mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-26 07:00:14 -05:00
Merge branch '3.x'
This commit is contained in:
commit
502c4ee5fb
22 files changed
+2360
-1143
No files matched your search
@@ -569,6 +569,20 @@ __ http://pygments.org/docs/lexers
|
||||
|
||||
print 'Explicit is better than implicit.'
|
||||
|
||||
In order to cross-reference a code-block using either the
|
||||
:rst:role:`ref` or the :rst:role:`numref` role, it is necessary
|
||||
that both :strong:`name` and :strong:`caption` be defined. The
|
||||
argument of :strong:`name` can then be given to :rst:role:`numref`
|
||||
to generate the cross-reference. Example::
|
||||
|
||||
See :numref:`this-py` for an example.
|
||||
|
||||
When using :rst:role:`ref`, it is possible to generate a cross-reference
|
||||
with only :strong:`name` defined, provided an explicit title is
|
||||
given. Example::
|
||||
|
||||
See :ref:`this code snippet <this-py>` for an example.
|
||||
|
||||
.. versionadded:: 1.3
|
||||
|
||||
.. rst:directive:option:: dedent: number
|
||||
@@ -1206,20 +1220,29 @@ the definition of the symbol. There is this directive:
|
||||
the following definition. If the definition spans multiple lines, each
|
||||
continuation line must begin with a colon placed at the same column as in
|
||||
the first line.
|
||||
Blank lines are not allowed within ``productionlist`` directive arguments.
|
||||
|
||||
The definition can contain token names which are marked as interpreted text
|
||||
(e.g., "``sum ::= `integer` "+" `integer```") -- this generates
|
||||
cross-references to the productions of these tokens. Outside of the
|
||||
production list, you can reference to token productions using
|
||||
:rst:role:`token`.
|
||||
|
||||
The *productionGroup* argument to :rst:dir:`productionlist` serves to
|
||||
distinguish different sets of production lists that belong to different
|
||||
grammars. Multiple production lists with the same *productionGroup* thus
|
||||
define rules in the same scope.
|
||||
|
||||
Blank lines are not allowed within ``productionlist`` directive arguments.
|
||||
Inside of the production list, tokens implicitly refer to productions
|
||||
from the current group. You can refer to the production of another
|
||||
grammar by prefixing the token with its group name and a colon, e.g,
|
||||
"``otherGroup:sum``". If the group of the token should not be shown in
|
||||
the production, it can be prefixed by a tilde, e.g.,
|
||||
"``~otherGroup:sum``". To refer to a production from an unnamed
|
||||
grammar, the token should be prefixed by a colon, e.g., "``:sum``".
|
||||
|
||||
The definition can contain token names which are marked as interpreted text
|
||||
(e.g. "``sum ::= `integer` "+" `integer```") -- this generates
|
||||
cross-references to the productions of these tokens. Outside of the
|
||||
production list, you can reference to token productions using
|
||||
:rst:role:`token`.
|
||||
However, if you have given a *productionGroup* argument you must prefix the
|
||||
Outside of the production list,
|
||||
if you have given a *productionGroup* argument you must prefix the
|
||||
token name in the cross-reference with the group name and a colon,
|
||||
e.g., "``myGroup:sum``" instead of just "``sum``".
|
||||
If the group should not be shown in the title of the link either
|
||||
|
||||
Reference in new issue
Block a user