putting a label for a section in Sphinx

72 views
Skip to first unread message

Joon Ro

unread,
Sep 28, 2012, 1:13:25 AM9/28/12
to leo-e...@googlegroups.com
Hi,

I am learning sphinx using leo, and I was wondering what should I do if I want to refer to a section.
I want to put  .. _my-reference-label: right before a section, but since sections are nodes in leo, I am not sure how to do this.

Best,
Joon

Edward K. Ream

unread,
Sep 28, 2012, 9:28:30 AM9/28/12
to leo-e...@googlegroups.com
Use an implicit hyperlink target to your section:
http://docutils.sourceforge.net/docs/user/rst/quickref.html#implicit-hyperlink-targets

The drawback to this is that they link will change if you change the
title of a section, that is, headline.

Edward

Joon Ro

unread,
Oct 6, 2012, 1:55:44 AM10/6/12
to leo-e...@googlegroups.com
Thanks. This worked well. 

-Joon


--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To post to this group, send email to leo-e...@googlegroups.com.
To unsubscribe from this group, send email to leo-editor+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en.


Joon Ro

unread,
Oct 7, 2012, 2:50:33 AM10/7/12
to leo-e...@googlegroups.com
Actually, I think  this functionality (http://sphinx.pocoo.org/markup/inline.html#ref-role) is needed because sometimes I want to link to a section which is in different file. 

It would be great if there is an heading option which I could give the reference name, or there is a special directive inside the body, which would generate a label which corresponds to the section (heading). 

Would this be something implementable?

Thank you!!
Joon


On Saturday, October 6, 2012 12:55:46 AM UTC-5, Joon Ro wrote:
Thanks. This worked well. 

-Joon

Edward K. Ream

unread,
Oct 8, 2012, 3:06:50 PM10/8/12
to leo-e...@googlegroups.com
On Sun, Oct 7, 2012 at 1:50 AM, Joon Ro <joon...@gmail.com> wrote:

> It would be great if there is an heading option which I could give the reference name, or there is a special directive inside the body, which would generate a label which corresponds to the section (heading).

> Would this be something implementable?

Sure. It would be similar to @first in some ways.

Please create a wish-list bug for this. It's likely to be the only
way I'll get to it. Thanks.

Edward

Joon Ro

unread,
Oct 9, 2012, 9:29:43 PM10/9/12
to leo-e...@googlegroups.com
Will do. Thank you very much!!

Best,
Joon

Edward K. Ream

unread,
May 1, 2013, 3:08:14 PM5/1/13
to leo-editor
On Sun, Oct 7, 2012 at 1:50 AM, Joon Ro <joon...@gmail.com> wrote:
Actually, I think  this functionality (http://sphinx.pocoo.org/markup/inline.html#ref-role) is needed because sometimes I want to link to a section which is in different file. 

It would be great if there is an heading option which I could give the reference name, or there is a special directive inside the body, which would generate a label which corresponds to the section (heading). 

Would this be something implementable?

Everything is implementable :-)  But if you want something done it would be best to file a wish-list bug report at https://bugs.launchpad.net/leo-editor

Edward
Reply all
Reply to author
Forward
0 new messages