NewGraphEnvironment / fpr

Fish Passage Reporting functions for British Columbia
http://www.newgraphenvironment.com/fpr/
Other
2 stars 2 forks source link

`fpr_kable` double Table #s , black font in captions in dark mode and `pagedown` build reference errors #68

Closed NewGraphEnvironment closed 3 months ago

NewGraphEnvironment commented 3 months ago

image

This error does not occur when only Table 1.1 is built

processing file: mybookdown_template.Rmd

output file: mybookdown_template.knit.md

/Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/pandoc +RTS -K512m -RTS mybookdown_template.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output mybookdown_template.html --lua-filter /Users/airvine/Library/R/arm64/4.3/library/bookdown/rmarkdown/lua/custom-environment.lua --lua-filter /Users/airvine/Library/R/arm64/4.3/library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /Users/airvine/Library/R/arm64/4.3/library/rmarkdown/rmarkdown/lua/latex-div.lua --metadata-file /var/folders/mg/h910y2c54fsc99qj74dyrjph0000gn/T//RtmppGBSO4/file10399365cb01d --embed-resources --standalone --wrap preserve --lua-filter /Users/airvine/Library/R/arm64/4.3/library/pagedown/resources/lua/uri-to-fn.lua --lua-filter /Users/airvine/Library/R/arm64/4.3/library/pagedown/resources/lua/loft.lua --lua-filter /Users/airvine/Library/R/arm64/4.3/library/pagedown/resources/lua/footnotes.lua '--mathjax=https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --metadata newpage_html_class="page-break-after" --section-divs --table-of-contents --toc-depth 1 --template /Users/airvine/Library/R/arm64/4.3/library/pagedown/resources/html/paged.html --highlight-style pygments --number-sections --css style-pagedown.css --css default-page-custom.css --include-in-header /var/folders/mg/h910y2c54fsc99qj74dyrjph0000gn/T//RtmppGBSO4/rmarkdown-str10399389385da.html --citeproc 

Output created: mybookdown_template.html
Warning: A runtime exception has occured while executing JavaScript
  Runtime exception message:
    ReferenceError: $ is not defined
    at http://127.0.0.1:5454/mybookdown_template.html:32159:9
Warning: A runtime exception has occured while executing JavaScript
  Runtime exception message:
    ReferenceError: jQuery is not defined
    at http://127.0.0.1:5454/mybookdown_template.html:33062:3
[1] TRUE

may be related to https://github.com/NewGraphEnvironment/fpr/issues/30

lucy-schick commented 3 months ago

similar issue here https://github.com/rstudio/pagedown/issues/182#issuecomment-668892654

NewGraphEnvironment commented 3 months ago

i can confirm it is an issue with kableExtra:: calls. was tipped off by this https://github.com/jhelvy/renderthis/issues/46

I will keep narrowing it down and trying to fix

We also now have black font showing in table captions when the reports are served in Dark mode which is also new and unfortunate. this could be a bit of a large mess to untangle with so many tables already on the street. oh gee

NewGraphEnvironment commented 3 months ago

adding this removes the warning ReferenceError: $ is not defined but not the doubling of Table headers and the black font in dark mode.

We have at least two separate issues

chunk ``` {r jquery, echo=FALSE, eval=T} htmltools::tagList(rmarkdown::html_dependency_jquery()) triple_backtick ```

NewGraphEnvironment commented 3 months ago

Phew.

Have dealt with double table captions in function with addition of label = NA in knitr::kable(caption = caption_text, booktabs = T, label = NA)

Issue with black text in dark mode has been dealt with in develpment version of kableExtra so can be imported with

pak::pkg_install("haozhu233/kableExtra")  

Gee wiz. Will close with label=NA fix

lucy-schick commented 3 months ago

thank you for fixing all this!