Skip to content

Commit

Permalink
chore: remove useless math workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle committed Oct 8, 2024
1 parent 49d51d2 commit 9d2ecee
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 85 deletions.
34 changes: 0 additions & 34 deletions R/build-site.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ build_ropensci_docs <- function(path = ".", destination = NULL, install = FALSE,
override$navbar <- modifyList(override$navbar, navbar_config)
}

math_config <- get_math_rendering(path)
if (!is.null(math_config)) {
override$template$`math-rendering` <- math_config
}

find_and_fix_readme(path, pkgname)

# Prevent favicon building
Expand Down Expand Up @@ -147,35 +142,6 @@ fixup_navbar_config <- function(path) {

}

# we need this to keep supporting the old syntax we had set up
# TODO: PR to packages using it so we can remove those lines!
get_math_rendering <- function(path){

pkgdown_yml <- pkgdown_config_path(path = path)

if (is.null(pkgdown_yml)) {
return(NULL)
}

pkgdown_config <- yaml::read_yaml(pkgdown_yml)

if (is.null(pkgdown_config)) {
return(NULL)
}

math_rendering <- pkgdown_config$template$`math-rendering`
if (!is.null(math_rendering)) {
return(math_rendering)
}

if(isTRUE(pkgdown_config$mathjax) || isTRUE(pkgdown_config$template$params$mathjax)){
return("mathjax")
}

return(NULL)

}

find_and_fix_readme <- function(path, pkg){
# From pkgdown build_home_index()
home_files <- file.path(path, c("index.Rmd", "README.Rmd", "index.md", "README.md"))
Expand Down
51 changes: 0 additions & 51 deletions tests/testthat/test-mathjax.R

This file was deleted.

0 comments on commit 9d2ecee

Please sign in to comment.