ewx: (Default)
[personal profile] ewx
# this is kind of painful using only BREs
nroff -man "$1" | sed 's/&/\&/g;
                       s/</\&lt;/g;
                       s/>/\&gt;/g;
                       s/@/\&#64;/g;
                       s!\(.\)^H\1!<b>\1</b>!g;
                       s!\(&[#0-9a-z][0-9a-z]*;\)^H\1!<b>\1</b>!g;
                       s!_^H\(.\)!<i>\1</i>!g;
                       s!_^H\(&[#0-9a-z][0-9a-z]*;\)!<i>\1</i>!g;
                       s!</\([bi]\)><\1>!!g'

(^H means a single character 8, not the two characters ^ and H.)

(no subject)

Date: 2004-05-24 09:47 am (UTC)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com
Turns formatted man pages, which use overprinting to implement bold and underlining, into a fragment of HTML.

January 2026

S M T W T F S
    123
45678910
111213141516 17
18192021222324
25262728293031

Most Popular Tags

Expand Cut Tags

No cut tags