mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge with 'stable'
This commit is contained in:
13
tests/roots/test-directive-code/python.rst
Normal file
13
tests/roots/test-directive-code/python.rst
Normal file
@@ -0,0 +1,13 @@
|
||||
===========================
|
||||
Literal Includes for python
|
||||
===========================
|
||||
|
||||
block start with blank or comment
|
||||
=================================
|
||||
|
||||
.. literalinclude:: target.py
|
||||
:pyobject: block_start_with_comment
|
||||
|
||||
.. literalinclude:: target.py
|
||||
:pyobject: block_start_with_blank
|
||||
|
||||
22
tests/roots/test-directive-code/target.py
Normal file
22
tests/roots/test-directive-code/target.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# Literally included file using Python highlighting
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
foo = "Including Unicode characters: üöä"
|
||||
|
||||
class Foo:
|
||||
pass
|
||||
|
||||
class Bar:
|
||||
def baz():
|
||||
pass
|
||||
|
||||
# comment after Bar class definition
|
||||
def bar(): pass
|
||||
|
||||
def block_start_with_comment():
|
||||
# Comment
|
||||
return 1
|
||||
|
||||
def block_start_with_blank():
|
||||
|
||||
return 1
|
||||
Reference in New Issue
Block a user