15-toml-html-encodingok
Structure
importtoml:lib/toml.mq.mdhtml:lib/html.mq.mdenc:lib/encoding.mq.md
fn · h1Config and safe text without plugins
comment
fn · h1main
bind
`cfg` = > toml.parse text=app = "demo"
[server]
port = 8080
call
> print text=[app](`cfg`)bind
`srv` = [server](`cfg`)call
> print text=[port](`srv`)bind
`safe` = > html.escape text=<tag>call
> print text=`safe`bind
`b` = > enc.base32_encode text=okcall
> print text=`b`Functions
Variables
-
b textN5VQ====N5VQ====
-
cfg map · 2
app demo server Map(1) key value app demo server key value port 8080 -
safe text<tag><tag>
-
srv map · 1
port 8080 key value port 8080
Execution
demo
8080
<tag>
N5VQ====
Source
--- title: Mid stdlib — toml, html, base32 description: Config TOML + HTML escape + base32 (Mid2 M8) import toml:lib/toml.mq.md import html:lib/html.mq.md import enc:lib/encoding.mq.md --- # Config and safe text without plugins Parse a TOML subset for tools, escape HTML before assembly, encode with base32. # main **cfg = > toml.parse text="app = \"demo\"\n[server]\nport = 8080\n"** > print text=[app](`cfg`) **srv = [server](`cfg`)** > print text=[port](`srv`) **safe = > html.escape text="<tag>"** > print text=`safe` **b = > enc.base32_encode text="ok"** > print text=`b`
Parse a TOML subset for tools, escape HTML before assembly, encode with base32.