Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

formatting a Sphinx reference

If I use this RST source:

- :ref:`Naming Convention <naming>` --- we consistently 
  followed a certain naming convention

then I can get output that looks like this

  • Naming Convention — we consistently followed a certain naming convention

but what can I do to make "Naming Convention" boldface? RST doesn't seem to like the idea of nested formatting directives.

I've tried the suggestion in https://stackoverflow.com/a/4836544/44330 but it doesn't seem to work in this case (a :ref: rather than an HTML hyperlink)

I'm willing to write my own extension if necessary, as long as it's simple, but I don't know where to start.

like image 476
Jason S Avatar asked Jan 20 '26 19:01

Jason S


1 Answers

Does it help you to include a cssclass as the parent element of the reference? If the goal is to style link text selectively for specific links then you could do something like:

.. cssclass:: boldlink

:ref:`Naming Convention <naming>` --- we consistently followed a certain naming convention

Then define in custom.css:

.boldlink a { font-weight: bold; }

While you could override the CSS for all references, that would also restyle all the other links in the document:

span.std-ref { font-weight: bold; }
like image 165
ricardkelly Avatar answered Jan 25 '26 23:01

ricardkelly



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!