diff --git a/roffit b/roffit index 905ae4d..89bd2f1 100755 --- a/roffit +++ b/roffit @@ -10,7 +10,7 @@ # Author: Daniel Stenberg # Web: https://daniel.haxx.se/projects/roffit -my $version = "0.12"; +my $version = "0.13"; use strict; #use warnings; @@ -37,6 +37,7 @@ my @mandirs; my $mandir; my $hrefdir="."; my $filename; +my $leavecase; while($ARGV[0]) { if($ARGV[0] eq "--bare") { @@ -48,6 +49,10 @@ while($ARGV[0]) { print "roffit $version (https://daniel.haxx.se/projects/roffit/)\n"; exit; } + elsif($ARGV[0] eq "--preserve-case") { + $leavecase = 1; + exit; + } elsif($ARGV[0] =~ /^--mandir=(.*)/) { # check for other HTMLized man pages in these given dirs # can be specified multiple times @@ -63,12 +68,14 @@ while($ARGV[0]) { } elsif($ARGV[0] =~ /^(--help|-h)/) { print $debugFH "Usage: roffit [options] [infile] < infile > outfile\n", - "Options:\n", - " --version display roffit version and exit\n", - " --bare do not put in HTML, HEAD, BODY tags\n", - " --mandir= check for other HTMLized man pages in these dirs\n", - " --hrefdir= if a manpage is found in the --mandir, this is the\n", - " dir we prefix the HTML file name with in the output\n"; + "Options:\n", + " --bare do not put in HTML, HEAD, BODY tags\n", + " --hrefdir= if a manpage is found in the --mandir, this is the\n", + " dir we prefix the HTML file name with in the output\n", + " --mandir= check for other HTMLized man pages in these dirs\n", + " --preserve-case leave case of section headers untouched\n", + " --version display roffit version and exit\n"; + exit; } else { @@ -384,6 +391,7 @@ sub parsefile { $rest =~ s/\"//g; # cut off quotes $rest = do_encode($rest); + $rest = ucfirst(lc($rest)) if(!$leavecase); $out = "

$rest

"; $indentlevel=0; $within_tp=0; diff --git a/roffit.1 b/roffit.1 index f9adc37..2178a05 100644 --- a/roffit.1 +++ b/roffit.1 @@ -2,7 +2,7 @@ .\" nroff -man roffit.1 .\" Written by Daniel Stenberg .\" -.TH roffit 1 "27 Feb 2004" "roffit 0.6" "roffit Manual" +.TH roffit 1 "October 5 2021" "roffit 0.13" "roffit Manual" .SH NAME roffit \- convert nroff to HTML .SH SYNOPSIS @@ -32,6 +32,10 @@ section). .IP \-\-hrefdir= Specify a directory to prefix generated href links created with the \-\-mandir option. This defaults to ".". +.IP \-\-preserve-case +When used, this makes roffit preserve the case in SH (section header) in the +output instead of uppercasing the first letter and doing the rest lowercase. +The case changing was introduced in roffit 0.13. .SH "CSS CLASSES" .IP h2.nroffsh The nroff ".SH" section. These are normally the "headlines" before each sub