Obsidian reader extensions for comments and wikilink transclusions#11135
Obsidian reader extensions for comments and wikilink transclusions#11135kepano wants to merge 2 commits into
Conversation
|
Transclusion should be possible. See |
|
@jgm I think this is in a good place for your review now. Some notes:
|
479d5f1 to
7b2638d
Compare
|
Can you rebase this into one commit, or a few logically coherent commits? All API changes should be clearly described and marked as such |
626148c to
dbd8cdf
Compare
dbd8cdf to
ad204c0
Compare
Done! |
|
Re |
|
Does |
|
Hello, thanks for working on it. What about Obsidian callouts? Do you think those are doable also? |
|
@jgm Thanks for the update. I saw a notification from you about other requested changes on #9883 but it seems you removed that comment. Is there something else you want me to work on?
They are indeed transclusions, not links. The content within the source block or heading is transcluded into the document. See also this documentation page about embeds. In Obsidian-Flavored Markdown adding an exclamation mark
I'll check and add tests for this.
Callouts are already handled by the |
|
@kepano Should transclusions perhaps add a class to the transcluded content? Obsidian detects transcluded content and adds classes (such as "markdown-embed-content" if the embed is a heading or Markdown block), and uses that to display it differently (like a specially styled blockquote, with a link icon that leads to the embedded content), but in this implementation there's no way to differentiate regular content from transcluded content - it's all just one flat Pandoc document. So if one were to export an Obsidian note with a transclusion in it to PDF/TeX or HTML using this extension, the information about the fact that this is a transclusion is lost, and the result can't be styled to look like the Obsidian note. |
Add Obsidian-Flavored Markdown #9883 using Markdown extensions.
Extensions
comments: Parses%%text%%as comments (removed from output)wikilink_transclusions: Parses![[Title]]for full file transclusionwikilink_heading_transclusions: Parses![[Title#Heading]]for heading transclusionswikilink_block_transclusions: Parses![[Title#^id]]for block transclusionsblock_ids: Parses^idat paragraph end, wraps paragraph inDivwith that IDUses
insertIncludedFilefor transclusion.Includes tests and manual updates.