mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add :filename: also for literalinclude. Changelog entry.
This commit is contained in:
@@ -188,6 +188,25 @@ Includes
|
||||
The ``prepend`` and ``append`` options, as well as ``tab-width``.
|
||||
|
||||
|
||||
Showing a file name
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionadded:: 1.3
|
||||
|
||||
A ``filename`` option can be given to show that name before the code block. For
|
||||
example::
|
||||
|
||||
.. code-block:: python
|
||||
:filename: this.py
|
||||
|
||||
print 'Explicit is better than implicit.'
|
||||
|
||||
|
||||
:rst:dir:`literalinclude` also supports the ``filename`` option, with the
|
||||
additional feature that if you leave the value empty, the shown filename will be
|
||||
exactly the one given as an argument.
|
||||
|
||||
|
||||
.. rubric:: Footnotes
|
||||
|
||||
.. [1] There is a standard ``.. include`` directive, but it raises errors if the
|
||||
|
||||
Reference in New Issue
Block a user