I'm building a new website with the {distill} package but am having trouble figuring out how to apply CSS to html_notebook files where I have contained my projects.
It's a bit difficult to figure out what the appropriate reprex is so I'll just try to specify code as much as possible - sorry.
Formerly I've been able to simply host notebooks by putting them in nb.html form and putting them in the website directory (like so, but I would like to apply custom CSS to them for this rebuild.
I have a project directory for my new website. The index.Rmd file is a distill website with a theme from the postcards package (ie, the YAML contains site: distill::distill_website and output: postcards::trestles) that I have customized with a css file listed in the _site.yml (using this code: theme: theme2.css). When I preview the website the index page looks fine.
I can successfully link to files from the index called, for example, "project.nb.html" with standard markdown, but the theme is not applied to them.
As recommended by the Markdown Cookbook, I tried instead converting those html_notebook files to html_documents that refer to a CSS style document, by modifying the YAML like so:
output: html_document: css: "projectstyle.css"
but this creates this error when I attempt to knit:
Error in yaml::yaml.load(..., eval.expr = TRUE) : Scanner error: mapping values are not >allowed in this context at line 2, column 22
likewise, using
output: html_notebook(css = "project.css")
creates this error when knitted:
Error: YAML output format must evaluate to a function
I also tried the distill::create_article() function to see if I could copy the contents of the notebook into one of those, but it was not ultra helpful, there does not appear to be a way to convert existing markdown files into distill articles unless I haven't found it yet!
Very thankful for any help anyone can suggest.