mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
parent
28e1b1996d
commit
996b872875
@ -574,6 +574,12 @@ class StandardDomain(Domain):
|
||||
break
|
||||
else:
|
||||
continue
|
||||
elif node.traverse(addnodes.toctree):
|
||||
n = node.traverse(addnodes.toctree)[0]
|
||||
if n.get('caption'):
|
||||
sectname = n['caption']
|
||||
else:
|
||||
continue
|
||||
else:
|
||||
# anonymous-only labels
|
||||
continue
|
||||
|
@ -487,6 +487,10 @@ def get_figtype(node):
|
||||
from docutils import nodes
|
||||
if isinstance(node, nodes.figure):
|
||||
return 'figure'
|
||||
elif isinstance(node, nodes.image) and isinstance(node.parent, nodes.figure):
|
||||
# bare image node is not supported because it doesn't have caption and
|
||||
# no-caption-target isn't a numbered figure.
|
||||
return 'figure'
|
||||
elif isinstance(node, nodes.table):
|
||||
return 'table'
|
||||
elif isinstance(node, nodes.container):
|
||||
|
@ -10,6 +10,8 @@ Contents:
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:numbered:
|
||||
:caption: Table of Contents
|
||||
:name: mastertoc
|
||||
|
||||
extapi
|
||||
images
|
||||
@ -54,3 +56,9 @@ This used to crash:
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
Test for issue #1700
|
||||
====================
|
||||
|
||||
:ref:`mastertoc`
|
||||
|
||||
|
@ -141,11 +141,17 @@ Adding \n to test unescaping.
|
||||
* :ref:`admonition-section`
|
||||
* :ref:`here <some-label>`
|
||||
* :ref:`my-figure`
|
||||
* :ref:`my-figure-name`
|
||||
* :ref:`my-table`
|
||||
* :ref:`my-table-name`
|
||||
* :ref:`my-code-block`
|
||||
* :ref:`my-code-block-name`
|
||||
* :numref:`my-figure`
|
||||
* :numref:`my-figure-name`
|
||||
* :numref:`my-table`
|
||||
* :numref:`my-table-name`
|
||||
* :numref:`my-code-block`
|
||||
* :numref:`my-code-block-name`
|
||||
* :doc:`subdir/includes`
|
||||
* ``:download:`` is tested in includes.txt
|
||||
* :option:`Python -c option <python -c>`
|
||||
@ -172,6 +178,7 @@ Tables
|
||||
.. _my-table:
|
||||
|
||||
.. table:: my table
|
||||
:name: my-table-name
|
||||
|
||||
+----+----------------+----+
|
||||
| 1 | * Block elems | x |
|
||||
@ -199,6 +206,7 @@ Figures
|
||||
.. _my-figure:
|
||||
|
||||
.. figure:: img.png
|
||||
:name: my-figure-name
|
||||
|
||||
My caption of the figure
|
||||
|
||||
@ -237,6 +245,7 @@ Code blocks
|
||||
.. code-block:: ruby
|
||||
:linenos:
|
||||
:caption: my ruby code
|
||||
:name: my-code-block-name
|
||||
|
||||
def ruby?
|
||||
false
|
||||
|
Loading…
Reference in New Issue
Block a user