Scripts for working with HTML
This commit is contained in:
parent
3b1863798e
commit
46f6d59d2d
3 changed files with 30 additions and 0 deletions
10
bin/htm
Executable file
10
bin/htm
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
echo addr=dot | 9p write acme/$winid/ctl
|
||||
data=$(9p read acme/$winid/xdata)
|
||||
|
||||
indentation=$(echo "$data" | sed 1q | sed -E 's/^( *).*$/\1/')
|
||||
html=$(echo "$data" | sed "s/^$indentation//" | pug --pretty | sed '/^$/d' | s2t 2 | sed "s/^/$indentation/")
|
||||
|
||||
echo addr=dot | 9p write acme/$winid/ctl
|
||||
echo -n "$html" | 9p write acme/$winid/data
|
||||
Loading…
Add table
Add a link
Reference in a new issue