Discussion:
List all section anchors in rst docs
Nada Gh
2017-10-21 09:55:21 UTC
Permalink
Hi,

I want to list all anchors of sections in rst Docs (e.g. .. _anchorname:),
such that it will help in cross-referencing. If a cross-reference from
previous documents is required, I just run a script which will list all
used anchors, titles, and Docname and then use them a proper one.

Shall I use docutil lib and parse over the rst docs. Is there any sample
code to start with?

Thanks & Regards
--
You received this message because you are subscribed to the Google Groups "sphinx-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Komiya Takeshi
2017-10-21 10:36:30 UTC
Permalink
Hi Nada,

All labels (a.k.a. anchors) are stored at std domain. So you can
access them like following:

std_domain = env.get_domain('std')
std_domain.data['labels'] # => dictional (labelname -> docname,
labelid, sectionname)

If you are writing an extension, you can access them after read process.

Thanks,
Takeshi KOMIYA
Post by Nada Gh
Hi,
I want to list all anchors of sections in rst Docs (e.g. .. _anchorname:),
such that it will help in cross-referencing. If a cross-reference from
previous documents is required, I just run a script which will list all used
anchors, titles, and Docname and then use them a proper one.
Shall I use docutil lib and parse over the rst docs. Is there any sample
code to start with?
Thanks & Regards
--
You received this message because you are subscribed to the Google Groups
"sphinx-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "sphinx-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nada Gh
2017-10-21 11:14:14 UTC
Permalink
Thank you so much Takeshi!.
From where I can read more about this?

Best Regards,
Nada
Post by Komiya Takeshi
Hi Nada,
All labels (a.k.a. anchors) are stored at std domain. So you can
std_domain = env.get_domain('std')
std_domain.data['labels'] # => dictional (labelname -> docname,
labelid, sectionname)
If you are writing an extension, you can access them after read process.
Thanks,
Takeshi KOMIYA
Post by Nada Gh
Hi,
I want to list all anchors of sections in rst Docs (e.g. ..
_anchorname:),
Post by Nada Gh
such that it will help in cross-referencing. If a cross-reference from
previous documents is required, I just run a script which will list all
used
Post by Nada Gh
anchors, titles, and Docname and then use them a proper one.
Shall I use docutil lib and parse over the rst docs. Is there any sample
code to start with?
Thanks & Regards
--
You received this message because you are subscribed to the Google
Groups
Post by Nada Gh
"sphinx-dev" group.
To unsubscribe from this group and stop receiving emails from it, send
an
Post by Nada Gh
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "sphinx-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Komiya Takeshi
2017-10-21 11:54:31 UTC
Permalink
It's internal data of Sphinx, so it's not documented.
Post by Nada Gh
Thank you so much Takeshi!.
From where I can read more about this?
Best Regards,
Nada
Post by Komiya Takeshi
Hi Nada,
All labels (a.k.a. anchors) are stored at std domain. So you can
std_domain = env.get_domain('std')
std_domain.data['labels'] # => dictional (labelname -> docname,
labelid, sectionname)
If you are writing an extension, you can access them after read process.
Thanks,
Takeshi KOMIYA
Post by Nada Gh
Hi,
I want to list all anchors of sections in rst Docs (e.g. ..
_anchorname:),
such that it will help in cross-referencing. If a cross-reference from
previous documents is required, I just run a script which will list all used
anchors, titles, and Docname and then use them a proper one.
Shall I use docutil lib and parse over the rst docs. Is there any sample
code to start with?
Thanks & Regards
--
You received this message because you are subscribed to the Google Groups
"sphinx-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"sphinx-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "sphinx-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nada Gh
2017-10-21 16:22:15 UTC
Permalink
Ok, I will try what you've suggested.

Thank you
Post by Komiya Takeshi
It's internal data of Sphinx, so it's not documented.
Post by Nada Gh
Thank you so much Takeshi!.
From where I can read more about this?
Best Regards,
Nada
Post by Komiya Takeshi
Hi Nada,
All labels (a.k.a. anchors) are stored at std domain. So you can
std_domain = env.get_domain('std')
std_domain.data['labels'] # => dictional (labelname -> docname,
labelid, sectionname)
If you are writing an extension, you can access them after read
process.
Post by Nada Gh
Post by Komiya Takeshi
Thanks,
Takeshi KOMIYA
Post by Nada Gh
Hi,
I want to list all anchors of sections in rst Docs (e.g. ..
_anchorname:),
such that it will help in cross-referencing. If a cross-reference
from
Post by Nada Gh
Post by Komiya Takeshi
Post by Nada Gh
previous documents is required, I just run a script which will list
all
Post by Nada Gh
Post by Komiya Takeshi
Post by Nada Gh
used
anchors, titles, and Docname and then use them a proper one.
Shall I use docutil lib and parse over the rst docs. Is there any
sample
Post by Nada Gh
Post by Komiya Takeshi
Post by Nada Gh
code to start with?
Thanks & Regards
--
You received this message because you are subscribed to the Google Groups
"sphinx-dev" group.
To unsubscribe from this group and stop receiving emails from it,
send
Post by Nada Gh
Post by Komiya Takeshi
Post by Nada Gh
an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google
Groups
Post by Nada Gh
"sphinx-dev" group.
To unsubscribe from this group and stop receiving emails from it, send
an
Post by Nada Gh
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "sphinx-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-dev+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...