Hacker News new | ask | show | jobs
by dqv 505 days ago
Any Markdown implementation which allows for custom directives and is CommonMark-compliant is good enough for me.

MyST, for example, lets you do

    :::{makeup-highlight}
    :lang: elixir
    defmodule A do
      def b, do: :ok
    end
    :::

    :::{pygments-highlight}
    :lang: python
    class B:
        pass
    :::
Since MyST has intermediaries that just give you an AST, you have a lot more extensibility using directives and roles to do special things (including includes). You can of course just use MyST proper, but getting to transform the AST myself how I see fit is a big win in my eyes. Pandoc does have AST and all that too, but MyST's implementation strikes the best balance for me.
2 comments

AsciiDoctor also has an AST intermediary which can be used by plugins/extensions.
Does anyone know a JS renderer that supports custom directives?
markdown-it?