Chilipp / sphinx-nbexamples

⛔️ Deprecated: Create an examples gallery with sphinx from Jupyter Notebooks
MIT License
15 stars 11 forks source link

README.md files are not rendered correctly #3

Closed effigies closed 5 years ago

effigies commented 5 years ago

If a directory has a README.md file sphinx-nbexamples will try to use it, but links and other markup will not be correctly rendered. One option would be to try using m2r if available.

Chilipp commented 5 years ago

Dear @effigies, thanks for your report! Yes, indeed, this is not how it should work. I don't know m2r personally, but my suggestion would be to simply use pandoc for the conversion, since this is anyway a requirement for sphinx-nbexamples (actually I should mention this in the docs).

The idea would be to include something like

fname, ext = os.path.splitext(readme_file)
if ext in ['.md', '.markdown']:
    spr.check_cal(['pandoc', readme_file, '-o', fname + '.rst'])

What do you think of it?

effigies commented 5 years ago

That seems perfectly reasonable to me.