diff --git a/.babel.cfg b/.babel.cfg new file mode 100644 index 00000000..cc4c9de0 --- /dev/null +++ b/.babel.cfg @@ -0,0 +1,3 @@ +[javascript: **.js] + +[jinja2: **.html] diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..5621e4b7 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: monthly + assignees: + - "ezio-melotti" + groups: + actions: + patterns: + - "*" + cooldown: + default-days: 7 diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 00000000..5f89818f --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,5 @@ +changelog: + exclude: + authors: + - dependabot[bot] + - pre-commit-ci[bot] diff --git a/.github/workflows/documentation-links.yml b/.github/workflows/documentation-links.yml new file mode 100644 index 00000000..a4de7dcd --- /dev/null +++ b/.github/workflows/documentation-links.yml @@ -0,0 +1,24 @@ +name: Read the Docs PR preview +# Automatically edits a pull request's descriptions with a link +# to the documentation's preview on Read the Docs. + +on: + pull_request_target: + types: + - opened + +permissions: + pull-requests: write + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + documentation-links: + runs-on: ubuntu-latest + steps: + - uses: readthedocs/actions/preview@v1 + with: + project-slug: "python-docs-theme-previews" + single-version: "true" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..2c301a86 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,19 @@ +name: Lint + +on: [push, pull_request, workflow_dispatch] + +permissions: {} + +env: + FORCE_COLOR: 1 + RUFF_OUTPUT_FORMAT: github + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + - uses: j178/prek-action@v2 diff --git a/.github/workflows/pypi-package.yml b/.github/workflows/pypi-package.yml new file mode 100644 index 00000000..27343998 --- /dev/null +++ b/.github/workflows/pypi-package.yml @@ -0,0 +1,58 @@ +name: Build & maybe upload PyPI package + +on: + push: + pull_request: + release: + types: + - published + workflow_dispatch: + +permissions: {} + +env: + FORCE_COLOR: 1 + +jobs: + # Always build & lint package. + build-package: + name: Build & verify package + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + - uses: actions/setup-python@v6 + + - name: Compile translations + run: | + pip install --upgrade pip + pip install -r requirements.txt + python babel_runner.py compile + + - uses: hynek/build-and-inspect-python-package@v2 + + # Upload to real PyPI on GitHub Releases. + release-pypi: + name: Publish to PyPI + environment: release-pypi + # Only run for published releases. + if: | + github.repository_owner == 'python' + && github.event.action == 'published' + runs-on: ubuntu-latest + needs: build-package + + permissions: + id-token: write + + steps: + - name: Download packages built by build-and-inspect-python-package + uses: actions/download-artifact@v8 + with: + name: Packages + path: dist + + - name: Upload package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 824bb0c6..6a10a674 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,36 +1,95 @@ ---- - name: Tests -on: - push: - branches: - - master - pull_request: - branches: - - master +on: [push, pull_request, workflow_dispatch] + +permissions: {} + +env: + FORCE_COLOR: 1 jobs: build_doc: - name: 'Build cpython doc' + name: Build CPython docs runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.15", "3.14", "3.13", "3.12"] + include: + - python-version: "3.15" + branch: "main" steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v6 with: - python-version: 3.8 - - name: clone docsbuild scripts + persist-credentials: false + - uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + allow-prereleases: true + cache: pip + - name: Clone docsbuild scripts run: | git clone https://github.com/python/docsbuild-scripts/ - - name: setup requirements + - name: Set up requirements run: | python -m pip install --upgrade pip - python -m pip install jinja2 markupsafe zc.lockfile - - name: build docs + python -m pip install -r docsbuild-scripts/requirements.txt + - name: Build documentation + run: > + python ./docsbuild-scripts/build_docs.py + --quick + --build-root ./build_root + --www-root ./www + --log-directory ./logs + --group "$(id -g)" + --skip-cache-invalidation + --theme "$(pwd)" + --languages en + --branches ${{ matrix.branch || matrix.python-version }} + ${{ matrix.branch == 'main' && '--select-output no-html' || '' }} + - name: Show logs + if: failure() run: | - python3 ./docsbuild-scripts/build_docs.py --quick --build-root ./build_root --www-root ./www --log-directory ./logs --group $(id -g) --skip-cache-invalidation --theme $(pwd) --language en --branch 3.9 - - name: 'Upload' - uses: actions/upload-artifact@v2.2.2 + cat ./logs/docsbuild.log + - name: Upload + uses: actions/upload-artifact@v7 with: - name: doc-html + name: doc-html-${{ matrix.python-version }} path: www/ + + translations: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-latest", "windows-latest"] + # Test minimum supported and latest stable from 3.x series + python-version: ["3.12", "3"] + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + - uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + allow-prereleases: true + cache: pip + - name: Install dependencies + run: | + pip install --upgrade pip + pip install -r requirements.txt + - name: Remove locale file for testing + shell: bash + run: rm -rf python_docs_theme/locale/pt_BR/ + - run: python babel_runner.py extract + - run: python babel_runner.py init -l pt_BR + - run: python babel_runner.py update + - run: python babel_runner.py update -l pt_BR + - run: python babel_runner.py compile + - run: python babel_runner.py compile -l pt_BR + - name: Print .pot file + shell: bash + run: cat python_docs_theme/locale/python-docs-theme.pot + - name: Print .po file + shell: bash + run: cat python_docs_theme/locale/pt_BR/LC_MESSAGES/python-docs-theme.po diff --git a/.github/zizmor.yml b/.github/zizmor.yml new file mode 100644 index 00000000..9b42b47c --- /dev/null +++ b/.github/zizmor.yml @@ -0,0 +1,10 @@ +# Configuration for the zizmor static analysis tool, run via pre-commit in CI +# https://woodruffw.github.io/zizmor/configuration/ +rules: + dangerous-triggers: + ignore: + - documentation-links.yml + unpinned-uses: + config: + policies: + "*": ref-pin diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..6ff79684 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,56 @@ +repos: + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.14.10 + hooks: + - id: ruff-check + args: [--exit-non-zero-on-fix] + + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 25.12.0 + hooks: + - id: black + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: check-case-conflict + - id: check-merge-conflict + - id: check-toml + - id: check-yaml + - id: debug-statements + - id: end-of-file-fixer + - id: trailing-whitespace + + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.36.0 + hooks: + - id: check-dependabot + - id: check-github-workflows + + - repo: https://github.com/rhysd/actionlint + rev: v1.7.10 + hooks: + - id: actionlint + + - repo: https://github.com/woodruffw/zizmor-pre-commit + rev: v1.19.0 + hooks: + - id: zizmor + + - repo: https://github.com/tox-dev/pyproject-fmt + rev: v2.11.1 + hooks: + - id: pyproject-fmt + + - repo: https://github.com/abravalheri/validate-pyproject + rev: v0.24.1 + hooks: + - id: validate-pyproject + + - repo: meta + hooks: + - id: check-hooks-apply + - id: check-useless-excludes + +ci: + autoupdate_schedule: quarterly diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 00000000..7ac1f464 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,15 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details +# Project page: https://readthedocs.org/projects/python-docs-theme-previews/ + +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3" + + commands: + - git clone --depth=1 https://github.com/python/cpython + - make html CPYTHON_PATH=cpython + - mv cpython/Doc/build _readthedocs diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..8c34acb1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,260 @@ +# Changelog + +## [2026.3](https://github.com/python/python-docs-theme/releases/tag/2026.3) + +* Add colors for new thread-safety levels by @lysnikolaou in https://github.com/python/python-docs-theme/pull/299 + +## [2026.2](https://github.com/python/python-docs-theme/releases/tag/2026.2) + +* Style codeblock `:caption:` by @StanFromIreland in https://github.com/python/python-docs-theme/pull/288 +* Enable copy button for shell sessions and consoles by @hugovk in https://github.com/python/python-docs-theme/pull/295 +* Add colors for thread safety annotations by @lysnikolaou in https://github.com/python/python-docs-theme/pull/297 + +## [2025.12](https://github.com/python/python-docs-theme/releases/tag/2025.12) + +* Add support for green, red and yellow side borders for code examples by @hugovk in https://github.com/python/python-docs-theme/pull/285 +* Add Portuguese translation by @NyaPuma in https://github.com/python/python-docs-theme/pull/281 +* Add support for Python 3.15 by @hugovk in https://github.com/python/python-docs-theme/pull/282 +* Convert CHANGELOG and CONTRIBUTING from .rst to .md by @hugovk in https://github.com/python/python-docs-theme/pull/277 +* Add zizmor to CI and fix findings by @hugovk in https://github.com/python/python-docs-theme/pull/283 + +## [2025.10](https://github.com/python/python-docs-theme/releases/tag/2025.10) + +* Add Romanian translation by @octaG-M in https://github.com/python/python-docs-theme/pull/272 +* Add Arabic and Russian translations by @StanFromIreland in https://github.com/python/python-docs-theme/pull/274 +* Add French translation by @JulienPalard in https://github.com/python/python-docs-theme/pull/275 +* Update authors in `pyproject.toml` by @StanFromIreland in https://github.com/python/python-docs-theme/pull/271 +* Add link to devguide in README by @StanFromIreland in https://github.com/python/python-docs-theme/pull/266 + +## [2025.9.2](https://github.com/python/python-docs-theme/releases/tag/2025.9.2) + +* Add Korean and Indonesian translations from Transifex in https://github.com/python/python-docs-theme/pull/264 +* Add German translation by @cmaureir in https://github.com/python/python-docs-theme/pull/262 +* Fix compilation of translations and loading of translations on pages with html + source in https://github.com/python/python-docs-theme/pull/263 +* Fix search button cutting off long translations in https://github.com/python/python-docs-theme/pull/268 +* Fix `Copy` button copying line numbers by @StanFromIreland in https://github.com/python/python-docs-theme/pull/270 + +## [2025.9.1](https://github.com/python/python-docs-theme/releases/tag/2025.9.1) + +* Add Japanese, Turkish and Spanish translations from Transifex in https://github.com/python/python-docs-theme/pull/259 + +## [2025.9](https://github.com/python/python-docs-theme/releases/tag/2025.9) + +* Enable theme translation and add Polish by @StanFromIreland in https://github.com/python/python-docs-theme/pull/246 +* Add Greek translation by @lysnikolaou and @skpanagiotis in https://github.com/python/python-docs-theme/pull/256 and https://github.com/python/python-docs-theme/pull/257 +* Add Swedish translation by @yeager in https://github.com/python/python-docs-theme/pull/250 +* Add Brazilian Portuguese, Simplified Chinese and Traditional Chinese translations from [Transifex](https://explore.transifex.com/python-doc/python-docs-theme/) in https://github.com/python/python-docs-theme/pull/253 + +## [2025.5](https://github.com/python/python-docs-theme/releases/tag/2025.5) + +* Make the copy button only appear when hovered over or clicked on by @kevteg in https://github.com/python/python-docs-theme/pull/243 + +## [2025.4.1](https://github.com/python/python-docs-theme/releases/tag/2025.4.1) + +* Fix copy button with multiple tracebacks by @tomasr8 in https://github.com/python/python-docs-theme/pull/240 + +## [2025.4](https://github.com/python/python-docs-theme/releases/tag/2025.4) + +* Require Sphinx 7.3 by @AA-Turner in https://github.com/python/python-docs-theme/pull/221 +* Add support for Python 3.14 by @hugovk https://github.com/python/python-docs-theme/pull/236 +* Drop support for Python 3.10 and 3.11 by @hugovk in https://github.com/python/python-docs-theme/pull/234 +* Add a copy button to code samples by @tomasr8 in https://github.com/python/python-docs-theme/pull/231 +* Add missing i18n for copy button titles by @tomasr8 in https://github.com/python/python-docs-theme/pull/225 +* Use consistent line-height for light & dark theme by @tomasr8 in https://github.com/python/python-docs-theme/pull/227 +* Remove self-closing tags by @hugovk in https://github.com/python/python-docs-theme/pull/226 +* Replace deprecated classifier with licence expression (PEP 639) by @hugovk in https://github.com/python/python-docs-theme/pull/237 + +## [2025.2](https://github.com/python/python-docs-theme/releases/tag/2025.2) + +- Note minimum requirements for Sphinx (#216) + Contributed by Adam Turner +- Horizontally centre the sidebar collapse button (#219) + Contributed by Tomas Roun +- Make sidebar width more flexible (#218) + Contributed by Tomas Roun +- Set `__version__` in the runtime package (#222) + Contributed by Adam Turner + +## [2024.12](https://github.com/python/python-docs-theme/releases/tag/2024.12) + +- Hide header and search bar when printing (#204) + Contributed by Hugo van Kemenade + +## [2024.10](https://github.com/python/python-docs-theme/releases/tag/2024.10) + +- Add support for Python 3.13 (#196) + Contributed by Hugo van Kemenade +- Drop support for Python 3.8 (#197) + Contributed by Hugo van Kemenade +- Add script for handling translations (#195) + Contributed by Rafael Fontenelle +- Generate digital attestations for PyPI (PEP 740) (#198) + Contributed by Hugo van Kemenade + +## [2024.6](https://github.com/python/python-docs-theme/releases/tag/2024.6) + +- Add backgrounds and borders to admonitions (#190) + Contributed by Hugo van Kemenade +- Use different colour for 'Return value: Borrowed reference' (#188) + Contributed by Hugo van Kemenade + +## [2024.4](https://github.com/python/python-docs-theme/releases/tag/2024.4) + +- Add colour to version change directives (#185) + Contributed by Hugo van Kemenade +- Only show 'Last updated on ...' when `last_updated` defined (#183) + Contributed by Hugo van Kemenade +- Use system font stack for all code (#186) + Contributed by Hugo van Kemenade + +## [2024.3](https://github.com/python/python-docs-theme/releases/tag/2024.3) + +- Modernise font: use system font stack to improve text readability and webpage performance (#174) + Contributed by Hugo van Kemenade +- Remove incorrect CSS property (#178) + Contributed by Kerim Kabirov + +## [2024.2](https://github.com/python/python-docs-theme/releases/tag/2024.2) + +- Do not underline navigation links (#169) + Contributed by Hugo van Kemenade +- Only apply underline offset to code formatting for underline visibility (#171) + Contributed by Hugo van Kemenade + +## [2024.1](https://github.com/python/python-docs-theme/releases/tag/2024.1) + +- Underline links for readability and a11y (#160, #166) + Contributed by Hugo van Kemenade +- Add `hosted_on` variable for a link in the footer (#165) + Contributed by Hugo van Kemenade +- Consistently reference `theme_root_icon` (#163) + Contributed by Marko Budiselic +- Dark mode: fix contrast of footer highlight (#162) + Contributed by Hugo van Kemenade + +## [2023.9](https://github.com/python/python-docs-theme/releases/tag/2023.9) + +- Focus search box when pressing slash (#153) + Contributed by Hugo van Kemenade + +## [2023.8](https://github.com/python/python-docs-theme/releases/tag/2023.8) + +- Add Python 3.12 and 3.13 classifiers (#147) + Contributed by Hugo van Kemenade +- Dark mode: Also give aside.topic a dark background (#150) + Contributed by Hugo van Kemenade +- Restore the menu on mobile devices (inadvertently broken in 2023.7) (#146) + Contributed by Hugo van Kemenade + +## [2023.7](https://github.com/python/python-docs-theme/releases/tag/2023.7) + +- Fix compatibility with Sphinx 7.1 (#137) + Contributed by Pradyun Gedam +- Enable the slash keypress to focus the search field (#141) + Contributed by Mike Fiedler +- Sphinx 6.2 fix: add `nav.contents` where `div.topic` is used (#138) + Contributed by Hugo van Kemenade +- Dark mode: fix contrast for C++ specific styling (#133) + Contributed by Hugo van Kemenade +- Don't let long code literals extend beyond the right side of the screen (#139) + Contributed by Hugo van Kemenade +- Test with Python 3.12 (#140) + Contributed by Hugo van Kemenade + +## [2023.5](https://github.com/python/python-docs-theme/releases/tag/2023.5) + +- Add a dark theme. (#44) + Contributed by Nils K +- Fix: Remove searchbox id from form. (fixes #117) + Contributed by Nils K +- Update `python-docs-theme` to work with Sphinx 5 & 6. (#99 & #127) + Contributed by Adam Turner +- Override font for `.sig` for consistency with other code blocks. (#121) + Contributed by Chris Warrick +- Dark mode: add class to invert image brightness. (#128) + Contributed by Hugo van Kemenade + + +## [2023.3.1](https://github.com/python/python-docs-theme/releases/tag/2023.3.1) + +- Skip cache-busting for old Sphinx #113 + + +## [2023.3](https://github.com/python/python-docs-theme/releases/tag/2023.3) + +- Fix problem with monospace rendering in Vivaldi #104 +- Fix mobile nav obstructing content #96 +- Reduce footer margin only for desktop #106 +- Append a hash ?digest to CSS files for cache-busting #108 + + +## [2022.1](https://github.com/python/python-docs-theme/releases/tag/2022.1) + +- Add a configuration for license URL. (#90) +- Exclude the floating navbar from CHM help. (#84) +- Make sidebar scrollable and sticky (on modern browsers) (#91) + + +## [2021.11.1](https://github.com/python/python-docs-theme/releases/tag/2021.11.1) + +- Fix monospace again, on buggy Google Chrome (#87) + Contributed by Tushar Sadhwani + + +## [2021.11](https://github.com/python/python-docs-theme/releases/tag/2021.11) + +- Fix monospace on buggy Google Chrome (#85) + Contributed by Tushar Sadhwani + + +## [2021.8](https://github.com/python/python-docs-theme/releases/tag/2021.8) + +- Add the copyright_url variable in the theme (#67) + Contributed by jablonskidev +- Improve readability (#79) + Contributed by Olga Bulat +- Remove #searchbox on mobile to fix a layout bug (#76) + Contributed by Olga Bulat +- Fix the appearance of version/language selects (#74) + Contributed by Olga Bulat + + +## [2021.5](https://github.com/python/python-docs-theme/releases/tag/2021.5) + +- Make the theme responsive (#46) + Contributed by Olga Bulat. +- Use Python 3.8 for the Github Actions (#71) + Contributed by Stéphane Wirtel. +- Use default pygments theme (#68) + Contributed by Aaron Carlisle. +- Test Github action to validate the theme against docsbuild scripts. (#69) + Contributed by Julien Palard. +- Add the copy button to pycon3 highlighted code blocks. (#64) + Contributed by Julien Palard. + + +## [2020.12](https://github.com/python/python-docs-theme/releases/tag/v2020.12) + +- Updated the readme, to remind user to install the package in a virtual environment. (#41) + Contributed by Mariatta. +- Updated the package url, using the GitHub repository instead of docs.python.org (#49) + Contributed by Pradyun Gedam. +- Added license information to the footer of the doc (#36) + Contributed by Todd. +- Fixed typo in the footer (#52) + Contributed by Dominic Davis-Foster. +- Added information on how to use the package (#32) + Contributed by Tapasweni Pathak. +- Fixed code formatting (#53). + Contributed by Hugo van Kemenade. +- Fixed code bgcolor and codetextcolor for Sphinx 3.1.0+ (#57) + Contributed by Zhiming Wang. + +## 2018.7 +Corresponds to [44a8f30](https://github.com/python/python-docs-theme/commit/44a8f306db9ec86d277a8a687538d5d51e415130) + + +## [2018.2](https://github.com/python/python-docs-theme/releases/tag/2018.2) + +Initial release. diff --git a/CHANGELOG.rst b/CHANGELOG.rst deleted file mode 100644 index 1baefff9..00000000 --- a/CHANGELOG.rst +++ /dev/null @@ -1,73 +0,0 @@ -========= -Changelog -========= - -`2021.11.1 `_ ------------------------------------------------------------------------------------ - -- Fix monospace again, on buggy Google Chrome (#87) - Contributed by Tushar Sadhwani - - -`2021.11 `_ -------------------------------------------------------------------------------- - -- Fix monospace on buggy Google Chrome (#85) - Contributed by Tushar Sadhwani - - -`2021.8 `_ ------------------------------------------------------------------------------- - -- Add the copyright_url variable in the theme (#67) - Contributed by jablonskidev -- Improve readability (#79) - Contributed by Olga Bulat -- Remove #searchbox on mobile to fix a layout bug (#76) - Contributed by Olga Bulat -- Fix the appearance of version/language selects (#74) - Contributed by Olga Bulat - - -`2021.5 `_ ------------------------------------------------------------------------------- - -- Make the theme responsive (#46) - Contributed by Olga Bulat. -- Use Python 3.8 for the Github Actions (#71) - Contributed by Stéphane Wirtel. -- Use default pygments theme (#68) - Contributed by Aaron Carlisle. -- Test Github action to validate the theme against docsbuild scripts. (#69) - Contributed by Julien Palard. -- Add the copy button to pycon3 highlighted code blocks. (#64) - Contributed by Julien Palard. - - -`2020.12 `_ ------------------------------------------------------------------------------- - -- Updated the readme, to remind user to install the package in a virtual environment. (#41) - Contributed by Mariatta. -- Updated the package url, using the GitHub repository instead of docs.python.org (#49) - Contributed by Pradyun Gedam. -- Added license information to the footer of the doc (#36) - Contributed by Todd. -- Fixed typo in the footer (#52) - Contributed by Dominic Davis-Foster. -- Added information on how to use the package (#32) - Contributed by Tapasweni Pathak. -- Fixed code formatting (#53). - Contributed by Hugo van Kemenade. -- Fixed code bgcolor and codetextcolor for Sphinx 3.1.0+ (#57) - Contributed by Zhiming Wang. - -2018.7 ------- -Corresponds to `44a8f30 `_ - - -`2018.2 `_ ---------------------------------------------------------------------------- - -Initial release. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..4ca0f05a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,27 @@ +# How to release + +- Update `CHANGELOG.md` +- Bump version (YYYY.MM) in `python_docs_theme/__init__.py` +- Commit +- Push to check tests pass on + [GitHub Actions](https://github.com/python/python-docs-theme/actions) +- Go to https://github.com/python/python-docs-theme/releases +- Click "Draft a new release" +- Click "Tag: Select tag" +- Type the next YYYY.MM version (no leading zero) and + select "Create new tag" +- Click "Create" for "YYYY.MM will be created on publish" +- Leave the "Release title" blank (it will be autofilled) +- Click "Generate release notes" and amend as required +- Click "Publish release" +- Check the tagged [GitHub Actions build](https://github.com/python/python-docs-theme/actions/workflows/pypi-package.yml) + has deployed to [PyPI](https://pypi.org/project/python-docs-theme/#history) + +# Makefile usage + +This project includes a simple Makefile for syncing changes to the theme with +the main CPython repository. Run `make help` for details on available rules. + +There is one configurable variable, `CPYTHON_PATH`, which should be the path +to the CPython repository on your machine. By default, it points to +`../cpython`. diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst deleted file mode 100644 index 8f5edaa5..00000000 --- a/CONTRIBUTING.rst +++ /dev/null @@ -1,15 +0,0 @@ -# How to release - -- Update CHANGELOG.rst -- bump version (YYYY.MM) in setup.py and python_docs_theme/theme.conf -- commit -- push to check one last time if the tests pass github side. -- tag it (YYYY.MM). -- build (``python -m build``) -- Test it (in :file:`cpython/Doc` run - ``./venv/bin/pip install ../../python-docs-theme/dist/python-docs-theme-2021.8.tar.gz`` - then build the doc using ``make html``). -- upload it: ``twine upload dist/*``. -- bump version (YYYY.MM.dev) in setup.py and python_docs_theme/theme.conf -- Commit this last bump. -- push and push the tag (``git push && git push --tags``) diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 3ae74ecc..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,2 +0,0 @@ -include LICENSE README.rst -recursive-include python_docs_theme *.* diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..dda3c238 --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +# You can set these variables from the command line. +CPYTHON_PATH = ../cpython +PYTHON = python3 +PACKAGE_ABS_PATH = $(shell pwd)/$(shell find dist/python-docs-theme-*.tar.gz) +SPHINXOPTS = + + +.PHONY: help +help: + @echo "Please use \`make ' where is one of" + @echo " venv to create a venv with necessary tools at $(CPYTHON_PATH)/Doc/venv" + @echo " html to make standalone CPython HTML files" + @echo " htmlview to open the index page built by the html target in your browser" + +.PHONY: venv +venv: + $(PYTHON) -m pip install build + $(PYTHON) -m build + cd $(CPYTHON_PATH)/Doc \ + && make venv \ + && ./venv/bin/pip install $(PACKAGE_ABS_PATH) + +.PHONY: html +html: venv + cd $(CPYTHON_PATH)/Doc && \ + make SPHINXOPTS="$(SPHINXOPTS)" html + +.PHONY: htmlview +htmlview: html + $(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('$(CPYTHON_PATH)/Doc/build/html/index.html'))" diff --git a/README.md b/README.md new file mode 100644 index 00000000..6d89793a --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# Python Docs Sphinx Theme + +This is the theme for the Python documentation. +It requires Python 3.12 or newer and Sphinx 7.3 or newer. + +Note that when adopting this theme, you're also borrowing an element of the +trust and credibility established by the CPython core developers over the +years. That's fine, and you're welcome to do so for other Python community +projects if you so choose, but please keep in mind that in doing so you're also +choosing to accept some of the responsibility for maintaining that collective +trust. + +To use the theme, install it into your docs build environment via `pip` +(preferably in a virtual environment). + + +## Configuration options + +To use this theme, add the following to `conf.py`: + +- `html_theme = 'python_docs_theme'` + +- `html_sidebars`, defaults taken from https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_sidebars + + +## Translation + +This theme supports localization. For more information see the [Python Developer's +Guide](https://devguide.python.org/documentation/translations/translating/#how-do-i-translate-the-python-docs-sphinx-theme). + + +## Preview + +See a demo of the CPython docs using this theme: + +- https://python-docs-theme-previews.readthedocs.io + +The kitchen sink is a showcase of every Sphinx feature: + +- https://sphinx-themes.org/sample-sites/python-docs-theme/kitchen-sink/ diff --git a/README.rst b/README.rst deleted file mode 100644 index 3f2e8443..00000000 --- a/README.rst +++ /dev/null @@ -1,24 +0,0 @@ -Python Docs Sphinx Theme -========================= - -This is the theme for the Python documentation. - -Note that when adopting this theme, you're also borrowing an element of the -trust and credibility established by the CPython core developers over the -years. That's fine, and you're welcome to do so for other Python community -projects if you so choose, but please keep in mind that in doing so you're also -choosing to accept some of the responsibility for maintaining that collective -trust. - -To use the theme, install it into your docs build environment via ``pip`` -(preferably in a virtual environment). - - -Configuration options ---------------------- - -To use this theme, add the following to ``conf.py``: - -- ``html_theme = 'python_docs_theme'`` - -- ``html_sidebars``, defaults taken from http://www.sphinx-doc.org/en/stable/config.html#confval-html_sidebars diff --git a/babel_runner.py b/babel_runner.py new file mode 100755 index 00000000..677f6da2 --- /dev/null +++ b/babel_runner.py @@ -0,0 +1,139 @@ +"""Script for handling translations with Babel""" + +from __future__ import annotations + +import argparse +import ast +import subprocess +import tomllib +from pathlib import Path + +# Global variables used by pybabel below (paths relative to PROJECT_DIR) +DOMAIN = "python-docs-theme" +COPYRIGHT_HOLDER = "Python Software Foundation" +SOURCE_DIR = "python_docs_theme" +MAPPING_FILE = ".babel.cfg" + +PROJECT_DIR = Path(__file__).resolve().parent +PYPROJECT_TOML = Path(PROJECT_DIR, "pyproject.toml") +INIT_PY = PROJECT_DIR / SOURCE_DIR / "__init__.py" +LOCALES_DIR = Path(f"{SOURCE_DIR}", "locale") +POT_FILE = Path(LOCALES_DIR, f"{DOMAIN}.pot") + + +def get_project_info() -> dict: + """Retrieve project's info to populate the message catalog template""" + pyproject_text = PYPROJECT_TOML.read_text(encoding="utf-8") + project_data = tomllib.loads(pyproject_text)["project"] + + # read __version__ from __init__.py + for child in ast.parse(INIT_PY.read_bytes()).body: + if not isinstance(child, ast.Assign): + continue + target = child.targets[0] + if not isinstance(target, ast.Name) or target.id != "__version__": + continue + version_node = child.value + if not isinstance(version_node, ast.Constant): + continue + project_data["version"] = version_node.value + break + + return project_data + + +def extract_messages() -> None: + """Extract messages from all source files into message catalog template""" + Path(PROJECT_DIR, LOCALES_DIR).mkdir(parents=True, exist_ok=True) + project_data = get_project_info() + subprocess.run( + [ + "pybabel", + "extract", + "-F", + MAPPING_FILE, + "--copyright-holder", + COPYRIGHT_HOLDER, + "--project", + project_data["name"], + "--version", + project_data["version"], + "--msgid-bugs-address", + project_data["urls"]["Issue tracker"], + "-o", + POT_FILE, + SOURCE_DIR, + ], + cwd=PROJECT_DIR, + check=True, + ) + + +def init_locale(locale: str) -> None: + """Initialize a new locale based on existing message catalog template""" + pofile = PROJECT_DIR / LOCALES_DIR / locale / "LC_MESSAGES" / f"{DOMAIN}.po" + if pofile.exists(): + print(f"There is already a message catalog for locale {locale}, skipping.") + return + cmd = [ + "pybabel", + "init", + "-i", + POT_FILE, + "-d", + LOCALES_DIR, + "-D", + DOMAIN, + "-l", + locale, + ] + subprocess.run(cmd, cwd=PROJECT_DIR, check=True) + + +def update_catalogs(locale: str) -> None: + """Update translations from existing message catalogs""" + cmd = ["pybabel", "update", "-i", POT_FILE, "-d", LOCALES_DIR, "-D", DOMAIN] + if locale: + cmd.extend(["-l", locale]) + subprocess.run(cmd, cwd=PROJECT_DIR, check=True) + + +def compile_catalogs(locale: str) -> None: + """Compile existing message catalogs""" + cmd = ["pybabel", "compile", "-d", LOCALES_DIR, "-D", DOMAIN] + if locale: + cmd.extend(["-l", locale]) + subprocess.run(cmd, cwd=PROJECT_DIR, check=True) + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument( + "command", + choices=["extract", "init", "update", "compile"], + help="command to be executed", + ) + parser.add_argument( + "-l", + "--locale", + default="", + help="language code (needed for init, optional for update and compile)", + ) + + args = parser.parse_args() + locale = args.locale + + if args.command == "extract": + extract_messages() + elif args.command == "init": + if not locale: + parser.error("init requires passing the --locale option") + init_locale(locale) + elif args.command == "update": + update_catalogs(locale) + elif args.command == "compile": + compile_catalogs(locale) + + +if __name__ == "__main__": + main() diff --git a/code_of_conduct.rst b/code_of_conduct.rst deleted file mode 100644 index 28de97ce..00000000 --- a/code_of_conduct.rst +++ /dev/null @@ -1,14 +0,0 @@ -Code of Conduct -=============== - -Please note that all interactions on -`Python Software Foundation `__-supported -infrastructure is `covered -`__ -by the `PSF Code of Conduct `__, -which includes all infrastructure used in the development of Python itself -(e.g. mailing lists, issue trackers, GitHub, etc.). - -In general this means everyone is expected to be open, considerate, and -respectful of others no matter what their position is within the project. - diff --git a/pyproject.toml b/pyproject.toml index de11f324..b8598f52 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,74 @@ [build-system] +build-backend = "flit_core.buildapi" requires = [ - "setuptools>=42", - "wheel" + "flit-core>=3.7", ] -build-backend = "setuptools.build_meta" +[project] +name = "python-docs-theme" +description = "The Sphinx theme for the CPython docs and related projects" +readme = "README.md" +license = "PSF-2.0" +license-files = [ "LICENSE" ] +authors = [ { name = "Python Docs Sphinx Theme maintainers" } ] +requires-python = ">=3.12" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Framework :: Sphinx :: Theme", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", + "Topic :: Documentation", + "Topic :: Software Development :: Documentation", +] +dynamic = [ "version" ] + +dependencies = [ + "sphinx>=7.3", +] + +urls.Code = "https://github.com/python/python-docs-theme" +urls.Download = "https://pypi.org/project/python-docs-theme/" +urls.Homepage = "https://github.com/python/python-docs-theme/" +urls."Issue tracker" = "https://github.com/python/python-docs-theme/issues" +entry-points."sphinx.html_themes".python_docs_theme = "python_docs_theme" + +[tool.flit.module] +name = "python_docs_theme" + +[tool.flit.sdist] +include = [ "python_docs_theme/" ] + +[tool.ruff] +fix = true + +lint.select = [ + "C4", # flake8-comprehensions + "E", # pycodestyle errors + "F", # pyflakes errors + "I", # isort + "ISC", # flake8-implicit-str-concat + "LOG", # flake8-logging + "PGH", # pygrep-hooks + "PYI", # flake8-pyi + "RUF022", # unsorted-dunder-all + "RUF100", # unused noqa (yesqa) + "UP", # pyupgrade + "W", # pycodestyle warnings + "YTT", # flake8-2020 +] +lint.ignore = [ + "E203", # Whitespace before ':' + "E221", # Multiple spaces before operator + "E226", # Missing whitespace around arithmetic operator + "E241", # Multiple spaces after ',' +] +lint.isort.required-imports = [ "from __future__ import annotations" ] + +[tool.pyproject-fmt] +max_supported_python = "3.15" diff --git a/python_docs_theme/__init__.py b/python_docs_theme/__init__.py index 407d62a8..e92b7512 100644 --- a/python_docs_theme/__init__.py +++ b/python_docs_theme/__init__.py @@ -1,12 +1,51 @@ -import os +from __future__ import annotations +from pathlib import Path -def setup(app): - current_dir = os.path.abspath(os.path.dirname(__file__)) - app.add_html_theme( - 'python_docs_theme', current_dir) +from sphinx.locale import get_translation + +TYPE_CHECKING = False +if TYPE_CHECKING: + from typing import Any + + from sphinx.application import Sphinx + from sphinx.util.typing import ExtensionMetadata + +__version__ = "2026.3" + +THEME_PATH = Path(__file__).resolve().parent +LOCALE_DIR = THEME_PATH / "locale" +MESSAGE_CATALOG_NAME = "python-docs-theme" + + +def add_translation_to_context( + app: Sphinx, + pagename: str, + templatename: str, + context: dict[str, Any], + doctree: None, +) -> None: + theme_gettext = get_translation(MESSAGE_CATALOG_NAME) + sphinx_gettext = get_translation("sphinx") + + def combined(message: str) -> str: + translation = theme_gettext(message) + if translation == message: + return sphinx_gettext(message) + return translation + + context["_"] = context["gettext"] = context["ngettext"] = combined + + +def setup(app: Sphinx) -> ExtensionMetadata: + app.require_sphinx("7.3") + + app.add_html_theme("python_docs_theme", str(THEME_PATH)) + app.add_message_catalog(MESSAGE_CATALOG_NAME, LOCALE_DIR) + app.connect("html-page-context", add_translation_to_context) return { - 'parallel_read_safe': True, - 'parallel_write_safe': True, + "version": __version__, + "parallel_read_safe": True, + "parallel_write_safe": True, } diff --git a/python_docs_theme/footerdonate.html b/python_docs_theme/footerdonate.html index 2aef2ac2..010014d6 100644 --- a/python_docs_theme/footerdonate.html +++ b/python_docs_theme/footerdonate.html @@ -1,3 +1,3 @@ {% trans %}The Python Software Foundation is a non-profit corporation.{% endtrans %} {% trans %}Please donate.{% endtrans %} -
+
diff --git a/python_docs_theme/layout.html b/python_docs_theme/layout.html index 3b35d9c1..1903fad4 100644 --- a/python_docs_theme/layout.html +++ b/python_docs_theme/layout.html @@ -14,7 +14,7 @@

