Expand description
Flexible tools for assembling and rendering structured documentation trees.
Build documents from Block and Inline nodes, then render them using
Markdown-friendly md output, ANSI-aware term output, or a custom
Render implementation.
§Examples
use docloom::md::doc;
use docloom::prelude::*;
let markdown = doc([
h1("Docloom Overview"),
p((bold("Docloom"), " turns structured blocks into Markdown.")),
h2("Getting Started"),
p((
"Compose ",
italic("inline styles"),
" and render them together.",
)),
code_block("rust", "fn main() { println!(\"hello\"); }"),
h2("Lists"),
ul(["Supports bullet lists", "And numbered ones"]),
ol(["Call `doc`", "Render the output"]),
task_list([
(true, p("Choose block types")),
(false, p("Render to more targets")),
]),
h2("Tables"),
table(
("Feature", "Description"),
(
("Tables", "Markdown alignment helpers"),
("Task lists", "Checkbox formatting"),
),
),
h2("Quotes"),
quote(p("Render nested content with ease.")),
hr(),
p("Generate complete documents without manual Markdown stitching."),
]);
let content = format!("{markdown}");
assert!(content.contains("Docloom Overview"));Modules§
- md
- Markdown renderer and supporting types.
- prelude
- Convenience re-exports of builder helpers and extension traits.
- term
- Terminal renderer with ANSI color support.
Enums§
- Alignment
- Column alignment options used when rendering tables.
- Block
- Document-level nodes describing paragraphs, lists, and other structural items.
- Inline
- Inline elements that compose textual content.
Traits§
- Render
- Trait implemented by renderers that consume
BlockandInlinetrees. - Renderable
- Trait for types that know how to render themselves with a
Render.