diff options
author | gbmor <ben@gbmor.dev> | 2019-09-14 15:22:58 -0400 |
---|---|---|
committer | gbmor <ben@gbmor.dev> | 2019-09-14 15:22:58 -0400 |
commit | 590174feb82150b854dd7d462420d40fc7ecbdc9 (patch) | |
tree | c3935dcc17ac2e19b3d8bb893b05b95dc535836f /pages | |
parent | 3342ab601f9f5b63a6dfd36f4a1e2f5e862d8fcd (diff) | |
download | wiki-590174feb82150b854dd7d462420d40fc7ecbdc9.tar.gz |
pp(1) by adi, added page
Diffstat (limited to 'pages')
-rw-r--r-- | pages/pp.md | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/pages/pp.md b/pages/pp.md new file mode 100644 index 0000000..b854561 --- /dev/null +++ b/pages/pp.md @@ -0,0 +1,60 @@ +<!-- +title: pp(1) +description: Introduction to pp(1) +author: ahriman / gbmor +--> + +# pp(1) + +`pp(1)` is a shell preprocessor developed by our own user [adi](https://adi.tilde.institute). +It allows one to embed shell into any text file between instances of the token `#!`. This powerful +tool allows the dynamic generation of static pages using standard bourne shell. + +For example: +``` +<!doctype html> +<title>pp(1) example</title> +<ul> +#! +i=1 +while test $i -le 10 +do +if test $((i % 2)) -eq 0 +then +#! + <li class=even>$i</li> +#! +else +#! + <li class=odd>$i</li> +#! +fi +i=$((i + 1)) +done +#! +</ul> +``` +Will output, per the manual page: +``` +<!doctype html> +<title>pp(1) example</title> +<ul> + <li class=odd>1</li> + <li class=even>2</li> + <li class=odd>3</li> + <li class=even>4</li> + <li class=odd>5</li> + <li class=even>6</li> + <li class=odd>7</li> + <li class=even>8</li> + <li class=odd>9</li> + <li class=even>10</li> +</ul> +``` + +The manpage includes more information on advanced features, such as piping `stdin` and debugging. + +## Notes +* Full Guide: [adi.tilde.institute/pp](https://adi.tilde.institute/pp) + +[back](/) |