Live data from Hacker News

Markdown, Asciidoc, or reStructuredText – a tale of docs-as-code

dewanahmed.com

21–30 of 89 posts

Re: Markdown, Asciidoc, or reStructuredText – a tale of docs-as-code

#21
post #5

Markdown can simply be code - the fenced code blocks are quite enjoyable to work with. RMarkdown is this. Before I learned of RMarkdown I had written something to extract code blocks with filenames that are visible in the rendered page (since hiding it at the end of the first triple backquote codefence isn't great for visibility). I'm currently working on a JavaScript-centered notebook tool (rather than Python center…

> Markdown can simply be code - the fenced code blocks are quite enjoyable to work with.

Hmm, if a Markdown file can have code interspersed, then can't a code file have Markdown interspersed, and the two interpretations of the file could in some sense be symmetric - and equally valid ?

Obv such "interspersions" exist in certain implementations, but I don't think such symmetries do, nor is there anything like a "standard" for it.

Literate programming using Markdown - who'da thunk it ?

Someone pls correct me if I'm OTL.

Re: Markdown, Asciidoc, or reStructuredText – a tale of docs-as-code

#22
I've done a lot of research and testing with Markdown, Asciidoc, and reStructuredText to see which would work best for my company's documentation needs. We ended up going with Asciidoc and Antora for the following reasons.

Asciidoc:

* Almost as simple as Markdown.

* Less convoluted than reStructuredText.

* Excellent support for complex tables, captions, callouts, etc.

* We prefer Asciidocs table structure to Markdown's since it is easier to create and maintain.

* Excellent documentation.

Antora:

* Comes with a default template, which makes building prototypes easier.

* Ability to pull from multiple git repositories.

* Native Asciidoc support.

* Fast compile times.

* Good documentation.

Based on our research, I even migrated my personal 11ty sites from Markdown to Asciidoc and have been quite happy with it.

Re: Markdown, Asciidoc, or reStructuredText – a tale of docs-as-code

#23

I love Asciidoc, but the tooling is pretty crummy. It's not much fun to install and manage asciidoctor if you aren't into the ruby space, and pandoc doesn't take asciidoc as an input. Its the first I'm hearing of Antora though, so I'll be sure to check that out.

Antora is pretty nice for large documentation projects. For smaller projects, you may want to try 11ty and the Asciidoctor plugin: https://github.com/saneef/eleventy-plugin-asciidoc

Re: Markdown, Asciidoc, or reStructuredText – a tale of docs-as-code

#25
post #3

Points to the Markdown family for using mostly nice syntax. I mean the basics like lists, links, and headings look fine (I can do without the underlined headings or whatever they are called though). Markdown is nice for readmes and simple notes. Usage beyond that is not quite questionable to but debatable. Asciidoc seems to have a solid backend. But it seems to have a problem with nesting. Nesting things should be ta…

Does any of them make it easy to (a) define & use footnotes, and then (b) render the footnotes flexibly as a default, for example as either (b.1) end-of-page (in page-oriented physical formats) or (b.2) in Tufte-style side notes (in unpaged online formats) ?

Re: Markdown, Asciidoc, or reStructuredText – a tale of docs-as-code

#26
Last year we changed the source format for MDN from some extremely messy, WYSIWYG-authored HTML to something that would be easier for authors to use. We considered Asciidoc and reST, and despite its limitations, we chose Markdown (GFM specifically) for two reasons:

1. We get a _lot_ of casual contributors to MDN: about 180-200 unique contributors/month, most of whom we never see again. Almost all of them can contribute much more easily with Markdown than with anything else. Many of these people are unlikely to put even an half an hour into learning a new syntax.

2. Markdown has great tooling support. For example, if we want to run Prettier over our embedded code samples, it's really easy if we are in Markdown. If we are in Markdown we will get nice formatting just about everywhere, including GitHub of course and most people's editors.

One thing that made the choice easier for us is that MDN's a very mature doc site, so we had a very good idea of which Markdown limitations were likely to be a problem for us.

If you're interested, we blogged about this project: https://openwebdocs.org/content/posts/markdown-conversion/.

Re: Markdown, Asciidoc, or reStructuredText – a tale of docs-as-code

#27
Is it worth mentioning org-mode [0] and Racket's documentation system Scribble [1]. Docs as code and the tangle functionality in org-mode's Babel seem to fit right together. I am only familiar with Scribble by name.

[0] https://orgmode.org/manual/Working-with-Source-Code.html [1] https://docs.racket-lang.org/scribble/how-to-doc.html#%28par...

Re: Markdown, Asciidoc, or reStructuredText – a tale of docs-as-code

#28

I'm primarily a Python dev. I * hate* RST. I despise that it's really the only viable choice for docstrings in Python and wish for something rustdoc-like to be ported to Python

Same.

Good news though, the jupyter devs created myst (https://myst-parser.readthedocs.io/en/latest/syntax/syntax.h...), a superset of markdown that has almost all the features of rst, and can embed rst when it falls short.

And there is a plugin to use it with sphinx. It can even reside in a project that started with rst files, both format can coexist.

With this and sphinx-autoreload, writing doc is so much better.

Re: Markdown, Asciidoc, or reStructuredText – a tale of docs-as-code

#29
post #2

As I said on Twitter, this was a great article, but needs to mention Jekyll, which was one of the OG static site generators. There are others such as eleventy as well. I was kinda shocked that asciidoc came up as the recommended documentation solution; we use it and were looking to possibly make a move because of some of the warts (includes are great, but then make updating doc more complex, no one line ifdef check,…

Stripe’s Markdoc (markdoc.dev) is very promising.

Anything AsciiDoc can do, Markdoc can be extended to do, from variables through includes.

React or HTML output. AST transforms or functions. Upcoming editor support etc.

The community isn’t there yet but I predict it will show up.

Re: Markdown, Asciidoc, or reStructuredText – a tale of docs-as-code

#30

Last year we changed the source format for MDN from some extremely messy, WYSIWYG-authored HTML to something that would be easier for authors to use. We considered Asciidoc and reST, and despite its limitations, we chose Markdown (GFM specifically) for two reasons: 1. We get a _lot_ of casual contributors to MDN: about 180-200 unique contributors/month, most of whom we never see again. Almost all of them can contribu…

You made the right choice, rst is not user friendly, even for tech savvy people.

I'll take the opportunity to do a shameless plug for the amazing "Markedly Structured Text", or MyST, a markdown flavor that is both easy to write like markdown, and expressive like rst.

Basically, if you know markdown, you can write decent MyST already. In fact, any markdown is valid MyST and .md is a valid file extension for MyST.

Once you want more, the syntax offers richer construct, but still easy enough to use.

Check it out: https://myst-parser.readthedocs.io/en/latest/syntax/syntax.h...

I wanted to love asciidoc because the format rocks, but it never took off and the tooling is still lacking. MyST piggy back on markdown ecosystem, this is less of a problem.

Also, the devs behind it also have a very good track record at creating a good FOSS ecosystem.

Post reply on HN