ncase / covid-19

COVID-19 Futures, Explained With Playable Simulations
Creative Commons Zero v1.0 Universal
233 stars 106 forks source link

Parsing markdown (pandoc or other tools?) #30

Open pietroppeter opened 4 years ago

pietroppeter commented 4 years ago

In order to do finalize a translation we will need to parse the markdown in words.md into html. I was expecting that pandoc would work out of the box but apparently this is not the case. I was able to get what appears to be a good parsing (with footnotes) using the following:

 pandoc --from markdown_strict+footnotes words\words.md -o words\words.html

This was supposed to work but did not work for me.

pandoc --from markdown-markdown_in_html_blocks+raw_html words\words.md -o words\words.html

For the above recipes see discussion here: https://stackoverflow.com/questions/39220389/embed-indented-html-in-markdown-with-pandoc

In order for the above to work correctly I had also to substitute . . . with <p>. . .</p> in words.md.

Are there any better solutions out there? Would be worthwhile adding something like this to the how-to-translate instructions?

Awesome work btw!

vrruiz commented 4 years ago

I'm using MacDown in Mac and I export from there. Ghostwriter in Linux doesn't support footnotes.

pietroppeter commented 4 years ago

We added to our Italian translation (#3) repo, a build command that streamlines the update of index.html (it calls pandoc with appropriate parameters and manages automatically the cut and paste inside article). It seems to be working fine.

Since it might be useful for other, you find it here with discussion on how to use it here.

harisont commented 4 years ago

I would like to add a tip: if you install pandoc (especially if just for this project, but once you install it you will probably want to have it forever anyway), just get the binaries. Compiling it requires an unreasonable amount of dependencies (and time).