diff options
-rw-r--r-- | README.markdown | 3 | ||||
-rwxr-xr-x | bin/htref | 3 | ||||
-rw-r--r-- | man/man1/htref.1df | 20 |
3 files changed, 25 insertions, 1 deletions
diff --git a/README.markdown b/README.markdown index b0982a7d..3ee71195 100644 --- a/README.markdown +++ b/README.markdown @@ -405,9 +405,10 @@ Installed by the `install-bin` target: * `min(1df)` prints the minimum. * `mode(1df)` prints the first encountered mode. * `tot(1df)` totals the set. -* Two quick-and-dirty HTML text node content encoding tools: +* Three quick-and-dirty HTML tools: * `htenc(1df)` encodes. * `htdec(1df)` decodes. + * `htrec(1df)` wraps `a` tags around URLs. * `ap(1df)` reads arguments for a given command from the standard input, prompting if appropriate * `apf(1df)` prepends arguments to a command with ones read from a file, diff --git a/bin/htref b/bin/htref new file mode 100755 index 00000000..da089edc --- /dev/null +++ b/bin/htref @@ -0,0 +1,3 @@ +#!/bin/sed -f +# Quick-and-dirty HTML linkifier +s_https*://[^ \t<>]*_<a href="&">&</a>_ diff --git a/man/man1/htref.1df b/man/man1/htref.1df new file mode 100644 index 00000000..922188dc --- /dev/null +++ b/man/man1/htref.1df @@ -0,0 +1,20 @@ +.TH HTREF 1df "January 2017" "Manual page for htref" +.SH NAME +.B htref +\- turn URLs into HTML links +.SH SYNOPSIS +htenc urls | +.B htref +| nlbr > urls.html +.SH DESCRIPTION +.B htref +looks for http:// and https:// URLs, and wraps <a href="..."> tags around them +pointing to the same URL. HTML encoding of the URL should be done before this +step. +.P +All characters that are not spaces, tabs, or angle brackets are included in the +URL. +.SH SEE ALSO +htenc(1df) +.SH AUTHOR +Tom Ryder <tom@sanctum.geek.nz> |