parse_md_to_df_str | R Documentation |
This function parses a vector of Markdown content into a structured DataFrame. Each line of Markdown is analyzed for heading levels, and content under headings is aggregated if specified. This allows for a tabular representation of hierarchical document structures, useful for content analysis and manipulation.
parse_md_to_df_str(chr, summarize = TRUE, collapse = ", ")
chr |
A character vector containing Markdown content, typically obtained
from |
summarize |
Logical, if |
collapse |
The string to use when collapsing multiple lines of content under
each heading when |
A data.frame
where each row corresponds to a heading or content line.
If summarize
is TRUE
, each heading level is summarized into single entries
per heading level. The DataFrame columns represent the hierarchical levels
(headings) and the content under these headings.
markdown_text <- c("# Heading 1", "Content under heading 1", "## Subheading 1.1",
"Content under subheading 1.1", "# Heading 2", "Content under heading 2")
md_df <- parse_md_to_df_str(markdown_text)
print(md_df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.