From b8a4be9e71e9a8768cfa344b64bae186690a5fb1 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Fri, 11 Jan 2019 21:03:45 +0000 Subject: user/docbook2x: new package --- user/docbook2x/manpage-comments.patch | 81 +++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 user/docbook2x/manpage-comments.patch (limited to 'user/docbook2x/manpage-comments.patch') diff --git a/user/docbook2x/manpage-comments.patch b/user/docbook2x/manpage-comments.patch new file mode 100644 index 000000000..c78a95c91 --- /dev/null +++ b/user/docbook2x/manpage-comments.patch @@ -0,0 +1,81 @@ +# Conventionally, preprocessor declarations should start with +# '\" +# rather than +# .\" +# Current man-db only supports the first (and recommended) syntax. + +diff -urNad trunk~/perl/db2x_manxml.pl trunk/perl/db2x_manxml.pl +--- trunk~/perl/db2x_manxml.pl 2006-04-22 17:21:32.000000000 +0200 ++++ trunk/perl/db2x_manxml.pl 2007-11-24 01:27:37.000000000 +0100 +@@ -342,6 +342,25 @@ + $self->{line_start} = 1; + } + ++# ++# Print a comment in the output, without causing a break. ++# Params: comment - the comment text. ++# May use any characters; they need not be escaped. ++# ++sub comment_nobreak ++{ ++ my ($self, $comment) = @_; ++ $self->write("\n") unless $self->{line_start}; ++ ++ foreach my $line (split(/\n/, $comment)) { ++ $self->write('\'\" '); ++ $self->write($line); ++ $self->write("\n"); ++ } ++ ++ $self->{line_start} = 1; ++} ++ + + # + # Use a roff "escape" i.e. commands embedded in text starting with \ +@@ -510,16 +529,20 @@ + + $self->{'adjust-stack'} = [ 'b' ]; + +- $self->{rw}->comment($elem->attr('preprocessors')) +- if($elem->attr('preprocessors') ne ''); +- ++ my $preprocessors = $elem->attr('preprocessors'); + # I've dug through the Internet to see if there was any + # standard way to specify encoding with man pages. + # The following seems to be a reasonable proposal: + # + my $encoding = $self->{options}->{'encoding'}; + $encoding =~ s#//TRANSLIT$##i; +- $self->{rw}->comment("-*- coding: $encoding -*-"); ++ $encoding = "-*- coding: $encoding -*-"; ++ if ($preprocessors eq '') { ++ $preprocessors = $encoding; ++ } else { ++ $preprocessors = "$preprocessors $encoding"; ++ } ++ $self->{rw}->comment_nobreak($preprocessors); + + # Define escapes for switching to and from monospace fonts (groff only) + $self->{rw}->request(qw{ .if \n(.g .ds T< \\\\FC}); +diff -urNad trunk~/xslt/backend/db2x_manxml.xsl trunk/xslt/backend/db2x_manxml.xsl +--- trunk~/xslt/backend/db2x_manxml.xsl 2006-04-23 16:44:52.000000000 +0200 ++++ trunk/xslt/backend/db2x_manxml.xsl 2007-11-24 01:27:37.000000000 +0100 +@@ -528,7 +528,7 @@ + +- .\" -*- coding: ++ '\" -*- coding: + + -*- + +@@ -538,7 +538,7 @@ + +- .\" -*- coding: ++ '\" -*- coding: + + -*- + -- cgit v1.2.3-60-g2f50