Improved build infrastructure which will provide better page rendering
experience. Submitted by: "intron" <intron intron ac> Obtained from: The FreeBSD Simplified Chinese Project
This commit is contained in:
parent
35f45479a9
commit
ce1cb7e0d5
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=25468
2 changed files with 433 additions and 330 deletions
|
@ -1,170 +0,0 @@
|
|||
<!-- $FreeBSD$ -->
|
||||
<?xml version="1.0" encoding="US-ASCII"?>
|
||||
<!-- The translation override for docbook stock file -->
|
||||
|
||||
<!ENTITY Abstract "\U-6458;\U-8981;">
|
||||
<!ENTITY abstract "\U-6458;\U-8981;">
|
||||
<!ENTITY Answer "\U-7B54;\U-FF1A;">
|
||||
<!ENTITY answer "\U-7B54;\U-FF1A;">
|
||||
<!ENTITY Appendix "\U-9644;\U-5F55;">
|
||||
<!ENTITY appendix "\U-9644;\U-5F55;">
|
||||
<!ENTITY Article "\U-6587;\U-7AE0;">
|
||||
<!ENTITY article "\U-6587;\U-7AE0;">
|
||||
<!ENTITY Bibliography "\U-53C2;\U-8003;\U-4E66;\U-76EE;">
|
||||
<!ENTITY bibliography "\U-53C2;\U-8003;\U-4E66;\U-76EE;">
|
||||
<!ENTITY Book "\U-4E66;">
|
||||
<!ENTITY book "\U-4E66;">
|
||||
<!ENTITY CAUTION "\U-5C0F;\U-5FC3;">
|
||||
<!ENTITY Caution "\U-5C0F;\U-5FC3;">
|
||||
<!ENTITY caution "\U-5C0F;\U-5FC3;">
|
||||
<!ENTITY Chapter "\U-7AE0;">
|
||||
<!ENTITY chapter "\U-7AE0;">
|
||||
<!ENTITY Colophon "Colophon">
|
||||
<!ENTITY colophon "Colophon">
|
||||
<!ENTITY Copyright "\U-7248;\U-6743;">
|
||||
<!ENTITY copyright "\U-7248;\U-6743;">
|
||||
<!ENTITY Dedication "\U-9898;\U-8BCD;">
|
||||
<!ENTITY dedication "\U-9898;\U-8BCD;">
|
||||
<!ENTITY Edition "\U-7248;">
|
||||
<!ENTITY edition "\U-7248;">
|
||||
<!ENTITY Equation "\U-516C;\U-5F0F;">
|
||||
<!ENTITY equation "\U-516C;\U-5F0F;">
|
||||
<!ENTITY Example "\U-4F8B;">
|
||||
<!ENTITY example "\U-4F8B;">
|
||||
<!ENTITY Figure "\U-56FE;">
|
||||
<!ENTITY figure "\U-56FE;">
|
||||
<!ENTITY Glossary "\U-672F;\U-8BED;\U-8868;">
|
||||
<!ENTITY glossary "\U-672F;\U-8BED;\U-8868;">
|
||||
<!ENTITY GlossSee "\U-89C1;">
|
||||
<!ENTITY glosssee "\U-89C1;">
|
||||
<!ENTITY GlossSeeAlso "\U-53C2;\U-89C1;">
|
||||
<!ENTITY glossseealso "\U-53C2;\U-89C1;">
|
||||
<!ENTITY IMPORTANT "\U-91CD;\U-8981;">
|
||||
<!ENTITY important "\U-91CD;\U-8981;">
|
||||
<!ENTITY Important "\U-91CD;\U-8981;">
|
||||
<!ENTITY Index "\U-7D22;\U-5F15;">
|
||||
<!ENTITY index "\U-7D22;\U-5F15;">
|
||||
<!ENTITY ISBN "ISBN">
|
||||
<!ENTITY isbn "ISBN">
|
||||
<!ENTITY LegalNotice "\U-6CD5;\U-5F8B;\U-901A;\U-544A;">
|
||||
<!ENTITY legalnotice "\U-6CD5;\U-5F8B;\U-901A;\U-544A;">
|
||||
<!ENTITY MsgAud "\U-53D7;\U-4F17;">
|
||||
<!ENTITY msgaud "\U-53D7;\U-4F17;">
|
||||
<!ENTITY MsgLevel "\U-7EA7;\U-522B;">
|
||||
<!ENTITY msglevel "\U-7EA7;\U-522B;">
|
||||
<!ENTITY MsgOrig "\U-51FA;\U-5904;">
|
||||
<!ENTITY msgorig "\U-51FA;\U-5904;">
|
||||
<!ENTITY NOTE "\U-6CE8;\U-610F;">
|
||||
<!ENTITY Note "\U-6CE8;\U-610F;">
|
||||
<!ENTITY note "\U-6CE8;\U-610F;">
|
||||
<!ENTITY numbercn "\U-7B2C;">
|
||||
<!ENTITY Part "\U-90E8;\U-5206;">
|
||||
<!ENTITY part "\U-90E8;\U-5206;">
|
||||
<!ENTITY Preface "\U-524D;\U-8A00;">
|
||||
<!ENTITY preface "\U-524D;\U-8A00;">
|
||||
<!ENTITY Procedure "\U-8FC7;\U-7A0B;">
|
||||
<!ENTITY procedure "\U-8FC7;\U-7A0B;">
|
||||
<!ENTITY ProductionSet "Production">
|
||||
<!ENTITY PubDate "\U-51FA;\U-7248;\U-65E5;\U-671F;">
|
||||
<!ENTITY pubdate "\U-51FA;\U-7248;\U-65E5;\U-671F;">
|
||||
<!ENTITY Published "\U-51FA;\U-7248;\U-65B9;">
|
||||
<!ENTITY published "\U-51FA;\U-7248;\U-65B9;">
|
||||
<!ENTITY Qandadiv "\U-8D28;\U-4FDD;">
|
||||
<!ENTITY qandadiv "\U-8D28;\U-4FDD;">
|
||||
<!ENTITY Question "\U-95EE;\U-FF1A;">
|
||||
<!ENTITY question "\U-95EE;\U-FF1A;">
|
||||
<!ENTITY RefEntry "">
|
||||
<!ENTITY refentry "">
|
||||
<!ENTITY Reference "\U-53C2;\U-8003;">
|
||||
<!ENTITY reference "\U-53C2;\U-8003;">
|
||||
<!ENTITY RefName "\U-540D;\U-79F0;">
|
||||
<!ENTITY refname "\U-540D;\U-79F0;">
|
||||
<!ENTITY RefSection "">
|
||||
<!ENTITY refsection "">
|
||||
<!ENTITY RefSynopsisDiv "\U-5927;\U-7EB2;">
|
||||
<!ENTITY refsynopsisdiv "\U-5927;\U-7EB2;">
|
||||
<!ENTITY RevHistory "\U-4FEE;\U-8BA2;\U-5386;\U-53F2;">
|
||||
<!ENTITY revhistory "\U-4FEE;\U-8BA2;\U-5386;\U-53F2;">
|
||||
<!ENTITY revision "\U-4FEE;\U-8BA2;">
|
||||
<!ENTITY Revision "\U-4FEE;\U-8BA2;">
|
||||
<!ENTITY sect1 "\U-8282;">
|
||||
<!ENTITY sect2 "\U-8282;">
|
||||
<!ENTITY sect3 "\U-8282;">
|
||||
<!ENTITY sect4 "\U-8282;">
|
||||
<!ENTITY sect5 "\U-8282;">
|
||||
<!ENTITY section "\U-8282;">
|
||||
<!ENTITY Section "\U-8282;">
|
||||
<!ENTITY see "\U-89C1;">
|
||||
<!ENTITY See "\U-89C1;">
|
||||
<!ENTITY seealso "\U-53C2;\U-89C1;">
|
||||
<!ENTITY Seealso "\U-53C2;\U-89C1;">
|
||||
<!ENTITY SeeAlso "\U-53C2;\U-89C1;">
|
||||
<!ENTITY set "Set">
|
||||
<!ENTITY Set "Set">
|
||||
<!ENTITY setindex "Set Index">
|
||||
<!ENTITY SetIndex "Set Index">
|
||||
<!ENTITY Sidebar "">
|
||||
<!ENTITY sidebar "sidebar">
|
||||
<!ENTITY step "\U-6B65;\U-9AA4;">
|
||||
<!ENTITY Step "\U-6B65;\U-9AA4;">
|
||||
<!ENTITY Table "\U-8868;">
|
||||
<!ENTITY table "\U-8868;">
|
||||
<!ENTITY tip "\U-63D0;\U-793A;">
|
||||
<!ENTITY TIP "\U-63D0;\U-793A;">
|
||||
<!ENTITY Tip "\U-63D0;\U-793A;">
|
||||
<!ENTITY Warning "\U-8B66;\U-544A;">
|
||||
<!ENTITY warning "\U-8B66;\U-544A;">
|
||||
<!ENTITY WARNING "\U-8B66;\U-544A;">
|
||||
<!ENTITY and "\U-548C;">
|
||||
<!ENTITY by "\U-7531;">
|
||||
<!ENTITY called "\U-79F0;\U-4E3A;">
|
||||
<!ENTITY Edited "\U-7F16;\U-8F91;\U-65F6;\U-95F4;">
|
||||
<!ENTITY edited "\U-7F16;\U-8F91;\U-65F6;\U-95F4;">
|
||||
<!ENTITY Editedby "\U-7F16;\U-8F91;\U-8005;">
|
||||
<!ENTITY editedby "\U-7F16;\U-8F91;\U-8005;">
|
||||
<!ENTITY in "\U-4E8E;">
|
||||
<!ENTITY lastlistcomma "">
|
||||
<!ENTITY listcomma "\U-3001;">
|
||||
<!ENTITY nonexistantelement "\U-4E0D;\U-5B58;\U-5728;\U-7684;\U-5143;\U-7D20;">
|
||||
<!ENTITY notes "\U-5907;\U-6CE8;">
|
||||
<!ENTITY Notes "\U-5907;\U-6CE8;">
|
||||
<!ENTITY Pgs "\U-9875;">
|
||||
<!ENTITY pgs "\U-9875;">
|
||||
<!ENTITY Revisedby "\U-4FEE;\U-8BA2;\U-8005;\U-FF1A;">
|
||||
<!ENTITY revisedby "\U-4FEE;\U-8BA2;\U-8005;\U-FF1A;">
|
||||
<!ENTITY TableNotes "\U-8868;\U-6CE8;">
|
||||
<!ENTITY tablenotes "\U-8868;\U-6CE8;">
|
||||
<!ENTITY TableofContents "\U-76EE;\U-5F55;">
|
||||
<!ENTITY tableofcontents "\U-76EE;\U-5F55;">
|
||||
<!ENTITY the "">
|
||||
<!ENTITY unexpectedelementname "\U-672A;\U-9884;\U-671F;\U-7684;\U-540D;\U-79F0;">
|
||||
<!ENTITY unsupported "\U-4E0D;\U-652F;\U-6301;">
|
||||
<!ENTITY xrefto "xref to">
|
||||
<!ENTITY listofequations "\U-516C;\U-5F0F;\U-6E05;\U-5355;">
|
||||
<!ENTITY ListofEquations "\U-516C;\U-5F0F;\U-6E05;\U-5355;">
|
||||
<!ENTITY ListofExamples "\U-8303;\U-4F8B;\U-6E05;\U-5355;">
|
||||
<!ENTITY listofexamples "\U-8303;\U-4F8B;\U-6E05;\U-5355;">
|
||||
<!ENTITY ListofFigures "\U-63D2;\U-56FE;\U-6E05;\U-5355;">
|
||||
<!ENTITY listoffigures "\U-63D2;\U-56FE;\U-6E05;\U-5355;">
|
||||
<!ENTITY ListofProcedures "\U-8FC7;\U-7A0B;\U-6E05;\U-5355;">
|
||||
<!ENTITY listofprocedures "\U-8FC7;\U-7A0B;\U-6E05;\U-5355;">
|
||||
<!ENTITY listoftables "\U-8868;\U-683C;\U-6E05;\U-5355;">
|
||||
<!ENTITY ListofTables "\U-8868;\U-683C;\U-6E05;\U-5355;">
|
||||
<!ENTITY ListofUnknown "\U-672A;\U-77E5;\U-6E05;\U-5355;">
|
||||
<!ENTITY listofunknown "\U-672A;\U-77E5;\U-6E05;\U-5355;">
|
||||
<!ENTITY nav-home "\U-8D77;\U-59CB;\U-9875;">
|
||||
<!ENTITY nav-next "\U-4E0B;\U-4E00;\U-9875;">
|
||||
<!ENTITY nav-next-sibling "\U-5FEB;\U-8FDB;">
|
||||
<!ENTITY nav-prev "\U-4E0A;\U-4E00;\U-9875;">
|
||||
<!ENTITY nav-prev-sibling "\U-5FEB;\U-9000;">
|
||||
<!ENTITY nav-up "\U-4E0A;\U-4E00;\U-7EA7;">
|
||||
<!ENTITY nav-toc "\U-76EE;\U-5F55;">
|
||||
<!ENTITY Draft "\U-8349;\U-7A3F;">
|
||||
<!ENTITY above "above">
|
||||
<!ENTITY below "below">
|
||||
<!ENTITY sectioncalled "\U-4E00;\U-8282;">
|
||||
<!ENTITY lowercase.alpha "abcdefghijklmnopqrstuvwxyz">
|
||||
<!ENTITY uppercase.alpha "ABCDEFGHIJKLMNOPQRSTUVWXYZ">
|
||||
<!ENTITY hyphenation-character "-">
|
||||
<!ENTITY hyphenation-push-character-count "2">
|
||||
<!ENTITY hyphenation-remain-character-count "2">
|
|
@ -1,173 +1,446 @@
|
|||
<!-- $FreeBSD$ -->
|
||||
<!--
|
||||
DocBook Language Specific Style Sheet for Localization (Simplified Chinese).
|
||||
|
||||
Original Revision: 1.20
|
||||
$FreeBSD$
|
||||
-->
|
||||
|
||||
<!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 % lang.zhcn.dsssl "IGNORE">
|
||||
<!ENTITY % zhcn.words
|
||||
PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//ZHCN"
|
||||
"dbl1zhcn.ent">
|
||||
%zhcn.words;
|
||||
|
||||
<!ENTITY % freebsd.l10n PUBLIC "-//FreeBSD//ENTITIES DocBook Language Specific Entities//EN">
|
||||
%freebsd.l10n;
|
||||
|
||||
<!ENTITY % output.html "IGNORE">
|
||||
<!ENTITY % output.print "IGNORE">
|
||||
<!ENTITY % output.print.niceheaders "IGNORE">
|
||||
]>
|
||||
|
||||
<style-sheet>
|
||||
<style-specification use="docbook">
|
||||
<style-specification-body>
|
||||
<![ %lang.zhcn.dsssl; [
|
||||
(define %gentext-language% "zhcn")
|
||||
<!-- HTML only .................................................... -->
|
||||
|
||||
<![ %output.html; [
|
||||
|
||||
<!-- Generate links to HTML man pages -->
|
||||
(define %refentry-xref-link% #t)
|
||||
|
||||
(define ($email-footer$)
|
||||
(make sequence
|
||||
(make element gi: "p"
|
||||
attributes: (list (list "align" "center"))
|
||||
(make element gi: "small"
|
||||
(literal "本文档和其它文档可从这里下载:")
|
||||
(create-link
|
||||
(list (list "HREF" "ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/"))
|
||||
(literal "ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/"))
|
||||
(literal ".")))
|
||||
(make element gi: "p"
|
||||
attributes: (list (list "align" "center"))
|
||||
(make element gi: "small"
|
||||
(literal "如果对于FreeBSD有问题,请先阅读")
|
||||
(create-link
|
||||
(list (list "HREF" "http://www.FreeBSD.org/docs.html"))
|
||||
(literal "文档"))
|
||||
(literal ",如不能解决再联系<")
|
||||
(create-link
|
||||
(list (list "HREF" "mailto:questions@FreeBSD.org"))
|
||||
(literal "questions@FreeBSD.org"))
|
||||
(literal ">.")
|
||||
(make empty-element gi: "br")
|
||||
(literal "关于本文档的问题请发信联系 <")
|
||||
(create-link (list (list "HREF" "mailto:doc@FreeBSD.org"))
|
||||
(literal "doc@FreeBSD.org"))
|
||||
(literal ">.")))))
|
||||
|
||||
;; 以下几个定义可产生出汉语习惯的章节号。
|
||||
;; 很奇怪,不知道定义在
|
||||
;; /usr/local/share/sgml/docbook/dsssl/modular/common/dbl1zhcn.dsl
|
||||
;; 中的zhcn-xref-strings为什么不起作用。
|
||||
;; 用Google可以搜索到其它语言翻译者此类抱怨的文章。
|
||||
|
||||
;; toc-entry
|
||||
;; 修改自 /usr/local/share/sgml/docbook/dsssl/modular/html/dbautoc.dsl
|
||||
;; 在目录中显示:
|
||||
;; 第 xx 章
|
||||
;; 第 xx.xx 节
|
||||
|
||||
(define (toc-entry tocentry)
|
||||
(make element gi: "DT"
|
||||
(make sequence
|
||||
(if (equal? (element-label tocentry) "")
|
||||
(empty-sosofo)
|
||||
(make sequence
|
||||
(literal "第")
|
||||
(literal (element-label tocentry))
|
||||
(literal (gentext-element-name tocentry))
|
||||
(literal (gentext-label-title-sep
|
||||
(gi tocentry)))))
|
||||
|
||||
;; If the tocentry isn't in its own
|
||||
;; chunk, don't make a link...
|
||||
(if (and #f (not (chunk? tocentry)))
|
||||
(element-title-sosofo tocentry)
|
||||
(make element gi: "A"
|
||||
attributes: (list
|
||||
(list "HREF"
|
||||
(href-to tocentry)))
|
||||
(element-title-sosofo tocentry)))
|
||||
|
||||
;; Maybe annotate...
|
||||
(if (and %annotate-toc%
|
||||
(equal? (gi tocentry) (normalize "refentry")))
|
||||
(make sequence
|
||||
(dingbat-sosofo "nbsp");
|
||||
(dingbat-sosofo "em-dash");
|
||||
(dingbat-sosofo "nbsp");
|
||||
(toc-annotation tocentry))
|
||||
(empty-sosofo)))))
|
||||
|
||||
;; lot-entry
|
||||
;; 修改自 /usr/local/share/sgml/docbook/dsssl/modular/html/dbautoc.dsl
|
||||
;; 在表格清单中显示:
|
||||
;; 表 xx-xx. ....
|
||||
;; 在插图清单中显示:
|
||||
;; 图 xx-xx. ....
|
||||
;; 在范例清单中显示:
|
||||
;; 例 xx-xx. ....
|
||||
|
||||
|
||||
(define (lot-entry tocentry)
|
||||
(make element gi: "DT"
|
||||
(make sequence
|
||||
(if (equal? (element-label tocentry) "")
|
||||
(empty-sosofo)
|
||||
(make sequence
|
||||
(literal (gentext-element-name tocentry))
|
||||
(literal (element-label tocentry))
|
||||
(literal (gentext-label-title-sep
|
||||
(gi tocentry)))))
|
||||
|
||||
;; If the tocentry isn't in its own
|
||||
;; chunk, don't make a link...
|
||||
(if (and #f (not (chunk? tocentry)))
|
||||
(element-title-sosofo tocentry)
|
||||
(make element gi: "A"
|
||||
attributes: (list
|
||||
(list "HREF"
|
||||
(href-to tocentry)))
|
||||
(element-title-sosofo tocentry))))))
|
||||
|
||||
;; 修改自 /usr/local/share/sgml/docbook/dsssl/modular/html/dbttlpg.dsl
|
||||
;; 使每部分的开头页(称为Title Page)显示“第xx部分”
|
||||
|
||||
(mode part-titlepage-recto-mode
|
||||
(element title
|
||||
(let ((division (ancestor-member (current-node) (division-element-list))))
|
||||
(make element gi: "H1"
|
||||
attributes: (list (list "CLASS" (gi)))
|
||||
(if (string=? (element-label division) "")
|
||||
(empty-sosofo)
|
||||
(literal "第"
|
||||
(element-label division)
|
||||
(gentext-element-name division)
|
||||
(gentext-label-title-sep (gi division))))
|
||||
(with-mode title-mode
|
||||
(process-children)))))
|
||||
)
|
||||
|
||||
|
||||
;; 修改自/usr/local/share/sgml/docbook/dsssl/modular/html/dbcompon.dsl
|
||||
;; 使每章第一页上显示“第xx章”
|
||||
|
||||
(define ($component-title$ #!optional (titlegi "H1") (subtitlegi "H2"))
|
||||
(let* ((info (cond
|
||||
((equal? (gi) (normalize "article"))
|
||||
(node-list-filter-by-gi (children (current-node))
|
||||
(list (normalize "artheader")
|
||||
(normalize "articleinfo"))))
|
||||
((or
|
||||
(equal? (gi) (normalize "appendix"))
|
||||
(equal? (gi) (normalize "bibliography"))
|
||||
(equal? (gi) (normalize "chapter"))
|
||||
(equal? (gi) (normalize "glossary"))
|
||||
(equal? (gi) (normalize "index"))
|
||||
(equal? (gi) (normalize "preface"))
|
||||
(equal? (gi) (normalize "reference"))
|
||||
(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")))
|
||||
(titles (if (node-list-empty? parent-titles)
|
||||
(select-elements exp-children (normalize "title"))
|
||||
parent-titles))
|
||||
(parent-subttl (select-elements (children (current-node)) (normalize "subtitle")))
|
||||
(subtitles (if (node-list-empty? parent-subttl)
|
||||
(select-elements exp-children (normalize "subtitle"))
|
||||
parent-subttl)))
|
||||
(make sequence
|
||||
(make element gi: titlegi
|
||||
(make sequence
|
||||
(make element gi: "A"
|
||||
attributes: (list (list "NAME" (element-id)))
|
||||
(empty-sosofo))
|
||||
(if (and %chapter-autolabel%
|
||||
(or (equal? (gi) (normalize "chapter"))
|
||||
(equal? (gi) (normalize "appendix"))))
|
||||
(literal "第"
|
||||
(element-label (current-node))
|
||||
(gentext-element-name-space (gi))
|
||||
(gentext-label-title-sep (gi)))
|
||||
(empty-sosofo))
|
||||
(if (node-list-empty? titles)
|
||||
(element-title-sosofo) ;; get a default!
|
||||
(with-mode title-mode
|
||||
(process-node-list titles)))))
|
||||
(if (node-list-empty? subtitles)
|
||||
(empty-sosofo)
|
||||
(with-mode subtitle-mode
|
||||
(make element gi: subtitlegi
|
||||
(process-node-list subtitles)))))))
|
||||
|
||||
;; 修改自/usr/local/share/sgml/docbook/dsssl/modular/html/dbnavig.dsl
|
||||
;; 使页眉上显示“第xx章”等等。
|
||||
|
||||
(define (nav-context-sosofo elemnode)
|
||||
(let* ((component (ancestor-member elemnode
|
||||
(append (book-element-list)
|
||||
(division-element-list)
|
||||
(component-element-list))))
|
||||
(context-text (inherited-dbhtml-value elemnode "context-text")))
|
||||
(if (and context-text (not (string=? context-text "")))
|
||||
(literal context-text)
|
||||
(if (equal? (element-label component) "")
|
||||
(make sequence
|
||||
(element-title-sosofo component))
|
||||
(make sequence
|
||||
;; Special case. This is a bit of a hack.
|
||||
;; I need to revisit this aspect of
|
||||
;; appendixes.
|
||||
(if (and (equal? (gi component) (normalize "appendix"))
|
||||
(or (equal? (gi elemnode) (normalize "sect1"))
|
||||
(equal? (gi elemnode) (normalize "section")))
|
||||
(equal? (gi (parent component)) (normalize "article")))
|
||||
(element-label-sosofo component)
|
||||
(make sequence
|
||||
(literal "第")
|
||||
(element-label-sosofo component)
|
||||
(literal (gentext-element-name-space (gi component)))
|
||||
))
|
||||
(literal (gentext-label-title-sep (gi component)))
|
||||
(element-title-sosofo component))))))
|
||||
|
||||
|
||||
]]>
|
||||
|
||||
<!-- Convert " ... " to “ ... ” in the HTML output. -->
|
||||
<!-- Work around the issue that the current DSL doesn't translate -->
|
||||
(define (gentext-en-nav-prev prev)
|
||||
(make sequence (literal "上一页")))
|
||||
(define (gentext-en-nav-next next)
|
||||
(make sequence (literal "下一页")))
|
||||
(define (gentext-en-nav-up up)
|
||||
(make sequence (literal "向上")))
|
||||
(define (gentext-en-nav-home home)
|
||||
(make sequence (literal "首页")))
|
||||
(define (en-xref-strings)
|
||||
(list (list (normalize "appendix") (if %chapter-autolabel%
|
||||
"附录 %n"
|
||||
"附录 %t"))
|
||||
(list (normalize "article") (string-append %gentext-en-start-quote%
|
||||
"%t"
|
||||
%gentext-en-end-quote%))
|
||||
(list (normalize "bibliography") "%t")
|
||||
(list (normalize "book") "%t")
|
||||
(list (normalize "chapter") (if %chapter-autolabel%
|
||||
"第 %n 章"
|
||||
"%t 这章"))
|
||||
(list (normalize "equation") "公式 %n")
|
||||
(list (normalize "example") "例 %n")
|
||||
(list (normalize "figure") "图 %n")
|
||||
(list (normalize "glossary") "%t")
|
||||
(list (normalize "index") "%t")
|
||||
(list (normalize "listitem") "%n")
|
||||
(list (normalize "part") "第 %n 部分")
|
||||
(list (normalize "preface") "%t")
|
||||
(list (normalize "procedure") "过程 %n, %t")
|
||||
(list (normalize "reference") "参考文献 %n, %t")
|
||||
(list (normalize "section") (if %section-autolabel%
|
||||
"第 %n 节"
|
||||
"%t 小节"))
|
||||
(list (normalize "sect1") (if %section-autolabel%
|
||||
"第 %n 节"
|
||||
"%t 小节"))
|
||||
(list (normalize "sect2") (if %section-autolabel%
|
||||
"第 %n 节"
|
||||
"%t 小节"))
|
||||
(list (normalize "sect3") (if %section-autolabel%
|
||||
"第 %n 节"
|
||||
"%t 小节"))
|
||||
(list (normalize "sect4") (if %section-autolabel%
|
||||
"第 %n 节"
|
||||
"%t 小节"))
|
||||
(list (normalize "sect5") (if %section-autolabel%
|
||||
"第 %n 节"
|
||||
"%t 小节"))
|
||||
(list (normalize "simplesect") (if %section-autolabel%
|
||||
"第 %n 节"
|
||||
"%t 小节"))
|
||||
(list (normalize "sidebar") "提示 %t")
|
||||
(list (normalize "step") "第 %n 步")
|
||||
(list (normalize "table") "表 %n")))
|
||||
(define (en-element-name)
|
||||
(list (list (normalize "abstract") "&Abstract;")
|
||||
(list (normalize "answer") "&Answer;")
|
||||
(list (normalize "appendix") "&Appendix;")
|
||||
(list (normalize "article") "&Article;")
|
||||
(list (normalize "bibliography") "&Bibliography;")
|
||||
(list (normalize "book") "&Book;")
|
||||
(list (normalize "calloutlist") "")
|
||||
(list (normalize "caution") "&Caution;")
|
||||
(list (normalize "chapter") "&numbercn;")
|
||||
(list (normalize "copyright") "&Copyright;")
|
||||
(list (normalize "dedication") "&Dedication;")
|
||||
(list (normalize "edition") "&Edition;")
|
||||
(list (normalize "equation") "&Equation;")
|
||||
(list (normalize "example") "&Example;")
|
||||
(list (normalize "figure") "&Figure;")
|
||||
(list (normalize "glossary") "&Glossary;")
|
||||
(list (normalize "glosssee") "&GlossSee;")
|
||||
(list (normalize "glossseealso") "&GlossSeeAlso;")
|
||||
(list (normalize "important") "&Important;")
|
||||
(list (normalize "index") "&Index;")
|
||||
(list (normalize "colophon") "&Colophon;")
|
||||
(list (normalize "setindex") "&SetIndex;")
|
||||
(list (normalize "isbn") "&isbn;")
|
||||
(list (normalize "legalnotice") "&LegalNotice;")
|
||||
(list (normalize "msgaud") "&MsgAud;")
|
||||
(list (normalize "msglevel") "&MsgLevel;")
|
||||
(list (normalize "msgorig") "&MsgOrig;")
|
||||
(list (normalize "note") "&Note;")
|
||||
(list (normalize "part") "&Part;")
|
||||
(list (normalize "preface") "&Preface;")
|
||||
(list (normalize "procedure") "&Procedure;")
|
||||
(list (normalize "pubdate") "&Published;")
|
||||
(list (normalize "question") "&Question;")
|
||||
(list (normalize "refentry") "&RefEntry;")
|
||||
(list (normalize "reference") "&Reference;")
|
||||
(list (normalize "refname") "&RefName;")
|
||||
(list (normalize "revhistory") "&RevHistory;")
|
||||
(list (normalize "refsect1") "&RefSection;")
|
||||
(list (normalize "refsect2") "&RefSection;")
|
||||
(list (normalize "refsect3") "&RefSection;")
|
||||
(list (normalize "refsynopsisdiv") "&RefSynopsisDiv;")
|
||||
(list (normalize "revision") "&Revision;")
|
||||
(list (normalize "sect1") "&numbercn;")
|
||||
(list (normalize "sect2") "&numbercn;")
|
||||
(list (normalize "sect3") "&numbercn;")
|
||||
(list (normalize "sect4") "&numbercn;")
|
||||
(list (normalize "sect5") "&numbercn;")
|
||||
(list (normalize "section") "&numbercn;")
|
||||
(list (normalize "simplesect") "&numbercn;")
|
||||
(list (normalize "seeie") "&See;")
|
||||
(list (normalize "seealsoie") "&Seealso;")
|
||||
(list (normalize "set") "&Set;")
|
||||
(list (normalize "sidebar") "&Sidebar;")
|
||||
(list (normalize "step") "&step;")
|
||||
(list (normalize "table") "&Table;")
|
||||
(list (normalize "tip") "&Tip;")
|
||||
(list (normalize "toc") "&TableofContents;")
|
||||
(list (normalize "warning") "&Warning;")))
|
||||
(define (en-label-title-sep)
|
||||
(list (list (normalize "abstract") ": ")
|
||||
(list (normalize "answer") " ")
|
||||
(list (normalize "appendix") ". ")
|
||||
(list (normalize "caution") "")
|
||||
(list (normalize "chapter") " &Chapter;. ")
|
||||
(list (normalize "equation") ". ")
|
||||
(list (normalize "example") ". ")
|
||||
(list (normalize "figure") ". ")
|
||||
(list (normalize "footnote") ". ")
|
||||
(list (normalize "glosssee") ": ")
|
||||
(list (normalize "glossseealso") ": ")
|
||||
(list (normalize "important") ": ")
|
||||
(list (normalize "note") ": ")
|
||||
(list (normalize "orderedlist") ". ")
|
||||
(list (normalize "part") ". ")
|
||||
(list (normalize "procedure") ". ")
|
||||
(list (normalize "prefix") ". ")
|
||||
(list (normalize "question") " ")
|
||||
(list (normalize "refentry") "")
|
||||
(list (normalize "reference") ". ")
|
||||
(list (normalize "refsect1") ". ")
|
||||
(list (normalize "refsect2") ". ")
|
||||
(list (normalize "refsect3") ". ")
|
||||
(list (normalize "sect1") " &Section;. ")
|
||||
(list (normalize "sect2") " &Section;. ")
|
||||
(list (normalize "sect3") " &Section;. ")
|
||||
(list (normalize "sect4") " &Section;. ")
|
||||
(list (normalize "sect5") " &Section;. ")
|
||||
(list (normalize "section") " &Section;. ")
|
||||
(list (normalize "simplesect") " &Section;. ")
|
||||
(list (normalize "seeie") " ")
|
||||
(list (normalize "seealsoie") " ")
|
||||
(list (normalize "step") ". ")
|
||||
(list (normalize "table") ". ")
|
||||
(list (normalize "tip") ": ")
|
||||
(list (normalize "warning") ": ")))
|
||||
<!-- More aesthetically pleasing chapter headers for print output -->
|
||||
|
||||
<![ %output.print.niceheaders; [
|
||||
|
||||
(define niceheader-rule-spacebefore (* (HSIZE 5) %head-before-factor%))
|
||||
(define niceheader-rule-spaceafter 0pt)
|
||||
|
||||
(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 6)
|
||||
line-spacing: (* (HSIZE 6) %line-spacing-factor%)
|
||||
; space-before: (* (HSIZE 5) %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))))
|
||||
|
||||
(if (equal? (gi) (normalize "index"))
|
||||
(empty-sosofo)
|
||||
(make rule
|
||||
length: %body-width%
|
||||
display-alignment: 'start
|
||||
space-before: niceheader-rule-spacebefore
|
||||
space-after: niceheader-rule-spaceafter
|
||||
line-thickness: 0.5pt)))))
|
||||
|
||||
(element authorgroup
|
||||
(empty-sosofo))
|
||||
|
||||
]]>
|
||||
|
||||
<!-- Print only ................................................... -->
|
||||
|
||||
<![ %output.print; [
|
||||
|
||||
(define minimal-section-labels #f)
|
||||
(define max-section-level-labels
|
||||
(if minimal-section-labels 3 10))
|
||||
|
||||
(define ($section-title$)
|
||||
(let* ((sect (current-node))
|
||||
(info (info-element))
|
||||
(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 sect) (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")))
|
||||
(renderas (inherited-attribute-string (normalize "renderas") sect))
|
||||
(hlevel ;; the apparent section level;
|
||||
(if renderas ;; if not real section level,
|
||||
(string->number ;; then get the apparent level
|
||||
(substring renderas 4 5)) ;; from "renderas",
|
||||
(SECTLEVEL))) ;; else use the real level
|
||||
(hs (HSIZE (- 4 hlevel))))
|
||||
|
||||
(make sequence
|
||||
(make paragraph
|
||||
font-family-name: %title-font-family%
|
||||
font-weight: (if (< hlevel 5) 'bold 'medium)
|
||||
font-posture: (if (< hlevel 5) 'upright 'italic)
|
||||
font-size: hs
|
||||
line-spacing: (* hs %line-spacing-factor%)
|
||||
space-before: (* hs %head-before-factor%)
|
||||
space-after: (if (node-list-empty? subtitles)
|
||||
(* hs %head-after-factor%)
|
||||
0pt)
|
||||
start-indent: (if (or (>= hlevel 3)
|
||||
(member (gi) (list (normalize "refsynopsisdiv")
|
||||
(normalize "refsect1")
|
||||
(normalize "refsect2")
|
||||
(normalize "refsect3"))))
|
||||
%body-start-indent%
|
||||
0pt)
|
||||
first-line-start-indent: 0pt
|
||||
quadding: %section-title-quadding%
|
||||
keep-with-next?: #t
|
||||
heading-level: (if %generate-heading-level% (+ hlevel 1) 0)
|
||||
;; SimpleSects are never AUTO numbered...they aren't hierarchical
|
||||
(if (> hlevel (- max-section-level-labels 1))
|
||||
(empty-sosofo)
|
||||
(if (string=? (element-label (current-node)) "")
|
||||
(empty-sosofo)
|
||||
(literal (element-label (current-node))
|
||||
(gentext-label-title-sep (gi sect)))))
|
||||
(element-title-sosofo (current-node)))
|
||||
(with-mode section-title-mode
|
||||
(process-node-list subtitles))
|
||||
($section-info$ info))))
|
||||
|
||||
]]>
|
||||
|
||||
<!-- Both sets of stylesheets ..................................... -->
|
||||
|
||||
(define (local-zhcn-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") " ")
|
||||
))
|
||||
|
||||
<!-- 等同于 <book lang="zh_cn"> -->
|
||||
|
||||
(define %default-language% "zh_cn")
|
||||
|
||||
|
||||
|
||||
</style-specification-body>
|
||||
</style-specification>
|
||||
|
||||
|
|
Loading…
Reference in a new issue