webpro / reveal-md

reveal.js on steroids! Get beautiful reveal.js presentations from any Markdown file
MIT License
3.74k stars 416 forks source link

Added support for json5 config files #464

Closed MartenBE closed 11 months ago

MartenBE commented 1 year ago

This adds support for json5 files. This allows comments in the reveal.json and reveal-md.json config files. Following files will be read in this order:

  1. reveal.json5 and reveal-md.json5
  2. If the json5 files haven't been found, reveal.json and reveal-md.json will be read just like reveal-md already did. This allows for backward comptability.
webpro commented 11 months ago

Personally I find it a bit much for reveal-md to support JSON5, but fine :)

MartenBE commented 11 months ago

It's only because I have a template repository for colleagues and I wanted to include options with comments in the config files to explain to them what is advised to change (or not) and where they can find some resources. Somehow including comments in the JSON-files made reveal-md fail to run. It also cursed with prettier in vs-code. I looked it up and there was jsonc and json5, but json5 seemed the better fit as it is standardized to make reveal-md work with comments in the json files and to simplify editor support in those cases.

It is a very niche case, I totally admit, but it would help me (and maybe others) so I appreciate the time you took to merge :) !

webpro commented 11 months ago

I knew you had a good reason to create the pull request, thanks for taking the time to implement and explain it. In this case it's not a big deal, but the time (cost) to review and merge is often much, much less than the responsibility I take upon me after the fact.