The branch master has been updated via c49be85acdf6d10bfb17d0a5f1cb6405ae25fcaf (commit) via 064a3b32b4890eff85cb8c905d91cf361673e485 (commit) via 6869d8b6065b187af840f29a574dace73d05f3c4 (commit) from 025f5f461ca3a67091aac0690de2496c03d3ba7f (commit)
- Log ----------------------------------------------------------------- commit c49be85acdf6d10bfb17d0a5f1cb6405ae25fcaf Author: Richard Levitte <levi...@openssl.org> Date: Thu Jan 3 17:23:54 2019 +0100 Generate apropos-like tables instead of filelists for manpages This works together with bin/mk-manpages' generation of description comment. Reviewed-by: Matt Caswell <m...@openssl.org> (Merged from https://github.com/openssl/web/pull/102) commit 064a3b32b4890eff85cb8c905d91cf361673e485 Author: Richard Levitte <levi...@openssl.org> Date: Thu Jan 3 17:17:32 2019 +0100 Have bin/mk-manpages and bin/mk-newmanpages add a description comment Reviewed-by: Matt Caswell <m...@openssl.org> (Merged from https://github.com/openssl/web/pull/102) commit 6869d8b6065b187af840f29a574dace73d05f3c4 Author: Richard Levitte <levi...@openssl.org> Date: Thu Jan 3 17:11:47 2019 +0100 Change getnames() to getdata(), for generic data retrieval from POD files Reviewed-by: Matt Caswell <m...@openssl.org> (Merged from https://github.com/openssl/web/pull/102) ----------------------------------------------------------------------- Summary of changes: Makefile | 14 +++++++------- bin/mk-apropos | 13 +++++++++++++ bin/mk-manpages | 43 ++++++++++++++++++++++++----------------- bin/mk-newmanpages | 43 ++++++++++++++++++++++++----------------- docs/man1.0.2/apps/index.html | 7 +++---- docs/man1.0.2/crypto/index.html | 7 +++---- docs/man1.0.2/ssl/index.html | 7 +++---- docs/man1.1.0/apps/index.html | 7 +++---- docs/man1.1.0/crypto/index.html | 7 +++---- docs/man1.1.0/ssl/index.html | 7 +++---- docs/man1.1.1/man1/index.html | 7 +++---- docs/man1.1.1/man3/index.html | 7 +++---- docs/man1.1.1/man5/index.html | 7 +++---- docs/man1.1.1/man7/index.html | 7 +++---- docs/manmaster/man1/index.html | 7 +++---- docs/manmaster/man3/index.html | 7 +++---- docs/manmaster/man5/index.html | 7 +++---- docs/manmaster/man7/index.html | 7 +++---- 18 files changed, 112 insertions(+), 99 deletions(-) create mode 100755 bin/mk-apropos diff --git a/Makefile b/Makefile index c6c54bb..2418e5e 100644 --- a/Makefile +++ b/Makefile @@ -58,16 +58,16 @@ rebuild: all define makemanpages ./bin/mk-manpages $(1) $(2) docs - ./bin/mk-filelist -a docs/man$(2)/apps '' '*.html' >docs/man$(2)/apps/index.inc - ./bin/mk-filelist -a docs/man$(2)/crypto '' '*.html' >docs/man$(2)/crypto/index.inc - ./bin/mk-filelist -a docs/man$(2)/ssl '' '*.html' >docs/man$(2)/ssl/index.inc + ./bin/mk-apropos docs/man$(2)/apps > docs/man$(2)/apps/index.inc + ./bin/mk-apropos docs/man$(2)/crypto > docs/man$(2)/crypto/index.inc + ./bin/mk-apropos docs/man$(2)/ssl > docs/man$(2)/ssl/index.inc endef define newmakemanpages ./bin/mk-newmanpages $(1) $(2) docs - ./bin/mk-filelist -a docs/man$(2)/man1 '' '*.html' >docs/man$(2)/man1/index.inc - ./bin/mk-filelist -a docs/man$(2)/man3 '' '*.html' >docs/man$(2)/man3/index.inc - ./bin/mk-filelist -a docs/man$(2)/man5 '' '*.html' >docs/man$(2)/man5/index.inc - ./bin/mk-filelist -a docs/man$(2)/man7 '' '*.html' >docs/man$(2)/man7/index.inc + ./bin/mk-apropos docs/man$(2)/man1 > docs/man$(2)/man1/index.inc + ./bin/mk-apropos docs/man$(2)/man3 > docs/man$(2)/man3/index.inc + ./bin/mk-apropos docs/man$(2)/man5 > docs/man$(2)/man5/index.inc + ./bin/mk-apropos docs/man$(2)/man7 > docs/man$(2)/man7/index.inc endef manpages: manmaster $(call newmakemanpages,$(CHECKOUTS)/openssl-1.1.1-stable,1.1.1) diff --git a/bin/mk-apropos b/bin/mk-apropos new file mode 100755 index 0000000..a9dd5b6 --- /dev/null +++ b/bin/mk-apropos @@ -0,0 +1,13 @@ +#! /bin/sh +# $1 is the top of the manual page tree to look through + +dir=$1 +cd $dir + +for m in `find . -name '*.html' | sort`; do + description=`grep -F '<!-- OSSL: description:' $m | sed -e 's|^[^:]*: *||' -e 's|^[^:]*: *||' -e 's| *-->||'` + manfile=`echo $m | sed -e 's|\./||'` + manname=`basename $manfile .html` + origmanfile=`echo $manfile | sed -e "s|^$subdir|$origsubdir|"` + echo "<tr><td><a href=\"$manfile\">$manname</a></td><td>$description</td></tr>" +done diff --git a/bin/mk-manpages b/bin/mk-manpages index f177f3f..0096ec2 100755 --- a/bin/mk-manpages +++ b/bin/mk-manpages @@ -56,17 +56,18 @@ sub main { my $filename = File::Spec->catfile( $dir, $ent ); my $basename = basename( $ent, ".pod" ); my $title = $basename; + my %data = $class->getdata( $filename ); my $out = - $class->genhtml( $release, $sect, $filename, $title, $basename ); + $class->genhtml( $release, $sect, $filename, $title, $basename, + $data{description}); my $outfile = File::Spec->catfile( $wwwdir, "man$release", $sect, "$basename.html" ); open( my $fh, ">", $outfile ) or $class->die("Can't open $outfile: $!"); print $fh $out or $class->die("Can't print $outfile: $!"); close($fh) or $class->die("Can't close $outfile: $!"); - my @altnames = $class->getnames( $filename, $basename ); - foreach my $alt (@altnames) { + foreach my $alt (grep { $_ ne $basename } @{$data{names}}) { my $target = File::Spec->catfile( $wwwdir, "man$release", $sect, "$alt.html" ); if ( ! -f $target ) { @@ -80,8 +81,8 @@ sub main { # Generate a manpage sub genhtml { - my ( $class, $release, $section, $filename, $title, $file ) = @_; - my $header = $class->htmlHeader($title); + my ( $class, $release, $section, $filename, $title, $file, $desc ) = @_; + my $header = $class->htmlHeader( $title, $desc ); my $footer = $class->htmlFooter( $release, $section, $file ); open( my $fh, $filename ) || $class->die("Can't open $filename: $!"); @@ -107,37 +108,42 @@ sub genhtml { return $out; } -# Return all the OTHER names in a manpage -sub getnames { - my ( $class, $infile, $basename ) = @_; - my @words = (); +# Return diverse data from a manpage if available, currently: +# { +# names => [ ... ] # list of all OTHER names +# description => "text" # the short description from NAME +# } +sub getdata { + my ( $class, $infile ) = @_; + my %data = (); open( my $fh, "<", $infile ) or $class->die("Can't open $infile: $!"); { local $/ = ""; - my $found = 0; + my $foundname = 0; while (<$fh>) { chop; s/\n/ /gm; if (/^=head1 /) { - $found = 0; + $foundname = 0; } - elsif ($found) { + elsif ($foundname) { if (/ - /) { - s/ - .*//; + $data{description} = $'; + $_ = $`; s/,\s+/,/g; s/\s+,/,/g; s/^\s+//g; s/\s+$//g; s/\s/_/g; - push @words, split ','; + push @{$data{names}}, split ','; } } - if (/^=head1\s*NAME\s*$/) { - $found = 1; + if (/^=head1\s+NAME\s*$/) { + $foundname = 1; } } } - return grep { $_ ne $basename } @words; + return %data; } sub die { @@ -221,10 +227,11 @@ sub process_options { } sub htmlHeader { - my ( $class, $title ) = @_; + my ( $class, $title, $desc ) = @_; return <<EOFH; <!DOCTYPE html> <html lang="en"> +<!-- OSSL: description: $desc --> <!--#include virtual="/inc/head.shtml" --> <body> <!--#include virtual="/inc/banner.shtml" --> diff --git a/bin/mk-newmanpages b/bin/mk-newmanpages index 975f176..f8a3ffd 100755 --- a/bin/mk-newmanpages +++ b/bin/mk-newmanpages @@ -41,17 +41,18 @@ sub main { my $filename = File::Spec->catfile( $dir, $ent ); my $basename = basename( $ent, ".pod" ); my $title = $basename; + my %data = $class->getdata( $filename ); my $out = - $class->genhtml( $release, $sect, $filename, $title, $basename ); + $class->genhtml( $release, $sect, $filename, $title, $basename, + $data{description}); my $outfile = File::Spec->catfile( $wwwdir, "man$release", $sect, "$basename.html" ); open( my $fh, ">", $outfile ) or $class->die("Can't open $outfile: $!"); print $fh $out or $class->die("Can't print $outfile: $!"); close($fh) or $class->die("Can't close $outfile: $!"); - my @altnames = $class->getnames( $filename, $basename ); - foreach my $alt (@altnames) { + foreach my $alt (grep { $_ ne $basename } @{$data{names}}) { my $target = File::Spec->catfile( $wwwdir, "man$release", $sect, "$alt.html" ); if ( ! -f $target ) { @@ -65,8 +66,8 @@ sub main { # Generate a manpage sub genhtml { - my ( $class, $release, $section, $filename, $title, $file ) = @_; - my $header = $class->htmlHeader($title); + my ( $class, $release, $section, $filename, $title, $file, $desc ) = @_; + my $header = $class->htmlHeader( $title, $desc ); my $footer = $class->htmlFooter( $release, $section, $file ); open( my $fh, $filename ) || $class->die("Can't open $filename: $!"); @@ -86,37 +87,42 @@ sub genhtml { return $out; } -# Return all the OTHER names in a manpage -sub getnames { - my ( $class, $infile, $basename ) = @_; - my @words = (); +# Return diverse data from a manpage if available, currently: +# { +# names => [ ... ] # list of all OTHER names +# description => "text" # the short description from NAME +# } +sub getdata { + my ( $class, $infile ) = @_; + my %data = (); open( my $fh, "<", $infile ) or $class->die("Can't open $infile: $!"); { local $/ = ""; - my $found = 0; + my $foundname = 0; while (<$fh>) { chop; s/\n/ /gm; if (/^=head1 /) { - $found = 0; + $foundname = 0; } - elsif ($found) { + elsif ($foundname) { if (/ - /) { - s/ - .*//; + $data{description} = $'; + $_ = $`; s/,\s+/,/g; s/\s+,/,/g; s/^\s+//g; s/\s+$//g; s/\s/_/g; - push @words, split ','; + push @{$data{names}}, split ','; } } - if (/^=head1\s*NAME\s*$/) { - $found = 1; + if (/^=head1\s+NAME\s*$/) { + $foundname = 1; } } } - return grep { $_ ne $basename } @words; + return %data; } sub die { @@ -200,10 +206,11 @@ sub process_options { } sub htmlHeader { - my ( $class, $title ) = @_; + my ( $class, $title, $desc ) = @_; return <<EOFH; <!DOCTYPE html> <html lang="en"> +<!-- OSSL: description: $desc --> <!--#include virtual="/inc/head.shtml" --> <body> <!--#include virtual="/inc/banner.shtml" --> diff --git a/docs/man1.0.2/apps/index.html b/docs/man1.0.2/apps/index.html index 5ce458a..5c5e77e 100644 --- a/docs/man1.0.2/apps/index.html +++ b/docs/man1.0.2/apps/index.html @@ -15,11 +15,10 @@ The detailed list is here: </p> - <table> + <table style="border-spacing: 10px 0;"> <tr> - <td>KBytes </td> - <td>Date </td> - <td>File </td> + <td>NAME</td> + <td>Description</td> </tr> <!--#include virtual="index.inc" --> </table> diff --git a/docs/man1.0.2/crypto/index.html b/docs/man1.0.2/crypto/index.html index dd79aa9..0791e21 100644 --- a/docs/man1.0.2/crypto/index.html +++ b/docs/man1.0.2/crypto/index.html @@ -15,11 +15,10 @@ The detailed list is here: </p> - <table> + <table style="border-spacing: 10px 0;"> <tr> - <td>KBytes </td> - <td>Date </td> - <td>File </td> + <td>NAME</td> + <td>Description</td> </tr> <!--#include virtual="index.inc" --> </table> diff --git a/docs/man1.0.2/ssl/index.html b/docs/man1.0.2/ssl/index.html index 71cd650..5cd9454 100644 --- a/docs/man1.0.2/ssl/index.html +++ b/docs/man1.0.2/ssl/index.html @@ -15,11 +15,10 @@ The detailed list is here: </p> - <table> + <table style="border-spacing: 10px 0;"> <tr> - <td>KBytes </td> - <td>Date </td> - <td>File </td> + <td>NAME</td> + <td>Description</td> </tr> <!--#include virtual="index.inc" --> </table> diff --git a/docs/man1.1.0/apps/index.html b/docs/man1.1.0/apps/index.html index 1e80193..6e7076b 100644 --- a/docs/man1.1.0/apps/index.html +++ b/docs/man1.1.0/apps/index.html @@ -15,11 +15,10 @@ The detailed list is here: </p> - <table> + <table style="border-spacing: 10px 0;"> <tr> - <td>KBytes </td> - <td>Date </td> - <td>File </td> + <td>NAME</td> + <td>Description</td> </tr> <!--#include virtual="index.inc" --> </table> diff --git a/docs/man1.1.0/crypto/index.html b/docs/man1.1.0/crypto/index.html index 1538615..1b3545e 100644 --- a/docs/man1.1.0/crypto/index.html +++ b/docs/man1.1.0/crypto/index.html @@ -15,11 +15,10 @@ The detailed list is here: </p> - <table> + <table style="border-spacing: 10px 0;"> <tr> - <td>KBytes </td> - <td>Date </td> - <td>File </td> + <td>NAME</td> + <td>Description</td> </tr> <!--#include virtual="index.inc" --> </table> diff --git a/docs/man1.1.0/ssl/index.html b/docs/man1.1.0/ssl/index.html index dd24494..031132b 100644 --- a/docs/man1.1.0/ssl/index.html +++ b/docs/man1.1.0/ssl/index.html @@ -15,11 +15,10 @@ The detailed list is here: </p> - <table> + <table style="border-spacing: 10px 0;"> <tr> - <td>KBytes </td> - <td>Date </td> - <td>File </td> + <td>NAME</td> + <td>Description</td> </tr> <!--#include virtual="index.inc" --> </table> diff --git a/docs/man1.1.1/man1/index.html b/docs/man1.1.1/man1/index.html index c0cc99e..b008c2b 100644 --- a/docs/man1.1.1/man1/index.html +++ b/docs/man1.1.1/man1/index.html @@ -15,11 +15,10 @@ The detailed list is here: </p> - <table> + <table style="border-spacing: 10px 0;"> <tr> - <td>KBytes </td> - <td>Date </td> - <td>File </td> + <td>NAME</td> + <td>Description</td> </tr> <!--#include virtual="index.inc" --> </table> diff --git a/docs/man1.1.1/man3/index.html b/docs/man1.1.1/man3/index.html index d12bda6..b7adf3d 100644 --- a/docs/man1.1.1/man3/index.html +++ b/docs/man1.1.1/man3/index.html @@ -14,11 +14,10 @@ The detailed list is here: </p> - <table> + <table style="border-spacing: 10px 0;"> <tr> - <td>KBytes </td> - <td>Date </td> - <td>File </td> + <td>NAME</td> + <td>Description</td> </tr> <!--#include virtual="index.inc" --> </table> diff --git a/docs/man1.1.1/man5/index.html b/docs/man1.1.1/man5/index.html index a4564ab..7d47c8f 100644 --- a/docs/man1.1.1/man5/index.html +++ b/docs/man1.1.1/man5/index.html @@ -14,11 +14,10 @@ The detailed list is here: </p> - <table> + <table style="border-spacing: 10px 0;"> <tr> - <td>KBytes </td> - <td>Date </td> - <td>File </td> + <td>NAME</td> + <td>Description</td> </tr> <!--#include virtual="index.inc" --> </table> diff --git a/docs/man1.1.1/man7/index.html b/docs/man1.1.1/man7/index.html index 49b6a73..7223213 100644 --- a/docs/man1.1.1/man7/index.html +++ b/docs/man1.1.1/man7/index.html @@ -14,11 +14,10 @@ The detailed list is here: </p> - <table> + <table style="border-spacing: 10px 0;"> <tr> - <td>KBytes </td> - <td>Date </td> - <td>File </td> + <td>NAME</td> + <td>Description</td> </tr> <!--#include virtual="index.inc" --> </table> diff --git a/docs/manmaster/man1/index.html b/docs/manmaster/man1/index.html index 90f1fa2..83a2859 100644 --- a/docs/manmaster/man1/index.html +++ b/docs/manmaster/man1/index.html @@ -15,11 +15,10 @@ The detailed list is here: </p> - <table> + <table style="border-spacing: 10px 0;"> <tr> - <td>KBytes </td> - <td>Date </td> - <td>File </td> + <td>NAME</td> + <td>Description</td> </tr> <!--#include virtual="index.inc" --> </table> diff --git a/docs/manmaster/man3/index.html b/docs/manmaster/man3/index.html index 6f46995..9de91ae 100644 --- a/docs/manmaster/man3/index.html +++ b/docs/manmaster/man3/index.html @@ -14,11 +14,10 @@ The detailed list is here: </p> - <table> + <table style="border-spacing: 10px 0;"> <tr> - <td>KBytes </td> - <td>Date </td> - <td>File </td> + <td>NAME</td> + <td>Description</td> </tr> <!--#include virtual="index.inc" --> </table> diff --git a/docs/manmaster/man5/index.html b/docs/manmaster/man5/index.html index 64f26a8..0227046 100644 --- a/docs/manmaster/man5/index.html +++ b/docs/manmaster/man5/index.html @@ -14,11 +14,10 @@ The detailed list is here: </p> - <table> + <table style="border-spacing: 10px 0;"> <tr> - <td>KBytes </td> - <td>Date </td> - <td>File </td> + <td>NAME</td> + <td>Description</td> </tr> <!--#include virtual="index.inc" --> </table> diff --git a/docs/manmaster/man7/index.html b/docs/manmaster/man7/index.html index b1dc49d..9eb7a14 100644 --- a/docs/manmaster/man7/index.html +++ b/docs/manmaster/man7/index.html @@ -14,11 +14,10 @@ The detailed list is here: </p> - <table> + <table style="border-spacing: 10px 0;"> <tr> - <td>KBytes </td> - <td>Date </td> - <td>File </td> + <td>NAME</td> + <td>Description</td> </tr> <!--#include virtual="index.inc" --> </table> _____ openssl-commits mailing list To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-commits