mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
feat: add literate programming script
This commit is contained in:
17
.bin/lit.awk
Normal file
17
.bin/lit.awk
Normal file
@@ -0,0 +1,17 @@
|
||||
BEGIN {
|
||||
if (!comment) comment = "--";
|
||||
if (!begin) begin = "\\begin{code}";
|
||||
if (!end) end = "\\end{code}";
|
||||
}
|
||||
{
|
||||
if ($0 == begin) {
|
||||
code = 1;
|
||||
print comment, $0;
|
||||
} else if ($0 == end) {
|
||||
code = 0;
|
||||
print comment, $0;
|
||||
} else {
|
||||
if (code) print $0;
|
||||
else print comment, $0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user