changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > werc / changeset: Two new configuration options for wman:

changeset 647: bec1802070f8
parent 646: 8704f5149b91
child 648: 656a0878728d
author: Uriel <u@berlinblue.org>
date: Sun, 09 Jan 2011 10:48:18 +0000
files: apps/wman/app.rc
description: Two new configuration options for wman:

* wman_tmac (defaults to 'an') to pass as parameter to the -m flag of troff.
* fn wman_out_filter (defaults to calling wman_default_out_filter) to do post-processing (eg., calling col) of man page output.

Also filter out directories starting with _ from man page section listings.
     1.1--- a/apps/wman/app.rc	Sun Jan 09 10:44:54 2011 +0000
     1.2+++ b/apps/wman/app.rc	Sun Jan 09 10:48:18 2011 +0000
     1.3@@ -1,4 +1,5 @@
     1.4 fn conf_enable_wman {
     1.5+    wman_tmac=an
     1.6     wman_base_uri=$conf_wd
     1.7     wman_man_path=$*
     1.8     if(~ $#wman_man_path 0)
     1.9@@ -6,7 +7,7 @@
    1.10     conf_enable_app wman
    1.11 }
    1.12 
    1.13-wman_junk_filter='/(\/(INDEX|\.cvsignore)|\.9p|\.html)$/d; s!/man([0-9]+/[^/]+)$!/\1!; '
    1.14+wman_junk_filter='/(\/(INDEX|\.cvsignore|_.*)|\.9p|\.html)$/d; s!/man([0-9]+/[^/]+)$!/\1!; '
    1.15 fn wman_ls_pages {
    1.16     ls $* \
    1.17         | sed $dirfilter^$wman_junk_filter^' s/\.([0-9]|9p)$//; s!/0intro$!/intro!' \
    1.18@@ -70,8 +71,19 @@
    1.19 
    1.20 fn wman_page_gen {
    1.21     #troff -manhtml $1| troff2html -t 'Plan 9 from User Space'
    1.22-    troff -N -man $1 \
    1.23-    | escape_html \
    1.24+    # Using GNU col here to remove nroffs garbage (eg., from .ft B); p9p has no col(1) :(
    1.25+    troff -N -m$wman_tmac $1 | wman_out_filter
    1.26+}
    1.27+
    1.28+fn wman_out_filter {
    1.29+    wman_default_out_filter
    1.30+}
    1.31+
    1.32+fn wman_default_out_filter {
    1.33+    escape_html \
    1.34     | sed 's!([\.\-a-zA-Z0-9]+)\(('^`{echo $wman_cat_list|tr ' ' '|'}^')\)!<a href="../\2/\1">&</a>!g' \
    1.35     | awk '/^$/ {if(n != 1) print; n=1; next} /./ {n=0; print}'
    1.36+
    1.37 }
    1.38+
    1.39+