Repository navigation
NESTED
Ilia Maslakov edited this page Oct 18, 2026
·
1 revision
Markdown hands each fenced block to the rules of the language it names, and those rules hand on what they embed in turn.
#!/bin/sh
# count the expressions of a log, then store the total
total=$(awk '/^= / { n++ } END { print n }' "${LOG:-calc.log}")
python3 - <<EOF
import json
print(json.dumps({"total": $total}))
EOF
sqlite3 stats.db <<EOF
INSERT INTO runs (total, day) VALUES ($total, date('now'));
SELECT count(*) FROM runs WHERE total > 10;
EOF<style>
.result { color: #2a7; font-weight: bold; }
</style>
<input id="expr" value="2 3 +">
<script>
const out = document.querySelector(".result");
out.textContent = `= ${eval("2 + 3")}`;
</script>{# the report of one run #}
<h1>{{ suite | upper }}</h1>
{% for case in cases if case.ok %}
<li>{{ case.input }} = {{ case.result | round(2) }}</li>
{% endfor %}static int
apply (token_kind_t kind, rpn_stack_t *s)
{
if (stack_pop (s, &b) != 0) /* nothing to pop */
return -1;
return stack_push (s, a / b);
}{ "input": "6 7 *", "expect": 42, "tags": ["mul"], "slow": false }sequenceDiagram
participant U as User
participant C as calc
U->>C: 2 3 +
C-->>U: = 5
Note over C: the stack is empty again
--- a/calc.c
+++ b/calc.c
@@ -10,3 +10,3 @@
if (b == 0.0)
- return 0.0;
+ return b < 0.0 ? -1.0 : 1.0;bluerig on GitHub |
Issues |
F1 in the editor and man bluerig have the full reference.
The editor
Beside the text
Extending
About the wiki