In case there are other R users out there, I thought I would share how to convert Obsidian Markdown to .html, .docx, .pdf etc. It has come in handy a few times to share notes with team members who don’t work in Obsidian.md
The rmarkdown() library is used for the pandoc conversion functions.
These examples convert a single .md to a single .html - the .docx example saves the converted file to another directory.
If you want to convert multiple files into a single document you can use the c(“file1.md”, “file2.md”, “file3.md”…) format. You could make this more sophisticated by creating a vector with all the .md files in a directory or a loop to convert multiple files separately etc.
library(rmarkdown)
#HTML
pandoc_convert(“U:/ObsidianNotesFolder/Team/2020-10-06.md”,
to=“html”,
output=“20201006.html”)
#PDF
pandoc_convert(“U:/ObsidianNotesFolder/Team/2020-10-06.md”,
to=“pdf”,
output=“20201006.pdf”)
#docx saved to a Temp directory
pandoc_convert(“U:/ObsidianNotesFolder/Team/2020-10-06.md”,
to=“docx”,
output=“C:/Temp/2020-10-06.docx”)
#epub
pandoc_convert(“U:/ObsidianNotesFolder/Team/2020-10-06.md”,
to=“epub”,
output=“20201006.epub”)