Extension for Sphinx which enables combining code blocks.
Project description
Sphinx Combine
Extension for Sphinx which enables combining code blocks.
Installation
sphinx-combine is compatible with Sphinx 7.2.0+ using Python 3.10+.
$ pip install sphinx-combine
Setup
Add the following to conf.py to enable the extension:
"""Configuration for Sphinx."""
extensions = ["sphinxcontrib.spelling"] # Example existing extensions
extensions += ["sphinx_combine"]
Using combined-code-block
The extension provides a new directive, combined-code-block, which allows you to combine multiple code blocks into a single code block.
The directive takes a language argument which is used to determine the syntax, as well as all options that the code-block directive supports.
Languages and options of code blocks within the directive are ignored.
.. combined-code-block:: python
.. literalinclude:: my_code.js
:language: javascript
.. code-block:: python
"""First code block."""
.. code-block:: cpp
// Second code block.
Contributing
See CONTRIBUTING.rst.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sphinx_combine-2024.12.30.tar.gz.
File metadata
- Download URL: sphinx_combine-2024.12.30.tar.gz
- Upload date:
- Size: 23.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bae9540e384daa307d5fb1284069795ec89c5c02e72c461e5c76d5d457fc8a72
|
|
| MD5 |
4e7bc40a8dbb0dff7c983f54708fec1d
|
|
| BLAKE2b-256 |
e7992bb2b399d66a13052d2b3cea7b50d89ed2f9d8e6fbe02c9af16f7c713a74
|
Provenance
The following attestation bundles were made for sphinx_combine-2024.12.30.tar.gz:
Publisher:
release.yml on adamtheturtle/sphinx-combine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_combine-2024.12.30.tar.gz -
Subject digest:
bae9540e384daa307d5fb1284069795ec89c5c02e72c461e5c76d5d457fc8a72 - Sigstore transparency entry: 158232774
- Sigstore integration time:
-
Permalink:
adamtheturtle/sphinx-combine@cfa83d3b232cca3639bf00c3ec8b0c0ed2c82dc8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/adamtheturtle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cfa83d3b232cca3639bf00c3ec8b0c0ed2c82dc8 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file sphinx_combine-2024.12.30-py2.py3-none-any.whl.
File metadata
- Download URL: sphinx_combine-2024.12.30-py2.py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f02d45a95e596cc10455b2bc15b90f95a08baac7f534d0ffe66d594904800a9f
|
|
| MD5 |
972f9419742df389de4371469e4c070e
|
|
| BLAKE2b-256 |
8d76a68951267fbb5d169b3068cc76bc9f6d5d1d57ac63bdbe89a86c2e93301e
|
Provenance
The following attestation bundles were made for sphinx_combine-2024.12.30-py2.py3-none-any.whl:
Publisher:
release.yml on adamtheturtle/sphinx-combine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sphinx_combine-2024.12.30-py2.py3-none-any.whl -
Subject digest:
f02d45a95e596cc10455b2bc15b90f95a08baac7f534d0ffe66d594904800a9f - Sigstore transparency entry: 158232775
- Sigstore integration time:
-
Permalink:
adamtheturtle/sphinx-combine@cfa83d3b232cca3639bf00c3ec8b0c0ed2c82dc8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/adamtheturtle
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cfa83d3b232cca3639bf00c3ec8b0c0ed2c82dc8 -
Trigger Event:
workflow_dispatch
-
Statement type: