File: code-block.rst

package info (click to toggle)
sphinx-toolbox 4.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,936 kB
  • sloc: python: 11,668; sh: 27; javascript: 25; makefile: 17
file content (60 lines) | stat: -rw-r--r-- 801 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
:orphan:

=====================================
sphinx-toolbox Demo - Code
=====================================

.. code-block:: python

	def print(text):
		sys.stdout.write(text)


.. code-block:: python
	:tab-width: 4

	def print(text):
		sys.stdout.write(text)


.. code-block:: python
	:tab-width: 8

	def print(text):
		sys.stdout.write(text)


.. code-block:: python
	:dedent: 4

		def print(text):
			sys.stdout.write(text)

.. code-block:: python
	:linenos:

	def print(text):
		sys.stdout.write(text)

Code Cell
-----------

.. code-cell:: python
	:execution-count: 1

	def print(text):
		sys.stdout.write(text)

	print("hello world")

.. output-cell::
	:execution-count: 1

	hello world

.. code-cell:: python
	:execution-count: 2
	:tab-width: 8

	def print(text):
		sys.stdout.write(text)