Skip to main content

A sphinx theme for IATI documentation sites.

Project description

IATI Sphinx Theme

How do I use IATI Sphinx Theme?

Please see the IATI Sphinx Theme Documentation for usage instructions.

How do I contribute to IATI Sphinx Theme?

Install dependencies

pip install -r requirements_dev.txt

Update dependencies

python -m piptools compile --extra=dev -o requirements_dev.txt pyproject.toml
pip install -r requirements_dev.txt

Run linting

black iati_sphinx_theme/ docs/
isort iati_sphinx_theme/ docs/
flake8 iati_sphinx_theme/ docs/
mypy iati_sphinx_theme/ docs/

Documentation with live preview

  1. In one terminal, build the CSS in watch mode

    npm run build:watch
    
  2. In a separate terminal, install the Sphinx theme then start the docs development server:

    pip install -e .
    sphinx-autobuild -a docs docs/_build/html --watch iati_sphinx_theme/
    

Testing a local version of the theme against another project

To run a local version of the theme with another project, e.g. my-docs, take the following steps:

  1. Clone the sphinx-theme repository, and checkout the branch or tag you want to use.

  2. Run the following command in the sphinx-theme directory, to build the CSS for the theme.

    npm run build
    
  3. Go to my-docs directory, and install the Sphinx theme

    pip install -e /path/to/sphinx-theme
    
  4. Set the html_theme option in your conf.py

    html_theme = "iati_sphinx_theme"
    
  5. Start the docs development server:

    pip install sphinx-autobuild
    sphinx-autobuild docs docs/_build/html
    

Translation

Follow the steps below to translate the theme's built-in strings from the HTML templates in the iati_sphinx_theme directory. The message catalog name is sphinx.[pot|po|mo] and is found in the iati_sphinx_theme/locale directory. These are bundled with the published theme in order for consumers to have access to the translations.

A Makefile exists to make running the commands easier:

  1. Extract text into .pot files

    make extract
    
  2. Update existing .po files based on .pot files

    make update
    
  3. Optionally, initialise a .po file for a new language

    make init lang=es
    
  4. Add translations to the .po files

  5. Compile to .mo files (only applies to the theme's built-in strings, so that they can be bundled with the theme)

    make compile
    

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

iati_sphinx_theme-1.10.0.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

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

iati_sphinx_theme-1.10.0-py2.py3-none-any.whl (30.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file iati_sphinx_theme-1.10.0.tar.gz.

File metadata

  • Download URL: iati_sphinx_theme-1.10.0.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.16

File hashes

Hashes for iati_sphinx_theme-1.10.0.tar.gz
Algorithm Hash digest
SHA256 5d7b9ea223afa367ea68d49957483295031dd709d6c72a5efcdc12814563e3e8
MD5 2a64cde09ebc45e2f00f949985abffe9
BLAKE2b-256 477d207553e64a0756f5f93ae7f6bff5a572724bf523235158b2bbafb7a449f6

See more details on using hashes here.

File details

Details for the file iati_sphinx_theme-1.10.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for iati_sphinx_theme-1.10.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 941f25ef2edfc1a3c79185d7be38525b8b84b9a81630c650eeec3c17b675d566
MD5 35c66a9ee9e086fd480f3dfab31aed7d
BLAKE2b-256 4f834cc22e3935b78a122dd2588d439b0f6b7be548bd62ff66db1a9cb5bc8f31

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