From cb33dc044fa692e83aa35bc59db1f632433b0a1a Mon Sep 17 00:00:00 2001 From: Angel Ortega Date: Fri, 28 Nov 2008 12:39:47 +0100 Subject: [PATCH] New option --abstract. --- RELEASE_NOTES | 2 ++ mp_doccer | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index cf4299d..18ed409 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -5,6 +5,8 @@ mp_doccer Release Notes ----- * New Grutatxt output format. + * New command line option, `--abstract', to set the abstract + for the generated document. 1.2.1 ----- diff --git a/mp_doccer b/mp_doccer index 5aad0e3..6c94dbc 100755 --- a/mp_doccer +++ b/mp_doccer @@ -38,6 +38,9 @@ my $output = ''; # documentation title my $title = 'API'; +# documentation abstract +my $abstract = ''; + # man section my $man_section = '3'; @@ -74,6 +77,7 @@ if (!GetOptions('f|format=s' => \$format, 'p|prefix=s' => \$file_prefix, 'm|man-section=s' => \$man_section, 'a|author=s' => \$author, + 'b|abstract=s' => \$abstract, 'q|quiet' => \$quiet, 'h|help' => \$usage) or $usage) { @@ -292,12 +296,13 @@ Options: -f|--format="format" Format for the generated documentation. Valid ones are: - html man localhelp html1 + html man localhelp html1 grutatxt -p|--prefix="prefix" Prefix for the name of the generated files. Main index file will also have this name. -a|--author="author" Sets author info (as name and email) to be included in the documentation. + -b|--abstract="text" Abstract for the documentation. -m|--man-section="sect" Section number for the generated man pages. -v|--version Shows version. @@ -305,7 +310,7 @@ Options: -h|--help This help. The mp_doccer Home Page: -http://www.triptico.com/software/mp_doccer.html +http://triptico.com/software/mp_doccer.html EOF exit(0); @@ -554,7 +559,11 @@ sub html_toc my $func_link = shift; my $ret = ''; - $ret .= "

$title

\n
\n"; + $ret .= "

$title

\n"; + + $ret .= "

$abstract

\n" if $abstract; + + $ret .= "
\n"; if (scalar(keys(%categories))) { $ret .= "

By Category

\n"; @@ -824,6 +833,8 @@ sub format_grutatxt print F _grutatxt_header($title, "="); + print F "$abstract\n\n" if $abstract; + if (scalar(keys(%categories))) { print F _grutatxt_header('By Category', '-'); -- 2.11.4.GIT