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.
I wonder if it would preserve the linking system from Obsidian? I know when converting from OneNote to epub the links are preserved, but I wasn’t sure for Obsidian. It’s nice to have all of the links in tact on a tablet. Any thoughts?
A couple quick questions for those with more experience:
Can this be done via a CLI? Or do I need to launch RStudio every time? If so, how? I’d appreciate any help, as I’d like to not having to open rstudio every time I’d want to perform a conversion.
Can it insert citations from a bib-file and still have them render correctly?)
Can it include images? The Obsidian-Pandoc-plugin is currently unable to insert images into its output.
Do I need to care about image locations being in a relative path? Can it be in the vault’s global asset-folder?