From f678dc96b87520cec03532a6275c0fa7c807ae62 Mon Sep 17 00:00:00 2001 From: "David F. Skoll" Date: Sun, 7 Oct 2007 22:24:35 -0400 Subject: [PATCH] Write man page for rem2html --- www/rem2html | 102 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 66 insertions(+), 36 deletions(-) diff --git a/www/rem2html b/www/rem2html index 5e215539..95d06cc8 100755 --- a/www/rem2html +++ b/www/rem2html @@ -25,9 +25,67 @@ rem2html - Convert the output of "remind -p" to HTML remind -p ... | rem2html [options] -=head2 usage +=head1 OPTIONS -Print usage to STDERR and exit. +=over 4 + +=item --help, -h + +Print usage information + +=item --version + +Print version + +=item --backurl I + +When producing the small calendar for the previous month, make the +month name a link to I. + +=item --forwurl I + +When producing the small calendar for the next month, make the +month name a link to I. + +=item --imgbase I + +When creating URLs for images and the stylesheet, use +I as the base URL. + +=item --stylesheet I + +Use I as the stylesheet. If this option is used, +I is I interpreted relative to B. + +=item --nostyle + +Produce basic HTML that does not use a CSS stylesheet. + +=item --tableonly + +Output results as a EtableE ... E/tableE sequence only +without any EhtmlE or EbodyE tags. + +=item --title I + +Use I<title> as the content between E<lt>titleE<gt> and E<lt>/titleE<gt> +tags. + + +=item --prologue I<html_text> + +Insert I<html_text> right after the E<lt>bodyE<gt> tag. + +=item --epilogue I<html_text> + +Insert I<html_text> right before the E<lt>/bodyE<gt> tag. + +=back + +=head1 AUTHOR + +rem2html was written by David F. Skoll with much inspiration from an +earlier version by Don Schwarz. =cut @@ -45,6 +103,7 @@ Usage: remind -p ... | rem2html [options] Options: --help, -h Print usage information +--man Show man page (requires "perldoc") --version Print version --backurl url Make the title on the previous month's small calendar entry a link to <url> @@ -54,23 +113,18 @@ Options: prepended to url.css --nostyle Produce basic HTML that does not use a CSS stylesheet --tableonly Output results as a <table> only, no <html>, <body>, etc. ---title What to put in <title>... tags +--title string What to put in ... tags --prologue html_text Text to insert at the top of the body --epilogue html_text Text to insert at the end of the body EOM exit($exit_status); } -=head2 parse_options - -Parse command-line options - -=cut - sub parse_options { local $SIG{__WARN__} = sub { print STDERR "$TIDY_PROGNAME: $_[0]\n"; }; if (!GetOptions(\%Options, "help|h", + "man", "version", "stylesheet=s", "nostyle", @@ -100,11 +154,6 @@ sub parse_options $Options{'stylesheet'} ||= $stylesheet; } -=head2 start_output - -Start the HTML output - -=cut sub start_output { return if ($Options{'tableonly'}); @@ -122,11 +171,6 @@ sub start_output } } -=head2 end_output - -Finish off the calendar - -=cut sub end_output { return if ($Options{'tableonly'}); @@ -136,11 +180,6 @@ sub end_output print("\n\n"); } -=head2 parse_input - -Parse off one month's worth of input - -=cut sub parse_input { undef $days; @@ -225,12 +264,6 @@ sub parse_input return $found_data; } -=head2 small_calendar MONTH, MONLEN, URL, FIRST_COL - -Draw a small calendar - -=cut - sub small_calendar { my($month, $monlen, $url, $first_col) = @_; @@ -315,12 +348,6 @@ sub small_calendar print "\n"; } -=head2 output_calendar - -Take the parsed input and output a calendar - -=cut - sub output_calendar { # Which column is 1st of month in? @@ -512,6 +539,9 @@ parse_options(); if ($Options{'help'}) { usage(0); exit(0); +} elsif ($Options{'man'}) { + system("perldoc $0"); + exit(0); } elsif ($Options{'version'}) { print "rem2html version $rem2html_version.\n"; exit(0);