nml/readme.nml

129 lines
7.6 KiB
Text
Raw Normal View History

2024-07-19 11:57:09 +02:00
@html.page_title = NML -- Readme
@html.title = NML -- The nice markup languge!
@'html.css = style.css
2024-04-10 12:42:24 +02:00
2024-07-19 11:57:09 +02:00
@tex.main.fontsize = 9
2024-07-23 14:04:57 +02:00
@tex.main.preamble = \usepackage{xcolor, amsmath} \\
2024-07-19 11:57:09 +02:00
\definecolor{__color1}{HTML}{d5d5d5} \\
\everymath{\color{__color1}\displaystyle}
@tex.main.block_prepend = \color{__color1}
2024-04-10 12:42:24 +02:00
2024-07-19 11:57:09 +02:00
# Paragraphs
2024-04-10 12:42:24 +02:00
2024-07-19 11:57:09 +02:00
Blank lines (or multiple `\\n`'s) create new paragraphs!
2024-04-10 12:42:24 +02:00
2024-07-19 11:57:09 +02:00
```Plain Text, Example
First paragraph :: first '\n'
:: second '\n'
Second paragraph
2024-04-10 12:42:24 +02:00
```
2024-07-19 11:57:09 +02:00
# Lists
2024-04-10 12:42:24 +02:00
2024-07-19 11:57:09 +02:00
Numbered lists `-`:
- first
- second
- third
2024-04-10 12:42:24 +02:00
2024-07-19 11:57:09 +02:00
Unnumbered lists `\*`:
* A
* B
* C
2024-04-10 12:42:24 +02:00
2024-07-19 11:57:09 +02:00
NML also supports list nesting of multiple kinds:
* first
* second
*- 2.1
*- 2.2
*-* even more nested
* third
2024-04-10 12:42:24 +02:00
2024-07-19 11:57:09 +02:00
# Style
2024-04-10 12:42:24 +02:00
2024-07-19 11:57:09 +02:00
NML supports markdown-based text styling:
* \*\*bold\*\* -> **bold**
* \*italic\* -> *italic*
* \__underline\__ -> __underline__
* \`emphasis\` -> `emphasis`
2024-04-10 12:42:24 +02:00
2024-07-19 11:57:09 +02:00
Some additionally supportd text styling
* \`\`inline code\`\` -> ``inline code``
* \`\`C, int main()\`\` -> ``C, int main()``
2024-04-10 12:42:24 +02:00
2024-07-19 11:57:09 +02:00
# Code
2024-04-10 12:42:24 +02:00
2024-07-19 11:57:09 +02:00
```[line_offset=64] C, Some C code
int main(int argc, char** argv)
{
return 0;
}
2024-04-10 12:42:24 +02:00
```
2024-07-19 11:57:09 +02:00
# Lua kernel
2024-04-10 12:42:24 +02:00
2024-07-19 11:57:09 +02:00
Simple kernel named `example`:
``Lua
@<example
function make_bold(text)
return "**" .. text .. "**"
end
>@
``
@<example
function make_bold(text)
return "**" .. text .. "**"
end
>@
2024-04-10 12:42:24 +02:00
2024-07-19 11:57:09 +02:00
Evaluating `!` from a kernel: `\%<![kernel] eval>\%`
2024-04-10 12:42:24 +02:00
2024-07-23 14:04:57 +02:00
* `\%<[example]! make_bold("Hello, World!")>\%` → %<[example]! make_bold("Hello, World!")>%
2024-04-10 12:42:24 +02:00
2024-07-19 11:57:09 +02:00
# Latex
2024-04-10 12:42:24 +02:00
2024-07-25 14:19:49 +02:00
## Support for inline maths:
2024-07-19 11:57:09 +02:00
* $\sum^{\infty}_{k=1} \frac{1}{k^2} = \frac{\pi^2}{6}$
* $n! = \int_0^\infty t^n e^{-t} \text{ d}t$
2024-07-25 14:19:49 +02:00
# Graphs
NML adds support for *Graphviz* graphs.
[graph][
width=600px,
layout=neato
]
digraph g {
bgcolor="transparent"
fontname="Helvetica,Arial,sans-serif"
node [fontname="Helvetica,Arial,sans-serif"]
edge [fontname="Helvetica,Arial,sans-serif"]
graph [fontsize=30 labelloc="t" label="" splines=true overlap=false rankdir = "LR"];
"state0" [ style = "filled, bold" penwidth = 5 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<<table border="0" cellborder="0" cellpadding="3" bgcolor="white"><tr><td bgcolor="black" align="center" colspan="2"><font color="white">State #0</font></td></tr><tr><td align="left" port="r0">&#40;0&#41; s -&gt; &bull;e $ </td></tr><tr><td align="left" port="r1">&#40;1&#41; e -&gt; &bull;l '=' r </td></tr><tr><td align="left" port="r2">&#40;2&#41; e -&gt; &bull;r </td></tr><tr><td align="left" port="r3">&#40;3&#41; l -&gt; &bull;'*' r </td></tr><tr><td align="left" port="r4">&#40;4&#41; l -&gt; &bull;'n' </td></tr><tr><td align="left" port="r5">&#40;5&#41; r -&gt; &bull;l </td></tr></table>> ];
"state1" [ style = "filled" penwidth = 1 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<<table border="0" cellborder="0" cellpadding="3" bgcolor="white"><tr><td bgcolor="black" align="center" colspan="2"><font color="white">State #1</font></td></tr><tr><td align="left" port="r3">&#40;3&#41; l -&gt; &bull;'*' r </td></tr><tr><td align="left" port="r3">&#40;3&#41; l -&gt; '*' &bull;r </td></tr><tr><td align="left" port="r4">&#40;4&#41; l -&gt; &bull;'n' </td></tr><tr><td align="left" port="r5">&#40;5&#41; r -&gt; &bull;l </td></tr></table>> ];
"state2" [ style = "filled" penwidth = 1 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<<table border="0" cellborder="0" cellpadding="3" bgcolor="white"><tr><td bgcolor="black" align="center" colspan="2"><font color="white">State #2</font></td></tr><tr><td align="left" port="r4">&#40;4&#41; l -&gt; 'n' &bull;</td><td bgcolor="grey" align="right">=$</td></tr></table>> ];
"state3" [ style = "filled" penwidth = 1 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<<table border="0" cellborder="0" cellpadding="3" bgcolor="white"><tr><td bgcolor="black" align="center" colspan="2"><font color="white">State #3</font></td></tr><tr><td align="left" port="r5">&#40;5&#41; r -&gt; l &bull;</td><td bgcolor="grey" align="right">=$</td></tr></table>> ];
"state4" [ style = "filled" penwidth = 1 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<<table border="0" cellborder="0" cellpadding="3" bgcolor="white"><tr><td bgcolor="black" align="center" colspan="2"><font color="white">State #4</font></td></tr><tr><td align="left" port="r3">&#40;3&#41; l -&gt; '*' r &bull;</td><td bgcolor="grey" align="right">=$</td></tr></table>> ];
"state5" [ style = "filled" penwidth = 1 fillcolor = "black" fontname = "Courier New" shape = "Mrecord" label =<<table border="0" cellborder="0" cellpadding="3" bgcolor="black"><tr><td bgcolor="black" align="center" colspan="2"><font color="white">State #5</font></td></tr><tr><td align="left" port="r0"><font color="white">&#40;0&#41; s -&gt; e &bull;$ </font></td></tr></table>> ];
"state6" [ style = "filled" penwidth = 1 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<<table border="0" cellborder="0" cellpadding="3" bgcolor="white"><tr><td bgcolor="black" align="center" colspan="2"><font color="white">State #6</font></td></tr><tr><td align="left" port="r1">&#40;1&#41; e -&gt; l &bull;'=' r </td></tr><tr><td align="left" port="r5">&#40;5&#41; r -&gt; l &bull;</td><td bgcolor="grey" align="right">$</td></tr></table>> ];
"state7" [ style = "filled" penwidth = 1 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<<table border="0" cellborder="0" cellpadding="3" bgcolor="white"><tr><td bgcolor="black" align="center" colspan="2"><font color="white">State #7</font></td></tr><tr><td align="left" port="r1">&#40;1&#41; e -&gt; l '=' &bull;r </td></tr><tr><td align="left" port="r3">&#40;3&#41; l -&gt; &bull;'*' r </td></tr><tr><td align="left" port="r4">&#40;4&#41; l -&gt; &bull;'n' </td></tr><tr><td align="left" port="r5">&#40;5&#41; r -&gt; &bull;l </td></tr></table>> ];
"state8" [ style = "filled" penwidth = 1 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<<table border="0" cellborder="0" cellpadding="3" bgcolor="white"><tr><td bgcolor="black" align="center" colspan="2"><font color="white">State #8</font></td></tr><tr><td align="left" port="r1">&#40;1&#41; e -&gt; l '=' r &bull;</td><td bgcolor="grey" align="right">$</td></tr></table>> ];
"state9" [ style = "filled" penwidth = 1 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<<table border="0" cellborder="0" cellpadding="3" bgcolor="white"><tr><td bgcolor="black" align="center" colspan="2"><font color="white">State #9</font></td></tr><tr><td align="left" port="r2">&#40;2&#41; e -&gt; r &bull;</td><td bgcolor="grey" align="right">$</td></tr></table>> ];
state0 -> state5 [ penwidth = 5 fontsize = 28 fontcolor = "black" label = "e" ];
state0 -> state6 [ penwidth = 5 fontsize = 28 fontcolor = "black" label = "l" ];
state0 -> state9 [ penwidth = 5 fontsize = 28 fontcolor = "black" label = "r" ];
state0 -> state1 [ penwidth = 1 fontsize = 14 fontcolor = "grey28" label = "'*'" ];
state0 -> state2 [ penwidth = 1 fontsize = 14 fontcolor = "grey28" label = "'n'" ];
state1 -> state1 [ penwidth = 1 fontsize = 14 fontcolor = "grey28" label = "'*'" ];
state1 -> state4 [ penwidth = 5 fontsize = 28 fontcolor = "black" label = "r" ];
state1 -> state2 [ penwidth = 1 fontsize = 14 fontcolor = "grey28" label = "'n'" ];
state1 -> state3 [ penwidth = 5 fontsize = 28 fontcolor = "black" label = "l" ];
state6 -> state7 [ penwidth = 1 fontsize = 14 fontcolor = "grey28" label = "'='" ];
state7 -> state8 [ penwidth = 5 fontsize = 28 fontcolor = "black" label = "r" ];
state7 -> state1 [ penwidth = 1 fontsize = 14 fontcolor = "grey28" label = "'*'" ];
state7 -> state2 [ penwidth = 1 fontsize = 14 fontcolor = "grey28" label = "'n'" ];
state7 -> state3 [ penwidth = 5 fontsize = 28 fontcolor = "black" label = "l" ];
}
[/graph]