Skip to content

Commit e53f837

Browse files
authored
Merge pull request #5 from dmurdoch/move_js_to_src
Move the uncompressed source to src/mathjax.
2 parents 6820db7 + 6490d85 commit e53f837

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+25
-13
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
^docs$
66
^.*\.Rproj$
77
^\.Rproj\.user$
8+
^inst/doc/mathjax

inst/doc/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mathjax

src/install.libs.R

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
1-
message(getwd())
2-
3-
mjdir <- "../inst/doc/mathjax"
4-
5-
jsfiles <- list.files(mjdir, pattern = "[.]js$", recursive = TRUE)
6-
1+
srcdir <- "../src"
2+
destdir <- "../inst/doc"
3+
jsfiles <- list.files(srcdir, pattern = "[.]js$",
4+
recursive = TRUE)
5+
fontfiles <- list.files(srcdir, pattern = "[.]woff$",
6+
recursive = TRUE)
77
minify <- requireNamespace("js", quietly = TRUE)
8-
9-
if (minify) {
10-
for (f in jsfiles) {
11-
dir <- file.path(mjdir, dirname(f))
12-
mini <- js::uglify_files(file.path(mjdir, f), unused = FALSE)
13-
writeLines(mini, file.path(dir, basename(f)))
14-
}
8+
for (f in jsfiles) {
9+
dir <- file.path(destdir, dirname(f))
10+
if (!dir.exists(dir))
11+
dir.create(dir, recursive = TRUE)
12+
if (minify) {
13+
mini <- js::uglify_files(file.path(srcdir, f), unused = FALSE)
14+
writeLines(mini, file.path(dir, basename(f)))
15+
} else
16+
file.copy(file.path(srcdir, f),
17+
file.path(destdir, f))
1518
}
19+
for (f in fontfiles) {
20+
dir <- file.path(destdir, dirname(f))
21+
if (!dir.exists(dir))
22+
dir.create(dir, recursive = TRUE)
23+
file.copy(file.path(srcdir, f),
24+
file.path(destdir, f))
25+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)