Closed alan-y closed 1 year ago
Looks good, and works fine for me. I wonder if we could replace the CSS file in the template folder with a symbolic link?
It seems to work on Posit Workbench (Linux), not sure if it will work on Windows though, and according to this git should be fine with it - https://mokacoding.com/blog/symliks-in-git/. It would just mean that you'd only ever have to edit the file at
inst/text
and the template one would mirror any changes.An alternative might be to call
add_stylecss
on the new directory, although the message output from that function might be a little confusing to the user.
Creating symbolic links requires elevated privelages so not possible for us. The other option is potentially doable - but if we don't include the css file with the Rmd template then a directory won't be created. This means when the template would open in temporary memory in RStudio and automating how to find the filepath for copying in the css file might be tricky.
Actually as the Rmd file must be knitted, I think we can just use getwd()
to find the path (I'm not 100% sure if this works in all circumstances or not). I've made some amendments so that the CSS file doesn't automatically open when you add it in.
After the CSS addin, finishing off with the HTML template. It would be good if you can give it a quick test and happy to take any suggestions. Thanks.