Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Mar 2000 13:23:50 +0000
From:      Nik Clayton <nik@freebsd.org>
To:        Jun Kuriyama <kuriyama@FreeBSD.org>
Cc:        nik@freebsd.org, doc@freebsd.org
Subject:   Re: Appending mailing list links to documents
Message-ID:  <20000318132350.A9834@kilt.nothing-going-on.org>
In-Reply-To: <86vh2p438s.wl@localhost.sky.rim.or.jp>; from Jun Kuriyama on Wed, Mar 15, 2000 at 07:05:07AM %2B0900
References:  <20000313205349.A48293@kilt.nothing-going-on.org> <86vh2p438s.wl@localhost.sky.rim.or.jp>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Wed, Mar 15, 2000 at 07:05:07AM +0900, Jun Kuriyama wrote:
> From: Nik Clayton <nik@freebsd.org>
> >   2.  The best way to handle i18n in the patch.
> 
> To handle this cleanly, we should have l10n-{en,es,fr,ja,ru,zh}.ent
> files like as Norm's dsssl-docbook-modular distribution.

Possibly.  The problem with that is that 

  (a) Norm doesn't address the issue of different character sets, which
      we do.

  (b) As far as I can see, DSSSL doesn't support 'positional parameters'
      (see printf(3), and the '$' format string), making it tricky to do
      l10n where you're replacing more than one item, and where the order
      of items in the string might change depending on the language.

Really, you need a way to address this that's more comprehensive than 
simple translating a word from one language to another.

Then I had a brain wave.  Check out the attached patches.

Basically, the idea is that now, instead of having one freebsd.dsl file
that contains all the language specific code as well as the language
independent definitions, we keep language independent stuff only in 
doc/share/sgml/freebsd.dsl.

All the language dependent stuff goes in to 
doc/<lang>/share/sgml/freebsd.dsl.  So we'll have one of these per
language (and encoding).

This, second, freebsd.dsl includes the doc/share/sgml/freebsd.dsl file, 
in the same way that doc/share/sgml/freebsd.dsl includes Norm Walsh's
stylesheets.  However, it overrides, or adds to the definition in that
file.

So our stylesheet definitions are spread out in to three places, instead
of the two they're currently located:

    $PREFIX/share/sgml/docbook/dsssl/modular   

        The original stylesheets.

    doc/share/sgml/freebsd.dsl

        Customisations that apply to the FDP as a whole.  These are used
        to enforce a consistent style on the output.

    doc/<lang>/share/sgml/freebsd.dsl

        Customisations that apply to a specific language.  These include
        any changes to, for example, specify the language and encoding of
        the output HTML file.

When building the docs, the Makefile (actually, doc.docbook.mk) has to
refer to doc/<lang>/share/sgml/freebsd.dsl, instead of the current
doc/share/sgml/freebsd.dsl.

This means that the various Makefile.inc files no longer need to include
a "JADEFLAGS+= -ilang.<whatever>", as those settings can be set in the 
language specific freebsd.dsl, instead of being options in the master
freebsd.dsl file.

There are two files attached to this message.  The first is a patch to 
apply to the top of the doc/ tree, which fixes up the existing Makefile's
and the share/sgml/freebsd.dsl file.  It also sorts out 
share/mk/doc.docbook.mk, because the DSL* variable values have changed.

[ doc.docbook.mk also has another small patch -- Palm Pilots don't like
  having multiple files installed with the same name.  So this just 
  symlinks "book.pdb" to ${.CURDIR:T}.pdb -- eg., in the handbook, you get
  a "book.pdb" file, and a link to it called "handbook.pdb".  This makes
  it a bit easier to install these on the Palm Pilot. ]

The second is a tar file to extract at the top of the doc/ tree, which
contains the new <lang>/share/sgml/freebsd.dsl files

Give it a go, let me know what you think.

N
-- 
Internet connection, $19.95 a month.  Computer, $799.95.  Modem, $149.95.
Telephone line, $24.95 a month.  Software, free.  USENET transmission,
hundreds if not thousands of dollars.  Thinking before posting, priceless.
Somethings in life you can't buy.  For everything else, there's MasterCard.
  -- Graham Reed, in the Scary Devil Monastery

