sphinx-revealjs-ext-codeblock
Map standard Sphinx code-block options to reveal.js code attributes for the
Sphinx revealjs builder.
It lets authors keep using standard directives such as code-block,
literalinclude, :linenos:, :lineno-start:, and :emphasize-lines:
instead of switching to reveal.js-specific directives.
Table of Contents
Installation
pip install sphinx-revealjs-ext-codeblock
Usage
conf.py
extensions = [
"sphinx_revealjs",
"sphinx_revealjs_ext_codeblock",
]
Specify revealjs_script_plugins & revealjs_css_files.
- https://sphinx-revealjs.readthedocs.io/en/stable/configurations/#confval-revealjs_script_plugins
- https://sphinx-revealjs.readthedocs.io/en/stable/configurations/#confval-revealjs_css_files
Line Numbers
.. code-block:: python
:linenos:
while True:
print("Hello world!")
<pre>
<code class="python" data-line-numbers>
while True:
print("Hello world!")
</code>
</pre>
See https://revealjs.com/code/#line-numbers-%26-highlights
Highlights
.. code-block:: python
:emphasize-lines: 2
while True:
print("Hello world!")
<pre>
<code class="python" data-line-numbers="2">
while True:
print("Hello world!")
</code>
</pre>
See https://revealjs.com/code/#line-numbers-%26-highlights
Literalinclude Line Number Start
.. literalinclude:: example.py
:language: python
:lines: 2-3
:linenos:
:lineno-start: 1
<pre>
<code class="python" data-line-numbers data-ln-start-from="1">
print("two")
print("three")
</code>
</pre>
See https://revealjs.com/code/#line-number-offset-4.2.0
Literalinclude Matched Line Numbers
.. literalinclude:: example.py
:language: python
:lines: 2-3
:linenos:
:lineno-match:
<pre>
<code class="python" data-line-numbers data-ln-start-from="2">
print("two")
print("three")
</code>
</pre>
License
sphinx-revealjs-ext-codeblock is distributed under the terms of the MIT license.
Metadata
Release files for sphinx-revealjs-ext-codeblock 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sphinx_revealjs_ext_codeblock-0.1.2.tar.gz | 6.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sphinx_revealjs_ext_codeblock-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.7 kB
Release files / sphinx_revealjs_ext_codeblock-0.1.2.tar.gz
| Download URL | sphinx_revealjs_ext_codeblock-0.1.2.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9aca986c12aff0627a02610637d73a067f477ac4b6e87e4f26e724ef39275dd4
|
|
BLAKE2b-256 checksum How to use checksums |
f5b8824dd975ab8bfcd619bb15cccb314a9d80d4605f6eef67dd54c7d557bf5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 20, 2026.
Transparency logRelease files / sphinx_revealjs_ext_codeblock-0.1.2-py3-none-any.whl
| Download URL | sphinx_revealjs_ext_codeblock-0.1.2-py3-none-any.whl |
|---|---|
| Size | 4.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
63a3131bbfecd26b47464b2ae6779438e6856e7c7cfff8b9957c7b3494a5d933
|
|
BLAKE2b-256 checksum How to use checksums |
05e36d2918452c08079fb0316da3e16836e46d0301f5384600d1b48becfe10fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 20, 2026.
Transparency logSecurity for sphinx-revealjs-ext-codeblock 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for sphinx_revealjs_ext_codeblock-0.1.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.