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
Standards and Conventions

Documentation Overview

Single-page view · as markdown

Overview

Standards and Conventions / Documentation Overview

Peios documentation comes in seven forms. Each one has a different reader and answers a different question. Learn explains and help summarizes; each of the other five forms is the authority for its own kind of fact.

FormReaderAnswers
LearnAnyone getting orientedWhy does this exist, and how does it fit together?
Man pagesUsers, administrators, and developers at the interfaceExactly what does this command, file, call, or function do?
Command-line helpAnyone at a prompt who needs a reminderWhat does this program accept?
regmanAnyone reading or changing configurationWhat does this registry key mean, and what values are valid?
evmanAnyone reading the event streamWhat does this event, or this field, mean?
Technical reference manualsDevelopers of one specific componentHow does this component work inside?
SpecificationsAnyone implementing or consuming a shared protocol or formatWhat must be true?

Learn #

High-level, educational documentation. Learn is what you read when you want to understand something: concepts, how the pieces fit, and guides that walk through a task. Developer guides, such as how to package an application or how to emit events, are learn, not reference.

Learn can describe an interface, but it is never the authority for one. Where it touches a flag, a key, or an event, it links to the form that owns it.

Man pages #

Thorough technical documentation, still centered on the user. A man page is where every flag, exit status, file, and environment variable is recorded, including the edge cases learn leaves out. If you have forgotten something, you read the man page.

Man pages are also the API reference: section 2 for system calls, section 3 for library functions.

Some overlap with learn is inevitable, and the set includes pages adopted from other projects. Adopted pages are patched wherever Peios behaves differently from upstream. Peios does not ship inaccurate documentation.

Command-line help #

The text a program prints for --help: one line for each command, argument, and option, and a pointer to the man page. Help is a summary of the man page, never a replacement for it, and the two must agree. The same rules cover the version and error messages a program prints.

regman #

regman owns the documentation of every registry key and value: its type, default, valid range, and what it applies to. Other forms do not document configuration inline; they point at the regman page.

evman #

evman owns the documentation of every event and every event field. A field with no evman definition is not part of the platform's vocabulary, and no component is allowed to emit it.

Technical reference manuals #

Thorough systems documentation for the developers of one specific component: its internal design, data structures, and behavior. A TRM describes one implementation.

Specifications #

Specifications for the protocols and formats shared across Peios. A specification states a contract that more than one party relies on.

The line between a TRM and a specification: if a second implementation, or a consumer on the other side of the boundary, would need to know it, it belongs in a specification. If it is true only of this implementation, it belongs in the TRM. TRMs cite specifications rather than restating them.

When forms overlap #

Every fact has one authority:

  • Interface details (flags, exit statuses, files, calls) belong to the man page. Help summarizes them and must agree with it.
  • Registry keys belong to regman, and events to evman, without exception.
  • Shared contracts belong to the specification, which wins over any TRM.
  • Learn explains and links; it is never the source to quote.

Publishing a Repository's Docs to Learn

Standards and Conventions / Documentation Overview

Learn is built from the central learn repository and from a docs/learn/ tree in each component's repository. Follow these steps when a repository first contributes pages, so that its documentation is published and stays current.

Before you start #

  • Lay out the repository's docs/learn/ tree as Trail merged trees require: the same shelves, products, and containers as Learn, with identical metadata.
  • Push the repository to GitHub.

Add the repository to the site #

  1. In learn/trail.toml, add a [[merge]] table after the existing ones:

    [[merge]]
    repo = "https://github.com/peios/authd"
    dir = "docs/learn"
    path = "../authd/docs/learn"
    

    repo and dir are where Learn's deploy fetches the tree. path is the repository's checkout beside learn/ in a workspace. Trail uses it when it exists, so trail serve learn shows local edits.

  2. From the workspace root, build the combined site strictly:

    trail build learn --strict --out local/learn-site
    

    Fix any duplicate pages, mismatched containers, or broken links it reports.

  3. Commit the change to learn and push it.

Redeploy when its documentation changes #

  1. In the component's repository, add this file as .github/workflows/update-learn.yml:

    name: Update Learn
    
    # Asks Learn to redeploy when this repository's documentation changes. The
    # same file goes in every repository that contributes to Learn.
    on:
        push:
            paths: ["docs/**"]
    
    permissions: {}
    
    jobs:
        dispatch:
            if: github.ref_name == github.event.repository.default_branch
            runs-on: ubuntu-latest
            steps:
                - run: gh api repos/peios/learn/dispatches -f event_type=docs-changed
                  env:
                      GH_TOKEN: ${{ secrets.LEARN_DISPATCH_TOKEN }}
    

    The file is the same in every repository. It runs only for pushes to the default branch that change docs/.

  2. For a repository outside the peios organization, add a LEARN_DISPATCH_TOKEN repository secret. The peios organization provides the secret to its own repositories.

  3. For a private repository, give Learn's LEARN_READ_TOKEN read access to its contents. Learn's deploy fetches the tree with that token.

Check the result #

Push a documentation change to the default branch. The repository's Update Learn run succeeds, and a Deploy to GitHub Pages run starts in peios/learn. When it finishes, the change is on learn.peios.org.

Peios Learn — documentation for Peios software.

Built with Trail.