I have about four more libraries coming out soon. (And corresponding videos.)
So, I'm wanting to create for myself a "best practice" for writing books and/or docs with as much efficiency as possible. To that end, I'm doing the following to get some of the RST files from Nim's built in doc service:
#!/bin/bash
nim doc src/example.nim
pandoc --from=html --to=rst --output=docs/example.rst example.html
rm example.html
Pandoc does convert the html to RST. But it isn't pretty as the HTML has lots of trappings that don't convert well to RST. The irony, of course, is that the Nim is getting the ## comments in source in the RST format in the first place, then generating the HTML.
Before I go coding my own solution; I thought I'd ask: is there a known utility that does what I'm looking for in a better way?
(In case anyone asks: going from RST source to epub, mobi, Amazon self-pub, readthedocs.org, etc is far easier than from HTML. HTML is great, but it makes far too many styling decisions.)
If nothing else, I'll probably use nim jsondoc to get something more parsable and roll my own solution. But I wanted to ask first.
- the description fields are not converted to html
- (bonus) it also parses the main documentation not associated with a type/method/etc, perhaps an entry of type "main".
I've already got so many projects in progress already. But perhaps I could add just one more...