Closed jeroen closed 2 years ago
One idea. Adding a fewlines after https://github.com/ropensci-org/rotemplate/blob/4c5a93c826fcae7ea3f8a038834a5fdb8de15d1f/R/build-site.R#L38 that, if the code is run in a test, write out the pkgdown object somewhere so we could check it has what we expect. Or, some tests on the resulting website.
The problem was that somehow, even if I was manually setting pkg$meta$template$mathjax <- TRUE
the resulting site somehow still didn't have mathjax. I have no idea why.
I think the best way to test is the same as the unit tests in pkgdown itself: create a dummy package in tests
that exercises some common problems with out template, and then add a unit test that runs build_ropensci_docs()
on that package and then checks the output html if mathjax is there.
Apparently the boostwatch thing is broken again 😢 https://github.com/r-universe/ropensci/runs/4873291211?check_suite_focus=true
Any comment on #79? After a first review I can add tests for "the bootswatch thing". :grin:
Our wrapper needs to overwrite the
template:params
however I keep breaking one case when fixing another.It seems that if we pass a list() in our overrides, the params merge (instead of replace) the ones from the
_pkgdown.yml
. In this scenario we get an error like here.So instead I tried to set
params=NULL
in our overrides and manually set mathjax = TRUE later in the wrapper, but then I found out this had broken our mathjax docs again.So now I reverted it again, but we really need unit tests that test at least these two scenarios.