Skip to main content

SphinxCLI

A CLI tool to ease the generation Sphinx documents by allowing for multiple builders and multiple languages to be built using a single command.

There are 2 ways of using the tool. As a REPL or as individual commands.

sphinxcli repl
sphinxcli build
sphinxcli build html
sphinxcli build html:latex
sphinxcli build html en
sphinxcli build html en:fr

REPL

If you don't use a command i.e. you just call sphinxcli you'll be put into a REPL where the commands below can be used one after another

$ sphinxcli

sphinxcli> settings
SphinxCLI Settings
  source       = src/docs
  target       = docs
  builders     = ['html']
  languages    = ['en']
  config       = src/docs
  doctree      = artifact/doctree
  target_order = builder

sphinxcli> set languages en:fr

sphinxcli> set target build/docs

sphinxcli> build
Build Settings
  config  = /sphinxcli/src/docs
  source  = /sphinxcli/src/docs
  doctree = /sphinxcli/artifact/doctree

Building html
  language  = en
  directory = /sphinxcli/docs/html/en

Building html
  language  = fr
  directory = /sphinxcli/docs/html/fr

sphinxcli> clean
Cleaning all generated files
  Removed documents in docs...
  Removed doctrees in artifact/doctree...

sphinxcli> quit

Commands

help or ?

Using help or ? displays a list of the available commands

Available commands:
  ?        - Display this list of commands
  build    - Build Sphinx the documents
  clean    - Clean any generated files
  exit     - Exit the REPL
  get      - Get a configuration setting
  help     - Display this list of commands
  quit     - Quit the REPL
  set      - Set a configuration setting's value
  settings - Display the current values of all settings
  version  - Display the version number of this tool

exit or quit

Exits the REPL

build

To run all builders and all languages defined in the config file use

sphinxcli build

To run a specific builder specify it after the build command

sphinxcli build html

To run multiple builders add them after the build command separated by : characters.

sphinxcli build "html:latex"

To generate documents for specific languages specify them after the builders.

sphinxcli build html "en:fr"

clean

Removes any built files (documents and doctrees)

get

Get a setting's value

set

Set a setting's value and update the pyproject.toml file.

settings

Display a list of the current settings

SphinxCLI Settings
  source       = src/docs/source
  target       = docs
  builders     = ['html']
  languages    = ['en']
  config       = src/docs/source
  doctree      = src/docs/build/doctree
  target_order = builder

version

Displays the version number of the tool

Configuration

The tool is configured within the pyproject.toml file.

The builders item defines which builders are run by default and can be specified as

  • a string with one builder e.g. html
  • a string with multiple builders separated by a : character e.g. html:latex
  • a list of builders e.g. ["html", "latex"]

The source item defines the directory where the Sphinx source files (.rst/.md) can be found.

The target item specifies where the built files will be written

The languages specifies the default languages to be built and can be specified like the builders item.

The config item specifies the directory where the Sphinx conf.py can be found.

The doctree item specifies where the Sphinx environment files will be stored.

The target_order item specifies how the built files will be structured. It can be either

  • builder which means the files will be written to the directory structure target/builder/language
  • language which means the files will be written to the directory structure target/language/builder
[tool.sphinxcli]
builders = ["html"]
source = "src/docs/source"
target = "docs"
languages = ["en"]
config = "src/docs/source"
doctree = "src/docs/build/doctree"
target_order = "builder"

Metadata

Release files for sphinxcli 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinxcli 0.1.1
File Size Uploaded Provenance
sphinxcli-0.1.1.tar.gz 19.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinxcli 0.1.1
File Interpreter ABI Platform
sphinxcli-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 43.4 kB

Release files / sphinxcli-0.1.1.tar.gz

Download URL sphinxcli-0.1.1.tar.gz
Size 19.9 kB
Tags Source
SHA-256 checksum
How to use checksums
944ff87afb00f20e1db44ae8ed1be1c0375698236a2e1b2d5651c644ad4afc6d
BLAKE2b-256 checksum
How to use checksums
603f9f3550e598f7a514e8261a597e893d85eab02cb01e1274c40780ee3d00e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.1 CPython/3.10.7 Linux/5.19.12-200.fc36.x86_64

Release files / sphinxcli-0.1.1-py3-none-any.whl

Download URL sphinxcli-0.1.1-py3-none-any.whl
Size 23.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d4931cb17d3b1e3d2a5d4bc9180473c9b06645a0fb91522de3c52ad4f383b944
BLAKE2b-256 checksum
How to use checksums
5e78706bb77e3dc1cbb2ec815ec19d16de4739dca5c6699144fd866399d39208
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.1 CPython/3.10.7 Linux/5.19.12-200.fc36.x86_64

Security for sphinxcli 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page