{{ _('Navigation') }}

{%- endfor %} {%- block rootrellink %} -
  • python logo
  • +
  • {{ theme_root_icon_alt_text }}
  • {{theme_root_name}}{{ reldelim1 }}
  • @@ -37,6 +37,7 @@

    {{ _('Navigation') }}

    {{ reldelim2 }}
  • {%- endif %} +
  • {{ themeselector() }}{{ reldelim2 }}
  • {% endblock %} @@ -47,25 +48,36 @@

    {{ _('Navigation') }}

    {%- if builder != "htmlhelp" %} {%- endif %} {%- endmacro %} +{%- macro themeselector() %} + +{%- endmacro %} + {% block relbar1 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %} {% block relbar2 %} {% if builder != 'qthelp' %} {{ relbar() }} {% endif %} {% endblock %} - {%- block extrahead -%} - + + {%- if builder != "htmlhelp" %} {%- if not embedded %} + + {%- endif -%} {%- endif -%} {{ super() }} @@ -78,35 +90,38 @@

    {{ _('Navigation') }}

    {%- block body_tag %} {{ super() }} +{%- if builder != 'htmlhelp' %}
    - + aria-pressed="false" aria-expanded="false" role="button" aria-label="{{ _('Menu')}}">
    +{% endif -%} {% endblock %} {% block footer %} diff --git a/python_docs_theme/locale/ar/LC_MESSAGES/python-docs-theme.po b/python_docs_theme/locale/ar/LC_MESSAGES/python-docs-theme.po new file mode 100644 index 00000000..de6ee2f5 --- /dev/null +++ b/python_docs_theme/locale/ar/LC_MESSAGES/python-docs-theme.po @@ -0,0 +1,127 @@ +# Translations template for python-docs-theme. +# Copyright (C) 2025 Python Software Foundation +# This file is distributed under the same license as the python-docs-theme +# project. +# FIRST AUTHOR , 2025. +# +# Translators: +# Mostapha Mostapha, 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: python-docs-theme 2025.9.2\n" +"Report-Msgid-Bugs-To: https://github.com/python/python-docs-theme/issues\n" +"POT-Creation-Date: 2025-10-13 01:45+0000\n" +"PO-Revision-Date: 2025-09-06 07:41+0000\n" +"Last-Translator: Mostapha Mostapha, 2025\n" +"Language-Team: Arabic (https://app.transifex.com/python-doc/teams/5390/ar/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.17.0\n" +"Language: ar\n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" + +#: python_docs_theme/footerdonate.html:1 +msgid "The Python Software Foundation is a non-profit corporation." +msgstr "مؤسسة بايثون للبرمجيات هي مؤسسة غير ربحية." + +#: python_docs_theme/footerdonate.html:2 +msgid "Please donate." +msgstr "من فضلك تبرع." + +#: python_docs_theme/layout.html:6 +msgid "Navigation" +msgstr "التنقل" + +#: python_docs_theme/layout.html:51 python_docs_theme/layout.html:111 +msgid "Quick search" +msgstr "بحث سريع" + +#: python_docs_theme/layout.html:52 python_docs_theme/layout.html:112 +msgid "Go" +msgstr "انطلق" + +#: python_docs_theme/layout.html:60 +msgid "Theme" +msgstr "المظهر" + +#: python_docs_theme/layout.html:62 +msgid "Auto" +msgstr "ذاتي" + +#: python_docs_theme/layout.html:63 +msgid "Light" +msgstr "الوضع الفاتح" + +#: python_docs_theme/layout.html:64 +msgid "Dark" +msgstr "الوضع المظلم" + +#: python_docs_theme/layout.html:96 +msgid "Menu" +msgstr "القائمة" + +#: python_docs_theme/layout.html:142 +msgid "Copyright" +msgstr "حقوق الطبع والنشر" + +#: python_docs_theme/layout.html:147 +msgid "" +"This page is licensed under the Python Software Foundation License Version " +"2." +msgstr "تُرخَّص هذه الصفحة بموجب رخصة مؤسسة بايثون للبرمجيات الإصدار 2." + +#: python_docs_theme/layout.html:149 +msgid "" +"Examples, recipes, and other code in the documentation are additionally " +"licensed under the Zero Clause BSD License." +msgstr "" +"أمثلة الكود والوصفات وغيرها في التوثيق مرخّصة أيضًا بموجب رخصة BSD الصفرية " +"(Zero Clause BSD License)." + +#: python_docs_theme/layout.html:152 +#, python-format +msgid "" +"See History and License for more " +"information." +msgstr "" +"انظر القسم التاريخ والترخيص لمزيد من " +"المعلومات." + +#: python_docs_theme/layout.html:155 +#, python-format +msgid "Hosted on %(hosted_on)s." +msgstr "مُستضاف على %(hosted_on)s." + +#: python_docs_theme/layout.html:163 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "آخر تحديث في %(last_updated)s." + +#: python_docs_theme/layout.html:166 +#, python-format +msgid "Found a bug?" +msgstr " تم العثور على خطأ ؟" + +#: python_docs_theme/layout.html:170 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"تم إنشاء المحتوى باستخدام Sphinx " +" %(sphinx_version)s." + +#: python_docs_theme/static/copybutton.js:30 +#: python_docs_theme/static/copybutton.js:55 +msgid "Copy" +msgstr "نسخ" + +#: python_docs_theme/static/copybutton.js:31 +msgid "Copy to clipboard" +msgstr "نسخ إلى الحافظة" + +#: python_docs_theme/static/copybutton.js:53 +msgid "Copied!" +msgstr "تم النسخ!" diff --git a/python_docs_theme/locale/de/LC_MESSAGES/python-docs-theme.po b/python_docs_theme/locale/de/LC_MESSAGES/python-docs-theme.po new file mode 100644 index 00000000..49dddf78 --- /dev/null +++ b/python_docs_theme/locale/de/LC_MESSAGES/python-docs-theme.po @@ -0,0 +1,132 @@ +# Translations template for python-docs-theme. +# Copyright (C) 2025 Python Software Foundation +# This file is distributed under the same license as the python-docs-theme +# project. +# FIRST AUTHOR , 2025. +# +# Translators: +# Cristián Maureira-Fredes, 2025 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: python-docs-theme 2025.5\n" +"Report-Msgid-Bugs-To: https://github.com/python/python-docs-theme/issues\n" +"POT-Creation-Date: 2025-09-06 08:40+0100\n" +"PO-Revision-Date: 2025-09-09 10:20+0200\n" +"Last-Translator: Cristián Maureira-Fredes, 2025\n" +"Language-Team: \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? " +"1 : 2;\n" +"Generated-By: Babel 2.16.0\n" +"X-Generator: Poedit 3.6\n" + +#: python_docs_theme/footerdonate.html:1 +msgid "The Python Software Foundation is a non-profit corporation." +msgstr "Die Python Software Foundation ist eine gemeinnützige Organisation." + +#: python_docs_theme/footerdonate.html:2 +msgid "Please donate." +msgstr "Spenden Sie bitte." + +#: python_docs_theme/layout.html:6 +msgid "Navigation" +msgstr "Navigation" + +#: python_docs_theme/layout.html:51 python_docs_theme/layout.html:111 +msgid "Quick search" +msgstr "Schnellsuche" + +#: python_docs_theme/layout.html:52 python_docs_theme/layout.html:112 +msgid "Go" +msgstr "Los" + +#: python_docs_theme/layout.html:60 +msgid "Theme" +msgstr "Thema" + +#: python_docs_theme/layout.html:62 +msgid "Auto" +msgstr "Auto" + +#: python_docs_theme/layout.html:63 +msgid "Light" +msgstr "Hell" + +#: python_docs_theme/layout.html:64 +msgid "Dark" +msgstr "Dunkel" + +#: python_docs_theme/layout.html:96 +msgid "Menu" +msgstr "Menü" + +#: python_docs_theme/layout.html:142 +msgid "Copyright" +msgstr "Copyright" + +#: python_docs_theme/layout.html:147 +msgid "" +"This page is licensed under the Python Software Foundation License Version " +"2." +msgstr "" +"Diese Seite ist unter der Python Software Foundation License Version 2 " +"lizenziert." + +#: python_docs_theme/layout.html:149 +msgid "" +"Examples, recipes, and other code in the documentation are additionally " +"licensed under the Zero Clause BSD License." +msgstr "" +"Beispiele, Rezepte und anderer Code in der Dokumentation sind zusätzlich " +"unter der Zero Clause BSD-Lizenz lizenziert." + +#: python_docs_theme/layout.html:152 +#, python-format +msgid "" +"See History and License for more " +"information." +msgstr "" +"Weitere Informationen finden Sie unter Verlauf und Lizenz." + +#: python_docs_theme/layout.html:155 +#, python-format +msgid "Hosted on %(hosted_on)s." +msgstr "Gehostet auf %(hosted_on)s." + +#: python_docs_theme/layout.html:163 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Zuletzt aktualisiert am %(last_updated)s." + +#: python_docs_theme/layout.html:166 +#, python-format +msgid "Found a bug?" +msgstr "Fehler gefunden?" + +#: python_docs_theme/layout.html:170 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"Erstellt mit Sphinx%(sphinx_version)s." + +#: python_docs_theme/static/copybutton.js:30 +#: python_docs_theme/static/copybutton.js:55 +msgid "Copy" +msgstr "Kopieren" + +#: python_docs_theme/static/copybutton.js:31 +msgid "Copy to clipboard" +msgstr "In die Zwischenablage kopieren" + +#: python_docs_theme/static/copybutton.js:53 +msgid "Copied!" +msgstr "Kopiert!" diff --git a/python_docs_theme/locale/el/LC_MESSAGES/python-docs-theme.po b/python_docs_theme/locale/el/LC_MESSAGES/python-docs-theme.po new file mode 100644 index 00000000..5ade8b82 --- /dev/null +++ b/python_docs_theme/locale/el/LC_MESSAGES/python-docs-theme.po @@ -0,0 +1,126 @@ +# Greek translations for python-docs-theme. +# Copyright (C) 2025 Python Software Foundation +# This file is distributed under the same license as the python-docs-theme +# project. +# Lysandros Nikolaou , 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: python-docs-theme 2025.5\n" +"Report-Msgid-Bugs-To: https://github.com/python/python-docs-theme/issues\n" +"POT-Creation-Date: 2025-09-08 10:23+0300\n" +"PO-Revision-Date: 2025-09-08 10:23+0300\n" +"Last-Translator: Lysandros Nikolaou \n" +"Language: el\n" +"Language-Team: PyGreece \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.17.0\n" + +#: python_docs_theme/footerdonate.html:1 +msgid "The Python Software Foundation is a non-profit corporation." +msgstr "Το Python Software Foundation είναι ένας μη κερδοσκοπικός οργανισμός." + +#: python_docs_theme/footerdonate.html:2 +msgid "Please donate." +msgstr "Παρακαλώ κάντε μια δωρεά." + +#: python_docs_theme/layout.html:6 +msgid "Navigation" +msgstr "Πλοήγηση" + +#: python_docs_theme/layout.html:51 python_docs_theme/layout.html:111 +msgid "Quick search" +msgstr "Γρήγορη αναζήτηση" + +#: python_docs_theme/layout.html:52 python_docs_theme/layout.html:112 +msgid "Go" +msgstr "Μετάβαση" + +#: python_docs_theme/layout.html:60 +msgid "Theme" +msgstr "Θέμα" + +#: python_docs_theme/layout.html:62 +msgid "Auto" +msgstr "Αυτόματα" + +#: python_docs_theme/layout.html:63 +msgid "Light" +msgstr "Φωτεινό" + +#: python_docs_theme/layout.html:64 +msgid "Dark" +msgstr "Σκούρο" + +#: python_docs_theme/layout.html:96 +msgid "Menu" +msgstr "Μενού" + +#: python_docs_theme/layout.html:142 +msgid "Copyright" +msgstr "Πνευματικά δικαιώματα" + +#: python_docs_theme/layout.html:147 +msgid "" +"This page is licensed under the Python Software Foundation License " +"Version 2." +msgstr "" +"Η σελίδα αυτή διατίθεται υπό την άδεια χρήσης του Python Software " +"Foundation, 2η έκδοση." + +#: python_docs_theme/layout.html:149 +msgid "" +"Examples, recipes, and other code in the documentation are additionally " +"licensed under the Zero Clause BSD License." +msgstr "" +"Παραδείγματα, οδηγοί και λοιπά κομμάτια κώδικα στην τεκμηρίωση διατίθενται " +"επιπλέον υπό την άδεια χρήσης Zero Clause BSD." + +#: python_docs_theme/layout.html:152 +#, python-format +msgid "" +"See History and License for more " +"information." +msgstr "" +"Δες την Ιστορία και Άδεια χρήσης για " +"περισσότερες πληροφορίες." + +#: python_docs_theme/layout.html:155 +#, python-format +msgid "Hosted on %(hosted_on)s." +msgstr "Φιλοξενείται στο %(hosted_on)s." + +#: python_docs_theme/layout.html:163 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Τελευταία ενημέρωση στις %(last_updated)s." + +#: python_docs_theme/layout.html:166 +#, python-format +msgid "Found a bug?" +msgstr "Βρήκες ένα bug?" + +#: python_docs_theme/layout.html:170 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"Δημιουργήθηκε με την χρήση του Sphinx " +"%(sphinx_version)s." + +#: python_docs_theme/static/copybutton.js:30 +#: python_docs_theme/static/copybutton.js:55 +msgid "Copy" +msgstr "Αντιγραφή" + +#: python_docs_theme/static/copybutton.js:31 +msgid "Copy to clipboard" +msgstr "Αντιγραφή στο πρόχειρο" + +#: python_docs_theme/static/copybutton.js:53 +msgid "Copied!" +msgstr "Αντιγράφηκε!" diff --git a/python_docs_theme/locale/es/LC_MESSAGES/python-docs-theme.po b/python_docs_theme/locale/es/LC_MESSAGES/python-docs-theme.po new file mode 100644 index 00000000..5ac9ab30 --- /dev/null +++ b/python_docs_theme/locale/es/LC_MESSAGES/python-docs-theme.po @@ -0,0 +1,127 @@ +# Translations template for python-docs-theme. +# Copyright (C) 2025 Python Software Foundation +# This file is distributed under the same license as the python-docs-theme +# project. +# FIRST AUTHOR , 2025. +# +# Translators: +# Cristián Maureira-Fredes, 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: python-docs-theme 2025.5\n" +"Report-Msgid-Bugs-To: https://github.com/python/python-docs-theme/issues\n" +"POT-Creation-Date: 2025-09-06 08:40+0100\n" +"PO-Revision-Date: 2025-09-06 07:41+0000\n" +"Last-Translator: Cristián Maureira-Fredes, 2025\n" +"Language-Team: Spanish (https://app.transifex.com/python-doc/teams/5390/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.16.0\n" +"Language: es\n" +"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" + +#: python_docs_theme/footerdonate.html:1 +msgid "The Python Software Foundation is a non-profit corporation." +msgstr "La Python Software Foundation es una corporación sin fines de lucro." + +#: python_docs_theme/footerdonate.html:2 +msgid "Please donate." +msgstr "Por favor dona." + +#: python_docs_theme/layout.html:6 +msgid "Navigation" +msgstr "Navegación" + +#: python_docs_theme/layout.html:51 python_docs_theme/layout.html:111 +msgid "Quick search" +msgstr "Búsqueda rápida" + +#: python_docs_theme/layout.html:52 python_docs_theme/layout.html:112 +msgid "Go" +msgstr "Ir" + +#: python_docs_theme/layout.html:60 +msgid "Theme" +msgstr "Tema" + +#: python_docs_theme/layout.html:62 +msgid "Auto" +msgstr "Auto" + +#: python_docs_theme/layout.html:63 +msgid "Light" +msgstr "Claro" + +#: python_docs_theme/layout.html:64 +msgid "Dark" +msgstr "Oscuro" + +#: python_docs_theme/layout.html:96 +msgid "Menu" +msgstr "Menú" + +#: python_docs_theme/layout.html:142 +msgid "Copyright" +msgstr "Derechos de autor" + +#: python_docs_theme/layout.html:147 +msgid "" +"This page is licensed under the Python Software Foundation License Version " +"2." +msgstr "Ésta página tiene la licencia Python Software Foundation Versión 2." + +#: python_docs_theme/layout.html:149 +msgid "" +"Examples, recipes, and other code in the documentation are additionally " +"licensed under the Zero Clause BSD License." +msgstr "" +"Ejemplos, guías, y otro código en la documentación están bajo la licencia " +"adicional Zero Clause BSD." + +#: python_docs_theme/layout.html:152 +#, python-format +msgid "" +"See History and License for more " +"information." +msgstr "" +"Ver Historia y Licencia para más " +"información." + +#: python_docs_theme/layout.html:155 +#, python-format +msgid "Hosted on %(hosted_on)s." +msgstr "Hospedado en %(hosted_on)s." + +#: python_docs_theme/layout.html:163 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Última actualización en %(last_updated)s." + +#: python_docs_theme/layout.html:166 +#, python-format +msgid "Found a bug?" +msgstr "Encontraste un bug?" + +#: python_docs_theme/layout.html:170 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"Creado usando Sphinx%(sphinx_version)s." + +#: python_docs_theme/static/copybutton.js:30 +#: python_docs_theme/static/copybutton.js:55 +msgid "Copy" +msgstr "Copiar" + +#: python_docs_theme/static/copybutton.js:31 +msgid "Copy to clipboard" +msgstr "Copiar al portapapeles" + +#: python_docs_theme/static/copybutton.js:53 +msgid "Copied!" +msgstr "¡Copiado!" diff --git a/python_docs_theme/locale/fr/LC_MESSAGES/python-docs-theme.po b/python_docs_theme/locale/fr/LC_MESSAGES/python-docs-theme.po new file mode 100644 index 00000000..77daa041 --- /dev/null +++ b/python_docs_theme/locale/fr/LC_MESSAGES/python-docs-theme.po @@ -0,0 +1,120 @@ +# Copyright (C) 2025 Python Software Foundation +# This file is distributed under the same license as the python-docs-theme +# project. +msgid "" +msgstr "" +"Project-Id-Version: python-docs-theme 2025.5\n" +"Report-Msgid-Bugs-To: https://github.com/python/python-docs-theme/issues\n" +"POT-Creation-Date: 2025-09-06 08:40+0100\n" +"PO-Revision-Date: 2025-10-17 23:24+0200\n" +"Last-Translator: Julien Palard \n" +"Language-Team: FRENCH \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.6\n" + +#: python_docs_theme/footerdonate.html:1 +msgid "The Python Software Foundation is a non-profit corporation." +msgstr "La Python Software Foundation est une association à but non lucratif." + +#: python_docs_theme/footerdonate.html:2 +msgid "Please donate." +msgstr "Elle vit de vos dons." + +#: python_docs_theme/layout.html:6 +msgid "Navigation" +msgstr "Navigation" + +#: python_docs_theme/layout.html:51 python_docs_theme/layout.html:111 +msgid "Quick search" +msgstr "Recherche rapide" + +#: python_docs_theme/layout.html:52 python_docs_theme/layout.html:112 +msgid "Go" +msgstr "Rechercher" + +#: python_docs_theme/layout.html:60 +msgid "Theme" +msgstr "Thème" + +#: python_docs_theme/layout.html:62 +msgid "Auto" +msgstr "Auto" + +#: python_docs_theme/layout.html:63 +msgid "Light" +msgstr "Clair" + +#: python_docs_theme/layout.html:64 +msgid "Dark" +msgstr "Sombre" + +#: python_docs_theme/layout.html:96 +msgid "Menu" +msgstr "Menu" + +#: python_docs_theme/layout.html:142 +msgid "Copyright" +msgstr "Copyright" + +#: python_docs_theme/layout.html:147 +msgid "" +"This page is licensed under the Python Software Foundation License Version 2." +msgstr "" +"La licence de cette page est la Python Software Foundation License Version 2." + +#: python_docs_theme/layout.html:149 +msgid "" +"Examples, recipes, and other code in the documentation are additionally " +"licensed under the Zero Clause BSD License." +msgstr "" +"La licence des exemples, recettes, et autres morceaux de code se trouvant " +"dans la documentation est la Zero Clause BSD License." + +#: python_docs_theme/layout.html:152 +#, python-format +msgid "" +"See History and License for more " +"information." +msgstr "" +"Pour plus d'informations, consultez Histoire et " +"licence." + +#: python_docs_theme/layout.html:155 +#, python-format +msgid "Hosted on %(hosted_on)s." +msgstr "Hébergé sur %(hosted_on)s." + +#: python_docs_theme/layout.html:163 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Dernière mise à jour : %(last_updated)s." + +#: python_docs_theme/layout.html:166 +#, python-format +msgid "Found a bug?" +msgstr "Un bogue ?" + +#: python_docs_theme/layout.html:170 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"Crée par Sphinx " +"%(sphinx_version)s." + +#: python_docs_theme/static/copybutton.js:30 +#: python_docs_theme/static/copybutton.js:55 +msgid "Copy" +msgstr "Copier" + +#: python_docs_theme/static/copybutton.js:31 +msgid "Copy to clipboard" +msgstr "Copier dans le presse-papier" + +#: python_docs_theme/static/copybutton.js:53 +msgid "Copied!" +msgstr "Copié !" diff --git a/python_docs_theme/locale/id/LC_MESSAGES/python-docs-theme.po b/python_docs_theme/locale/id/LC_MESSAGES/python-docs-theme.po new file mode 100644 index 00000000..53e473ef --- /dev/null +++ b/python_docs_theme/locale/id/LC_MESSAGES/python-docs-theme.po @@ -0,0 +1,129 @@ +# Translations template for python-docs-theme. +# Copyright (C) 2025 Python Software Foundation +# This file is distributed under the same license as the python-docs-theme +# project. +# FIRST AUTHOR , 2025. +# +# Translators: +# Hengky Kurniawan, 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: python-docs-theme 2025.5\n" +"Report-Msgid-Bugs-To: https://github.com/python/python-docs-theme/issues\n" +"POT-Creation-Date: 2025-09-06 08:40+0100\n" +"PO-Revision-Date: 2025-09-06 07:41+0000\n" +"Last-Translator: Hengky Kurniawan, 2025\n" +"Language-Team: Indonesian (https://app.transifex.com/python-doc/teams/5390/id/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.16.0\n" +"Language: id\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: python_docs_theme/footerdonate.html:1 +msgid "The Python Software Foundation is a non-profit corporation." +msgstr "Python Software Foundation adalah sebuah korporasi nirlaba." + +#: python_docs_theme/footerdonate.html:2 +msgid "Please donate." +msgstr "Mari berdonasi." + +#: python_docs_theme/layout.html:6 +msgid "Navigation" +msgstr "Navigasi" + +#: python_docs_theme/layout.html:51 python_docs_theme/layout.html:111 +msgid "Quick search" +msgstr "Pencarian cepat" + +#: python_docs_theme/layout.html:52 python_docs_theme/layout.html:112 +msgid "Go" +msgstr "Telusuri" + +#: python_docs_theme/layout.html:60 +msgid "Theme" +msgstr "Tema" + +#: python_docs_theme/layout.html:62 +msgid "Auto" +msgstr "Otomatis" + +#: python_docs_theme/layout.html:63 +msgid "Light" +msgstr "Terang" + +#: python_docs_theme/layout.html:64 +msgid "Dark" +msgstr "Gelap" + +#: python_docs_theme/layout.html:96 +msgid "Menu" +msgstr "Menu" + +#: python_docs_theme/layout.html:142 +msgid "Copyright" +msgstr "Hak cipta" + +#: python_docs_theme/layout.html:147 +msgid "" +"This page is licensed under the Python Software Foundation License Version " +"2." +msgstr "" +"Halaman ini dilisensikan di bawah Lisensi Python Software Foundation Versi " +"2." + +#: python_docs_theme/layout.html:149 +msgid "" +"Examples, recipes, and other code in the documentation are additionally " +"licensed under the Zero Clause BSD License." +msgstr "" +"Contoh, resep, dan kode lainnya dalam dokumentasi juga dilisensikan di bawah" +" Lisensi Zero Clause BSD." + +#: python_docs_theme/layout.html:152 +#, python-format +msgid "" +"See History and License for more " +"information." +msgstr "" +"Lihat Sejarah dan Lisensi untuk informasi " +"lebih lanjut." + +#: python_docs_theme/layout.html:155 +#, python-format +msgid "Hosted on %(hosted_on)s." +msgstr "Dihos di %(hosted_on)s." + +#: python_docs_theme/layout.html:163 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Terakhir diperbarui pada %(last_updated)s." + +#: python_docs_theme/layout.html:166 +#, python-format +msgid "Found a bug?" +msgstr "Menemukan kekutu?" + +#: python_docs_theme/layout.html:170 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"Dibuat menggunakan Sphinx " +"%(sphinx_version)s." + +#: python_docs_theme/static/copybutton.js:30 +#: python_docs_theme/static/copybutton.js:55 +msgid "Copy" +msgstr "Salin" + +#: python_docs_theme/static/copybutton.js:31 +msgid "Copy to clipboard" +msgstr "Salin ke papan klip" + +#: python_docs_theme/static/copybutton.js:53 +msgid "Copied!" +msgstr "Tersalin!" diff --git a/python_docs_theme/locale/ja/LC_MESSAGES/python-docs-theme.po b/python_docs_theme/locale/ja/LC_MESSAGES/python-docs-theme.po new file mode 100644 index 00000000..f0683c22 --- /dev/null +++ b/python_docs_theme/locale/ja/LC_MESSAGES/python-docs-theme.po @@ -0,0 +1,123 @@ +# Translations template for python-docs-theme. +# Copyright (C) 2025 Python Software Foundation +# This file is distributed under the same license as the python-docs-theme +# project. +# FIRST AUTHOR , 2025. +# +# Translators: +# Inada Naoki , 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: python-docs-theme 2025.5\n" +"Report-Msgid-Bugs-To: https://github.com/python/python-docs-theme/issues\n" +"POT-Creation-Date: 2025-09-06 08:40+0100\n" +"PO-Revision-Date: 2025-09-06 07:41+0000\n" +"Last-Translator: Inada Naoki , 2025\n" +"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/ja/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.16.0\n" +"Language: ja\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: python_docs_theme/footerdonate.html:1 +msgid "The Python Software Foundation is a non-profit corporation." +msgstr "Pythonソフトウェア財団は非営利法人です。" + +#: python_docs_theme/footerdonate.html:2 +msgid "Please donate." +msgstr "寄付をするには" + +#: python_docs_theme/layout.html:6 +msgid "Navigation" +msgstr "Navigation" + +#: python_docs_theme/layout.html:51 python_docs_theme/layout.html:111 +msgid "Quick search" +msgstr "検索" + +#: python_docs_theme/layout.html:52 python_docs_theme/layout.html:112 +msgid "Go" +msgstr "Go" + +#: python_docs_theme/layout.html:60 +msgid "Theme" +msgstr "テーマ" + +#: python_docs_theme/layout.html:62 +msgid "Auto" +msgstr "自動" + +#: python_docs_theme/layout.html:63 +msgid "Light" +msgstr "ライト" + +#: python_docs_theme/layout.html:64 +msgid "Dark" +msgstr "ダーク" + +#: python_docs_theme/layout.html:96 +msgid "Menu" +msgstr "メニュー" + +#: python_docs_theme/layout.html:142 +msgid "Copyright" +msgstr "Copyright" + +#: python_docs_theme/layout.html:147 +msgid "" +"This page is licensed under the Python Software Foundation License Version " +"2." +msgstr "このページはPython Software Foundation License Version 2でライセンスされています。" + +#: python_docs_theme/layout.html:149 +msgid "" +"Examples, recipes, and other code in the documentation are additionally " +"licensed under the Zero Clause BSD License." +msgstr "ドキュメント内のサンプル、レシピ等のコードは、Zero Clause BSDライセンスの下で追加的にライセンスされています。" + +#: python_docs_theme/layout.html:152 +#, python-format +msgid "" +"See History and License for more " +"information." +msgstr "詳しくは歴史とライセンスを参照してください。" + +#: python_docs_theme/layout.html:155 +#, python-format +msgid "Hosted on %(hosted_on)s." +msgstr "%(hosted_on)sにてホストされています。" + +#: python_docs_theme/layout.html:163 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "最終更新日: %(last_updated)s" + +#: python_docs_theme/layout.html:166 +#, python-format +msgid "Found a bug?" +msgstr "バグを報告する" + +#: python_docs_theme/layout.html:170 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"Sphinx%(sphinx_version)sを使って構築されています。" + +#: python_docs_theme/static/copybutton.js:30 +#: python_docs_theme/static/copybutton.js:55 +msgid "Copy" +msgstr "コピー" + +#: python_docs_theme/static/copybutton.js:31 +msgid "Copy to clipboard" +msgstr "クリップボードにコピーする" + +#: python_docs_theme/static/copybutton.js:53 +msgid "Copied!" +msgstr "コピーされました。" diff --git a/python_docs_theme/locale/ko/LC_MESSAGES/python-docs-theme.po b/python_docs_theme/locale/ko/LC_MESSAGES/python-docs-theme.po new file mode 100644 index 00000000..56bc7264 --- /dev/null +++ b/python_docs_theme/locale/ko/LC_MESSAGES/python-docs-theme.po @@ -0,0 +1,124 @@ +# Translations template for python-docs-theme. +# Copyright (C) 2025 Python Software Foundation +# This file is distributed under the same license as the python-docs-theme +# project. +# FIRST AUTHOR , 2025. +# +# Translators: +# wonsuk yang, 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: python-docs-theme 2025.5\n" +"Report-Msgid-Bugs-To: https://github.com/python/python-docs-theme/issues\n" +"POT-Creation-Date: 2025-09-06 08:40+0100\n" +"PO-Revision-Date: 2025-09-06 07:41+0000\n" +"Last-Translator: wonsuk yang, 2025\n" +"Language-Team: Korean (https://app.transifex.com/python-doc/teams/5390/ko/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.16.0\n" +"Language: ko\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: python_docs_theme/footerdonate.html:1 +msgid "The Python Software Foundation is a non-profit corporation." +msgstr "파이썬 소프트웨어 재단은 비영리 재단입니다." + +#: python_docs_theme/footerdonate.html:2 +msgid "Please donate." +msgstr "기부를 부탁드립니다." + +#: python_docs_theme/layout.html:6 +msgid "Navigation" +msgstr "내비게이션" + +#: python_docs_theme/layout.html:51 python_docs_theme/layout.html:111 +msgid "Quick search" +msgstr "빠른 검색" + +#: python_docs_theme/layout.html:52 python_docs_theme/layout.html:112 +msgid "Go" +msgstr "시작" + +#: python_docs_theme/layout.html:60 +msgid "Theme" +msgstr "테마" + +#: python_docs_theme/layout.html:62 +msgid "Auto" +msgstr "자동" + +#: python_docs_theme/layout.html:63 +msgid "Light" +msgstr "라이트" + +#: python_docs_theme/layout.html:64 +msgid "Dark" +msgstr "다크" + +#: python_docs_theme/layout.html:96 +msgid "Menu" +msgstr "메뉴" + +#: python_docs_theme/layout.html:142 +msgid "Copyright" +msgstr "저작권" + +#: python_docs_theme/layout.html:147 +msgid "" +"This page is licensed under the Python Software Foundation License Version " +"2." +msgstr "해당하는 페이지의 저작권은 파이썬 소프트웨어 재단 저작권 라이센스 버전 2를 통해 보호받음을 고지 드립니다." + +#: python_docs_theme/layout.html:149 +msgid "" +"Examples, recipes, and other code in the documentation are additionally " +"licensed under the Zero Clause BSD License." +msgstr "" +"해당하는 문서 내의 예제, 사용법, 그리고 다른 코드들은 또한 Zero Clause BSD 라이센스를 통해 보호받음을 고지 드립니다." + +#: python_docs_theme/layout.html:152 +#, python-format +msgid "" +"See History and License for more " +"information." +msgstr "보다 다양한 정보를 위해서는 라이센스와 기록물 을 참고 부탁드립니다." + +#: python_docs_theme/layout.html:155 +#, python-format +msgid "Hosted on %(hosted_on)s." +msgstr "호스트 주소는 다음과 같습니다: %(hosted_on)s." + +#: python_docs_theme/layout.html:163 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "마지막 업데이트: %(last_updated)s." + +#: python_docs_theme/layout.html:166 +#, python-format +msgid "Found a bug?" +msgstr "문제가 생기셨나요?" + +#: python_docs_theme/layout.html:170 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"해당하는 문서는 스핑크스 " +"%(sphinx_version)s를 통해 만들어졌습니다." + +#: python_docs_theme/static/copybutton.js:30 +#: python_docs_theme/static/copybutton.js:55 +msgid "Copy" +msgstr "복사" + +#: python_docs_theme/static/copybutton.js:31 +msgid "Copy to clipboard" +msgstr "클립보드에 복사" + +#: python_docs_theme/static/copybutton.js:53 +msgid "Copied!" +msgstr "복사되었습니다!" diff --git a/python_docs_theme/locale/pl/LC_MESSAGES/python-docs-theme.po b/python_docs_theme/locale/pl/LC_MESSAGES/python-docs-theme.po new file mode 100644 index 00000000..5249a260 --- /dev/null +++ b/python_docs_theme/locale/pl/LC_MESSAGES/python-docs-theme.po @@ -0,0 +1,127 @@ +# Translations template for python-docs-theme. +# Copyright (C) 2025 Python Software Foundation +# This file is distributed under the same license as the python-docs-theme +# project. +# FIRST AUTHOR , 2025. +# +# Translators: +# Stan Ulbrych, 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: python-docs-theme 2025.5\n" +"Report-Msgid-Bugs-To: https://github.com/python/python-docs-theme/issues\n" +"POT-Creation-Date: 2025-09-06 08:40+0100\n" +"PO-Revision-Date: 2025-09-06 07:41+0000\n" +"Last-Translator: Stan Ulbrych, 2025\n" +"Language-Team: Polish (https://app.transifex.com/python-doc/teams/5390/pl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.16.0\n" +"Language: pl\n" +"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" + +#: python_docs_theme/footerdonate.html:1 +msgid "The Python Software Foundation is a non-profit corporation." +msgstr "Python Software Foundation jest organizacją non-profit." + +#: python_docs_theme/footerdonate.html:2 +msgid "Please donate." +msgstr "Prosimy o wsparcie." + +#: python_docs_theme/layout.html:6 +msgid "Navigation" +msgstr "Nawigacja" + +#: python_docs_theme/layout.html:51 python_docs_theme/layout.html:111 +msgid "Quick search" +msgstr "Szybkie wyszukiwanie" + +#: python_docs_theme/layout.html:52 python_docs_theme/layout.html:112 +msgid "Go" +msgstr "Szukaj" + +#: python_docs_theme/layout.html:60 +msgid "Theme" +msgstr "Motyw" + +#: python_docs_theme/layout.html:62 +msgid "Auto" +msgstr "auto" + +#: python_docs_theme/layout.html:63 +msgid "Light" +msgstr "jasny" + +#: python_docs_theme/layout.html:64 +msgid "Dark" +msgstr "ciemny" + +#: python_docs_theme/layout.html:96 +msgid "Menu" +msgstr "Menu" + +#: python_docs_theme/layout.html:142 +msgid "Copyright" +msgstr "Prawa autorskie" + +#: python_docs_theme/layout.html:147 +msgid "" +"This page is licensed under the Python Software Foundation License Version " +"2." +msgstr "Ta strona jest objęta licencją Python Software Foundation w wersji 2." + +#: python_docs_theme/layout.html:149 +msgid "" +"Examples, recipes, and other code in the documentation are additionally " +"licensed under the Zero Clause BSD License." +msgstr "" +"Przykłady, przepisy i inny kod w dokumentacji są dodatkowo objęte licencją " +"Zero Clause BSD." + +#: python_docs_theme/layout.html:152 +#, python-format +msgid "" +"See History and License for more " +"information." +msgstr "" +"Zobacz Historię i licencję aby uzyskać " +"więcej informacji." + +#: python_docs_theme/layout.html:155 +#, python-format +msgid "Hosted on %(hosted_on)s." +msgstr "Hostowane na %(hosted_on)s." + +#: python_docs_theme/layout.html:163 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Ostatnia aktualizacja %(last_updated)s." + +#: python_docs_theme/layout.html:166 +#, python-format +msgid "Found a bug?" +msgstr "Znalazłeś(-aś) błąd?" + +#: python_docs_theme/layout.html:170 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"Stworzone za pomocą Sphinx " +"%(sphinx_version)s." + +#: python_docs_theme/static/copybutton.js:30 +#: python_docs_theme/static/copybutton.js:55 +msgid "Copy" +msgstr "Kopiuj" + +#: python_docs_theme/static/copybutton.js:31 +msgid "Copy to clipboard" +msgstr "Skopiuj do schowka" + +#: python_docs_theme/static/copybutton.js:53 +msgid "Copied!" +msgstr "Skopiowano!" diff --git a/python_docs_theme/locale/pt/LC_MESSAGES/python-docs-theme.po b/python_docs_theme/locale/pt/LC_MESSAGES/python-docs-theme.po new file mode 100644 index 00000000..27eeba6d --- /dev/null +++ b/python_docs_theme/locale/pt/LC_MESSAGES/python-docs-theme.po @@ -0,0 +1,129 @@ +# Translations template for python-docs-theme. +# Copyright (C) 2025 Python Software Foundation +# This file is distributed under the same license as the python-docs-theme +# project. +# FIRST AUTHOR , 2025. +# +# Translators: +# NyaPuma , 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: python-docs-theme 2025.10\n" +"Report-Msgid-Bugs-To: https://github.com/python/python-docs-theme/issues\n" +"POT-Creation-Date: 2025-11-24 01:51+0000\n" +"PO-Revision-Date: 2025-09-06 07:41+0000\n" +"Last-Translator: NyaPuma , 2025\n" +"Language-Team: Portuguese (https://app.transifex.com/python-doc/teams/5390/pt/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.17.0\n" +"Language: pt\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" + +#: python_docs_theme/footerdonate.html:1 +msgid "The Python Software Foundation is a non-profit corporation." +msgstr "A Python Software Foundation é uma corporação sem fins lucrativos." + +#: python_docs_theme/footerdonate.html:2 +msgid "Please donate." +msgstr "Por favor, faça uma doação." + +#: python_docs_theme/layout.html:6 +msgid "Navigation" +msgstr "Navegação" + +#: python_docs_theme/layout.html:51 python_docs_theme/layout.html:111 +msgid "Quick search" +msgstr "Pesquisa rápida" + +#: python_docs_theme/layout.html:52 python_docs_theme/layout.html:112 +msgid "Go" +msgstr "Ir" + +#: python_docs_theme/layout.html:60 +msgid "Theme" +msgstr "Tema" + +#: python_docs_theme/layout.html:62 +msgid "Auto" +msgstr "Automático" + +#: python_docs_theme/layout.html:63 +msgid "Light" +msgstr "Claro" + +#: python_docs_theme/layout.html:64 +msgid "Dark" +msgstr "Escuro" + +#: python_docs_theme/layout.html:96 +msgid "Menu" +msgstr "Menu" + +#: python_docs_theme/layout.html:142 +msgid "Copyright" +msgstr "Direitos de autor" + +#: python_docs_theme/layout.html:147 +msgid "" +"This page is licensed under the Python Software Foundation License Version " +"2." +msgstr "" +"Esta página está licenciada sob a Licença da Python Software Foundation " +"Versão 2." + +#: python_docs_theme/layout.html:149 +msgid "" +"Examples, recipes, and other code in the documentation are additionally " +"licensed under the Zero Clause BSD License." +msgstr "" +"Exemplos, receitas e outros códigos na documentação são licenciados " +"adicionalmente sob a licença BSD Zero Clause." + +#: python_docs_theme/layout.html:152 +#, python-format +msgid "" +"See History and License for more " +"information." +msgstr "" +"Consulte Histórico e licença para obter " +"mais informações." + +#: python_docs_theme/layout.html:155 +#, python-format +msgid "Hosted on %(hosted_on)s." +msgstr "Hospedado em %(hosted_on)s." + +#: python_docs_theme/layout.html:163 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Última atualização em %(last_updated)s." + +#: python_docs_theme/layout.html:166 +#, python-format +msgid "Found a bug?" +msgstr "Encontrou um erro?" + +#: python_docs_theme/layout.html:170 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"Criado usando o Sphinx " +"%(sphinx_version)s." + +#: python_docs_theme/static/copybutton.js:30 +#: python_docs_theme/static/copybutton.js:55 +msgid "Copy" +msgstr "Copiar" + +#: python_docs_theme/static/copybutton.js:31 +msgid "Copy to clipboard" +msgstr "Copiar para a área de transferência" + +#: python_docs_theme/static/copybutton.js:53 +msgid "Copied!" +msgstr "Copiado!" diff --git a/python_docs_theme/locale/pt_BR/LC_MESSAGES/python-docs-theme.po b/python_docs_theme/locale/pt_BR/LC_MESSAGES/python-docs-theme.po new file mode 100644 index 00000000..1006ae92 --- /dev/null +++ b/python_docs_theme/locale/pt_BR/LC_MESSAGES/python-docs-theme.po @@ -0,0 +1,130 @@ +# Translations template for python-docs-theme. +# Copyright (C) 2025 Python Software Foundation +# This file is distributed under the same license as the python-docs-theme +# project. +# FIRST AUTHOR , 2025. +# +# Translators: +# Alexsey Batista da Silva, 2025 +# Rafael Fontenelle , 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: python-docs-theme 2025.5\n" +"Report-Msgid-Bugs-To: https://github.com/python/python-docs-theme/issues\n" +"POT-Creation-Date: 2025-09-06 08:40+0100\n" +"PO-Revision-Date: 2025-09-06 07:41+0000\n" +"Last-Translator: Rafael Fontenelle , 2025\n" +"Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/teams/5390/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.16.0\n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n" + +#: python_docs_theme/footerdonate.html:1 +msgid "The Python Software Foundation is a non-profit corporation." +msgstr "A Python Software Foundation é uma corporação sem fins lucrativos." + +#: python_docs_theme/footerdonate.html:2 +msgid "Please donate." +msgstr "Por favor, faça sua doação." + +#: python_docs_theme/layout.html:6 +msgid "Navigation" +msgstr "Navegação" + +#: python_docs_theme/layout.html:51 python_docs_theme/layout.html:111 +msgid "Quick search" +msgstr "Pesquisa rápida" + +#: python_docs_theme/layout.html:52 python_docs_theme/layout.html:112 +msgid "Go" +msgstr "Ir" + +#: python_docs_theme/layout.html:60 +msgid "Theme" +msgstr "Tema" + +#: python_docs_theme/layout.html:62 +msgid "Auto" +msgstr "Automático" + +#: python_docs_theme/layout.html:63 +msgid "Light" +msgstr "Claro" + +#: python_docs_theme/layout.html:64 +msgid "Dark" +msgstr "Escuro" + +#: python_docs_theme/layout.html:96 +msgid "Menu" +msgstr "Menu" + +#: python_docs_theme/layout.html:142 +msgid "Copyright" +msgstr "Direitos autorais" + +#: python_docs_theme/layout.html:147 +msgid "" +"This page is licensed under the Python Software Foundation License Version " +"2." +msgstr "" +"Esta página está licenciada sob a Licença da Python Software Foundation " +"Versão 2." + +#: python_docs_theme/layout.html:149 +msgid "" +"Examples, recipes, and other code in the documentation are additionally " +"licensed under the Zero Clause BSD License." +msgstr "" +"Exemplos, receitas e outros códigos na documentação são licenciados " +"adicionalmente sob a licença BSD Zero Clause." + +#: python_docs_theme/layout.html:152 +#, python-format +msgid "" +"See History and License for more " +"information." +msgstr "" +"Consulte Histórico e licença para obter " +"mais informações." + +#: python_docs_theme/layout.html:155 +#, python-format +msgid "Hosted on %(hosted_on)s." +msgstr "Hospedado em %(hosted_on)s." + +#: python_docs_theme/layout.html:163 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Última atualização em %(last_updated)s." + +#: python_docs_theme/layout.html:166 +#, python-format +msgid "Found a bug?" +msgstr "Encontrou um erro?" + +#: python_docs_theme/layout.html:170 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"Criado usando o Sphinx " +"%(sphinx_version)s." + +#: python_docs_theme/static/copybutton.js:30 +#: python_docs_theme/static/copybutton.js:55 +msgid "Copy" +msgstr "Copiar" + +#: python_docs_theme/static/copybutton.js:31 +msgid "Copy to clipboard" +msgstr "Copiar para a área de transferência" + +#: python_docs_theme/static/copybutton.js:53 +msgid "Copied!" +msgstr "Copiado!" diff --git a/python_docs_theme/locale/ro/LC_MESSAGES/python-docs-theme.po b/python_docs_theme/locale/ro/LC_MESSAGES/python-docs-theme.po new file mode 100644 index 00000000..8694c7dc --- /dev/null +++ b/python_docs_theme/locale/ro/LC_MESSAGES/python-docs-theme.po @@ -0,0 +1,130 @@ +# Romanian translations for python-docs-theme. +# Copyright (C) 2025 Python Software Foundation +# This file is distributed under the same license as the python-docs-theme +# project. +# Octavian Mustafa , 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: python-docs-theme 2025.9.2\n" +"Report-Msgid-Bugs-To: https://github.com/python/python-docs-theme/issues\n" +"POT-Creation-Date: 2025-09-24 03:59+0300\n" +"PO-Revision-Date: 2025-09-24 03:59+0300\n" +"Last-Translator: Octavian Mustafa \n" +"Language: ro\n" +"Language-Team: Python Docs Romanian translation team\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100" +" < 20)) ? 1 : 2);\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.17.0\n" + +#: python_docs_theme/footerdonate.html:1 +msgid "The Python Software Foundation is a non-profit corporation." +msgstr "" +"Python Software Foundation (PSF, Fundația Python dedicată " +"software-ului) este o corporație non-profit." + +#: python_docs_theme/footerdonate.html:2 +msgid "Please donate." +msgstr "Vă rugăm să donați." + +#: python_docs_theme/layout.html:6 +msgid "Navigation" +msgstr "Navigație" + +#: python_docs_theme/layout.html:51 python_docs_theme/layout.html:111 +msgid "Quick search" +msgstr "Căutare rapidă" + +#: python_docs_theme/layout.html:52 python_docs_theme/layout.html:112 +msgid "Go" +msgstr "Execută" + +#: python_docs_theme/layout.html:60 +msgid "Theme" +msgstr "Tema" + +#: python_docs_theme/layout.html:62 +msgid "Auto" +msgstr "Automată" + +#: python_docs_theme/layout.html:63 +msgid "Light" +msgstr "Luminoasă" + +#: python_docs_theme/layout.html:64 +msgid "Dark" +msgstr "Întunecată" + +#: python_docs_theme/layout.html:96 +msgid "Menu" +msgstr "Meniu" + +#: python_docs_theme/layout.html:142 +msgid "Copyright" +msgstr "Drepturi de autor" + +#: python_docs_theme/layout.html:147 +msgid "" +"This page is licensed under the Python Software Foundation License " +"Version 2." +msgstr "" +"Pagina de față este licențiată cu Versiunea 2 a Python Software Foundation " +"License (Licența fundației Python dedicată software-ului)." + +#: python_docs_theme/layout.html:149 +msgid "" +"Examples, recipes, and other code in the documentation are additionally " +"licensed under the Zero Clause BSD License." +msgstr "" +"Exemplele, rețetele și alte fragmente de cod din documentație sunt " +"licențiate suplimentar cu Zero Clause BSD License (Licența de clauză zero " +"a BSD-ului)." + +#: python_docs_theme/layout.html:152 +#, python-format +msgid "" +"See History and License for more " +"information." +msgstr "" +"Vedeți Istoric și licență pentru mai multe " +"informații." + +#: python_docs_theme/layout.html:155 +#, python-format +msgid "Hosted on %(hosted_on)s." +msgstr "Găzduit de %(hosted_on)s." + +#: python_docs_theme/layout.html:163 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Ultima modificare în %(last_updated)s." + +#: python_docs_theme/layout.html:166 +#, python-format +msgid "Found a bug?" +msgstr "Ați găsit o greșeală?" + +#: python_docs_theme/layout.html:170 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"Creat cu Sphinx " +"%(sphinx_version)s." + +#: python_docs_theme/static/copybutton.js:30 +#: python_docs_theme/static/copybutton.js:55 +msgid "Copy" +msgstr "Copiază" + +#: python_docs_theme/static/copybutton.js:31 +msgid "Copy to clipboard" +msgstr "Copiat în clipboard" + +#: python_docs_theme/static/copybutton.js:53 +msgid "Copied!" +msgstr "Copiat!" diff --git a/python_docs_theme/locale/ru/LC_MESSAGES/python-docs-theme.po b/python_docs_theme/locale/ru/LC_MESSAGES/python-docs-theme.po new file mode 100644 index 00000000..9a3c0609 --- /dev/null +++ b/python_docs_theme/locale/ru/LC_MESSAGES/python-docs-theme.po @@ -0,0 +1,129 @@ +# Translations template for python-docs-theme. +# Copyright (C) 2025 Python Software Foundation +# This file is distributed under the same license as the python-docs-theme +# project. +# FIRST AUTHOR , 2025. +# +# Translators: +# Asdfgr Wertyu, 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: python-docs-theme 2025.9.2\n" +"Report-Msgid-Bugs-To: https://github.com/python/python-docs-theme/issues\n" +"POT-Creation-Date: 2025-10-13 01:45+0000\n" +"PO-Revision-Date: 2025-09-06 07:41+0000\n" +"Last-Translator: Asdfgr Wertyu, 2025\n" +"Language-Team: Russian (https://app.transifex.com/python-doc/teams/5390/ru/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.17.0\n" +"Language: ru\n" +"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n" + +#: python_docs_theme/footerdonate.html:1 +msgid "The Python Software Foundation is a non-profit corporation." +msgstr "Python Software Foundation — некоммерческая организация." + +#: python_docs_theme/footerdonate.html:2 +msgid "Please donate." +msgstr "Пожалуйста, сделайте пожертвование." + +#: python_docs_theme/layout.html:6 +msgid "Navigation" +msgstr "Навигация" + +#: python_docs_theme/layout.html:51 python_docs_theme/layout.html:111 +msgid "Quick search" +msgstr "Быстрый поиск" + +#: python_docs_theme/layout.html:52 python_docs_theme/layout.html:112 +msgid "Go" +msgstr "Поиск" + +#: python_docs_theme/layout.html:60 +msgid "Theme" +msgstr "Тема" + +#: python_docs_theme/layout.html:62 +msgid "Auto" +msgstr "Авто" + +#: python_docs_theme/layout.html:63 +msgid "Light" +msgstr "Свет" + +#: python_docs_theme/layout.html:64 +msgid "Dark" +msgstr "Темный" + +#: python_docs_theme/layout.html:96 +msgid "Menu" +msgstr "Меню" + +#: python_docs_theme/layout.html:142 +msgid "Copyright" +msgstr "Авторское право" + +#: python_docs_theme/layout.html:147 +msgid "" +"This page is licensed under the Python Software Foundation License Version " +"2." +msgstr "" +"Эта страница лицензирована в соответствии с лицензией Python Software " +"Foundation версии 2." + +#: python_docs_theme/layout.html:149 +msgid "" +"Examples, recipes, and other code in the documentation are additionally " +"licensed under the Zero Clause BSD License." +msgstr "" +"Примеры, рецепты и другой код в документации дополнительно лицензируются по " +"лицензии Zero Clause BSD." + +#: python_docs_theme/layout.html:152 +#, python-format +msgid "" +"See History and License for more " +"information." +msgstr "" +"Подробнее см. в разделе История и лицензия." + +#: python_docs_theme/layout.html:155 +#, python-format +msgid "Hosted on %(hosted_on)s." +msgstr "Размещено на %(hosted_on)s." + +#: python_docs_theme/layout.html:163 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Последнее обновление %(last_updated)s." + +#: python_docs_theme/layout.html:166 +#, python-format +msgid "Found a bug?" +msgstr "Нашли ошибку?" + +#: python_docs_theme/layout.html:170 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"Создано с помощью Sphinx %(sphinx_version)s." + +#: python_docs_theme/static/copybutton.js:30 +#: python_docs_theme/static/copybutton.js:55 +msgid "Copy" +msgstr "Копировать" + +#: python_docs_theme/static/copybutton.js:31 +msgid "Copy to clipboard" +msgstr "Копировать в буфер обмена" + +#: python_docs_theme/static/copybutton.js:53 +msgid "Copied!" +msgstr "Скопировано!" diff --git a/python_docs_theme/locale/sv/LC_MESSAGES/python-docs-theme.po b/python_docs_theme/locale/sv/LC_MESSAGES/python-docs-theme.po new file mode 100644 index 00000000..7bf73ef1 --- /dev/null +++ b/python_docs_theme/locale/sv/LC_MESSAGES/python-docs-theme.po @@ -0,0 +1,128 @@ +# Swedish translations for python-docs-theme. +# Copyright (C) 2025 Python Software Foundation +# This file is distributed under the same license as the python-docs-theme +# project. +# Daniel Nylander, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: python-docs-theme 2025.5\n" +"Report-Msgid-Bugs-To: https://github.com/python/python-docs-theme/" +"issues\n" +"POT-Creation-Date: 2025-08-07 19:09+0200\n" +"PO-Revision-Date: 2025-08-29 07:03+0200\n" +"Last-Translator: Daniel Nylander \n" +"Language-Team: sv\n" +"Language: sv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Generated-By: Babel 2.16.0\n" +"X-Generator: Poedit 3.7\n" + +#: python_docs_theme/footerdonate.html:1 +msgid "The Python Software Foundation is a non-profit corporation." +msgstr "Python Software Foundation är ett icke-vinstdrivande företag." + +#: python_docs_theme/footerdonate.html:2 +msgid "Please donate." +msgstr "Donera." + +#: python_docs_theme/layout.html:6 +msgid "Navigation" +msgstr "Navigering" + +#: python_docs_theme/layout.html:51 python_docs_theme/layout.html:111 +msgid "Quick search" +msgstr "Snabbsök" + +#: python_docs_theme/layout.html:52 python_docs_theme/layout.html:112 +msgid "Go" +msgstr "Start" + +#: python_docs_theme/layout.html:60 +msgid "Theme" +msgstr "Tema" + +#: python_docs_theme/layout.html:62 +msgid "Auto" +msgstr "Auto" + +#: python_docs_theme/layout.html:63 +msgid "Light" +msgstr "Ljus" + +#: python_docs_theme/layout.html:64 +msgid "Dark" +msgstr "Mörk" + +#: python_docs_theme/layout.html:96 +msgid "Menu" +msgstr "Meny" + +#: python_docs_theme/layout.html:142 +msgid "Copyright" +msgstr "Upphovsrätt" + +#: python_docs_theme/layout.html:147 +msgid "" +"This page is licensed under the Python Software Foundation License " +"Version 2." +msgstr "" +"Denna sida är licensierad enligt Python Software Foundation License " +"version 2." + +#: python_docs_theme/layout.html:149 +msgid "" +"Examples, recipes, and other code in the documentation are additionally " +"licensed under the Zero Clause BSD License." +msgstr "" +"Exempel, recept och annan kod i dokumentationen är dessutom " +"licensierade under Zero Clause BSD-licensen." + +#: python_docs_theme/layout.html:152 +#, python-format +msgid "" +"See History and License for more " +"information." +msgstr "" +"Se Historik och licens för mer " +"information." + +#: python_docs_theme/layout.html:155 +#, python-format +msgid "Hosted on %(hosted_on)s." +msgstr "Hosting %(hosted_on)s." + +#: python_docs_theme/layout.html:163 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Senast uppdaterad %(last_updated)s." + +#: python_docs_theme/layout.html:166 +#, python-format +msgid "Found a bug?" +msgstr "Har du hittat ett fel?" + +#: python_docs_theme/layout.html:170 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"Skapad med hjälp av Sphinx " +"%(sphinx_version)s." + +#: python_docs_theme/static/copybutton.js:30 +#: python_docs_theme/static/copybutton.js:55 +msgid "Copy" +msgstr "Kopiera" + +#: python_docs_theme/static/copybutton.js:31 +msgid "Copy to clipboard" +msgstr "Kopiera till urklipp" + +#: python_docs_theme/static/copybutton.js:53 +msgid "Copied!" +msgstr "Kopierad!" diff --git a/python_docs_theme/locale/tr/LC_MESSAGES/python-docs-theme.po b/python_docs_theme/locale/tr/LC_MESSAGES/python-docs-theme.po new file mode 100644 index 00000000..f79742f1 --- /dev/null +++ b/python_docs_theme/locale/tr/LC_MESSAGES/python-docs-theme.po @@ -0,0 +1,129 @@ +# Translations template for python-docs-theme. +# Copyright (C) 2025 Python Software Foundation +# This file is distributed under the same license as the python-docs-theme +# project. +# FIRST AUTHOR , 2025. +# +# Translators: +# Ege Akman, 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: python-docs-theme 2025.5\n" +"Report-Msgid-Bugs-To: https://github.com/python/python-docs-theme/issues\n" +"POT-Creation-Date: 2025-09-06 08:40+0100\n" +"PO-Revision-Date: 2025-09-06 07:41+0000\n" +"Last-Translator: Ege Akman, 2025\n" +"Language-Team: Turkish (https://app.transifex.com/python-doc/teams/5390/tr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.16.0\n" +"Language: tr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: python_docs_theme/footerdonate.html:1 +msgid "The Python Software Foundation is a non-profit corporation." +msgstr "Python Software Foundation kâr amacı gütmeyen bir kuruluştur." + +#: python_docs_theme/footerdonate.html:2 +msgid "Please donate." +msgstr "Lütfen bağış yapın." + +#: python_docs_theme/layout.html:6 +msgid "Navigation" +msgstr "Navigasyon" + +#: python_docs_theme/layout.html:51 python_docs_theme/layout.html:111 +msgid "Quick search" +msgstr "Hızlı arama" + +#: python_docs_theme/layout.html:52 python_docs_theme/layout.html:112 +msgid "Go" +msgstr "Ara" + +#: python_docs_theme/layout.html:60 +msgid "Theme" +msgstr "Tema" + +#: python_docs_theme/layout.html:62 +msgid "Auto" +msgstr "Otomatik" + +#: python_docs_theme/layout.html:63 +msgid "Light" +msgstr "Açık" + +#: python_docs_theme/layout.html:64 +msgid "Dark" +msgstr "Koyu" + +#: python_docs_theme/layout.html:96 +msgid "Menu" +msgstr "Menü" + +#: python_docs_theme/layout.html:142 +msgid "Copyright" +msgstr "Telif Hakkı" + +#: python_docs_theme/layout.html:147 +msgid "" +"This page is licensed under the Python Software Foundation License Version " +"2." +msgstr "" +"Bu sayfa, Python Software Foundation License Version 2 kapsamında " +"lisanslanmıştır." + +#: python_docs_theme/layout.html:149 +msgid "" +"Examples, recipes, and other code in the documentation are additionally " +"licensed under the Zero Clause BSD License." +msgstr "" +"Dokümantasyondaki örnekler, tarifler ve diğer kodlar ek olarak Zero Clause " +"BSD License kapsamında lisanslanmıştır." + +#: python_docs_theme/layout.html:152 +#, python-format +msgid "" +"See History and License for more " +"information." +msgstr "" +"Daha fazla bilgi için Geçmiş ve Lisans " +"bölümüne bakın. " + +#: python_docs_theme/layout.html:155 +#, python-format +msgid "Hosted on %(hosted_on)s." +msgstr "%(hosted_on)s üzerinde barındırılmaktadır." + +#: python_docs_theme/layout.html:163 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "En son %(last_updated)s tarihinde güncellendi." + +#: python_docs_theme/layout.html:166 +#, python-format +msgid "Found a bug?" +msgstr "Bir bug mı buldunuz?" + +#: python_docs_theme/layout.html:170 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"Sphinx %(sphinx_version)s ile " +"oluşturuldu. " + +#: python_docs_theme/static/copybutton.js:30 +#: python_docs_theme/static/copybutton.js:55 +msgid "Copy" +msgstr "Kopyala" + +#: python_docs_theme/static/copybutton.js:31 +msgid "Copy to clipboard" +msgstr "Panoya kopyala" + +#: python_docs_theme/static/copybutton.js:53 +msgid "Copied!" +msgstr "Kopyalandı!" diff --git a/python_docs_theme/locale/zh_CN/LC_MESSAGES/python-docs-theme.po b/python_docs_theme/locale/zh_CN/LC_MESSAGES/python-docs-theme.po new file mode 100644 index 00000000..73cc2937 --- /dev/null +++ b/python_docs_theme/locale/zh_CN/LC_MESSAGES/python-docs-theme.po @@ -0,0 +1,122 @@ +# Translations template for python-docs-theme. +# Copyright (C) 2025 Python Software Foundation +# This file is distributed under the same license as the python-docs-theme +# project. +# FIRST AUTHOR , 2025. +# +# Translators: +# 汇民 王 , 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: python-docs-theme 2025.5\n" +"Report-Msgid-Bugs-To: https://github.com/python/python-docs-theme/issues\n" +"POT-Creation-Date: 2025-09-06 08:40+0100\n" +"PO-Revision-Date: 2025-09-06 07:41+0000\n" +"Last-Translator: 汇民 王 , 2025\n" +"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.16.0\n" +"Language: zh_CN\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: python_docs_theme/footerdonate.html:1 +msgid "The Python Software Foundation is a non-profit corporation." +msgstr "Python 软件基金会是一家非营利性公司。" + +#: python_docs_theme/footerdonate.html:2 +msgid "Please donate." +msgstr "请进行捐赠。" + +#: python_docs_theme/layout.html:6 +msgid "Navigation" +msgstr "导航" + +#: python_docs_theme/layout.html:51 python_docs_theme/layout.html:111 +msgid "Quick search" +msgstr "快速搜索" + +#: python_docs_theme/layout.html:52 python_docs_theme/layout.html:112 +msgid "Go" +msgstr "转到" + +#: python_docs_theme/layout.html:60 +msgid "Theme" +msgstr "主题" + +#: python_docs_theme/layout.html:62 +msgid "Auto" +msgstr "自动" + +#: python_docs_theme/layout.html:63 +msgid "Light" +msgstr "明亮" + +#: python_docs_theme/layout.html:64 +msgid "Dark" +msgstr "黑暗" + +#: python_docs_theme/layout.html:96 +msgid "Menu" +msgstr "菜单" + +#: python_docs_theme/layout.html:142 +msgid "Copyright" +msgstr "版权" + +#: python_docs_theme/layout.html:147 +msgid "" +"This page is licensed under the Python Software Foundation License Version " +"2." +msgstr "本页面采用 Python 软件基金会许可证第 2 版授权。" + +#: python_docs_theme/layout.html:149 +msgid "" +"Examples, recipes, and other code in the documentation are additionally " +"licensed under the Zero Clause BSD License." +msgstr "文档中的示例、代码片段及其他代码内容额外采用零条款 BSD 许可证授权。" + +#: python_docs_theme/layout.html:152 +#, python-format +msgid "" +"See History and License for more " +"information." +msgstr "更多信息请参阅《 历史与许可 》。" + +#: python_docs_theme/layout.html:155 +#, python-format +msgid "Hosted on %(hosted_on)s." +msgstr "托管在%(hosted_on)s 上。" + +#: python_docs_theme/layout.html:163 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "最后更新于%(last_updated)s 。" + +#: python_docs_theme/layout.html:166 +#, python-format +msgid "Found a bug?" +msgstr "发现了错误?" + +#: python_docs_theme/layout.html:170 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"使用Sphinx %(sphinx_version)s 创建。" + +#: python_docs_theme/static/copybutton.js:30 +#: python_docs_theme/static/copybutton.js:55 +msgid "Copy" +msgstr "复制" + +#: python_docs_theme/static/copybutton.js:31 +msgid "Copy to clipboard" +msgstr "复制到剪贴板" + +#: python_docs_theme/static/copybutton.js:53 +msgid "Copied!" +msgstr "已复制!" diff --git a/python_docs_theme/locale/zh_TW/LC_MESSAGES/python-docs-theme.po b/python_docs_theme/locale/zh_TW/LC_MESSAGES/python-docs-theme.po new file mode 100644 index 00000000..c65766be --- /dev/null +++ b/python_docs_theme/locale/zh_TW/LC_MESSAGES/python-docs-theme.po @@ -0,0 +1,122 @@ +# Translations template for python-docs-theme. +# Copyright (C) 2025 Python Software Foundation +# This file is distributed under the same license as the python-docs-theme +# project. +# FIRST AUTHOR , 2025. +# +# Translators: +# W. H. Wang , 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: python-docs-theme 2025.5\n" +"Report-Msgid-Bugs-To: https://github.com/python/python-docs-theme/issues\n" +"POT-Creation-Date: 2025-09-06 08:40+0100\n" +"PO-Revision-Date: 2025-09-06 07:41+0000\n" +"Last-Translator: W. H. Wang , 2025\n" +"Language-Team: Chinese (Taiwan) (https://app.transifex.com/python-doc/teams/5390/zh_TW/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.16.0\n" +"Language: zh_TW\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: python_docs_theme/footerdonate.html:1 +msgid "The Python Software Foundation is a non-profit corporation." +msgstr "Python 軟體基金會是一家非營利法人。" + +#: python_docs_theme/footerdonate.html:2 +msgid "Please donate." +msgstr "敬請捐贈。" + +#: python_docs_theme/layout.html:6 +msgid "Navigation" +msgstr "導航" + +#: python_docs_theme/layout.html:51 python_docs_theme/layout.html:111 +msgid "Quick search" +msgstr "快速搜索" + +#: python_docs_theme/layout.html:52 python_docs_theme/layout.html:112 +msgid "Go" +msgstr "Go" + +#: python_docs_theme/layout.html:60 +msgid "Theme" +msgstr "主題" + +#: python_docs_theme/layout.html:62 +msgid "Auto" +msgstr "自動" + +#: python_docs_theme/layout.html:63 +msgid "Light" +msgstr "淺色模式" + +#: python_docs_theme/layout.html:64 +msgid "Dark" +msgstr "深色模式" + +#: python_docs_theme/layout.html:96 +msgid "Menu" +msgstr "選單" + +#: python_docs_theme/layout.html:142 +msgid "Copyright" +msgstr "版權所有" + +#: python_docs_theme/layout.html:147 +msgid "" +"This page is licensed under the Python Software Foundation License Version " +"2." +msgstr "此頁面採用 Python 軟體基金會授權條款第 2 版。" + +#: python_docs_theme/layout.html:149 +msgid "" +"Examples, recipes, and other code in the documentation are additionally " +"licensed under the Zero Clause BSD License." +msgstr "文件中的範例、應用技巧與其他程式碼額外採用了 Zero Clause BSD 授權條款。" + +#: python_docs_theme/layout.html:152 +#, python-format +msgid "" +"See History and License for more " +"information." +msgstr "更多訊息請見歷史與授權條款。" + +#: python_docs_theme/layout.html:155 +#, python-format +msgid "Hosted on %(hosted_on)s." +msgstr "託管於 %(hosted_on)s。" + +#: python_docs_theme/layout.html:163 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "最後更新於 %(last_updated)s。" + +#: python_docs_theme/layout.html:166 +#, python-format +msgid "Found a bug?" +msgstr "發現 bug?" + +#: python_docs_theme/layout.html:170 +#, python-format +msgid "" +"Created using Sphinx " +"%(sphinx_version)s." +msgstr "" +"以 Sphinx%(sphinx_version)s建立。 " + +#: python_docs_theme/static/copybutton.js:30 +#: python_docs_theme/static/copybutton.js:55 +msgid "Copy" +msgstr "複製" + +#: python_docs_theme/static/copybutton.js:31 +msgid "Copy to clipboard" +msgstr "複製到剪貼板" + +#: python_docs_theme/static/copybutton.js:53 +msgid "Copied!" +msgstr "已複製!" diff --git a/python_docs_theme/static/caret-down.svg b/python_docs_theme/static/caret-down.svg deleted file mode 100644 index fc55b349..00000000 --- a/python_docs_theme/static/caret-down.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/python_docs_theme/static/copybutton.js b/python_docs_theme/static/copybutton.js index 16dee005..f90eb1e8 100644 --- a/python_docs_theme/static/copybutton.js +++ b/python_docs_theme/static/copybutton.js @@ -1,64 +1,90 @@ -$(document).ready(function() { - /* Add a [>>>] button on the top-right corner of code samples to hide - * the >>> and ... prompts and the output and thus make the code - * copyable. */ - var div = $('.highlight-python .highlight,' + - '.highlight-python3 .highlight,' + - '.highlight-pycon .highlight,' + - '.highlight-pycon3 .highlight,' + - '.highlight-default .highlight'); - var pre = div.find('pre'); +// Extract copyable text from the code block ignoring the +// prompts and output. +function getCopyableText(rootElement) { + rootElement = rootElement.cloneNode(true) + // tracebacks (.gt) contain bare text elements that + // need to be removed + const tracebacks = rootElement.querySelectorAll(".gt") + for (const el of tracebacks) { + while ( + el.nextSibling && + (el.nextSibling.nodeType !== Node.ELEMENT_NODE || + !el.nextSibling.matches(".gp, .go")) + ) { + el.nextSibling.remove() + } + } + // Remove all elements with the "go" (Generic.Output), + // "gp" (Generic.Prompt), or "gt" (Generic.Traceback) CSS class + const elements = rootElement.querySelectorAll(".gp, .go, .gt, .linenos") + for (const el of elements) { + el.remove() + } + return rootElement.innerText.trim() +} + +const loadCopyButton = () => { + const button = document.createElement("button") + button.classList.add("copybutton") + button.type = "button" + button.innerText = _("Copy") + button.title = _("Copy to clipboard") + + const makeOnButtonClick = () => { + let timeout = null + // define the behavior of the button when it's clicked + return async event => { + // check if the clipboard is available + if (!navigator.clipboard || !navigator.clipboard.writeText) { + return; + } + + clearTimeout(timeout) + const buttonEl = event.currentTarget + const codeEl = buttonEl.nextElementSibling - // get the styles from the current theme - pre.parent().parent().css('position', 'relative'); - var hide_text = 'Hide the prompts and output'; - var show_text = 'Show the prompts and output'; - var border_width = pre.css('border-top-width'); - var border_style = pre.css('border-top-style'); - var border_color = pre.css('border-top-color'); - var button_styles = { - 'cursor':'pointer', 'position': 'absolute', 'top': '0', 'right': '0', - 'border-color': border_color, 'border-style': border_style, - 'border-width': border_width, 'color': border_color, 'text-size': '75%', - 'font-family': 'monospace', 'padding-left': '0.2em', 'padding-right': '0.2em', - 'border-radius': '0 3px 0 0' + try { + await navigator.clipboard.writeText(getCopyableText(codeEl)) + } catch (e) { + console.error(e.message) + return + } + + buttonEl.innerText = _("Copied!") + timeout = setTimeout(() => { + buttonEl.innerText = _("Copy") + }, 1500) + } } + const highlightedElements = document.querySelectorAll( + ".highlight-python .highlight," + + ".highlight-python3 .highlight," + + ".highlight-pycon .highlight," + + ".highlight-pycon3 .highlight," + + ".highlight-bash .highlight," + + ".highlight-console .highlight," + + ".highlight-doscon .highlight," + + ".highlight-ps1con .highlight," + + ".highlight-sh .highlight," + + ".highlight-shell-session .highlight," + + ".highlight-default .highlight" + ) + // create and add the button to all the code blocks that contain >>> - div.each(function(index) { - var jthis = $(this); - if (jthis.find('.gp').length > 0) { - var button = $('>>>'); - button.css(button_styles) - button.attr('title', hide_text); - button.data('hidden', 'false'); - jthis.prepend(button); - } - // tracebacks (.gt) contain bare text elements that need to be - // wrapped in a span to work with .nextUntil() (see later) - jthis.find('pre:has(.gt)').contents().filter(function() { - return ((this.nodeType == 3) && (this.data.trim().length > 0)); - }).wrap(''); - }); + highlightedElements.forEach(el => { + el.style.position = "relative" - // define the behavior of the button when it's clicked - $('.copybutton').click(function(e){ - e.preventDefault(); - var button = $(this); - if (button.data('hidden') === 'false') { - // hide the code output - button.parent().find('.go, .gp, .gt').hide(); - button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'hidden'); - button.css('text-decoration', 'line-through'); - button.attr('title', show_text); - button.data('hidden', 'true'); - } else { - // show the code output - button.parent().find('.go, .gp, .gt').show(); - button.next('pre').find('.gt').nextUntil('.gp, .go').css('visibility', 'visible'); - button.css('text-decoration', 'none'); - button.attr('title', hide_text); - button.data('hidden', 'false'); - } - }); -}); + // if we find a console prompt (.gp), prepend the (deeply cloned) button + const clonedButton = button.cloneNode(true) + // the onclick attribute is not cloned, set it on the new element + clonedButton.onclick = makeOnButtonClick() + el.prepend(clonedButton) + }) +} + +if (document.readyState !== "loading") { + loadCopyButton() +} else { + document.addEventListener("DOMContentLoaded", loadCopyButton) +} diff --git a/python_docs_theme/static/menu.js b/python_docs_theme/static/menu.js index b2eabb3a..c7ab03ea 100644 --- a/python_docs_theme/static/menu.js +++ b/python_docs_theme/static/menu.js @@ -1,55 +1,57 @@ -document.addEventListener('DOMContentLoaded', function () { +document.addEventListener("DOMContentLoaded", function () { // Make tables responsive by wrapping them in a div and making them scrollable - const tables = document.querySelectorAll('table.docutils'); + const tables = document.querySelectorAll("table.docutils") tables.forEach(function(table){ - table.outerHTML = '
    ' + table.outerHTML + '
    ' - }); + table.outerHTML = '
    ' + table.outerHTML + "
    " + }) - const togglerInput = document.querySelector('.toggler__input'); - const togglerLabel = document.querySelector('.toggler__label'); - const sideMenu = document.querySelector('.menu-wrapper'); - const menuItems = document.querySelectorAll('.menu') - const doc = document.querySelector('.document'); - const body = document.querySelector('body'); + const togglerInput = document.querySelector(".toggler__input") + const togglerLabel = document.querySelector(".toggler__label") + const sideMenu = document.querySelector(".menu-wrapper") + const menuItems = document.querySelectorAll(".menu") + const doc = document.querySelector(".document") + const body = document.querySelector("body") function closeMenu() { - togglerInput.checked = false; - sideMenu.setAttribute("aria-expanded", 'false'); - sideMenu.setAttribute('aria-hidden', 'true'); - togglerLabel.setAttribute('aria-pressed', 'false'); - body.style.overflow = 'visible'; + togglerInput.checked = false + sideMenu.setAttribute("aria-expanded", "false") + sideMenu.setAttribute("aria-hidden", "true") + togglerLabel.setAttribute("aria-pressed", "false") + body.style.overflow = "visible" } function openMenu() { - togglerInput.checked = true; - sideMenu.setAttribute("aria-expanded", 'true'); - sideMenu.setAttribute('aria-hidden', 'false'); - togglerLabel.setAttribute('aria-pressed', 'true'); - body.style.overflow = 'hidden'; + togglerInput.checked = true + sideMenu.setAttribute("aria-expanded", "true") + sideMenu.setAttribute("aria-hidden", "false") + togglerLabel.setAttribute("aria-pressed", "true") + body.style.overflow = "hidden" } // Close menu when link on the sideMenu is clicked - sideMenu.addEventListener('click', function (event) { - let target = event.target; - if (target.tagName.toLowerCase() !== 'a') return; - closeMenu(); + sideMenu.addEventListener("click", function (event) { + let target = event.target + if (target.tagName.toLowerCase() !== "a") { + return + } + closeMenu() }) // Add accessibility data when sideMenu is opened/closed - togglerInput.addEventListener('change', function (e) { - togglerInput.checked ? openMenu() : closeMenu(); - }); + togglerInput.addEventListener("change", function (_event) { + togglerInput.checked ? openMenu() : closeMenu() + }) // Make sideMenu links tabbable only when visible for(let menuItem of menuItems) { if(togglerInput.checked) { - menuItem.setAttribute('tabindex', '0'); + menuItem.setAttribute("tabindex", "0") } else { - menuItem.setAttribute('tabindex', '-1'); + menuItem.setAttribute("tabindex", "-1") } } // Close sideMenu when document body is clicked - doc.addEventListener('click', function () { + doc.addEventListener("click", function () { if (togglerInput.checked) { - closeMenu(); + closeMenu() } }) -}) \ No newline at end of file +}) diff --git a/python_docs_theme/static/py.png b/python_docs_theme/static/py.png deleted file mode 100644 index 93e4a02c..00000000 Binary files a/python_docs_theme/static/py.png and /dev/null differ diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css index d87f1402..7167addb 100644 --- a/python_docs_theme/static/pydoctheme.css +++ b/python_docs_theme/static/pydoctheme.css @@ -1,7 +1,79 @@ -@import url("default.css"); +/* Common colours */ +:root { + --good-color: rgb(41 100 51); + --good-border: rgb(79 196 100); + --middle-color: rgb(133 72 38); + --middle-border: rgb(244, 227, 76); + --bad-color: rgb(159 49 51); + --bad-border: rgb(244, 76, 78); +} + +/* unset some styles from the classic stylesheet */ +div.document, +div.body, +div.related, +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6, +div.sphinxsidebar a, +div.sphinxsidebar p, +div.sphinxsidebar ul, +div.sphinxsidebar h3, +div.sphinxsidebar h3 a, +div.sphinxsidebar h4, +.menu a, +.menu p, +.menu ul, +.menu h3, +.menu h3 a, +.menu h4, +table.docutils td, +table.indextable tr.cap, +pre { + background-color: inherit; + color: inherit; +} + +/* Add underlines to links */ +a[href] { + text-decoration: underline 1px; +} + +/* Increase the underline offset for code to avoid obscuring underscores */ +a[href]:has(> code) { + text-underline-offset: 0.25em; +} + +/* No underline for navigation */ +a.headerlink, +div.genindex-jumpbox a, +div.modindex-jumpbox a, +div#search-results a, +div.sphinxsidebar a, +div.toctree-wrapper a, +div[role=navigation] a, +table.contentstable a, +table.indextable a { + text-decoration: none; +} + +/* Except when hovered */ +div.genindex-jumpbox a:hover, +div.modindex-jumpbox a:hover, +div#search-results a:hover, +div.sphinxsidebar a:hover, +div.toctree-wrapper a:hover, +div[role=navigation] a:hover, +table.contentstable a:hover, +table.indextable a:hover { + text-decoration: underline; + text-underline-offset: auto; +} body { - background-color: white; margin-left: 1em; margin-right: 1em; } @@ -12,19 +84,23 @@ body { } div.related { + margin-top: 0.5em; margin-bottom: 1.2em; padding: 0.5em 0; - border-bottom: 1px solid #ccc; - margin-top: 0.5em; + border-width: 1px; + border-color: #ccc; } -div.related a:hover { - color: #0095C4; +.mobile-nav + div.related { + border-bottom-style: solid; } -div.related ~ div.related { - border-top: 1px solid #ccc; - border-bottom: none; +.document + div.related { + border-top-style: solid; +} + +div.related a:hover { + color: #0095c4; } .related .switchers { @@ -35,33 +111,66 @@ div.related ~ div.related { margin-right: 5px; } -.version_switcher_placeholder, -.language_switcher_placeholder { - padding-left: 5px; - background-color: white; +div.related ul::after { + content: ''; + clear: both; + display: block; } -.inline-search { - display: inline; -} +.inline-search, form.inline-search input { display: inline; } -form.inline-search input[type="submit"] { - width: 40px; + +form.inline-search input[type='submit'] { + /* In some languages, more than 40px is required */ + width: auto; + min-width: 40px; +} + +div.document { + display: flex; + /* Don't let long code literals extend beyond the right side of the screen */ + overflow-wrap: break-word; +} + +/* Don't let long code literals extend beyond the right side of the screen */ +span.pre { + white-space: unset; } div.sphinxsidebar { - background-color: #eeeeee; + display: flex; + width: min(25vw, 350px); + float: none; + position: sticky; + top: 0; + max-height: 100vh; + color: #444; + background-color: #eee; border-radius: 5px; line-height: 130%; font-size: smaller; } -div.sphinxsidebar h3, div.sphinxsidebar h4 { +div.sphinxsidebar h3, +div.sphinxsidebar h4 { margin-top: 1.5em; } +div.bodywrapper { + margin-left: min(25vw, 350px); +} + +div.sphinxsidebarwrapper { + box-sizing: border-box; + height: 100%; + overflow-x: hidden; + overflow-y: auto; + float: none; + flex-grow: 1; +} + div.sphinxsidebarwrapper > h3:first-child { margin-top: 0.2em; } @@ -71,28 +180,43 @@ div.sphinxsidebarwrapper > ul > li > ul > li { } div.sphinxsidebar a:hover { - color: #0095C4; + color: #0095c4; } form.inline-search input, -div.sphinxsidebar input { - font-family: 'Lucida Grande',Arial,sans-serif; +div.sphinxsidebar input, +div.related input { + font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif; border: 1px solid #999999; font-size: smaller; border-radius: 3px; } -div.sphinxsidebar input[type=text] { +div.sphinxsidebar input[type='text'] { max-width: 150px; } +#sidebarbutton { + display: flex; + justify-content: center; + align-items: center; + width: 12px; + min-width: 12px; + border-radius: 0 5px 5px 0; + border-left: none; +} + +#sidebarbutton:hover { + background-color: #AAAAAA; +} + div.body { padding: 0 0 0 1.2em; } div.body p, div.body dd, div.body li, div.body blockquote { text-align: left; - line-height: 1.4; + line-height: 1.6; } div.body h1, div.body h2, div.body h3, div.body h4, div.body h5, div.body h6 { margin: 0; @@ -111,16 +235,113 @@ div.body pre { border: 1px solid #ac9; } -div.body div.admonition, div.body div.impl-detail { +div.body { + .good pre { + border-left: 3px solid var(--good-border); + } + .bad pre { + border-left: 3px solid var(--bad-border); + } + .maybe pre { + border-left: 3px solid var(--middle-border); + } +} + +div.code-block-caption { + background-color: #eee; + border: 1px solid #ac9; + border-bottom: none; + border-radius: 3px 3px 0 0; + padding: 0.3em 0.6em; + font-size: 90%; + color: #333; + + & + div pre { + border-top-left-radius: 0 !important; + border-top-right-radius: 0 !important; + } + + & + div .copybutton { + border-top-right-radius: 0 !important; + } +} + +/* Admonitions */ +:root { + --admonition-background: #eee; + --admonition-border: #ccc; + --admonition-color: black; + --attention-background: #bbddff5c; + --attention-border: #0000ff36; + --caution-background: #ffc; + --caution-border: #dd6; + --danger-background: #ffe4e4; + --danger-border: red; + --error-background: #ffe4e4; + --error-border: red; + --hint-background: #dfd; + --hint-border: green; + --seealso-background: #ffc; + --seealso-border: #dd6; + --tip-background: #dfd; + --tip-border: green; + --warning-background: #ffe4e4; + --warning-border: red; +} + +div.body div.admonition { + background-color: var(--admonition-background); + border: 1px solid var(--admonition-border); border-radius: 3px; + color: var(--admonition-color); } -div.body div.impl-detail > p { - margin: 0; +div.body div.admonition.attention { + background-color: var(--attention-background); + border-color: var(--attention-border); +} + +div.body div.admonition.caution { + background-color: var(--caution-background); + border-color: var(--caution-border); +} + +div.body div.admonition.danger { + background-color: var(--danger-background); + border-color: var(--danger-border); +} + +div.body div.admonition.error { + background-color: var(--error-background); + border-color: var(--error-border); +} + +div.body div.admonition.hint { + background-color: var(--hint-background); + border-color: var(--hint-border); } -div.body div.seealso { - border: 1px solid #dddd66; +div.body div.admonition.seealso { + background-color: var(--seealso-background); + border-color: var(--seealso-border); +} + +div.body div.admonition.tip { + background-color: var(--tip-background); + border-color: var(--tip-border); +} + +div.body div.admonition.warning { + background-color: var(--warning-background); + border-color: var(--warning-border); +} + +div.body div.impl-detail { + border-radius: 3px; +} + +div.body div.impl-detail > p { + margin: 0; } div.body a { @@ -132,23 +353,32 @@ div.body a:visited { } div.body a:hover { - color: #00B0E4; + color: #00b0e4; } tt, code, pre { - font-family: "monospace", monospace; + font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace; font-size: 96.5%; } -div.body tt, div.body code { +div.body pre { + line-height: 120%; +} + +div.body tt, +div.body code { border-radius: 3px; } -div.body tt.descname, div.body code.descname { +div.body tt.descname, +div.body code.descname { font-size: 120%; } -div.body tt.xref, div.body a tt, div.body code.xref, div.body a code { +div.body tt.xref, +div.body a tt, +div.body code.xref, +div.body a code { font-weight: normal; } @@ -160,61 +390,149 @@ table.docutils { margin-bottom: 10px; } -table.docutils td, table.docutils th { +table.docutils td, +table.docutils th { border: 1px solid #ddd !important; border-radius: 3px; + padding: 0.3em 0.5em; } -table p, table li { +table p, +table li { text-align: left !important; } table.docutils th { background-color: #eee; - padding: 0.3em 0.5em; } -table.docutils td { - background-color: white; - padding: 0.3em 0.5em; -} - -table.footnote, table.footnote td { +table.footnote, +table.footnote td { border: 0 !important; } div.footer { line-height: 150%; - margin-top: -2em; text-align: right; width: auto; margin-right: 10px; } +div.footer a { + text-underline-offset: auto; +} + div.footer a:hover { - color: #0095C4; + color: #0095c4; +} + +/* C API return value annotations */ +:root { + --refcount: var(--good-color); + --refcount-return-borrowed-ref: var(--middle-color); } .refcount { - color: #060; + color: var(--refcount); +} + +.refcount.return_borrowed_ref { + color: var(--refcount-return-borrowed-ref) } .stableabi { color: #229; } -.highlight { - background: none !important; +/* C API thread safety annotations */ +:root { + --threadsafety-incompatible: var(--bad-color); + --threadsafety-compatible: var(--middle-color); + --threadsafety-distinct: var(--middle-color); + --threadsafety-shared: var(--good-color); + --threadsafety-atomic: var(--good-color); +} + +.threadsafety.threadsafety-incompatible { + color: var(--threadsafety-incompatible); } -dl > dt span ~ em { - font-family: "monospace", monospace; +.threadsafety.threadsafety-compatible { + color: var(--threadsafety-compatible); +} + +.threadsafety.threadsafety-distinct { + color: var(--threadsafety-distinct); +} + +.threadsafety.threadsafety-shared { + color: var(--threadsafety-shared); +} + +.threadsafety.threadsafety-atomic { + color: var(--threadsafety-atomic); +} + + +dl > dt span ~ em, +.sig { + font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace; } .toctree-wrapper ul { padding-left: 20px; } +.theme-selector { + margin-left: .5em; +} + +div.genindex-jumpbox, +div.genindex-jumpbox > p { + display: inline-flex; + flex-wrap: wrap; +} + +div.genindex-jumpbox a { + margin: 0 5px; + min-width: 30px; + text-align: center; +} + +.copybutton { + cursor: pointer; + position: absolute; + top: 0; + right: 0; + font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace; + font-size: 80%; + padding-left: .5em; + padding-right: .5em; + height: 100%; + max-height: min(100%, 2.4em); + border-radius: 0 3px 0 0; + color: #000; + background-color: #fff; + border: 1px solid #ac9; /* follows div.body pre */ + display: none; +} + +.copybutton:hover { + background-color: #eee; +} + +.copybutton:active { + background-color: #ddd; +} + +.highlight:active .copybutton { + display: block; +} + +.highlight:hover .copybutton { + display: block; +} + @media (max-width: 1023px) { /* Body layout */ div.body { @@ -244,13 +562,16 @@ dl > dt span ~ em { margin-inline-end: 0; } /* Remove sidebar and top related bar */ - div.related, .sphinxsidebar { + div.related, div.sphinxsidebar { display: none; } /* Anchorlinks are not hidden by fixed-positioned navbar when scrolled to */ html { scroll-padding-top: 40px; } + body { + margin-top: 40px; + } /* Top navigation bar */ .mobile-nav { @@ -260,7 +581,6 @@ dl > dt span ~ em { position: fixed; top: 0; left: 0; - background-color: white; box-shadow: rgba(0, 0, 0, 0.25) 0 0 2px 0; z-index: 1; } @@ -269,111 +589,79 @@ dl > dt span ~ em { } .nav-content { position: absolute; - z-index: 2; - left: 0; - top: 0; + z-index: 1; height: 40px; width: 100%; - max-width: 100vw; - padding: 0 1rem 0 45px; display: flex; - align-items: center; background-color: white; } - .nav-logo { - margin-right: 0.7rem; + .nav-items-wrapper { display: flex; - flex: 0 0 auto; + flex: auto; + padding: .25rem; + align-items: stretch; + } + .nav-logo { + margin-right: 1rem; + flex-shrink: 0; + align-self: center; } .nav-content img { + display: block; width: 20px; - height: auto; } .version_switcher_placeholder { - flex: 0 1 0; margin-right: 1rem; } + .version_switcher_placeholder > select { + height: 100%; + } .nav-content .search { display: flex; - flex: 1 1 auto; - align-items: center; - padding: 0 0 0 2px; + flex: auto; border: 1px solid #a9a9a9; - height: 30px; - overflow: hidden; - } - .nav-content .search:hover { - box-shadow: 0 1px 6px 0 rgba(32,33,36,0.28); - border-color: rgba(223,225,229,0); + align-items: stretch; } - .nav-content .search input[type=text] { + .nav-content .search input[type=search] { border: 0; - outline: 0; - box-shadow: none; - width: 40px; - height: 28px; - flex: 1 1 auto; + padding-left: 24px; + width: 100%; + flex: 1; } .nav-content .search input[type=submit] { height: 100%; - appearance: none; - -webkit-appearance: none; - border: 1px solid transparent; - border-left-color: #a9a9a9; box-shadow: none; + border: 0; + border-left: 1px solid #a9a9a9; cursor: pointer; - background-color: #f0f0f0; margin-right: 0; } - .nav-content .search input[type=submit]:hover { - border-color: #a9a9a9; - } .nav-content .search svg { - flex: 0 0 20px; - fill: #333; + position: absolute; + align-self: center; + padding-left: 4px; } .toggler__input { - width: 40px; - height: 40px; - left: 0; - opacity: 0; - position: absolute; - z-index: 3; - margin: 0; + display: none; } .toggler__label { width: 40px; - height: 40px; - margin: 0; - position: absolute; cursor: pointer; - top: 0; - left: 0; - background-color: transparent; - border: 1px solid white; - box-shadow: none; - z-index: 3; display: flex; align-items: center; justify-content: center; - padding: 0 8px; + padding: 8px; + flex-shrink: 0; } - .toggler__label:focus { - background-color: #eee; - border: 1px solid #ededed; - box-shadow: rgba(0, 0, 0, 0.25) 1px 0 2px 0; - } - .toggler__label:hover { - background-color: #eee; - border: 1px solid #ededed; - box-shadow: rgba(0, 0, 0, 0.25) 1px 0 2px 0; + .toggler__label:hover, .toggler__label:focus { + background-color: rgba(127 127 127 / 50%); } .toggler__label > span { position: relative; flex: none; height: 2px; width: 100%; - background: #444; + background: currentColor; transition: all 400ms ease; } .toggler__label > span::before, @@ -389,17 +677,17 @@ dl > dt span ~ em { .toggler__label > span::after { top: 8px; } - .toggler__input:checked ~ .toggler__label span { + .toggler__input:checked ~ nav > .toggler__label span { transform: rotate(135deg); } - .toggler__input:checked ~ .toggler__label span::before { + .toggler__input:checked ~ nav > .toggler__label span::before { transform: rotate(90deg); } - .toggler__input:checked ~ .toggler__label span::before, - .toggler__input:checked ~ .toggler__label span::after { + .toggler__input:checked ~ nav > .toggler__label span::before, + .toggler__input:checked ~ nav > .toggler__label span::after { top: 0; } - .toggler__input:checked:hover ~ .toggler__label span { + .toggler__input:checked:hover ~ nav > .toggler__label span { transform: rotate(315deg); } .toggler__input:checked ~ .menu-wrapper { @@ -417,6 +705,7 @@ dl > dt span ~ em { width: 300px; height: 100%; background-color: #eee; + color: #444444; box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); overflow-y: auto; } @@ -436,7 +725,6 @@ dl > dt span ~ em { font-size: 1.3em; } .menu-wrapper h3 { - color: #444444; font-size: 1.4em; } .menu-wrapper h3 + p, @@ -445,7 +733,6 @@ dl > dt span ~ em { } .menu a { font-size: smaller; - color: #444444; text-decoration: none; } .menu ul { @@ -461,43 +748,13 @@ dl > dt span ~ em { .menu ul li { margin-bottom: 0.5rem; } - .language_switcher_placeholder, - .version_switcher_placeholder { - position: relative; - border: 1px solid #a8a8a8; - height: 30px; - padding-right: 7px; - } .language_switcher_placeholder { margin-top: 2rem; } - .language_switcher_placeholder::after, - .version_switcher_placeholder::after { - content: url('../_static/caret-down.svg'); - position: absolute; - top: 7px; - width: 15px; - height: 15px; - right: 0; - pointer-events: none; - } - .language_switcher_placeholder select, - .version_switcher_placeholder select { - -webkit-appearance: none; - appearance: none; - border: 0; - height: 100%; - background-color: white; - } - .language_switcher_placeholder:focus-visible, - .version_switcher_placeholder:focus-visible { - outline-offset: 5px; - } .language_switcher_placeholder select { width: 100%; } .document { - padding-top: 40px; position: relative; z-index: 0; } @@ -506,4 +763,74 @@ dl > dt span ~ em { width: 100%; overflow-x: auto; } + + .menu .theme-selector-label { + margin-top: .5em; + display: flex; + width: 100%; + } + + .menu .theme-selector { + flex: auto; + } +} + +@media (min-width: 1024px) { + div.footer { + margin-top: -2em; + } +} + +/* Version change directives */ +:root { + --versionadded: var(--good-color); + --versionchanged: var(--middle-color); + --deprecated: var(--bad-color); + + --versionadded-border: var(--good-border); + --versionchanged-border: var(--middle-border); + --deprecated-border: var(--bad-border); +} + +div.versionadded, +div.versionchanged, +div.deprecated, +div.deprecated-removed { + border-left: 3px solid; + padding: 0 1rem; +} + +div.versionadded { + border-left-color: var(--versionadded-border); +} + +div.versionchanged { + border-left-color: var(--versionchanged-border); +} + +div.deprecated, +div.deprecated-removed, +div.versionremoved { + border-left-color: var(--deprecated-border); +} + +div.versionadded .versionmodified { + color: var(--versionadded); +} + +div.versionchanged .versionmodified { + color: var(--versionchanged); +} + +div.deprecated .versionmodified, +div.deprecated-removed .versionmodified, +div.versionremoved .versionmodified { + color: var(--deprecated); +} + +/* Hide header when printing */ +@media print { + div.mobile-nav { + display: none; + } } diff --git a/python_docs_theme/static/pydoctheme_dark.css b/python_docs_theme/static/pydoctheme_dark.css new file mode 100644 index 00000000..909a2969 --- /dev/null +++ b/python_docs_theme/static/pydoctheme_dark.css @@ -0,0 +1,197 @@ +/* Common colours */ +:root { + --good-color: rgb(79 196 100); + --good-border: var(--good-color); + --middle-color: rgb(244, 227, 76); + --middle-border: var(--middle-color); + --bad-color: rgb(244, 76, 78); + --bad-border: var(--bad-color); +} + + +/* Browser elements */ +:root { + scrollbar-color: #616161 transparent; + color-scheme: dark; +} + +html, +body { + background-color: #222; + color: rgba(255, 255, 255, 0.87); +} + +div.related { + color: rgba(255, 255, 255, 0.7); /* classic overwrite */ + border-color: #424242; +} + +/* SIDEBAR */ +div.sphinxsidebar, .menu-wrapper { + background-color: #333; + color: inherit; +} + +#sidebarbutton { + /* important to overwrite style attribute */ + background-color: #555 !important; + color: inherit !important; +} + +div.sidebar, aside.sidebar { + background-color: #424242; + border-color: #616161; +} + +/* ANCHORS AND HIGHLIGHTS */ +div.body a { + color: #7af; +} + +div.body a:visited { + color: #09e; +} + +a.headerlink:hover { + background-color: #424242; +} + +div.related a { + color: currentColor; +} + +div.footer, +div.footer a { + color: currentColor; /* classic overwrites */ +} + +dt:target, +span.highlighted { + background-color: #616161; +} + +.footnote:target { + background-color: #2c3e50; +} + +/* Below for most things in text */ + +dl.field-list > dt { + background-color: #434; +} + +table.docutils td, +table.docutils th { + border-color: #616161 !important; +} + +table.docutils th { + background-color: #424242; +} + +.stableabi { + color: #bbf; +} + +div.body pre { + border-color: #616161; +} + +div.code-block-caption { + background-color: #333; + border-color: #616161; + color: white; +} + +code { + background-color: #424242; +} + +div.body div.seealso { + background-color: rgba(255, 255, 0, 0.1); +} + +div.warning { + background-color: rgba(255, 0, 0, 0.2); +} + +.warning code { + background-color: rgba(255, 0, 0, 0.5); +} + +/* Admonitions */ +:root { + --admonition-background: #ffffff1a; + --admonition-border: currentColor; + --admonition-color: #ffffffde; + --attention-background: #ffffff1a; + --attention-border: currentColor; + --caution-background: #ffff001a; + --caution-border: #dd6; + --danger-background: #f003; + --danger-border: #f66; + --error-background: #f003; + --error-border: #f66; + --hint-background: #0044117a; + --hint-border: green; + --seealso-background: #ffff001a; + --seealso-border: #dd6; + --tip-background: #0044117a; + --tip-border: green; + --warning-background: #ff000033; + --warning-border: #ff6666; +} + +aside.topic, +div.topic, +div.note, +nav.contents { + background-color: rgba(255, 255, 255, 0.1); + border-color: currentColor; +} + +.note code { + background-color: rgba(255, 255, 255, 0.1); +} + +.mobile-nav { + box-shadow: rgba(255, 255, 255, 0.25) 0 0 2px 0; +} + +.nav-content { + background-color: black; +} + +img.invert-in-dark-mode { + filter: invert(1) hue-rotate(.5turn); +} + +/* -- object description styles --------------------------------------------- */ + +/* C++ specific styling */ + +/* Override Sphinx's basic.css to fix colour contrast */ +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #5283ff; +} + +/* Version change directives */ +:root { + --versionadded: var(--good-color); + --versionchanged: var(--middle-color); + --deprecated: var(--bad-color); +} + +.copybutton { + color: #ac9; /* follows div.body pre */ + background-color: #222222; /* follows body */ +} + +.copybutton:hover { + background-color: #434343; +} + +.copybutton:active { + background-color: #656565; +} diff --git a/python_docs_theme/static/search-focus.js b/python_docs_theme/static/search-focus.js new file mode 100644 index 00000000..aa5b42fd --- /dev/null +++ b/python_docs_theme/static/search-focus.js @@ -0,0 +1,21 @@ +function isInputFocused() { + const activeElement = document.activeElement; + return ( + activeElement.tagName === 'INPUT' || + activeElement.tagName === 'TEXTAREA' || + activeElement.isContentEditable + ); +} + +document.addEventListener('keydown', function(event) { + if (event.key === '/') { + if (!isInputFocused()) { + // Prevent "/" from being entered in the search box + event.preventDefault(); + + // Set the focus on the search box + const searchBox = document.getElementById('search-box'); + searchBox.focus(); + } + } +}); diff --git a/python_docs_theme/static/sidebar.js b/python_docs_theme/static/sidebar.js deleted file mode 100644 index 0680c6c8..00000000 --- a/python_docs_theme/static/sidebar.js +++ /dev/null @@ -1,194 +0,0 @@ -/* - * sidebar.js - * ~~~~~~~~~~ - * - * This script makes the Sphinx sidebar collapsible and implements intelligent - * scrolling. This is a slightly modified version of Sphinx's own sidebar.js. - * - * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds in - * .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton used to - * collapse and expand the sidebar. - * - * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden and the - * width of the sidebar and the margin-left of the document are decreased. - * When the sidebar is expanded the opposite happens. This script saves a - * per-browser/per-session cookie used to remember the position of the sidebar - * among the pages. Once the browser is closed the cookie is deleted and the - * position reset to the default (expanded). - * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -$(function() { - // global elements used by the functions. - // the 'sidebarbutton' element is defined as global after its - // creation, in the add_sidebar_button function - var jwindow = $(window); - var jdocument = $(document); - var bodywrapper = $('.bodywrapper'); - var documentwrapper = $('.documentwrapper'); - var sidebar = $('.sphinxsidebar'); - var sidebarwrapper = $('.sphinxsidebarwrapper'); - - // original margin-left of the bodywrapper and width of the sidebar - // with the sidebar expanded - var bw_margin_expanded = bodywrapper.css('margin-left'); - var ssb_width_expanded = sidebar.width(); - - // margin-left of the bodywrapper and width of the sidebar - // with the sidebar collapsed - var bw_margin_collapsed = '.8em'; - var ssb_width_collapsed = '.8em'; - - // colors used by the current theme - var dark_color = '#AAAAAA'; - var light_color = '#CCCCCC'; - - function get_viewport_height() { - if (window.innerHeight) - return window.innerHeight; - else - return jwindow.height(); - } - - function sidebar_is_collapsed() { - return sidebarwrapper.is(':not(:visible)'); - } - - function toggle_sidebar() { - if (sidebar_is_collapsed()) - expand_sidebar(); - else - collapse_sidebar(); - // adjust the scrolling of the sidebar - scroll_sidebar(); - } - - function collapse_sidebar() { - sidebarwrapper.hide(); - sidebar.css('width', ssb_width_collapsed); - bodywrapper.css('margin-left', bw_margin_collapsed); - sidebarbutton.css({ - 'margin-left': '0', - 'height': documentwrapper.height(), - 'border-radius': '5px' - }); - sidebarbutton.find('span').text('»'); - sidebarbutton.attr('title', _('Expand sidebar')); - document.cookie = 'sidebar=collapsed'; - } - - function expand_sidebar() { - bodywrapper.css('margin-left', bw_margin_expanded); - sidebar.css('width', ssb_width_expanded); - sidebarwrapper.show(); - sidebarbutton.css({ - 'margin-left': ssb_width_expanded-12, - 'height': Math.max(sidebarwrapper.height(), documentwrapper.height()), - 'border-radius': '0 5px 5px 0' - }); - sidebarbutton.find('span').text('«'); - sidebarbutton.attr('title', _('Collapse sidebar')); - //sidebarwrapper.css({'padding-top': - // Math.max(window.pageYOffset - sidebarwrapper.offset().top, 10)}); - document.cookie = 'sidebar=expanded'; - } - - function add_sidebar_button() { - sidebarwrapper.css({ - 'float': 'left', - 'margin-right': '0', - 'width': ssb_width_expanded - 28 - }); - // create the button - sidebar.append( - '
    «
    ' - ); - var sidebarbutton = $('#sidebarbutton'); - // find the height of the viewport to center the '<<' in the page - var viewport_height = get_viewport_height(); - var sidebar_offset = sidebar.offset().top; - var sidebar_height = Math.max(documentwrapper.height(), sidebar.height()); - sidebarbutton.find('span').css({ - 'display': 'block', - 'position': 'fixed', - 'top': Math.min(viewport_height/2, sidebar_height/2 + sidebar_offset) - 10 - }); - - sidebarbutton.click(toggle_sidebar); - sidebarbutton.attr('title', _('Collapse sidebar')); - sidebarbutton.css({ - 'border-radius': '0 5px 5px 0', - 'color': '#444444', - 'background-color': '#CCCCCC', - 'font-size': '1.2em', - 'cursor': 'pointer', - 'height': sidebar_height, - 'padding-top': '1px', - 'padding-left': '1px', - 'margin-left': ssb_width_expanded - 12 - }); - - sidebarbutton.hover( - function () { - $(this).css('background-color', dark_color); - }, - function () { - $(this).css('background-color', light_color); - } - ); - } - - function set_position_from_cookie() { - if (!document.cookie) - return; - var items = document.cookie.split(';'); - for(var k=0; k wintop && curbot > winbot) { - sidebarwrapper.css('top', $u.max([wintop - offset - 10, 0])); - } - else if (curtop < wintop && curbot < winbot) { - sidebarwrapper.css('top', $u.min([winbot - sidebar_height - offset - 20, - jdocument.height() - sidebar_height - 200])); - } - } - } - jwindow.scroll(scroll_sidebar); -}); diff --git a/python_docs_theme/static/themetoggle.js b/python_docs_theme/static/themetoggle.js new file mode 100644 index 00000000..f9394c66 --- /dev/null +++ b/python_docs_theme/static/themetoggle.js @@ -0,0 +1,24 @@ +const pydocthemeDark = document.getElementById('pydoctheme_dark_css') +const pygmentsDark = document.getElementById('pygments_dark_css') +const themeSelectors = document.getElementsByClassName('theme-selector') + +function activateTheme(theme) { + localStorage.setItem('currentTheme', theme); + [...themeSelectors].forEach(e => e.value = theme) + switch (theme) { + case 'light': + pydocthemeDark.media = 'not all' + pygmentsDark.media = 'not all' + break; + case 'dark': + pydocthemeDark.media = 'all' + pygmentsDark.media = 'all' + break; + default: + // auto + pydocthemeDark.media = '(prefers-color-scheme: dark)' + pygmentsDark.media = '(prefers-color-scheme: dark)' + } +} + +activateTheme(localStorage.getItem('currentTheme') || 'auto') diff --git a/python_docs_theme/theme.conf b/python_docs_theme/theme.conf deleted file mode 100644 index feaf249c..00000000 --- a/python_docs_theme/theme.conf +++ /dev/null @@ -1,32 +0,0 @@ -[theme] -inherit = default -stylesheet = pydoctheme.css?2021.11.1.dev -pygments_style = default - -[options] -bodyfont = 'Lucida Grande', Arial, sans-serif -headfont = 'Lucida Grande', Arial, sans-serif -footerbgcolor = white -footertextcolor = #555555 -relbarbgcolor = white -relbartextcolor = #666666 -relbarlinkcolor = #444444 -sidebarbgcolor = white -sidebartextcolor = #444444 -sidebarlinkcolor = #444444 -bgcolor = white -textcolor = #222222 -linkcolor = #0090c0 -visitedlinkcolor = #00608f -headtextcolor = #1a1a1a -headbgcolor = white -headlinkcolor = #aaaaaa -codebgcolor = #eeffcc -codetextcolor = #333333 - -issues_url = -root_name = Python -root_url = https://www.python.org/ -root_icon = py.svg -root_include_title = True -copyright_url = diff --git a/python_docs_theme/theme.toml b/python_docs_theme/theme.toml new file mode 100644 index 00000000..1d3cdbda --- /dev/null +++ b/python_docs_theme/theme.toml @@ -0,0 +1,39 @@ +[theme] +inherit = "default" +stylesheets = [ + "classic.css", + "pydoctheme.css", +] +pygments_style = { default = "default", dark = "monokai" } + +[options] +bodyfont = "-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif" +headfont = "-apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif" +footerbgcolor = "white" +footertextcolor = "#555555" +relbarbgcolor = "white" +relbartextcolor = "#666666" +relbarlinkcolor = "#444444" +sidebarbgcolor = "white" +sidebartextcolor = "#444444" +sidebarlinkcolor = "#444444" +sidebarbtncolor = "#cccccc" +bgcolor = "white" +textcolor = "#222222" +linkcolor = "#0090c0" +visitedlinkcolor = "#00608f" +headtextcolor = "#1a1a1a" +headbgcolor = "white" +headlinkcolor = "#aaaaaa" +codebgcolor = "#eeffcc" +codetextcolor = "#333333" + +hosted_on = "" +issues_url = "" +license_url = "" +root_name = "Python" +root_url = "https://www.python.org/" +root_icon = "py.svg" +root_icon_alt_text = "Python logo" +root_include_title = "True" +copyright_url = "" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..bb631b59 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +# for babel_runner.py +Babel +Jinja2 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 2a9acf13..00000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[bdist_wheel] -universal = 1 diff --git a/setup.py b/setup.py deleted file mode 100644 index 6447dc87..00000000 --- a/setup.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python - -import io - -from setuptools import setup - -# README into long description -with io.open("README.rst", encoding="utf-8") as readme_file: - long_description = readme_file.read() - - -setup( - name="python-docs-theme", - # Version is date based as year.month[.serial], where serial is used - # if multiple releases are needed to address build failures. - version="2021.11.1.dev", - description="The Sphinx theme for the CPython docs and related projects", - long_description=long_description, - author="PyPA", - author_email="distutils-sig@python.org", - url="https://github.com/python/python-docs-theme/", - packages=["python_docs_theme"], - include_package_data=True, - entry_points={ - "sphinx.html_themes": [ - "python_docs_theme = python_docs_theme", - ] - }, - classifiers=[ - "Intended Audience :: Developers", - "License :: OSI Approved :: Python Software Foundation License", - "Operating System :: OS Independent", - "Topic :: Documentation", - "Topic :: Software Development :: Documentation", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - ], -)