Public-Health-Scotland / phstemplates

Standard R templates and project structure for Public Health Scotland (https://public-health-scotland.github.io/phstemplates/)
Other
19 stars 6 forks source link

PHS HTML template #69

Closed alan-y closed 1 year ago

alan-y commented 1 year ago

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.

alan-y commented 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.

alan-y commented 1 year ago

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.