From 725caed4088358a7ebea4a9e855665ee8e1c84db Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 21 Jan 2017 15:13:25 +1300 Subject: Add htref(1df) --- README.markdown | 3 ++- bin/htref | 3 +++ man/man1/htref.1df | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 bin/htref create mode 100644 man/man1/htref.1df 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<>]*_&_ 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 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 -- cgit v1.2.3