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::Unknownto keep consumers resilient. - provides a plugin sdk for external snippet renderers (
pluginmodule).
§example
use lepiter_core::KnowledgeBase;
let index = KnowledgeBase::open("./lepiter")?;
for page in index.sorted_pages() {
println!("{} - {}", page.id, page.title);
}§plugin sdk
use lepiter_core::plugin::{PluginRequest, PluginResponse};
use lepiter_core::lepiter_plugin_main;
fn handle(req: PluginRequest) -> PluginResponse {
if req.typ != "wardleyMap" {
return PluginResponse::error("unsupported type");
}
PluginResponse::ok(vec!["example".to_string()])
}
lepiter_plugin_main!(handle);Modules§
- plugin
- plugin sdk for external snippet renderers.
Macros§
Structs§
- Attachment
Resolver - Resolves attachment targets relative to the knowledge base root.
- Knowledge
Base - Entry point for opening a Lepiter knowledge base directory.
- Knowledge
Base Index - Indexed knowledge base metadata with lazy page loading.
- Page
- Fully parsed page content.
- Page
Meta - Metadata for a page discovered during index scanning.
- Parse
Issue - Non-fatal parse/indexing issue associated with a source file.
- Resolved
Attachment - Resolved attachment target.
- Search
Hit - Search result entry for one page.
Enums§
- Attachment
Error - Attachment resolution failures.
- Link
Target Kind - Classification of a raw link target.
- Node
- Block-oriented normalized node model used by consumers (e.g. TUI).
- Search
Match Kind - Match category for search results.
- Title
Resolution - Result of resolving a page by title.
Functions§
- collect_
node_ types_ in_ file - Collects all observed
type/__typevalues and their counts in one page file. - normalize_
text - parse_
node_ from_ raw - Parses a single raw snippet JSON value into a
Node. - 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.