This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
Re: DocBook markup question -- sourcecode
- From: Tammy Fox <tfox at redhat dot com>
- To: docbook at lists dot oasis-open dot org
- Date: Thu, 07 Feb 2002 15:30:05 -0500
- Subject: Re: DOCBOOK: DocBook markup question -- sourcecode
- References: <001501c1b022$1c3952e0$0201a8c0@hephaestus>
You can do this if you put the source code inside <screen> tags
and add the following to your custom stylesheet (if you are using
DSSSL):
(element tgroup
(let* ((wrapper (parent (current-node)))
(frameattr (attribute-string (normalize "frame") wrapper))
(pgwide (attribute-string (normalize "pgwide") wrapper))
(footnotes (select-elements (descendants (current-node))
(normalize "footnote")))
(border (if (equal? frameattr (normalize "none"))
'(("BORDER" "0"))
'(("BORDER" "1"))))
(bgcolor '(("BGCOLOR" "#E0E0E0")))
(width (if (equal? pgwide "1")
(list (list "WIDTH" ($table-width$)))
'()))
(head (select-elements (children (current-node)) (normalize "thead")))
(body (select-elements (children (current-node)) (normalize "tbody")))
(feet (select-elements (children (current-node)) (normalize "tfoot"))))
(make element gi: "TABLE"
attributes: (append
border
width
bgcolor
'(("CELLSPACING" "0"))
'(("CELLPADDING" "4"))
(if %cals-table-class%
(list (list "CLASS" %cals-table-class%))
'()))
(process-node-list head)
(process-node-list body)
(process-node-list feet)
(make-table-endnotes))))
;;Should verbatim items be 'shaded' with a table?
(define %shade-verbatim%
#t)
;;Define shade-verbatim attributes
(define ($shade-verbatim-attr$)
(list
(list "BORDER" "0")
(list "BGCOLOR" "#E0E0E0")
(list "WIDTH" ($table-width$))))
--
Tammy
On Thu, Feb 07, 2002 at 01:55:03PM -0800, Ben Schepens wrote:
> Is it possible to properly mark up source code in a docbook file so that
> meinproc will produce html with the source code in a 'greybar' or colored
> background?
>
> I have included 2 examples of HTML files that have the look I would like to
> get?
>
> Thanks,
> Ben Schepens
> schepens@mindspring.com