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>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# $FreeBSD: doc/share/mk/doc.docbook.mk,v 1.37 2001/07/12 00:24:59 dd Exp $
|
||||
# $FreeBSD: doc/share/mk/doc.docbook.mk,v 1.38 2001/07/14 18:04:06 chris Exp $
|
||||
#
|
||||
# This include file <doc.docbook.mk> handles building and installing of
|
||||
# DocBook documentation in the FreeBSD Documentation Project.
|
||||
|
@ -49,6 +49,11 @@
|
|||
# CSS_SHEET Full path to a CSS stylesheet suitable for DocBook.
|
||||
# Default is ${DOC_PREFIX}/share/misc/docbook.css
|
||||
#
|
||||
# NICE_HEADERS If defined, customized chapter headers will be created
|
||||
# that you may find more aesthetically pleasing. Note
|
||||
# that this option only effects print output formats for
|
||||
# Enlish language books.
|
||||
#
|
||||
# Documents should use the += format to access these.
|
||||
#
|
||||
|
||||
|
@ -206,6 +211,10 @@ CLEANFILES+= ${DOC}.${_curformat}.${_curcomp}
|
|||
.endfor
|
||||
.endif
|
||||
|
||||
.if defined(NICE_HEADERS)
|
||||
JADEOPTS+= -ioutput.print.niceheaders
|
||||
.endif
|
||||
|
||||
#
|
||||
# Index generation
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!-- $FreeBSD: doc/share/sgml/freebsd.dsl,v 1.34 2001/06/24 02:46:40 murray Exp $ -->
|
||||
<!-- $FreeBSD: doc/share/sgml/freebsd.dsl,v 1.35 2001/07/12 01:40:31 murray Exp $ -->
|
||||
|
||||
<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
|
||||
<!ENTITY % output.html "IGNORE">
|
||||
|
@ -202,7 +202,7 @@
|
|||
(if (string=? (gi nd) (normalize "book"))
|
||||
3
|
||||
1))
|
||||
|
||||
|
||||
(element programlisting
|
||||
(if (and (equal? (attribute-string (normalize "role")) "pgpkey")
|
||||
(not withpgpkeys))
|
||||
|
@ -388,12 +388,6 @@
|
|||
(element (caution para) ($admonpara$))
|
||||
(element (caution simpara) ($admonpara$))
|
||||
|
||||
(define (local-en-label-title-sep)
|
||||
(list
|
||||
(list (normalize "warning") ": ")
|
||||
(list (normalize "caution") ": ")
|
||||
))
|
||||
|
||||
<!-- Tell the stylesheet about our local customisations -->
|
||||
|
||||
(element hostid ($mono-seq$))
|
||||
|
|
Loading…
Reference in a new issue