Refer to a numbered heading in ReST

Steven D'Aprano steve+comp.lang.python at pearwood.info
Thu Sep 22 04:30:04 EDT 2016


I have a ReST (ReStructured Text) document that auto-numbers headings.

I have a heading like:


    My Heading
    ----------


which will be given a number like 10.1 (say), except of course I don't know 
what the number will be until I've compiled the .rst file using Sphinx.

Later in the document I want to refer to the heading number, but *not* turn it 
into a cross-reference or link. I want to say:


    See clause XX.X.


where the XX.X is replaced by the number 10.1 (or whatever it turns out to be) 
but it should be just plain text. How can I do this using ReST and Sphinx?




-- 
Steven
git gets easier once you get the basic idea that branches are homeomorphic 
endofunctors mapping submanifolds of a Hilbert space.




More information about the Python-list mailing list