Skip to main content

Crate semora_cli

Crate semora_cli 

Source
Expand description

The semora CLI: publish Markdown and HTML to a Semora server and wait for feedback from the page.

The library exists for the binary and its tests; it is not a stable API.

Modules§

args
Command-line arguments.
bundle
Packing a folder into a tar for a bundle push.
cachefile
Small files in the config folder that several commands may write at once.
checkout
What this checkout last pulled or pushed for each document of its project, so pull can tell a file changed here from one changed on the server, and a keyed push can name the revision it started from.
client
The HTTP API client.
commands
One module per command group.
config
Where the CLI gets its server, key and defaults.
credentials
Stored logins: the OS keyring (Windows, macOS) or credentials.toml (mode 600).
docref
Document references: a bare id, a page URL, a websocket URL, or a project path link.
exit
Exit codes. wait defines them in the spec; every command uses the same ones.
local_links
Records on this machine that a .semora naming another server is used with this CLI’s server (semora project link). They live in project-links.toml in the config folder, never in the checkout, so nobody else’s copy of the project changes.
output
Printing helpers: short text by default, JSON with --json.
project_link
.semora: marks a folder as a Semora project, and where a push came from.
remember
Remembers which document each pushed path became, so the next push of that path replaces it. document.cache in the config folder has one line per path: <resolved path>\t<server>\t<id>.
server_id
The id each server gives itself, which .semora names the server by. The CLI learns it from whoami and keeps it in server-ids.cache in the config folder, one <origin>\t<id> line per server, so most commands don’t ask again.

Structs§

Ctx
Everything a command needs.

Functions§

main_entry
Parses arguments, runs the command and returns the process exit code.