stencila.toml
Overview
declare workspace metadata define remotes for sync define outputs and spreads configure site structure, routes, layout, navigation, and related settings
File Locations
User config directory: ~/.config/stencila/Workspace directory: the directory containing the nearest stencila.tomlor stencila.local.toml
stencila.tomlfor shared configuration stencila.local.tomlfor machine- or user-specific overrides
stencila.tomlfor user defaults
Workspace Resolution
Starts from the current working directory (or the path provided). Walks up the directory tree looking for stencila.toml. If none is found, walks up looking for stencila.local.toml. If neither exists, falls back to the user config directory if it contains stencila.toml. If no config exists anywhere, uses the start path as the workspace directory.
Merge Order and Precedence
~/.config/stencila/stencila.toml<workspace>/stencila.toml<workspace>/stencila.local.toml
Relative Paths
stencila.tomlstencila.local.toml
Example: Layered Configuration
~/.config/stencila/stencila.toml
[site]
formats = ["md"]<workspace>/stencila.toml
[site]
root = "docs"
formats = ["md", "pdf"]<workspace>/stencila.local.toml
[site]
formats = ["md"] # Local override for this machinesite.formats["md"]site.rootdocs
Validation
workspace configuration validation site configuration validation navigation item validation (must be internal routes) route configuration validation remote configuration validation output configuration validation
Watching for Changes
stencila.tomlstencila.tomlstencila.local.toml
CLI Behavior
stencila config setand stencila config unsetupdate a key path in the nearest, local, or user config file. Edits preserve existing formatting and comments. stencila initcan generate a starting stencila.tomlbased on repository analysis.
workspace.idis assigned when creating a workspace. site.domainis set via stencila site domain setand requires domain validation.
stencila configstencila init
stencila config get
stencila config set site.root docs
stencila config unset site.rootstencila init
stencila init --yesSections
[workspace] | |
[remotes] | |
[outputs] | |
[site] | |
[agents] |