From 16c7015c802d5b7e27199a36e01f3ffd2737e6ec Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 29 Feb 2008 09:08:53 +0000 Subject: [PATCH] Various updates, mainly related to uppercasing SH titles: - added a "Language: " metadata line to the top comment area of output man pages, to indicate the language the page is in - added a "toupper" macro of doing locale-aware uppercasing of SH titles and cross-references to SH titles; the mechanism relies on the uppercase.alpha and lowercase.alpha DocBook gentext keys to do locale-aware uppercasing based on the language the page is written in - added a "string.shuffle" template, which provides a library function for "shuffling" two strings together into a single string; it takes the first character for the first string, the first character from second string, etc. The only current use for it is to generate the argument for the groff tr request that does string uppercasing. - added make.tr.uppercase.arg and make.tr.normalcase.arg named templates for use in generating groff code for uppercasing and "normal"-casing SH titles - made the BB/BE "background drawing" macros have effect only in non-TTY output - output a few comments in the top part of source --- xsl/manpages/other.xsl | 128 +++++++++++++++++++++++++++++++---------- 1 file changed, 97 insertions(+), 31 deletions(-) diff --git a/xsl/manpages/other.xsl b/xsl/manpages/other.xsl index 47e99733a..38e61eda2 100644 --- a/xsl/manpages/other.xsl +++ b/xsl/manpages/other.xsl @@ -3,6 +3,7 @@ xmlns:exsl="http://exslt.org/common" xmlns:ng="http://docbook.org/docbook-ng" xmlns:db="http://docbook.org/ns/docbook" + xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" exclude-result-prefixes="exsl" version='1.0'> @@ -324,6 +325,12 @@ db:manvolnum + .\" Language: + + + + + .\" @@ -434,6 +441,9 @@ db:manvolnum + .\" ----------------------------------------------------------------- + .\" * set default formatting + .\" ----------------------------------------------------------------- .\" disable hyphenation .nh @@ -672,19 +682,37 @@ db:manvolnum - .\" define a macro for condtionally upper-casing SH x-refs + .\" ----------------------------------------------------------------- + .\" * (re)Define some macros + .\" ----------------------------------------------------------------- + .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + .\" toupper - uppercase a string (locale-aware) + .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + .de toupper + .tr + + + \\$* + .tr + + + .. + .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + .\" SH-xref - format a cross-reference to an SH section + .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .de SH-xref .ie n \{\ -.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ -\\$* -.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz .\} +.toupper \\$* .el \{\ \\$* .\} .. - .\" define a level-one heading that works better for non-TTY output + .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + .\" SH - level-one heading that works better for non-TTY output + .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .de1 SH +.\" put an extra blank line of space above the head .sp 1 .sp \\n[PD]u .nr an-level 1 @@ -697,53 +725,40 @@ db:manvolnum .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 +\." make the size of the head bigger .ps +3 .ft B .ne (2v + 1u) -.\" if we have only one arg, just use that -.ie (\\n[.$] == 1) \{\ .ie n \{\ -\&\\$1 +.\" if n (TTY output), use uppercase +.toupper \\$* .\} .el \{\ .nr an-break-flag 0 -.\" if this is troff/non-TTY output, show the second arg only -\&\\$1 +.\" if not n (not TTY), use normal case (not uppercase) +\\$1 .in \\n[an-margin]u .ti 0 -.\" draw a border/line under subheading +.\" if not n (not TTY), put a border/line under subheading .sp -.7 \l'\n(.lu' .\} -.\} -.\" we have more that one arg, so we decide which to use -.el \{\ -.ie n \{\ -.if \\n[.$] \&\\$1 -.\" if this is nroff/TTY output, show the first arg only -.\} -.el \{\ -.nr an-break-flag 0 -.\" if this is troff/non-TTY output, show the second arg only -.if \\n[.$] \&\\$2 -.in \\n[an-margin]u -.ti 0 -.\" draw a border/line under subheading -.sp -.7 -\l'\n(.lu' -.\} -.\} .. - \" define BB/BE macros for putting a background/screen - \" (filled box) around a block of text in non-TTY output + .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + .\" BB/BE - put background/screen (filled box) around block of text + .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .de BB +.if t \{\ +.sp -.5 .br .in +2n .ll -2n .gcolor red .di BX +.\} .. .de EB +.if t \{\ .br .di .in @@ -760,7 +775,58 @@ db:manvolnum .in .sp .5v .fi +.\} .. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.50.1