Skip to main content

Crate terraphim_markdown_parser

Crate terraphim_markdown_parser 

Source
Expand description

Markdown parser for Terraphim knowledge-graph documents.

Converts markdown files into typed terraphim_types::Document values, extracting titles, tags, and body text for indexing and search.

Re-exports§

pub use chunk::ContentChunk;
pub use chunk::chunk_by_headings;
pub use heading::HeadingNode;
pub use heading::HeadingTree;
pub use heading::MatchStrategy;
pub use heading::SectionConfig;
pub use heading::SectionPattern;
pub use heading::SectionType;
pub use heading::build_heading_tree;
pub use heading::classify_sections;
pub use limits::AstStats;
pub use limits::LimitKind;
pub use limits::ParseLimits;
pub use limits::ParseLimitsError;
pub use limits::measure_ast;

Modules§

chunk
heading
limits
Configurable resource limits for markdown parsing and extraction.

Structs§

Block
NormalizedMarkdown
ParseDiagnostic
A recovered-parse diagnostic describing loss, a parse failure, or a limit violation.
ParseReport
The outcome of a recovering parse: whatever output could be produced, explicit diagnostics, and whether the output is complete (loss-free).

Enums§

BlockKind
MarkdownParserError

Constants§

TERRAPHIM_BLOCK_ID_PREFIX

Functions§

blocks_to_documents
Convert extracted blocks into Terraphim Documents so downstream graph tooling can be reused.
ensure_terraphim_block_ids
Ensure every list item and paragraph has a stable Terraphim block id.
extract_first_heading
Extract the first H1 heading from markdown content using AST parsing.
normalize_markdown
Normalize markdown into canonical Terraphim form and return the extracted blocks.
parse_recovering
Recovering parsing: bounded, and loss-reporting instead of fail-closed.
parse_strict
Strict parsing: bounded, lossless, and fail-closed.