Skip to content

Commit

Permalink
Merge pull request #5 from dmurdoch/move_js_to_src
Browse files Browse the repository at this point in the history
Move the uncompressed source to src/mathjax.
  • Loading branch information
wviechtb authored Jan 30, 2021
2 parents 6820db7 + 6490d85 commit e53f837
Show file tree
Hide file tree
Showing 62 changed files with 25 additions and 13 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
^docs$
^.*\.Rproj$
^\.Rproj\.user$
^inst/doc/mathjax
1 change: 1 addition & 0 deletions inst/doc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mathjax
36 changes: 23 additions & 13 deletions src/install.libs.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
message(getwd())

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

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

srcdir <- "../src"
destdir <- "../inst/doc"
jsfiles <- list.files(srcdir, pattern = "[.]js$",
recursive = TRUE)
fontfiles <- list.files(srcdir, pattern = "[.]woff$",
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 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))
}
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))
}
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit e53f837

Please sign in to comment.