[-- Attachment #2 --]
Index: ja_JP.eucJP/articles/Makefile.inc
===================================================================
RCS file: /home/ncvs/doc/ja_JP.eucJP/articles/Makefile.inc,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Makefile.inc
--- Makefile.inc	2000/01/06 07:22:40	1.1.1.1
+++ Makefile.inc	2000/03/18 12:59:34
@@ -3,7 +3,6 @@
 #
 # Original revision: 1.3
 
-JADEFLAGS=      -ilang.ja
 TIDYFLAGS=      -raw
 
 DESTDIR?=	${DOCDIR}/ja/articles/${.CURDIR:T}
Index: ja_JP.eucJP/books/Makefile.inc
===================================================================
RCS file: /home/ncvs/doc/ja_JP.eucJP/books/Makefile.inc,v
retrieving revision 1.4
diff -u -r1.4 Makefile.inc
--- Makefile.inc	1999/09/06 06:53:19	1.4
+++ Makefile.inc	2000/03/18 12:59:57
@@ -2,7 +2,6 @@
 # $FreeBSD: doc/ja_JP.eucJP/books/Makefile.inc,v 1.4 1999/09/06 06:53:19 peter Exp $
 #
 
-JADEFLAGS=      -ilang.ja
 TIDYFLAGS=      -raw
 
 DESTDIR?=	${DOCDIR}/ja/books/${.CURDIR:T}
Index: ru_RU.KOI8-R/books/Makefile.inc
===================================================================
RCS file: /home/ncvs/doc/ru_RU.KOI8-R/books/Makefile.inc,v
retrieving revision 1.4
diff -u -r1.4 Makefile.inc
--- Makefile.inc	1999/10/31 22:13:32	1.4
+++ Makefile.inc	2000/03/18 12:58:52
@@ -2,7 +2,6 @@
 # $FreeBSD: doc/ru_RU.KOI8-R/books/Makefile.inc,v 1.4 1999/10/31 22:13:32 phantom Exp $
 #
 
-JADEFLAGS=	-ilang.ru
 TIDYFLAGS=	-raw
 
 DESTDIR?=	${DOCDIR}/ru_RU.KOI8-R/books/${.CURDIR:T}
Index: share/mk/doc.docbook.mk
===================================================================
RCS file: /home/ncvs/doc/share/mk/doc.docbook.mk,v
retrieving revision 1.8
diff -u -r1.8 doc.docbook.mk
--- doc.docbook.mk	2000/03/08 11:21:37	1.8
+++ doc.docbook.mk	2000/03/17 23:07:05
@@ -49,8 +49,8 @@
 
 JADE=		${PREFIX}/bin/jade
 
-DSLHTML?=	${DOC_PREFIX}/share/sgml/freebsd.dsl
-DSLPRINT?=	${DOC_PREFIX}/share/sgml/freebsd.dsl
+DSLHTML?=	../../share/sgml/freebsd.dsl
+DSLPRINT?=	../../share/sgml/freebsd.dsl
 FREEBSDCATALOG=	${DOC_PREFIX}/share/sgml/catalog
 
 DOCBOOKCATALOG=	${PREFIX}/share/sgml/docbook/catalog
@@ -137,8 +137,8 @@
 _docs+= ${DOC}.doc
 CLEANFILES+= ${DOC}.doc
 .elif ${_cf} == "pdb"
-_docs+= ${DOC}.pdb
-+CLEANFILES+= ${DOC}.pdb
+_docs+= ${DOC}.pdb ${.CURDIR:T}.pdb
++CLEANFILES+= ${DOC}.pdb ${.CURDIR:T}.pdb
 .endif
 .endfor
 
@@ -185,7 +185,10 @@
 	w3m -S -dump ${.ALLSRC} > ${.TARGET}
 
 ${DOC}.pdb: ${DOC}.html
-	iSilo386 -y -d0 -Idef ${DOC}.html ${DOC}.pdb
+	iSiloBSD -y -d0 -Idef ${DOC}.html ${DOC}.pdb
+
+${.CURDIR:T}.pdb: ${DOC}.pdb
+	ln -f ${DOC}.pdb ${.CURDIR}.pdb
 
 ${DOC}.rtf: ${SRCS}
 	${JADE} -Vrtf-backend -ioutput.print ${JADEOPTS} -d ${DSLPRINT} -t rtf -o ${.TARGET} ${MASTERDOC}
Index: share/sgml/freebsd.dsl
===================================================================
RCS file: /home/ncvs/doc/share/sgml/freebsd.dsl,v
retrieving revision 1.13
diff -u -r1.13 freebsd.dsl
--- freebsd.dsl	2000/02/15 01:57:17	1.13
+++ freebsd.dsl	2000/03/18 00:17:31
@@ -3,32 +3,19 @@
 <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
 <!ENTITY % output.html  "IGNORE">
 <!ENTITY % output.print "IGNORE">
-<!ENTITY % lang.ja      "IGNORE">
-<!ENTITY % lang.ja.dsssl	"IGNORE">
-<!ENTITY % lang.ru      "IGNORE">
+
 <![ %output.html; [
 <!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" CDATA DSSSL>
 ]]>
 <![ %output.print; [
 <!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN" CDATA DSSSL>
+
 ]]>
 ]>
 
 <style-sheet>
   <style-specification use="docbook">
     <style-specification-body>
