Skip to main content

Module json

Module json 

Source
Expand description

Wire format for the compiled site asset (note_XXX.json).

SiteAsset is the top-level output of crate::parse_document. It contains:

  • schema — integer version so renderers can detect breaking changes.
  • meta — parsed YAML frontmatter as a JSON value tree (native only).
  • ast — array of MarkPlus block nodes (see crate::ast).

Structs§

SchemaVersion
SiteAsset
The JSON asset written to dist/static_api/note_XXX.json.

Functions§

parse_json_data_to_ast
Parse a JSON data string and return AST block nodes.
read_and_validate_asset
Read a JSON file from path, validate it with the lightweight checker, and deserialize into a SiteAsset. Returns Err(String) on any failure.
read_asset_json
Read a JSON file and return the parsed JSON Value without validation. Convenience wrapper for callers that only need the raw JSON tree.
read_json_data_as_ast
Read a JSON data file and return AST block nodes.
validate_asset_json_str
Lightweight validation of the SiteAsset JSON string.
validate_asset_json_value
Validate a parsed JSON Value representing a SiteAsset wire format.