Skip to content

Commit

Permalink
Simplified minification build process (and to avoid R CMD check note).
Browse files Browse the repository at this point in the history
  • Loading branch information
wviechtb committed Jan 30, 2021
1 parent aac5417 commit 6820db7
Show file tree
Hide file tree
Showing 65 changed files with 18 additions and 31 deletions.
1 change: 0 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
^docs$
^.*\.Rproj$
^\.Rproj\.user$
^inst/doc/mathjax
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: mathjaxr
Version: 1.1-2
Date: 2021-01-29
Version: 1.1-3
Date: 2021-01-30
Title: Using 'Mathjax' in Rd Files
Authors@R: person(given = "Wolfgang", family = "Viechtbauer", role = c("aut","cre"), email = "[email protected]", comment = c(ORCID = "0000-0003-3463-4063"))
Description: Provides 'MathJax' and macros to enable its use within Rd files for rendering equations in the HTML help files.
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# mathjaxr 1.1-2 (2021-01-29)
# mathjaxr 1.1-3 (2021-01-30)

* upgraded MathJax version to 3.1.2

* MathJax is now bundled with non-minified js files
* MathJax is now bundled with non-minified javascript files; upon installation from the source package, the javascript files are minified if the `js` package is available

* `preview_rd()` now tries to load any package-specific macros before rendering a help page

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mathjaxr: Using Mathjax in Rd Files

[![R build status](https://github.com/wviechtb/mathjaxr/workflows/R-CMD-check/badge.svg)](https://github.com/wviechtb/mathjaxr/actions)
[![CRAN Version](https://www.r-pkg.org/badges/version/mathjaxr)](https://CRAN.R-project.org/package=mathjaxr)
![devel Version](https://img.shields.io/badge/devel-1.1--2-brightgreen.svg)
![devel Version](https://img.shields.io/badge/devel-1.1--3-brightgreen.svg)

## Description

Expand Down
1 change: 0 additions & 1 deletion inst/doc/.gitignore

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 13 additions & 24 deletions src/install.libs.R
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
message(getwd())
srcdir <- "../javascript"
destdir <- "../inst/doc"
jsfiles <- list.files(srcdir, pattern = "[.]js$",
recursive = TRUE)
fontfiles <- list.files(srcdir, pattern = "[.]woff$",
recursive = TRUE)
minify <- requireNamespace("js")
for (f in jsfiles) {
dir <- file.path(destdir, dirname(f))
if (!dir.exists(dir))
dir.create(dir, recursive = TRUE)
if (minify) {
mini <- js::uglify_files(file.path(srcdir, f), unused = FALSE)
writeLines(mini, file.path(dir, basename(f)))
} else
file.copy(file.path(srcdir, f),
file.path(destdir, f))

mjdir <- "../inst/doc/mathjax"

jsfiles <- list.files(mjdir, pattern = "[.]js$", recursive = TRUE)

minify <- requireNamespace("js", quietly = TRUE)

if (minify) {
for (f in jsfiles) {
dir <- file.path(mjdir, dirname(f))
mini <- js::uglify_files(file.path(mjdir, f), unused = FALSE)
writeLines(mini, file.path(dir, basename(f)))
}
}
for (f in fontfiles) {
dir <- file.path(destdir, dirname(f))
if (!dir.exists(dir))
dir.create(dir, recursive = TRUE)
file.copy(file.path(srcdir, f),
file.path(destdir, f))
}

0 comments on commit 6820db7

Please sign in to comment.