-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.mz
95 lines (64 loc) · 1.89 KB
/
README.mz
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
# markatzea
This project's `README.md` and stdout codeblocks are created using
markatzea:
```bash
markatzea README.mz > README.md
```
Markatzea does not break your existing markdown. It adds a little syntax for
defining the interpreter for that code block. This is defined after the
code-block's language name. The code-block is then passed as stdin into the
interpreter configured for that code-block.
## Usage
```bash bash
pod2text markatzea
```
## Examples
### Normal code-block
When no interpreter is defined, markatzea will print the markdown as is.
```bash
echo 'Does not evaluate this bash code-block'
```
```bash
echo 'Does not evaluate this bash code-block'
```
### Evaluated code-block
```bash bash
echo 'Does evaluate this bash code-block with bash'
```
```bash bash
echo 'Does evaluate this bash code-block with bash'
```
### Output Language
You can define the language to use for the output code block.
```bash|javascript bash
echo 'const value = 42;'
```
```bash|javascript bash
echo 'const value = 42;'
```
### Literate Programming
You can achieve a form of a literate programming using a template language that
offers a command line interface. See [memplate][2] for more information.
An example:
```bash memplate sane-bash-defaults
set -eo pipefail
```
Now we use the aliased template in another template.
```bash memplate | bash
<sane-bash-defaults
ls not-a-file |
cat - ||
echo 'Good! The ls process caused the pipe to stop.'
```
## Projects that use markatzea
> A list of projects that use markatzea.
- https://github.com/bas080/markatzea
- https://github.com/bas080/patroon
- https://github.com/bas080/furver
- https://github.com/bas080/package.sh
Notice that it makes it easier to maintain and test documentation by making
usage examples runnable and thereby testable.
## License
[GPL-3.0][1]
[1]:./LICENSE
[2]:https://github.com/bas080/memplate