No project description provided
Project description
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 structuretarget/builder/language
language
which means the files will be written to the directory structuretarget/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"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sphinxcli-0.1.1.tar.gz
.
File metadata
- Download URL: sphinxcli-0.1.1.tar.gz
- Upload date:
- Size: 19.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.10.7 Linux/5.19.12-200.fc36.x86_64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 944ff87afb00f20e1db44ae8ed1be1c0375698236a2e1b2d5651c644ad4afc6d |
|
MD5 | 91dcc0b1fe6c277f6bc4a6100ed98341 |
|
BLAKE2b-256 | 603f9f3550e598f7a514e8261a597e893d85eab02cb01e1274c40780ee3d00e1 |
File details
Details for the file sphinxcli-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: sphinxcli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 23.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.10.7 Linux/5.19.12-200.fc36.x86_64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4931cb17d3b1e3d2a5d4bc9180473c9b06645a0fb91522de3c52ad4f383b944 |
|
MD5 | ab1e1c695582bfd7a5ecebd046985415 |
|
BLAKE2b-256 | 5e78706bb77e3dc1cbb2ec815ec19d16de4739dca5c6699144fd866399d39208 |