Possible to use role defined in rst_prolog as default_role?

16 views
Skip to first unread message

Ian Pilcher

unread,
Jan 13, 2025, 8:44:20 PMJan 13
to sphinx...@googlegroups.com
I am using the rst_prolog setting to create an "arg" role, which I use
for inline highlighting of function/method argument/parameter names.

rst_prolog = """
.. raw:: html

<style type="text/css">
.arg {
font-family: monospace;
font-size: 90%;
font-weight: bold;
}
</style>

.. role:: arg
:class: arg
"""

I would like to use this as the default role, so I that I can simple
use single backticks (without the explicit role identifier) around
argument names in my Python docstrings.

default_role = 'arg'

This doesn't work, though. I get the following warning.

WARNING: default role arg not found

Is there any way to make this work?

--
========================================================================
Google Where SkyNet meets Idiocracy
========================================================================


Reply all
Reply to author
Forward
0 new messages