Skip to main content
https://travis-ci.org/nyergler/sphinx-classy-code.png?branch=master https://coveralls.io/repos/nyergler/sphinx-classy-code/badge.png

Drop-in replacements for Sphinxcode-block and literalinclude directives. In addition to specifying emphasize-lines, you can specify arbitrary classes to add on a per-line basis.

For example:

.. code-block:: python
   :line-classes: 1(python-def)

   def stay(classy):
       pass

Will wrap the function declaration in <span class="python-def">...</span>.

Valid line + class specifiers include:

  • 1(classname)

  • 1-5(classname)

You can separate multiple specifiers with a comma.

You can use both line-classes and emphasize-lines in the same block.

Installation

To install, simply install the package:

$ pip install sphinx-classy-code

Then add it to the list of Sphinx extensions in your conf.py:

extensions = ['classycode']

License

sphinx-classy-code is made available under a BSD license; see LICENSE for details.

News

0.1

Release date: 16 March 2014

  • code-block supports line-classes option.

  • literalinclude supports line-classes option.

  • line-classes and emphasize-lines work together correctly.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sphinx-classy-code-0.1.tar.gz (8.6 kB view details)

Uploaded Source

File details

Details for the file sphinx-classy-code-0.1.tar.gz.

File metadata

File hashes

Hashes for sphinx-classy-code-0.1.tar.gz
Algorithm Hash digest
SHA256 d4a38be95fa07bb7122293982b4490375b34b1e365c8cc7951421e9967c5f053
MD5 36b52fd625e043416d772c70a7f2d090
BLAKE2b-256 42a26e744da9671a5271e31e69aad8c7739983db718d09f0105da082153c0a60

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1 This release

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page