-      <!-- Locatization -->
-      <![ %lang.ja; [
-	<![ %lang.ja.dsssl; [
-	  (define %gentext-language% "ja")
-	]]>
-	(define %html-header-tags% '(("META" ("HTTP-EQUIV" "Content-Type") ("CONTENT" "text/html; charset=EUC-JP"))))
-      ]]>
-
-      <![ %lang.ru; [
-	(define %html-header-tags% '(("META" ("HTTP-EQUIV" "Content-Type") ("CONTENT" "text/html; charset=koi8-r"))))
-      ]]>
-
       <!-- HTML only .................................................... -->
       
       <![ %output.html; [
@@ -73,13 +60,36 @@
           (make element gi: "TD"
                 attributes: '(("VALIGN" "TOP"))
             (process-children)))
+
+        <!-- The next two definitions control the appearance of an
+             e-mail footer at the bottom of each page. -->
 
-        <!-- Fix a problem with the French localisation.  This should really
-             be a patch to the dsssl-docbook-modular port, but this gets it
-             more widely available sooner.  A patch will be applied to the
-             port as well, and then this can be removed. -->
-        (define (gentext-fr-nav-prev prev)
-          (make sequence (literal "Pr\U-00E9;c\U-00E9;dent")))
+        <!-- This is the text to display at the bottom of each page.
+             Defaults to nothing.  The individual stylesheets should
+             redefine this as necessary. -->
+        (define ($email-footer$)
+          (empty-sosofo))
+
+        <!-- This code handles displaying $email-footer$ at the bottom
+             of each page.
+
+             If "nuchunks" is turned on then we make sure that an <hr>
+             is shown first.
+
+             Then create a centered paragraph ("<p>"), and reduce the font
+             size ("<small>").  Then run $email-footer$, which should
+             create the text and links as necessary. -->
+	(define ($html-body-end$)
+          (if (equal? $email-footer$ (normalize ""))
+            (empty-sosofo)
+            (make sequence
+              (if nochunks
+                  (make empty-element gi: "hr")
+                  (empty-sosofo))
+                (make element gi: "p"
+                      attributes: (list (list "align" "center"))
+                  (make element gi: "small"
+                    ($email-footer$))))))
       ]]>
 
       <!-- Print only ................................................... --> 

[-- Attachment #3 --]
en_US.ISO_8859-1/share/sgml/freebsd.dsl100644   1751   1751        2014  7064534174  15413 0ustar  niknik<!-- $FreeBSD$ -->

<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY freebsd.dsl SYSTEM "../../../share/sgml/freebsd.dsl" CDATA DSSSL>
]>

<style-sheet>
  <style-specification use="docbook">
    <style-specification-body>
 
      <![ %output.html; [ 
	(define ($email-footer$)
          (make sequence
            (literal "For questions about FreeBSD, e-mail <")
            (make element gi: "a"
                  attributes: (list (list "href" "mailto:questions@freebsd.org"))
              (literal "questions@freebsd.org"))
            (literal ">.")
            (make empty-element gi: "br")
            (literal "For questions about this documentation, e-mail <")
              (make element gi: "a"
                    attributes: (list (list "href" "mailto:doc@freebsd.org"))
                (literal "doc@freebsd.org"))
	      (literal ">."))) 
      ]]>
    </style-specification-body>
  </style-specification>

  <external-specification id="docbook" document="freebsd.dsl">
</style-sheet>
es_ES.ISO_8859-1/share/sgml/freebsd.dsl100644   1751   1751        2014  7064534707  15402 0ustar  niknik<!-- $FreeBSD$ -->

<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY freebsd.dsl SYSTEM "../../../share/sgml/freebsd.dsl" CDATA DSSSL>
]>

