File: myst-codeblock.md

package info (click to toggle)
python-sybil 9.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,148 kB
  • sloc: python: 4,510; makefile: 90
file content (65 lines) | stat: -rw-r--r-- 1,116 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
61
62
63
64
65
This is a code block:

```python

    y += 1
```

After this text is a code block that goes boom:

```{code-block} python
    raise Exception('boom!')
```

Now we have an invisible code block, great for setting things up or checking
stuff within a doc:


% invisible-code-block: python
%
%  z += 1
[__init__.py](..%2F..%2Fsybil%2Fparsers%2Fmyst%2F__init__.py)
This paranoidly checks that we can use binary and unicode literals:

<!--- invisible-code-block: python
bin = b'x'
uni = u'x'
--->

- Here's a code block that should still be found!:

  ```python

    class NoVars:
         __slots__ = ['x']
  ```
  
  This one has some text after it that also forms part of the bullet.

- Another bullet:

  ```{code-block} python

    define_this = 1

  ```
- A following bullet straight away!

- A code block in a non-python language:

  ```lolcode

    HAI
    CAN HAS STDIO?
    VISIBLE "HAI WORLD!"
    KTHXBYE
  ```
- Here's another code block that should still be found, even though it's
  at the end of the document, so don't add more after it!:

  ```python

    class YesVars:
         __slots__ = ['x']

  ```