-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
130 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
^CRAN-RELEASE$ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ | ||
^\.travis\.yml$ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
Package: rmdfiltr | ||
Type: Package | ||
Title: Lua filters for R Markdown | ||
Version: 0.1.0 | ||
Title: 'Lua' filters for R Markdown | ||
Version: 0.1.2 | ||
Authors@R: c( | ||
person("Frederik", "Aust", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-4900-788X")) | ||
) | ||
URL: https://github.com/crsh/rmdfiltr | ||
BugReports: https://github.com/crsh/rmdfiltr/issues | ||
Description: Provides a collection of Lua filters that extend the functionality | ||
of R Markdown templates. | ||
Description: A collection of 'Lua' filters that extend the functionality | ||
of R Markdown templates (e.g., count words or post-process 'pandoc-citeproc'- | ||
citations). | ||
Imports: | ||
assertthat (>= 0.2.1), | ||
utils, | ||
|
@@ -17,7 +18,7 @@ SystemRequirements: pandoc (>= 2.0; https://pandoc.org) | |
License: MIT + file LICENSE | ||
Encoding: UTF-8 | ||
LazyData: true | ||
RoxygenNote: 6.1.0 | ||
RoxygenNote: 6.1.1 | ||
Suggests: | ||
dplyr (>= 0.8.0.1), | ||
ggplot2 (>= 3.0.0), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# rmdfiltr 0.1.0 | ||
|
||
* Updates pandoc-checks to comply with CRAN policy; replaces `report` argument | ||
with `error` flag. | ||
|
||
# rmdfiltr 0.1.0 | ||
|
||
* Initial release with word count and ampersand replacement filter. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
#' Verify minimum pandoc version | ||
#' #' Verify minimum pandoc version | ||
#' #' | ||
#' #' Verifies that pandoc version 2.0 or later is available. | ||
#' #' | ||
#' #' @param report Character. In case pandoc version is < 2.0 errors if | ||
#' #' \code{error}, warns if \code{warn}, or remains silent otherwise. | ||
#' #' | ||
#' #' @return Logical. \code{TRUE} if pandoc version is 2.0 or later, \code{FALSE} | ||
#' #' otherwise. | ||
#' #' @export | ||
#' #' | ||
#' #' @examples | ||
#' #' | ||
#' #' verify_pandoc_version(report = "silent") | ||
#' | ||
#' Verifies that pandoc version 2.0 or later is available. | ||
#' verify_pandoc_version <- function(report = "error") { | ||
#' assertthat::assert_that(length(report) == 1) | ||
#' assertthat::assert_that(is.character(report)) | ||
#' | ||
#' @param report Character. In case pandoc version is < 2.0 errors if | ||
#' \code{error}, warns if \code{warn}, or remains silent otherwise. | ||
#' lua_available <- utils::compareVersion("2.0", as.character(rmarkdown::pandoc_version())) <= 0 | ||
#' | ||
#' @return Logical. \code{TRUE} if pandoc version is 2.0 or later, \code{FALSE} | ||
#' otherwise. | ||
#' @export | ||
#' report_fun <- switch( | ||
#' report | ||
#' , "error" = stop | ||
#' , "warn" = function(x) { warning(x); return(FALSE) } | ||
#' , function(x) return(FALSE) | ||
#' ) | ||
#' | ||
#' @examples | ||
#' if(!lua_available) { | ||
#' report_fun("Lua filters require pandoc 2.0 or later (https://pandoc.org/).") | ||
#' } | ||
#' | ||
#' verify_pandoc_version(report = "silent") | ||
|
||
verify_pandoc_version <- function(report = "error") { | ||
assertthat::assert_that(length(report) == 1) | ||
assertthat::assert_that(is.character(report)) | ||
|
||
lua_available <- utils::compareVersion("2.0", as.character(rmarkdown::pandoc_version())) <= 0 | ||
|
||
report_fun <- switch( | ||
report | ||
, "error" = stop | ||
, "warn" = function(x) { warning(x); return(FALSE) } | ||
, function(x) return(FALSE) | ||
) | ||
|
||
if(!lua_available) { | ||
report_fun("Lua filters require pandoc 2.0 or later (https://pandoc.org/).") | ||
} | ||
|
||
lua_available | ||
} | ||
#' lua_available | ||
#' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.