<style-sheet>
  <style-specification use="docbook">
    <style-specification-body>
 
      <![ %output.html; [ 
	(define ($email-footer$)
          (make sequence
            (literal "For questions about FreeBSD, e-mail <")
            (make element gi: "a"
                  attributes: (list (list "href" "mailto:questions@freebsd.org"))
              (literal "questions@freebsd.org"))
            (literal ">.")
            (make empty-element gi: "br")
            (literal "For questions about this documentation, e-mail <")
              (make element gi: "a"
                    attributes: (list (list "href" "mailto:doc@freebsd.org"))
                (literal "doc@freebsd.org"))
	      (literal ">."))) 
      ]]>
    </style-specification-body>
  </style-specification>

  <external-specification id="docbook" document="freebsd.dsl">
</style-sheet>
fr_FR.ISO_8859-1/share/sgml/freebsd.dsl100644   1751   1751        2630  7064535050  15376 0ustar  niknik<!-- $FreeBSD$ -->

<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY freebsd.dsl SYSTEM "../../../share/sgml/freebsd.dsl" CDATA DSSSL>
]>

<style-sheet>
  <style-specification use="docbook">
    <style-specification-body>
 
      <![ %output.html; [ 
        <!-- Fix a problem with the French localisation.  This should really
             be a patch to the dsssl-docbook-modular port, but this gets it
             more widely available sooner.  A patch will be applied to the
             port as well, and then this can be removed. -->
        (define (gentext-fr-nav-prev prev)
          (make sequence (literal "Pr\U-00E9;c\U-00E9;dent")))

	(define ($email-footer$)
          (make sequence
            (literal "For questions about FreeBSD, e-mail <")
            (make element gi: "a"
                  attributes: (list (list "href" "mailto:questions@freebsd.org"))
              (literal "questions@freebsd.org"))
            (literal ">.")
            (make empty-element gi: "br")
            (literal "For questions about this documentation, e-mail <")
              (make element gi: "a"
                    attributes: (list (list "href" "mailto:doc@freebsd.org"))
                (literal "doc@freebsd.org"))
	      (literal ">."))) 
      ]]>
    </style-specification-body>
  </style-specification>

  <external-specification id="docbook" document="freebsd.dsl">
</style-sheet>
ja_JP.eucJP/share/sgml/freebsd.dsl100644   1751   1751        1046  7064534532  15110 0ustar  niknik<!-- $FreeBSD$ -->

<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY freebsd.dsl SYSTEM "../../../share/sgml/freebsd.dsl" CDATA DSSSL>
]>

<style-sheet>
  <style-specification use="docbook">
    <style-specification-body>
      (define %gentext-language% "ja")

      (define %html-header-tags% '(("META" ("HTTP-EQUIV" "Content-Type") ("CONTENT" "text/html; charset=EUC-JP")))) 
    </style-specification-body>
  </style-specification>

  <external-specification id="docbook" document="freebsd.dsl">
</style-sheet>
ru_RU.KOI8-R/share/sgml/freebsd.dsl100644   1751   1751        1046  7064534624  15066 0ustar  niknik<!-- $FreeBSD$ -->

<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY freebsd.dsl SYSTEM "../../../share/sgml/freebsd.dsl" CDATA DSSSL>
]>

<style-sheet>
  <style-specification use="docbook">
    <style-specification-body>
      (define %gentext-language% "ja")

      (define %html-header-tags% '(("META" ("HTTP-EQUIV" "Content-Type") ("CONTENT" "text/html; charset=koi8-r")))) 
    </style-specification-body>
  </style-specification>

  <external-specification id="docbook" document="freebsd.dsl">
</style-sheet>
zh_TW.Big5/share/sgml/freebsd.dsl100644   1751   1751         613  7064545110  14711 0ustar  niknik<!-- $FreeBSD$ -->

<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY freebsd.dsl SYSTEM "../../../share/sgml/freebsd.dsl" CDATA DSSSL>
]>

<style-sheet>
  <style-specification use="docbook">
    <style-specification-body>
 
    </style-specification-body>
  </style-specification>

  <external-specification id="docbook" document="freebsd.dsl">
</style-sheet>
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000318132350.A9834>