Introduce a 'NICE_HEADERS' tuneable knob that creates customized
chapter headers that you may find more aesthetically pleasing than the rather spartan chapter headers in Norm's print stylesheets. This option only effects print output formats for English language books. Also move the local-en-label-title-sep customization from share/sgml to en_blah/share/sgml since the best values for this customization depend on the locale. This changes (make FORMATS=ps) : Chapter 7. Users and Basic Account Management 7.1. Synopsis into (make NICE_HEADERS=1 FORMATS=ps) : Chapter 7 /Users and Basic Account Management/ 7.1 Synopsis More work needs to be done for the NICE_HEADERS case to enhance the output, but I think its an improvement.
This commit is contained in:
parent
060fb0d1c5
commit
213a66a8d3
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=9919
3 changed files with 130 additions and 10 deletions
|
@ -1,14 +1,16 @@
|
|||
<!-- $FreeBSD: doc/en_US.ISO_8859-1/share/sgml/freebsd.dsl,v 1.8 2001/06/02 23:06:17 dd Exp $ -->
|
||||
<!-- $FreeBSD: doc/en_US.ISO8859-1/share/sgml/freebsd.dsl,v 1.9 2001/06/03 00:07:27 dd Exp $ -->
|
||||
|
||||
<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
|
||||
<!ENTITY freebsd.dsl PUBLIC "-//FreeBSD//DOCUMENT DocBook Language Neutral Stylesheet//EN" CDATA DSSSL>
|
||||
<!ENTITY % output.html "IGNORE">
|
||||
<!ENTITY % output.print "IGNORE">
|
||||
<!ENTITY % output.print.niceheaders "IGNORE">
|
||||
]>
|
||||
|
||||
<style-sheet>
|
||||
<style-specification use="docbook">
|
||||
<style-specification-body>
|
||||
<!-- HTML only .................................................... -->
|
||||
|
||||
<![ %output.html; [
|
||||
(define ($email-footer$)
|
||||
|
@ -55,6 +57,121 @@
|
|||
(string-append "http://www.FreeBSD.org/cgi/man.cgi?query="
|
||||
refentrytitle "&" "sektion=" manvolnum))
|
||||
]]>
|
||||
|
||||
<!-- More aesthetically pleasing chapter headers for print output -->
|
||||
|
||||
<![ %output.print.niceheaders; [
|
||||
|
||||
(define ($component-title$)
|
||||
(let* ((info (cond
|
||||
((equal? (gi) (normalize "appendix"))
|
||||
(select-elements (children (current-node)) (normalize "docinfo")))
|
||||
((equal? (gi) (normalize "article"))
|
||||
(node-list-filter-by-gi (children (current-node))
|
||||
(list (normalize "artheader")
|
||||
(normalize "articleinfo"))))
|
||||
((equal? (gi) (normalize "bibliography"))
|
||||
(select-elements (children (current-node)) (normalize "docinfo")))
|
||||
((equal? (gi) (normalize "chapter"))
|
||||
(select-elements (children (current-node)) (normalize "docinfo")))
|
||||
((equal? (gi) (normalize "dedication"))
|
||||
(empty-node-list))
|
||||
((equal? (gi) (normalize "glossary"))
|
||||
(select-elements (children (current-node)) (normalize "docinfo")))
|
||||
((equal? (gi) (normalize "index"))
|
||||
(select-elements (children (current-node)) (normalize "docinfo")))
|
||||
((equal? (gi) (normalize "preface"))
|
||||
(select-elements (children (current-node)) (normalize "docinfo")))
|
||||
((equal? (gi) (normalize "reference"))
|
||||
(select-elements (children (current-node)) (normalize "docinfo")))
|
||||
((equal? (gi) (normalize "setindex"))
|
||||
(select-elements (children (current-node)) (normalize "docinfo")))
|
||||
(else
|
||||
(empty-node-list))))
|
||||
(exp-children (if (node-list-empty? info)
|
||||
(empty-node-list)
|
||||
(expand-children (children info)
|
||||
(list (normalize "bookbiblio")
|
||||
(normalize "bibliomisc")
|
||||
(normalize "biblioset")))))
|
||||
(parent-titles (select-elements (children (current-node)) (normalize "title")))
|
||||
(info-titles (select-elements exp-children (normalize "title")))
|
||||
(titles (if (node-list-empty? parent-titles)
|
||||
info-titles
|
||||
parent-titles))
|
||||
(subtitles (select-elements exp-children (normalize "subtitle"))))
|
||||
(make sequence
|
||||
(make paragraph
|
||||
font-family-name: %title-font-family%
|
||||
font-weight: 'bold
|
||||
font-size: (HSIZE 4)
|
||||
line-spacing: (* (HSIZE 4) %line-spacing-factor%)
|
||||
space-before: (* (HSIZE 4) %head-before-factor%)
|
||||
start-indent: 0pt
|
||||
first-line-start-indent: 0pt
|
||||
quadding: %component-title-quadding%
|
||||
heading-level: (if %generate-heading-level% 1 0)
|
||||
keep-with-next?: #t
|
||||
|
||||
(if (string=? (element-label) "")
|
||||
(empty-sosofo)
|
||||
(literal (gentext-element-name-space (current-node))
|
||||
(element-label)
|
||||
(gentext-label-title-sep (gi)))))
|
||||
(make paragraph
|
||||
font-family-name: %title-font-family%
|
||||
font-weight: 'bold
|
||||
font-posture: 'italic
|
||||
font-size: (HSIZE 4)
|
||||
line-spacing: (* (HSIZE 4) %line-spacing-factor%)
|
||||
space-before: (* (HSIZE 4) %head-before-factor%)
|
||||
start-indent: 0pt
|
||||
first-line-start-indent: 0pt
|
||||
quadding: %component-title-quadding%
|
||||
heading-level: (if %generate-heading-level% 1 0)
|
||||
keep-with-next?: #t
|
||||
|
||||
(if (node-list-empty? titles)
|
||||
(element-title-sosofo) ;; get a default!
|
||||
(with-mode component-title-mode
|
||||
(make sequence
|
||||
(process-node-list titles)))))
|
||||
|
||||
(make paragraph
|
||||
font-family-name: %title-font-family%
|
||||
font-weight: 'bold
|
||||
font-posture: 'italic
|
||||
font-size: (HSIZE 3)
|
||||
line-spacing: (* (HSIZE 3) %line-spacing-factor%)
|
||||
space-before: (* 0.5 (* (HSIZE 3) %head-before-factor%))
|
||||
space-after: (* (HSIZE 4) %head-after-factor%)
|
||||
start-indent: 0pt
|
||||
first-line-start-indent: 0pt
|
||||
quadding: %component-subtitle-quadding%
|
||||
keep-with-next?: #t
|
||||
|
||||
(with-mode component-title-mode
|
||||
(make sequence
|
||||
(process-node-list subtitles)))))))
|
||||
|
||||
]]>
|
||||
|
||||
<!-- Print only ................................................... -->
|
||||
|
||||
<!-- Both sets of stylesheets ..................................... -->
|
||||
|
||||
(define (local-en-label-title-sep)
|
||||
(list
|
||||
(list (normalize "warning") ": ")
|
||||
(list (normalize "caution") ": ")
|
||||
(list (normalize "chapter") " ")
|
||||
(list (normalize "sect1") " ")
|
||||
(list (normalize "sect2") " ")
|
||||
(list (normalize "sect3") " ")
|
||||
(list (normalize "sect4") " ")
|
||||
(list (normalize "sect5") " ")
|
||||
))
|
||||
|
||||
</style-specification-body>
|
||||
</style-specification>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue