Peios Learn
Documentation

Peios

Peios Peios Kernel Universal Directory Project

Developer Tools

Trail Acta Provium clackatoo CAF GCSL Pekit

Applications

Framewright

Standards and Conventions

Standards and Conventions Peios Specifications
Trail

Reference

Single-page view · as markdown

Directory and File Names

Trail / Reference

Trail uses directory names to derive navigation and URLs. A source name contains an order, a slug, and sometimes a kind suffix. trail-source(5) is the authoritative naming and containment reference.

Read a source name #

In 200--getting-started.topic, 200 controls sibling order, getting-started supplies the URL slug, and .topic selects the grouping kind. Root collections use a slug and .product or .antho, without an order.

Choose topics for independently readable pages and books for an ordered document with section numbers. Shelves group navigation without adding a URL segment. See Anatomy of a Site for a complete example tree.

Keep names stable #

Renaming a slug changes URLs and references. Order changes usually affect navigation only; in books they also affect published section numbers. Run trail build --strict after structural changes to find broken links.

Use link aliases when the same page belongs in several navigation locations. An alias does not duplicate the source article.

Reserved names #

Trail publishes generated pages and asset directories alongside authored content. Some slugs are reserved to prevent collisions. trail-source(5) lists them and the allowed files at each level of a tree.

trail.toml Reference

Trail / Reference

Each trail.toml configures the source directory that contains it. The root file defines site-wide presentation, merged trees, attachments, plugins, and writing rules. Grouping files describe their own navigation unit. trail.toml(5) is the authoritative key and validation reference.

Configure the site root #

Start with Configuring the Site. Set a public URL when you publish the site so canonical links and discovery files can use absolute addresses. Keep deployment-specific values in the root configuration rather than repeating them in articles.

Configure a grouping #

Products, anthologies, and books carry their own presentation metadata. Topics, chapters, and shelves can override their derived titles. The accepted keys differ by kind; trail.toml(5) lists each set.

Derived titles #

When a grouping has no explicit title, Trail converts its slug to title case. The first and last words are capitalized; internal articles, conjunctions, and short prepositions generally stay lowercase. Use an explicit title for a proper name or an identifier whose casing cannot be derived from the slug.

Reuse terminology #

An inline reference associates a phrase with a page or grouping. The phrase then links to that destination when used in prose. See Inline References for examples.

Add generated content #

A configured plugin expands named Markdown fences. Its command runs with the privileges of the build process, so review plugin configuration before building a source tree. trail-plugin(5) documents the process interface. Writing Plugin Blocks explains how to use it.

Check writing #

The optional [lint] table enables writing checks. trail-lint(5) documents the rules and configuration. Checking Style walks through running the check and interpreting findings.

Frontmatter Reference

Trail / Reference

Frontmatter gives an article its title and metadata before its Markdown body. trail-frontmatter(5) is the authoritative field reference, including types, defaults, validation, and differences between topic and book pages.

Write useful metadata #

A title helps readers choose a page. A description explains its scope in search results and Markdown mirrors. A topic page's type distinguishes a concept, a how-to, or a reference; books already have a document structure and do not accept that field.

Writing Articles and Frontmatter shows a complete example and explains how metadata affects the reading experience. trail build --strict checks that descriptions are present.

Connect related material #

Related-page references guide a reader to a useful next topic. Inline references make a recognizable phrase link to its definition. These serve different purposes: use related pages for a reading path and inline references for terminology.

See Inline References for matching and Writing Links and References for explicit links.

Command-line Reference

Trail / Reference

Trail provides commands for building, serving, and checking documentation. trail(1) is the authoritative command reference, including every option, exit status, environment input, and output path. Use trail --help for a summary or trail help build for one command.

Building a site #

Run trail build --strict from the directory containing trail.toml to check descriptions and build the site. The build validates links even without --strict. Read Building and Serving for a worked procedure and output ownership rules.

Previewing changes #

Run trail serve to preview the site while editing. It rebuilds after source changes and reloads connected browsers. Failed builds report a warning while the server stays running. Output can contain partial writes from a failed build; it is not an atomic snapshot of the last success.

Checking writing #

Run trail lint separately from a build. Findings and totals go to stderr. Each finding names its source path, line, column, and rule. A warning uses trail: warning:; an error uses trail:. The exit status is 1 if a rule reports an error, and 0 if there are only warnings or no findings. Checking Style explains configuration.

Exit status and streams #

Help, version, and successful commands exit with status 0. Operational failures exit with status 1. Usage errors exit with status 2. Running Trail without arguments prints help to stderr and exits with status 2. Build and server progress use stdout. Errors, warnings, and lint findings use stderr. Plugin diagnostics retain the plugin's own formatting.

Installing #

Build Trail from its source directory:

pekit build trail

pekit prints where the result is, under pekit-out/. Run tools/install to install the binary and manuals under $HOME/.local. See Building Trail for prerequisites, checks, and a custom installation prefix. Read a manual directly with man ./man/trail.1 from the source directory.

Peios Learn — documentation for Peios software.

Built with Trail.