parse_md {md4r}R Documentation

Parse markdown

Description

Parse either a literal markdown string or a markdown file given a path. Different dialects and features are supported via the flags argument. See flags_describe() for possible flags and their usage. parse_md() defaults parsing using the commonmark spec while parse_gfm() uses the GitHub flavored markdown spec.

Usage

parse_md(md, flags = "MD_DIALECT_COMMONMARK")

parse_gfm(md, flags = "MD_DIALECT_GITHUB")

Arguments

md

Character. Either literal string of markdown or a path to a markdown file.

flags

Character vector. Dialect flags used by the parser.

Value

Both functions return a markdown ast, a list with the md_block_doc class.

Examples

parse_md(system.file("examples/commonmark.md", package = "md4r"))

parse_gfm(system.file("examples/github.md", package = "md4r"))


[Package md4r version 0.5.2.0 Index]