markmap: Create a mind map in HTML widget

Description Usage Arguments Details Value Examples

View source: R/individual.R

Description

Create a mind map in HTML widget

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
markmap(
  from = ".",
  root = NA,
  input_type = c("auto", "markdown", "mindmap", "R", "dir"),
  md_list = FALSE,
  md_eq = FALSE,
  md_braces = FALSE,
  md_bookdown = FALSE,
  md_maxlevel = "",
  dir_files = TRUE,
  dir_all = TRUE,
  dir_excluded = NA,
  widget_name = NA,
  widget_width = NULL,
  widget_height = NULL,
  widget_elementId = NULL,
  widget_options = markmapOption(preset = "colorful")
)

Arguments

from

Character. The source text of the (R) Markdown syntax text, the R code, the FreeMind mind map code, or the path to the directory.

root

Character. The string displayed as the root (center) of the mind map.

input_type

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 assgined according to the features of the input text.

md_list

Logical. whether to process lists like headings in the Markdown input.

md_eq

Logical. Whether to include LaTeX equations in the Markdown input when converted to other formats.

md_braces

Logical. Whether to remove #ID in the headings of the markdown file (usually in a bookdown> project.

md_bookdown

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.

md_maxlevel

Integer or ”. The maximum level of the markdown headings that are displayed in the mind map.

dir_files

Logical. Whether to include files. If FALSE, only folders are included. If TRUE, folders and files are included.

dir_all

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.

dir_excluded

Character. The directories which are not included in the output.

widget_name

Character. The name of the html widget.

widget_width

Numeric. The width of the widget.

widget_height

Numeric. The height of the widget.

widget_elementId

Character. The ID of teh Widget.

widget_options

List. Options for the markmap widget. It should be a list passed from the markmapOption() function.

Details

This function, adapted from the Rmarkup package, creates a markmap widget using htmlwidgets. The widget can be rendered on HTML pages generated from R Markdown, Shiny,or other applications.

Value

HTML widget object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Display Markdown:
input <- system.file("examples/mindr-md.Rmd", package = "mindr")
# file.show(input)
input_txt <- readLines(input, encoding = "UTF-8")
markmap(input_txt)
markmap(input_txt, root = basename(input), md_list = TRUE, md_eq = FALSE,
    md_braces = FALSE, md_bookdown = TRUE)

# Display Mind Map:
input <- system.file("examples/mindr-mm.mm", package = "mindr")
# file.show(input)
input_txt <- readLines(input, encoding = "UTF-8")
markmap(input_txt)
markmap(input_txt, root = basename(input))

# Display R script:
input <- system.file("examples/mindr-r.R", package = "mindr")
# file.show(input)
from <- input_txt <- readLines(input, encoding = "UTF-8")
markmap(input_txt)
markmap(input_txt, root = basename(input), md_list = TRUE, md_eq = FALSE,
    md_braces = FALSE, md_bookdown = TRUE)

# Display directory:
input <- system.file(package = "mindr")
markmap(input)
markmap(input, root = "The mindr package", dir_files = FALSE, dir_excluded = c("Meta",
    "htmlwidgets/lib"), widget_elementId = "mindr-dir")

mindr documentation built on Nov. 22, 2021, 9:07 a.m.

Related to markmap in mindr...