How to browse the document tree in order?

18 views
Skip to first unread message

Peter Burdine

unread,
Sep 13, 2016, 5:12:14 PM9/13/16
to sphinx-dev
Is there a "simple" example of browsing the document tree in the order that the files appear in the output document?  I wrote an extension that collects data for pages with a specific role and I need to be able to present that data in the order that items appear in the document.  Since Sphinx processes all the files, then assembles them, I can't go by the list that is created by the extension.

Komiya Takeshi

unread,
Sep 27, 2016, 10:09:07 PM9/27/16
to sphinx-dev
Hi,

AFAIK there are no good examples to trace the document tree.
Please refer sphinx.environment:BuildEnvironment.assign_section_numbers(). The method traces whole of documents and obtain sections in the order you said.

Thanks,
Takeshi KOMIYA

2016年9月14日水曜日 6時12分14秒 UTC+9 Peter Burdine:

Peter Burdine

unread,
Sep 29, 2016, 11:54:27 AM9/29/16
to sphinx-dev
Thank you.  At least that is a starting point.  That probably gets me 50% the way there.
Reply all
Reply to author
Forward
0 new messages