Skip to content

Commit

Permalink
Get things ready for submission to CRAN.
Browse files Browse the repository at this point in the history
  • Loading branch information
wviechtb committed Jan 30, 2021
1 parent e53f837 commit ab9b650
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 25 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: mathjaxr
Version: 1.1-3
Version: 1.2-0
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"))
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# mathjaxr 1.1-3 (2021-01-30)
# mathjaxr 1.2-0 (2021-01-30)

* upgraded MathJax version to 3.1.2

Expand Down
9 changes: 6 additions & 3 deletions 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--3-brightgreen.svg)
![devel Version](https://img.shields.io/badge/devel-1.2--0-brightgreen.svg)

## Description

Expand Down Expand Up @@ -47,18 +47,21 @@ where ![\mu](https://render.githubusercontent.com/render/math?math=%5Cmu) denote

## Installation

The current official (i.e., [CRAN](https://cran.r-project.org/package=mathjaxr)) release can be installed directly within R with:
The current official (i.e., [CRAN](https://cran.r-project.org/package=mathjaxr)) release can be installed within R with:

```r
install.packages("mathjaxr")
```

After installing the [remotes](https://cran.r-project.org/package=remotes) package with ```install.packages("remotes")```, the development version of the `mathjaxr` package can be installed with:
The development version of the package can be installed with:

```r
install.packages("remotes")
remotes::install_github("wviechtb/mathjaxr")
```

This builds the package from source based on the current version on [GitHub](https://github.com/wviechtb/mathjaxr).

## Meta

The `mathjaxr` package is licensed under the [GNU General Public License Version 3](https://www.gnu.org/licenses/gpl-3.0.txt), while MathJax itself is licensed under the [Apache License, Version 2.0](https://github.com/mathjax/MathJax/blob/master/LICENSE). To report any issues or bugs, please go [here](https://github.com/wviechtb/mathjaxr/issues).
41 changes: 21 additions & 20 deletions src/install.libs.R
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
srcdir <- "../src"
srcdir <- "../src"
destdir <- "../inst/doc"
jsfiles <- list.files(srcdir, pattern = "[.]js$",
recursive = TRUE)
fontfiles <- list.files(srcdir, pattern = "[.]woff$",
recursive = TRUE)

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

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

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))
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))
}
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 ab9b650

Please sign in to comment.