File: page.rst

package info (click to toggle)
taskflow 3.9.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 45,948 kB
  • sloc: cpp: 39,058; xml: 35,572; python: 12,935; javascript: 1,732; makefile: 59; sh: 16
file content (140 lines) | stat: -rw-r--r-- 2,539 bytes parent folder | download
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
m.code
######

.. role:: ansi(code)
    :language: ansi
.. role:: cpp(code)
    :language: c++
.. role:: tex(code)
    :language: tex
.. role:: rst(code)
    :language: rst
.. role:: py(code)
    :language: py

.. code:: c++

    int main() {
        return 0;
    }

.. code:: c++
    :class: m-inverted
    :hl-lines: 2

    int main() {
        return 1;
    }

Legacy :rst:`:hl_lines:` option should work the same:

.. code:: c++
    :class: m-inverted
    :hl_lines: 2

    int main() {
        return 1;
    }

Same as above, but for a :rst:`.. include::`, which should also support line
highlighting:

.. include:: code.cpp
    :code: c++
    :class: m-inverted
    :hl-lines: 2

Inline code is here: :cpp:`constexpr`. Code without a language should be
rendered as plain monospace text: :code:`code`.

.. include:: console.ansi
    :code: ansi

Syntax highlighting:

.. code:: py

    # Comment
    var = "string{}escape\n"

Console colors, including :ansi:`inline` code:

.. include:: console-colors.ansi
    :code: ansi

.. code:: whatthefuck

    // this language is not highlighted

Properly preserve backslashes: :tex:`\frac{a}{b}` ... and backticks:
:rst:`:ref:`a function <os.path.join()>``

Don't trim leading spaces in blocks:

.. code:: c++

            nope();
        return false;
    }

`Advanced file inclusion`_
==========================

.. include:: file.py
    :start-after: """
    :end-before: """

.. the following tests :start-on:, empty :end-before: and :strip-prefix: also:

.. include:: file.py
    :start-on: # This is a reST
    :end-before:
    :strip-prefix: '# '

.. include:: file.py
    :start-after: # [yay-code]
    :end-before: # [/yay-code]
    :strip-prefix: '    '
    :code: py

In comparison, here's the default output without :rst:`:strip-prefix:`:

.. include:: file.py
    :start-after: # [yay-code]
    :end-before: # [/yay-code]
    :code: py

`Filters`_
==========

.. role:: css(code)
    :language: css

Applied by default, adding typographically correct spaces before and a color
swatch after --- and for inline as well: :css:`p{ color:#ff3366; }`

.. code:: css

    p{
        color:#ff3366;
    }

.. role:: css-filtered(code)
    :language: css
    :filters: lowercase replace_colors

Applied explicitly and then by default --- and for inline as well:
:css-filtered:`P{ COLOR:#C0FFEE; }`

.. code:: css
    :filters: lowercase replace_colors

    P{
        COLOR:#C0FFEE;
    }

Includes too:

.. include:: style.css
    :code: css
    :filters: lowercase replace_colors