I know reStructuredText has this directive:
.. code:: bash
gedit pohl.m
which renders a code block. Is there some way to get syntax highlighting for inline snippets like this:
Do edit the file, type ``gedit pohl.m`` into a terminal.
The backticks mark it as code, but I’d like to highlight it with pygments like the block. Is this possible?
Having looked into this some more I stumbled upon the document reStructuredText Interpreted Text Roles. From this document:
It seems that there is a
coderole, so you can simply typeto render an inline code block. To get syntax highlighting you can define a custom role. For example
which you can then use like so:
Note that the role definition must be placed before references to the role.
Note, the document I link to makes no mention of the version of docutils to which it refers. The code role is not available in docutils 0.8.1 (which is the only version I have to test against).