6. Test file and literal inclusion


# Literally included file using Python highlighting
# -*- coding: utf-8 -*-
foo = "Including Unicode characters: üöä"
class Foo:
pass
class Bar:
def baz():
pass
def bar(): pass
This file is encoded in latin-1 but at first read as utf-8.
Max Strauß aß in München eine Leberkässemmel.
This file is encoded in latin-1 but at first read as utf-8.
Max Strauß aß in München eine Leberkässemmel.
7. Literalinclude options
class Foo:
pass
def baz():
pass
6 7 8 | class Foo:
pass
class Bar:
|
foo = "Including Unicode characters: üöä"
START CODE
# Literally included file using Python highlighting
# -*- coding: utf-8 -*-
foo = "Including Unicode characters: üöä"
class Foo:
pass
class Bar:
def baz():
pass
def bar(): pass
END CODE
foo = "Including Unicode characters: üöä"
class Foo:
pass
class Bar:
def baz():
pass
def bar(): pass
# Literally included file using Python highlighting
# -*- coding: utf-8 -*-
foo = "Including Unicode characters: üöä"
--- literal_orig.inc
+++ literal.inc
@@ -1,12 +1,12 @@
# Literally included file using Python highlighting
# -*- coding: utf-8 -*-
-foo = "Including Unicode characters: üöä" # This will be changed
+foo = "Including Unicode characters: üöä"
-class FooOrig:
+class Foo:
pass
-class BarOrig:
+class Bar:
def baz():
pass
Tabs include file test
----------------------
The next line has a tab:
-| |-
Tabs include file test
----------------------
The next line has a tab:
-| |-
6 7 | class Foo:
pass
|
6 7 | class Foo:
pass
|
3 | foo = "Including Unicode characters: üöä"
|
Test if dedenting before parsing works.
def baz():
pass
8. Docutils include with “literal”
While not recommended, it should work (and leave quotes alone).
Testing "quotes" in literal 'included' text.