{ } Raw JSON

bundles / papyri 0.0.10 / papyri / directives / code_handler

function

papyri.directives:code_handler

source: /papyri/directives.py:138

Signature

def code_handler(argument: str, options: dict[str, str], content: str) → list[Any]

Summary

Directive handler that wraps the directive body in a Code node.

Extended Summary

Registered by default for code, code-block, and sourcecode. Also useful for domain-specific code directives — for example, the IPython Sphinx extension's .. ipython::

[global.directives]
ipython = 'papyri.directives:code_handler'

The directive argument (the lexer name, e.g. python or ipython) is currently ignored — Code does not yet carry a language hint.

Aliases

  • papyri.directives.code_handler