๐Ÿ“ฆ ftnext / sphinx-revealjs-ext-codeblock

โ˜… 0 stars โ‘‚ 0 forks ๐Ÿ‘ 0 watching โš–๏ธ MIT License
๐Ÿ“ฅ Clone https://github.com/ftnext/sphinx-revealjs-ext-codeblock.git
HTTPS git clone https://github.com/ftnext/sphinx-revealjs-ext-codeblock.git
SSH git clone git@github.com:ftnext/sphinx-revealjs-ext-codeblock.git
CLI gh repo clone ftnext/sphinx-revealjs-ext-codeblock
ftnext ftnext [chore] hatch version 0.1.1 c440f19 3 months ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ src
๐Ÿ“ tests
๐Ÿ“„ .gitignore
๐Ÿ“„ LICENSE
๐Ÿ“„ pyproject.toml
๐Ÿ“„ README.md
๐Ÿ“„ README.md

sphinx-revealjs-ext-codeblock

PyPI - Version PyPI - Python Version

Extend code-block directive for Sphinx revealjs builder.


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-revealjsscriptplugins
  • https://sphinx-revealjs.readthedocs.io/en/stable/configurations/#confval-revealjscssfiles

Line Numbers

.. code-block:: python
    :linenos:

    while True:
        print("Hello world!")

<pre>
  <code class="python" data-line-numbers>
while True:
    print(&quot;Hello world!&quot;)
  </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(&quot;Hello world!&quot;)
  </code>
</pre>

See https://revealjs.com/code/#line-numbers-%26-highlights

License

sphinx-revealjs-ext-codeblock is distributed under the terms of the MIT license.