-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
Problem
It is not possible to apply syntax highlighting to inline literals or code.
The docutils documentation provides a way to do this using the role directive to define a new role, based on the code role, but the resulting HTML contains classes like .keyword instead of classes like .highlight .k which are used in Pygments CSS.
Expected results
Sphinx to provide a code role that applies proper classes for Pygments to style.
There is an extension to add this, but it is from 2013 (so maybe out of date with recent Sphinx), and it does not contain code to generate highlighting in LaTeX.
Reproducible project / your project
.. role:: js(code)
:language: js
This is inline code :js:`function a() { return 1; }`Environment info
- Sphinx version: 1.7.5
tuukkamustonen, hoefling, haltode and namurphy