mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
merge with trunk
This commit is contained in:
commit
016f375403
2
EXAMPLES
2
EXAMPLES
@ -43,7 +43,7 @@ included, please mail to `the Google group
|
||||
* PyPubSub: http://pubsub.sourceforge.net/
|
||||
* pyrticle: http://documen.tician.de/pyrticle/
|
||||
* Pysparse: http://pysparse.sourceforge.net/
|
||||
* Python: http://docs.python.org/dev/
|
||||
* Python: http://docs.python.org/
|
||||
* python-apt: http://people.debian.org/~jak/python-apt-doc/
|
||||
* PyUblas: http://documen.tician.de/pyublas/
|
||||
* Reteisi: http://docs.argolinux.org/reteisi/
|
||||
|
@ -134,6 +134,19 @@ class HandleCodeBlocks(Transform):
|
||||
nodes.doctest_block):
|
||||
node.replace_self(node.children[0])
|
||||
|
||||
|
||||
class SortIds(Transform):
|
||||
"""
|
||||
Sort secion IDs so that the "id[0-9]+" one comes last.
|
||||
"""
|
||||
default_priority = 261
|
||||
|
||||
def apply(self):
|
||||
for node in self.document.traverse(nodes.section):
|
||||
if len(node['ids']) > 1 and node['ids'][0].startswith('id'):
|
||||
node['ids'] = node['ids'][1:] + [node['ids'][0]]
|
||||
|
||||
|
||||
class CitationReferences(Transform):
|
||||
"""
|
||||
Handle citation references before the default docutils transform does.
|
||||
@ -154,7 +167,7 @@ class SphinxStandaloneReader(standalone.Reader):
|
||||
Add our own transforms.
|
||||
"""
|
||||
transforms = [CitationReferences, DefaultSubstitutions, MoveModuleTargets,
|
||||
HandleCodeBlocks]
|
||||
HandleCodeBlocks, SortIds]
|
||||
|
||||
def get_transforms(self):
|
||||
return standalone.Reader.get_transforms(self) + self.transforms
|
||||
@ -167,7 +180,6 @@ class SphinxDummyWriter(UnfilteredWriter):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
class SphinxContentsFilter(ContentsFilter):
|
||||
"""
|
||||
Used with BuildEnvironment.add_toc_from() to discard cross-file links
|
||||
|
Loading…
Reference in New Issue
Block a user