Expand description
GitHub Flavored Markdown (GFM) extensions: tables, strikethrough, task lists. GitHub Flavored Markdown (GFM) extensions plugin.
Pre-processes Markdown content in the before_compile phase to add
support for GFM features that the upstream renderer does not handle:
- Tables —
| col | col |blocks with a|---|---|separator row. - Strikethrough —
~~text~~becomes<del>text</del>. - Task lists —
- [ ] itemand- [x] donebecome checkbox lists. - Footnotes —
[^id]references with[^id]:definitions.
§How it works
For each .md file under content_dir, the plugin:
- Splits the YAML/TOML frontmatter from the body so it stays untouched.
- Walks the body line-by-line, tracking fenced code blocks so GFM
syntax inside
blocks is preserved literally. - Detects GFM-specific blocks (tables, task lists) and renders only
those blocks through
pulldown-cmarkwith the matching options enabled, substituting the rendered HTML back into the source. - Applies an inline strikethrough transform to remaining text.
Standard markdown renderers pass block-level raw HTML through unchanged, so the substituted HTML composes cleanly with whatever renderer staticdatagen runs afterwards.
§Example
use ssg::plugin::PluginManager;
use ssg::markdown_ext::MarkdownExtPlugin;
let mut pm = PluginManager::new();
pm.register(MarkdownExtPlugin);Structs§
- Markdown
ExtPlugin - Plugin that expands GFM Markdown extensions in source files.
Functions§
- expand_
gfm - Expands all GFM constructs in
input, returning a new string.