fralau / mkdocs-macros-plugin

Create richer and more beautiful pages in MkDocs, by using variables and calls to macros in the markdown code.
https://mkdocs-macros-plugin.readthedocs.io
Other
321 stars 50 forks source link

Support for json for extra data files #138

Closed arnaudsylvestre closed 2 years ago

arnaudsylvestre commented 2 years ago

Hello and thanks for this plugin !

Only yaml files can be included thanks to include_yaml. Is it possible to add include_json ?

Thanks in advance

github-actions[bot] commented 2 years ago

Welcome to this project and thank you!' first issue

fralau commented 2 years ago

You're welcome. Could you describe your use case more in detail? (i.e. why you have this constraint of json files?)

I would see two possible routes:

  1. Convert your json files into yaml (depending on the circumstances, this might or might not be simple)
  2. Load the json files directly from the module (in define_env()). Writing the Python code for loading the json file and updating the variables dictionary should be straightforward.
arnaudsylvestre commented 2 years ago

Thank you for your quick answer.

I think I will take the second route by writing a module directly in python !