aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/w3mman
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--scripts/w3mman/.cvsignore5
-rw-r--r--scripts/w3mman/Makefile.in18
-rw-r--r--scripts/w3mman/README34
-rw-r--r--scripts/w3mman/w3mman.1.in46
-rw-r--r--scripts/w3mman/w3mman.de.1.in71
-rw-r--r--scripts/w3mman/w3mman.in22
-rw-r--r--scripts/w3mman/w3mman2html.cgi.in35
7 files changed, 170 insertions, 61 deletions
diff --git a/scripts/w3mman/.cvsignore b/scripts/w3mman/.cvsignore
deleted file mode 100644
index e867c6e..0000000
--- a/scripts/w3mman/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-w3mman
-w3mman2html.cgi
-w3mman.1
-
-Makefile
diff --git a/scripts/w3mman/Makefile.in b/scripts/w3mman/Makefile.in
index 569e2fc..ad1cffe 100644
--- a/scripts/w3mman/Makefile.in
+++ b/scripts/w3mman/Makefile.in
@@ -33,11 +33,13 @@ ETC_DIR = $(sysconfdir)
CONF_DIR = $(sysconfdir)/$(PACKAGE)
BIN_DIR = $(bindir)
MAN1_DIR = $(mandir)/man1
+MAN1_DE_DIR = $(mandir)/de/man1
TARGETS = w3mman
CGIBIN_TARGETS = w3mman2html.cgi
MAN1_TARGETS = w3mman.1
-MAN_TARGETS = $(MAN1_TARGETS)
+MAN1_DE_TARGETS = w3mman.de.1
+MAN_TARGETS = $(MAN1_TARGETS) $(MAN1_DE_TARGETS)
MKDIR = mkdir -p
INSTALL = @INSTALL@
@@ -53,6 +55,7 @@ install: $(TARGETS) $(CGIBIN_TARGETS) $(MAN_TARGETS)
-$(MKDIR) $(DESTDIR)$(BIN_DIR)
-$(MKDIR) $(DESTDIR)$(CGIBIN_DIR)
-$(MKDIR) $(DESTDIR)$(MAN1_DIR)
+ -$(MKDIR) $(DESTDIR)$(MAN1_DE_DIR)
for file in $(TARGETS); \
do \
$(INSTALL_SCRIPT) $$file $(DESTDIR)$(BIN_DIR); \
@@ -65,6 +68,12 @@ install: $(TARGETS) $(CGIBIN_TARGETS) $(MAN_TARGETS)
do \
$(INSTALL_MAN) $$file $(DESTDIR)$(MAN1_DIR); \
done
+ for file in $(MAN1_DE_TARGETS); \
+ do \
+ $(INSTALL_MAN) $$file $(DESTDIR)$(MAN1_DE_DIR); \
+ f=`echo "$$file" | sed -e 's/\.de\././'`; \
+ mv $(DESTDIR)$(MAN1_DE_DIR)/$$file $(DESTDIR)$(MAN1_DE_DIR)/$$f; \
+ done
uninstall:
-for file in $(TARGETS); \
@@ -79,6 +88,11 @@ uninstall:
do \
rm -f $(MAN1_DIR)/$$file; \
done
+ -for file in $(MAN1_DE_TARGETS); \
+ do \
+ f=`echo "$$file" | sed -e 's/\.de\././'`; \
+ rm -f $(MAN1_DE_DIR)/$$f; \
+ done
clean:
@@ -89,7 +103,7 @@ distclean:
dist: all
@-rm -fr $(distdir)/w3mman
-$(MKDIR) $(distdir)/w3mman
- cp Makefile README w3mman.in w3mman2html.cgi.in hlink.cgi w3mman.1.in $(distdir)/w3mman
+ cp Makefile README w3mman.in w3mman2html.cgi.in hlink.cgi w3mman.1.in w3mman.de.1.in $(distdir)/w3mman
( cd $(distdir); tar -cf - w3mman | GZIP='' gzip ) \
> $(distdir)/w3mman.tar.gz
-rm -fr $(distdir)/w3mman
diff --git a/scripts/w3mman/README b/scripts/w3mman/README
index 3bcbb3b..189e9ac 100644
--- a/scripts/w3mman/README
+++ b/scripts/w3mman/README
@@ -1,54 +1,54 @@
w3mman
- 他のマニュアルやヘッダファイルにリンクをはることができる
- man コマンドの代替コマンドです。
+ 篁ャ≪<ゃ潟с
+ man 潟潟篁f帥潟潟с
-使用法
+篏睡羈
w3mman
w3mman <command>[(<section>)]
w3mman [<section>] <command>
w3mman -k <keyword>
-環境変数
+医紊
W3MMAN_W3M
- 使用する w3m コマンドを指定します(デフォルトは w3m)
+ 篏睡 w3m 潟潟絎障( w3m)
W3MMAN_MAN
- 使用する man コマンドを指定します(デフォルトは man)
+ 篏睡 man 潟潟絎障( man)
-インストール
+ゃ潟鴻若
make install
- 必要なら PERL, MAN, LIBDIR を設定してください。
- w3mman2html.cgi もインストールされます。
+ 綽荀 PERL, MAN, LIBDIR 荐絎
+ w3mman2html.cgi ゃ潟鴻若障
================
w3mman2html.cgi
-使用法
+篏睡羈
w3m file:///$LIB/w3mman2html.cgi
w3m file:///$LIB/w3mman2html.cgi?<command>[(<section>)]
w3m file:///$LIB/w3mman2html.cgi?man=<command>[&section=<section>]
w3m file:///$LIB/w3mman2html.cgi?keyword=<keyword>
-インストール
+ゃ潟鴻若
make install
- 必要なら PERL, MAN, LIBDIR を設定してください。
- w3mman もインストールされます。
+ 綽荀 PERL, MAN, LIBDIR 荐絎
+ w3mman ゃ潟鴻若障
================
hlink.cgi
- ヘッダファイルなどにリンクを張る
+ <ゃ潟綣泣
-インストール
+ゃ潟鴻若
- /$LIB/ にコピー
- w3mman2html.cgi で使用するならば $CGI2 に設定してください。
+ /$LIB/ 潟
+ w3mman2html.cgi т戎 $CGI2 荐絎
diff --git a/scripts/w3mman/w3mman.1.in b/scripts/w3mman/w3mman.1.in
index 1c0361d..68e3afc 100644
--- a/scripts/w3mman/w3mman.1.in
+++ b/scripts/w3mman/w3mman.1.in
@@ -1,4 +1,4 @@
-.TH W3MMAN 1 "Nov 5, 2005"
+.TH W3MMAN 1 "2016-07-13"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@@ -12,36 +12,54 @@
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
-w3mman \- an interface to the on-line reference manuals by w3m(1)
+w3mman \- an interface to the on-line reference manuals via w3m(1)
.SH SYNOPSIS
+.\" mh 2016-07-04: "page" is an optional argument.
+.\" Started without it, w3mman displays a form that allows selection
+.\" of a manual page according to section, name and keyword.
+.\" Therefore square brackets introduced
.B w3mman
-.RI "[-M " path ] " " [ section ] " page"
+[
+.BI \-M " path"
+] [ [
+.I section
+]
+.I page
+]
.br
.B w3mman
-.RI "[-M " path "] -k " keyword
+[
+.BI \-M " path"
+] [
+.I section
+]
+.BI \-k " keyword"
.br
.B w3mman
-.RI -l " file
+.BI \-l " file"
+.br
.SH DESCRIPTION
+.\" mh 2016-07-04 text edited. This section shall deliver
+.\" more information than section NAME
.B w3mman
-is the system's manual pager by
-.BR w3m (1).
+is a Perl script that uses
+.BR w3m (1)
+to serve as a pager for on-line reference manuals.
.SH OPTIONS
A summary of options is included below.
.TP
.BI \-M " path"
-Specify
+Specify
.I path
-as MANPATH.
+as alternative MANPATH to use.
.TP
.BI \-k " keyword"
-Specify
-.I keyword.
+Specify \fIkeyword\fP.
.TP
.BI \-l " file"
-Specify a
-.I file.
+Specify a \fIfile\fP.
.SH ENVIRONMENT
+Two variables are available for debugging.
.TP
.B W3MMAN_W3M
If W3MMAN_W3M is set, its value is used instead of @W3M@.
@@ -51,7 +69,7 @@ If W3MMAN_MAN is set, its value is used instead of @MAN@.
.SH FILES
.TP
.I @libexecdir@/@PACKAGE@/cgi-bin/w3mman2html.cgi
-convert manual page to html.
+manual page to HTML converter.
.SH SEE ALSO
.BR man (1),
.BR w3m (1).
diff --git a/scripts/w3mman/w3mman.de.1.in b/scripts/w3mman/w3mman.de.1.in
new file mode 100644
index 0000000..d6c5a44
--- /dev/null
+++ b/scripts/w3mman/w3mman.de.1.in
@@ -0,0 +1,71 @@
+.\"*******************************************************************
+.\"
+.\" This file was generated with po4a. Translate the source file.
+.\"
+.\"*******************************************************************
+.TH W3MMAN 1 2016\-07\-13
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+w3mman \- eine Schnittstelle zur Anzeige von Online\-Referenzhandb端chern durch
+w3m(1)
+.SH SYNOPSIS
+.\" mh 2016-07-04: "page" is an optional argument.
+.\" Started without it, w3mman displays a form that allows selection
+.\" of a manual page according to section, name and keyword.
+.\" Therefore square brackets introduced
+\fBw3mman\fP [ \fB\-M\fP \fIPfad\fP ] [ \fIAbschnitt\fP ] [ \fISeite\fP ]
+.br
+\fBw3mman\fP [\fB\-M\fP \fIPfad\fP] \fB\-k\fP \fIStichwort\fP
+.br
+\fBw3mman\fP \fB\-l\fP \fIDatei\fP
+.br
+.SH BESCHREIBUNG
+.\" mh 2016-07-04 text edited. This section shall deliver
+.\" more information than section NAME
+\fBw3mman\fP ist ein Perl\-Skript, welches auf \fBw3m\fP(1) zur端ckgreift, um als
+Betrachter f端r Online\-Referenzhandb端cher zu dienen.
+.SH OPTIONEN
+Es folgt eine Zusammenfassung der Optionen.
+.TP
+\fB\-M\fP\fI Pfad\fP
+Suchpfad f端r Handbuchseiten auf \fIPfad\fP setzen
+.TP
+\fB\-k\fP \fIStichwort\fP
+zum \fIStichwort\fP passende Handbuchseiten anzeigen
+.TP
+\fB\-l\fP \fIDatei\fP
+die Handbuchseiten\-Datei \fIDatei\fP anzeigen
+.SH UMGEBUNGSVARIABLEN
+Zur Fehleranalyse stehen zwei Variablen zur Verf端gung.
+.TP
+\fBW3MMAN_W3M\fP
+Ist W3MMAN_W3M gesetzt, wird ihr Wert anstelle von @W3M@ verwendet.
+.TP
+\fBW3MMAN_MAN\fP
+Ist W3MMAN_MAN gesetzt, wird ihr Wert anstelle von @MAN@ verwendet.
+.SH DATEIEN
+.TP
+\fI@libexecdir@/@PACKAGE@/cgi\-bin/w3mman2html.cgi\fP
+Skript, welches Handbuchseiten in HTML konvertiert
+.SH "SIEHE AUCH"
+\fBman\fP(1), \fBw3m\fP(1).
+.SH AUTOR
+Diese Handbuchseite wurde von Fumitoshi UKAI <ukai@debian.or.jp> f端r
+Debian GNU / Linux geschrieben, sie kann aber auch auf anderen Systemen
+verwendet werden.
+Die deutsche bersetzung wurde 2016 von
+.UR markus.hiereth@freenet.de
+Markus Hiereth
+.UE
+erstellt.
diff --git a/scripts/w3mman/w3mman.in b/scripts/w3mman/w3mman.in
index 6a27e70..061cb1f 100644
--- a/scripts/w3mman/w3mman.in
+++ b/scripts/w3mman/w3mman.in
@@ -7,7 +7,7 @@ $SCRIPT = 'file:///$LIB/w3mman2html.cgi';
sub usage {
($_ = $0) =~ s@.*/@@;
print STDERR "$_ [-M <path>] [[<section>] <command>]\n";
- print STDERR "$_ [-M <path>] [-k <keyword>]\n";
+ print STDERR "$_ [-M <path>] [<section>] [-k <keyword>]\n";
print STDERR "$_ [-l <file>]\n";
exit 1;
}
@@ -20,19 +20,23 @@ while (@ARGV) {
$ENV{'MANPATH'} = shift @ARGV;
} elsif (/^-k$/) {
@ARGV || &usage();
- $query = "?keyword=" . &form_encode(shift @ARGV);
- } elsif (/^-l$/) {
- @ARGV || &usage();
- $query = "?quit=ok&local=" . &form_encode(shift @ARGV);
+ if ( $query eq "" ) { $query = "?quit=ok"; }
+ $query .= "&keyword=" . &form_encode(shift @ARGV);
+ } elsif (/^-l$/ || /\//) {
+ if (/^-l$/) {
+ @ARGV || &usage();
+ $_ = shift @ARGV;
+ }
+ $query = "?quit=ok&local=" . &form_encode($_);
$query .= "&pwd=" . &form_encode($ENV{'PWD'});
} elsif (/^-/) {
&usage();
- } elsif (/^\d/ || $_ eq 'n') {
- @ARGV || &usage();
- $query = "?quit=ok&man=" . &form_encode(shift @ARGV);
+ } elsif (/^\d/ || $_ eq 'n' || $_ eq 'l') {
+ if ( $query eq "" ) { $query = "?quit=ok"; }
$query .= "&section=" . &form_encode($_);
} else {
- $query = "?quit=ok&man=" . &form_encode($_);
+ if ( $query eq "" ) { $query = "?quit=ok"; }
+ $query .= "&man=" . &form_encode($_);
}
}
diff --git a/scripts/w3mman/w3mman2html.cgi.in b/scripts/w3mman/w3mman2html.cgi.in
index f430307..2d326a9 100644
--- a/scripts/w3mman/w3mman2html.cgi.in
+++ b/scripts/w3mman/w3mman2html.cgi.in
@@ -23,18 +23,23 @@ if ((! $query{"man"}) && (! $query{"local"})) {
if ($query{"keyword"}) {
$keyword = $query{"keyword"};
$k = &html_quote($keyword);
+ if ($query{"section"}) {
+ $section = $query{"section"};
+ $sectionopt = "-s $section ";
+ } else {
+ $sectionopt = "";
+ }
print <<EOF;
Content-Type: text/html
<html>
-<head><title>man -k $k</title></head>
+<head><title>man $sectionopt-k $k</title></head>
<body>
-<h2>man -k <b>$k</b></h2>
+<h2>man $sectionopt-k <b>$k</b></h2>
<ul>
EOF
$keyword =~ s:([^-\w\200-\377.,])::g;
- open(F, "$MAN -k $keyword 2> /dev/null |");
- @line = ();
+ open(F, "$MAN $sectionopt -k $keyword 2> /dev/null |");
while(<F>) {
chop;
$_ = &html_quote($_);
@@ -59,10 +64,10 @@ Content-Type: text/html
<body>
<form action="$CGI">
<table>
-<tr><td>Manual:<td><input name=man>
-<tr><td>Section:<td><input name=section>
-<tr><td>Keyword:<td><input name=keyword>
-<tr><td><td><input type=submit> <input type=reset>
+<tr><td>Manual:<td><input name=man />
+<tr><td>Section:<td><input name=section />
+<tr><td>Keyword:<td><input name=keyword />
+<tr><td><td><input type=submit /> <input type=reset />
</table>
</form>
</body>
@@ -76,7 +81,7 @@ if ($query{"local"}) {
if (! ($file =~ /^\//)) {
$file = $query{"pwd"} . '/' . $file;
}
- open(F, "MAN_KEEP_FORMATTING=1 $MAN -l $file 2> /dev/null |");
+ open(F, "MAN_KEEP_FORMATTING=1 $MAN $file 2> /dev/null |");
} else {
$man = $query{"man"};
if ($man =~ s/\((\w+)\)$//) {
@@ -126,12 +131,14 @@ while(<F>) {
s/\&/\&amp;/g;
s/\</\&lt;/g;
s/\>/\&gt;/g;
+ # non ASCII UTF-8 codepoint
+ my $utf8="[\300-\337][\200-\277]|[\340-\357][\200-\277]{2}|[\360-\367][\200-\277]{3}|[\370-\373][\200-\277]{4}|[\374\375][\200-\277]{5}";
- s@([\200-\377].)(\010{1,2}\1)+@<b>$1</b>@g;
+ s@($utf8)(\010\1)+@<b>$1</b>@g;
s@(\&\w+;|.)(\010\1)+@<b>$1</b>@g;
- s@__\010{1,2}((\<b\>)?[\200-\377].(\</b\>)?)@<u>$1</u>@g;
+ s@_\010((\<b\>)?($utf8)(\</b\>)?)@<u>$1</u>@g;
s@_\010((\<b\>)?(\&\w+\;|.)(\</b\>)?)@<u>$1</u>@g;
- s@((\<b\>)?[\200-\377].(\</b\>)?)\010{1,2}__@<u>$1</u>@g;
+ s@((\<b\>)?($utf8)(\</b\>)?)\010_@<u>$1</u>@g;
s@((\<b\>)?(\&\w+\;|.)(\</b\>)?)\010_@<u>$1</u>@g;
s@.\010(.)@$1@g;
@@ -156,7 +163,7 @@ EOF
}
s@(http|ftp)://[\w.\-/~]+[\w/]@<a href="$&">$&</a>@g;
- s@(\W)(mailto:)?(\w[\w.\-]*\@\w[\w.\-]*\.[\w.\-]*\w)@$1<a href="mailto:$3">$2$3</a>@g;
+ s@\b(mailto:|)(\w[\w.\-]*\@\w[\w.\-]*\.[\w.\-]*\w)@<a href="mailto:$2">$1$2</a>@g;
s@(\W)(\~?/[\w.][\w.\-/~]*)@$1 . &file_ref($2)@ge;
s@(include(<\/?[bu]\>|\s)*\&lt;)([\w.\-/]+)@$1 . &include_ref($3)@ge;
if ($prev && m@^\s*(\<[bu]\>)*(\w[\w.\-]*)(\</[bu]\>)*(\([\dm]\w*\))@) {
@@ -220,7 +227,7 @@ sub is_command {
local($p);
(! -d && -x) || return 0;
- if (! defined(%PATH)) {
+ if (! %PATH) {
for $p (split(":", $ENV{'PATH'})) {
$p =~ s@/+$@@;
$PATH{$p} = 1;