2001-10-13 03:07:24 +02:00
|
|
|
<!-- $FreeBSD$ -->
|
1999-11-15 20:44:15 +01:00
|
|
|
|
1998-06-30 10:52:15 +02:00
|
|
|
<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
|
2000-10-08 21:15:06 +02:00
|
|
|
<!ENTITY % output.html "IGNORE">
|
|
|
|
<!ENTITY % output.html.images "IGNORE">
|
2004-08-12 17:00:11 +02:00
|
|
|
<!ENTITY % output.rtf.images "IGNORE">
|
2000-10-08 21:15:06 +02:00
|
|
|
<!ENTITY % output.print "IGNORE">
|
|
|
|
<!ENTITY % output.print.pdf "IGNORE">
|
2001-09-08 03:59:22 +02:00
|
|
|
<!ENTITY % output.print.justify "IGNORE">
|
2001-09-11 04:31:50 +02:00
|
|
|
<!ENTITY % output.print.twoside "IGNORE">
|
Give each language and encoding it's own freebsd.dsl, to contain style
sheet definitions for that language only. Each file reads in the defaults
from the master share/sgml/freebsd.dsl file, and adds overrides, or new
definitions, as necessary.
Move the per-language hacks from share/sgml/freebsd.dsl in to
<lang>/share/sgml/freebsd.dsl as necessary.
Add links to the -questions and -doc mailing lists to the bottom of the
generated HTML output for some languages. The -questions link will
become a link to Greg's "Getting the most from questions" document when
I bring that in, but I haven't done that yet, and I didn't want these
patches hanging around my local tree.
This was the real reason for making freebsd.dsl language local, as it
makes it much easier to translate generated text, such as the text of
the links, without polluting share/sgml/freebsd.dsl.
Update doc.docbook.mk to use the new, per-language freebsd.dsl file when
building the docs. While I'm here, update .pdb generation so that it
creates a symlink to ${CURDIR:T}.pdb as well (e.g., the Handbook generates
"book.pdb" and "handbook.pdb"). This makes it easier to install more than
one document on a Palm, because two docs called "book.pdb" or "article.pdb"
can not co-exist.
2000-03-23 10:00:17 +01:00
|
|
|
|
2003-04-19 13:39:30 +02:00
|
|
|
<!ENTITY % freebsd.l10n PUBLIC "-//FreeBSD//ENTITIES DocBook Language Specific Entities//EN">
|
|
|
|
%freebsd.l10n;
|
|
|
|
<!ENTITY % freebsd.l10n-common PUBLIC "-//FreeBSD//ENTITIES DocBook Language Neutral Entities//EN">
|
|
|
|
%freebsd.l10n-common;
|
|
|
|
|
1998-12-20 21:33:49 +01:00
|
|
|
<![ %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>
|
Give each language and encoding it's own freebsd.dsl, to contain style
sheet definitions for that language only. Each file reads in the defaults
from the master share/sgml/freebsd.dsl file, and adds overrides, or new
definitions, as necessary.
Move the per-language hacks from share/sgml/freebsd.dsl in to
<lang>/share/sgml/freebsd.dsl as necessary.
Add links to the -questions and -doc mailing lists to the bottom of the
generated HTML output for some languages. The -questions link will
become a link to Greg's "Getting the most from questions" document when
I bring that in, but I haven't done that yet, and I didn't want these
patches hanging around my local tree.
This was the real reason for making freebsd.dsl language local, as it
makes it much easier to translate generated text, such as the text of
the links, without polluting share/sgml/freebsd.dsl.
Update doc.docbook.mk to use the new, per-language freebsd.dsl file when
building the docs. While I'm here, update .pdb generation so that it
creates a symlink to ${CURDIR:T}.pdb as well (e.g., the Handbook generates
"book.pdb" and "handbook.pdb"). This makes it easier to install more than
one document on a Palm, because two docs called "book.pdb" or "article.pdb"
can not co-exist.
2000-03-23 10:00:17 +01:00
|
|
|
|
1998-12-20 21:33:49 +01:00
|
|
|
]]>
|
1998-06-30 10:52:15 +02:00
|
|
|
]>
|
|
|
|
|
|
|
|
<style-sheet>
|
|
|
|
<style-specification use="docbook">
|
|
|
|
<style-specification-body>
|
2001-09-08 04:21:19 +02:00
|
|
|
|
|
|
|
(declare-flow-object-class formatting-instruction
|
|
|
|
"UNREGISTERED::James Clark//Flow Object Class::formatting-instruction")
|
|
|
|
|
1998-12-20 21:33:49 +01:00
|
|
|
<!-- HTML only .................................................... -->
|
|
|
|
|
|
|
|
<![ %output.html; [
|
|
|
|
<!-- Configure the stylesheet using documented variables -->
|
1998-06-30 10:52:15 +02:00
|
|
|
|
2001-09-13 09:34:57 +02:00
|
|
|
(define %hyphenation% #f) <!-- Silence a warning -->
|
|
|
|
|
1998-12-20 21:33:49 +01:00
|
|
|
(define %gentext-nav-use-tables%
|
|
|
|
;; Use tables to build the navigation headers and footers?
|
|
|
|
#t)
|
1998-06-30 10:52:15 +02:00
|
|
|
|
1998-12-20 21:33:49 +01:00
|
|
|
(define %html-ext%
|
|
|
|
;; Default extension for HTML output files
|
|
|
|
".html")
|
1998-06-30 10:52:15 +02:00
|
|
|
|
1998-12-20 21:33:49 +01:00
|
|
|
(define %shade-verbatim%
|
|
|
|
;; Should verbatim environments be shaded?
|
|
|
|
#f)
|
1998-06-30 10:52:15 +02:00
|
|
|
|
1998-12-20 21:33:49 +01:00
|
|
|
(define %use-id-as-filename%
|
|
|
|
;; Use ID attributes as name for component HTML files?
|
|
|
|
#t)
|
1998-11-04 23:41:50 +01:00
|
|
|
|
1998-12-20 21:33:49 +01:00
|
|
|
(define %root-filename%
|
|
|
|
;; Name for the root HTML document
|
|
|
|
"index")
|
|
|
|
|
1999-01-02 18:08:45 +01:00
|
|
|
(define html-manifest
|
|
|
|
;; Write a manifest?
|
1999-01-28 00:29:14 +01:00
|
|
|
#f)
|
1999-09-03 19:12:43 +02:00
|
|
|
|
2001-02-13 20:21:31 +01:00
|
|
|
(define %generate-legalnotice-link%
|
|
|
|
;; Should legal notices be a link to a separate file?
|
|
|
|
;;
|
|
|
|
;; Naturally, this has no effect if you're building one big
|
|
|
|
;; HTML file.
|
2003-02-16 15:59:30 +01:00
|
|
|
#f)
|
2001-02-13 20:21:31 +01:00
|
|
|
|
2003-04-19 13:39:30 +02:00
|
|
|
(define %generate-docformat-navi-link%
|
|
|
|
;; Create docformat navi link for HTML output?
|
|
|
|
#f)
|
|
|
|
|
2004-07-15 10:26:33 +02:00
|
|
|
;; Taken from Norm's stylesheets; modified to add support for TITLE so
|
|
|
|
;; that we get a mouse over definition for acronyms in HTML output.
|
|
|
|
|
|
|
|
(define ($acronym-seq$ #!optional (sosofo (process-children)))
|
|
|
|
;; FIXME: html4 only
|
|
|
|
(let ((title (attribute-string (normalize "role") (current-node))))
|
|
|
|
(if title
|
|
|
|
(make element gi: "ACRONYM"
|
|
|
|
attributes: (list
|
|
|
|
(list "TITLE" title)
|
|
|
|
(list "CLASS" (gi)))
|
|
|
|
sosofo)
|
|
|
|
(make element gi: "ACRONYM"
|
|
|
|
attributes: (list
|
|
|
|
(list "CLASS" (gi)))
|
|
|
|
sosofo))))
|
|
|
|
|
2001-04-09 22:35:47 +02:00
|
|
|
(define (book-titlepage-recto-elements)
|
|
|
|
(list (normalize "title")
|
|
|
|
(normalize "subtitle")
|
|
|
|
(normalize "graphic")
|
|
|
|
(normalize "mediaobject")
|
|
|
|
(normalize "corpauthor")
|
|
|
|
(normalize "authorgroup")
|
|
|
|
(normalize "author")
|
|
|
|
(normalize "editor")
|
|
|
|
(normalize "copyright")
|
|
|
|
(normalize "abstract")
|
|
|
|
(normalize "legalnotice")
|
|
|
|
(normalize "isbn")))
|
|
|
|
|
2003-04-19 13:39:30 +02:00
|
|
|
;; Create a simple navigation link
|
|
|
|
;; if %generate-docformat-navi-link% defined.
|
|
|
|
(define (make-docformat-navi tlist)
|
|
|
|
(let ((rootgi (gi (sgml-root-element))))
|
|
|
|
(make element gi: "DIV"
|
|
|
|
attributes: '(("CLASS" "DOCFORAMTNAVI"))
|
|
|
|
(literal "[ ")
|
|
|
|
(make-docformat-navi-link rootgi tlist)
|
|
|
|
(literal " ]"))))
|
|
|
|
|
|
|
|
(define (make-docformat-navi-link rootgi tlist)
|
|
|
|
(make sequence
|
|
|
|
(cond
|
|
|
|
((null? tlist) (empty-sosofo))
|
|
|
|
((null? (car tlist)) (empty-sosofo))
|
|
|
|
((not (symbol? (car tlist))) (empty-sosofo))
|
|
|
|
((equal? (car tlist) 'html-split)
|
|
|
|
(make sequence
|
|
|
|
(create-link (list (list "href" "./index.html"))
|
|
|
|
(literal "&docnavi.split-html;"))
|
|
|
|
(if (not (null? (cdr tlist)))
|
|
|
|
(make sequence
|
|
|
|
(literal " / ")
|
|
|
|
(make-docformat-navi-link rootgi (cdr tlist)))
|
|
|
|
(empty-sosofo))))
|
|
|
|
((equal? (car tlist) 'html-single)
|
|
|
|
(make sequence
|
|
|
|
(create-link (list (list "href"
|
|
|
|
(string-append "./" (case-fold-down rootgi) ".html")))
|
|
|
|
(literal "&docnavi.single-html;"))
|
|
|
|
(if (not (null? (cdr tlist)))
|
|
|
|
(make sequence
|
|
|
|
(literal " / ")
|
|
|
|
(make-docformat-navi-link rootgi (cdr tlist)))
|
|
|
|
(empty-sosofo))))
|
|
|
|
(else (empty-sosofo)))))
|
|
|
|
|
|
|
|
(define (article-titlepage-separator side)
|
|
|
|
(make sequence
|
|
|
|
(if %generate-docformat-navi-link%
|
|
|
|
(make-docformat-navi '(html-split html-single))
|
|
|
|
(empty-sosofo))
|
|
|
|
(make empty-element gi: "HR")))
|
|
|
|
|
|
|
|
(define (book-titlepage-separator side)
|
|
|
|
(if (equal? side 'recto)
|
|
|
|
(make sequence
|
|
|
|
(if %generate-docformat-navi-link%
|
|
|
|
(make-docformat-navi '(html-split html-single))
|
|
|
|
(empty-sosofo))
|
|
|
|
(make empty-element gi: "HR"))
|
|
|
|
(empty-sosofo)))
|
|
|
|
|
Give each language and encoding it's own freebsd.dsl, to contain style
sheet definitions for that language only. Each file reads in the defaults
from the master share/sgml/freebsd.dsl file, and adds overrides, or new
definitions, as necessary.
Move the per-language hacks from share/sgml/freebsd.dsl in to
<lang>/share/sgml/freebsd.dsl as necessary.
Add links to the -questions and -doc mailing lists to the bottom of the
generated HTML output for some languages. The -questions link will
become a link to Greg's "Getting the most from questions" document when
I bring that in, but I haven't done that yet, and I didn't want these
patches hanging around my local tree.
This was the real reason for making freebsd.dsl language local, as it
makes it much easier to translate generated text, such as the text of
the links, without polluting share/sgml/freebsd.dsl.
Update doc.docbook.mk to use the new, per-language freebsd.dsl file when
building the docs. While I'm here, update .pdb generation so that it
creates a symlink to ${CURDIR:T}.pdb as well (e.g., the Handbook generates
"book.pdb" and "handbook.pdb"). This makes it easier to install more than
one document on a Palm, because two docs called "book.pdb" or "article.pdb"
can not co-exist.
2000-03-23 10:00:17 +01:00
|
|
|
<!-- 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))
|
|
|
|
|
2001-06-16 23:30:11 +02:00
|
|
|
(define html-index-filename
|
|
|
|
(if nochunks
|
|
|
|
"html.index"
|
|
|
|
"html-split.index"))
|
|
|
|
|
2001-06-18 16:29:16 +02:00
|
|
|
(define %stylesheet%
|
|
|
|
"docbook.css")
|
|
|
|
|
Give each language and encoding it's own freebsd.dsl, to contain style
sheet definitions for that language only. Each file reads in the defaults
from the master share/sgml/freebsd.dsl file, and adds overrides, or new
definitions, as necessary.
Move the per-language hacks from share/sgml/freebsd.dsl in to
<lang>/share/sgml/freebsd.dsl as necessary.
Add links to the -questions and -doc mailing lists to the bottom of the
generated HTML output for some languages. The -questions link will
become a link to Greg's "Getting the most from questions" document when
I bring that in, but I haven't done that yet, and I didn't want these
patches hanging around my local tree.
This was the real reason for making freebsd.dsl language local, as it
makes it much easier to translate generated text, such as the text of
the links, without polluting share/sgml/freebsd.dsl.
Update doc.docbook.mk to use the new, per-language freebsd.dsl file when
building the docs. While I'm here, update .pdb generation so that it
creates a symlink to ${CURDIR:T}.pdb as well (e.g., the Handbook generates
"book.pdb" and "handbook.pdb"). This makes it easier to install more than
one document on a Palm, because two docs called "book.pdb" or "article.pdb"
can not co-exist.
2000-03-23 10:00:17 +01:00
|
|
|
<!-- This code handles displaying $email-footer$ at the bottom
|
|
|
|
of each page.
|
|
|
|
|
2001-04-09 22:35:47 +02:00
|
|
|
If "nochunks" is turned on then we make sure that an <hr>
|
Give each language and encoding it's own freebsd.dsl, to contain style
sheet definitions for that language only. Each file reads in the defaults
from the master share/sgml/freebsd.dsl file, and adds overrides, or new
definitions, as necessary.
Move the per-language hacks from share/sgml/freebsd.dsl in to
<lang>/share/sgml/freebsd.dsl as necessary.
Add links to the -questions and -doc mailing lists to the bottom of the
generated HTML output for some languages. The -questions link will
become a link to Greg's "Getting the most from questions" document when
I bring that in, but I haven't done that yet, and I didn't want these
patches hanging around my local tree.
This was the real reason for making freebsd.dsl language local, as it
makes it much easier to translate generated text, such as the text of
the links, without polluting share/sgml/freebsd.dsl.
Update doc.docbook.mk to use the new, per-language freebsd.dsl file when
building the docs. While I'm here, update .pdb generation so that it
creates a symlink to ${CURDIR:T}.pdb as well (e.g., the Handbook generates
"book.pdb" and "handbook.pdb"). This makes it easier to install more than
one document on a Palm, because two docs called "book.pdb" or "article.pdb"
can not co-exist.
2000-03-23 10:00:17 +01:00
|
|
|
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))
|
2001-02-20 20:17:26 +01:00
|
|
|
($email-footer$))))
|
2000-07-25 12:31:35 +02:00
|
|
|
|
2001-03-24 10:40:24 +01:00
|
|
|
(define %refentry-xref-link%
|
|
|
|
;; REFENTRY refentry-xref-link
|
|
|
|
;; PURP Generate URL links when cross-referencing RefEntrys?
|
|
|
|
;; DESC
|
|
|
|
;; If true, a web link will be generated, presumably
|
|
|
|
;; to an online man->HTML gateway. The text of the link is
|
|
|
|
;; generated by the $create-refentry-xref-link$ function.
|
|
|
|
;; /DESC
|
|
|
|
;; AUTHOR N/A
|
|
|
|
;; /REFENTRY
|
|
|
|
#f)
|
|
|
|
|
2003-05-22 17:03:50 +02:00
|
|
|
<!-- Specify how to generate the man page link HREF -->
|
|
|
|
(define ($create-refentry-xref-link$ #!optional (n (current-node)))
|
|
|
|
(let* ((r (select-elements (children n) (normalize "refentrytitle")))
|
|
|
|
(m (select-elements (children n) (normalize "manvolnum")))
|
|
|
|
(v (attribute-string (normalize "vendor") n))
|
|
|
|
(u (string-append "http://www.FreeBSD.org/cgi/man.cgi?query="
|
|
|
|
(data r) "&" "sektion=" (data m))))
|
|
|
|
(case v
|
2004-08-30 11:19:35 +02:00
|
|
|
(("current") (string-append u "&" "manpath=FreeBSD+6-current"))
|
|
|
|
(("xfree86") (string-append u "&" "manpath=XFree86+4.4.0"))
|
|
|
|
(("xorg") (string-append u "&" "manpath=X11R6.7.0"))
|
2003-05-22 17:03:50 +02:00
|
|
|
(("netbsd") (string-append u "&" "manpath=NetBSD+1.6.1"))
|
2004-08-30 11:19:35 +02:00
|
|
|
(("openbsd") (string-append u "&" "manpath=OpenBSD+3.4"))
|
2003-05-22 17:03:50 +02:00
|
|
|
(("ports") (string-append u "&" "manpath=FreeBSD+Ports"))
|
|
|
|
(else u))))
|
2001-04-05 15:19:59 +02:00
|
|
|
|
2004-07-14 11:44:30 +02:00
|
|
|
(element application ($bold-seq$))
|
|
|
|
|
2001-03-24 10:40:24 +01:00
|
|
|
(element citerefentry
|
2002-08-27 16:03:38 +02:00
|
|
|
(let ((href ($create-refentry-xref-link$)))
|
2001-06-18 16:29:16 +02:00
|
|
|
(if %refentry-xref-link%
|
|
|
|
(create-link (list (list "HREF" href))
|
2001-03-24 10:40:24 +01:00
|
|
|
(if %refentry-xref-italic%
|
|
|
|
($italic-seq$)
|
|
|
|
($charseq$)))
|
|
|
|
(if %refentry-xref-italic%
|
|
|
|
($italic-seq$)
|
|
|
|
($charseq$)))))
|
2001-07-24 13:07:59 +02:00
|
|
|
|
2002-02-27 05:56:44 +01:00
|
|
|
(element filename
|
|
|
|
(let* ((class (attribute-string (normalize "role"))))
|
|
|
|
(cond
|
|
|
|
((equal? class "package")
|
|
|
|
(let* ((urlurl "http://www.FreeBSD.org/cgi/url.cgi")
|
|
|
|
(href (string-append urlurl "?ports/"
|
2001-08-09 02:14:42 +02:00
|
|
|
(data (current-node))
|
|
|
|
"/pkg-descr")))
|
2002-02-27 05:56:44 +01:00
|
|
|
(create-link (list (list "HREF" href)) ($mono-seq$))))
|
|
|
|
(else ($mono-seq$)))))
|
2002-10-28 20:35:31 +01:00
|
|
|
|
|
|
|
;; Ensure that we start with no preferred mediaobject notations,
|
|
|
|
;; so that in the text-only case we don't choose any of the
|
|
|
|
;; possible images, and fallback to the most appropriate
|
|
|
|
;; textobject
|
|
|
|
(define preferred-mediaobject-notations
|
|
|
|
'())
|
2003-05-22 17:03:50 +02:00
|
|
|
|
|
|
|
<!-- Convert " ... " to `` ... '' in the HTML output. -->
|
|
|
|
(element quote
|
|
|
|
(make sequence
|
|
|
|
(literal "``")
|
|
|
|
(process-children)
|
|
|
|
(literal "''")))
|
2003-08-20 17:40:46 +02:00
|
|
|
|
|
|
|
;; The special FreeBSD version of the trademark tag handling.
|
|
|
|
;; This function was more or less taken from the DocBook DSSSL
|
|
|
|
;; stylesheets by Norman Walsh.
|
|
|
|
(element trademark
|
|
|
|
(if (show-tm-symbol? (current-node))
|
|
|
|
(make sequence
|
|
|
|
($charseq$)
|
|
|
|
(cond
|
|
|
|
((equal? (attribute-string "class") (normalize "copyright"))
|
|
|
|
(make entity-ref name: "copy"))
|
|
|
|
((equal? (attribute-string "class") (normalize "registered"))
|
|
|
|
(make entity-ref name: "reg"))
|
|
|
|
((equal? (attribute-string "class") (normalize "service"))
|
|
|
|
(make element gi: "SUP"
|
|
|
|
(literal "SM")))
|
|
|
|
(else
|
|
|
|
(make entity-ref name: "#8482"))))
|
|
|
|
($charseq$)))
|
|
|
|
|
1998-12-20 21:33:49 +01:00
|
|
|
]]>
|
|
|
|
|
2000-10-08 21:15:06 +02:00
|
|
|
<!-- HTML with images ............................................ -->
|
|
|
|
|
|
|
|
<![ %output.html.images [
|
|
|
|
|
2001-06-24 04:46:40 +02:00
|
|
|
; The new Cascading Style Sheets for the HTML output are very confused
|
|
|
|
; by our images when used with div class="mediaobject". We can
|
|
|
|
; clear up the confusion by ignoring the whole mess and just
|
|
|
|
; displaying the image.
|
|
|
|
|
|
|
|
(element mediaobject
|
2002-10-28 20:35:31 +01:00
|
|
|
(make element gi: "P"
|
|
|
|
($mediaobject$)))
|
2001-06-24 04:46:40 +02:00
|
|
|
|
2000-10-08 21:15:06 +02:00
|
|
|
(define %graphic-default-extension%
|
|
|
|
"png")
|
|
|
|
|
|
|
|
(define %callout-graphics%
|
|
|
|
;; Use graphics in callouts?
|
|
|
|
#t)
|
|
|
|
|
|
|
|
(define %callout-graphics-ext%
|
|
|
|
;; The extension to use for callout images. This is an extension
|
|
|
|
;; to the stylesheets, they do not support this functionality
|
|
|
|
;; natively.
|
|
|
|
".png")
|
|
|
|
|
|
|
|
(define %callout-graphics-path%
|
|
|
|
;; Path to callout graphics
|
|
|
|
"./imagelib/callouts/")
|
|
|
|
|
|
|
|
;; Redefine $callout-bug$ to support the %callout-graphic-ext%
|
|
|
|
;; variable.
|
|
|
|
(define ($callout-bug$ conumber)
|
|
|
|
(let ((number (if conumber (format-number conumber "1") "0")))
|
|
|
|
(if conumber
|
|
|
|
(if %callout-graphics%
|
|
|
|
(if (<= conumber %callout-graphics-number-limit%)
|
|
|
|
(make empty-element gi: "IMG"
|
|
|
|
attributes: (list (list "SRC"
|
|
|
|
(root-rel-path
|
|
|
|
(string-append
|
|
|
|
%callout-graphics-path%
|
|
|
|
number
|
|
|
|
%callout-graphics-ext%)))
|
|
|
|
(list "HSPACE" "0")
|
|
|
|
(list "VSPACE" "0")
|
|
|
|
(list "BORDER" "0")
|
|
|
|
(list "ALT"
|
|
|
|
(string-append
|
|
|
|
"(" number ")"))))
|
|
|
|
(make element gi: "B"
|
|
|
|
(literal "(" (format-number conumber "1") ")")))
|
|
|
|
(make element gi: "B"
|
|
|
|
(literal "(" (format-number conumber "1") ")")))
|
|
|
|
(make element gi: "B"
|
|
|
|
(literal "(??)")))))
|
|
|
|
]]>
|
|
|
|
|
2004-08-12 17:00:11 +02:00
|
|
|
<!-- RTF with images ............................................ -->
|
|
|
|
|
|
|
|
<![ %output.rtf.images [
|
|
|
|
|
|
|
|
(define %graphic-default-extension%
|
|
|
|
"png")
|
|
|
|
|
|
|
|
(define %callout-graphics%
|
|
|
|
;; Use graphics in callouts?
|
|
|
|
#f)
|
|
|
|
]]>
|
|
|
|
|
2001-09-11 04:31:50 +02:00
|
|
|
<!-- Two-sided Print output ....................................... -->
|
|
|
|
<![ %output.print.twoside; [
|
|
|
|
|
2001-09-11 10:56:52 +02:00
|
|
|
;; From an email by Ian Castle to the DocBook-apps list
|
|
|
|
|
2001-09-13 09:34:57 +02:00
|
|
|
(define ($component$)
|
|
|
|
(make simple-page-sequence
|
|
|
|
page-n-columns: %page-n-columns%
|
|
|
|
page-number-restart?: (or %page-number-restart%
|
|
|
|
; (book-start?)
|
|
|
|
(first-chapter?))
|
|
|
|
page-number-format: ($page-number-format$)
|
|
|
|
use: default-text-style
|
|
|
|
left-header: ($left-header$)
|
|
|
|
center-header: ($center-header$)
|
|
|
|
right-header: ($right-header$)
|
|
|
|
left-footer: ($left-footer$)
|
|
|
|
center-footer: ($center-footer$)
|
|
|
|
right-footer: ($right-footer$)
|
|
|
|
start-indent: %body-start-indent%
|
|
|
|
input-whitespace-treatment: 'collapse
|
|
|
|
quadding: %default-quadding%
|
|
|
|
(make sequence
|
|
|
|
($component-title$)
|
|
|
|
(process-children))
|
|
|
|
(make-endnotes)))
|
|
|
|
|
|
|
|
;; From an email by Ian Castle to the DocBook-apps list
|
|
|
|
|
2001-09-11 10:56:52 +02:00
|
|
|
(define (first-part?)
|
|
|
|
(let* ((book (ancestor (normalize "book")))
|
|
|
|
(nd (ancestor-member (current-node)
|
|
|
|
(append
|
|
|
|
(component-element-list)
|
|
|
|
(division-element-list))))
|
|
|
|
(bookch (children book)))
|
|
|
|
(let loop ((nl bookch))
|
|
|
|
(if (node-list-empty? nl)
|
|
|
|
#f
|
|
|
|
(if (equal? (gi (node-list-first nl)) (normalize "part"))
|
|
|
|
(if (node-list=? (node-list-first nl) nd)
|
|
|
|
#t
|
|
|
|
#f)
|
|
|
|
(loop (node-list-rest nl)))))))
|
|
|
|
|
|
|
|
|
|
|
|
;; From an email by Ian Castle to the DocBook-apps list
|
|
|
|
|
|
|
|
(define (first-chapter?)
|
|
|
|
;; Returns #t if the current-node is in the first chapter of a book
|
|
|
|
(if (has-ancestor-member? (current-node) (division-element-list))
|
2001-09-11 04:31:50 +02:00
|
|
|
#f
|
2001-09-11 10:56:52 +02:00
|
|
|
(let* ((book (ancestor (normalize "book")))
|
|
|
|
(nd (ancestor-member (current-node)
|
|
|
|
(append (component-element-list)
|
|
|
|
(division-element-list))))
|
|
|
|
(bookch (children book))
|
|
|
|
(bookcomp (expand-children bookch (list (normalize "part")))))
|
|
|
|
(let loop ((nl bookcomp))
|
|
|
|
(if (node-list-empty? nl)
|
|
|
|
#f
|
|
|
|
(if (equal? (gi (node-list-first nl)) (normalize "chapter"))
|
|
|
|
(if (node-list=? (node-list-first nl) nd)
|
|
|
|
#t
|
|
|
|
#f)
|
|
|
|
(loop (node-list-rest nl))))))))
|
|
|
|
|
|
|
|
|
|
|
|
; By default, the Part I title page will be given a roman numeral,
|
|
|
|
; which is wrong so we have to fix it
|
|
|
|
|
|
|
|
(define (part-titlepage elements #!optional (side 'recto))
|
|
|
|
(let ((nodelist (titlepage-nodelist
|
|
|
|
(if (equal? side 'recto)
|
|
|
|
(part-titlepage-recto-elements)
|
|
|
|
(part-titlepage-verso-elements))
|
|
|
|
elements))
|
|
|
|
;; partintro is a special case...
|
|
|
|
(partintro (node-list-first
|
|
|
|
(node-list-filter-by-gi elements (list (normalize "partintro"))))))
|
|
|
|
(if (part-titlepage-content? elements side)
|
|
|
|
(make simple-page-sequence
|
|
|
|
page-n-columns: %titlepage-n-columns%
|
|
|
|
;; Make sure that page number format is correct.
|
|
|
|
page-number-format: ($page-number-format$)
|
|
|
|
;; Make sure that the page number is set to 1 if this is the first part
|
|
|
|
;; in the book
|
|
|
|
page-number-restart?: (first-part?)
|
|
|
|
input-whitespace-treatment: 'collapse
|
|
|
|
use: default-text-style
|
2001-09-11 04:31:50 +02:00
|
|
|
|
2001-09-11 10:56:52 +02:00
|
|
|
;; This hack is required for the RTF backend. If an
|
|
|
|
;; external-graphic is the first thing on the page,
|
|
|
|
;; RTF doesn't seem to do the right thing (the graphic
|
|
|
|
;; winds up on the baseline of the first line of the
|
|
|
|
;; page, left justified). This "one point rule" fixes
|
|
|
|
;; that problem.
|
|
|
|
|
|
|
|
(make paragraph
|
|
|
|
line-spacing: 1pt
|
|
|
|
(literal ""))
|
|
|
|
|
|
|
|
(let loop ((nl nodelist) (lastnode (empty-node-list)))
|
|
|
|
(if (node-list-empty? nl)
|
|
|
|
(empty-sosofo)
|
|
|
|
(make sequence
|
|
|
|
(if (or (node-list-empty? lastnode)
|
|
|
|
(not (equal? (gi (node-list-first nl))
|
|
|
|
(gi lastnode))))
|
|
|
|
(part-titlepage-before (node-list-first nl) side)
|
|
|
|
(empty-sosofo))
|
|
|
|
(cond
|
|
|
|
((equal? (gi (node-list-first nl)) (normalize "subtitle"))
|
|
|
|
(part-titlepage-subtitle (node-list-first nl) side))
|
|
|
|
((equal? (gi (node-list-first nl)) (normalize "title"))
|
|
|
|
(part-titlepage-title (node-list-first nl) side))
|
|
|
|
(else
|
|
|
|
(part-titlepage-default (node-list-first nl) side)))
|
|
|
|
(loop (node-list-rest nl) (node-list-first nl)))))
|
|
|
|
(if (and %generate-part-toc%
|
|
|
|
%generate-part-toc-on-titlepage%
|
|
|
|
(equal? side 'recto))
|
|
|
|
(make display-group
|
|
|
|
(build-toc (current-node)
|
|
|
|
(toc-depth (current-node))))
|
|
|
|
(empty-sosofo))
|
|
|
|
|
|
|
|
;; PartIntro is a special case
|
|
|
|
(if (and (equal? side 'recto)
|
|
|
|
(not (node-list-empty? partintro))
|
|
|
|
%generate-partintro-on-titlepage%)
|
|
|
|
($process-partintro$ partintro #f)
|
|
|
|
(empty-sosofo)))
|
|
|
|
(empty-sosofo))))
|
2001-09-11 04:31:50 +02:00
|
|
|
|
|
|
|
]]>
|
|
|
|
|
2001-09-08 03:59:22 +02:00
|
|
|
<!-- Print with justification ..................................... -->
|
|
|
|
<![ %output.print.justify; [
|
|
|
|
|
|
|
|
(define %default-quadding%
|
|
|
|
'justify)
|
|
|
|
|
|
|
|
(define %hyphenation%
|
|
|
|
#t)
|
2001-09-11 04:06:03 +02:00
|
|
|
|
|
|
|
|
2001-09-11 10:47:53 +02:00
|
|
|
;; The url.sty package is making all of the links purple/pink.
|
|
|
|
;; Someone please fix this!
|
|
|
|
|
|
|
|
(define (urlwrap)
|
2001-09-11 04:06:03 +02:00
|
|
|
(let ((%factor% (if %verbatim-size-factor%
|
|
|
|
%verbatim-size-factor%
|
|
|
|
1.0)))
|
2001-09-11 10:47:53 +02:00
|
|
|
(make sequence
|
|
|
|
font-family-name: %mono-font-family%
|
|
|
|
font-size: (* (inherited-font-size) %factor%)
|
|
|
|
(make formatting-instruction data:
|
|
|
|
(string-append
|
|
|
|
"\\url|"
|
|
|
|
(data (current-node))
|
|
|
|
"|")))))
|
|
|
|
|
|
|
|
(define (pathwrap)
|
|
|
|
(let ((%factor% (if %verbatim-size-factor%
|
|
|
|
%verbatim-size-factor%
|
|
|
|
1.0)))
|
|
|
|
(make sequence
|
|
|
|
font-family-name: %mono-font-family%
|
|
|
|
font-size: (* (inherited-font-size) %factor%)
|
|
|
|
(make formatting-instruction data:
|
|
|
|
(string-append
|
|
|
|
"\\path|"
|
|
|
|
(data (current-node))
|
|
|
|
"|")))))
|
|
|
|
|
2001-09-13 09:34:57 +02:00
|
|
|
;; Some others may check the value of %hyphenation% and be
|
|
|
|
;; specified below
|
|
|
|
|
|
|
|
; (element email
|
|
|
|
; (make sequence
|
|
|
|
; (literal "<")
|
|
|
|
; (urlwrap)
|
|
|
|
; (literal ">")))
|
|
|
|
|
2001-09-11 10:47:53 +02:00
|
|
|
(element filename
|
|
|
|
(pathwrap))
|
|
|
|
|
|
|
|
(element varname
|
|
|
|
(pathwrap))
|
2001-09-11 04:06:03 +02:00
|
|
|
|
2001-09-08 03:59:22 +02:00
|
|
|
]]>
|
|
|
|
|
1998-12-20 21:33:49 +01:00
|
|
|
<!-- Print only ................................................... -->
|
|
|
|
<![ %output.print; [
|
2001-07-12 03:40:31 +02:00
|
|
|
(define withpgpkeys
|
|
|
|
#f)
|
|
|
|
|
2001-07-20 06:59:28 +02:00
|
|
|
;; If a link is entered as "file://localhost/usr/ports" in the docs
|
|
|
|
;; then we only want to display "/usr/ports" in printed form.
|
|
|
|
|
|
|
|
(define (fix-url url)
|
|
|
|
(if (and (> (string-length url) 15)
|
|
|
|
(string=? (substring url 0 16) "file://localhost"))
|
|
|
|
(substring url 16 (string-length url))
|
|
|
|
url))
|
2001-07-21 11:09:59 +02:00
|
|
|
|
|
|
|
|
|
|
|
(element (primaryie ulink)
|
|
|
|
(indexentry-link (current-node)))
|
|
|
|
(element (secondaryie ulink)
|
|
|
|
(indexentry-link (current-node)))
|
|
|
|
(element (tertiaryie ulink)
|
|
|
|
(indexentry-link (current-node)))
|
|
|
|
|
2002-01-10 23:09:44 +01:00
|
|
|
;; Override the count-footnote? definition from dbblock.dsl
|
|
|
|
;; to fix a bug. Basically, the original procedure would count
|
|
|
|
;; all ulink elements when doing %footnote-ulinks%. It's
|
|
|
|
;; actually harder than that, because ulink elements with no
|
|
|
|
;; content shouldn't generate footnotes (the ulink element
|
|
|
|
;; definition just inserts the url attribute in-line, thus there
|
|
|
|
;; is no need for a footnote with the url). So, when we figure
|
|
|
|
;; out which footnotes to count for the purpose of determining
|
|
|
|
;; footnote numbers, we only count the ulink elements containing
|
|
|
|
;; content.
|
|
|
|
(define (count-footnote? footnote)
|
|
|
|
;; don't count footnotes in comments (unless you're showing comments)
|
|
|
|
;; or footnotes in tables which are handled locally in the table
|
|
|
|
(if (or (and (has-ancestor-member? footnote (list (normalize "comment")))
|
|
|
|
(not %show-comments%))
|
|
|
|
(has-ancestor-member? footnote (list (normalize "tgroup")))
|
|
|
|
(and (has-ancestor-member? footnote (list (normalize "ulink")))
|
|
|
|
(node-list-empty? (children footnote))))
|
|
|
|
#f
|
|
|
|
#t))
|
|
|
|
|
2001-07-20 06:59:28 +02:00
|
|
|
(element ulink
|
|
|
|
(make sequence
|
|
|
|
(if (node-list-empty? (children (current-node)))
|
2001-12-20 14:52:16 +01:00
|
|
|
(literal (fix-url (attribute-string (normalize "url"))))
|
2001-07-20 06:59:28 +02:00
|
|
|
(make sequence
|
|
|
|
($charseq$)
|
|
|
|
(if %footnote-ulinks%
|
2002-01-07 04:46:24 +01:00
|
|
|
(if (and (equal? (print-backend) 'tex) bop-footnotes)
|
|
|
|
(make sequence
|
|
|
|
($ss-seq$ + (literal (footnote-number (current-node))))
|
|
|
|
(make page-footnote
|
|
|
|
(make paragraph
|
|
|
|
font-size: (* %footnote-size-factor% %bf-size%)
|
|
|
|
font-posture: 'upright
|
|
|
|
quadding: %default-quadding%
|
|
|
|
line-spacing: (* (* %footnote-size-factor% %bf-size%)
|
|
|
|
%line-spacing-factor%)
|
|
|
|
space-before: %para-sep%
|
|
|
|
space-after: %para-sep%
|
|
|
|
start-indent: %footnote-field-width%
|
|
|
|
first-line-start-indent: (- %footnote-field-width%)
|
|
|
|
(make line-field
|
|
|
|
field-width: %footnote-field-width%
|
|
|
|
(literal (footnote-number (current-node))
|
|
|
|
(gentext-label-title-sep (normalize "footnote"))))
|
2002-01-08 04:49:50 +01:00
|
|
|
(literal (fix-url (attribute-string (normalize "url")))))))
|
2002-01-07 04:46:24 +01:00
|
|
|
($ss-seq$ + (literal (footnote-number (current-node)))))
|
2001-07-20 06:59:28 +02:00
|
|
|
(if (and %show-ulinks%
|
|
|
|
(not (equal? (fix-url (attribute-string (normalize "url")))
|
|
|
|
(data-of (current-node)))))
|
|
|
|
(make sequence
|
|
|
|
(literal " (")
|
2001-09-08 04:21:19 +02:00
|
|
|
(if %hyphenation%
|
|
|
|
(make formatting-instruction data:
|
|
|
|
(string-append "\\url{"
|
|
|
|
(fix-url (attribute-string
|
|
|
|
(normalize "url")))
|
|
|
|
"}"))
|
|
|
|
(literal (fix-url (attribute-string (normalize "url")))))
|
2001-07-20 06:59:28 +02:00
|
|
|
(literal ")"))
|
|
|
|
(empty-sosofo)))))))
|
|
|
|
|
|
|
|
|
2001-03-04 19:05:19 +01:00
|
|
|
(define (toc-depth nd)
|
|
|
|
(if (string=? (gi nd) (normalize "book"))
|
|
|
|
3
|
|
|
|
1))
|
2001-07-16 07:00:21 +02:00
|
|
|
|
2001-07-12 03:40:31 +02:00
|
|
|
(element programlisting
|
|
|
|
(if (and (equal? (attribute-string (normalize "role")) "pgpkey")
|
|
|
|
(not withpgpkeys))
|
|
|
|
(empty-sosofo)
|
2001-07-27 23:16:55 +02:00
|
|
|
(next-match)))
|
2003-06-17 22:22:51 +02:00
|
|
|
|
|
|
|
(element legalnotice
|
|
|
|
(if (equal? (attribute-string (normalize "role")) "trademarks")
|
|
|
|
(make sequence
|
|
|
|
(process-children))
|
|
|
|
(next-match)))
|
2001-07-12 03:40:31 +02:00
|
|
|
|
2001-03-04 19:05:19 +01:00
|
|
|
(define %body-start-indent%
|
|
|
|
0pi)
|
1998-06-30 10:52:15 +02:00
|
|
|
|
2001-04-09 22:35:47 +02:00
|
|
|
(define (book-titlepage-verso-elements)
|
|
|
|
(list (normalize "title")
|
|
|
|
(normalize "subtitle")
|
|
|
|
(normalize "corpauthor")
|
|
|
|
(normalize "authorgroup")
|
|
|
|
(normalize "author")
|
|
|
|
(normalize "editor")
|
|
|
|
(normalize "edition")
|
|
|
|
(normalize "pubdate")
|
|
|
|
(normalize "copyright")
|
|
|
|
(normalize "abstract")
|
|
|
|
(normalize "legalnotice")
|
|
|
|
(normalize "revhistory")
|
|
|
|
(normalize "isbn")))
|
|
|
|
|
2000-10-08 21:15:06 +02:00
|
|
|
;; Norm's stylesheets are smart about working out what sort of
|
|
|
|
;; object to display. But this bites us. Since we know that the
|
|
|
|
;; first item is going to be displayable, always use that.
|
|
|
|
(define (find-displayable-object objlist notlist extlist)
|
|
|
|
(let loop ((nl objlist))
|
|
|
|
(if (node-list-empty? nl)
|
|
|
|
(empty-node-list)
|
|
|
|
(let* ((objdata (node-list-filter-by-gi
|
|
|
|
(children (node-list-first nl))
|
|
|
|
(list (normalize "videodata")
|
|
|
|
(normalize "audiodata")
|
|
|
|
(normalize "imagedata"))))
|
|
|
|
(filename (data-filename objdata))
|
|
|
|
(extension (file-extension filename))
|
|
|
|
(notation (attribute-string (normalize "format") objdata)))
|
|
|
|
(node-list-first nl)))))
|
|
|
|
|
|
|
|
;; When selecting a filename to use, don't append the default
|
|
|
|
;; extension, instead, just use the bare filename, and let TeX
|
|
|
|
;; work it out. jadetex will use the .eps file, while pdfjadetex
|
|
|
|
;; will use the .png file automatically.
|
|
|
|
(define (graphic-file filename)
|
|
|
|
(let ((ext (file-extension filename)))
|
|
|
|
(if (or tex-backend ;; TeX can work this out itself
|
|
|
|
(not filename)
|
|
|
|
(not %graphic-default-extension%)
|
|
|
|
(member ext %graphic-extensions%))
|
|
|
|
filename
|
|
|
|
(string-append filename "." %graphic-default-extension%))))
|
|
|
|
|
2001-02-20 20:09:50 +01:00
|
|
|
;; Including bitmaps in the PS and PDF output tends to scale them
|
|
|
|
;; horribly. The solution is to scale them down by 50%.
|
|
|
|
;;
|
|
|
|
;; You could do this with 'imagedata scale="50"' in the source,
|
|
|
|
;; but that will affect all the output formats that we use (because
|
|
|
|
;; there is only one 'imagedata' per image).
|
|
|
|
;;
|
|
|
|
;; Solution is to have the authors include the "FORMAT" attribute,
|
|
|
|
;; set to PNG or EPS as appropriate, but to omit the extension.
|
|
|
|
;; If we're using the tex-backend, and the FORMAT is PNG, and the
|
|
|
|
;; author hasn't already set a scale, then set scale to 0.5.
|
|
|
|
;; Otherwise, use the supplied scale, or 1, as appropriate.
|
|
|
|
(define ($graphic$ fileref
|
|
|
|
#!optional (display #f) (format #f)
|
|
|
|
(scale #f) (align #f))
|
|
|
|
(let* ((graphic-format (if format format ""))
|
|
|
|
(graphic-scale (if scale
|
|
|
|
(/ (string->number scale) 100)
|
|
|
|
(if (and tex-backend
|
|
|
|
(equal? graphic-format "PNG"))
|
|
|
|
0.5 1)))
|
|
|
|
(graphic-align (cond ((equal? align (normalize "center"))
|
|
|
|
'center)
|
|
|
|
((equal? align (normalize "right"))
|
|
|
|
'end)
|
|
|
|
(else
|
|
|
|
'start))))
|
|
|
|
(make external-graphic
|
|
|
|
entity-system-id: (graphic-file fileref)
|
|
|
|
notation-system-id: graphic-format
|
|
|
|
scale: graphic-scale
|
|
|
|
display?: display
|
|
|
|
display-alignment: graphic-align)))
|
2003-08-20 17:40:46 +02:00
|
|
|
|
2004-07-14 11:44:30 +02:00
|
|
|
;; Display TeX and LaTeX properly by sending direct formatting
|
|
|
|
;; commands to the TeX backend.
|
|
|
|
|
|
|
|
(element application
|
|
|
|
(if (equal? "TeX" (data (current-node)))
|
|
|
|
(make formatting-instruction data:
|
|
|
|
"\\TeX{}")
|
|
|
|
(if (equal? "LaTeX" (data (current-node)))
|
|
|
|
(make formatting-instruction data:
|
|
|
|
"\\LaTeX{}")
|
|
|
|
($bold-seq$))))
|
|
|
|
|
2003-08-20 17:40:46 +02:00
|
|
|
;; The special FreeBSD version of the trademark tag handling.
|
|
|
|
;; This function was more or less taken from the DocBook DSSSL
|
|
|
|
;; stylesheets by Norman Walsh.
|
|
|
|
(element trademark
|
|
|
|
(if (show-tm-symbol? (current-node))
|
|
|
|
(make sequence
|
|
|
|
($charseq$)
|
|
|
|
(cond
|
|
|
|
((equal? (attribute-string "class") (normalize "copyright"))
|
|
|
|
(literal "\copyright-sign;"))
|
|
|
|
((equal? (attribute-string "class") (normalize "registered"))
|
|
|
|
(literal "\registered-sign;"))
|
|
|
|
((equal? (attribute-string "class") (normalize "service"))
|
|
|
|
($ss-seq$ + (literal "SM")))
|
|
|
|
(else
|
|
|
|
(literal "\trade-mark-sign;"))))
|
|
|
|
($charseq$)))
|
|
|
|
|
|
|
|
;; Make the trademark functions think print output has chunks.
|
|
|
|
(define (chunk-parent nd)
|
|
|
|
(sgml-root-element nd))
|
|
|
|
|
2001-01-08 13:40:52 +01:00
|
|
|
]]>
|
|
|
|
|
|
|
|
<![ %output.print.pdf; [
|
2000-10-08 21:15:06 +02:00
|
|
|
|
1998-12-20 21:33:49 +01:00
|
|
|
]]>
|
|
|
|
|
1999-08-23 23:02:01 +02:00
|
|
|
<!-- Both sets of stylesheets ..................................... -->
|
|
|
|
|
|
|
|
(define %section-autolabel%
|
|
|
|
#t)
|
1999-04-04 19:08:20 +02:00
|
|
|
|
2001-09-08 00:26:45 +02:00
|
|
|
(define %label-preface-sections%
|
|
|
|
#f)
|
|
|
|
|
1999-04-04 19:08:20 +02:00
|
|
|
(define %may-format-variablelist-as-table%
|
|
|
|
#f)
|
|
|
|
|
|
|
|
(define %indent-programlisting-lines%
|
2003-04-19 13:39:30 +02:00
|
|
|
#f)
|
1999-04-04 19:08:20 +02:00
|
|
|
|
|
|
|
(define %indent-screen-lines%
|
2003-04-19 13:39:30 +02:00
|
|
|
#f)
|
2000-02-14 02:29:17 +01:00
|
|
|
|
|
|
|
(define (article-titlepage-recto-elements)
|
|
|
|
(list (normalize "title")
|
|
|
|
(normalize "subtitle")
|
|
|
|
(normalize "corpauthor")
|
|
|
|
(normalize "authorgroup")
|
|
|
|
(normalize "author")
|
|
|
|
(normalize "releaseinfo")
|
|
|
|
(normalize "copyright")
|
|
|
|
(normalize "pubdate")
|
|
|
|
(normalize "revhistory")
|
|
|
|
(normalize "legalnotice")
|
|
|
|
(normalize "abstract")))
|
|
|
|
|
2000-10-08 21:15:06 +02:00
|
|
|
(define %admon-graphics%
|
|
|
|
;; Use graphics in admonitions?
|
|
|
|
#f)
|
|
|
|
|
|
|
|
(define %admon-graphics-path%
|
|
|
|
;; Path to admonition images
|
|
|
|
"./imagelib/admon/")
|
|
|
|
|
|
|
|
(define ($admon-graphic$ #!optional (nd (current-node)))
|
|
|
|
;; Admonition graphic file
|
|
|
|
(string-append %admon-graphics-path% (case-fold-down (gi nd)) ".png"))
|
|
|
|
|
2003-11-14 22:17:46 +01:00
|
|
|
(define %show-all-trademark-symbols%
|
|
|
|
;; Show all the trademark symbols, not just the required
|
|
|
|
;; symbols.
|
|
|
|
#f)
|
|
|
|
|
1998-06-30 10:52:15 +02:00
|
|
|
<!-- Slightly deeper customisations -->
|
|
|
|
|
2001-08-10 01:18:34 +02:00
|
|
|
<!-- We would like the author attributions to show up in line
|
|
|
|
with the section they refer to. Authors who made the same
|
|
|
|
contribution should be listed in a single <authorgroup> and
|
|
|
|
only one of the <author> elements should contain a <contrib>
|
|
|
|
element that describes what the whole authorgroup was
|
|
|
|
responsible for. For example:
|
|
|
|
|
2001-08-14 07:22:57 +02:00
|
|
|
<chapterinfo>
|
2001-08-10 01:18:34 +02:00
|
|
|
<authorgroup>
|
|
|
|
<author>
|
|
|
|
<firstname>Bob</firstname>
|
|
|
|
<surname>Jones</surname>
|
|
|
|
<contrib>Contributed by </contrib>
|
|
|
|
</author>
|
|
|
|
<author>
|
|
|
|
<firstname>Sarah</firstname>
|
|
|
|
<surname>Lee</surname>
|
|
|
|
</author>
|
|
|
|
</authorgroup>
|
|
|
|
</chapterinfo>
|
|
|
|
|
|
|
|
Would show up as "Contributed by Bob Jones and Sarah Lee". Each
|
2002-11-20 20:41:10 +01:00
|
|
|
authorgroup shows up as a separate sentence. -->
|
2001-08-10 01:18:34 +02:00
|
|
|
|
|
|
|
|
2001-07-17 04:22:29 +02:00
|
|
|
(element chapterinfo
|
|
|
|
(process-children))
|
2001-07-21 04:29:59 +02:00
|
|
|
(element sect1info
|
|
|
|
(process-children))
|
|
|
|
(element sect2info
|
|
|
|
(process-children))
|
2001-08-10 01:18:34 +02:00
|
|
|
(element sect3info
|
|
|
|
(process-children))
|
|
|
|
(element sect4info
|
|
|
|
(process-children))
|
|
|
|
(element sect5info
|
|
|
|
(process-children))
|
2001-07-17 04:22:29 +02:00
|
|
|
(element (chapterinfo authorgroup author)
|
2001-08-10 01:18:34 +02:00
|
|
|
(literal (author-list-string)))
|
2001-07-21 04:29:59 +02:00
|
|
|
(element (sect1info authorgroup author)
|
2001-08-10 01:18:34 +02:00
|
|
|
(literal (author-list-string)))
|
2001-07-21 04:29:59 +02:00
|
|
|
(element (sect2info authorgroup author)
|
2001-08-10 01:18:34 +02:00
|
|
|
(literal (author-list-string)))
|
|
|
|
(element (sect3info authorgroup author)
|
|
|
|
(literal (author-list-string)))
|
|
|
|
(element (sect4info authorgroup author)
|
|
|
|
(literal (author-list-string)))
|
|
|
|
(element (sect5info authorgroup author)
|
|
|
|
(literal (author-list-string)))
|
|
|
|
|
|
|
|
(define (custom-authorgroup)
|
2001-08-09 02:28:10 +02:00
|
|
|
($italic-seq$
|
2001-08-10 01:18:34 +02:00
|
|
|
(make sequence
|
|
|
|
(process-node-list (select-elements (descendants (current-node))
|
|
|
|
(normalize "contrib")))
|
|
|
|
(process-children)
|
|
|
|
(literal ". "))))
|
|
|
|
|
|
|
|
(element (chapterinfo authorgroup)
|
|
|
|
(custom-authorgroup))
|
2001-07-21 04:29:59 +02:00
|
|
|
(element (sect1info authorgroup)
|
2001-08-10 01:18:34 +02:00
|
|
|
(custom-authorgroup))
|
2001-07-21 04:29:59 +02:00
|
|
|
(element (sect2info authorgroup)
|
2001-08-10 01:18:34 +02:00
|
|
|
(custom-authorgroup))
|
|
|
|
(element (sect3info authorgroup)
|
|
|
|
(custom-authorgroup))
|
|
|
|
(element (sect4info authorgroup)
|
|
|
|
(custom-authorgroup))
|
|
|
|
(element (sect5info authorgroup)
|
|
|
|
(custom-authorgroup))
|
2001-07-17 04:22:29 +02:00
|
|
|
|
2001-08-14 07:18:06 +02:00
|
|
|
<!-- I want things marked up with 'sgmltag' eg.,
|
|
|
|
|
|
|
|
<para>You can use <sgmltag>para</sgmltag> to indicate
|
|
|
|
paragraphs.</para>
|
|
|
|
|
|
|
|
to automatically have the opening and closing braces inserted,
|
|
|
|
and it should be in a mono-spaced font. -->
|
|
|
|
|
1998-06-30 10:52:15 +02:00
|
|
|
(element sgmltag ($mono-seq$
|
|
|
|
(make sequence
|
|
|
|
(literal "<")
|
|
|
|
(process-children)
|
|
|
|
(literal ">"))))
|
|
|
|
|
2000-07-25 20:23:45 +02:00
|
|
|
<!-- Add double quotes around <errorname> text. -->
|
|
|
|
|
|
|
|
(element errorname
|
|
|
|
(make sequence
|
|
|
|
<![ %output.html; [ (literal "``") ]]>
|
|
|
|
($mono-seq$ (process-children))
|
|
|
|
<![ %output.html; [ (literal "''") ]]>
|
|
|
|
))
|
|
|
|
|
1998-06-30 10:52:15 +02:00
|
|
|
<!-- John Fieber's 'instant' translation specification had
|
|
|
|
'<command>' rendered in a mono-space font, and '<application>'
|
|
|
|
rendered in bold.
|
|
|
|
|
|
|
|
Norm's stylesheet doesn't do this (although '<command>' is
|
|
|
|
rendered in bold).
|
|
|
|
|
|
|
|
Configure the stylesheet to behave more like John's. -->
|
|
|
|
|
|
|
|
(element command ($mono-seq$))
|
2001-07-25 01:09:25 +02:00
|
|
|
(element envar ($mono-seq$))
|
1998-06-30 10:52:15 +02:00
|
|
|
|
1998-12-05 01:38:14 +01:00
|
|
|
<!-- Warnings and cautions are put in boxed tables to make them stand
|
|
|
|
out. The same effect can be better achieved using CSS or similar,
|
|
|
|
so have them treated the same as <important>, <note>, and <tip>
|
|
|
|
-->
|
|
|
|
(element warning ($admonition$))
|
|
|
|
(element (warning title) (empty-sosofo))
|
|
|
|
(element (warning para) ($admonpara$))
|
|
|
|
(element (warning simpara) ($admonpara$))
|
|
|
|
(element caution ($admonition$))
|
|
|
|
(element (caution title) (empty-sosofo))
|
|
|
|
(element (caution para) ($admonpara$))
|
|
|
|
(element (caution simpara) ($admonpara$))
|
|
|
|
|
1998-06-30 10:52:15 +02:00
|
|
|
<!-- Tell the stylesheet about our local customisations -->
|
2001-09-13 09:34:57 +02:00
|
|
|
|
|
|
|
(element hostid
|
|
|
|
(if %hyphenation%
|
|
|
|
(urlwrap)
|
|
|
|
($mono-seq$)))
|
1998-06-30 10:52:15 +02:00
|
|
|
(element username ($mono-seq$))
|
2001-05-22 05:32:17 +02:00
|
|
|
(element groupname ($mono-seq$))
|
1998-06-30 10:52:15 +02:00
|
|
|
(element devicename ($mono-seq$))
|
|
|
|
(element maketarget ($mono-seq$))
|
|
|
|
(element makevar ($mono-seq$))
|
|
|
|
|
2000-10-28 23:14:44 +02:00
|
|
|
<!-- Override generate-anchor. This is used to generate a unique ID for
|
|
|
|
each element that can be linked to. The element-id function calls
|
|
|
|
this one if there's no ID attribute that it can use. Normally, we
|
|
|
|
would just use the current element number. However, if it's a
|
|
|
|
a question then use the question's number, as determined by the
|
|
|
|
question-answer-label function.
|
|
|
|
|
|
|
|
This generates anchors of the form "Qx.y.", where x.y is the
|
|
|
|
question label. This will probably break if question-answer-label
|
|
|
|
is changed to generate something that might be the same for two
|
|
|
|
different questions (for example, if question numbering restarts
|
|
|
|
for each qandaset. -->
|
|
|
|
(define (generate-anchor #!optional (nd (current-node)))
|
|
|
|
(cond
|
|
|
|
((equal? (gi nd) (normalize "question"))
|
|
|
|
(string-append "Q" (question-answer-label)))
|
|
|
|
(else
|
|
|
|
(string-append "AEN" (number->string (all-element-number nd))))))
|
2001-05-20 19:30:44 +02:00
|
|
|
|
|
|
|
(define (xref-biblioentry target)
|
|
|
|
(let* ((abbrev (node-list-first
|
|
|
|
(node-list-filter-out-pis (children target))))
|
|
|
|
(label (attribute-string (normalize "xreflabel") target)))
|
|
|
|
|
|
|
|
(if biblio-xref-title
|
|
|
|
(let* ((citetitles (select-elements (descendants target)
|
|
|
|
(normalize "citetitle")))
|
|
|
|
(titles (select-elements (descendants target)
|
|
|
|
(normalize "title")))
|
|
|
|
(isbn (select-elements (descendants target)
|
|
|
|
(normalize "isbn")))
|
|
|
|
(publisher (select-elements (descendants target)
|
|
|
|
(normalize "publishername")))
|
|
|
|
(title (if (node-list-empty? citetitles)
|
|
|
|
(node-list-first titles)
|
|
|
|
(node-list-first citetitles))))
|
|
|
|
(with-mode xref-title-mode
|
|
|
|
(make sequence
|
|
|
|
(process-node-list title))))
|
|
|
|
(if biblio-number
|
|
|
|
(make sequence
|
|
|
|
(literal "[" (number->string (bibentry-number target)) "]"))
|
|
|
|
(if label
|
|
|
|
(make sequence
|
|
|
|
(literal "[" label "]"))
|
|
|
|
(if (equal? (gi abbrev) (normalize "abbrev"))
|
|
|
|
(make sequence
|
|
|
|
(process-node-list abbrev))
|
|
|
|
(make sequence
|
|
|
|
(literal "[" (id target) "]"))))))))
|
The problem is with nested links; quite frankly, they don't work.
This isn't normally an issue because no one in their right mind will
stick a <link> inside another <link>. However, we have entities which
create links, such as &man.*;, &a.*;, etc. It's nice to be able to
use these inside links. To deal with this..
Introduce a create-link procedure which will be used to replace (make
element gi: "A" ...) constructs. This procedure creates a link as
specified only if the can-link-here procecure (described below)
returns #t. If the latter returns #f, it will print the link text
without the link.
The (also new) can-link-here procedure returns #t if it determines
that it's okay to make a link in the current context, and #f
otherwise. Currently, it does its check by figuring out whether the
current context is within a <title> or <question> tag. This is not
ideal because it doesn't catch all cases, but it's a lot better than
nothing. As the other cases are discovered, this procedure can be
modified.
2001-06-03 01:02:13 +02:00
|
|
|
|
|
|
|
<!-- The (create-link) procedure should be used by all FreeBSD
|
|
|
|
stylesheets to create links. It calls (can-link-here) to
|
|
|
|
determine whether it's okay to make a link in the current
|
|
|
|
position.
|
|
|
|
|
|
|
|
This check is necessary because links aren't allowed in,
|
|
|
|
for example, <question> tags since the latter cause links
|
|
|
|
to be created by themselves. Obviously, nested links lead
|
|
|
|
to all kinds of evil. This normally wouldn't be a problem
|
|
|
|
since no one in their right mind will put a <ulink> or
|
|
|
|
<link> in a <question>, but it comes up when someone uses,
|
|
|
|
say, a man page entity (e.g., &man.ls.1;); the latter may
|
|
|
|
cause a link to be created, but its use inside a <question>
|
|
|
|
is perfectly legal.
|
|
|
|
|
|
|
|
The (can-link-here) routine isn't perfect; in fact, it's a
|
|
|
|
hack and an ugly one at that. Ideally, it would detect if
|
|
|
|
the currect output would wind up in an <a> tag and return
|
|
|
|
#f if that's the case. Slightly less ideally it would
|
|
|
|
check the current mode and return #f if, say, we're
|
|
|
|
currently in TOC mode. Right now, it makes a best guess
|
|
|
|
attempt at guessing which tags might cause links to be
|
|
|
|
generated. -->
|
|
|
|
(define (can-link-here)
|
|
|
|
(cond ((has-ancestor-member? (current-node)
|
|
|
|
'("TITLE" "QUESTION")) #f)
|
|
|
|
(#t #t)))
|
|
|
|
|
|
|
|
(define (create-link attrlist target)
|
|
|
|
(if (can-link-here)
|
|
|
|
(make element gi: "A"
|
|
|
|
attributes: attrlist
|
|
|
|
target)
|
|
|
|
target))
|
2003-08-20 17:40:46 +02:00
|
|
|
|
|
|
|
;; Standard boolean XNOR (NOT Exclusive OR).
|
|
|
|
(define (xnor x y)
|
|
|
|
(or (and x y)
|
|
|
|
(and (not x) (not y))))
|
|
|
|
|
|
|
|
;; Standard boolean XOR (Exclusive OR).
|
|
|
|
(define (xor x y)
|
|
|
|
(not (xnor x y)))
|
|
|
|
|
|
|
|
;; Determine if a given node is in a title.
|
|
|
|
(define (is-in-title? node)
|
|
|
|
(has-ancestor-member? node (list (normalize "title"))))
|
|
|
|
|
|
|
|
;; Number of references to a trademark before the current
|
|
|
|
;; reference in each chunk. Trademarks in title tags, and
|
|
|
|
;; trademarks in normal text (actually just text that is not in
|
|
|
|
;; title tags) are counted separately.
|
|
|
|
(define ($chunk-trademark-number$ trademark)
|
|
|
|
(let* ((trademarks (select-elements
|
|
|
|
(descendants (chunk-parent trademark))
|
|
|
|
(normalize "trademark"))))
|
|
|
|
(let loop ((nl trademarks) (num 1))
|
|
|
|
(if (node-list-empty? nl)
|
|
|
|
num
|
|
|
|
(if (node-list=? (node-list-first nl) trademark)
|
|
|
|
num
|
|
|
|
(if (and (string=? (data trademark)
|
|
|
|
(data (node-list-first nl)))
|
|
|
|
(xnor (is-in-title? trademark)
|
|
|
|
(is-in-title? (node-list-first nl))))
|
|
|
|
(loop (node-list-rest nl) (+ num 1))
|
|
|
|
(loop (node-list-rest nl) num)))))))
|
|
|
|
|
|
|
|
;; Determine if we should show a trademark symbol. Either in
|
2003-09-14 15:11:43 +02:00
|
|
|
;; first occurrence in the proper context, if the role
|
|
|
|
;; attribute is set to force, or if %show-all-trademark-symbols%
|
|
|
|
;; is set to true.
|
2003-08-20 17:40:46 +02:00
|
|
|
(define (show-tm-symbol? trademark)
|
2003-09-14 15:11:43 +02:00
|
|
|
(or %show-all-trademark-symbols%
|
|
|
|
(= ($chunk-trademark-number$ trademark) 1)
|
2003-08-20 17:40:46 +02:00
|
|
|
(equal? (attribute-string (normalize "role") trademark) "force")))
|
|
|
|
|
1998-06-30 10:52:15 +02:00
|
|
|
</style-specification-body>
|
|
|
|
</style-specification>
|
2001-05-20 19:30:44 +02:00
|
|
|
|
1998-12-20 21:33:49 +01:00
|
|
|
<external-specification id="docbook" document="docbook.dsl">
|
1998-06-30 10:52:15 +02:00
|
|
|
</style-sheet>
|