All-in-one wrapper for the conversion between (R) Markdown, FreeMind mind map, Mermaid mind map, R code, directory structure, and HTML widget.
mm(
from = NA,
input_type = c("auto", "markdown", "mindmap", "R", "dir"),
output_type = c("widget", "mindmap", "markdown", "R", "dir", "mermaid"),
root = NA,
md_list = FALSE,
md_eq = FALSE,
md_braces = FALSE,
md_bookdown = FALSE,
md_maxlevel = "",
r_seclabel = " --------",
r_chunkheading = FALSE,
dir_files = TRUE,
dir_all = TRUE,
dir_excluded = NA,
dir_to = NA,
dir_quiet = FALSE,
mmd_shape = c("cloud", "rounded_square", "square", "bang", "circle", "hexagon"),
widget_name = NA,
widget_width = NULL,
widget_height = NULL,
widget_elementId = NULL,
widget_options = markmapOption(preset = "colorful")
)Desired output.
Character. The source text of the (R) Markdown syntax text, the R code, the FreeMind mind map code, or the path to the directory.
Character. The type of the input text. It can be 'auto', 'markdown', 'mindmap', 'R', 'dir'. The default value is 'auto', which means the type will be automatically assigned according to the features of the input text.
Character. The type of the output. It can be 'widget', 'mindmap', 'markdown', 'R', 'dir', 'mmd'. The default value is 'widget'.
Character. The string displayed as the root (center) of the mind map.
Logical. whether to process lists like headings in the Markdown input.
Logical. Whether to include LaTeX equations in the Markdown input when converted to other formats.
Logical. Whether to remove #ID in the headings of the markdown file (usually in a bookdown> project.
Logical. Whether the R Markdown syntax text is in bookdown style, i.e. # (PART), # (APPENDIX), and # References as an upper level of the Level 1 heading.
Integer or ''. The maximum level of the markdown headings that are displayed in the mind map.
Character. The ending characters indicating sections in R Markdown.
Logical. Whether process the chunk label as headings.
Logical. Whether to include files. If FALSE, only folders are included. If TRUE, folders and files are included.
Logical. Whether to include all files in a directory. If FALSE, only the names of visible files are included (following Unix-style visibility, that is files whose name does not start with a dot). If TRUE, all file names will be included.
Character. The directories which are not included in the output.
Character. The path of the output directory.
Logical. Whether to display the results of generated directories.
Character. The shape of mermaid mindmap nodes. See Mermaid document.
Character. The name of the html widget.
Numeric. The width of the widget.
Numeric. The height of the widget.
Character. The ID of teh Widget.
List. Options for the markmap widget. It should be a list passed from the markmapOption() function.
mm() converts between (R) Markdown syntax text, R code, FreeMind mind map code, Mermaid mind map code, and directory, and display them in a HTML widget. It is a wrapper for other conversion functions in this package.
input <- system.file('examples/mindr-md.Rmd', package = 'mindr')
input_txt <- readLines(input, encoding = 'UTF-8')
mm_output <- mm(input_txt, output_type = c('mindmap', 'markdown', 'R', 'widget'))
mm_output
# See the vignette for more examples:
vignette('mindr', package = 'mindr')
Run the code above in your browser using DataLab