From c755545ebd1f4faddc2c4b7b3b263151e2e4327a Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sun, 26 Jun 2005 07:10:38 +0000 Subject: [PATCH] Checkpointing before coding and committing final character-map changes. This change fully implements character-map support. I'll write up a longer description of that in a later commit. But the brief description is: The old Unicode character replacement mechanism (replace-entities template) has been removed; a completely different character-replacement mechanism is now used instead. By default, it does replacement of all Latin-1 symbols, along with most special spaces, dashes, and quotes (about 75 characters by default, compared to the less than 20 special characters that were handled previously). And the "full" character map provides support for converting about 800 characters. The mechanism use a "character map" (in a format compliant with the XSLT 2.0 spec and therefore completely "forward compatible" with XSLT 2.0. Other changes made for this commit: - Changed default output encoding to UTF-8. THIS DOES NOT MEAN THAT MAN PAGES ARE OUTPUT IN RAW UTF-8, because the character-map is applied before final output, causing all UTF-8 characters covered in the map to be converted to roff equivalents. - Removed code for adding backslashes before periods/dots and before hyphens (-); here's why: * Backslashes in front of periods/dots are needed only in the very rare case where a period is the very first character in a line, without any space in front of it. A better way to deal with that rare case is for authors to add a zero-width space in front of the offending dot(s) in their source * Backslashes in front of (-/-) are needed... when? Myself, I don't know, so the current stylesheet does not add backslashes in front of them, ever. If there is a specific case where they are necessary or desirable, then we need to add code for that case, not just do a blanket conversion. And, anyway, my understanding from reading the groff docs is that \- is, specifically, a _minus sign_. So if you have a place where you want a minus sign to be output instead of (-), then you should use (−/−) in your source instead. And if you have a place where you want an en dash, (–/–). Or if there are places where the stylesheets are internally generating (-) where they should be generating − or –, then we need to fix those, not just do blanket conversion. - Consolidated all bold and italic formatting so that it is done by applying the mode="bold" and mode="italic" templates. - Consolidated handling of all instances where we want to prevent line breaking; they are all now processed using the prevent.line.breaking template. - Removed "quote" template. In output, this was causing anything marked up with the element to be preceded by two backticks and followed by two apostrophes -- that is, that old-school hack for generating "curly" quotes in Emacs and in X-Windows fonts. While Emacs still seems to support that, I don't think X-Windows has for a long time now. And, anyway, it looks (and has always looked) like complete crap when viewed on a normal tty/console --- xsl/manpages/docbook.xsl | 59 ++++-- xsl/manpages/general.xsl | 366 ++++++++++++++------------------------ xsl/manpages/info.xsl | 91 +++++----- xsl/manpages/inline.xsl | 34 ++-- xsl/manpages/lists.xsl | 35 ++-- xsl/manpages/other.xsl | 21 +-- xsl/manpages/param.ent | 9 +- xsl/manpages/param.xweb | 26 ++- xsl/manpages/refentry.xsl | 2 +- xsl/manpages/synop.xsl | 64 +++---- 10 files changed, 302 insertions(+), 405 deletions(-) diff --git a/xsl/manpages/docbook.xsl b/xsl/manpages/docbook.xsl index b49169337..6ab09f354 100644 --- a/xsl/manpages/docbook.xsl +++ b/xsl/manpages/docbook.xsl @@ -4,6 +4,12 @@ exclude-result-prefixes="exsl" version='1.0'> + + + + - @@ -27,13 +32,27 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + @@ -53,7 +72,7 @@ - + @@ -89,8 +108,8 @@ - - + + @@ -123,18 +142,20 @@ - + - + - - + + + + - - + + @@ -142,7 +163,9 @@ - + + + diff --git a/xsl/manpages/general.xsl b/xsl/manpages/general.xsl index 15c68bcea..9396e33e2 100644 --- a/xsl/manpages/general.xsl +++ b/xsl/manpages/general.xsl @@ -1,5 +1,6 @@ - - - - - - - - + + + + + + + + + + + - \fB @@ -37,7 +40,6 @@ - \fI @@ -46,9 +48,24 @@ - - - + + + + + + + + + + + + + + + + + + @@ -58,75 +75,88 @@ - + + + + + + + + + - .sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br - - \fB - - - - - - - - - \fR + + + .sp + .it 1 an-trap + .nr an-no-space-flag 1 + .nr an-break-flag 1 + .br + + + + + + + + + + + + + - - - + + + + + + - - - - - - - + + + + + + + - + + - - + + - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -139,7 +169,7 @@ @@ -149,9 +179,9 @@ - - - + + + @@ -161,180 +191,44 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bullet - - \(bu - \(co - \(tm - \(tm - \(rg - (SM) - \~ - \(lq - \(rq - ` - ' - \(em - \(em - \(en - \(en - - \(bu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsl/manpages/info.xsl b/xsl/manpages/info.xsl index 27911c815..ea824d1e0 100644 --- a/xsl/manpages/info.xsl +++ b/xsl/manpages/info.xsl @@ -1,8 +1,7 @@ - + @@ -91,49 +90,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + @@ -265,10 +260,4 @@ > - - Copyright \(co - - .Sp - - diff --git a/xsl/manpages/inline.xsl b/xsl/manpages/inline.xsl index 49cf4da09..6727dc772 100644 --- a/xsl/manpages/inline.xsl +++ b/xsl/manpages/inline.xsl @@ -1,5 +1,6 @@ - + + @@ -37,8 +37,8 @@ - - + + @@ -83,7 +83,11 @@ - \(bu + + + + + .TP @@ -108,24 +112,27 @@ - .RS .TP 3 + .RS + .TP 3 - .LP .RE .IP + .LP + .RE + .IP - + - - - + + + - + @@ -148,8 +155,8 @@ - - + + .IP diff --git a/xsl/manpages/other.xsl b/xsl/manpages/other.xsl index 0e3315e1a..576dba307 100644 --- a/xsl/manpages/other.xsl +++ b/xsl/manpages/other.xsl @@ -23,21 +23,16 @@ - @dot@@esc@" ** You probably do not want to + .\" ** You probably do not want to edit this file directly ** - @dot@@esc@" It was generated using the DocBook + .\" It was generated using the DocBook XSL Stylesheets (version - - - - - - )@dot@ - - @dot@@esc@" Instead of manually editing it, you + + ). + .\" Instead of manually editing it, you probably should edit the DocBook XML - @dot@@esc@" source for it and then use the DocBook - XSL Stylesheets to regenerate it@dot@ + .\" source for it and then use the DocBook + XSL Stylesheets to regenerate it. @@ -75,7 +70,7 @@ - @dot@TH " + .TH " - \ No newline at end of file + + + + + + + \ No newline at end of file diff --git a/xsl/manpages/param.xweb b/xsl/manpages/param.xweb index 93517c06e..187deec88 100644 --- a/xsl/manpages/param.xweb +++ b/xsl/manpages/param.xweb @@ -30,14 +30,23 @@ - Parameters -&alignment; -&hyphenate; + General +&man.alignment; +&man.hyphenate; +&man.output.quietly; +&man.output.encoding; + + + Character map +&man.charmap.uri; +&man.charmap.use.subset; +&man.charmap.subset.profile; The Stylesheet - The param.xsl stylesheet is just a wrapper around all of these parameters. + The param.xsl stylesheet is just a + wrapper around all of these parameters. - - + + + + + + + diff --git a/xsl/manpages/refentry.xsl b/xsl/manpages/refentry.xsl index 9f696bc35..3a9bb3344 100644 --- a/xsl/manpages/refentry.xsl +++ b/xsl/manpages/refentry.xsl @@ -38,7 +38,7 @@ - \- + - diff --git a/xsl/manpages/synop.xsl b/xsl/manpages/synop.xsl index 7a30bf8d6..365f3239c 100644 --- a/xsl/manpages/synop.xsl +++ b/xsl/manpages/synop.xsl @@ -14,21 +14,14 @@ ******************************************************************** --> - - - + + + -.PP - + .PP + - - - - - @@ -46,7 +39,7 @@ - + @@ -63,12 +56,12 @@ - - - - - - + + + + + @@ -103,23 +96,6 @@ - - - - - - - - - - - - - - - - - @@ -138,13 +114,15 @@ - .ad l .hy 0 + .ad l + .hy 0 .HP - .ad .hy + .ad + .hy @@ -154,9 +132,9 @@ .sp - + + + .ad l .hy 0 @@ -179,7 +157,7 @@ - + @@ -195,7 +173,7 @@ - + , -- 2.40.0