Skip to content

Commit

Permalink
Add support for md_extensions YAML header option
Browse files Browse the repository at this point in the history
  • Loading branch information
juba committed Nov 22, 2019
1 parent a7b1de9 commit 7b4f0f5
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 8 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
rmdformats 0.3.6
----------------

* Add support for `md_extensions` YAML header option
* Fix td background-color incompatibility with DT in readthedown (thanks @davidvilanova)
* Fix material toc links not working when dot in level 1 title (thanks @PriyaShaji)
* Fix problems with runtime:shiny in material (thanks @MiWebR)
Expand Down
3 changes: 3 additions & 0 deletions R/html_clean.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#' @param thumbnails if TRUE display content images as thumbnails
#' @param gallery if TRUE and lightbox is TRUE, add a gallery navigation between images in lightbox display
#' @param pandoc_args arguments passed to the pandoc_args argument of rmarkdown \code{\link[rmarkdown]{html_document}}
#' @param md_extensions arguments passed to the md_extensions argument of rmarkdown \code{\link[rmarkdown]{html_document}}
#' @param toc if TRUE, display a table of contents
#' @param toc_depth adjust table of contents depth
#' @param use_bookdown if TRUE, uses \code{\link[bookdown]{html_document2}} instead of \code{\link[rmarkdown]{html_document}}, thus providing numbered sections and cross references
Expand All @@ -38,6 +39,7 @@ html_clean <- function(fig_width = 6,
thumbnails = TRUE,
gallery = FALSE,
pandoc_args = NULL,
md_extensions = NULL,
toc_depth = 2,
toc = TRUE,
mathjax = "rmdformats",
Expand Down Expand Up @@ -83,6 +85,7 @@ html_clean <- function(fig_width = 6,
fig_caption = fig_caption,
highlight = highlight,
pandoc_args = pandoc_args,
md_extensions = md_extensions,
toc = toc,
toc_depth = toc_depth
)
Expand Down
5 changes: 4 additions & 1 deletion R/html_docco.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#' @param thumbnails if TRUE display content images as thumbnails
#' @param gallery if TRUE and lightbox is TRUE, add a gallery navigation between images in lightbox display
#' @param pandoc_args arguments passed to the pandoc_args argument of rmarkdown \code{\link[rmarkdown]{html_document}}
#' @param md_extensions arguments passed to the md_extensions argument of rmarkdown \code{\link[rmarkdown]{html_document}}
#' @param use_bookdown if TRUE, uses \code{\link[bookdown]{html_document2}} instead of \code{\link[rmarkdown]{html_document}}, thus providing numbered sections and cross references
#' @param mathjax set to NULL to disable Mathjax insertion
#' @param ... Additional function arguments passed to rmarkdown \code{\link[rmarkdown]{html_document}}
Expand All @@ -34,6 +35,7 @@ html_docco <- function(fig_width = 6,
thumbnails = TRUE,
gallery = FALSE,
pandoc_args = NULL,
md_extensions = NULL,
mathjax = "rmdformats",
use_bookdown = FALSE,
...) {
Expand Down Expand Up @@ -77,7 +79,8 @@ html_docco <- function(fig_width = 6,
fig_height = fig_height,
fig_caption = fig_caption,
highlight = highlight,
pandoc_args = pandoc_args
pandoc_args = pandoc_args,
md_extensions = md_extensions
)
html_document_args <- append(html_document_args, extra_args)
if (use_bookdown) {
Expand Down
3 changes: 3 additions & 0 deletions R/material.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#' @param gallery if TRUE and lightbox is TRUE, add a gallery navigation between images in lightbox display
#' @param cards if TRUE, sections will be presented as distinct and animated cards
#' @param pandoc_args arguments passed to the pandoc_args argument of rmarkdown \code{\link[rmarkdown]{html_document}}
#' @param md_extensions arguments passed to the md_extensions argument of rmarkdown \code{\link[rmarkdown]{html_document}}
#' @param use_bookdown if TRUE, uses \code{\link[bookdown]{html_document2}} instead of \code{\link[rmarkdown]{html_document}}, thus providing numbered sections and cross references
#' @param mathjax set to NULL to disable Mathjax insertion
#' @param ... Additional function arguments passed to R Markdown \code{\link[rmarkdown]{html_document}}
Expand All @@ -38,6 +39,7 @@ material <- function(fig_width = 6,
cards = TRUE,
mathjax = "rmdformats",
pandoc_args = NULL,
md_extensions = NULL,
use_bookdown = FALSE,
...) {

Expand Down Expand Up @@ -82,6 +84,7 @@ material <- function(fig_width = 6,
fig_caption = fig_caption,
highlight = highlight,
pandoc_args = pandoc_args,
md_extensions = md_extensions,
toc = TRUE,
toc_depth = 1
)
Expand Down
3 changes: 3 additions & 0 deletions R/readthedown.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#' @param thumbnails if TRUE display content images as thumbnails
#' @param gallery if TRUE and lightbox is TRUE, add a gallery navigation between images in lightbox display
#' @param pandoc_args arguments passed to the pandoc_args argument of rmarkdown \code{\link[rmarkdown]{html_document}}
#' @param md_extensions arguments passed to the md_extensions argument of rmarkdown \code{\link[rmarkdown]{html_document}}
#' @param toc_depth adjust table of contents depth
#' @param use_bookdown if TRUE, uses \code{\link[bookdown]{html_document2}} instead of \code{\link[rmarkdown]{html_document}}, thus providing numbered sections and cross references
#' @param mathjax set to NULL to disable Mathjax insertion
Expand All @@ -37,6 +38,7 @@ readthedown <- function(fig_width = 8,
thumbnails = FALSE,
gallery = FALSE,
pandoc_args = NULL,
md_extensions = NULL,
toc_depth = 2,
mathjax = "rmdformats",
use_bookdown = FALSE,
Expand Down Expand Up @@ -81,6 +83,7 @@ readthedown <- function(fig_width = 8,
fig_caption = fig_caption,
highlight = highlight,
pandoc_args = pandoc_args,
md_extensions = md_extensions,
toc = TRUE,
toc_depth = toc_depth
)
Expand Down
7 changes: 5 additions & 2 deletions man/html_clean.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/html_docco.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion man/material.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions man/readthedown.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7b4f0f5

Please sign in to comment.