This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Chunk everything in a DocBook book? (Repost)


I sent this a while back and never received a response. Does anyone
have any ideas?



I am using the Modular DocBook stylesheets to produce HTML from a book
I starting to write using DocBook. In most chapters I anticipate
having two levels of <section>, and I'd like to have both appear in
the automatically generated table of contents and to have all appear
as separate chunks. Currently (v1.54) the DSSSL outputs a chunk only
for the top-level section in each chapter. I can get separate chunks
for each section by changing the definition of chunk in dbchunk.dsl as
follows: 

(define (chunk? #!optional (nd (current-node)))
  ;; 1. The (sgml-root-element) is always a chunk.
  ;; 2. If nochunks is #t or the dbhtml PI on the root element 
  ;;    specifies chunk='no', then the root element is the only
  ;;    chunk.
  ;; 3. Otherwise, elements in the chunk-element-list are chunks
  ;;    unless they're combined with their parent.
  ;; 4. Except for bibliographys, which are only chunks if they
  ;;    occur in book.
  ;; 5. And except for sections, which are only chunks if they
  ;;    are at the top level.
  ;;
  (let* ((notchunk (or (and (equal? (gi nd) (normalize "bibliography"))
			    (not (equal? (gi (parent nd)) (normalize "book"))))
		       (and (equal? (gi nd) (normalize "section"))
			    (equal? (gi (parent nd)) (normalize "section")))))
	 (maybechunk (not notchunk)))
    (if (node-list=? nd (sgml-root-element))
	#t
	(if (or nochunks
		(equal? (dbhtml-value (sgml-root-element) "chunk") "no"))
	    #f
	    (if (member (gi nd) (chunk-element-list))
;; HERE'S the change
                #t
;;		(if (combined-chunk? nd)
;;		    #f
;;		    maybechunk)
		#f)))))

This puts out the appropriate chunks, but the second-level sections
don't appear in the table of contents and the footer navigation is
incorrect. Can I do what I want with <section> or do I need to use
<sect1> and <sect2> and add <sect2> to chunk-element-list?

Kent




-- 
Kent E. Holsinger                kent@darwin.eeb.uconn.edu
                                 http://darwin.eeb.uconn.edu
-- Department of Ecology & Evolutionary Biology          
-- University of Connecticut, U-3043                                       
-- Storrs, CT   06269-3043                                               

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]