allowing CSS styling on most DocBook inline elements

Subject: allowing CSS styling on most DocBook inline elements
From: Fred Yankowski <fcy@xxxxxxx>
Date: Tue, 14 Jul 1998 09:54:07 -0500 (CDT)

I've just started using DocBook (and DSSSL, and jade -- my brain
hurts) and found that I wanted to tweak the style of the generated
HTML text for elements such as GUILABEL.  Norman Walsh's (excellent)
DocBook stylesheets translate many such elements to just a simple
untagged character sequence, but I found that it was simple to change
that to generate a SPAN element to wrap each such DocBook element,
with a CLASS attribute identifying the gi of that latter element.
I've attached my hack to this message, as a context diff.

With that patch in place, I can use a CSS stylesheet like the
following to display GUILABELs in helvetica:

	SPAN.GUILABEL  { font-family: helvetica }

It seems that DocBook inline elements that map to the HTML B, I,
and/or TT tags are already generated with similar CLASS attributes, so
my change generalizes the pattern to the many other elements that map
to a simple character sequence.

In fact, and I admit that I'm a novice and don't understand the
ramifications, it seems preferable to map *all* inline elements to
SPAN elements and use CSS to apply the desired style, rather than to
wire in generation of B, I, and TT elements.  Is it unfair to expect
CSS to be available in most browsers?  Is it too awkward to have to
pass a CSS stylesheet file along with the generated HTML file?

Fred Yankowski  fyankowski@xxxxxxxxxxxxxxx  tel: +1(630)955-3460
INTELLICORP   2443 Warrenville Rd, Ste 600, Lisle, IL 60532, USA


*** 1.1 1998/07/09 20:59:07
--- dbhtml.dsl  1998/07/09 21:00:27
*** 170,177 ****
  (define ($charseq$ #!optional (sosofo (process-children)))
!   (make sequence
!     sosofo))
  ;; ----------------------------------------------------------------------
--- 170,178 ----
  (define ($charseq$ #!optional (sosofo (process-children)))
!   (make element gi: "SPAN"
!       attributes: `(("CLASS" ,(gi)))
!       sosofo))
  ;; ----------------------------------------------------------------------

 DSSSList info and archive:

Current Thread
  • allowing CSS styling on most DocBook inline elements
    • Fred Yankowski - from mail1.ability.netby (8.8.5/8.6.12) with ESMTP id KAA18869Tue, 14 Jul 1998 10:59:52 -0400 (EDT) <=
      • Norman Walsh - from mail1.ability.netby (8.8.5/8.6.12) with ESMTP id LAA21176Tue, 14 Jul 1998 11:22:15 -0400 (EDT)