Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove useless math workaround #119

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,9 @@ Encoding: UTF-8
RoxygenNote: 7.2.1.9000
Imports:
curl,
jsonlite,
memoise,
pkgdown (>= 2.0.9.9000),
purrr,
servr,
yaml,
xml2,
commonmark
yaml
Roxygen: list(markdown = TRUE)
Config/testthat/edition: 3
36 changes: 1 addition & 35 deletions R/build-site.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,7 @@ build_ropensci_docs <- function(path = ".", destination = NULL, install = FALSE,

navbar_config <- fixup_navbar_config(path)
if (!is.null(navbar_config)) {
override$navbar <- modifyList(override$navbar, navbar_config)
}

math_config <- get_math_rendering(path)
if (!is.null(math_config)) {
override$template$`math-rendering` <- math_config
override$navbar <- utils::modifyList(override$navbar, navbar_config)
}

find_and_fix_readme(path, pkgname)
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.

Loading