[w3m-dev 03583] w3mman

* scripts/w3mman/README: W3MMAN_W3M, W3MMAN_MAN
* scripts/w3mman/w3mman.1.in: add ENVIRONMENT
* scripts/w3mman/w3mman.in: $ENV{'W3MMAN_W3M'}, $ENV{'W3MMAN_MAN'}
* scripts/w3mman/w3mman2html.cgi.in: $ENV{'W3MMAN_MAN'}
				hyphenation
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
Fumitoshi UKAI
2002-12-18 16:48:02 +00:00
parent 8696cb81db
commit 3888822eef
5 changed files with 50 additions and 6 deletions

View File

@@ -1,3 +1,12 @@
2002-12-19 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 03583] w3mman
* scripts/w3mman/README: W3MMAN_W3M, W3MMAN_MAN
* scripts/w3mman/w3mman.1.in: add ENVIRONMENT
* scripts/w3mman/w3mman.in: $ENV{'W3MMAN_W3M'}, $ENV{'W3MMAN_MAN'}
* scripts/w3mman/w3mman2html.cgi.in: $ENV{'W3MMAN_MAN'}
hyphenation
2002-12-19 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> 2002-12-19 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 03582] add config options graphic_char and use_proxy * [w3m-dev 03582] add config options graphic_char and use_proxy
@@ -5959,4 +5968,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1 * release-0-2-1
* import w3m-0.2.1 * import w3m-0.2.1
$Id: ChangeLog,v 1.633 2002/12/18 16:42:30 ukai Exp $ $Id: ChangeLog,v 1.634 2002/12/18 16:48:02 ukai Exp $

View File

@@ -11,6 +11,13 @@ w3mman
w3mman [<section>] <command> w3mman [<section>] <command>
w3mman -k <keyword> w3mman -k <keyword>
<EFBFBD>Ķ<EFBFBD><EFBFBD>ѿ<EFBFBD>
W3MMAN_W3M
<20><><EFBFBD>Ѥ<EFBFBD><D1A4><EFBFBD> w3m <20><><EFBFBD>ޥ<EFBFBD><DEA5>ɤ<EFBFBD><C9A4><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD>(<28>ǥե<C7A5><D5A5><EFBFBD><EFBFBD>Ȥ<EFBFBD> w3m)
W3MMAN_MAN
<20><><EFBFBD>Ѥ<EFBFBD><D1A4><EFBFBD> man <20><><EFBFBD>ޥ<EFBFBD><DEA5>ɤ<EFBFBD><C9A4><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD>(<28>ǥե<C7A5><D5A5><EFBFBD><EFBFBD>Ȥ<EFBFBD> man)
<EFBFBD><EFBFBD><EFBFBD>󥹥ȡ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>󥹥ȡ<EFBFBD><EFBFBD><EFBFBD>
make install make install

View File

@@ -34,6 +34,13 @@ as MANPATH.
.B \-k " keyword" .B \-k " keyword"
Specify Specify
.I keyword. .I keyword.
.SH ENVIRONMENT
.TP
.B W3MMAN_W3M
If W3MMAN_W3M is set, its value is used instead of @W3M@.
.TP
.B W3MMAN_MAN
If W3MMAN_MAN is set, its value is used instead of @MAN@.
.SH FILES .SH FILES
.TP .TP
.I @LIB_DIR@/w3mman2html.cgi .I @LIB_DIR@/w3mman2html.cgi

View File

@@ -1,7 +1,7 @@
#!@PERL@ #!@PERL@
@W3M = split(' ', '@W3M@'); @W3M = split(' ', $ENV{'W3MMAN_W3M'} || '@W3M@');
$ENV{'MAN'} = '@MAN@'; $ENV{'W3MMAN_MAN'} ||= '@MAN@';
$SCRIPT = 'file:///$LIB/w3mman2html.cgi'; $SCRIPT = 'file:///$LIB/w3mman2html.cgi';
sub usage { sub usage {

View File

@@ -1,6 +1,6 @@
#!@PERL@ #!@PERL@
$MAN = $ENV{'MAN'} || '@MAN@'; $MAN = $ENV{'W3MMAN_MAN'} || '@MAN@';
$QUERY = $ENV{'QUERY_STRING'} || $ARGV[0]; $QUERY = $ENV{'QUERY_STRING'} || $ARGV[0];
$SCRIPT_NAME = $ENV{'SCRIPT_NAME'} || $0; $SCRIPT_NAME = $ENV{'SCRIPT_NAME'} || $0;
$CGI = "file://$SCRIPT_NAME"; $CGI = "file://$SCRIPT_NAME";
@@ -89,6 +89,8 @@ open(F, "$MAN $section $man 2> /dev/null |");
$ok = 0; $ok = 0;
undef $header; undef $header;
$blank = -1; $blank = -1;
$cmd = "";
$prev = "";
while(<F>) { while(<F>) {
if (! defined($header)) { if (! defined($header)) {
/^\s*$/ && next; /^\s*$/ && next;
@@ -147,11 +149,30 @@ EOF
s@(http|ftp)://[\w.\-/~]+[\w/]@<a href="$&">$&</a>@g; 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@(\W)(mailto:)?(\w[\w.\-]*\@\w[\w.\-]*\.[\w.\-]*\w)@$1<a href="mailto:$3">$2$3</a>@g;
s@(\W)(\~?/[\w.][/\w.\-]*)@$1 . &file_ref($2)@ge; s@(\W)(\~?/[\w.][\w.\-/~]*)@$1 . &file_ref($2)@ge;
s@(include(<\/?[bu]\>|\s)*\&lt;)([/\w.\-]+)@$1 . &include_ref($3)@ge; s@(include(<\/?[bu]\>|\s)*\&lt;)([\w.\-/]+)@$1 . &include_ref($3)@ge;
if ($prev && m@^\s*(\<[bu]\>)*(\w[\w.\-]*)(\</[bu]\>)*(\([\dm]\w*\))@) {
$cmd .= "$2$4";
$prev =~ s@(\w[\w.\-]*-)((\</[bu]\>)*\s*)$@<a href="$CGI?$cmd">$1</a>$2@;
print $prev;
$prev = '';
s@^(\s*(\<[bu]\>)*)(\w[\w.\-]*)@@;
print "$1<a href=\"$CGI?$cmd\">$3</a>";
} elsif ($prev) {
print $prev;
$prev = '';
}
s@(\w[\w.\-]*)((\</[bu]\>)*)(\([\dm]\w*\))@<a href="$CGI?$1$4">$1</a>$2$4@g; s@(\w[\w.\-]*)((\</[bu]\>)*)(\([\dm]\w*\))@<a href="$CGI?$1$4">$1</a>$2$4@g;
if (m@(\w[\w.\-]*)-(\</[bu]\>)*\s*$@) {
$cmd = $1;
$prev = $_;
next;
}
print; print;
} }
if ($prev) {
print $prev;
}
close(F); close(F);
if (! $ok) { if (! $ok) {
if ($query{'quit'}) { if ($query{'quit'}) {