diff --git a/README.md b/README.md index 07ca926..7a2be03 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,8 @@ Who is who in **bin** directory: - `commit MESSAGE` commit and push to master - `f TEXT` find TEXT using The Silver Searcher - `hd SYMBOL` draw a pretty heading +- `htm` feed selection to [Pug](https://github.com/pugjs/pug) +- `html` HTML boilerplate - `i`/`ui` indent/unindent selection - `lstrip` remove leading whitespace - `t2s N_SPACES`/`s2t N_SPACES` tabs <=> spaces diff --git a/bin/htm b/bin/htm new file mode 100755 index 0000000..cbaefb7 --- /dev/null +++ b/bin/htm @@ -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 diff --git a/bin/html b/bin/html new file mode 100755 index 0000000..81cd79e --- /dev/null +++ b/bin/html @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +echo -n , | 9p write acme/$winid/addr +#echo WORKS | 9p write acme/$winid/data + +9p write acme/$winid/data << HTML + + + + + + + + + + + +HTML