Is there a way to selectively hide comments from rendering? I want to hide eg. ;; vi:fdm=marker and ;; a folded section {{{ that control vim's code folding.
ah, ok ... thanks for all that detail. I've learned stuff. On my particular issue, where I've landed is that I'll just shove the stuff that is extra foldable detail in a separate namespace then I don't need to see it in either clerk or vim. (It always takes me a while to figure out the simplest thing).
hi @rgm I fear we don’t have a mechanism yet to selectively turn off markdown parsing of comments. When the expression allows it, maybe you can try with #_ , like in #_ vi:fdm=marker but I think it won’t work with the curly braces.
On the other hand, you might try overriding the default renderer for markdown text nodes. In Clerk every markdown node has its own (customizable) renderer 🙂 That’d go in a notebook like:
(nextjournal.clerk/add-viewers! [(update nextjournal.clerk.viewer/markdown-viewer :add-viewers nextjournal.clerk.viewer/add-viewers
[{:name :nextjournal.markdown/text
:transform-fn (fn [{node :nextjournal/value}]
(clerk/html [:span (str/replace (:text node) #"(\{\{\{|\}\}\})" "")]))}])])
Or set it globally with (clerk/reset-viewers! :default (viewer/add-viewers [ … ]))