I'm collaborating on a website rendered through blogdown and GitHub Pages. Our experience has been great so far, but we've run into one small hiccup:
We have a local copy of a Lua filter that we'd like to pass our Rmds through before knitting, using the pandoc_args: "--lua-filter=PATH/TO/filter.lua" YAML header. The filter is saved in a subfolder of the project directory.
However, when any of us tries to write the path as a relative path, with the project directory as the current directory, Pandoc fails to find the filter file.
On one person's machine we can get around the relative path failure by using the $HOME shell environment variable to absolute-path to the Lua filter, but this doesn't generalize to other collaborators' machines if the folder(s) containing the project directory on their computers aren't the same.
When R Markdown calls Pandoc, where is the working directory? And can we change the Pandoc working directory so that relative paths to Lua filters will work across machines?
(All collaborators are on Macs. I at least have Mojave installed, with R 3.6.1, pandoc 2.9.2, rmarkdown 2.3, blogdown 0.20.)
Thank y'all for your help! Please let me know what additional info you might need.
I think pandoc will run from where the Rmd file is rendered, like classic rmarkdown rendering: the document folder. As a global solution, it is better to use absolute path in this case.
With a combination of here to create full path from a project dir, working for everyone, and r expression in yaml header, I think it could work.
It took a little bit of brain wiggling to realize that while pandoc_args: takes a vector specified with hard brackets, !expr will pass a correctly formatted character vector if you use c() to stitch together your args instead:
For --no-highlight, you should be able to use highlight = NULL in the html_document or pdf_document function. It will pass the correct argument to pandoc.