3

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

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.

Jason S
  • 184,598
  • 164
  • 608
  • 970
  • Possible duplicate of http://stackoverflow.com/q/8091979/407651 – mzjn Aug 09 '16 at 08:09
  • No, it's not a duplicate. That issue has formatting in the referenced section, not the section referencing it: in other words, if A references B, then question http://stackoverflow.com/questions/8091979 has the formatting in B and asks how to get that formatting to show up in A. My question is that if A references B, how can I add formatting in A. – Jason S Aug 09 '16 at 18:58

1 Answers1

3

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; }
ricardkelly
  • 2,003
  • 1
  • 1
  • 18