Learn R Programming

md4r (version 0.5.2.0)

parse_md: 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")

Value

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

Arguments

md

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

flags

Character vector. Dialect flags used by the parser.

Examples

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

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

Run the code above in your browser using DataLab