docbook: Modified ldp.dsl to all role=strong in a doc
Subject:
Modified ldp.dsl to all role=strong in a doc
From:
Dan York ####@####.####
Date:
10 Jan 2001 15:31:51 -0000
Message-Id: <3A5C804C.F49BCC7A@e-smith.com>
Folks,
FYI, I've been working on a (non-LDP) document in DocBook and using
the ldp.dsl file because I like some of the formatting changes that
have been introduced. However, in my document, I needed to make some
words bold (to match the style of the pre-DocBook doc). Since I couldn't
figure out any other way to do this with either Norman's regular DSSSL
files or the ldp.dsl file, I introduced a "role" attribute to the
<emphasis> tag, so that now the following works:
<para>This text has some <emphasis role="strong">bold text</emphasis>
and some <emphasis>italic text</emphasis> when converted to HTML. </para>
The relevant lines I added to the bottom of the HTML section of my
"ldp.dsl" file were:
(element emphasis
(if (equal? (attribute-string "role") "strong")
(make element gi: "STRONG" (process-children))
(make element gi: "EM" (process-children))))
I have not (yet) customized the print part of the style sheet, mostly
because I've been working on the online documents right now, and also
because I just haven't had time to read up on how to change the print
attributes.
Anyway, I thought I'd mention it here. I've also attached my version
of the altered ldp.dsl file. I don't know if this is something that
others want to incorporate.
This works for me, but I do wonder - did I miss something in
the rest of the DSSSL stylesheets? Is there some other way to make
something bold?
Regards,
Dan
--
Dan York, Director of Training ####@####.####
Ph: +1-613-751-4401 Mobile: +1-613-263-4312 Fax: +1-613-564-7739
e-smith, inc. 150 Metcalfe St., Suite 1500, Ottawa,ON K2P 1P1 Canada
http://www.e-smith.com/ open source, open mind
<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY % html "IGNORE">
<![%html;[
<!ENTITY % print "IGNORE">
<!ENTITY docbook.dsl SYSTEM "/usr/lib/sgml/stylesheets/docbook/html/docbook.dsl" CDATA dsssl>
]]>
<!ENTITY % print "INCLUDE">
<![%print;[
<!ENTITY docbook.dsl SYSTEM "/usr/lib/sgml/stylesheets/docbook/print/docbook.dsl" CDATA dsssl>
]]>
]>
<style-sheet>
<style-specification id="print" use="docbook">
<style-specification-body>
;; ==============================
;; customize the print stylesheet
;; ==============================
(declare-characteristic preserve-sdata?
;; this is necessary because right now jadetex does not understand
;; symbolic entities, whereas things work well with numeric entities.
"UNREGISTERED::James Clark//Characteristic::preserve-sdata?"
#f)
(define %generate-article-toc%
;; Should a Table of Contents be produced for Articles?
#t)
(define (toc-depth nd)
2)
(define %generate-article-titlepage-on-separate-page%
;; Should the article title page be on a separate page?
#t)
(define %section-autolabel%
;; Are sections enumerated?
#t)
(define %footnote-ulinks%
;; Generate footnotes for ULinks?
#f)
(define %bop-footnotes%
;; Make "bottom-of-page" footnotes?
#f)
(define %body-start-indent%
;; Default indent of body text
0pi)
(define %para-indent-firstpara%
;; First line start-indent for the first paragraph
0pt)
(define %para-indent%
;; First line start-indent for paragraphs (other than the first)
0pt)
(define %block-start-indent%
;; Extra start-indent for block-elements
0pt)
(define formal-object-float
;; Do formal objects float?
#t)
(define %hyphenation%
;; Allow automatic hyphenation?
#t)
(define %admon-graphics%
;; Use graphics in admonitions?
#f)
</style-specification-body>
</style-specification>
<!--
;; ===================================================
;; customize the html stylesheet; borrowed from Cygnus
;; at http://sourceware.cygnus.com/ (cygnus-both.dsl)
;; ===================================================
-->
<style-specification id="html" use="docbook">
<style-specification-body>
(declare-characteristic preserve-sdata?
;; this is necessary because right now jadetex does not understand
;; symbolic entities, whereas things work well with numeric entities.
"UNREGISTERED::James Clark//Characteristic::preserve-sdata?"
#f)
(define %generate-legalnotice-link%
;; put the legal notice in a separate file
#t)
(define %admon-graphics-path%
;; use graphics in admonitions, set their
"../images/")
(define %admon-graphics%
#f)
(define %funcsynopsis-decoration%
;; make funcsynopsis look pretty
#t)
(define %html-ext%
".html")
(define %generate-article-toc%
;; Should a Table of Contents be produced for Articles?
;; If true, a Table of Contents will be generated for each 'Article'.
#t)
(define %generate-part-toc%
#t)
(define %generate-article-titlepage%
#t)
(define (chunk-skip-first-element-list)
;; forces the Table of Contents on separate page
'())
(define %root-filename%
;; The filename of the root HTML document (e.g, "index").
"index")
(define %shade-verbatim%
#t)
(define %use-id-as-filename%
;; Use ID attributes as name for component HTML files?
#t)
(define %graphic-default-extension%
"gif")
(define %section-autolabel%
;; For enumerated sections (1.1, 1.1.1, 1.2, etc.)
#t)
(define (toc-depth nd)
;; more depth, 2 levels, to toc, instead of flat hierarchy
2)
;; DY - Nov 2000 - added text below to make role=strong equate to bold
(element emphasis
(if (equal? (attribute-string "role") "strong")
(make element gi: "STRONG" (process-children))
(make element gi: "EM" (process-children))))
</style-specification-body>
</style-specification>
<external-specification id="docbook" document="docbook.dsl">
</style-sheet>