Skip to main content

Crate lepiter_core

Crate lepiter_core 

Source
Expand description

Core data model and parser for Lepiter knowledge bases stored as page JSON files.

§Scope

  • Scans a Lepiter directory and builds a metadata index keyed by page id.
  • Loads and parses individual pages lazily by id.
  • Converts page snippet trees into a stable block-oriented node model.
  • Preserves unknown node types as Node::Unknown to keep consumers resilient.

§Example

use lepiter_core::KnowledgeBase;

let index = KnowledgeBase::open("./lepiter")?;
for page in index.sorted_pages_by_title() {
    println!("{} - {}", page.id, page.title);
}

Structs§

KnowledgeBase
Entry point for opening a Lepiter knowledge base directory.
KnowledgeBaseIndex
Indexed knowledge base metadata with lazy page loading.
Page
Fully parsed page content.
PageMeta
Metadata for a page discovered during index scanning.
ParseIssue
Non-fatal parse/indexing issue associated with a source file.
SearchHit
Search result entry for one page.

Enums§

LinkTargetKind
Classification of a raw link target.
Node
Block-oriented normalized node model used by consumers (e.g. TUI).
SearchMatchKind
Match category for search results.
TitleResolution
Result of resolving a page by title.

Functions§

collect_node_types_in_file
Collects all observed type/__type values and their counts in one page file.
render_nodes_to_text
Renders normalized nodes to plain text.
render_page_to_text
Renders a parsed page to plain text.

Type Aliases§

PageId
Canonical page identifier used throughout the API.