by dragonsh · 4y ago · 0 comments
In order to generate a print quality documentation from this markdoc format will be a huge task. RestructuredText already has strong support for Latex output.
Now people have plain markdown, gitbook and now markdoc with its own set of non standard extensions. Hopefully rst format can catch up among JavaScript developers.
So far haven’t seen a complete documentation tool like Python Sphinx [1].
[0] https://docutils.sourceforge.io/docs/ref/rst/restructuredtex...
As a former colleague liked to say, "The bar to authoring documentation needs to be so low you can trip over it."
Wikis have an incredibly low bar, and at some point making things easy leads directly to garbage-in-garbage-out disorganization.
Having docs go through the same linting and code review process (which should also be easy!) as code is the way forward for docs longer than a few pages.
Sphinx is excellent and batteries included for this sort of lint process.
Not to mention all the special-custom-component standards now which require code... the whole point of Markdown was you could just use any old text editor and be just as well off as looking at a prettified version.
You have the higher complexity and learning curve anyways, more, even.
I guess, the bad design decisions in RST are bad, but there are equally bad design decisions in all these new extensions, editors.
Instead of trying use a hammer put in screws, we should just change tooling. If you need document-level formatting etc., plain-text formatting is cool but don't try to be markdown. Use markdown when you just need simple text docs, if you find yourself doing complex stuff maybe you shouldn't be using markdown, or at least not calling yourself "markdown".
1. The specification for the syntax is decent but not really comprehensive. There's zero chance you could write a compatible implementation from it. To be fair this is true for the original Markdown but I think there's been a lot of effort to make fully defined versions (e.g. CommonMark), but...
2. The only implementation is the Python one. Frankly Python sucks. The Docutils code has no type annotations so good luck reading it, which you will have to do because...
3. The actual Docutils API is very badly documented. This is easily the biggest flaw. I have implemented a couple of custom directives for my company's docs and it was extremely frustrating to get it working. Pretty much down to using grep.app to search for examples of other random people that have figured it out.
So I would strongly recommend not using RST. I've been wondering what would be better for a while - normal Markdown is just not rich enough for good docs. This looks pretty nice though.
Latex output is nice, but not really super important in 2022 and definitely not worth the flaws of RestructuredText.
Do not use RestructuredText.
I say this as a (former) committer to docutils.
The LaTeX support is ok in rst if you want to create something similar to a Word document. If you actually wanted to print a book, you need to use something like my tool, rst2nitrile.
The Python documentation folks seem to be interested in abstracting Sphinx to markdown as well with MyST...
rst is a dead end at this point.