Skip to main content

Crate ashlar_docs

Crate ashlar_docs 

Source
Expand description

A documentation library for agents: folders are categories (nested folders are subcategories), markdown files are documents, and every page is served verbatim.

  • _category.md in a folder describes it (frontmatter title, description; the body is the overview). It is not listed as a document. The root one says what the library is.
  • A document’s frontmatter has title, description (when to read it), and optionally order (lower first) and tags.
  • embed (build scripts) writes a (path, text) table of a folder for include!, so a page joins by being added to the folder. Library::overlay_dir adds a folder at run time on top, where the same path replaces the built-in page.

Modules§

write
Writing pages into the user’s own folder (the one Library::overlay_dir reads), so an agent can keep notes that later sessions find: save a page, append to one, delete one.

Structs§

Category
One category (folder). A folder without _category.md still is one, titled after its name.
Doc
One document.
Frontmatter
The frontmatter fields this library reads, and the text after it.
Library
Documents and categories, sorted by path.
Node
A category with what is under it, for Library::tree.

Enums§

Source
Where a page came from.

Constants§

CATEGORY_FILE
The file in a folder that describes its category.
MAX_DEPTH
Folders deeper than this are not read.
MAX_FILES
A run-time folder contributes at most this many files.
MAX_FILE_BYTES
A run-time file larger than this is skipped.

Functions§

embed
Write the markdown files under dir as a Rust table for include!: pub static FILES: &[(&str, &str)] = &[("skills/review.md", include_str!("…")), …];, sorted by path, and print cargo:rerun-if-changed for every folder and file so an added, removed or edited page rebuilds the crate. For build scripts. Returns how many files were written.