Title: | Create Simple Yet Powerful HTML Documents with Light Weight CSS Frameworks |
---|---|
Description: | Create minimal, responsive, and style-agnostic HTML documents with the lightweight CSS frameworks such as 'sakura', 'Water.css', and 'spcss'. Powerful features include table of contents floating as a sidebar, folding codes and results, and more. |
Authors: | Atsushi Yasumoto [aut, cph, cre] , Angelos Chalaris [aut] (mini.css), Susam Pal [aut] (spcss), Mitesh Shah [aut] (sakura), Kognise [aut] (Water.css) |
Maintainer: | Atsushi Yasumoto <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.4.0 |
Built: | 2024-11-11 03:29:14 UTC |
Source: | https://github.com/atusy/minidown |
The button can self-contain the input data by base64 encoding.
download_rmd_button( input = NULL, text = "Download Rmd", ..., class = "button", align = "right", aside = TRUE, embed = NULL )
download_rmd_button( input = NULL, text = "Download Rmd", ..., class = "button", align = "right", aside = TRUE, embed = NULL )
input |
Filename of the input. If |
text |
The text for the hyperlink. |
... |
Arguments passed to the |
class |
HTML class(es) given to the anchor element generated by |
align |
Align the button by CSS's |
aside |
Whether to wrap the anchor element by the aside element. |
embed |
A function to embed file(s).
One of |
shiny.tag
class object.
set.seed(1L) input <- tempfile() writeLines("", input) download_rmd_button(input) # Requires zip command if (interactive()) { input <- tempdir() download_rmd_button(input, embed = xfun::embed_dir) }
set.seed(1L) input <- tempfile() writeLines("", input) download_rmd_button(input) # Requires zip command if (interactive()) { input <- tempdir() download_rmd_button(input, embed = xfun::embed_dir) }
To see the names of the frameworks, run names(frameworks)
.
To see the names of themes of a framework, say "mini"
, run
names(frameworks$mini$stylesheet)
frameworks
frameworks
A list
The output format is HTML5 in general. If framework = "bootstrap"
is given,
the output format becomes HTML4 and comparable to rmarkdown::html_document
except for the behavior of the code_folding
option.
mini_document( framework = "sakura", theme = "default", toc = FALSE, toc_float = FALSE, toc_highlight = FALSE, section_divs = TRUE, code_folding = c("none", "show", "hide"), results_folding = c("none", "show", "hide"), tabset = FALSE, code_download = FALSE, self_contained = TRUE, math = "katex_serverside", template = "default", extra_dependencies = NULL, includes = list(), keep_md = FALSE, pandoc_args = NULL, ... )
mini_document( framework = "sakura", theme = "default", toc = FALSE, toc_float = FALSE, toc_highlight = FALSE, section_divs = TRUE, code_folding = c("none", "show", "hide"), results_folding = c("none", "show", "hide"), tabset = FALSE, code_download = FALSE, self_contained = TRUE, math = "katex_serverside", template = "default", extra_dependencies = NULL, includes = list(), keep_md = FALSE, pandoc_args = NULL, ... )
framework , theme
|
A string to specify the name of a framework
(default: |
toc |
|
toc_float |
TRUE to float the table of contents to the left of the main document content. |
toc_highlight |
This is an experimental feature. |
section_divs |
Wrap sections in |
code_folding |
Setup code folding by a string or a named list.
A choice for the string are |
results_folding |
Setup results folding by a string, |
tabset |
|
code_download |
If |
self_contained |
Produce a standalone HTML file with no external dependencies, using data: URIs to incorporate the contents of linked scripts, stylesheets, images, and videos. Note that even for self contained documents MathJax is still loaded externally (this is necessary because of its size). |
math |
This is a good choice when you want to exclude JavaScript from the output.
The default value |
template |
Pandoc template. If "default", the package's internal template
is used. If a path, user's original template is used. If |
extra_dependencies |
Additional function arguments to pass to the
base R Markdown HTML output formatter |
includes |
Named list of additional content to include within the
document (typically created using the |
keep_md |
Keep the markdown file generated by knitting. |
pandoc_args |
Additional command line options to pass to pandoc |
... |
Arguments passed to |
## Not run: library(rmarkdown) library(minidown) render("input.Rmd", mini_document) ## End(Not run)
## Not run: library(rmarkdown) library(minidown) render("input.Rmd", mini_document) ## End(Not run)