2009-06-04 18:21:26 +02:00
|
|
|
Testing downloadable files
|
|
|
|
|
==========================
|
|
|
|
|
|
|
|
|
|
Download :download:`img.png` here.
|
|
|
|
|
Download :download:`this <subdir/img.png>` there.
|
|
|
|
|
Don't download :download:`this <nonexisting.png>`.
|
|
|
|
|
|
2008-08-04 17:01:15 +00:00
|
|
|
Test file and literal inclusion
|
|
|
|
|
===============================
|
|
|
|
|
|
|
|
|
|
.. include:: subdir/include.inc
|
|
|
|
|
|
2010-05-30 12:59:42 +02:00
|
|
|
.. include:: /subdir/include.inc
|
|
|
|
|
|
2008-08-04 17:01:15 +00:00
|
|
|
.. literalinclude:: literal.inc
|
|
|
|
|
:language: python
|
|
|
|
|
|
|
|
|
|
.. should succeed
|
|
|
|
|
.. literalinclude:: wrongenc.inc
|
|
|
|
|
:encoding: latin-1
|
2016-02-14 09:21:35 +01:00
|
|
|
:language: none
|
2008-08-04 17:01:15 +00:00
|
|
|
.. include:: wrongenc.inc
|
|
|
|
|
:encoding: latin-1
|
2008-12-28 21:30:25 +01:00
|
|
|
|
2009-01-03 12:29:42 +01:00
|
|
|
Literalinclude options
|
|
|
|
|
======================
|
|
|
|
|
|
|
|
|
|
.. highlight:: text
|
|
|
|
|
|
|
|
|
|
.. cssclass:: inc-pyobj1
|
|
|
|
|
.. literalinclude:: literal.inc
|
|
|
|
|
:pyobject: Foo
|
|
|
|
|
|
|
|
|
|
.. cssclass:: inc-pyobj2
|
|
|
|
|
.. literalinclude:: literal.inc
|
|
|
|
|
:pyobject: Bar.baz
|
|
|
|
|
|
|
|
|
|
.. cssclass:: inc-lines
|
|
|
|
|
.. literalinclude:: literal.inc
|
|
|
|
|
:lines: 6-7,9
|
2014-01-11 08:44:45 +01:00
|
|
|
:lineno-start: 6
|
2009-01-03 12:29:42 +01:00
|
|
|
|
|
|
|
|
.. cssclass:: inc-startend
|
|
|
|
|
.. literalinclude:: literal.inc
|
|
|
|
|
:start-after: coding: utf-8
|
|
|
|
|
:end-before: class Foo
|
|
|
|
|
|
2009-06-04 17:57:58 +02:00
|
|
|
.. cssclass:: inc-preappend
|
|
|
|
|
.. literalinclude:: literal.inc
|
|
|
|
|
:prepend: START CODE
|
|
|
|
|
:append: END CODE
|
2008-12-28 21:30:25 +01:00
|
|
|
|
2010-01-30 18:49:42 +01:00
|
|
|
.. literalinclude:: literal.inc
|
|
|
|
|
:start-after: utf-8
|
|
|
|
|
|
|
|
|
|
.. literalinclude:: literal.inc
|
|
|
|
|
:end-before: class Foo
|
|
|
|
|
|
2014-08-12 14:11:54 +09:00
|
|
|
.. literalinclude:: literal.inc
|
2014-09-07 15:28:58 +02:00
|
|
|
:diff: literal_orig.inc
|
2014-08-12 14:11:54 +09:00
|
|
|
|
2010-01-08 18:36:58 +01:00
|
|
|
.. cssclass:: inc-tab3
|
|
|
|
|
.. literalinclude:: tabs.inc
|
|
|
|
|
:tab-width: 3
|
|
|
|
|
:language: text
|
|
|
|
|
|
|
|
|
|
.. cssclass:: inc-tab8
|
|
|
|
|
.. literalinclude:: tabs.inc
|
|
|
|
|
:tab-width: 8
|
|
|
|
|
:language: python
|
|
|
|
|
|
2014-09-30 00:11:28 +02:00
|
|
|
.. cssclass:: inc-pyobj-lines-match
|
|
|
|
|
.. literalinclude:: literal.inc
|
|
|
|
|
:pyobject: Foo
|
|
|
|
|
:lineno-match:
|
|
|
|
|
|
|
|
|
|
.. cssclass:: inc-lines-match
|
|
|
|
|
.. literalinclude:: literal.inc
|
2014-10-02 00:41:30 +02:00
|
|
|
:lines: 6-7,8
|
2014-09-30 00:11:28 +02:00
|
|
|
:lineno-match:
|
|
|
|
|
|
|
|
|
|
.. cssclass:: inc-startend-match
|
|
|
|
|
.. literalinclude:: literal.inc
|
|
|
|
|
:start-after: coding: utf-8
|
|
|
|
|
:end-before: class Foo
|
|
|
|
|
:lineno-match:
|
|
|
|
|
|
2009-06-04 18:21:26 +02:00
|
|
|
Test if dedenting before parsing works.
|
2008-12-28 21:30:25 +01:00
|
|
|
|
2009-06-04 18:21:26 +02:00
|
|
|
.. highlight:: python
|
2008-12-28 21:30:25 +01:00
|
|
|
|
2009-06-04 18:21:26 +02:00
|
|
|
.. cssclass:: inc-pyobj-dedent
|
|
|
|
|
.. literalinclude:: literal.inc
|
|
|
|
|
:pyobject: Bar.baz
|
2009-12-24 13:19:07 +01:00
|
|
|
|
|
|
|
|
Docutils include with "literal"
|
|
|
|
|
===============================
|
|
|
|
|
|
|
|
|
|
While not recommended, it should work (and leave quotes alone).
|
|
|
|
|
|
|
|
|
|
.. include:: quotes.inc
|
|
|
|
|
:literal:
|