Expand description
moss-core: Pure Rust content processing.
Zero I/O, zero async. Takes strings in, returns strings out. All filesystem access happens in the Tauri layer.
Panic-free contract: Every public function in moss-core is invoked from
Tauri command handlers in the host process. The host is configured with
panic = "abort" for release builds, so any panic on user input crashes
the whole desktop app (see fix in date.rs for the editor-mount panic on
Chinese filenames). Treat moss-core as panic-free on user input: never
unwrap/expect a value derived from arbitrary user data, and never use
byte-indexed &str slicing without a char_boundary guarantee.
Re-exports§
pub use extract_headings::extract_headings;pub use extract_headings::HeadingInfo;pub use page_kind::PageKind;pub use resolved::Resolved;pub use resolved::ResolvedOrigin;
Modules§
- asset_
paths - Pure URL/path transform helpers — no filesystem access, no env lookups. Used by moss-core’s render functions (see crate::render::*) and by upstream src-tauri call sites.
- asset_
snapshot - Pre-fetched asset metadata available to Stage 1 + Stage 2.
- ast
- Typed body AST.
- content_
graph - In-memory index of content files, headings, and block IDs.
- contract
- moss HTML/CSS contract surface.
- csv_
table - Pure CSV/TSV → HTML table renderer.
- date
- Publish-date resolution for moss content.
- extract_
headings - Pure extraction of a document’s headings (text + slug + level) for the
editor’s
[[Page#Heading]]autocomplete. Reusesparse()(which runsassign_heading_id_suffixes) so the returned slugs are byte-identical to the rendered<hN id="...">attributes — the keystone invariant. - frontmatter
- YAML frontmatter parsing with body preservation.
- frontmatter_
union - Normalization for union-typed frontmatter fields (
children,series). - heading
- Article heading rule — single source of truth for the auto-injected
<h1 class="moss-article-title">and the editor’s pinned heading element. - heading_
anchor - Obsidian-compatible heading anchor generation.
- home
- Home file detection for the moss content model.
- link_
candidates - Link resolution candidate generation.
- link_
completions - Pure ranker for wikilink autocomplete completions.
- media
- Unified media reference resolution and display attributes.
- page_
kind - Classification of moss page/source-file kinds.
- render
- HTML synthesizers for moss-emitted markdown content.
- resolve
- Centralized link resolution — ALL wikilink handling (body AND frontmatter) happens here.
- resolved
- A value paired with its origin. Lets downstream consumers decide whether to honor the value as author intent (explicit) or override it with an inferred default (auto-detected).
- schema
- Content model types driven by the schema.
- schema_
fields - Builtin frontmatter field definitions.
- shortcode_
tokens - Tokenizer for shortcode opening, closing, and divider lines.
- sort
- Folder-listing sort: types and inference cascade.
- validation
- Schema-driven frontmatter validation.