| 1 |
Testing downloadable files |
| 2 |
========================== |
| 3 |
|
| 4 |
Download :download:`img.png` here. |
| 5 |
Download :download:`this <subdir/img.png>` there. |
| 6 |
Download :download:`file with special characters <file_with_special_#_chars.xyz>`. |
| 7 |
|
| 8 |
Test file and literal inclusion |
| 9 |
=============================== |
| 10 |
|
| 11 |
.. include:: subdir/include.inc |
| 12 |
|
| 13 |
.. include:: /subdir/include.inc |
| 14 |
|
| 15 |
.. literalinclude:: literal.inc |
| 16 |
:language: python |
| 17 |
|
| 18 |
.. should succeed |
| 19 |
.. literalinclude:: wrongenc.inc |
| 20 |
:encoding: latin-1 |
| 21 |
:language: none |
| 22 |
.. include:: wrongenc.inc |
| 23 |
:encoding: latin-1 |
| 24 |
|
| 25 |
Literalinclude options |
| 26 |
====================== |
| 27 |
|
| 28 |
.. highlight:: text |
| 29 |
|
| 30 |
.. cssclass:: inc-pyobj1 |
| 31 |
.. literalinclude:: literal.inc |
| 32 |
:pyobject: Foo |
| 33 |
|
| 34 |
.. cssclass:: inc-pyobj2 |
| 35 |
.. literalinclude:: literal.inc |
| 36 |
:pyobject: Bar.baz |
| 37 |
|
| 38 |
.. cssclass:: inc-lines |
| 39 |
.. literalinclude:: literal.inc |
| 40 |
:lines: 6-7,9 |
| 41 |
:lineno-start: 6 |
| 42 |
|
| 43 |
.. cssclass:: inc-startend |
| 44 |
.. literalinclude:: literal.inc |
| 45 |
:start-after: coding: utf-8 |
| 46 |
:end-before: class Foo |
| 47 |
|
| 48 |
.. cssclass:: inc-preappend |
| 49 |
.. literalinclude:: literal.inc |
| 50 |
:prepend: START CODE |
| 51 |
:append: END CODE |
| 52 |
|
| 53 |
.. literalinclude:: literal.inc |
| 54 |
:start-after: utf-8 |
| 55 |
|
| 56 |
.. literalinclude:: literal.inc |
| 57 |
:end-before: class Foo |
| 58 |
|
| 59 |
.. literalinclude:: literal.inc |
| 60 |
:diff: literal_orig.inc |
| 61 |
|
| 62 |
.. cssclass:: inc-tab3 |
| 63 |
.. literalinclude:: tabs.inc |
| 64 |
:tab-width: 3 |
| 65 |
:language: text |
| 66 |
|
| 67 |
.. cssclass:: inc-tab8 |
| 68 |
.. literalinclude:: tabs.inc |
| 69 |
:tab-width: 8 |
| 70 |
:language: python |
| 71 |
|
| 72 |
.. cssclass:: inc-pyobj-lines-match |
| 73 |
.. literalinclude:: literal.inc |
| 74 |
:pyobject: Foo |
| 75 |
:lineno-match: |
| 76 |
|
| 77 |
.. cssclass:: inc-lines-match |
| 78 |
.. literalinclude:: literal.inc |
| 79 |
:lines: 6-7,8 |
| 80 |
:lineno-match: |
| 81 |
|
| 82 |
.. cssclass:: inc-startend-match |
| 83 |
.. literalinclude:: literal.inc |
| 84 |
:start-after: coding: utf-8 |
| 85 |
:end-before: class Foo |
| 86 |
:lineno-match: |
| 87 |
|
| 88 |
Test if dedenting before parsing works. |
| 89 |
|
| 90 |
.. highlight:: python |
| 91 |
|
| 92 |
.. cssclass:: inc-pyobj-dedent |
| 93 |
.. literalinclude:: literal.inc |
| 94 |
:pyobject: Bar.baz |
| 95 |
|
| 96 |
Docutils include with "literal" |
| 97 |
=============================== |
| 98 |
|
| 99 |
While not recommended, it should work (and leave quotes alone). |
| 100 |
|
| 101 |
.. include:: quotes.inc |
| 102 |
:literal: |