Skip to content

code-block documentation doesn't mention :class: option #10461

@simonw

Description

@simonw

Describe the bug

The following can be used to add an extra HTML class to a code block:

.. code-block:: json
   :class: metadata-json

    {
        "databases": {}
    }

But it's not mentioned in the documentation here: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-code-block

How to Reproduce

View https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-code-block

Expected behavior

No response

Your project

https://github.com/simonw/datasette

Screenshots

No response

OS

All

Python version

All

Sphinx version

All

Sphinx extensions

No response

Extra tools

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions