jgm / pandoc

Universal markup converter
https://pandoc.org
Other
33.12k stars 3.3k forks source link

Obsidian Flavored Markdown reader/writer #9883

Open kepano opened 1 week ago

kepano commented 1 week ago

Describe your proposed improvement and the problem it solves.

Add a reader and writer for Obsidian Flavored Markdown. Obsidian Flavored Markdown combines features from CommonMark, GitHub Flavored Markdown and LaTeX, as well as several extensions inspired by wiki markup.

Syntax Description
[[Link]] Internal links
![[Link]] Embed files
![[Link#^id]] Block references
^id Defining a block
%%Text%% Comments
~~Text~~ Strikethroughs
==Text== Highlights
``` Code blocks
- [ ] Incomplete task
- [x] Completed task
> [!note] Callouts
(GFM syntax) Tables

Describe alternatives you've considered.

Most of these extensions exist in one form or another within Pandoc, but it seems like it would be convenient to bundle them all together in a way that makes converting to/from Obsidian files easier. I'd like to explore implementing this myself, but wanted to first gauge interest.

jgm commented 1 week ago

I think we already have all the needed extensions, except for [^id] for defining a block (and similarly "block references") and comments. So, if these things were implemented, one could easily package obsidian flavored markdown as a set of extensions on top of commonmark.

jgm commented 1 week ago

Note that to make these extensions on top of commonmark, one would have to add modules to commonmark-extensions. This parsing work would not be done in pandoc itself, though support for the new features in the writer would have to be done in pandoc's markdown writer.