假设我有一个目录,其中包含两个 Markdown 文件
a note.md
another one.md
与
a note.md
包含
Here is a description of an idea.
![[another one.md]]
和
another one.md
包含
Here is another idea related to it.
我正在 bash 中寻找一个可以实现的命令
a note.md
,![[another one.md]]
中的引用 a note.md
替换为 another one.md
中的实际内容,并且 此示例中的输出将包含
Here is a description of an idea.
Here is another idea related to it.
为什么? Obsidian Markdown 笔记应用程序允许使用 ![[]]
将文件内容
嵌入到 Markdown 文件中,如上所述。但是,当使用 Pandoc 转换此类文件时,引用将被视为文本。所以我正在寻找一种在 Pandoc 转换之前添加嵌入内容的方法。
perl -pe 's/!\[\[(.*?)]]/`cat "$1"`/eg' "a note.md"