Skip to main content

Sphinx extension for autodocumenting localecmd modules

Project description

sphinx-localecmddoc

Sphinx extension for autodocumenting localecmd modules The extension is hard-coded to generate markdown to be parsed with the myst-parser.

Install

The commands assume that your virtual environment is activated in the terminal. The installation will also install the needed dependencies if not present:

  • Sphinx
  • Myst-parser
  • Localecmd (which is needed for what to document)

Install from git (not recommended, but only option)

To install the package and its dependencies, run

pip install sphinx-localecmddoc @ git+https://codeberg.org/jbox/sphinx-localecmddoc.git

Remember to add the dependency to the pyproject.toml (or equvalent)

Usage and configuration

The guide assumes that you already have set up sphinx with myst-parser.

Within the conf.py, add the extension to the extension list:

extensions = [
...
    'localecmddoc',
...
]

You must also add the searchpath for localecmd.Modules, see below.

Module searchpath

Now the searchpath for localecmd.Modules has to be added. This is a list of all modules within your project that contain the localecmd.Modules you want to document.

Adding the searchpath is an important step, as the extension must know where to look for the modules. The modules will be imported with importlib, meaning that the project must be on the search path of Python. The right way of doing this is to install the project in editable mode: pip install -e ..

For example, if the project name is project and modules are in cmd, write

localecmd_searchmodules = ['project.cmd']

Output directory

This is currently 'function' and cannot be changed yet.

Name of builtin module

Localecmd has some builtin commands. These are included in the generated documentation under the name 'core' by default. This name can be changed with localecmd_builtins_modulename, for example 'builtins':

localecmd_builtins_modulename = 'builtins'

To not generate the documentation for the builtin commands, set the variable to an empty string:

localecmd_builtins_modulename = ''

Develop

git clone https://codeberg.org/jbox/sphinx-localecmddoc.git
cd sphinx-localecmddoc
python3 -m venv .venv --prompt sphinx-localecmddoc
source .venv/bin/activate
pip install -U pip
pip install -e . --group dev
pre-commit install

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx_localecmddoc-0.1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sphinx_localecmddoc-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file sphinx_localecmddoc-0.1.0.tar.gz.

File metadata

  • Download URL: sphinx_localecmddoc-0.1.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for sphinx_localecmddoc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3f0cfab30d32af09815daabc6a69b30de4af1478aba3290eff37303cbc73ed6b
MD5 325367d6bb479ccb1dcad8d19239a71a
BLAKE2b-256 6d661c2721173b3ef77d639a4d7a547c187330c43e88ef2e9a40322312a223d4

See more details on using hashes here.

File details

Details for the file sphinx_localecmddoc-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sphinx_localecmddoc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 211ab86ef6a822bb49d3917911d713c05d2cf0950dc30988cc611190cf87a710
MD5 25e5040a2fbbc62d090fbaf9348e0c74
BLAKE2b-256 abdeb68127bbe77ee0d96051166db3b13c4d2352f52a99fd083aae41fac2853c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page