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
|
Here's a simple fenced code block:
```python
>>> 1+1
2
```
Here's a fenced code block forming a MyST role:
```{code-block} python
>>> 1 + 1
3
```
Here's a fleshed out MyST directive:
```{directivename} arguments
---
key1: val1
key2: val2
---
This is
directive content
```
Here's the eval-rst role with a nexted Shinx role:
```{eval-rst}
.. doctest::
>>> 1 + 1
4
```
Here's an example of one way we could do "invisible directives":
% invisible-code-block: python
%
% b = 5
%
% ...etc...
This is the same style, but indented and is parsed out for pragmatic reasons:
% code-block: py
%
% b = 6
% ...etc...
%
Here's another way we might be able to do them:
<!--- invisible-code-block: python
def foo():
return 42
meaning_of_life = 42
assert foo() == meaning_of_life()
--->
This is the same style, but indented and is parsed out for pragmatic reasons:
<!--- code-block: python
blank line above ^^
blank line below:
--->
This is an <!-- inline comment -->.
- This one is in a bullet list so should be picked up (typo deliberate!).
```pthon
assert 1 + 1 == 2
```
- Here's one indented because it's in a bullet list:
<!--- invisible-code: py
blank line above ^^
blank line below:
--->
- Directives can also be indented for the same reason:
```{foo} bar
---
key1: val1
---
This, too, is a directive content
```
<!-- skip: next -->
<!-- skip: start if("some stuff here", reason='Something') -->
<!--
skip: and
-->
<!--
; skip: end
Other stuff here just gets ignored
-->
<!-- ; skip: also -->
<!-- clear-namespace -->
|