How can I use color with ReStructured Text? For example, **hello** translates into hello. How can I make ReStructure(r
Sphinx already supports colors with the s5defs.txt standard definition file intended for inclusion (but is missing the CSS file):
Create/append this text to the value of rst_epilog
sphinx configuration, in your docs/conf.py file:
rst_prolog = """
.. include::
.. default-role::
"""
Follow Sphinx's instructions to add a css with the colors (e.g. adopt the hack.css from @Næreen's answer):
_static/css/s4defs-roles.css;append it's path into shtml_css_files sphinx configuration:
html_css_files = [
'css/s4defs-roles.css',
]
You may then use:
Some :red:`colored text` at last!
TIP: Read this SO if you also want the styling to appear in Latex output.