pkgdown
pkgdown copied to clipboard
math in README
Fix #2261 See also #2262 (would better be done in a separate PR)
I got a bit stuck trying to test this as it was hard for me to catch the Pandoc error in a test (it appeared in the log but I could not catch it :sweat_smile:) hence the new Pandoc option for making warnings failures.
In any case the whole point is adding --mathjax
to the Pandoc call.
Hi Maelle, FYI I'm still unable to render $\sqrt{x}$ in https://cthombor.github.io/SafeVote/; but I do have another clue which might help localise the defect... or perhaps just indicates that a repair is still in the process of being deployed!
Using devtools::check_rhub() today, I got a couple of notes:
❯ checking HTML version of manual ... [11s] NOTE Skipping checking math rendering: package 'V8' unavailable
❯ checking for detritus in the temp directory ... NOTE Found the following files/directories: 'lastMiKTeXException'
I don't find a copy of lastMiKTeXException in my check_rub() results
the fix is in this branch only for now :-)
@maelle Pandoc's --mathjax
option optionally allows to specify a URL pointing to the MathJax assets to be used. If none is provided (like in your current PR),
a link to the Cloudflare CDN will be inserted.
This is kinda detrimental to the goal of https://github.com/r-lib/pkgdown/pull/2249. 😐
Furthermore, I don't quite understand why the README is treated differently than articles/vignettes... pkgdown already includes MathJax assets, so it should really be possible to use the same approach to build both the README and articles/vignettes (where inline math is properly rendered), no?
@maelle Pandoc's --mathjax option optionally allows to specify a URL pointing to the MathJax assets to be used. If none is provided (like in your current PR),
This is kinda detrimental to the goal of https://github.com/r-lib/pkgdown/pull/2249. neutral_face
Good to know, thank you! I guess that if we keep this option, we'll need to add the URL then.
Furthermore, I don't quite understand why the README is treated differently than articles/vignettes... pkgdown already includes MathJax assets, so it should really be possible to use the same approach to build both the README and articles/vignettes (where inline math is properly rendered), no?
The big difference is that vignettes/articles are knit whereas the README is not. Now, it does not mean approaches can't be aligned somehow. :sweat_smile:
Probably worth digging into how RMarkdown sets the --mathjax
argument so we can make sure to align.
🚀 Deployed on https://664275b6275d192272162b4a--pkgdown-dev.netlify.app
@maelle can you please take another look at this? I just tweaked the way that you test the code, adding some future looking support to make it easier to modify existing pkgdown test sites.