webpro/reveal-md

JSON configuration files not found when targeting markdown files outside the current directory

Septaris opened this issue · 1 comments

Description

The reveal-md.json and reveal.json configuration files are only loaded if they are located in the current working directory. This creates an issue for users who wish to target a Markdown file that is located outside the current directory. In this scenario, the configuration files will not be found and loaded, resulting in default settings being used.

Proposal

To address this issue, the code in lib/config.js should be modified to search for the configuration files in the same directory as the target Markdown file or in the given directory (if a directory is used as CLI argument). This would allow users to specify the location of the configuration files regardless of their current working directory.

Steps to Reproduce

  1. Place a Markdown file in a directory other than the current working directory.
  2. Try to run reveal-md on this Markdown file.
  3. Observe that the reveal-md.json and reveal.json configuration files are ignored, resulting in default settings being used.

Expected Result

The configuration files should be found and loaded, regardless of the location of the target Markdown file.

Actual Result

The configuration files are only found and loaded if they are located in the current working directory.

Yeah that's a known issue/feature. Keep everything together, or start reveal-md from a higher/common dir.