charge/markdown
Types
Represents a parsed markdown file with frontmatter.
Markdown parsing uses marked
pub opaque type MarkdownFile(a)
Values
pub fn content(file: MarkdownFile(a)) -> element.ElementTree
pub fn from_markdown(
out out_dir: fs.Path,
dir dir: fs.Path,
decode decode: fn(fs.SitePath) -> decode.Decoder(a),
agg agg: fn(List(a)) -> b,
render render: fn(MarkdownFile(a), b) -> Result(
element.ElementTree,
error.ChargeError,
),
) -> charge.Pipeline(MarkdownFile(a), b)
Create a pipeline that loads markdown files as it’s initial source with included page rendering, aggregation, and frontmatter parsing
pub fn frontmatter(file: MarkdownFile(a)) -> a
Get the frontmatter from a markdown file
pub fn to_html_file(
file: MarkdownFile(a),
rendered: element.ElementTree,
) -> charge.Asset
Convert a markdown file to an HTML asset with fully-rendered HTML content