Markdown and its different flavours have a number of interesting extensions, notably the [
hl_lines attribute], which allows to highlight specific lines in a fenced code block, as illustrated here and here. This feature has actually been implemented in ox-hugo (export of org to Hugo-compatible markdown) by "hacking the
What I am trying to do is the following:
1. specify arbitrary attributes in a code block
I can't find anything in the documentation for org-mode or emacs about adding arbitrary attributes to a code block through some kind of header. The kind of syntax I would have expected:
#+begin_src python attr:"hl_lines='2'"
#+begin_src python :hl_line "2"
#+attr_markdown: :hl_lines 2 #+begin_src: python
2. export an org file to Markdown (either through
commonmark/etc.) in a way that keeps the attributes
pandoc does not support
hl_lines, and cuts off anything that comes after
#+begin_src python .... when exporting (tried both from emacs and from the pandoc CLI).
To be clear, I am trying to find a solution in
pandoc to avoid having to deal with the many idiosyncrasies of
org-md-export-to-markdown I have to face with my specific files.
3. deploy the Markdown files through a service that can understand the
This last step is solved.
Is implementing this feature in
pandoc the only way or is there some workaround I haven't found?