Handling Markdown in Notes/Domino
Daniel Nashed – 1 May 2025 19:13:54
Markdown is a simplified format which many modern applications support.
All GitHub projects use Markdown. LLMs return formatted text in Markdown.
There are multiple formats. The standard format is CommonMark, which supports extensions.
One of the most well known extension is Git Flavored Markdown (GFM).
Markdown -> CommonMark
https://commonmark.org/
https://github.com/commonmark/cmark
GitHub Flavored Markdown Spec
https://github.github.com/gfm/#tables-extension-
GitHub provides a way to convert Markdown via a REST API
curl -X POST -H "Content-Type: application/json" -d '{"text":"# Hello World", "mode":"gfm"}' https://api.github.com/markdown
Pandoc is an interesting tool
Pandoc is one of the best tools
pandoc -f html -t markdown hello.html
Flexmark
But the best way currently is Flexmark which is also used by the Domino REST API
https://github.com/vsch/flexmark-java
There is also a C implementation. But the Java Lib can be integrated in applications.
I implemented a Java Script Lib converting Markdown to HTML.
How to best store Markdown and HTML?
Multipart MIME is a good format to store multiple formats
- text/plain
- text/html
The plain text can be used later to edit it in markdown and convert it again.
For now this sounds like the best way to store Markdown and HTML.
This would be future proof and can be permanently stored natively in Notes documents.
HTML does not have a CSS out of the box
Converting from Markdown to HTML is pretty straightforward.
The bigger challenge is formatting the HTML with a proper CSS.
The full GitHub CSS for Markdown is not compatible with Notes.
For now I am using a simple CSS which looks pretty OK.
But there is room for improvements and we are still working on it.
Once we found better CSS we can reconvert the documents any time.
We still have the original Markdown in the plain text representation and can apply any CSS.
There is still work to do for the CSS part. But this is already a good first step.
- Comments [0]