stilo

Documentation style guide

This guide keeps Stilo’s developer documentation consistent: the pages in docs/, CONTRIBUTING.md, and the docstrings and comments in the code. The user manual is not written here (see README.md).

Where things live

What Where
Developer docs: architecture, setup, server, CLI, web app, editor, protocol, editor component docs/, plain Markdown, index in docs/README.md
Contributing, changelog CONTRIBUTING.md, CHANGELOG.md at the repository root
API details next to the code Python docstrings, JSDoc comments

The protocol is a contract. docs/protocol.md is the contract between the web app and the server, and with any other server that speaks it. Change it first, then src/stilo/server/ and web/src/api.js.

Narrative style

Terms

Use For
document one .texl file
folder the folder that stilo serve serves
the web app the whole user interface in the browser
the editor the sheet of cells, <texl-editor>
cell one part of a document, from its marker to the next
line a cell, as the user sees it, by its number
tag a <% %> tag
name a Swan identifier (not “variable”, except in passing)
comment a cell comment, <!--[ ... ]-->

Write “Stilo”, “Texl” and “Swan” capitalized in prose, and stilo in code font for the command. Write keys as Ctrl+Enter.

Code examples

API references

Every entry has the same shape: a heading with the name in code font, a signature block, a one-sentence summary that starts with a verb in the third person (“Returns …”, “Creates …”), details, and an example where it helps. Signatures use the language’s own notation: Python with type hints, JavaScript as in the editor’s API reference (component/api.md).

Docstrings and comments