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
|
break
|
||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
|
elif node.traverse(addnodes.toctree):
|
||||||
|
n = node.traverse(addnodes.toctree)[0]
|
||||||
|
if n.get('caption'):
|
||||||
|
sectname = n['caption']
|
||||||
|
else:
|
||||||
|
continue
|
||||||
else:
|
else:
|
||||||
# anonymous-only labels
|
# anonymous-only labels
|
||||||
continue
|
continue
|
||||||
|
@ -487,6 +487,10 @@ def get_figtype(node):
|
|||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
if isinstance(node, nodes.figure):
|
if isinstance(node, nodes.figure):
|
||||||
return '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):
|
elif isinstance(node, nodes.table):
|
||||||
return 'table'
|
return 'table'
|
||||||
elif isinstance(node, nodes.container):
|
elif isinstance(node, nodes.container):
|
||||||
|
@ -10,6 +10,8 @@ Contents:
|
|||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 2
|
:maxdepth: 2
|
||||||
:numbered:
|
:numbered:
|
||||||
|
:caption: Table of Contents
|
||||||
|
:name: mastertoc
|
||||||
|
|
||||||
extapi
|
extapi
|
||||||
images
|
images
|
||||||
@ -54,3 +56,9 @@ This used to crash:
|
|||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:hidden:
|
:hidden:
|
||||||
|
|
||||||
|
Test for issue #1700
|
||||||
|
====================
|
||||||
|
|
||||||
|
:ref:`mastertoc`
|
||||||
|
|
||||||
|
@ -141,11 +141,17 @@ Adding \n to test unescaping.
|
|||||||
* :ref:`admonition-section`
|
* :ref:`admonition-section`
|
||||||
* :ref:`here <some-label>`
|
* :ref:`here <some-label>`
|
||||||
* :ref:`my-figure`
|
* :ref:`my-figure`
|
||||||
|
* :ref:`my-figure-name`
|
||||||
* :ref:`my-table`
|
* :ref:`my-table`
|
||||||
|
* :ref:`my-table-name`
|
||||||
* :ref:`my-code-block`
|
* :ref:`my-code-block`
|
||||||
|
* :ref:`my-code-block-name`
|
||||||
* :numref:`my-figure`
|
* :numref:`my-figure`
|
||||||
|
* :numref:`my-figure-name`
|
||||||
* :numref:`my-table`
|
* :numref:`my-table`
|
||||||
|
* :numref:`my-table-name`
|
||||||
* :numref:`my-code-block`
|
* :numref:`my-code-block`
|
||||||
|
* :numref:`my-code-block-name`
|
||||||
* :doc:`subdir/includes`
|
* :doc:`subdir/includes`
|
||||||
* ``:download:`` is tested in includes.txt
|
* ``:download:`` is tested in includes.txt
|
||||||
* :option:`Python -c option <python -c>`
|
* :option:`Python -c option <python -c>`
|
||||||
@ -172,6 +178,7 @@ Tables
|
|||||||
.. _my-table:
|
.. _my-table:
|
||||||
|
|
||||||
.. table:: my table
|
.. table:: my table
|
||||||
|
:name: my-table-name
|
||||||
|
|
||||||
+----+----------------+----+
|
+----+----------------+----+
|
||||||
| 1 | * Block elems | x |
|
| 1 | * Block elems | x |
|
||||||
@ -199,6 +206,7 @@ Figures
|
|||||||
.. _my-figure:
|
.. _my-figure:
|
||||||
|
|
||||||
.. figure:: img.png
|
.. figure:: img.png
|
||||||
|
:name: my-figure-name
|
||||||
|
|
||||||
My caption of the figure
|
My caption of the figure
|
||||||
|
|
||||||
@ -237,6 +245,7 @@ Code blocks
|
|||||||
.. code-block:: ruby
|
.. code-block:: ruby
|
||||||
:linenos:
|
:linenos:
|
||||||
:caption: my ruby code
|
:caption: my ruby code
|
||||||
|
:name: my-code-block-name
|
||||||
|
|
||||||
def ruby?
|
def ruby?
|
||||||
false
|
false
|
||||||
|
Loading…
Reference in New Issue
Block a user