From d31c43e62fd5483de3604ef825522501eece7feb Mon Sep 17 00:00:00 2001 From: "Graydon, Tracy" Date: Fri, 31 Aug 2012 11:34:41 -0700 Subject: [PATCH 1/1] TIVI-153: Add docbook-style-dssl as dep for iputils --- BUGS | 35 + ChangeLog | 140 + README | 91 + RELEASE-NOTES.html | 34 + RELEASE-NOTES.txt | 76 + RELEASE-NOTES.xml | 126 + VERSION | 1 + WhatsNew | 372 ++ bin/ChangeLog | 58 + bin/collateindex.pl | 737 ++++ bin/collateindex.pl.1 | 214 + catalog | 53 + common/ChangeLog | 157 + common/catalog | 37 + common/cs-hack.pl | 8 + common/dbcommon.dsl | 1904 ++++++++ common/dbl10n.dsl | 1554 +++++++ common/dbl10n.ent | 361 ++ common/dbl10n.pl | 55 + common/dbl10n.template | 277 ++ common/dbl1af.dsl | 440 ++ common/dbl1af.ent | 160 + common/dbl1bg.dsl | 431 ++ common/dbl1bg.ent | 172 + common/dbl1bs.dsl | 444 ++ common/dbl1bs.ent | 172 + common/dbl1ca.dsl | 443 ++ common/dbl1ca.ent | 162 + common/dbl1cs.dsl | 443 ++ common/dbl1cs.ent | 160 + common/dbl1da.dsl | 432 ++ common/dbl1da.ent | 163 + common/dbl1de.dsl | 445 ++ common/dbl1de.ent | 169 + common/dbl1el.dsl | 445 ++ common/dbl1el.ent | 160 + common/dbl1en.dsl | 444 ++ common/dbl1en.ent | 172 + common/dbl1es.dsl | 434 ++ common/dbl1es.ent | 162 + common/dbl1et.dsl | 444 ++ common/dbl1et.ent | 160 + common/dbl1eu.dsl | 444 ++ common/dbl1eu.ent | 160 + common/dbl1fi.dsl | 444 ++ common/dbl1fi.ent | 160 + common/dbl1fr.dsl | 436 ++ common/dbl1fr.ent | 172 + common/dbl1hu.dsl | 447 ++ common/dbl1hu.ent | 160 + common/dbl1id.dsl | 608 +++ common/dbl1id.ent | 160 + common/dbl1it.dsl | 471 ++ common/dbl1it.ent | 160 + common/dbl1ja.dsl | 445 ++ common/dbl1ja.ent | 162 + common/dbl1ko.dsl | 455 ++ common/dbl1ko.ent | 158 + common/dbl1nl.dsl | 440 ++ common/dbl1nl.ent | 160 + common/dbl1nn.dsl | 445 ++ common/dbl1nn.ent | 166 + common/dbl1no.dsl | 437 ++ common/dbl1no.ent | 160 + common/dbl1null.dsl | 12 + common/dbl1pl.dsl | 434 ++ common/dbl1pl.ent | 160 + common/dbl1pt.dsl | 433 ++ common/dbl1pt.ent | 172 + common/dbl1ptbr.dsl | 434 ++ common/dbl1ptbr.ent | 162 + common/dbl1ro.dsl | 434 ++ common/dbl1ro.ent | 160 + common/dbl1ru.dsl | 446 ++ common/dbl1ru.ent | 189 + common/dbl1sk.dsl | 442 ++ common/dbl1sk.ent | 160 + common/dbl1sl.dsl | 446 ++ common/dbl1sl.ent | 160 + common/dbl1sr.dsl | 446 ++ common/dbl1sr.ent | 172 + common/dbl1sv.dsl | 448 ++ common/dbl1sv.ent | 162 + common/dbl1th.ent | 160 + common/dbl1tr.dsl | 443 ++ common/dbl1tr.ent | 172 + common/dbl1uk.dsl | 444 ++ common/dbl1uk.ent | 190 + common/dbl1xh.dsl | 444 ++ common/dbl1xh.ent | 160 + common/dbl1zhcn.dsl | 447 ++ common/dbl1zhcn.ent | 172 + common/dbl1zhtw.dsl | 447 ++ common/dbl1zhtw.ent | 159 + common/dbtable.dsl | 244 ++ contrib/html/ChangeLog | 4 + contrib/html/short-biblioentry.dsl | 30 + contrib/imagemap/ChangeLog | 4 + contrib/imagemap/imagemap.dsl | 77 + contrib/imagemap/testdoc.sgm | 29 + contrib/imagemap/testimg.jpg | Bin 0 -> 6690 bytes contrib/print/ChangeLog | 4 + contrib/print/short-biblioentry.dsl | 30 + contrib/renumberinpart/ChangeLog | 4 + contrib/renumberinpart/renumberinpart.dsl | 28 + contrib/renumberinpart/test.sgm | 19 + contrib/subdoc/ChangeLog | 5 + contrib/subdoc/book.sgm | 13 + contrib/subdoc/subdoc.dsl | 35 + contrib/subdoc/subdoc.dtd | 22 + contrib/subdoc/subdoc1.sgm | 6 + contrib/subdoc/subdoc2.sgm | 6 + contrib/subdoc/subdocbc.mod | 29 + dtds/dbdsssl/ChangeLog | 4 + dtds/dbdsssl/dbdsssl.dtd | 147 + dtds/decls/ChangeLog | 4 + dtds/decls/docbook.dcl | 106 + dtds/decls/xml.dcl | 179 + dtds/html/ChangeLog | 5 + dtds/html/ISOlat1.gml | 74 + dtds/html/catalog | 3 + dtds/html/dbhtml.dcl | 76 + dtds/html/dbhtml.dtd | 604 +++ dtds/html/test.htm | 13 + dtds/imagelib/ChangeLog | 4 + dtds/imagelib/imagelib.dtd | 62 + dtds/olink/ChangeLog | 4 + dtds/olink/olinksum.dtd | 36 + frames/ChangeLog | 5 + frames/README | 76 + frames/docbook.css | 12 + frames/docbook.js | 86 + frames/frames.dsl | 131 + frames/frames.htm | 19 + frames/navbar.htm | 31 + html/ChangeLog | 349 ++ html/XREF | 2 + html/catalog | 3 + html/dbadmon.dsl | 171 + html/dbautoc.dsl | 128 + html/dbbibl.dsl | 997 +++++ html/dbblock.dsl | 306 ++ html/dbcallou.dsl | 206 + html/dbchunk.dsl | 492 +++ html/dbcompon.dsl | 199 + html/dbdivis.dsl | 176 + html/dbefsyn.dsl | 824 ++++ html/dbfootn.dsl | 249 ++ html/dbgloss.dsl | 193 + html/dbgraph.dsl | 218 + html/dbhtml.dsl | 446 ++ html/dbindex.dsl | 374 ++ html/dbinfo.dsl | 879 ++++ html/dbinline.dsl | 312 ++ html/dblink.dsl | 433 ++ html/dblists.dsl | 435 ++ html/dblot.dsl | 24 + html/dbmath.dsl | 67 + html/dbmsgset.dsl | 42 + html/dbnavig.dsl | 1058 +++++ html/dbparam.dsl | 1723 ++++++++ html/dbpi.dsl | 62 + html/dbprocdr.dsl | 69 + html/dbqanda.dsl | 172 + html/dbrfntry.dsl | 170 + html/dbsect.dsl | 160 + html/dbsynop.dsl | 201 + html/dbtable.dsl | 494 +++ html/dbtitle.dsl | 67 + html/dbttlpg.dsl | 4588 +++++++++++++++++++ html/dbverb.dsl | 218 + html/docbook.dsl | 242 ++ html/version.dsl | 14 + images/ChangeLog | 13 + images/Make.images | 10 + images/callouts/1.eps | 284 ++ images/callouts/1.gif | Bin 0 -> 890 bytes images/callouts/1.pdf | Bin 0 -> 1454 bytes images/callouts/10.eps | 284 ++ images/callouts/10.gif | Bin 0 -> 926 bytes images/callouts/10.pdf | Bin 0 -> 1494 bytes images/callouts/2.eps | 284 ++ images/callouts/2.gif | Bin 0 -> 907 bytes images/callouts/2.pdf | Bin 0 -> 1483 bytes images/callouts/3.eps | 284 ++ images/callouts/3.gif | Bin 0 -> 914 bytes images/callouts/3.pdf | Bin 0 -> 1483 bytes images/callouts/4.eps | 284 ++ images/callouts/4.gif | Bin 0 -> 907 bytes images/callouts/4.pdf | Bin 0 -> 1482 bytes images/callouts/5.eps | 284 ++ images/callouts/5.gif | Bin 0 -> 912 bytes images/callouts/5.pdf | Bin 0 -> 1485 bytes images/callouts/6.eps | 284 ++ images/callouts/6.gif | Bin 0 -> 917 bytes images/callouts/6.pdf | Bin 0 -> 1485 bytes images/callouts/7.eps | 284 ++ images/callouts/7.gif | Bin 0 -> 903 bytes images/callouts/7.pdf | Bin 0 -> 1479 bytes images/callouts/8.eps | 284 ++ images/callouts/8.gif | Bin 0 -> 915 bytes images/callouts/8.pdf | Bin 0 -> 1487 bytes images/callouts/9.eps | 284 ++ images/callouts/9.gif | Bin 0 -> 919 bytes images/callouts/9.pdf | Bin 0 -> 1488 bytes images/callouts/ChangeLog | 13 + images/caution.eps | 553 +++ images/caution.gif | Bin 0 -> 1039 bytes images/caution.pdf | Bin 0 -> 1843 bytes images/home.eps | 551 +++ images/home.gif | Bin 0 -> 995 bytes images/home.pdf | Bin 0 -> 1768 bytes images/important.eps | 553 +++ images/important.gif | Bin 0 -> 1081 bytes images/important.pdf | Bin 0 -> 2021 bytes images/next.eps | 551 +++ images/next.gif | Bin 0 -> 964 bytes images/next.pdf | Bin 0 -> 1737 bytes images/note.eps | 296 ++ images/note.gif | Bin 0 -> 1070 bytes images/note.pdf | Bin 0 -> 1686 bytes images/prev.eps | 551 +++ images/prev.gif | Bin 0 -> 944 bytes images/prev.pdf | Bin 0 -> 1693 bytes images/tip.eps | 296 ++ images/tip.gif | Bin 0 -> 1029 bytes images/tip.pdf | Bin 0 -> 1641 bytes images/toc-blank.eps | 300 ++ images/toc-blank.gif | Bin 0 -> 95 bytes images/toc-blank.pdf | Bin 0 -> 1388 bytes images/toc-minus.eps | 283 ++ images/toc-minus.gif | Bin 0 -> 843 bytes images/toc-minus.pdf | Bin 0 -> 1376 bytes images/toc-plus.eps | 283 ++ images/toc-plus.gif | Bin 0 -> 846 bytes images/toc-plus.pdf | Bin 0 -> 1382 bytes images/up.eps | 551 +++ images/up.gif | Bin 0 -> 922 bytes images/up.pdf | Bin 0 -> 1626 bytes images/warning.eps | 553 +++ images/warning.gif | Bin 0 -> 1052 bytes images/warning.pdf | Bin 0 -> 1846 bytes lib/ChangeLog | 36 + lib/dblib.dsl | 1858 ++++++++ olink/ChangeLog | 4 + olink/olink.dsl | 175 + packaging/docbook-style-dsssl.Makefile | 46 + packaging/docbook-style-dsssl.changes | 3 + packaging/docbook-style-dsssl.spec | 89 + print/ChangeLog | 327 ++ print/XREF | 2 + print/catalog | 3 + print/dbadmon.dsl | 161 + print/dbautoc.dsl | 179 + print/dbbibl.dsl | 868 ++++ print/dbblock.dsl | 689 +++ print/dbcallou.dsl | 221 + print/dbcompon.dsl | 520 +++ print/dbdivis.dsl | 224 + print/dbefsyn.dsl | 588 +++ print/dbgloss.dsl | 117 + print/dbgraph.dsl | 134 + print/dbindex.dsl | 156 + print/dbinfo.dsl | 1012 +++++ print/dbinline.dsl | 263 ++ print/dblink.dsl | 457 ++ print/dblists.dsl | 515 +++ print/dblot.dsl | 24 + print/dbmath.dsl | 92 + print/dbmsgset.dsl | 51 + print/dbparam.dsl | 2085 +++++++++ print/dbprint.dsl | 205 + print/dbprocdr.dsl | 38 + print/dbqanda.dsl | 126 + print/dbrfntry.dsl | 215 + print/dbsect.dsl | 208 + print/dbsynop.dsl | 224 + print/dbtable.dsl | 587 +++ print/dbtitle.dsl | 52 + print/dbttlpg.dsl | 6772 +++++++++++++++++++++++++++++ print/dbverb.dsl | 222 + print/docbook.dsl | 197 + print/notoc.dsl | 29 + print/plain.dsl | 37 + print/version.dsl | 14 + 285 files changed, 75562 insertions(+) create mode 100644 BUGS create mode 100644 ChangeLog create mode 100644 README create mode 100644 RELEASE-NOTES.html create mode 100644 RELEASE-NOTES.txt create mode 100644 RELEASE-NOTES.xml create mode 100644 VERSION create mode 100644 WhatsNew create mode 100644 bin/ChangeLog create mode 100644 bin/collateindex.pl create mode 100644 bin/collateindex.pl.1 create mode 100644 catalog create mode 100644 common/ChangeLog create mode 100644 common/catalog create mode 100644 common/cs-hack.pl create mode 100644 common/dbcommon.dsl create mode 100644 common/dbl10n.dsl create mode 100644 common/dbl10n.ent create mode 100644 common/dbl10n.pl create mode 100644 common/dbl10n.template create mode 100644 common/dbl1af.dsl create mode 100644 common/dbl1af.ent create mode 100644 common/dbl1bg.dsl create mode 100644 common/dbl1bg.ent create mode 100644 common/dbl1bs.dsl create mode 100644 common/dbl1bs.ent create mode 100644 common/dbl1ca.dsl create mode 100644 common/dbl1ca.ent create mode 100644 common/dbl1cs.dsl create mode 100644 common/dbl1cs.ent create mode 100644 common/dbl1da.dsl create mode 100644 common/dbl1da.ent create mode 100644 common/dbl1de.dsl create mode 100644 common/dbl1de.ent create mode 100644 common/dbl1el.dsl create mode 100644 common/dbl1el.ent create mode 100644 common/dbl1en.dsl create mode 100644 common/dbl1en.ent create mode 100644 common/dbl1es.dsl create mode 100644 common/dbl1es.ent create mode 100644 common/dbl1et.dsl create mode 100644 common/dbl1et.ent create mode 100644 common/dbl1eu.dsl create mode 100644 common/dbl1eu.ent create mode 100644 common/dbl1fi.dsl create mode 100644 common/dbl1fi.ent create mode 100644 common/dbl1fr.dsl create mode 100644 common/dbl1fr.ent create mode 100644 common/dbl1hu.dsl create mode 100644 common/dbl1hu.ent create mode 100644 common/dbl1id.dsl create mode 100644 common/dbl1id.ent create mode 100644 common/dbl1it.dsl create mode 100644 common/dbl1it.ent create mode 100644 common/dbl1ja.dsl create mode 100644 common/dbl1ja.ent create mode 100644 common/dbl1ko.dsl create mode 100644 common/dbl1ko.ent create mode 100644 common/dbl1nl.dsl create mode 100644 common/dbl1nl.ent create mode 100644 common/dbl1nn.dsl create mode 100644 common/dbl1nn.ent create mode 100644 common/dbl1no.dsl create mode 100644 common/dbl1no.ent create mode 100644 common/dbl1null.dsl create mode 100644 common/dbl1pl.dsl create mode 100644 common/dbl1pl.ent create mode 100644 common/dbl1pt.dsl create mode 100644 common/dbl1pt.ent create mode 100644 common/dbl1ptbr.dsl create mode 100644 common/dbl1ptbr.ent create mode 100644 common/dbl1ro.dsl create mode 100644 common/dbl1ro.ent create mode 100644 common/dbl1ru.dsl create mode 100644 common/dbl1ru.ent create mode 100644 common/dbl1sk.dsl create mode 100644 common/dbl1sk.ent create mode 100644 common/dbl1sl.dsl create mode 100644 common/dbl1sl.ent create mode 100644 common/dbl1sr.dsl create mode 100644 common/dbl1sr.ent create mode 100644 common/dbl1sv.dsl create mode 100644 common/dbl1sv.ent create mode 100644 common/dbl1th.ent create mode 100644 common/dbl1tr.dsl create mode 100644 common/dbl1tr.ent create mode 100644 common/dbl1uk.dsl create mode 100644 common/dbl1uk.ent create mode 100644 common/dbl1xh.dsl create mode 100644 common/dbl1xh.ent create mode 100644 common/dbl1zhcn.dsl create mode 100644 common/dbl1zhcn.ent create mode 100644 common/dbl1zhtw.dsl create mode 100644 common/dbl1zhtw.ent create mode 100644 common/dbtable.dsl create mode 100644 contrib/html/ChangeLog create mode 100644 contrib/html/short-biblioentry.dsl create mode 100644 contrib/imagemap/ChangeLog create mode 100644 contrib/imagemap/imagemap.dsl create mode 100644 contrib/imagemap/testdoc.sgm create mode 100644 contrib/imagemap/testimg.jpg create mode 100644 contrib/print/ChangeLog create mode 100644 contrib/print/short-biblioentry.dsl create mode 100644 contrib/renumberinpart/ChangeLog create mode 100644 contrib/renumberinpart/renumberinpart.dsl create mode 100644 contrib/renumberinpart/test.sgm create mode 100644 contrib/subdoc/ChangeLog create mode 100644 contrib/subdoc/book.sgm create mode 100644 contrib/subdoc/subdoc.dsl create mode 100644 contrib/subdoc/subdoc.dtd create mode 100644 contrib/subdoc/subdoc1.sgm create mode 100644 contrib/subdoc/subdoc2.sgm create mode 100644 contrib/subdoc/subdocbc.mod create mode 100644 dtds/dbdsssl/ChangeLog create mode 100644 dtds/dbdsssl/dbdsssl.dtd create mode 100644 dtds/decls/ChangeLog create mode 100644 dtds/decls/docbook.dcl create mode 100644 dtds/decls/xml.dcl create mode 100644 dtds/html/ChangeLog create mode 100644 dtds/html/ISOlat1.gml create mode 100644 dtds/html/catalog create mode 100644 dtds/html/dbhtml.dcl create mode 100644 dtds/html/dbhtml.dtd create mode 100644 dtds/html/test.htm create mode 100644 dtds/imagelib/ChangeLog create mode 100644 dtds/imagelib/imagelib.dtd create mode 100644 dtds/olink/ChangeLog create mode 100644 dtds/olink/olinksum.dtd create mode 100644 frames/ChangeLog create mode 100644 frames/README create mode 100644 frames/docbook.css create mode 100644 frames/docbook.js create mode 100644 frames/frames.dsl create mode 100644 frames/frames.htm create mode 100644 frames/navbar.htm create mode 100644 html/ChangeLog create mode 100644 html/XREF create mode 100644 html/catalog create mode 100644 html/dbadmon.dsl create mode 100644 html/dbautoc.dsl create mode 100644 html/dbbibl.dsl create mode 100644 html/dbblock.dsl create mode 100644 html/dbcallou.dsl create mode 100644 html/dbchunk.dsl create mode 100644 html/dbcompon.dsl create mode 100644 html/dbdivis.dsl create mode 100644 html/dbefsyn.dsl create mode 100644 html/dbfootn.dsl create mode 100644 html/dbgloss.dsl create mode 100644 html/dbgraph.dsl create mode 100644 html/dbhtml.dsl create mode 100644 html/dbindex.dsl create mode 100644 html/dbinfo.dsl create mode 100644 html/dbinline.dsl create mode 100644 html/dblink.dsl create mode 100644 html/dblists.dsl create mode 100644 html/dblot.dsl create mode 100644 html/dbmath.dsl create mode 100644 html/dbmsgset.dsl create mode 100644 html/dbnavig.dsl create mode 100644 html/dbparam.dsl create mode 100644 html/dbpi.dsl create mode 100644 html/dbprocdr.dsl create mode 100644 html/dbqanda.dsl create mode 100644 html/dbrfntry.dsl create mode 100644 html/dbsect.dsl create mode 100644 html/dbsynop.dsl create mode 100644 html/dbtable.dsl create mode 100644 html/dbtitle.dsl create mode 100644 html/dbttlpg.dsl create mode 100644 html/dbverb.dsl create mode 100644 html/docbook.dsl create mode 100644 html/version.dsl create mode 100644 images/ChangeLog create mode 100644 images/Make.images create mode 100644 images/callouts/1.eps create mode 100644 images/callouts/1.gif create mode 100644 images/callouts/1.pdf create mode 100644 images/callouts/10.eps create mode 100644 images/callouts/10.gif create mode 100644 images/callouts/10.pdf create mode 100644 images/callouts/2.eps create mode 100644 images/callouts/2.gif create mode 100644 images/callouts/2.pdf create mode 100644 images/callouts/3.eps create mode 100644 images/callouts/3.gif create mode 100644 images/callouts/3.pdf create mode 100644 images/callouts/4.eps create mode 100644 images/callouts/4.gif create mode 100644 images/callouts/4.pdf create mode 100644 images/callouts/5.eps create mode 100644 images/callouts/5.gif create mode 100644 images/callouts/5.pdf create mode 100644 images/callouts/6.eps create mode 100644 images/callouts/6.gif create mode 100644 images/callouts/6.pdf create mode 100644 images/callouts/7.eps create mode 100644 images/callouts/7.gif create mode 100644 images/callouts/7.pdf create mode 100644 images/callouts/8.eps create mode 100644 images/callouts/8.gif create mode 100644 images/callouts/8.pdf create mode 100644 images/callouts/9.eps create mode 100644 images/callouts/9.gif create mode 100644 images/callouts/9.pdf create mode 100644 images/callouts/ChangeLog create mode 100644 images/caution.eps create mode 100644 images/caution.gif create mode 100644 images/caution.pdf create mode 100644 images/home.eps create mode 100644 images/home.gif create mode 100644 images/home.pdf create mode 100644 images/important.eps create mode 100644 images/important.gif create mode 100644 images/important.pdf create mode 100644 images/next.eps create mode 100644 images/next.gif create mode 100644 images/next.pdf create mode 100644 images/note.eps create mode 100644 images/note.gif create mode 100644 images/note.pdf create mode 100644 images/prev.eps create mode 100644 images/prev.gif create mode 100644 images/prev.pdf create mode 100644 images/tip.eps create mode 100644 images/tip.gif create mode 100644 images/tip.pdf create mode 100644 images/toc-blank.eps create mode 100644 images/toc-blank.gif create mode 100644 images/toc-blank.pdf create mode 100644 images/toc-minus.eps create mode 100644 images/toc-minus.gif create mode 100644 images/toc-minus.pdf create mode 100644 images/toc-plus.eps create mode 100644 images/toc-plus.gif create mode 100644 images/toc-plus.pdf create mode 100644 images/up.eps create mode 100644 images/up.gif create mode 100644 images/up.pdf create mode 100644 images/warning.eps create mode 100644 images/warning.gif create mode 100644 images/warning.pdf create mode 100644 lib/ChangeLog create mode 100644 lib/dblib.dsl create mode 100644 olink/ChangeLog create mode 100644 olink/olink.dsl create mode 100644 packaging/docbook-style-dsssl.Makefile create mode 100644 packaging/docbook-style-dsssl.changes create mode 100644 packaging/docbook-style-dsssl.spec create mode 100644 print/ChangeLog create mode 100644 print/XREF create mode 100644 print/catalog create mode 100644 print/dbadmon.dsl create mode 100644 print/dbautoc.dsl create mode 100644 print/dbbibl.dsl create mode 100644 print/dbblock.dsl create mode 100644 print/dbcallou.dsl create mode 100644 print/dbcompon.dsl create mode 100644 print/dbdivis.dsl create mode 100644 print/dbefsyn.dsl create mode 100644 print/dbgloss.dsl create mode 100644 print/dbgraph.dsl create mode 100644 print/dbindex.dsl create mode 100644 print/dbinfo.dsl create mode 100644 print/dbinline.dsl create mode 100644 print/dblink.dsl create mode 100644 print/dblists.dsl create mode 100644 print/dblot.dsl create mode 100644 print/dbmath.dsl create mode 100644 print/dbmsgset.dsl create mode 100644 print/dbparam.dsl create mode 100644 print/dbprint.dsl create mode 100644 print/dbprocdr.dsl create mode 100644 print/dbqanda.dsl create mode 100644 print/dbrfntry.dsl create mode 100644 print/dbsect.dsl create mode 100644 print/dbsynop.dsl create mode 100644 print/dbtable.dsl create mode 100644 print/dbtitle.dsl create mode 100644 print/dbttlpg.dsl create mode 100644 print/dbverb.dsl create mode 100644 print/docbook.dsl create mode 100644 print/notoc.dsl create mode 100644 print/plain.dsl create mode 100644 print/version.dsl diff --git a/BUGS b/BUGS new file mode 100644 index 0000000..2400c96 --- /dev/null +++ b/BUGS @@ -0,0 +1,35 @@ +Using Equations w/o titles results in incorrectly numbered + equations with titles. Use InformalEquation instead. + +InlineEquations don't work in the RTF backend. It's not my fault. + +Callout support is somewhat fragile. + +Line numbering of linespecific displays is somewhat fragile. + +In two-sided mode, with the RTF backend, the appropriate + alternation of inner/outer headers and footers does not work + correctly unless %page-number-restart% is true. This is + caused by a limitation in RTF. + +CHAR alignment in tables is not supported + +The stylesheets can't automatically put callout marks on a +PROGRAMLISTING or SCREEN if the text comes from an external file +using the LINESPECIFIC INLINEGRAPHIC trick. + +"Extra"

elements appear in the HTML output if you put block +elements inside of elements in your source. The problem +is that + + Some text ...

+ +Is translated into + +

Some text ...

+ +but HTML doesn't allow "table" inside a P, so the begin table +implies an "

" which makes the

after the table erroneous. +I don't have a good answer for this, but I'm tempted to make all +

tags empty in the HTML so that the browser has to imply all +the

s. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..778484b --- /dev/null +++ b/ChangeLog @@ -0,0 +1,140 @@ +2004-11-05 Michael Smith + + * Makefile: plain-text release notes, added target to make + +2004-11-04 Michael Smith + + * .cvsignore: ignore RELEASE-NOTES.html + + * .cvsignore: ignore RELEASE-NOTES.txt + + * FRESHMEAT: New file. + + * Makefile: RELEASE-NOTES.html and freshmeat targets added + + * RELEASE-NOTES.xml: New file. + + * VERSION: Version 1.79 released. + +2004-10-23 + + * Makefile: The debian directory no longer corresponds to the actual Debian package, so + it would only be confusing to keep it around. + + * TODO: TODO items are nowadays listed at SourceForge; this file doesn't serve a + purpose anymore. + +2004-09-14 + + * README.CVS: Add note that xmlcharent also needs to be checked out when working from CVS. + +2003-03-21 Adam Di Carlo + + * Makefile: clean target cleans backup files and CVS junk + + * VERSION: Keep CVS and real releases distinct + +2003-02-20 Adam Di Carlo + + * Makefile: don't distrib empty debian dir and *.orig + +2003-02-19 Norman Walsh + + * VERSION: Version 1.78 released. + +2002-12-16 Adam Di Carlo + + * .cvsignore: ignorables, esp stuff built by debian/rules + +2002-08-08 Adam Di Carlo + + * Makefile: 'doc' target uses bin subdir, clean target additional goes into print, + html, and bin + + * catalog: appropriate DTDDECL for dtds/html/dbhtml.dcl (merging in Debian changes) + +2002-08-07 Adam Di Carlo + + * README.CVS: some more information in the 'Installation' section + +2002-07-07 Norman Walsh + + * Makefile: Keep the debian directory out of the distribution + + * VERSION: Keep CVS and real releases distinct + + * VERSION: Version 1.77 released. + +2002-03-24 Adam Di Carlo + + * Makefile: clean does more subdirs now + +2002-02-22 Norman Walsh + + * Makefile: Improve archive construction + + * VERSION: Version 1.76 released. + +2002-02-21 Norman Walsh + + * VERSION: Version 1.75 released. + +2001-12-01 Norman Walsh + + * Makefile: Bug #449776: include EPS/PDF graphics + +2001-11-30 Norman Walsh + + * VERSION: Keep CVS versions distinct from real releases + + * VERSION: Merged V174bugfixes + + * VERSION: New file. + +2001-11-28 Norman Walsh + + * VERSION: branches: 1.11.2; + Version 1.74 released. + +2001-09-29 Norman Walsh + + * VERSION: Version 1.73 released. + + * VERSION: Keep CVS versions distinct from real releases + +2001-08-06 Norman Walsh + + * VERSION: Keep CVS versions distinct from real releases + + * VERSION: Version 1.72 released. + +2001-07-08 Norman Walsh + + * VERSION: Version 1.71 released. + +2001-05-22 Norman Walsh + + * VERSION: Version 1.70 released. + +2001-04-20 Norman Walsh + + * VERSION: Version 1.68 released. + + * VERSION: Version 1.69 released. + +2001-04-15 Norman Walsh + + * Makefile: Various distribution hacks + +2001-04-04 Norman Walsh + + * .cvsignore, Makefile, README: Adjust Makefiles and documentation for building a new distrib + + * VERSION: Version 1.67 released. + +2001-04-02 Norman Walsh + + * BUGS, README.CVS, TODO, VERSION, catalog: Initial checkins + + * Makefile: New file. + diff --git a/README b/README new file mode 100644 index 0000000..4665743 --- /dev/null +++ b/README @@ -0,0 +1,91 @@ +README for the DocBook Stylesheets + +These are DSSSL stylesheets for the DocBook DTD. + +For more information, see http://docbook.sourceforge.net/ + +Manifest +-------- + +bin/ contains scripts for some (optional) post-processing +common/ contains code common to both stylesheets +contrib/ contains contributions +doc/ contains installation and reference documentation (this is + now distributed in a separate ZIP archive) +docsrc/ contains the SGML source for the documentation +dtds/ contains auxiliary DTDs +frames/ contains support for frames +html/ contains the HTML stylesheet (for use with -t sgml) +images/ contains images used by the HTML stylesheets +lib/ contains DSSSL functions that are believed to be useful but + are totally independent of any particular stylesheet +olink/ contains olink support +print/ contains the print stylesheet + +Changes +------- + +See the ChangeLog in each directory for additional information +about the specific changes. + +See WhatsNew for changes since the last release. + +Installation +------------ + +See doc/install.html and/or http://nwalsh.com/docbook/dsssl/ + +Copyright +--------- + +Copyright (C) 1997-2001 Norman Walsh + +The original inspiration for these stylesheets came from the +work of Jon Bosak, Anders Berglund, Tony Graham, Terry Allen, +James Clark, and many others. I am indebted to them and to the +community of users on dssslist@mulberrytech.com for making +substantial contributions to this work and for answering my many +questions. + +This software may be distributed under the same terms as Jade: + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the ``Software''), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +Except as contained in this notice, the names of individuals +credited with contribution to this software shall not be used in +advertising or otherwise to promote the sale, use or other +dealings in this Software without prior written authorization +from the individuals in question. + +Any stylesheet derived from this Software that is publically +distributed will be identified with a different name and the +version strings in any derived Software will be changed so that +no possibility of confusion between the derived package and this +Software will exist. + +Warranty +-------- + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL NORMAN WALSH OR ANY OTHER +CONTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Contacting the Author +--------------------- + +These stylesheets are maintained by Norman Walsh, . diff --git a/RELEASE-NOTES.html b/RELEASE-NOTES.html new file mode 100644 index 0000000..a7b97e3 --- /dev/null +++ b/RELEASE-NOTES.html @@ -0,0 +1,34 @@ + + + DocBook DSSSL Stylesheet Release Notes

DocBook DSSSL Stylesheet Release Notes

DocBook Open Repository Team

$Id: RELEASE-NOTES.xml,v 1.1 2004/11/04 11:34:01 xmldoc Exp $

03 November 2004


Table of Contents

Release 1.79

These are the release notes for the DocBook DSSSL Stylesheets. + At a minimum, this file attempts to document changes to the public + APIs and provide a high-level overview of the features added in each + release.

Release 1.79

This release contains fixes for a number of long-standing + bugs. See the WhatsNew file for more + details. Among the user-visible changes are:

  • HTML stylesheets.  +

    • The doctype definition in the HTML output now + contains a system identifier, required for better + parsing in contemporary browsers.

    • CSS decoration has been added to procedure + steps.

    • Uses of <VAR> in HTML output (often rendered + in italic) have been changed to something more + appropriate

    • The last character of the version was cut off in + previous releases.

    • Processing instruction parsing has been made + more robust against arbitrarily formed PIs.

    • Callout graphics and admonition graphics share a + single variable, %stock-graphics-extension%.

    • The value of the VALIGN attribute has been + corrected to MIDDLE instead of CENTER.

    +

  • Print stylesheets.  +

    • Admonition titles and contents are kept + together.

    • Programlistings with callouts now honor the + width attribute.

    • The rendering of othercredit has been made more + useful.

    • Excessive after spacing when a listitem contains + multiple paras or verbatim environments has been + fixed.

    • Empty ulinks don't generate footnotes, so they + are now omitted from the footnote counting.

    • Some cases where components were restarting the + page numbering were fixed.

    • article-titlepage-recto-elements has been made + to match the HTML version.

    • Support for revdescription inside revison on + titlepages has been added.

    +

  • General.  +

    • "pc" is now allowed as abbreviation for + "pica".

    • The return value of my-debug has been + fixed.

    • A Bosnian translation has been added.

    • A Bulgarian translation has been added.

    +

\ No newline at end of file diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt new file mode 100644 index 0000000..43fb394 --- /dev/null +++ b/RELEASE-NOTES.txt @@ -0,0 +1,76 @@ +DocBook DSSSL Stylesheet Release Notes + +DocBook Open Repository Team + +$Id: RELEASE-NOTES.xml,v 1.1 2004/11/04 11:34:01 xmldoc Exp $ + +03 November 2004 + +------------------------------------------------------------------------------- + +Table of Contents + +Release 1.79 + +These are the release notes for the DocBook DSSSL Stylesheets. At a minimum, +this file attempts to document changes to the public APIs and provide a +high-level overview of the features added in each release. + +Release 1.79 + +This release contains fixes for a number of long-standing bugs. See the +WhatsNew file for more details. Among the user-visible changes are: + + * HTML stylesheets. + + o The doctype definition in the HTML output now contains a system + identifier, required for better parsing in contemporary browsers. + + o CSS decoration has been added to procedure steps. + + o Uses of in HTML output (often rendered in italic) have been + changed to something more appropriate + + o The last character of the version was cut off in previous releases. + + o Processing instruction parsing has been made more robust against + arbitrarily formed PIs. + + o Callout graphics and admonition graphics share a single variable, + %stock-graphics-extension%. + + o The value of the VALIGN attribute has been corrected to MIDDLE instead + of CENTER. + + * Print stylesheets. + + o Admonition titles and contents are kept together. + + o Programlistings with callouts now honor the width attribute. + + o The rendering of othercredit has been made more useful. + + o Excessive after spacing when a listitem contains multiple paras or + verbatim environments has been fixed. + + o Empty ulinks don't generate footnotes, so they are now omitted from the + footnote counting. + + o Some cases where components were restarting the page numbering were + fixed. + + o article-titlepage-recto-elements has been made to match the HTML + version. + + o Support for revdescription inside revison on titlepages has been added. + + * General. + + o "pc" is now allowed as abbreviation for "pica". + + o The return value of my-debug has been fixed. + + o A Bosnian translation has been added. + + o A Bulgarian translation has been added. + diff --git a/RELEASE-NOTES.xml b/RELEASE-NOTES.xml new file mode 100644 index 0000000..dbaa087 --- /dev/null +++ b/RELEASE-NOTES.xml @@ -0,0 +1,126 @@ + + +
+ + DocBook DSSSL Stylesheet Release Notes + 03 November 2004 + $Id: RELEASE-NOTES.xml,v 1.1 2004/11/04 11:34:01 xmldoc Exp $ + DocBook Open Repository Team + + These are the release notes for the DocBook DSSSL Stylesheets. + At a minimum, this file attempts to document changes to the public + APIs and provide a high-level overview of the features added in each + release. +
+ Release 1.79 + This release contains fixes for a number of long-standing + bugs. See the file for more + details. Among the user-visible changes are: + + + + HTML stylesheets + + + + The doctype definition in the HTML output now + contains a system identifier, required for better + parsing in contemporary browsers. + + + CSS decoration has been added to procedure + steps. + + + Uses of <VAR> in HTML output (often rendered + in italic) have been changed to something more + appropriate + + + The last character of the version was cut off in + previous releases. + + + Processing instruction parsing has been made + more robust against arbitrarily formed PIs. + + + Callout graphics and admonition graphics share a + single variable, %stock-graphics-extension%. + + + The value of the VALIGN attribute has been + corrected to MIDDLE instead of CENTER. + + + + + + + + Print stylesheets + + + + Admonition titles and contents are kept + together. + + + Programlistings with callouts now honor the + width attribute. + + + The rendering of othercredit has been made more + useful. + + + Excessive after spacing when a listitem contains + multiple paras or verbatim environments has been + fixed. + + + Empty ulinks don't generate footnotes, so they + are now omitted from the footnote counting. + + + Some cases where components were restarting the + page numbering were fixed. + + + article-titlepage-recto-elements has been made + to match the HTML version. + + + Support for revdescription inside revison on + titlepages has been added. + + + + + + + + General + + + + "pc" is now allowed as abbreviation for + "pica". + + + The return value of my-debug has been + fixed. + + + A Bosnian translation has been added. + + + A Bulgarian translation has been added. + + + + + + +
+
diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..17420a5 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.79 diff --git a/WhatsNew b/WhatsNew new file mode 100644 index 0000000..b26f319 --- /dev/null +++ b/WhatsNew @@ -0,0 +1,372 @@ +Changes since version 1.78 (2003-02-19) + +Changes to dsssl/* + + | 2004-11-05 Michael Smith + | + | * Makefile: plain-text release notes, added target to make + | + | 2004-11-04 Michael Smith + | + | * .cvsignore: ignore RELEASE-NOTES.html + | + | * .cvsignore: ignore RELEASE-NOTES.txt + | + | * FRESHMEAT: New file. + | + | * Makefile: RELEASE-NOTES.html and freshmeat targets added + | + | * RELEASE-NOTES.xml: New file. + | + | * VERSION: Version 1.79 released. + | + | 2004-10-23 + | + | * Makefile: The debian directory no longer corresponds to the + | actual Debian package, so it would only be confusing to keep + | it around. + | + | * TODO: TODO items are nowadays listed at SourceForge; this + | file doesn't serve a purpose anymore. + | + | 2004-09-14 + | + | * README.CVS: Add note that xmlcharent also needs to be + | checked out when working from CVS. + | + | 2003-03-21 Adam Di Carlo + | + | * Makefile: clean target cleans backup files and CVS junk + | + | * VERSION: Keep CVS and real releases distinct + | + | 2003-02-20 Adam Di Carlo + | + | * Makefile: don't distrib empty debian dir and *.orig + | + +Changes to dsssl/bin/* + + | 2004-10-24 + | + | * collateindex.pl: Only mention the program's base name in the + | error messages. + | + | 2004-10-23 + | + | * Makefile: Don't put a "v" before the version number here. + | + | * collateindex.pl: Put the options list in some kind of order, + | and make the error messages have a consistent format. + | + | 2003-03-21 Adam Di Carlo + | + | * Makefile: clean target cleans backup files and CVS junk + | + | 2003-03-16 Adam Di Carlo + | + | * Makefile: fix the POD release variable + | + +Changes to dsssl/doc/* + + | 2003-03-21 Adam Di Carlo + | + | * Makefile: clean target cleans backup files and CVS junk + | + | 2003-03-17 Adam Di Carlo + | + | * Makefile: Make required stuff in ../docsrc as needed + | + | 2003-03-16 Adam Di Carlo + | + | * Makefile: removing *.htm in addition to the *.html + | + +Changes to dsssl/common/* + + | 2004-10-10 + | + | * dbcommon.dsl: Give othercredit some useful rendering in + | print output, by copying over the author rendering. Fix + | author-list-string for authorgroups that contain both + | authors and othercredits. (bug #1038081) + | + | 2004-10-09 + | + | * .cvsignore, Makefile, dbl10n.dsl, dbl10n.ent, + | dbl10n.template, dbl1bg.dsl: New Bulgarian translation by + | Viktor Vasilev (SF patch #1040075) + | + | * dbl1bs.dsl: Additional fixes for Bosnian translation, by + | Kemal Skripic (SF patch #1037371) + | + | 2004-09-22 Michael Smith + | + | * .cvsignore: dbl1bs.ent added to ignore list; also re-sorted + | list + | + | 2004-09-17 + | + | * Makefile, dbl10n.dsl, dbl10n.ent, dbl10n.template, + | dbl1bs.dsl: Bosnian translation by Kemal Skripic + | + | 2003-04-28 Adam Di Carlo + | + | * dbcommon.dsl: Fix a problem pointed out by Tim Waugh in + | articleinfo vs artheader in the article-title procedure. + | Also ensure articleinfo is used in some other contexts. + | + +Changes to dsssl/docsrc/* + + | 2004-10-23 Michael Smith + | + | * collateindex.sgm, dblib.sgm, docbook.sgm, htparam.sgm, + | imagelib.sgm, indexing.sgm, olinksemantics.sgm, + | otherdoc.sgm, prparam.sgm: Bug #1052834 (PIs in dsssl/doc + | sources causing jade errors) apparently jade has a problem + | dealing with single quotation marks in PIs -- at least it + | appears like that in the case where it needs to take a + | single-quoted value from within a PI and use it to write a + | filename; so changed al single-quote filenames in PIs to + | doubly quoted ones; seems to have made jade happy + | + | 2004-09-18 + | + | * custom.sgm: Fix for Documentation Request #510281: Add + | missing -d option in example + | + | * custom.sgm: Fix for Documentation Request #992388: Removed + | obsolete section about setting the stylesheet language via a + | customization layer (now done using a stylesheet parameter). + | + | 2003-03-17 Adam Di Carlo + | + | * doc.dsl: Minor readability fixes. + | + +Changes to dsssl/html/* + + | 2004-10-10 + | + | * dbhtml.dsl, dbparam.dsl, dbttlpg.dsl: Support for specifying + | a system ID for the HTML output documents, required for + | better parsing in contemporary browsers. A default system ID + | is set if %html40% is true. + | + | 2004-10-09 + | + | * docbook.dsl: New Bulgarian translation by Viktor Vasilev (SF + | patch #1040075) + | + | 2004-09-23 + | + | * dbprocdr.dsl: Add CSS decoration of procedure steps (RFE + | #1033197) + | + | 2004-09-17 + | + | * docbook.dsl: Bosnian translation by Kemal Skripic + | + | 2004-09-14 + | + | * dbinline.dsl: Fix for bug #860398: Change uses of $var-seq$ + | to something more appropriate. + | + | 2004-07-11 + | + | * version.dsl: Closes Bug 912831: the last character of + | VERSION was being cut off. + | + | 2003-05-28 Adam Di Carlo + | + | * dbblock.dsl: HTML attribs for comments variablized for + | maintenance. + | + | 2003-04-29 Adam Di Carlo + | + | * dbcompon.dsl: Finding the subtitle for a component should + | use the parent title if set; this is consistent with how the + | title is already set; closes SF bug 613773. + | + | 2003-04-28 Adam Di Carlo + | + | * dbpi.dsl: Ensure dbhtml-findvalue can handle the + | pi-field-list being a non-pair, which may occur in some + | poorly formed dbhtml PIs; returns #f in this case. + | + | 2003-04-27 Adam Di Carlo + | + | * dbcompon.dsl: Simplify some code, no functional changes + | + | 2003-04-26 Adam Di Carlo + | + | * dbcallou.dsl, dbparam.dsl: callout graphics and admonition + | graphics, if needed, share a single variable, + | %stock-graphics-extension% -- "stock" here referring to + | standard, stock images, e.g., not per document images; this + | closes Debian Bug#187429 + | + | 2003-04-12 Adam Di Carlo + | + | * dbadmon.dsl: VALIGN should be MIDDLE, not CENTER; closes + | Debian Bug#187569 + | + | 2003-04-05 Adam Di Carlo + | + | * dblists.dsl: back out my last change; there are 4 places + | taht use this and until I understand how + | varlistentry-term-too-long? is supposed to work at all I + | better not mess with it + | + | * dblists.dsl: termlength in varlist is measurement-to-length, + | not string->number + | + | 2003-03-25 Adam Di Carlo + | + | * db31.dsl, dbblock.dsl, dbcompon.dsl, dbgraph.dsl, + | dbqanda.dsl, dbsect.dsl, docbook.dsl: move data from db31 + | into its proper component files + | + | 2003-03-21 Adam Di Carlo + | + | * Makefile: Don't hardcode DSSSL file list, use $(wildcard + | *.dsl); clean is cleaner + | + +Changes to dsssl/lib/* + + | 2004-10-24 + | + | * dblib.dsl: Revision 1.6 completely broke PI processing, so + | back that out for now. + | + | 2003-04-29 Adam Di Carlo + | + | * dblib.dsl: Fix my-debug so it actually returns what you ask + | it to. + | + | 2003-04-28 Adam Di Carlo + | + | * dblib.dsl: Make PI parsing more robust by rewriting + | parse-pi-attribute and a fix in parse-starttag-pi. I'm still + | not entirely happy with the PI parsing, its probably a + | little flakey, but it shouldn't completely bail out when it + | hits data its not expecting. Closes Debian Bug#186886. + | + | 2003-04-26 Adam Di Carlo + | + | * dblib.dsl: Fix a typo in the param docs + | + | 2003-04-05 Adam Di Carlo + | + | * dblib.dsl: xsl stylesheet refers to pica as "pc" rather than + | "pi", so we allow either one as a pica + | + +Changes to dsssl/print/* + + | 2004-10-10 + | + | * dbadmon.dsl: Fix for bug #522140: Keep admonition titles and + | contents together when graphics are used. + | + | * dbcallou.dsl: Synchronized $callout-verbatim-display$ with + | $verbatim-display$; fixes bug #517520 (callout ignores width + | of programlisting) + | + | * dbttlpg.dsl: Give othercredit some useful rendering in print + | output, by copying over the author rendering. Fix + | author-list-string for authorgroups that contain both + | authors and othercredits. (bug #1038081) + | + | 2004-10-09 + | + | * dbprint.dsl, dbverb.dsl: Patch #571688: Fixes excessive + | after spacing when a listitem contains multiple paras or + | verbatim environments. Patches originally by Tim Waugh and + | Tammy Fox. + | + | * docbook.dsl: New Bulgarian translation by Viktor Vasilev (SF + | patch #1040075) + | + | 2004-09-17 + | + | * docbook.dsl: Bosnian translation by Kemal Skripic + | + | 2004-09-14 + | + | * dbblock.dsl: Fix for bug #502066: Empty ulinks don't + | generate footnotes, so they should be omitted from the + | footnote counting. Patch by Bruce A. Mah. + | + | * dbprint.dsl: Fix for bug #529969: Make italic monospace and + | strong monospace inherit verbatim-size-factor. Patch by + | David Aumueller. + | + | 2004-07-11 + | + | * version.dsl: Closes Bug 912831: the last character of + | VERSION was being cut off. + | + | 2003-12-05 Adam Di Carlo + | + | * dbdivis.dsl: fix a bug when multiple elements in + | $generate-book-lot-list$ had content; whitespace and comment + | updates + | + | 2003-04-29 Adam Di Carlo + | + | * dbcompon.dsl: Finding the subtitle for a component should + | use the parent title if set; this is consistent with how the + | title is already set; closes SF bug 613773. + | + | * dbcompon.dsl: Suppress some cases where components were + | restarting page numbering, fix from Ian Castle; closes SF + | bug 439751. + | + | * dbparam.dsl: Correct reference to undefined variable + | "admon-graphic-default-extension". + | + | * dbttlpg.dsl: Add elements to print version of + | article-titlepage-recto-elements so that it matches the HTML + | version, fixes SF bug 626909. + | + | 2003-04-26 Adam Di Carlo + | + | * dbparam.dsl: rename parameter + | admon-graphic-default-extension to + | %admon-graphics-extension% for consistency + | + | * dbparam.dsl: Note that %admon-graphics-path% requires the + | trailing directory separator -- + | + | * dbparam.dsl: %admon-graphics-extension% will use the old + | name, admon-graphic-default-extension, if set + | + | 2003-03-25 Adam Di Carlo + | + | * db31.dsl, dbblock.dsl, dbcompon.dsl, dbgraph.dsl, + | dbinline.dsl, dbqanda.dsl, dbsect.dsl, docbook.dsl: move + | data from db31 into its proper component files + | + | 2003-03-24 Jirka Kosek + | + | * dbttlpg.dsl: Added support for revdescription inside revison + | on titlepages + | + | 2003-03-21 Adam Di Carlo + | + | * Makefile: Don't hardcode DSSSL file list, use $(wildcard + | *.dsl); clean is cleaner + | + +Changes to dsssl/doc/testdata/* + + | 2003-03-16 Adam Di Carlo + | + | * c01.htm, jtest.rtf, test.rtf: Generated files should not be + | in CVS + | + diff --git a/bin/ChangeLog b/bin/ChangeLog new file mode 100644 index 0000000..8c75e0d --- /dev/null +++ b/bin/ChangeLog @@ -0,0 +1,58 @@ +2004-10-24 + + * collateindex.pl: Only mention the program's base name in the error messages. + +2004-10-23 + + * Makefile: Don't put a "v" before the version number here. + + * collateindex.pl: Put the options list in some kind of order, and make the error messages + have a consistent format. + +2003-03-21 Adam Di Carlo + + * Makefile: clean target cleans backup files and CVS junk + +2003-03-16 Adam Di Carlo + + * Makefile: fix the POD release variable + +2003-01-19 Adam Di Carlo + + * collateindex.pl: fix from Tim Waugh for when the same indexterm has too different + seealso's, where currently script produces invalid SGML/XML; fixes bug #551318 + +2002-12-16 Adam Di Carlo + + * .cvsignore: New file. + +2002-08-08 Adam Di Carlo + + * Makefile: New file. + +2002-01-07 Adam Di Carlo + + * collateindex.pl: emit a warning if a duplicated index entry is found and removed + +2001-12-01 Norman Walsh + + * collateindex.pl: Patch #468645: fix for indexterm zones in print + +2001-04-20 Adam Di Carlo + + * collateindex.pl: add POD documentation; remove the usage message documentation in the name of reducing redundancy + +2001-04-18 Adam Di Carlo + + * collateindex.pl: add -q (quiet) and -V (report version only) arguments + +2001-04-03 Norman Walsh + + * collateindex.pl: Whitespace changes + + * collateindex.pl: Fix bug 412898, produce links in the index, even in the presence of seealso + +2001-04-02 Norman Walsh + + * collateindex.pl: New file. + diff --git a/bin/collateindex.pl b/bin/collateindex.pl new file mode 100644 index 0000000..e384711 --- /dev/null +++ b/bin/collateindex.pl @@ -0,0 +1,737 @@ +#!/usr/bin/perl -- # -*- Perl -*- +# +# $Id: collateindex.pl,v 1.10 2004/10/24 17:05:41 petere78 Exp $ + +=head1 NAME + +collateindex.pl - generate DocBook index files + +=head1 SYNOPSIS + +B [B<-f>] [B<-g>] [B<-i> I] [B<-I> I] [B<-N>] + [B<-o> F] [B<-p>] [B<-P> F] [B<-q>] [B<-s> I] + [B<-S> I] [B<-t> I] [B<-x>] F + +=head1 DESCRIPTION + +B creates index data for DocBook XML or SGML files. + +=cut + +use File::Basename; +use Getopt::Std; + +$me = basename($0); + +$usage = "Usage: $0 [options] file +Try \"perldoc $me\" for documentation.\n"; + +( $version = '$Revision: 1.10 $' ) =~ s/^\$[R]evision:\s*([^ ]*)\s*\$$/$1/; + +=head1 OPTIONS + +=over 5 + +=item B<-f> + +Force the output file to be written, even if it appears to have been +edited by hand. + +=item B<-g> + +Group terms with IndexDiv based on the first letter of the term (or +its SortAs attribute). (This might not handle all language environments.) + +=item B<-i> I + +The ID to use for the EindexE tag. + +=item B<-I> I + +The implied scope, must be C, C, or C. IndexTerms +which do not specify a scope will have the implied scope. If +unspecified, C is assumed. + +=item B<-N> + +New index (generates an empty index file). + +=item B<-o> F + +Output to F. Defaults to F. + +=item B<-p> + +Link to points in the document. The default is to link to the closest +containing section. + +=item B<-P> F + +Read a preamble from F. The contents of F will be +inserted before the EindexE tag. + +=item B<-q> + +Run quietly. + +=item B<-s> I + +Name the IndexDiv that contains symbols. The default is C. +Meaningless if B<-g> is not used. + +=item B<-S> I + +Scope of the index, must be C, C, or C. If +unspecified, C is assumed. + +=item B<-t> I + +Title for the index. + +=item B<-x> + +Make a SetIndex. + +=item B<-V> + +Print version number and exit. + +=item F + +The file containing index data generated with the DocBook DSSSL +HTML stylesheet (usually called F). + +=back + +=cut + + +die $usage if ! getopts('Dfgi:NpP:s:o:S:I:t:xqV'); + +$linkpoints = $opt_p; +$lettergroups = $opt_g; +$symbolsname = $opt_s || "Symbols"; +$title = $opt_t; +$preamble = $opt_P; +$outfile = $opt_o || '-'; +$indexid = $opt_i; +$scope = uc($opt_S) || 'ALL'; +$impliedscope = uc($opt_I) || 'ALL'; +$setindex = $opt_x; +$forceoutput = $opt_f; +$newindex = $opt_N; +$debug = $opt_D; +$quiet = $opt_q; + +if ( $opt_V ) { + print "collateindex.pl $version\n"; + exit 0; +} + +$indextag = $setindex ? 'setindex' : 'index'; + +if ($newindex) { + safe_open(*OUT, $outfile); + if ($indexid) { + print OUT "<$indextag id='$indexid'>\n\n"; + } else { + print OUT "<$indextag>\n\n"; + } + + print OUT "\n"; + print OUT "\n"; + + print OUT "\n"; + exit 0; +} + +$dat = shift @ARGV || die $usage; +die "$me: file \"$dat\" does not exist\n" if ! -f $dat; + +%legal_scopes = ('ALL' => 1, 'LOCAL' => 1, 'GLOBAL' => 1); +if ($scope && !$legal_scopes{$scope}) { + die "$me: invalid scope: $scope\n"; +} +if ($impliedscope && !$legal_scopes{$impliedscope}) { + die "$me: invalid implied scope: $impliedscope\n"; +} + +@term = (); +%id = (); + +$termcount = 0; + +$quiet || print STDERR "Processing $dat...\n"; + +# Read the index file, creating an array of objects. Each object +# represents and indexterm and has fields for the content of the +# indexterm + +open (F, $dat); +while () { + chop; + chop if /\r$/; + + if (/^\/indexterm/i) { + push (@term, $idx); + next; + } + + if (/^indexterm (.*)$/i) { + $termcount++; + $idx = {}; + $idx->{'zone'} = {}; + $idx->{'href'} = $1; + $idx->{'count'} = $termcount; + $idx->{'scope'} = $impliedscope; + next; + } + + if (/^indexpoint (.*)$/i) { + $idx->{'hrefpoint'} = $1; + next; + } + + if (/^title (.*)$/i) { + $idx->{'title'} = $1; + next; + } + + if (/^primary[\[ ](.*)$/i) { + if (/^primary\[(.*?)\] (.*)$/i) { + $idx->{'psortas'} = &escape($1); + $idx->{'primary'} = &escape($2); + } else { + $idx->{'psortas'} = &escape($1); + $idx->{'primary'} = &escape($1); + } + next; + } + + if (/^secondary[\[ ](.*)$/i) { + if (/^secondary\[(.*?)\] (.*)$/i) { + $idx->{'ssortas'} = &escape($1); + $idx->{'secondary'} = &escape($2); + } else { + $idx->{'ssortas'} = &escape($1); + $idx->{'secondary'} = &escape($1); + } + next; + } + + if (/^tertiary[\[ ](.*)$/i) { + if (/^tertiary\[(.*?)\] (.*)$/i) { + $idx->{'tsortas'} = &escape($1); + $idx->{'tertiary'} = &escape($2); + } else { + $idx->{'tsortas'} = &escape($1); + $idx->{'tertiary'} = &escape($1); + } + next; + } + + if (/^see (.*)$/i) { + $idx->{'see'} = &escape($1); + next; + } + + if (/^seealso (.*)$/i) { + $idx->{'seealso'} = &escape($1); + next; + } + + if (/^significance (.*)$/i) { + $idx->{'significance'} = &escape($1); + next; + } + + if (/^class (.*)$/i) { + $idx->{'class'} = &escape($1); + next; + } + + if (/^scope (.*)$/i) { + $idx->{'scope'} = &escape(uc($1)); + next; + } + + if (/^startref (.*)$/i) { + $idx->{'startref'} = $1; + next; + } + + if (/^id (.*)$/i) { + $idx->{'id'} = $1; + $id{$1} = $idx; + next; + } + + if (/^zone (.*)$/i) { + my($href) = $1; + $_ = scalar(); + chop; + die "$me: invalid zone: $_\n" if !/^title (.*)$/i; + $idx->{'zone'}->{$href} = $1; + next; + } + + die "$me: unrecognized tag in input: $_\n"; +} +close (F); + +$quiet || print STDERR "$termcount entries loaded...\n"; + +# Fixup the startrefs... +# In DocBook, STARTREF is a #CONREF attribute; support this by copying +# all of the fields from the indexterm with the id specified by STARTREF +# to the indexterm that has the STARTREF. +foreach $idx (@term) { + my($ididx, $field); + if ($idx->{'startref'}) { + $ididx = $id{$idx->{'startref'}}; + foreach $field ('primary', 'secondary', 'tertiary', 'see', 'seealso', + 'psortas', 'ssortas', 'tsortas', 'significance', + 'class', 'scope') { + $idx->{$field} = $ididx->{$field}; + } + } +} + +# Sort the index terms +@term = sort termsort @term; + +# Move all of the non-alphabetic entries to the front of the index. +@term = sortsymbols(@term); + +safe_open(*OUT, $outfile); + +# Write the index... +if ($indexid) { + print OUT "<$indextag id='$indexid'>\n\n"; +} else { + print OUT "<$indextag>\n\n"; +} + +print OUT "\n"; +print OUT "\n"; + +print OUT "\n\n"; + +print OUT "$title\n\n" if $title; + +$last = {}; # the last indexterm we processed +$first = 1; # this is the first one +$group = ""; # we're not in a group yet +$lastout = ""; # we've not put anything out yet +@seealsos = (); # See also stack. + +foreach $idx (@term) { + next if $idx->{'startref'}; # no way to represent spans... + next if ($idx->{'scope'} eq 'LOCAL') && ($scope eq 'GLOBAL'); + next if ($idx->{'scope'} eq 'GLOBAL') && ($scope eq 'LOCAL'); + next if &same($idx, $last); # suppress duplicates + + $termcount--; + + # If primary changes, output a whole new index term, otherwise just + # output another secondary or tertiary, as appropriate. We know from + # sorting that the terms will always be in the right order. + if (!&tsame($last, $idx, 'primary')) { + print "DIFF PRIM\n" if $debug; + &end_entry() if not $first; + + if ($lettergroups) { + # If we're grouping, make the right indexdivs + $letter = $idx->{'psortas'}; + $letter = $idx->{'primary'} if !$letter; + $letter = uc(substr($letter, 0, 1)); + + # symbols are a special case + if (($letter lt 'A') || ($letter gt 'Z')) { + if (($group eq '') + || (($group ge 'A') && ($group le 'Z'))) { + print OUT "\n" if !$first; + print OUT "$symbolsname\n\n"; + $group = $letter; + } + } elsif (($group eq '') || ($group ne $letter)) { + print OUT "\n" if !$first; + print OUT "$letter\n\n"; + $group = $letter; + } + } + + $first = 0; # there can only be on first ;-) + + print OUT "\n"; + print OUT " ", $idx->{'primary'}; + $lastout = "primaryie"; + + if ($idx->{'secondary'}) { + print OUT "\n \n"; + print OUT " ", $idx->{'secondary'}; + $lastout = "secondaryie"; + }; + + if ($idx->{'tertiary'}) { + print OUT "\n \n"; + print OUT " ", $idx->{'tertiary'}; + $lastout = "tertiaryie"; + } + } elsif (!&tsame($last, $idx, 'secondary')) { + print "DIFF SEC\n" if $debug; + + print OUT "\n \n" if $lastout; + + foreach (@seealsos) { + # it'd be nice to make this a link... + print OUT $indent, " ", &escape($_), "\n"; + } + @seealsos = (); + + print OUT " ", $idx->{'secondary'}; + $lastout = "secondaryie"; + if ($idx->{'tertiary'}) { + print OUT "\n \n"; + print OUT " ", $idx->{'tertiary'}; + $lastout = "tertiaryie"; + } + } elsif (!&tsame($last, $idx, 'tertiary')) { + print "DIFF TERT\n" if $debug; + + print OUT "\n \n" if $lastout; + + foreach (@seealsos) { + # it'd be nice to make this a link... + print OUT $indent, " ", &escape($_), "\n"; + } + @seealsos = (); + + if ($idx->{'tertiary'}) { + print OUT " ", $idx->{'tertiary'}; + $lastout = "tertiaryie"; + } + } + + &print_term($idx); + + $last = $idx; +} + +# Termcount is > 0 iff some entries were skipped. +$quiet || print STDERR "$termcount entries ignored...\n"; + +&end_entry(); + +print OUT "\n" if $lettergroups; +print OUT "\n"; + +close (OUT); + +$quiet || print STDERR "Done.\n"; + +sub same { + my($a) = shift; + my($b) = shift; + + my($aP) = $a->{'psortas'} || $a->{'primary'}; + my($aS) = $a->{'ssortas'} || $a->{'secondary'}; + my($aT) = $a->{'tsortas'} || $a->{'tertiary'}; + + my($bP) = $b->{'psortas'} || $b->{'primary'}; + my($bS) = $b->{'ssortas'} || $b->{'secondary'}; + my($bT) = $b->{'tsortas'} || $b->{'tertiary'}; + + my($same); + + $aP =~ s/^\s*//; $aP =~ s/\s*$//; $aP = uc($aP); + $aS =~ s/^\s*//; $aS =~ s/\s*$//; $aS = uc($aS); + $aT =~ s/^\s*//; $aT =~ s/\s*$//; $aT = uc($aT); + $bP =~ s/^\s*//; $bP =~ s/\s*$//; $bP = uc($bP); + $bS =~ s/^\s*//; $bS =~ s/\s*$//; $bS = uc($bS); + $bT =~ s/^\s*//; $bT =~ s/\s*$//; $bT = uc($bT); + +# print "[$aP]=[$bP]\n"; +# print "[$aS]=[$bS]\n"; +# print "[$aT]=[$bT]\n"; + + # Two index terms are the same if: + # 1. the primary, secondary, and tertiary entries are the same + # (or have the same SORTAS) + # AND + # 2. They occur in the same titled section + # AND + # 3. They point to the same place + # + # Notes: Scope is used to suppress some entries, but can't be used + # for comparing duplicates. + # Interpretation of "the same place" depends on whether or + # not $linkpoints is true. + + $same = (($aP eq $bP) + && ($aS eq $bS) + && ($aT eq $bT) + && ($a->{'title'} eq $b->{'title'}) + && ($a->{'href'} eq $b->{'href'})); + + # If we're linking to points, they're only the same if they link + # to exactly the same spot. + $same = $same && ($a->{'hrefpoint'} eq $b->{'hrefpoint'}) + if $linkpoints; + + if ($same) { + warn "$me: duplicated index entry found: $aP $aS $aT\n"; + } + + $same; +} + +sub tsame { + # Unlike same(), tsame only compares a single term + my($a) = shift; + my($b) = shift; + my($term) = shift; + my($sterm) = substr($term, 0, 1) . "sortas"; + my($A, $B); + + $A = $a->{$sterm} || $a->{$term}; + $B = $b->{$sterm} || $b->{$term}; + + $A =~ s/^\s*//; $A =~ s/\s*$//; $A = uc($A); + $B =~ s/^\s*//; $B =~ s/\s*$//; $B = uc($B); + + return $A eq $B; +} + +sub end_entry { + # End any open elements... + print OUT "\n \n" if $lastout; + + foreach (@seealsos) { + # it'd be nice to make this a link... + print OUT $indent, " ", &escape($_), "\n"; + } + @seealsos = (); + + print OUT "\n\n"; + $lastout = ""; +} + +sub print_term { + # Print out the links for an indexterm. There can be more than + # one if the term has a ZONE that points to more than one place. + # (do we do the right thing in that case?) + my($idx) = shift; + my($key, $indent, @hrefs); + my(%href) = (); + my(%phref) = (); + + $indent = " "; + + if ($idx->{'see'}) { + # it'd be nice to make this a link... + if ($lastout) { + print OUT "\n \n"; + $lastout = ""; + } + print OUT $indent, "", &escape($idx->{'see'}), "\n"; + return; + } + + if (keys %{$idx->{'zone'}}) { + foreach $key (keys %{$idx->{'zone'}}) { + $href{$key} = $idx->{'zone'}->{$key}; + $phref{$key} = $key; + } + } else { + $href{$idx->{'href'}} = $idx->{'title'}; + $phref{$idx->{'href'}} = $idx->{'hrefpoint'}; + } + + # We can't use because we don't know the ID of the term in the + # original source (and, in fact, it might not have one). + print OUT ",\n"; + @hrefs = keys %href; + while (@hrefs) { + my($linkend) = ""; + my($role) = ""; + $key = shift @hrefs; + if ($linkpoints) { + $linkend = $phref{$key}; + } else { + $linkend = $key; + } + + $role = $phref{$key}; + $role = $1 if $role =~ /\#(.*)$/; + $role = $1 if $role =~ /(.*)\./; + + print OUT $indent; + print OUT ""; + print OUT "" if ($idx->{'significance'} eq 'PREFERRED'); + print OUT &escape($href{$key}); + print OUT "" if ($idx->{'significance'} eq 'PREFERRED'); + print OUT ""; + } + + if ($idx->{'seealso'}) { + push @seealsos, $idx->{'seealso'}; + } +} + +sub termsort { + my($aP) = $a->{'psortas'} || $a->{'primary'}; + my($aS) = $a->{'ssortas'} || $a->{'secondary'}; + my($aT) = $a->{'tsortas'} || $a->{'tertiary'}; + my($ap) = $a->{'count'}; + + my($bP) = $b->{'psortas'} || $b->{'primary'}; + my($bS) = $b->{'ssortas'} || $b->{'secondary'}; + my($bT) = $b->{'tsortas'} || $b->{'tertiary'}; + my($bp) = $b->{'count'}; + + $aP =~ s/^\s*//; $aP =~ s/\s*$//; $aP = uc($aP); + $aS =~ s/^\s*//; $aS =~ s/\s*$//; $aS = uc($aS); + $aT =~ s/^\s*//; $aT =~ s/\s*$//; $aT = uc($aT); + $bP =~ s/^\s*//; $bP =~ s/\s*$//; $bP = uc($bP); + $bS =~ s/^\s*//; $bS =~ s/\s*$//; $bS = uc($bS); + $bT =~ s/^\s*//; $bT =~ s/\s*$//; $bT = uc($bT); + + if ($aP eq $bP) { + if ($aS eq $bS) { + if ($aT eq $bT) { + # make sure seealso's always sort to the bottom + return 1 if ($a->{'seealso'}); + return -1 if ($b->{'seealso'}); + # if everything else is the same, keep these elements + # in document order (so the index links are in the right + # order) + return $ap <=> $bp; + } else { + return $aT cmp $bT; + } + } else { + return $aS cmp $bS; + } + } else { + return $aP cmp $bP; + } +} + +sub sortsymbols { + my(@term) = @_; + my(@new) = (); + my(@sym) = (); + my($letter); + my($idx); + + # Move the non-letter things to the front. Should digits be thier + # own group? Maybe... + foreach $idx (@term) { + $letter = $idx->{'psortas'}; + $letter = $idx->{'primary'} if !$letter; + $letter = uc(substr($letter, 0, 1)); + + if (($letter lt 'A') || ($letter gt 'Z')) { + push (@sym, $idx); + } else { + push (@new, $idx); + } + } + + return (@sym, @new); +} + +sub safe_open { + local(*OUT) = shift; + local(*F, $_); + + if (($outfile ne '-') && (!$forceoutput)) { + my($handedit) = 1; + if (open (OUT, $outfile)) { + while () { + if (//){ + $handedit = 0; + last; + } + } + close (OUT); + } else { + $handedit = 0; + } + + if ($handedit) { + print STDERR "$me: file \"$outfile\" appears to have been edited by hand\n"; + print STDERR "Use the -f option or specify a different output file name.\n"; + exit 1; + } + } + + open (OUT, ">$outfile") || die "$me: could not open file \"$outfile\": $!\n"; + + if ($preamble) { + # Copy the preamble + if (open(F, $preamble)) { + while () { + print OUT $_; + } + close(F); + } else { + warn "$me: could not open preamble file \"$preamble\": $!\n"; + } + } +} + +sub escape { + # make sure & and < don't show up in the index + local $_ = shift; + s/&/&/sg; + s//>/sg; # what the heck + + return $_; +} + + + +=head1 EXAMPLE + +B B<-o> F F + +=head1 EXIT STATUS + +=over 5 + +=item B<0> + +Success + +=item B<1> + +Failure + +=back + +=head1 AUTHOR + +Norm Walsh Endw@nwalsh.comE + +Minor updates by Adam Di Carlo Eadam@onshore.comE and Peter Eisentraut Epeter_e@gmx.netE + +=cut + diff --git a/bin/collateindex.pl.1 b/bin/collateindex.pl.1 new file mode 100644 index 0000000..a1b7020 --- /dev/null +++ b/bin/collateindex.pl.1 @@ -0,0 +1,214 @@ +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sh \" Subsection heading +.br +.if t .Sp +.ne 5 +.PP +\fB\\$1\fR +.PP +.. +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. | will give a +.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to +.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' +.\" expand to `' in nroff, nothing in troff, for use with C<>. +.tr \(*W-|\(bv\*(Tr +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.\" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.hy 0 +.if n .na +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "COLLATEINDEX 1" +.TH COLLATEINDEX 1 "2004-11-04" "docbook-dsssl 1.79" "DocBook DSSSL" +.SH "NAME" +collateindex.pl \- generate DocBook index files +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +\&\fBcollateindex.pl\fR [\fB\-f\fR] [\fB\-g\fR] [\fB\-i\fR \fIid\fR] [\fB\-I\fR \fIscope\fR] [\fB\-N\fR] + [\fB\-o\fR \fIfile\fR] [\fB\-p\fR] [\fB\-P\fR \fIfile\fR] [\fB\-q\fR] [\fB\-s\fR \fIname\fR] + [\fB\-S\fR \fIscope\fR] [\fB\-t\fR \fIname\fR] [\fB\-x\fR] \fIfile\fR +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +\&\fBcollateindex.pl\fR creates index data for DocBook \s-1XML\s0 or \s-1SGML\s0 files. +.SH "OPTIONS" +.IX Header "OPTIONS" +.IP "\fB\-f\fR" 5 +.IX Item "-f" +Force the output file to be written, even if it appears to have been +edited by hand. +.IP "\fB\-g\fR" 5 +.IX Item "-g" +Group terms with IndexDiv based on the first letter of the term (or +its SortAs attribute). (This might not handle all language environments.) +.IP "\fB\-i\fR \fIid\fR" 5 +.IX Item "-i id" +The \s-1ID\s0 to use for the tag. +.IP "\fB\-I\fR \fIscope\fR" 5 +.IX Item "-I scope" +The implied scope, must be \f(CW\*(C`all\*(C'\fR, \f(CW\*(C`local\*(C'\fR, or \f(CW\*(C`global\*(C'\fR. IndexTerms +which do not specify a scope will have the implied scope. If +unspecified, \f(CW\*(C`all\*(C'\fR is assumed. +.IP "\fB\-N\fR" 5 +.IX Item "-N" +New index (generates an empty index file). +.IP "\fB\-o\fR \fIfile\fR" 5 +.IX Item "-o file" +Output to \fIfile\fR. Defaults to \fIstdout\fR. +.IP "\fB\-p\fR" 5 +.IX Item "-p" +Link to points in the document. The default is to link to the closest +containing section. +.IP "\fB\-P\fR \fIfile\fR" 5 +.IX Item "-P file" +Read a preamble from \fIfile\fR. The contents of \fIfile\fR will be +inserted before the tag. +.IP "\fB\-q\fR" 5 +.IX Item "-q" +Run quietly. +.IP "\fB\-s\fR \fIname\fR" 5 +.IX Item "-s name" +Name the IndexDiv that contains symbols. The default is \f(CW\*(C`Symbols\*(C'\fR. +Meaningless if \fB\-g\fR is not used. +.IP "\fB\-S\fR \fIscope\fR" 5 +.IX Item "-S scope" +Scope of the index, must be \f(CW\*(C`all\*(C'\fR, \f(CW\*(C`local\*(C'\fR, or \f(CW\*(C`global\*(C'\fR. If +unspecified, \f(CW\*(C`all\*(C'\fR is assumed. +.IP "\fB\-t\fR \fIname\fR" 5 +.IX Item "-t name" +Title for the index. +.IP "\fB\-x\fR" 5 +.IX Item "-x" +Make a SetIndex. +.IP "\fB\-V\fR" 5 +.IX Item "-V" +Print version number and exit. +.IP "\fIfile\fR" 5 +.IX Item "file" +The file containing index data generated with the DocBook \s-1DSSSL\s0 +\&\s-1HTML\s0 stylesheet (usually called \fI\s-1HTML\s0.index\fR). +.SH "EXAMPLE" +.IX Header "EXAMPLE" +\&\fBcollateindex.pl\fR \fB\-o\fR \fIindex.sgml\fR \fI\s-1HTML\s0.index\fR +.SH "EXIT STATUS" +.IX Header "EXIT STATUS" +.IP "\fB0\fR" 5 +.IX Item "0" +Success +.IP "\fB1\fR" 5 +.IX Item "1" +Failure +.SH "AUTHOR" +.IX Header "AUTHOR" +Norm Walsh +.PP +Minor updates by Adam Di Carlo and Peter Eisentraut diff --git a/catalog b/catalog new file mode 100644 index 0000000..df05b02 --- /dev/null +++ b/catalog @@ -0,0 +1,53 @@ +OVERRIDE YES + +-- Stylesheets -- + +PUBLIC "-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN" + print/docbook.dsl + +PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" + html/docbook.dsl + +PUBLIC "-//Norman Walsh//DOCUMENT DSSSL Library//EN" + lib/dblib.dsl + +PUBLIC "-//Norman Walsh//DOCUMENT DSSSL Library V2//EN" + lib/dblib.dsl + +-- DTDs -- + +PUBLIC "+//IDN nwalsh.com//DTD DocBook DSSSL Architecture V1.0//EN" + dtds/dbdsssl/dbdsssl.dtd + +PUBLIC "-//Norman Walsh//DTD DocBook OLink Summary V1.1//EN" + dtds/olink/olinksum.dtd + +PUBLIC "-//Norman Walsh//DTD DocBook HTML 1.0//EN" + dtds/html/dbhtml.dtd + +DTDDECL "-//Norman Walsh//DTD DocBook HTML 1.0//EN" + dtds/html/dbhtml.dcl + +PUBLIC "-//Norman Walsh//DTD Image Library 1.0//EN" + dtds/imagelib/imagelib.dtd + +-- Entities -- + +PUBLIC "ISO 8879-1986//ENTITIES Added Latin 1//EN//HTML" + dtds/html/ISOlat1.gml + +-- Documents -- + +PUBLIC "-//Norman Walsh//DOCUMENT DocBook DSSSL Stylesheet Documentation V1.0//EN" + docsrc/docbook.sgm + +PUBLIC "-//Norman Walsh//DOCUMENT OLink Test Document V1.0//EN" + docsrc/olinktarget.sgm + +PUBLIC "-//Norman Walsh//DOCUMENT OLink Semantics in the DocBook DSSSL Stylesheets V1.0//EN" + docsrc/olinksemantics.sgm + +-- Declarations -- + +-- SGMLDECL "dtds/decls/docbook.dcl" -- + diff --git a/common/ChangeLog b/common/ChangeLog new file mode 100644 index 0000000..bfdbc87 --- /dev/null +++ b/common/ChangeLog @@ -0,0 +1,157 @@ +2004-10-10 + + * dbcommon.dsl: Give othercredit some useful rendering in print output, by copying over the + author rendering. Fix author-list-string for authorgroups that contain + both authors and othercredits. (bug #1038081) + +2004-10-09 + + * .cvsignore, Makefile, dbl10n.dsl, dbl10n.ent, dbl10n.template, dbl1bg.dsl: + New Bulgarian translation by Viktor Vasilev (SF patch #1040075) + + * dbl1bs.dsl: Additional fixes for Bosnian translation, by Kemal Skripic (SF patch + #1037371) + +2004-09-22 Michael Smith + + * .cvsignore: dbl1bs.ent added to ignore list; also re-sorted list + +2004-09-17 + + * Makefile, dbl10n.dsl, dbl10n.ent, dbl10n.template, dbl1bs.dsl: + Bosnian translation by Kemal Skripic + +2003-04-28 Adam Di Carlo + + * dbcommon.dsl: Fix a problem pointed out by Tim Waugh in articleinfo vs artheader in + the article-title procedure. Also ensure articleinfo is used in some + other contexts. + +2003-01-15 Adam Di Carlo + + * dbcommon.dsl: make
appear correctly in the PDF bookmark hierarchy; also + fix font size selection for section titles + + corrects sourceforge bugs 589247 and 524028; patch from Carsten Haese + appreciated + +2002-12-20 Adam Di Carlo + + * dbl1en.dsl: fix up some case-folding incidents + +2002-08-07 Adam Di Carlo + + * Makefile: dbl1he.ent doesn't exist, was breaking build + +2002-06-06 Norman Walsh + + * dbl1tr.dsl: Patch #554930: obvious gentext-tr-intra-label-sep fix + +2002-04-29 Norman Walsh + + * .cvsignore, Makefile: (Incomplete) support for Hebrew + +2002-03-24 Adam Di Carlo + + * .cvsignore, Makefile: suffix rules for the *.ent production; add a rule to create a catalog + automatically form the *.dsl files + + * Makefile: clean shouldn't remove dbl10n.ent + +2002-03-20 Norman Walsh + + * dbl10n.dsl: Remove duplicated comment + +2002-02-22 Norman Walsh + + * dbcommon.dsl: Fix test for articles in books + +2002-02-20 Norman Walsh + + * dbl1fr.dsl: Fix French quotes + +2002-01-03 Norman Walsh + + * .cvsignore, Makefile: Added Thai localization + +2001-12-04 Norman Walsh + + * dbcommon.dsl: Bug #435320: Poor enumeration of LoTs and LoFs + +2001-12-01 Norman Walsh + + * dbcommon.dsl: Bug #473531 numbering of blocks when the root element is not a component + +2001-11-30 Norman Walsh + + * .cvsignore, dbl10n.ent: Merged V174bugfixes + + * .cvsignore, dbl10n.ent: New file. + + * dbcommon.dsl: Patch #473116: Section levels + + * dbl10n.ent: branches: 1.1.2; + file dbl10n.ent was initially added on branch V174bugfixes. + +2001-11-20 Norman Walsh + + * dbcommon.dsl: Support artheader or articleinfo as the info-element of an article + +2001-11-14 Norman Walsh + + * Makefile, dbl10n.dsl, dbl10n.pl, dbl10n.template, dbl1eu.dsl, dbl1nn.dsl, dbl1uk.dsl, dbl1xh.dsl: + Added Basque, Nynorsk, Ukranian, and Xhosa + +2001-09-23 Norman Walsh + + * dbcommon.dsl: Patch #461632, title sizes for bibliography and index divs + + * dbcommon.dsl: Patch #460349, don't check extension for linespecific inclusions + +2001-09-09 Norman Walsh + + * dbcommon.dsl: Bug #459209, allow format attribute to be absent + +2001-09-06 Jirka Kosek + + * dbl1cs.dsl: Synchronized with localization in cs.xml + +2001-08-30 Norman Walsh + + * dbcommon.dsl: Fix XML/SGML discrepancy wrt normalization of notation names; move some common stuff into dbcommon + +2001-07-04 + + * Makefile, dbl10n.dsl, dbl1af.dsl, dbl1tr.dsl: Added Afrikaans and Turkish + +2001-06-20 Norman Walsh + + * dbcommon.dsl, dbl10n.dsl, dbl1ca.dsl, dbl1cs.dsl, dbl1da.dsl, dbl1de.dsl, dbl1el.dsl, dbl1en.dsl, dbl1es.dsl, dbl1et.dsl, dbl1fi.dsl, dbl1fr.dsl, dbl1hu.dsl, dbl1id.dsl, dbl1it.dsl, dbl1ja.dsl, dbl1ko.dsl, dbl1nl.dsl, dbl1no.dsl, dbl1pl.dsl, dbl1pt.dsl, dbl1ptbr.dsl, dbl1ro.dsl, dbl1ru.dsl, dbl1sk.dsl, dbl1sl.dsl, dbl1sr.dsl, dbl1sv.dsl, dbl1zhcn.dsl, dbl1zhtw.dsl: + Updated support for locale-sensitive commas in lists + +2001-05-11 Norman Walsh + + * dbl10n.dsl, dbl1sr.dsl, dbl1zhtw.dsl: Support Serbian and Traditional Chinese + +2001-05-04 Norman Walsh + + * Makefile: Add (partial support for) Serbian localization + +2001-04-20 Norman Walsh + + * Makefile, cs-hack.pl: Fixed charset issues that caused the .ent files not to work in SGML + +2001-04-09 Norman Walsh + + * dbl1ko.dsl: Updates from Park Yong Joo + +2001-04-02 Norman Walsh + + * .cvsignore: branches: 1.1.2; + Added Makefiles to build common/*.ent + + * Makefile: New file. + + * dbcommon.dsl, dbl10n.dsl, dbl1ca.dsl, dbl1cs.dsl, dbl1da.dsl, dbl1de.dsl, dbl1el.dsl, dbl1en.dsl, dbl1es.dsl, dbl1et.dsl, dbl1fi.dsl, dbl1fr.dsl, dbl1hu.dsl, dbl1id.dsl, dbl1it.dsl, dbl1ja.dsl, dbl1ko.dsl, dbl1nl.dsl, dbl1no.dsl, dbl1null.dsl, dbl1pl.dsl, dbl1pt.dsl, dbl1ptbr.dsl, dbl1ro.dsl, dbl1ru.dsl, dbl1sk.dsl, dbl1sl.dsl, dbl1sv.dsl, dbl1zhcn.dsl, dbtable.dsl: + New file. + diff --git a/common/catalog b/common/catalog new file mode 100644 index 0000000..5829925 --- /dev/null +++ b/common/catalog @@ -0,0 +1,37 @@ +OVERRIDE YES +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//AF" "dbl1af.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//BG" "dbl1bg.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//BS" "dbl1bs.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//CA" "dbl1ca.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//CS" "dbl1cs.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//DA" "dbl1da.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//DE" "dbl1de.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//EL" "dbl1el.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//EN" "dbl1en.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//ES" "dbl1es.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//ET" "dbl1et.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//EU" "dbl1eu.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//FI" "dbl1fi.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//FR" "dbl1fr.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//HU" "dbl1hu.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//IN" "dbl1id.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//IT" "dbl1it.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//JA" "dbl1ja.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//KO" "dbl1ko.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//NL" "dbl1nl.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//NN" "dbl1nn.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//NO" "dbl1no.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//PL" "dbl1pl.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//PT" "dbl1pt.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//PTBR" "dbl1ptbr.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//RO" "dbl1ro.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//RU" "dbl1ru.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//SK" "dbl1sk.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//SL" "dbl1sl.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//SR" "dbl1sr.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//SV" "dbl1sv.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//TR" "dbl1tr.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//UK" "dbl1uk.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//XH" "dbl1xh.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//ZHCN" "dbl1zhcn.ent" +PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//ZHTW" "dbl1zhtw.ent" diff --git a/common/cs-hack.pl b/common/cs-hack.pl new file mode 100644 index 0000000..7f1c1ee --- /dev/null +++ b/common/cs-hack.pl @@ -0,0 +1,8 @@ +#!/bin/perl -- # -*- Perl -*- + +# Charset hacking... + +while (<>) { + s/\&\#(\d+);/sprintf("\\U-%04X;", $1)/egs; + print; +} diff --git a/common/dbcommon.dsl b/common/dbcommon.dsl new file mode 100644 index 0000000..16e133b --- /dev/null +++ b/common/dbcommon.dsl @@ -0,0 +1,1904 @@ +;; $Id: dbcommon.dsl,v 1.14 2004/10/10 21:15:05 petere78 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; +;; This file contains general functions common to both print and HTML +;; versions of the DocBook stylesheets. +;; + +;; If **ANY** change is made to this file, you _MUST_ alter the +;; following definition: + +(define %docbook-common-version% + "Modular DocBook Stylesheet Common Functions") + +;; === element lists ==================================================== + +;; these have to be functions because they have to be evaluated when +;; there is a current-node so that normalize can know what declaration +;; is in effect + +(define (set-element-list) + (list (normalize "set"))) + +(define (book-element-list) + (list (normalize "book"))) + +(define (division-element-list) + (list (normalize "part"))) + +(define (component-element-list) + (list (normalize "preface") + (normalize "chapter") + (normalize "appendix") + (normalize "article") + (normalize "glossary") + (normalize "bibliography") + (normalize "index") + (normalize "colophon") + (normalize "setindex") + (normalize "reference") + (normalize "refentry") + (normalize "book"))) ;; just in case nothing else matches... + +(define (major-component-element-list) + (list (normalize "preface") + (normalize "chapter") + (normalize "appendix") + (normalize "article") + (normalize "glossary") + (normalize "bibliography") + (normalize "index") + (normalize "colophon") + (normalize "setindex") + (normalize "reference") + (normalize "refentry") + (normalize "part") + (normalize "book"))) ;; just in case nothing else matches... + +(define (section-element-list) + (list (normalize "sect1") + (normalize "sect2") + (normalize "sect3") + (normalize "sect4") + (normalize "sect5") + (normalize "section") + (normalize "simplesect") + (normalize "refsect1") + (normalize "refsect2") + (normalize "refsect3"))) + +(define (block-element-list) + (list (normalize "example") + (normalize "figure") + (normalize "table") + (normalize "equation") + (normalize "procedure"))) + +(define (outer-parent-list) + (list (normalize "toc") + (normalize "lot") + (normalize "appendix") + (normalize "chapter") + (normalize "part") + (normalize "preface") + (normalize "reference") + (normalize "bibliography") + (normalize "glossary") + (normalize "index") + (normalize "setindex") + (normalize "sect1") + (normalize "sect2") + (normalize "sect3") + (normalize "sect4") + (normalize "sect5") + (normalize "simplesect") + (normalize "partintro") + (normalize "bibliodiv") + (normalize "glossdiv") + (normalize "indexdiv") + (normalize "refentry") + (normalize "refsect1") + (normalize "refsect2") + (normalize "refsect3") + (normalize "msgtext") + (normalize "msgexplan"))) + +(define (list-element-list) + (list (normalize "orderedlist") + (normalize "itemizedlist") + (normalize "variablelist") + (normalize "segmentedlist") + (normalize "simplelist") + (normalize "calloutlist") + (normalize "step"))) + +(define (info-element-list) + (list (normalize "appendixinfo") + (normalize "articleinfo") + (normalize "bibliographyinfo") + (normalize "bookinfo") + (normalize "chapterinfo") + (normalize "glossaryinfo") + (normalize "indexinfo") + (normalize "objectinfo") + (normalize "partinfo") + (normalize "prefaceinfo") + (normalize "refentryinfo") + (normalize "referenceinfo") + (normalize "refsect1info") + (normalize "refsect2info") + (normalize "refsect3info") + (normalize "refsynopsisdivinfo") + (normalize "sect1info") + (normalize "sect2info") + (normalize "sect3info") + (normalize "sect4info") + (normalize "sect5info") + (normalize "sectioninfo") + (normalize "setindexinfo") + (normalize "setinfo") + (normalize "sidebarinfo") + ;; historical + (normalize "artheader") + (normalize "docinfo"))) + +;; === automatic TOC ==================================================== + +;; Returns #t if nd should appear in the auto TOC +(define (appears-in-auto-toc? nd) + (if (or (equal? (gi nd) (normalize "refsect1")) + (have-ancestor? (normalize "refsect1") nd)) + #f + #t)) + +;; # return elements of nl for which appears-in-auto-toc? is #t +(define (toc-list-filter nodelist) + (let loop ((toclist (empty-node-list)) (nl nodelist)) + (if (node-list-empty? nl) + toclist + (if (appears-in-auto-toc? (node-list-first nl)) + (loop (node-list toclist (node-list-first nl)) + (node-list-rest nl)) + (loop toclist (node-list-rest nl)))))) + +;; === common =========================================================== + +(define (INLIST?) + (has-ancestor-member? (current-node) (list-element-list))) + +(define (INBLOCK?) + (has-ancestor-member? (current-node) + (list (normalize "example") + (normalize "informalexample") + (normalize "figure") + (normalize "informalfigure") + (normalize "equation") + (normalize "informalequation") + (normalize "funcsynopsis") + (normalize "programlistingco") + (normalize "screenco") + (normalize "graphicco")))) + +(define (PARNUM) + (child-number (parent (current-node)))) + +(define (NESTEDFNUM n fmt) + (if (number? n) + (format-number n fmt) + #f)) + +(define (FNUM n) (NESTEDFNUM n "1")) + +(define (book-start?) + ;; Returns #t if the current-node is in the first division or + ;; component of a book. + (let ((book (ancestor (normalize "book"))) + (nd (ancestor-member + (current-node) + (append (component-element-list) (division-element-list))))) + (let loop ((ch (children book))) + (if (node-list-empty? ch) + #f + (if (member (gi (node-list-first ch)) + (append (component-element-list) (division-element-list))) + (node-list=? (node-list-first ch) nd) + (loop (node-list-rest ch))))))) + +(define (first-chapter?) + ;; Returns #t if the current-node is in the first chapter of a book + (let* ((book (ancestor (normalize "book"))) + (nd (ancestor-member + (current-node) + (append (component-element-list) (division-element-list)))) + (bookch (children book)) + (bookcomp (expand-children bookch (list (normalize "part"))))) + (let loop ((nl bookcomp)) + (if (node-list-empty? nl) + #f + (if (equal? (gi (node-list-first nl)) (normalize "chapter")) + (if (node-list=? (node-list-first nl) nd) + #t + #f) + (loop (node-list-rest nl))))))) + +;; === bibliographic ==================================================== + +;; Localized author-string + +(define (author-list-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of AUTHOR + ;; *including appropriate punctuation* if the AUTHOR occurs in a list + ;; of AUTHORs in an AUTHORGROUP: + ;; + ;; John Doe + ;; or + ;; John Doe and Jane Doe + ;; or + ;; John Doe, Jane Doe, and A. Nonymous + ;; + + (let* ((author-node-list (select-elements + (descendants + (ancestor (normalize "authorgroup") author)) + (normalize "author"))) + (corpauthor-node-list (select-elements + (descendants + (ancestor (normalize "authorgroup") author)) + (normalize "corpauthor"))) + (othercredit-node-list (select-elements + (descendants + (ancestor (normalize "authorgroup") author)) + (normalize "othercredit"))) + (editor-node-list (select-elements + (descendants + (ancestor (normalize "authorgroup"))) + (normalize "editor"))) + (author-count (if (have-ancestor? (normalize "authorgroup") author) + (+ (node-list-length author-node-list) + (node-list-length corpauthor-node-list) + (node-list-length othercredit-node-list) + (node-list-length editor-node-list)) + 1)) + (this-count (if (have-ancestor? (normalize "authorgroup") author) + (+ (node-list-length (preced author)) 1) + 1))) + (string-append + (if (and (> author-count 1) + (absolute-last-sibling? author)) + (string-append (gentext-and) " ") + "") + + (author-string author) + + (if (> author-count 2) + (if (> (- author-count this-count) 1) + (gentext-listcomma) + (if (= (- author-count this-count) 1) + (gentext-lastlistcomma) + "")) + "") + (if (and (> author-count 1) + (not (absolute-last-sibling? author))) + " " + "")))) + +;; === procedures ======================================================= + +(define ($proc-hierarch-number-format$ depth) + (case (modulo depth 5) + ((1) "1") + ((2) "a") + ((3) "i") + ((4) "A") + (else "I"))) + +(define ($proc-hierarch-number$ nd seperator) + (if (equal? (gi nd) (normalize "step")) + (string-append + (format-number + (child-number nd) + ($proc-hierarch-number-format$ ($proc-step-depth$ nd))) + seperator) + "")) + +(define ($proc-step-depth$ nd) + (let loop ((step nd) (depth 0)) + (if (equal? (gi step) (normalize "procedure")) + depth + (loop (parent step) + (if (equal? (gi step) (normalize "step")) + (+ depth 1) + depth))))) + +(define ($proc-step-number$ nd) + (let* ((step (if (equal? (gi nd) (normalize "step")) nd (parent nd))) + (str ($proc-hierarch-number$ step ""))) + (string-append str (gentext-label-title-sep (normalize "step"))))) + +(define ($proc-step-xref-number$ nd) + (let loop ((step nd) (str "") (first #t)) + (if (equal? (gi step) (normalize "procedure")) + str + (loop (parent step) + (if (equal? (gi step) (normalize "step")) + (string-append + ($proc-hierarch-number$ step + (if first + "" + (gentext-intra-label-sep (normalize "step")))) + str) + str) + (if (equal? (gi step) (normalize "step")) + #f + first))))) + +;; === sections ========================================================= + +(define (section-level-by-gi chunked? gi) + ;; Figure out the heading level of an element by its name. We need + ;; to distinguish between the chunked processing mode (for HTML) and + ;; the non-chunked (print or HTML). It is important that no heading + ;; level is skipped in a document structure (e.g., sect1 = 2, sect2 + ;; = 4); this results in broken PDF bookmarks. + (if chunked? + (cond + ((equal? gi (normalize "sect5")) 5) + ((equal? gi (normalize "sect4")) 4) + ((equal? gi (normalize "sect3")) 3) + ((equal? gi (normalize "sect2")) 2) + ((equal? gi (normalize "sect1")) 1) + ((equal? gi (normalize "refsect3")) 4) + ((equal? gi (normalize "refsect2")) 3) + ((equal? gi (normalize "refsect1")) 2) + ((equal? gi (normalize "refsynopsisdiv")) 2) + ((equal? gi (normalize "bibliography")) 1) + ((equal? gi (normalize "bibliodiv")) 2) + ((equal? gi (normalize "index")) 1) + ((equal? gi (normalize "setindex")) 1) + ((equal? gi (normalize "indexdiv")) 2) + (else 1)) + (cond + ((equal? gi (normalize "sect5")) 6) + ((equal? gi (normalize "sect4")) 5) + ((equal? gi (normalize "sect3")) 4) + ((equal? gi (normalize "sect2")) 3) + ((equal? gi (normalize "sect1")) 2) + ;; The next four are not used by the HTML stylesheets. + ((equal? gi (normalize "refsect3")) 5) + ((equal? gi (normalize "refsect2")) 4) + ((equal? gi (normalize "refsect1")) 3) + ((equal? gi (normalize "refsynopsisdiv")) 3) + ((equal? gi (normalize "bibliography")) 1) + ((equal? gi (normalize "bibliodiv")) 2) + ((equal? gi (normalize "index")) 1) + ((equal? gi (normalize "setindex")) 1) + ((equal? gi (normalize "indexdiv")) 2) + (else 1)))) + +(define (section-level-by-node chunked? sect) + (if (equal? (gi sect) (normalize "section")) + ;; Section is special, it is recursive. + (let ((depth (length (hierarchical-number-recursive + (normalize "section"))))) + (if (> depth 5) + 6 + (if chunked? (+ depth 1) (+ depth 2)))) + (if (equal? (gi sect) (normalize "simplesect")) + ;; SimpleSect is special, it should be level "n+1", where "n" is + ;; the level of the numbered section that contains it. If it is + ;; the *first* sectioning element in a chapter, make it + ;; %default-simplesect-level% + (cond + ((have-ancestor? (normalize "sect5")) + (+ 1 (section-level-by-gi chunked? (normalize "sect5")))) + ((have-ancestor? (normalize "sect4")) + (+ 1 (section-level-by-gi chunked? (normalize "sect4")))) + ((have-ancestor? (normalize "sect3")) + (+ 1 (section-level-by-gi chunked? (normalize "sect3")))) + ((have-ancestor? (normalize "sect2")) + (+ 1 (section-level-by-gi chunked? (normalize "sect2")))) + ((have-ancestor? (normalize "sect1")) + (+ 1 (section-level-by-gi chunked? (normalize "sect1")))) + ((have-ancestor? (normalize "refsect3")) + (+ 1 (section-level-by-gi chunked? (normalize "refsect3")))) + ((have-ancestor? (normalize "refsect2")) + (+ 1 (section-level-by-gi chunked? (normalize "refsect2")))) + ((have-ancestor? (normalize "refsect1")) + (+ 1 (section-level-by-gi chunked? (normalize "refsect1")))) + (else %default-simplesect-level%)) + ;; the rest of the section elements can be identified by name + (section-level-by-gi chunked? (gi sect))))) + +;; === synopsis ========================================================= + +;; The following definitions match those given in the reference +;; documentation for DocBook V3.0 +(define %arg-choice-opt-open-str% "[") +(define %arg-choice-opt-close-str% "]") +(define %arg-choice-req-open-str% "{") +(define %arg-choice-req-close-str% "}") +(define %arg-choice-plain-open-str% " ") +(define %arg-choice-plain-close-str% " ") +(define %arg-choice-def-open-str% "[") +(define %arg-choice-def-close-str% "]") +(define %arg-rep-repeat-str% "...") +(define %arg-rep-norepeat-str% "") +(define %arg-rep-def-str% "") +(define %arg-or-sep% " | ") +(define %cmdsynopsis-hanging-indent% 4pi) + +;; === linking ========================================================== + +;; From the DocBook V3.0 Reference entry for element XREF: +;; +;; Description +;; +;; Cross reference link to another part of the document. XRef is empty, +;; and has common, Linkend, and Endterm attributes. +;; +;; Processing Expectations +;; +;; XRef must have a Linkend, but the Endterm is optional. If it is used, +;; the content of the element it points to is displayed as the text of +;; the cross reference; if it is absent, the XRefLabel of the +;; cross-referenced object is displayed. +;; +;; If neither the ENDTERM nor the XREFLABEL is present, then the cross +;; reference text is taken from the (gentext-xref-strings) function +;; in the localization file, like this +;; +;; A cross reference to an element, the target, begins with the +;; text returned by (gentext-xref-strings (gi target)). Within +;; that text, the following substitutions are made: +;; +;; %p is replaced by the number of the page on which target occurs +;; %g is replaced by the (gentext-element-name) +;; %n is replaced by the label +;; %t is replaced by the title +;; +;; After the "direct" cross reference, a number of indirect references +;; are possible. If the target element is in a different block, section, +;; component, division, or book an indirect cross reference may be made. +;; +;; The indirect cross reference will only be made if +;; +;; (auto-xref-indirect? target ancestor) +;; +;; returns #t. The indirect reference is created by appending the +;; connect returned by (auto-xref-indirect-connector) to the direct +;; reference and then adding a direct refernce to the ancestor. +;; The process is repeated for each ancestral element. +;; +;; For example, if a direct reference to a section returns +;; +;; "the section called %t" +;; +;; and a direct reference to a chapter returns +;; +;; "Chapter %n" +;; +;; and (auto-xref-indirect? sect1 chapter) returns #t, and +;; (auto-xref-indirect-connector chapter) returns "in", then +;; an xref to a section in another chapter will be: +;; +;; "the section called %t in Chapter %n" +;; +;; Where %t and %n will be filled in accordingly. +;; +;; ====================================================================== + +(define (auto-xref-indirect? target ancestor) + ;; This function answers the question: should an indirect reference + ;; to ancestor be made for target? For example: + ;; + ;; (auto-xref-indirect? SECT1 CHAP) + ;; + ;; should return #t iff a reference of the form "in [CHAP-xref]" should + ;; be generated for a reference to SECT1 if SECT1 is in a different + ;; chapter than the XREF to SECT1. + ;; + ;; This function _does not_ have to consider the case of whether or + ;; not target and the xref are in the same ancestor. + ;; + (cond + ;; Always add indirect references to another book + ((member (gi ancestor) (book-element-list)) + #t) + ;; Add indirect references to the section or component a block + ;; is in iff chapters aren't autolabelled. (Otherwise "Figure 1-3" + ;; is sufficient) + ((and (member (gi target) (block-element-list)) + (not %chapter-autolabel%)) + #t) + ;; Add indirect references to the component a section is in if + ;; the sections are not autolabelled + ((and (member (gi target) (section-element-list)) + (member (gi ancestor) (component-element-list)) + (not %section-autolabel%)) + #t) + (else #f))) + +(define (auto-xref-direct target + #!optional + (xref-string (gentext-xref-strings target))) + (let* ((substitute (list + (list "%g" (element-gi-sosofo target)) + (list "%n" (element-label-sosofo target)) + (list "%p" (element-page-number-sosofo target)) + (list "%t" (element-title-xref-sosofo target)))) + (tlist (match-split-list xref-string (assoc-objs substitute)))) + (string-list-sosofo tlist substitute))) + +(define (auto-xref-indirect target + #!optional + (xref-string (gentext-xref-strings target))) + (make sequence + (auto-xref-indirect-connector target) + (auto-xref-direct target xref-string))) + +(define (auto-xref target + #!optional (xref-string (gentext-xref-strings target))) + (let ((source (current-node)) + (cont-blok (ancestor-member target (block-element-list))) + (cont-sect (ancestor-member target (section-element-list))) + (cont-comp (ancestor-member target (component-element-list))) + (cont-divn (ancestor-member target (division-element-list))) + (cont-book (ancestor-member target (book-element-list)))) + (make sequence + (auto-xref-direct target xref-string) + (if (or (node-list=? cont-blok + (ancestor-member source (block-element-list))) + (node-list=? cont-blok target) + (not (auto-xref-indirect? target cont-blok))) + (empty-sosofo) + (auto-xref-indirect cont-blok)) + (if (or (node-list=? cont-sect + (ancestor-member source (section-element-list))) + (node-list=? cont-sect target) + (not (auto-xref-indirect? target cont-sect))) + (empty-sosofo) + (auto-xref-indirect cont-sect)) + (if (or (node-list=? cont-comp + (ancestor-member source (component-element-list))) + (node-list=? cont-comp target) + (not (auto-xref-indirect? target cont-comp))) + (empty-sosofo) + (auto-xref-indirect cont-comp)) + (if (or (node-list=? cont-divn + (ancestor-member source (division-element-list))) + (node-list=? cont-divn target) + (not (auto-xref-indirect? target cont-divn))) + (empty-sosofo) + (auto-xref-indirect cont-divn)) + (if (or (node-list=? cont-book + (ancestor-member source (book-element-list))) + (node-list=? cont-book target) + (not (auto-xref-indirect? target cont-book))) + (empty-sosofo) + (auto-xref-indirect cont-book))))) + +;; ====================================================================== + +(define (set-number-restart-list cmp) (list (normalize "set"))) +(define (book-number-restart-list cmp) (list (normalize "set"))) +(define (part-number-restart-list cmp) (list (normalize "book"))) +(define (reference-number-restart-list cmp) (list (normalize "book"))) +(define (preface-number-restart-list cmp) (list (normalize "book"))) +(define (chapter-number-restart-list cmp) (list (normalize "book"))) +(define (appendix-number-restart-list cmp) (list (normalize "book") + (normalize "article"))) +(define (article-number-restart-list cmp) (list (normalize "book"))) +(define (glossary-number-restart-list cmp) (list (normalize "book"))) +(define (bibliography-number-restart-list cmp) (list (normalize "book"))) +(define (index-number-restart-list cmp) (list (normalize "book"))) +(define (setindex-number-restart-list cmp) (list (normalize "set"))) +(define (refentry-number-restart-list cmp) (list (normalize "reference"))) +(define (default-number-restart-list cmp) (list (normalize "book"))) + +(define (component-number-restart-list cmp) + ;; Return the list of elements at which numbering of 'cmp' should reset. + ;; For example, for CHAPTER, it might return '("BOOK") causing chapters + ;; to be sequentially numbered across a book. If it returned + ;; '("BOOK" "PART") then chapter numbering would restart at each + ;; BOOK or PART. + (let ((name (gi cmp))) + (cond + ((equal? name (normalize "set")) (set-number-restart-list cmp)) + ((equal? name (normalize "book")) (book-number-restart-list cmp)) + ((equal? name (normalize "part")) (part-number-restart-list cmp)) + ((equal? name (normalize "reference")) (reference-number-restart-list cmp)) + ((equal? name (normalize "preface")) (preface-number-restart-list cmp)) + ((equal? name (normalize "chapter")) (chapter-number-restart-list cmp)) + ((equal? name (normalize "appendix")) (appendix-number-restart-list cmp)) + ((equal? name (normalize "article")) (article-number-restart-list cmp)) + ((equal? name (normalize "glossary")) (glossary-number-restart-list cmp)) + ((equal? name (normalize "bibliography")) (bibliography-number-restart-list cmp)) + ((equal? name (normalize "index")) (index-number-restart-list cmp)) + ((equal? name (normalize "setindex")) (setindex-number-restart-list cmp)) + ((equal? name (normalize "refentry")) (refentry-number-restart-list cmp)) + (else (default-number-restart-list cmp))))) + +(define (set-number-ignore-list cmp) '()) +(define (book-number-ignore-list cmp) '()) +(define (part-number-ignore-list cmp) '()) +(define (reference-number-ignore-list cmp) (list (normalize "part"))) +(define (preface-number-ignore-list cmp) (list (normalize "part"))) +(define (chapter-number-ignore-list cmp) (list (normalize "part"))) +(define (appendix-number-ignore-list cmp) (list (normalize "part"))) +(define (article-number-ignore-list cmp) (list (normalize "part"))) +(define (glossary-number-ignore-list cmp) (list (normalize "part"))) +(define (bibliography-number-ignore-list cmp) (list (normalize "part"))) +(define (index-number-ignore-list cmp) (list (normalize "part"))) +(define (setindex-number-ignore-list cmp) (list (normalize "part"))) +(define (refentry-number-ignore-list cmp) '()) +(define (default-number-ignore-list cmp) '()) + +(define (component-number-ignore-list cmp) + ;; Return the list of elements (inside the restart list) which are + ;; hierarchy levels which should be ignored. For example, for CHAPTER, + ;; it might return '("PART") causing chapter numbering inside books + ;; to ignore parts. + ;; + ;; Basically, if you skip up past a component/division element in + ;; the restart list, you better put the element(s) you skipped in + ;; the ignore list or the stylesheet may never see your component + ;; when it's trying to do the numbering. + (let ((name (gi cmp))) + (cond + ((equal? name (normalize "set")) (set-number-ignore-list cmp)) + ((equal? name (normalize "book")) (book-number-ignore-list cmp)) + ((equal? name (normalize "part")) (part-number-ignore-list cmp)) + ((equal? name (normalize "reference")) (reference-number-ignore-list cmp)) + ((equal? name (normalize "preface")) (preface-number-ignore-list cmp)) + ((equal? name (normalize "chapter")) (chapter-number-ignore-list cmp)) + ((equal? name (normalize "appendix")) (appendix-number-ignore-list cmp)) + ((equal? name (normalize "article")) (article-number-ignore-list cmp)) + ((equal? name (normalize "glossary")) (glossary-number-ignore-list cmp)) + ((equal? name (normalize "bibliography")) (bibliography-number-ignore-list cmp)) + ((equal? name (normalize "index")) (index-number-ignore-list cmp)) + ((equal? name (normalize "setindex")) (setindex-number-ignore-list cmp)) + ((equal? name (normalize "refentry")) (refentry-number-ignore-list cmp)) + (else (default-number-ignore-list cmp))))) + +(define (set-number-sibling-list cmp) '()) +(define (book-number-sibling-list cmp) '()) +(define (part-number-sibling-list cmp) '()) +(define (reference-number-sibling-list cmp) '()) +(define (preface-number-sibling-list cmp) '()) +(define (chapter-number-sibling-list cmp) '()) +(define (appendix-number-sibling-list cmp) '()) +(define (article-number-sibling-list cmp) '()) +(define (glossary-number-sibling-list cmp) '()) +(define (bibliography-number-sibling-list cmp) '()) +(define (index-number-sibling-list cmp) '()) +(define (setindex-number-sibling-list cmp) '()) +(define (refentry-number-sibling-list cmp) '()) +(define (default-number-sibling-list cmp) '()) + +(define (component-number-sibling-list cmp) + ;; Return the list of elements with which 'cmp' should be numbered. + ;; For example, for PART it might return '("PART" "REFERENCE") causing + ;; sibling parts and references to be numbered together. + (let ((name (gi cmp))) + (cond + ((equal? name (normalize "set")) (set-number-sibling-list cmp)) + ((equal? name (normalize "book")) (book-number-sibling-list cmp)) + ((equal? name (normalize "part")) (part-number-sibling-list cmp)) + ((equal? name (normalize "reference")) (reference-number-sibling-list cmp)) + ((equal? name (normalize "preface")) (preface-number-sibling-list cmp)) + ((equal? name (normalize "chapter")) (chapter-number-sibling-list cmp)) + ((equal? name (normalize "appendix")) (appendix-number-sibling-list cmp)) + ((equal? name (normalize "article")) (article-number-sibling-list cmp)) + ((equal? name (normalize "glossary")) (glossary-number-sibling-list cmp)) + ((equal? name (normalize "bibliography")) (bibliography-number-sibling-list cmp)) + ((equal? name (normalize "index")) (index-number-sibling-list cmp)) + ((equal? name (normalize "setindex")) (setindex-number-sibling-list cmp)) + ((equal? name (normalize "refentry")) (refentry-number-sibling-list cmp)) + (else (default-number-sibling-list cmp))))) + +(define (component-number component-node) + (let* ((root (ancestor-member component-node + (component-number-restart-list + component-node))) + (clist (expand-children (children root) + (component-number-ignore-list + component-node))) + (slist (append (list (gi component-node)) + (component-number-sibling-list component-node)))) + (let loop ((nl clist) (count 1)) + (if (node-list-empty? nl) + 1 + (if (node-list=? (node-list-first nl) component-node) + count + (if (member (gi (node-list-first nl)) slist) + (loop (node-list-rest nl) (+ count 1)) + (loop (node-list-rest nl) count))))))) + +;; == components and divisions == + +(define (set-autolabel nd #!optional (force-label? #f)) + "") + +(define (book-autolabel nd #!optional (force-label? #f)) + "") + +(define (part-autolabel nd #!optional (force-label? #f)) + (format-number (component-number nd) (label-number-format nd))) + +(define (reference-autolabel nd #!optional (force-label? #f)) + (format-number (component-number nd) (label-number-format nd))) + +(define (preface-autolabel nd #!optional (force-label? #f)) + "") + +(define (chapter-autolabel nd #!optional (force-label? #f)) + (if (or force-label? %chapter-autolabel%) + (format-number (component-number nd) (label-number-format nd)) + "")) + +(define (appendix-autolabel nd #!optional (force-label? #f)) + ;; Abandoned special processing for appendixes in articles. Maybe + ;; it's a good idea, but it can't be done here because it screws + ;; up cross references to appendixes. + (if (or force-label? %chapter-autolabel%) + (format-number (component-number nd) (label-number-format nd)) + "")) + +(define (article-autolabel nd #!optional (force-label? #f)) + "") + +(define (glossary-autolabel nd #!optional (force-label? #f)) + "") + +(define (bibliography-autolabel nd #!optional (force-label? #f)) + "") + +(define (index-autolabel nd #!optional (force-label? #f)) + "") + +(define (indexdiv-autolabel nd #!optional (force-label? #f)) + "") + +(define (colophon-autolabel nd #!optional (force-label? #f)) + "") + +(define (setindex-autolabel nd #!optional (force-label? #f)) + "") + +(define (refentry-autolabel nd #!optional (force-label? #f)) + (let* ((isep (gentext-intra-label-sep nd)) + (refnamediv (select-elements (children nd) + (normalize "refnamediv"))) + (refd (select-elements (children refnamediv) + (normalize "refdescriptor"))) + (refnames (select-elements (children refnamediv) + (normalize "refname")))) + "")) + +;; == /components and divisions == + +(define (dedication-autolabel nd #!optional (force-label? #f)) + "") + +(define (bibliodiv-autolabel nd #!optional (force-label? #f)) + "") + +(define (glossdiv-autolabel nd #!optional (force-label? #f)) + "") + +(define (section-autolabel-prefix nd) + (let* ((isep (gentext-intra-label-sep nd)) + (haschn (not (node-list-empty? (ancestor (normalize "chapter") nd)))) + (hasapn (not (node-list-empty? (ancestor (normalize "appendix") nd))))) + (cond + (haschn (string-append + (element-label (ancestor (normalize "chapter") nd)) isep)) + (hasapn (string-append + (element-label (ancestor (normalize "appendix") nd)) isep)) + (else "")))) + +(define (section-autolabel nd #!optional (force-label? #f)) + (let* ((isep (gentext-intra-label-sep nd)) + (hasprf (not (node-list-empty? (ancestor (normalize "preface") nd)))) + (prefix (section-autolabel-prefix nd))) + (if (and (or force-label? %section-autolabel%) + (or %label-preface-sections% + (not hasprf))) + (cond + ((equal? (gi nd) (normalize "sect1")) + (string-append prefix (format-number (child-number nd) + (label-number-format nd)))) + ((equal? (gi nd) (normalize "sect2")) + (string-append + (element-label (ancestor (normalize "sect1") nd) force-label?) + isep + (format-number (child-number nd) (label-number-format nd)))) + ((equal? (gi nd) (normalize "sect3")) + (string-append + (element-label (ancestor (normalize "sect2") nd) force-label?) + isep + (format-number (child-number nd) (label-number-format nd)))) + ((equal? (gi nd) (normalize "sect4")) + (string-append + (element-label (ancestor (normalize "sect3") nd) force-label?) + isep + (format-number (child-number nd) (label-number-format nd)))) + ((equal? (gi nd) (normalize "sect5")) + (string-append + (element-label (ancestor (normalize "sect4") nd) force-label?) + isep + (format-number (child-number nd) (label-number-format nd)))) + + ((equal? (gi nd) (normalize "simplesect")) + (let* ((possible-sect-ancestors + (node-list (ancestor (normalize "section") nd) + (ancestor (normalize "sect5") nd) + (ancestor (normalize "sect4") nd) + (ancestor (normalize "sect3") nd) + (ancestor (normalize "sect2") nd) + (ancestor (normalize "sect1") nd))) + (section-ancestor (node-list-first possible-sect-ancestors))) + (if (node-list-empty? section-ancestor) + (string-append prefix (format-number (child-number nd) + (label-number-format nd))) + (string-append + (element-label section-ancestor force-label?) + isep + (format-number (child-number nd) (label-number-format nd)))))) + + ((equal? (gi nd) (normalize "section")) + (if (node-list-empty? (ancestor (normalize "section") nd)) + (string-append prefix (format-number (child-number nd) + (label-number-format nd))) + (string-append + (element-label (ancestor (normalize "section") nd) force-label?) + isep + (format-number (child-number nd) (label-number-format nd))))) + (else (string-append (gi nd) " IS NOT A SECTION!"))) + ""))) + +(define (refsection-autolabel nd #!optional (force-label? #f)) + "") + +(define (step-autolabel nd #!optional (force-label? #f)) + ($proc-step-xref-number$ nd)) + +(define (listitem-autolabel nd #!optional (force-label? #f)) + (if (equal? (gi (parent nd)) (normalize "orderedlist")) + (number->string (child-number nd)) + "[xref to LISTITEM only supported in ORDEREDLIST]")) + +(define (sidebar-autolabel nd #!optional (force-label? #f)) + "") + +(define (legalnotice-autolabel nd #!optional (force-label? #f)) + "") + +(define (abstract-autolabel nd #!optional (force-label? #f)) + "") + +(define (block-autolabel nd #!optional (force-label? #f)) + (let* ((chn (element-label (ancestor (normalize "chapter") nd))) + (apn (element-label (ancestor (normalize "appendix") nd))) + (rfn (element-label (ancestor (normalize "refentry") nd))) + ;; If the root of this document isn't in component-element-list, these + ;; things all wind up being numbered 0. To avoid that, we force the + ;; root element to be in the list of components if it isn't already + ;; a component. + (incomp (member (gi (sgml-root-element)) (component-element-list))) + ;; In articles in books, number blocks from book not from article. + ;; Otherwise you get 1, 1, 1, 1, etc. for the first figure in each + ;; article. + (artinbook (and (not (node-list-empty? (ancestor (normalize "article") nd))) + (not (node-list-empty? (ancestor (normalize "book") nd))))) + + (bkn (if artinbook + (format-number (component-child-number + nd + (list (normalize "book"))) + (label-number-format nd)) + (if incomp + (format-number (component-child-number + nd + (component-element-list)) + (label-number-format nd)) + (format-number (component-child-number + nd + (append (component-element-list) + (list (gi (sgml-root-element))))) + (label-number-format nd)))))) + (if (equal? chn "") + (if (equal? apn "") + (if (equal? rfn "") + bkn + (string-append rfn (gentext-intra-label-sep nd) bkn)) + (string-append apn (gentext-intra-label-sep nd) bkn)) + (string-append chn (gentext-intra-label-sep nd) bkn)))) + +;; For all elements, if a LABEL attribute is present, that is the label +;; that they get. Otherwise: +;; BOOK gets the Book volume, by book-autolabel +;; PREFACE gets "", by preface-autolabel +;; CHAPTER gets the Chapter number, by chapter-autolabel +;; APPENDIX gets the Appendix letter, by appendix-autolabel +;; REFERENCE gets "", by reference-autolabel +;; REFENTRY gets "", by refentry-autolabel +;; SECT* gets the nested section number (e.g., 1.3.5), by section-autolabel +;; REFSECT* gets the nested section number, by refsection-autolabel +;; everything else gets numbered by block-autolabel +;; +(define (element-label #!optional (nd (current-node)) (force-label? #f)) + (if (node-list-empty? nd) + "" + (let ((label (attribute-string (normalize "label") nd))) + (if label + label + (cond + ;; Use a seperately defined assoc list? + ((equal? (gi nd) (normalize "abstract")) + (abstract-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "appendix")) + (appendix-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "article")) + (article-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "bibliodiv")) + (bibliodiv-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "bibliography")) + (bibliography-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "book")) + (book-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "chapter")) + (chapter-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "dedication")) + (dedication-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "glossary")) + (glossary-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "glossdiv")) + (glossdiv-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "index")) + (index-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "colophon")) + (colophon-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "indexdiv")) + (indexdiv-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "setindex")) + (setindex-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "legalnotice")) + (legalnotice-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "listitem")) + (listitem-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "part")) + (part-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "preface")) + (preface-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "refentry")) + (refentry-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "reference")) + (reference-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "refsynopsisdiv")) + (refsection-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "refsect1")) + (refsection-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "refsect2")) + (refsection-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "refsect3")) + (refsection-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "sect1")) + (section-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "sect2")) + (section-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "sect3")) + (section-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "sect4")) + (section-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "sect5")) + (section-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "section")) + (section-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "simplesect")) + (section-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "set")) + (set-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "sidebar")) + (sidebar-autolabel nd force-label?)) + ((equal? (gi nd) (normalize "step")) + (step-autolabel nd force-label?)) + (else (block-autolabel nd force-label?))))))) + +;; ====================================================================== + +;; Returns the element label as a sosofo +;; +(define (element-label-sosofo nd #!optional (force-label? #f)) + (if (string=? (element-label nd force-label?) "") + (empty-sosofo) + (make sequence + (literal (element-label nd force-label?))))) + +;; ====================================================================== + +(define (set-title nd) + (let* ((setinfo (select-elements (children nd) (normalize "setinfo"))) + (sititles (select-elements + (expand-children (children setinfo) + (list (normalize "bookbiblio") + (normalize "bibliomisc") + (normalize "biblioset"))) + (normalize "title"))) + (settitles (select-elements (children nd) (normalize "title"))) + (titles (if (node-list-empty? settitles) + sititles + settitles))) + (if (node-list-empty? titles) + "" + (node-list-first titles)))) + +(define (book-title nd) + (let* ((bookinfo (select-elements (children nd) (normalize "bookinfo"))) + (bititles (select-elements + (expand-children (children bookinfo) + (list (normalize "bookbiblio") + (normalize "bibliomisc") + (normalize "biblioset"))) + (normalize "title"))) + (chtitles (select-elements (children nd) (normalize "title"))) + (titles (if (node-list-empty? chtitles) + bititles + chtitles))) + (if (node-list-empty? titles) + "" + (node-list-first titles)))) + +(define (part-title nd) + (let* ((docinfo (select-elements (children nd) (normalize "docinfo"))) + (dititles (select-elements + (expand-children (children docinfo) + (list (normalize "bookbiblio") + (normalize "bibliomisc") + (normalize "biblioset"))) + (normalize "title"))) + (chtitles (select-elements (children nd) (normalize "title"))) + (titles (if (node-list-empty? chtitles) + dititles + chtitles))) + (if (node-list-empty? titles) + "" + (node-list-first titles)))) + + (define (article-title nd) + (let* ((titles + (or (select-elements (children + (node-list-filter-by-gi (children nd) + (list (normalize "artheader") + (normalize "articleinfo")))) + (normalize "title")) + (select-elements (children nd) + (normalize "title"))))) + (if (node-list-empty? titles) + "" + (node-list-first titles)))) + +(define (preface-title nd) + (chapter-title nd)) + +(define (chapter-title nd) + (let* ((docinfo (select-elements (children nd) (normalize "docinfo"))) + (dititles (select-elements + (expand-children (children docinfo) + (list (normalize "bookbiblio") + (normalize "bibliomisc") + (normalize "biblioset"))) + (normalize "title"))) + (chtitles (select-elements (children nd) (normalize "title"))) + (titles (if (node-list-empty? chtitles) + dititles + chtitles))) + (if (node-list-empty? titles) + "" + (node-list-first titles)))) + +(define (appendix-title nd) + (chapter-title nd)) + +(define (reference-title nd) + (chapter-title nd)) + +(define (refsynopsisdiv-title nd) + (optional-title nd)) + +;; Returns either the REFENTRYTITLE or the first REFNAME. +;; +(define (refentry-title nd) + (let* ((refmeta (select-elements (descendants nd) (normalize "refmeta"))) + (refttl (select-elements (descendants refmeta) (normalize "refentrytitle"))) + (refndiv (select-elements (descendants nd) (normalize "refnamediv"))) + (refname (select-elements (descendants refndiv) (normalize "refname")))) + (if (node-list-empty? refttl) + (if (node-list-empty? refname) + "" + (node-list-first refname)) + (node-list-first refttl)))) + +(define (optional-title nd) + (let* ((docinfo (select-elements (children nd) (normalize "docinfo"))) + (dititles (select-elements (children docinfo) (normalize "title"))) + (chtitles (select-elements (children nd) (normalize "title"))) + (titles (if (node-list-empty? chtitles) + dititles + chtitles))) + (if (node-list-empty? titles) + (gentext-element-name nd) + (node-list-first titles)))) + +(define (glossary-title nd) + (optional-title nd)) + +(define (bibliography-title nd) + (optional-title nd)) + +(define (index-title nd) + (optional-title nd)) + +(define (setindex-title nd) + (optional-title nd)) + +(define (dedication-title nd) + (optional-title nd)) + +(define (colophon-title nd) + (gentext-element-name nd)) + +(define (section-title nd) + (let* ((info (select-elements (children nd) + (list (normalize "sect1info") + (normalize "sect2info") + (normalize "sect3info") + (normalize "sect4info") + (normalize "sect5info") + (normalize "section")))) + (ititles (select-elements (children info) (normalize "title"))) + (ctitles (select-elements (children nd) (normalize "title"))) + (titles (if (node-list-empty? ctitles) + ititles + ctitles))) + (if (node-list-empty? titles) + "" + (node-list-first titles)))) + +(define (refsection-title nd) + (let* ((info (select-elements (children nd) + (list (normalize "refsect1info") + (normalize "refsect2info") + (normalize "refsect3info")))) + (ititles (select-elements (children info) (normalize "title"))) + (ctitles (select-elements (children nd) (normalize "title"))) + (titles (if (node-list-empty? ctitles) + ititles + ctitles))) + (if (node-list-empty? titles) + "" + (node-list-first titles)))) + +(define (block-title nd) + (let ((titles (select-elements (children nd) (normalize "title")))) + (if (node-list-empty? titles) + "" + (node-list-first titles)))) + +;; ====================================================================== + +(define (set-title-sosofo nd) + (let ((title (set-title nd))) + (if (string? title) + (empty-sosofo) + (with-mode title-sosofo-mode + (process-node-list title))))) + +(define (book-title-sosofo nd) + (let ((title (book-title nd))) + (if (string? title) + (empty-sosofo) + (with-mode title-sosofo-mode + (process-node-list title))))) + +(define (part-title-sosofo nd) + (let ((title (part-title nd))) + (if (string? title) + (empty-sosofo) + (with-mode title-sosofo-mode + (process-node-list title))))) + +(define (article-title-sosofo nd) + (let ((title (article-title nd))) + (if (string? title) + (empty-sosofo) + (with-mode title-sosofo-mode + (process-node-list title))))) + +(define (preface-title-sosofo nd) + (let ((title (preface-title nd))) + (if (string? title) + (empty-sosofo) + (with-mode title-sosofo-mode + (process-node-list title))))) + +(define (chapter-title-sosofo nd) + (let ((title (chapter-title nd))) + (if (string? title) + (empty-sosofo) + (with-mode title-sosofo-mode + (process-node-list title))))) + +(define (appendix-title-sosofo nd) + (let ((title (appendix-title nd))) + (if (string? title) + (empty-sosofo) + (with-mode title-sosofo-mode + (process-node-list title))))) + +(define (reference-title-sosofo nd) + (let ((title (reference-title nd))) + (if (string? title) + (empty-sosofo) + (with-mode title-sosofo-mode + (process-node-list title))))) + +(define (refsynopsisdiv-title-sosofo nd) + (optional-title-sosofo nd)) + +(define (refentry-title-sosofo nd) + (let ((title (refentry-title nd))) + (if (string? title) + (empty-sosofo) + (with-mode title-sosofo-mode + (process-node-list title))))) + +(define (optional-title-sosofo nd) + (let ((title (optional-title nd))) + (if (string? title) + (literal title) + (with-mode title-sosofo-mode + (process-node-list title))))) + +(define (glossary-title-sosofo nd) + (optional-title-sosofo nd)) + +(define (bibliography-title-sosofo nd) + (optional-title-sosofo nd)) + +(define (index-title-sosofo nd) + (optional-title-sosofo nd)) + +(define (setindex-title-sosofo nd) + (optional-title-sosofo nd)) + +(define (dedication-title-sosofo nd) + (optional-title-sosofo nd)) + +(define (colophon-title-sosofo nd) + (literal (gentext-element-name nd))) + +(define (section-title-sosofo nd) + (let ((title (section-title nd))) + (if (string? title) + (empty-sosofo) + (with-mode title-sosofo-mode + (process-node-list title))))) + +(define (refsection-title-sosofo nd) + (let ((title (refsection-title nd))) + (if (string? title) + (empty-sosofo) + (with-mode title-sosofo-mode + (process-node-list title))))) + +(define (block-title-sosofo nd) + (let ((title (block-title nd))) + (if (string? title) + (empty-sosofo) + (with-mode title-sosofo-mode + (process-node-list title))))) + +(mode title-sosofo-mode + (element title + (process-children-trim)) + + (element citetitle + (process-children-trim)) + + (element refname + (process-children-trim)) + + (element refentrytitle + (process-children-trim))) + +;; Returns the title of the element as a sosofo. +;; +(define (element-title-sosofo #!optional (nd (current-node))) + (if (node-list-empty? nd) + (empty-sosofo) + (cond + ;; Use a seperately defined assoc list? + ((equal? (gi nd) (normalize "appendix")) (appendix-title-sosofo nd)) + ((equal? (gi nd) (normalize "article")) (article-title-sosofo nd)) + ((equal? (gi nd) (normalize "bibliography")) (bibliography-title-sosofo nd)) + ((equal? (gi nd) (normalize "book")) (book-title-sosofo nd)) + ((equal? (gi nd) (normalize "chapter")) (chapter-title-sosofo nd)) + ((equal? (gi nd) (normalize "dedication")) (dedication-title-sosofo nd)) + ((equal? (gi nd) (normalize "glossary")) (glossary-title-sosofo nd)) + ((equal? (gi nd) (normalize "index")) (index-title-sosofo nd)) + ((equal? (gi nd) (normalize "colophon")) (colophon-title-sosofo nd)) + ((equal? (gi nd) (normalize "setindex")) (index-title-sosofo nd)) + ((equal? (gi nd) (normalize "part")) (part-title-sosofo nd)) + ((equal? (gi nd) (normalize "preface")) (preface-title-sosofo nd)) + ((equal? (gi nd) (normalize "refentry")) (refentry-title-sosofo nd)) + ((equal? (gi nd) (normalize "reference")) (reference-title-sosofo nd)) + ((equal? (gi nd) (normalize "refsect1")) (refsection-title-sosofo nd)) + ((equal? (gi nd) (normalize "refsect2")) (refsection-title-sosofo nd)) + ((equal? (gi nd) (normalize "refsect3")) (refsection-title-sosofo nd)) + ((equal? (gi nd) (normalize "refsynopsisdiv")) (refsynopsisdiv-title-sosofo nd)) + ((equal? (gi nd) (normalize "sect1")) (section-title-sosofo nd)) + ((equal? (gi nd) (normalize "sect2")) (section-title-sosofo nd)) + ((equal? (gi nd) (normalize "sect3")) (section-title-sosofo nd)) + ((equal? (gi nd) (normalize "sect4")) (section-title-sosofo nd)) + ((equal? (gi nd) (normalize "sect5")) (section-title-sosofo nd)) + ((equal? (gi nd) (normalize "set")) (set-title-sosofo nd)) + (else (block-title-sosofo nd))))) + +;; ====================================================================== + +;; Returns the title of the element; returns a node if possible, or a string +(define (element-title nd) + (if (node-list-empty? nd) + "" + (cond + ;; Use a seperately defined assoc list? + ((equal? (gi nd) (normalize "appendix")) (appendix-title nd)) + ((equal? (gi nd) (normalize "article")) (article-title nd)) + ((equal? (gi nd) (normalize "bibliography")) (bibliography-title nd)) + ((equal? (gi nd) (normalize "book")) (book-title nd)) + ((equal? (gi nd) (normalize "chapter")) (chapter-title nd)) + ((equal? (gi nd) (normalize "dedication")) (dedication-title nd)) + ((equal? (gi nd) (normalize "glossary")) (glossary-title nd)) + ((equal? (gi nd) (normalize "index")) (index-title nd)) + ((equal? (gi nd) (normalize "colophon")) (colophon-title nd)) + ((equal? (gi nd) (normalize "setindex")) (setindex-title nd)) + ((equal? (gi nd) (normalize "part")) (part-title nd)) + ((equal? (gi nd) (normalize "preface")) (preface-title nd)) + ((equal? (gi nd) (normalize "refentry")) (refentry-title nd)) + ((equal? (gi nd) (normalize "reference")) (reference-title nd)) + ((equal? (gi nd) (normalize "refsect1")) (refsection-title nd)) + ((equal? (gi nd) (normalize "refsect2")) (refsection-title nd)) + ((equal? (gi nd) (normalize "refsect3")) (refsection-title nd)) + ((equal? (gi nd) (normalize "refsynopsisdiv")) (refsynopsisdiv-title nd)) + ((equal? (gi nd) (normalize "sect1")) (section-title nd)) + ((equal? (gi nd) (normalize "sect2")) (section-title nd)) + ((equal? (gi nd) (normalize "sect3")) (section-title nd)) + ((equal? (gi nd) (normalize "sect4")) (section-title nd)) + ((equal? (gi nd) (normalize "sect5")) (section-title nd)) + ((equal? (gi nd) (normalize "set")) (set-title nd)) + (else (block-title nd))))) + +;; ====================================================================== +;; Returns the data of a node, carefully excising INDEXTERMs from +;; the data content +;; + +(define (data-of node) + ;; return the data characters of a node, except for the content of + ;; indexterms which are suppressed. + (let loop ((nl (children node)) (result "")) + (if (node-list-empty? nl) + result + (if (equal? (node-property 'class-name (node-list-first nl)) 'element) + (if (or (equal? (gi (node-list-first nl)) (normalize "indexterm")) + (equal? (gi (node-list-first nl)) (normalize "comment")) + (equal? (gi (node-list-first nl)) (normalize "remark"))) + (loop (node-list-rest nl) result) + (loop (node-list-rest nl) + (string-append result (data-of (node-list-first nl))))) + (if (or (equal? (node-property 'class-name (node-list-first nl)) + 'data-char) + (equal? (node-property 'class-name (node-list-first nl)) + 'sdata)) + (loop (node-list-rest nl) + (string-append result (data (node-list-first nl)))) + (loop (node-list-rest nl) result)))))) + +;; ====================================================================== +;; Returns the element title data of nd +;; +(define (element-title-string nd) + (let ((title (element-title nd))) + (if (string? title) + title + (data-of title)))) + +;; ====================================================================== +;; Returns the element gi as a sosofo +;; +(define (element-gi-sosofo nd) + (if (node-list-empty? nd) + (empty-sosofo) + (make sequence + (literal (gentext-element-name nd))))) + +;; ====================================================================== + +(define (titlepage-info-elements node info #!optional (intro (empty-node-list))) + ;; Returns a node-list of the elements that might appear on a title + ;; page. This node-list is constructed as follows: + ;; + ;; 1. The "title" child of node is considered as a possibility + ;; 2. If info is not empty, then node-list starts as the children + ;; of info. If the children of info don't include a title, then + ;; the title from the node is added. + ;; 3. If info is empty, then node-list starts as the children of node, + ;; but with "partintro" filtered out. + + (let* ((title (select-elements (children node) (normalize "title"))) + (nl (if (node-list-empty? info) + (node-list-filter-by-not-gi (children node) + (list (normalize "partintro"))) + (children info))) + (nltitle (node-list-filter-by-gi nl (list (normalize "title"))))) + (if (node-list-empty? info) + (node-list nl + intro) + (node-list (if (node-list-empty? nltitle) + title + (empty-node-list)) + nl + intro)))) + +;; ====================================================================== + +(define (info-element #!optional (nd (current-node))) + ;; Returns the *INFO element for the nd or (empty-node-list) if no + ;; such node exists... + (cond + ((equal? (gi nd) (normalize "set")) + (select-elements (children nd) (normalize "setinfo"))) + ((equal? (gi nd) (normalize "book")) + (select-elements (children nd) (normalize "bookinfo"))) + ((equal? (gi nd) (normalize "section")) + (select-elements (children nd) (normalize "sectioninfo"))) + ((equal? (gi nd) (normalize "sect1")) + (select-elements (children nd) (normalize "sect1info"))) + ((equal? (gi nd) (normalize "sect2")) + (select-elements (children nd) (normalize "sect2info"))) + ((equal? (gi nd) (normalize "sect3")) + (select-elements (children nd) (normalize "sect3info"))) + ((equal? (gi nd) (normalize "sect4")) + (select-elements (children nd) (normalize "sect4info"))) + ((equal? (gi nd) (normalize "sect5")) + (select-elements (children nd) (normalize "sect5info"))) + ((equal? (gi nd) (normalize "refsect1")) + (select-elements (children nd) (normalize "refsect1info"))) + ((equal? (gi nd) (normalize "refsect2")) + (select-elements (children nd) (normalize "refsect2info"))) + ((equal? (gi nd) (normalize "refsect3")) + (select-elements (children nd) (normalize "refsect3info"))) + ((equal? (gi nd) (normalize "refsynopsisdiv")) + (select-elements (children nd) (normalize "refsynopsisdivinfo"))) + ((equal? (gi nd) (normalize "article")) + (node-list-filter-by-gi (children nd) (list (normalize "artheader") + (normalize "articleinfo")))) + (else ;; BIBLIODIV, GLOSSDIV, INDEXDIV, PARTINTRO, SIMPLESECT + (select-elements (children nd) (normalize "docinfo"))))) + +;; ====================================================================== +;; +;; Bibliography filtering... + +(define (biblio-filter allentries) + (let* ((all (descendants (sgml-root-element))) + (link (select-elements all (normalize "link"))) + (xref (select-elements all (normalize "xref"))) + (cite (select-elements all (normalize "citation"))) + (xref-elements (node-list link xref))) + (let loop ((entries allentries) (used (empty-node-list))) + (if (node-list-empty? entries) + used + (if (or (cited-by-xref (node-list-first entries) xref-elements) + (cited-by-citation (node-list-first entries) cite)) + (loop (node-list-rest entries) + (node-list used (node-list-first entries))) + (loop (node-list-rest entries) used)))))) + +(define (cited-by-xref bib xref-elements) + (let* ((id (attribute-string (normalize "id") bib))) + (if id + (let loop ((links xref-elements)) + (if (node-list-empty? links) + #f + (if (equal? (attribute-string (normalize "linkend") + (node-list-first links)) id) + #t + (loop (node-list-rest links))))) + #f))) + +(define (cited-by-citation bib citations) + (let loop ((links citations)) + (if (node-list-empty? links) + #f + (if (citation-matches-target? (node-list-first links) bib) + #t + (loop (node-list-rest links)))))) + +(define (citation-matches-target? citation target) + (let* ((fchild (node-list-first + (node-list-filter-out-pis + (children target)))) + (abbrev (if (equal? (gi fchild) (normalize "abbrev")) + fchild + (empty-node-list))) + (cite (data-of citation))) + (or (equal? (attribute-string "id" target) (normalize cite)) + (equal? (attribute-string "xreflabel" target) (normalize cite)) + (equal? (normalize cite) (normalize (data-of abbrev)))))) + +(define (bibentry-number bibentry) + (let* ((bgraphy (ancestor-member bibentry + (list (normalize "bibliography")))) + (comps (expand-children (children bgraphy) + (list (normalize "bibliodiv"))))) + (let loop ((nl comps) (count 1)) + (if (node-list-empty? nl) + 0 + (if (node-list=? (node-list-first nl) bibentry) + count + (if (or (equal? (gi (node-list-first nl)) + (normalize "biblioentry")) + (equal? (gi (node-list-first nl)) + (normalize "bibliomixed"))) + (loop (node-list-rest nl) (+ count 1)) + (loop (node-list-rest nl) count))))))) + +;; ====================================================================== + +(define (olink-resource-title pubid sysid) + ;; This version of olink-resource-title expects public identifiers + ;; with the following format: + ;; + ;; -//owner//TEXT title Vx.x//EN + ;; + ;; Specifically the title is the description field of the public + ;; identifier minus the first word (TEXT, the type) and the last + ;; word, in my case a version string. Words are blank delimited. + ;; The parsing will fail if a "/" appears anywhere in any field. + ;; The system identifier is ignored + ;; + (let* ((pubidparts (if pubid + (split pubid '(#\/)) + (split "-//none//type version//la" '(#\/)))) + (description (car (cdr (cdr pubidparts)))) + (descparts (split description)) + (titleparts (list-head (cdr descparts) (- (length descparts) 2)))) + (join titleparts))) + +;; ====================================================================== + +(define (orderedlist-listitem-number listitem) + ;; return the number of listitem, taking continuation into account + (let* ((orderedlist (parent listitem)) + (listitems (select-elements (children orderedlist) + (normalize "listitem"))) + (continue? (equal? (attribute-string (normalize "continuation") + orderedlist) + (normalize "continues"))) + +;; If a list is the continuation of a previous list, we must find the +;; list that is continued in order to calculate the starting +;; item number of this list. +;; +;; Of all the lists in this component, only the following are candidates: +;; 1. Lists which precede this list +;; 2. Lists which are not ancestors of this list +;; 3. Lists that do not have ancestors that are lists which precede this one +;; +;; Of the candidates, the last one, in document order, is the preceding +;; list + (all-lists (select-elements + (descendants (ancestor-member orderedlist + (component-element-list))) + (normalize "orderedlist"))) + + (cand1 (if continue? + (let loop ((nl all-lists) + (prec (empty-node-list))) + (if (node-list-empty? nl) + prec + (if (node-list=? (node-list-first nl) + orderedlist) + prec + (loop (node-list-rest nl) + (node-list prec + (node-list-first nl)))))) + (empty-node-list))) + + (cand2 (let loop ((nl cand1) + (cand2lists (empty-node-list))) + (if (node-list-empty? nl) + cand2lists + (loop (node-list-rest nl) + (if (descendant-of? (node-list-first nl) + orderedlist) + cand2lists + (node-list cand2lists + (node-list-first nl))))))) + + ;; now find the last item of cand2 that is not a descendant + ;; of some other element of the cand2 list. + (preclist (let loop ((nl (node-list-reverse cand2))) + (if (node-list-empty? nl) + (empty-node-list) + (if (descendant-member-of? + (node-list-first nl) + (node-list-rest nl)) + (loop (node-list-rest nl)) + (node-list-first nl))))) + + (precitem (if (node-list-empty? preclist) + (empty-node-list) + (node-list-last (children preclist)))) + (precitem-number (if (and continue? (not (node-list-empty? precitem))) + (orderedlist-listitem-number precitem) + 0))) + + (+ precitem-number (child-number listitem)))) + +(define (descendant-member-of? node node-list) + ;; return true if node is a descedant of any member of node-list + (let loop ((nl node-list)) + (if (node-list-empty? nl) + #f + (if (descendant-of? (node-list-first nl) node) + #t + (loop (node-list-rest nl)))))) + +;; ====================================================================== + +(define (orderedlist-listitem-label listitem) + ;; return the formatted number of listitem + (let* ((number (orderedlist-listitem-number listitem)) + (depth (length (hierarchical-number-recursive + (normalize "orderedlist") + listitem))) + (numeration (inherited-attribute-string (normalize "numeration") + listitem)) + ;; rawnum allows for numbering to alternate + (rawnum (cond + ((equal? numeration (normalize "arabic")) 1) + ((equal? numeration (normalize "loweralpha")) 2) + ((equal? numeration (normalize "lowerroman")) 3) + ((equal? numeration (normalize "upperalpha")) 4) + ((equal? numeration (normalize "upperroman")) 0) + (else (modulo depth 5))))) + (case rawnum + ((1) (format-number number "1")) + ((2) (format-number number "a")) + ((3) (format-number number "i")) + ((4) (format-number number "A")) + ((0) (format-number number "I"))))) + +(define (orderedlist-listitem-label-recursive listitem) + ;; return the recursively formatted number of the listitem. + ;; In other words, something of the form 1.2.3 for a third level + ;; nested ordered list + (let loop ((li (parent listitem)) + (label (orderedlist-listitem-label listitem))) + (if (or (node-list-empty? li) + (node-list-empty? (ancestor (normalize "orderedlist") li))) + label + (if (and (equal? (gi li) (normalize "listitem")) + (equal? (gi (parent li)) (normalize "orderedlist"))) + (loop (parent li) + (string-append + (orderedlist-listitem-label li) + (gentext-intra-label-sep li) + label)) + (loop (parent li) label))))) + +(define (question-answer-label #!optional (node (current-node))) + (let* ((inhlabel (inherited-attribute-string (normalize "defaultlabel") + node)) + (deflabel (if inhlabel inhlabel (qanda-defaultlabel))) + (label (attribute-string (normalize "label") node)) + (hnr (hierarchical-number-recursive (normalize "qandadiv") + node)) + + (parsect (ancestor-member node (section-element-list))) + + (defnum (if (and %qanda-inherit-numeration% + %section-autolabel%) + (if (node-list-empty? parsect) + (section-autolabel-prefix node) + (section-autolabel parsect)) + "")) + + (hnumber (let loop ((numlist hnr) (number defnum) + (sep (if (equal? defnum "") "" "."))) + (if (null? numlist) + number + (loop (cdr numlist) + (string-append number + sep + (number->string (car numlist))) + ".")))) + (cnumber (child-number (parent node))) + (number (string-append hnumber + (if (equal? hnumber "") + "" + ".") + (number->string cnumber)))) + (cond + ((equal? deflabel (normalize "qanda")) + (gentext-element-name node)) + ((equal? deflabel (normalize "label")) + label) + ;; Note: only questions are numbered... + ((and (equal? deflabel (normalize "number")) + (equal? (gi node) (normalize "question"))) + (string-append number ".")) + (else "")))) + +;; ====================================================================== +;; Calculate term lengths... + +(define (varlistentry-term-too-long? vle termlength) + (let loop ((nl (select-elements (children vle) (normalize "term"))) + (too-long? #f)) + (if (or too-long? (node-list-empty? nl)) + too-long? + (loop (node-list-rest nl) + (> (string-length (data (node-list-first nl))) + termlength))))) + +(define (variablelist-term-too-long? termlength) + (let loop ((nl (select-elements (children (current-node)) + (normalize "varlistentry"))) + (too-long? #f)) + (if (or too-long? (node-list-empty? nl)) + too-long? + (loop (node-list-rest nl) + (varlistentry-term-too-long? (node-list-first nl) termlength))))) + +;; ====================================================================== +;; bibliography elements + +(define (biblioentry-inline-elements) + (list (normalize "abbrev") + (normalize "affiliation") + (normalize "artpagenums") + (normalize "author") + (normalize "authorgroup") + (normalize "authorinitials") + (normalize "citetitle") + (normalize "collab") + (normalize "confgroup") + (normalize "contractnum") + (normalize "contractsponsor") + (normalize "contrib") + (normalize "copyright") + (normalize "corpauthor") + (normalize "corpname") + (normalize "date") + (normalize "edition") + (normalize "editor") + (normalize "firstname") + (normalize "honorific") + (normalize "invpartnumber") + (normalize "isbn") + (normalize "issn") + (normalize "issuenum") + (normalize "lineage") + (normalize "orgname") + (normalize "othercredit") + (normalize "othername") + (normalize "pagenums") + (normalize "productname") + (normalize "productnumber") + (normalize "pubdate") + (normalize "publisher") + (normalize "publishername") + (normalize "pubsnumber") + (normalize "releaseinfo") + (normalize "seriesvolnums") + (normalize "subtitle") + (normalize "surname") + (normalize "title") + (normalize "titleabbrev") + (normalize "volumenum"))) + +(define (biblioentry-block-elements) + (list (normalize "abstract") + (normalize "address") + (normalize "authorblurb") + (normalize "printhistory") + (normalize "revhistory") + (normalize "seriesinfo"))) + +(define (biblioentry-flatten-elements) + (list (normalize "articleinfo") + (normalize "biblioset") + (normalize "bookbiblio") + (normalize "artheader"))) + +;; === db31 common ====================================================== + +(define (data-filename dataobj) + (let* ((entityref (attribute-string (normalize "entityref") dataobj)) + (fileref (attribute-string (normalize "fileref") dataobj)) + (filename (if fileref + fileref + (system-id-filename entityref))) + (ext (file-extension filename))) + (if (or (not filename) + (not %graphic-default-extension%) + (member ext %graphic-extensions%)) + filename + (string-append filename "." %graphic-default-extension%)))) + +(define (normalized-member string string-list) + (if (string? string) + (let loop ((sl string-list)) + (if (null? sl) + #f + (if (string=? (normalize string) (normalize (car sl))) + #t + (loop (cdr sl))))) + #f)) + +(define (find-displayable-object objlist notlist extlist) + (let loop ((nl objlist)) + (if (node-list-empty? nl) + (empty-node-list) + (let* ((objdata (node-list-filter-by-gi + (children (node-list-first nl)) + (list (normalize "videodata") + (normalize "audiodata") + (normalize "imagedata")))) + (filename (data-filename objdata)) + (extension (file-extension filename)) + (notation (attribute-string (normalize "format") objdata))) + (if (or (normalized-member notation notlist) + (normalized-member extension extlist) + (and notation + (string=? notation (normalize "linespecific")))) + (node-list-first nl) + (loop (node-list-rest nl))))))) + +(define (select-displayable-object objlist) + (let ((pref (find-displayable-object objlist + preferred-mediaobject-notations + preferred-mediaobject-extensions)) + (ok (find-displayable-object objlist + acceptable-mediaobject-notations + acceptable-mediaobject-extensions))) + (if (node-list-empty? pref) + ok + pref))) + +(define ($mediaobject$) + (let* ((objects (node-list-filter-by-gi + (children (current-node)) + (list (normalize "videoobject") + (normalize "imageobject") + (normalize "audioobject")))) + (dobject (select-displayable-object objects)) + (textobj (select-elements (children (current-node)) + (normalize "textobject"))) + (caption (select-elements (children (current-node)) + (normalize "caption")))) + (make sequence + (if (node-list-empty? dobject) + (if (node-list-empty? textobj) + (empty-sosofo) + (process-node-list (node-list-first textobj))) + (process-node-list dobject)) + (process-node-list caption)))) + +;; ====================================================================== diff --git a/common/dbl10n.dsl b/common/dbl10n.dsl new file mode 100644 index 0000000..35876bd --- /dev/null +++ b/common/dbl10n.dsl @@ -0,0 +1,1554 @@ +;; $Id: dbl10n.dsl,v 1.8 2004/10/09 21:36:35 petere78 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com. Please use the ISO 639 language +;; code to identify the language. Append a subtag as per RFC 1766, +;; if necessary. + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x and #x +;; keywords. +;; + +;; The following language codes from ISO 639 are recognized: +;; af - Afrikaans 1.71 +;; bg - Bulgarian +;; bs - Bosnian +;; ca - Catalan +;; cs - Czech +;; da - Danish (previously dk) +;; de - German (previously dege) +;; el - Greek +;; en - English (previously usen) +;; es - Spanish +;; et - Estonian 1.55 +;; eu - Basque 1.74 +;; fi - Finnish +;; fr - French +;; hu - Hungarian 1.55 +;; id - Indonesian 1.55 +;; it - Italian +;; ja - Japanese +;; ko - Korean 1.59 +;; nl - Dutch +;; nn - Nnyorsk 1.74 +;; no - Norwegian (previously bmno) ??? +;; pl - Polish +;; pt - Portuguese +;; pt_br - Portuguese (Brazil) +;; ro - Romanian +;; ru - Russian +;; sk - Slovak +;; sl - Slovenian 1.55 +;; sr - Serbian 1.70 +;; sv - Swedish (previously svse) +;; tr - Turkish 1.71 +;; uk - Ukranian 1.74 +;; xh - Xhosa 1.74 +;; zh_cn - Chinese (Continental) 1.55 +;; zh_tw - Chinese (Traditional) 1.70 + +;; The following language codes are recognized for historical reasons: + +;; bmno(no) - Norwegian (Norsk Bokmal) ??? +;; dege(de) - German +;; dk(da) - Danish +;; svse(sv) - Swedish +;; usen(en) - English + +(define %default-language% "en") +(define %gentext-language% #f) +(define %gentext-use-xref-lang% #f) + +(define ($lang$ #!optional (target (current-node)) (xref-context #f)) + (if %gentext-language% + (lang-fix %gentext-language%) + (if (or xref-context %gentext-use-xref-lang%) + (let loop ((here target)) + (if (node-list-empty? here) + (lang-fix %default-language%) + (if (attribute-string (normalize "lang") here) + (lang-fix (attribute-string (normalize "lang") here)) + (loop (parent here))))) + (if (inherited-attribute-string (normalize "lang")) + (lang-fix (inherited-attribute-string (normalize "lang"))) + (lang-fix %default-language%))))) + +(define (lang-fix language) + ;; Lowercase the language + ;; Translate 'xx-yy' to 'xx_yy' + (let ((fixed-lang (if (> (string-index language "-") 0) + (let ((pos (string-index language "-"))) + (string-append + (substring language 0 pos) + "_" + (substring language (+ pos 1) + (string-length language)))) + language))) + (case-fold-down fixed-lang))) + +(define (author-string #!optional (author (current-node))) + (let ((lang (if (string? author) ($lang$) ($lang$ author)))) + (case lang + ;; ISO 639/ISO 3166/RFC 1766 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error (string-append "L10N ERROR: author-string: " + lang)))))) + +(define (gentext-xref-strings target) + (let ((giname (if (string? target) (normalize target) (gi target))) + (lang (if (string? target) ($lang$) ($lang$ target)))) + (case lang + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error (string-append "L10N ERROR: gentext-xref-strings: " + lang)))))) + +(define (auto-xref-indirect-connector before) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: auto-xref-indirect-connector")))) + +(define (generate-toc-in-front) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: generate-toc-in-front")))) + +(define (gentext-element-name target) + (let ((giname (if (string? target) (normalize target) (gi target))) + (lang (if (string? target) ($lang$) ($lang$ target #t)))) + (case lang + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error (string-append "L10N ERROR: gentext-element-name: " + lang + " (" + giname + ")")))))) + +(define (gentext-element-name-space target) + (let ((giname (if (string? target) (normalize target) (gi target))) + (lang (if (string? target) ($lang$) ($lang$ target)))) + (case lang + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-element-name-space"))))) + +(define (gentext-intra-label-sep target) + (let ((giname (if (string? target) (normalize target) (gi target))) + (lang (if (string? target) ($lang$) ($lang$ target)))) + (case lang + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-intra-label-sep"))))) + +(define (gentext-label-title-sep target) + (let ((giname (if (string? target) (normalize target) (gi target))) + (lang (if (string? target) ($lang$) ($lang$ target)))) + (case lang + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-label-title-sep"))))) + +(define (label-number-format target) + (let ((giname (if (string? target) (normalize target) (gi target))) + (lang (if (string? target) ($lang$) ($lang$ target)))) + (case lang + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: label-number-format"))))) + +(define ($lot-title$ lotgi) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: $lot-title$")))) + +(define (gentext-start-quote) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-start-quote")))) + +(define (gentext-end-quote) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-end-quote")))) + +(define (gentext-start-nested-quote) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-start-nested-quote")))) + +(define (gentext-end-nested-quote) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-end-nested-quote")))) + +(define (gentext-by) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-by")))) + +(define (gentext-edited-by) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-edited-by")))) + +(define (gentext-revised-by) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-revised-by")))) + +(define (gentext-page) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-page")))) + +(define (gentext-and) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-and")))) + +(define (gentext-listcomma) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-listcomma")))) + +(define (gentext-lastlistcomma) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-lastlistcomma")))) + +(define (gentext-bibl-pages) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-bibl-pages")))) + +(define (gentext-endnotes) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-endnotes")))) + +(define (gentext-table-endnotes) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-table-endnotes")))) + +(define (gentext-index-see) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-index-see")))) + +(define (gentext-index-seealso) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-index-seealso")))) + +(define (gentext-nav-prev prev) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-nav-prev")))) + +(define (gentext-nav-prev-sibling prevsib) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-nav-prev-sibling ")))) + +(define (gentext-nav-next-sibling nextsib) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-nav-next-sibling")))) + +(define (gentext-nav-next next) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-nav-next")))) + +(define (gentext-nav-up up) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-nav-up")))) + +(define (gentext-nav-home home) + (case ($lang$) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (else (error "L10N ERROR: gentext-nav-home")))) diff --git a/common/dbl10n.ent b/common/dbl10n.ent new file mode 100644 index 0000000..5b9b3a2 --- /dev/null +++ b/common/dbl10n.ent @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + + +]]> + + diff --git a/common/dbl10n.pl b/common/dbl10n.pl new file mode 100644 index 0000000..8683841 --- /dev/null +++ b/common/dbl10n.pl @@ -0,0 +1,55 @@ +#!/usr/bin/perl -w -- # -*- Perl -*- + +use strict; + +my $template = "dbl10n.template"; +my $dbl10n = "dbl10n.dsl"; +my @languages = (); +my %langsection = (); +my $inlist = 0; +my $historical = 0; + +open (F, $template); +open (G, ">$dbl10n"); + +while () { + if (/\%\%\/?LANGUAGES\%\%/ || /\%\%HISTORICAL\%\%/) { + $inlist = 1 if $& eq '%%LANGUAGES%%'; + $inlist = 0 if $& eq '%%/LANGUAGES%%'; + $historical = 1 if $& eq '%%HISTORICAL%%'; + next; + } + + if ($inlist && /^;; (\S+)\s+-/) { + my $lang = $1; + my $section = $1; + + if ($historical) { + $lang =~ /^(\S+)\((\S+)\)/; + $lang = $1; + $section = $2; + } + + $section =~ s/\_//sg; +# print "$lang = $section\n"; + + push (@languages, $lang); + $langsection{$lang} = $section; + } + + if (/ (string-index language "-") 0) + (let ((pos (string-index language "-"))) + (string-append + (substring language 0 pos) + "_" + (substring language (+ pos 1) + (string-length language)))) + language))) + (case-fold-down fixed-lang))) + +(define (author-string #!optional (author (current-node))) + (let ((lang (if (string? author) ($lang$) ($lang$ author)))) + (case lang + ;; ISO 639/ISO 3166/RFC 1766 + + (else (error (string-append "L10N ERROR: author-string: " + lang)))))) + +(define (gentext-xref-strings target) + (let ((giname (if (string? target) (normalize target) (gi target))) + (lang (if (string? target) ($lang$) ($lang$ target)))) + (case lang + + (else (error (string-append "L10N ERROR: gentext-xref-strings: " + lang)))))) + +(define (auto-xref-indirect-connector before) + (case ($lang$) + + (else (error "L10N ERROR: auto-xref-indirect-connector")))) + +(define (generate-toc-in-front) + (case ($lang$) + + (else (error "L10N ERROR: generate-toc-in-front")))) + +(define (gentext-element-name target) + (let ((giname (if (string? target) (normalize target) (gi target))) + (lang (if (string? target) ($lang$) ($lang$ target #t)))) + (case lang + + (else (error (string-append "L10N ERROR: gentext-element-name: " + lang + " (" + giname + ")")))))) + +(define (gentext-element-name-space target) + (let ((giname (if (string? target) (normalize target) (gi target))) + (lang (if (string? target) ($lang$) ($lang$ target)))) + (case lang + + (else (error "L10N ERROR: gentext-element-name-space"))))) + +(define (gentext-intra-label-sep target) + (let ((giname (if (string? target) (normalize target) (gi target))) + (lang (if (string? target) ($lang$) ($lang$ target)))) + (case lang + + (else (error "L10N ERROR: gentext-intra-label-sep"))))) + +(define (gentext-label-title-sep target) + (let ((giname (if (string? target) (normalize target) (gi target))) + (lang (if (string? target) ($lang$) ($lang$ target)))) + (case lang + + (else (error "L10N ERROR: gentext-label-title-sep"))))) + +(define (label-number-format target) + (let ((giname (if (string? target) (normalize target) (gi target))) + (lang (if (string? target) ($lang$) ($lang$ target)))) + (case lang + + (else (error "L10N ERROR: label-number-format"))))) + +(define ($lot-title$ lotgi) + (case ($lang$) + + (else (error "L10N ERROR: $lot-title$")))) + +(define (gentext-start-quote) + (case ($lang$) + + (else (error "L10N ERROR: gentext-start-quote")))) + +(define (gentext-end-quote) + (case ($lang$) + + (else (error "L10N ERROR: gentext-end-quote")))) + +(define (gentext-start-nested-quote) + (case ($lang$) + + (else (error "L10N ERROR: gentext-start-nested-quote")))) + +(define (gentext-end-nested-quote) + (case ($lang$) + + (else (error "L10N ERROR: gentext-end-nested-quote")))) + +(define (gentext-by) + (case ($lang$) + + (else (error "L10N ERROR: gentext-by")))) + +(define (gentext-edited-by) + (case ($lang$) + + (else (error "L10N ERROR: gentext-edited-by")))) + +(define (gentext-revised-by) + (case ($lang$) + + (else (error "L10N ERROR: gentext-revised-by")))) + +(define (gentext-page) + (case ($lang$) + + (else (error "L10N ERROR: gentext-page")))) + +(define (gentext-and) + (case ($lang$) + + (else (error "L10N ERROR: gentext-and")))) + +(define (gentext-listcomma) + (case ($lang$) + + (else (error "L10N ERROR: gentext-listcomma")))) + +(define (gentext-lastlistcomma) + (case ($lang$) + + (else (error "L10N ERROR: gentext-lastlistcomma")))) + +(define (gentext-bibl-pages) + (case ($lang$) + + (else (error "L10N ERROR: gentext-bibl-pages")))) + +(define (gentext-endnotes) + (case ($lang$) + + (else (error "L10N ERROR: gentext-endnotes")))) + +(define (gentext-table-endnotes) + (case ($lang$) + + (else (error "L10N ERROR: gentext-table-endnotes")))) + +(define (gentext-index-see) + (case ($lang$) + + (else (error "L10N ERROR: gentext-index-see")))) + +(define (gentext-index-seealso) + (case ($lang$) + + (else (error "L10N ERROR: gentext-index-seealso")))) + +(define (gentext-nav-prev prev) + (case ($lang$) + + (else (error "L10N ERROR: gentext-nav-prev")))) + +(define (gentext-nav-prev-sibling prevsib) + (case ($lang$) + + (else (error "L10N ERROR: gentext-nav-prev-sibling ")))) + +(define (gentext-nav-next-sibling nextsib) + (case ($lang$) + + (else (error "L10N ERROR: gentext-nav-next-sibling")))) + +(define (gentext-nav-next next) + (case ($lang$) + + (else (error "L10N ERROR: gentext-nav-next")))) + +(define (gentext-nav-up up) + (case ($lang$) + + (else (error "L10N ERROR: gentext-nav-up")))) + +(define (gentext-nav-home home) + (case ($lang$) + + (else (error "L10N ERROR: gentext-nav-home")))) diff --git a/common/dbl1af.dsl b/common/dbl1af.dsl new file mode 100644 index 0000000..47b62e0 --- /dev/null +++ b/common/dbl1af.dsl @@ -0,0 +1,440 @@ + +%af.words; +]> + + + + + +;; $Id: dbl1af.dsl,v 1.1 2001/07/04 14:46:00 uid48421 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; Modified for Afrikaans + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (af-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (af-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "the &appendix; called %t")) + (list (normalize "article") (string-append %gentext-af-start-quote% + "%t" + %gentext-af-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "the &chapter; called %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sidebar") "the &sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-af-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (af-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (af-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-af-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (af-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") "&Chapter;") + (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") "&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") "&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 (gentext-af-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (af-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-af-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-af-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-af-intra-label-sep) + (list)) + +(define (af-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-af-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (sep (assoc name (af-intra-label-sep)))) + (if sep + (car (cdr sep)) + ""))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-af-label-title-sep) + (list)) + +(define (af-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-af-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (sep (assoc name (af-label-title-sep)))) + (if sep + (car (cdr sep)) + ""))) + +(define (af-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (af-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (af-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (af-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-af$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (af-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-af-start-quote% (dingbat "ldquo")) + +(define %gentext-af-end-quote% (dingbat "rdquo")) + +(define %gentext-af-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-af-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-af-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-af-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-af-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-af-page% "") + +(define %gentext-af-and% "∧") + +(define %gentext-af-listcomma% "&listcomma;") + +(define %gentext-af-lastlistcomma% "&lastlistcomma;") + +(define %gentext-af-bibl-pages% "&Pgs;") + +(define %gentext-af-endnotes% "&Notes;") + +(define %gentext-af-table-endnotes% "&TableNotes;:") + +(define %gentext-af-index-see% "&See;") + +(define %gentext-af-index-seealso% "&SeeAlso;") + + +(define (gentext-af-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-af-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-af-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-af-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-af-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-af-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1af.ent b/common/dbl1af.ent new file mode 100644 index 0000000..893f197 --- /dev/null +++ b/common/dbl1af.ent @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1bg.dsl b/common/dbl1bg.dsl new file mode 100644 index 0000000..3b1417d --- /dev/null +++ b/common/dbl1bg.dsl @@ -0,0 +1,431 @@ + +%cyr1; + +%bg.words; +]> + + + + + +;; $Id: dbl1bg.dsl,v 1.1 2004/10/09 21:36:35 petere78 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The Bulgarian version of this file used the Romanian as a template. + +(define (bg-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (bg-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "&appendix; %t")) + (list (normalize "article") (string-append %gentext-bg-start-quote% + "%t" + %gentext-bg-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "&chapter; %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "sidebar") "&sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-bg-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (bg-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (bg-auto-xref-indirect-connector before) + (literal " ∈ ")) + +;; Should the TOC come first or last? +;; +(define %generate-bg-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (bg-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") "&Chapter;") + (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") "&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") "&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 (gentext-bg-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (bg-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-bg-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-bg-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-bg-intra-label-sep) + (list)) + +(define (bg-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-bg-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-bg-intra-label-sep))) + (sep (assoc name (bg-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-bg-label-title-sep) + (list)) + +(define (bg-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-bg-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-bg-label-title-sep))) + (sep (assoc name (bg-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (bg-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (bg-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (bg-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (bg-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-bg$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (bg-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-bg-start-quote% (dingbat "ldquo")) + +(define %gentext-bg-end-quote% (dingbat "rdquo")) + +(define %gentext-bg-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-bg-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-bg-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-bg-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-bg-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-bg-page% "") + +(define %gentext-bg-and% "∧") + +(define %gentext-bg-listcomma% "&listcomma;") + +(define %gentext-bg-lastlistcomma% "&lastlistcomma;") + +(define %gentext-bg-bibl-pages% "&Pgs;") + +(define %gentext-bg-endnotes% "&Notes;") + +(define %gentext-bg-table-endnotes% "&TableNotes;:") + +(define %gentext-bg-index-see% "&See;") + +(define %gentext-bg-index-seealso% "&SeeAlso;") + + +(define (gentext-bg-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-bg-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-bg-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-bg-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-bg-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-bg-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + diff --git a/common/dbl1bg.ent b/common/dbl1bg.ent new file mode 100644 index 0000000..be544f2 --- /dev/null +++ b/common/dbl1bg.ent @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1bs.dsl b/common/dbl1bs.dsl new file mode 100644 index 0000000..fe63f66 --- /dev/null +++ b/common/dbl1bs.dsl @@ -0,0 +1,444 @@ + +%bs.words; +]> + + + + + +;; $Id: dbl1bs.dsl,v 1.2 2004/10/09 21:16:26 petere78 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (bs-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (bs-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "&appendix; sa nazivom %t")) + (list (normalize "article") (string-append %gentext-bs-start-quote% + "%t" + %gentext-bs-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "&chapter; sa nazivom %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "§ion; sa nazivom %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "§ion; sa nazivom %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "§ion; sa nazivom %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "§ion; sa nazivom %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "§ion; sa nazivom %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "§ion; sa nazivom %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "§ion; sa nazivom %t")) + (list (normalize "sidebar") "the &sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-bs-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (bs-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (bs-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-bs-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (bs-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") "&Chapter;") + (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") "&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") "&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 (gentext-bs-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (bs-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-bs-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-bs-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-bs-intra-label-sep) + (list)) + +(define (bs-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-bs-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-bs-intra-label-sep))) + (sep (assoc name (bs-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-bs-label-title-sep) + (list)) + +(define (bs-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-bs-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-bs-label-title-sep))) + (sep (assoc name (bs-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (bs-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (bs-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (bs-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (bs-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-bs$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (bs-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-bs-start-quote% (dingbat "ldquo")) + +(define %gentext-bs-end-quote% (dingbat "rdquo")) + +(define %gentext-bs-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-bs-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-bs-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-bs-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-bs-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-bs-page% "") + +(define %gentext-bs-and% "∧") + +(define %gentext-bs-listcomma% "&listcomma;") + +(define %gentext-bs-lastlistcomma% "&lastlistcomma;") + +(define %gentext-bs-bibl-pages% "&Pgs;") + +(define %gentext-bs-endnotes% "&Notes;") + +(define %gentext-bs-table-endnotes% "&TableNotes;:") + +(define %gentext-bs-index-see% "&see;") + +(define %gentext-bs-index-seealso% "&seealso;") + + +(define (gentext-bs-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-bs-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-bs-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-bs-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-bs-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-bs-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1bs.ent b/common/dbl1bs.ent new file mode 100644 index 0000000..c485ff6 --- /dev/null +++ b/common/dbl1bs.ent @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1ca.dsl b/common/dbl1ca.dsl new file mode 100644 index 0000000..93980dd --- /dev/null +++ b/common/dbl1ca.dsl @@ -0,0 +1,443 @@ + +%ca.words; +]> + + + + + +;; $Id: dbl1ca.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; Contributors: +;; Perceval - Marc Huguet Puig, mhp@nil.fut.es +;; marc*, marc.gonzalez-carnicer@european-go.org + +(define (ca-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (ca-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "l'&appendix; de nom %t")) + (list (normalize "article") (string-append %gentext-ca-start-quote% + "%t" + %gentext-ca-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "el &chapter; de nom %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "la §ion; de nom %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "la §ion; de nom %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "la §ion; de nom %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "la §ion; de nom %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "la §ion; de nom %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "la §ion; de nom %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "la §ion; de nom %t")) + (list (normalize "sidebar") "la &sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-ca-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (ca-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (ca-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " al ")) + ((equal? (gi before) (normalize "chapter")) + (literal " al; ")) + ((equal? (gi before) (normalize "sect1")) + (literal " a la; ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-ca-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (ca-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") "&Chapter;") + (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") "&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") "&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 (gentext-ca-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (ca-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-ca-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-ca-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-ca-intra-label-sep) + (list)) + +(define (ca-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-ca-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-ca-intra-label-sep))) + (sep (assoc name (ca-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-ca-label-title-sep) + (list)) + +(define (ca-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-ca-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-ca-label-title-sep))) + (sep (assoc name (ca-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (ca-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (ca-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (ca-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (ca-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-ca$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (ca-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-ca-start-quote% (dingbat "ldquo")) + +(define %gentext-ca-end-quote% (dingbat "rdquo")) + +(define %gentext-ca-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-ca-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-ca-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-ca-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-ca-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-ca-page% "") + +(define %gentext-ca-and% "∧") + +(define %gentext-ca-listcomma% "&listcomma;") + +(define %gentext-ca-lastlistcomma% "&lastlistcomma;") + +(define %gentext-ca-bibl-pages% "&Pgs;") + +(define %gentext-ca-endnotes% "&Notes;") + +(define %gentext-ca-table-endnotes% "&TableNotes;:") + +(define %gentext-ca-index-see% "&See;") + +(define %gentext-ca-index-seealso% "&SeeAlso;") + + +(define (gentext-ca-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-ca-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-ca-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-ca-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-ca-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-ca-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1ca.ent b/common/dbl1ca.ent new file mode 100644 index 0000000..cbe3e89 --- /dev/null +++ b/common/dbl1ca.ent @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1cs.dsl b/common/dbl1cs.dsl new file mode 100644 index 0000000..5d2a7c6 --- /dev/null +++ b/common/dbl1cs.dsl @@ -0,0 +1,443 @@ + +%cs.words; +]> + + + + + +;; $Id: dbl1cs.dsl,v 1.3 2001/09/06 14:49:24 kosek Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; Contributors: +;; Ralf Schleitzer, ralf.schleitzer@ixos.de + +(define (cs-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (cs-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "%n" + "%n \U-2013; \U-201E;%t\U-201C;")) + (list (normalize "article") (string-append %gentext-cs-start-quote% + "%t" + %gentext-cs-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "%n" + "%n \U-2013; \U-201E;%t\U-201C;")) + (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 \U-2013; \U-201E;%t\U-201C;") + (list (normalize "preface") "%t") + (list (normalize "procedure") "%n \U-2013; \U-201E;%t\U-201C;") + (list (normalize "reference") "%t") + (list (normalize "section") (if %section-autolabel% + "%n" + "\U-201E;%t\U-201C;")) + (list (normalize "sect1") (if %section-autolabel% + "%n" + "\U-201E;%t\U-201C;")) + (list (normalize "sect2") (if %section-autolabel% + "%n" + "\U-201E;%t\U-201C;")) + (list (normalize "sect3") (if %section-autolabel% + "%n" + "\U-201E;%t\U-201C;")) + (list (normalize "sect4") (if %section-autolabel% + "%n" + "\U-201E;%t\U-201C;")) + (list (normalize "sect5") (if %section-autolabel% + "%n" + "\U-201E;%t\U-201C;")) + (list (normalize "simplesect") (if %section-autolabel% + "%n" + "\U-201E;%t\U-201C;")) + (list (normalize "sidebar") "%t") + (list (normalize "step") "%n") + (list (normalize "table") "%n"))) + +(define (gentext-cs-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (cs-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (cs-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-cs-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (cs-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") "&Chapter;") + (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") "&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") "&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 (gentext-cs-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (cs-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-cs-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-cs-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-cs-intra-label-sep) + (list)) + +(define (cs-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-cs-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-cs-intra-label-sep))) + (sep (assoc name (cs-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-cs-label-title-sep) + (list)) + +(define (cs-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-cs-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-cs-label-title-sep))) + (sep (assoc name (cs-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (cs-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (cs-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (cs-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (cs-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-cs$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (cs-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + + +(define %gentext-cs-start-quote% "\U-201E;") + +(define %gentext-cs-end-quote% "\U-201C;") + +(define %gentext-cs-start-nested-quote% "\U-201A;") + +(define %gentext-cs-end-nested-quote% "\U-2018;") + +(define %gentext-cs-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-cs-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-cs-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-cs-page% "") + +(define %gentext-cs-and% "∧") + +(define %gentext-cs-listcomma% "&listcomma;") + +(define %gentext-cs-lastlistcomma% "&lastlistcomma;") + +(define %gentext-cs-bibl-pages% "&Pgs;") + +(define %gentext-cs-endnotes% "&Notes;") + +(define %gentext-cs-table-endnotes% "&TableNotes;:") + +(define %gentext-cs-index-see% "&See;") + +(define %gentext-cs-index-seealso% "&SeeAlso;") + + +(define (gentext-cs-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-cs-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-cs-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-cs-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-cs-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-cs-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1cs.ent b/common/dbl1cs.ent new file mode 100644 index 0000000..39d3493 --- /dev/null +++ b/common/dbl1cs.ent @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1da.dsl b/common/dbl1da.dsl new file mode 100644 index 0000000..79d4823 --- /dev/null +++ b/common/dbl1da.dsl @@ -0,0 +1,432 @@ + +%da.words; +]> + + + + + +;; $Id: dbl1da.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; Contributors: +;; Finn Bock, fbo@dde.dk + +(define (da-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (da-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "&appendix; med navn %t")) + (list (normalize "article") (string-append %gentext-da-start-quote% + "%t" + %gentext-da-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "kapitlet om %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "sektionen med navn %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "sektionen med navn %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "undersektionen med navn %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "undersektionen med navn %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "undersektionen med navn %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "undersektionen med navn %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "undersektionen med navn %t")) + (list (normalize "sidebar") "&sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-da-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (da-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (da-auto-xref-indirect-connector before) + (literal " i ")) + +;; Should the TOC come first or last? +;; +(define %generate-da-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (da-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") "&Chapter;") + (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") "&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") "&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 (gentext-da-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (da-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-da-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-da-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-da-intra-label-sep) + (list)) + +(define (da-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-da-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-da-intra-label-sep))) + (sep (assoc name (da-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-da-label-title-sep) + (list)) + +(define (da-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-da-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-da-label-title-sep))) + (sep (assoc name (da-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (da-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (da-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (da-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (da-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-da$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (da-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-da-start-quote% (dingbat "ldquo")) + +(define %gentext-da-end-quote% (dingbat "rdquo")) + +(define %gentext-da-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-da-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-da-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-da-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-da-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-da-page% "") + +(define %gentext-da-and% "∧") + +(define %gentext-da-listcomma% "&listcomma;") + +(define %gentext-da-lastlistcomma% "&lastlistcomma;") + +(define %gentext-da-bibl-pages% "&Pgs;") + +(define %gentext-da-endnotes% "&Notes;") + +(define %gentext-da-table-endnotes% "&TableNotes;:") + +(define %gentext-da-index-see% "&See;") + +(define %gentext-da-index-seealso% "&SeeAlso;") + + +(define (gentext-da-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-da-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-da-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-da-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-da-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-da-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + + diff --git a/common/dbl1da.ent b/common/dbl1da.ent new file mode 100644 index 0000000..0ac6132 --- /dev/null +++ b/common/dbl1da.ent @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1de.dsl b/common/dbl1de.dsl new file mode 100644 index 0000000..6b323be --- /dev/null +++ b/common/dbl1de.dsl @@ -0,0 +1,445 @@ + +%de.words; +]> + + + + + +;; $Id: dbl1de.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; Contributors: +;; Rainer Feuerstein, fire@informatik.uni-wuerzburg.de, +;; Christian Leutloff, leutloff@sundancer.oche.de +;; Ulrich Windl, Ulrich.Windl@rz.uni-regensburg.de +;; Christian Kirsch, ck@held.mind.de +;; Joerg Wittenberger, Joerg.Wittenberger@pobox.com + +(define (de-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (de-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "&Appendix; namens %t")) + (list (normalize "article") (string-append %gentext-de-start-quote% + "%t" + %gentext-de-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "&Chapter; namens %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "&Section; namens %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "&Section; namens %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "&Section; namens %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "&Section; namens %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "&Section; namens %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "&Section; namens %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "&Section; namens %t")) + (list (normalize "sidebar") "&Sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-de-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (de-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (de-auto-xref-indirect-connector before) + ;; In German one usually says "... in dem Buch ..." (probably because + ;; it's a larger piece of work and more commonly known) + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ dem ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-de-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; +(define (de-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") "&Chapter;") + (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") "&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") "&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 (gentext-de-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (de-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-de-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-de-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-de-intra-label-sep) + (list)) + +(define (de-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-de-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-de-intra-label-sep))) + (sep (assoc name (de-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-de-label-title-sep) + (list)) + +(define (de-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-de-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-de-label-title-sep))) + (sep (assoc name (de-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (de-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (de-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (de-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (de-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-de$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (de-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-de-start-quote% "\U-201E;") + +(define %gentext-de-end-quote% "\U-201C;") + +(define %gentext-de-start-nested-quote% "\U-201A;") + +(define %gentext-de-end-nested-quote% "\U-2018;") + +(define %gentext-de-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-de-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-de-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-de-page% "") + +(define %gentext-de-and% "∧") + +(define %gentext-de-listcomma% "&listcomma;") + +(define %gentext-de-lastlistcomma% "&lastlistcomma;") + +(define %gentext-de-bibl-pages% "&Pgs;") + +(define %gentext-de-endnotes% "&Notes;") + +(define %gentext-de-table-endnotes% "&TableNotes;:") + +(define %gentext-de-index-see% "&See;") + +(define %gentext-de-index-seealso% "&SeeAlso;") + + +(define (gentext-de-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-de-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-de-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-de-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-de-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-de-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + + diff --git a/common/dbl1de.ent b/common/dbl1de.ent new file mode 100644 index 0000000..0b6e053 --- /dev/null +++ b/common/dbl1de.ent @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1el.dsl b/common/dbl1el.dsl new file mode 100644 index 0000000..1570238 --- /dev/null +++ b/common/dbl1el.dsl @@ -0,0 +1,445 @@ + +%el.words; +]> + + + + + +;; $Id: dbl1el.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (el-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (el-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "ôï &appendix; ìå üíïìá %t")) + (list (normalize "article") (string-append %gentext-el-start-quote% + "%t" + %gentext-el-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "ôï &chapter; ìå üíïìá %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "ôï §ion; ìå üíïìá %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "ôï §ion; ìå üíïìá %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "ôï §ion; ìå üíïìá %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "ôï §ion; ìå üíïìá %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "ôï §ion; ìå üíïìá %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "ôï §ion; ìå üíïìá %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "ôï §ion; ìå üíïìá %t")) + (list (normalize "sidebar") "ôï &sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + + +(define (gentext-el-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (el-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (el-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-el-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; +(define (el-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") "&Chapter;") + (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") "&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") "&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 (gentext-el-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (el-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-el-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-el-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-el-intra-label-sep) + (list)) + +(define (el-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-el-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-el-intra-label-sep))) + (sep (assoc name (el-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-el-label-title-sep) + (list)) + +(define (el-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-el-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-el-label-title-sep))) + (sep (assoc name (el-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (el-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (el-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (el-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (el-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-el$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (el-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-el-start-quote% (dingbat "ldquo")) + +(define %gentext-el-end-quote% (dingbat "rdquo")) + +(define %gentext-el-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-el-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-el-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-el-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-el-revised-by% "&Editedby;") + ;; "Revised by" Jane Doe + +(define %gentext-el-page% "") + +(define %gentext-el-and% "∧") + +(define %gentext-el-listcomma% "&listcomma;") + +(define %gentext-el-lastlistcomma% "&lastlistcomma;") + +(define %gentext-el-bibl-pages% "&Pgs;") + +(define %gentext-el-endnotes% "&Notes;") + +(define %gentext-el-table-endnotes% "&TableNotes;:") + +(define %gentext-el-index-see% "&See;") + +(define %gentext-el-index-seealso% "&SeeAlso;") + + +(define (gentext-el-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-el-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-el-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-el-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-el-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-el-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + + diff --git a/common/dbl1el.ent b/common/dbl1el.ent new file mode 100644 index 0000000..c15e62f --- /dev/null +++ b/common/dbl1el.ent @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1en.dsl b/common/dbl1en.dsl new file mode 100644 index 0000000..573d28b --- /dev/null +++ b/common/dbl1en.dsl @@ -0,0 +1,444 @@ + +%en.words; +]> + + + + + +;; $Id: dbl1en.dsl,v 1.3 2002/12/20 02:22:06 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (en-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (en-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "the &appendix; called %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% + "&Chapter; %n" + "the &chapter; called %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sidebar") "the &sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-en-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (en-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (en-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-en-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(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") "&Chapter;") + (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") "&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") "&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 (gentext-en-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (en-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-en-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-en-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-en-intra-label-sep) + (list)) + +(define (en-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-en-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-en-intra-label-sep))) + (sep (assoc name (en-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-en-label-title-sep) + (list)) + +(define (en-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-en-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-en-label-title-sep))) + (sep (assoc name (en-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (en-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (en-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (en-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (en-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-en$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (en-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-en-start-quote% (dingbat "ldquo")) + +(define %gentext-en-end-quote% (dingbat "rdquo")) + +(define %gentext-en-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-en-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-en-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-en-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-en-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-en-page% "") + +(define %gentext-en-and% "∧") + +(define %gentext-en-listcomma% "&listcomma;") + +(define %gentext-en-lastlistcomma% "&lastlistcomma;") + +(define %gentext-en-bibl-pages% "&Pgs;") + +(define %gentext-en-endnotes% "&Notes;") + +(define %gentext-en-table-endnotes% "&TableNotes;:") + +(define %gentext-en-index-see% "&see;") + +(define %gentext-en-index-seealso% "&seealso;") + + +(define (gentext-en-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-en-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-en-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-en-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-en-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-en-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1en.ent b/common/dbl1en.ent new file mode 100644 index 0000000..c0ef979 --- /dev/null +++ b/common/dbl1en.ent @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1es.dsl b/common/dbl1es.dsl new file mode 100644 index 0000000..7d69918 --- /dev/null +++ b/common/dbl1es.dsl @@ -0,0 +1,434 @@ + +%es.words; +]> + + + + + +;; $Id: dbl1es.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (es-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (es-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "el &appendix; de nombre %t")) + (list (normalize "article") (string-append %gentext-es-start-quote% + "%t" + %gentext-es-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "el &chapter; de nombre %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "la §ion; de nombre %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "la §ion; de nombre %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "la §ion; de nombre %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "la §ion; de nombre %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "la §ion; de nombre %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "la §ion; de nombre %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "la §ion; de nombre %t")) + (list (normalize "sidebar") "&sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-es-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (es-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (es-auto-xref-indirect-connector before) + (literal " ∈ ")) + +;; Should the TOC come first or last? +;; +(define %generate-es-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (es-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") "&Chapter;") + (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") "&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") "&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 (gentext-es-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (es-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-es-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-es-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-es-intra-label-sep) + (list)) + +(define (es-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-es-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-es-intra-label-sep))) + (sep (assoc name (es-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-es-label-title-sep) + (list)) + +(define (es-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-es-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-es-label-title-sep))) + (sep (assoc name (es-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (es-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (es-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (es-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (es-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-es$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (es-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-es-start-quote% (dingbat "ldquo")) + +(define %gentext-es-end-quote% (dingbat "rdquo")) + +(define %gentext-es-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-es-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-es-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-es-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-es-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-es-page% "") + +(define %gentext-es-and% "∧") + +(define %gentext-es-listcomma% "&listcomma;") + +(define %gentext-es-lastlistcomma% "&lastlistcomma;") + +(define %gentext-es-bibl-pages% "&Pgs;") + +(define %gentext-es-endnotes% "&Notes;") + +(define %gentext-es-table-endnotes% "&TableNotes;:") + +(define %gentext-es-index-see% "&See;") + +(define %gentext-es-index-seealso% "&SeeAlso;") + + +(define (gentext-es-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-es-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-es-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-es-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-es-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-es-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + + diff --git a/common/dbl1es.ent b/common/dbl1es.ent new file mode 100644 index 0000000..3e1b7e0 --- /dev/null +++ b/common/dbl1es.ent @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1et.dsl b/common/dbl1et.dsl new file mode 100644 index 0000000..5a75101 --- /dev/null +++ b/common/dbl1et.dsl @@ -0,0 +1,444 @@ + +%et.words; +]> + + + + + +;; $Id: dbl1et.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (et-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (et-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "&appendix; %t")) + (list (normalize "article") (string-append %gentext-et-start-quote% + "%t" + %gentext-et-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "&chapter; %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "sidebar") "&sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-et-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (et-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (et-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-et-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (et-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") "&Chapter;") + (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") "&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") "&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 (gentext-et-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (et-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-et-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-et-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-et-intra-label-sep) + (list)) + +(define (et-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-et-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (et-intra-label-sep))) + (sep (assoc name (en-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-et-label-title-sep) + (list)) + +(define (et-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-et-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-et-label-title-sep))) + (sep (assoc name (et-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (et-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (et-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (et-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (et-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-et$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (et-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-et-start-quote% (dingbat "ldquo")) + +(define %gentext-et-end-quote% (dingbat "rdquo")) + +(define %gentext-et-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-et-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-et-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-et-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-et-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-et-page% "") + +(define %gentext-et-and% "∧") + +(define %gentext-et-listcomma% "&listcomma;") + +(define %gentext-et-lastlistcomma% "&lastlistcomma;") + +(define %gentext-et-bibl-pages% "&Pgs;") + +(define %gentext-et-endnotes% "&Notes;") + +(define %gentext-et-table-endnotes% "&TableNotes;:") + +(define %gentext-et-index-see% "&See;") + +(define %gentext-et-index-seealso% "&SeeAlso;") + + +(define (gentext-et-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-et-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-et-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-et-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-et-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-et-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1et.ent b/common/dbl1et.ent new file mode 100644 index 0000000..b325fce --- /dev/null +++ b/common/dbl1et.ent @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1eu.dsl b/common/dbl1eu.dsl new file mode 100644 index 0000000..4d38398 --- /dev/null +++ b/common/dbl1eu.dsl @@ -0,0 +1,444 @@ + +%eu.words; +]> + + + + + +;; $Id: dbl1eu.dsl,v 1.1 2001/11/14 20:57:53 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (eu-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (eu-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "the &appendix; called %t")) + (list (normalize "article") (string-append %gentext-eu-start-quote% + "%t" + %gentext-eu-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "the &chapter; called %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sidebar") "the &sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-eu-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (eu-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (eu-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-eu-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (eu-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") "&Chapter;") + (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") "&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") "&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 (gentext-eu-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (eu-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-eu-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-eu-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-eu-intra-label-sep) + (list)) + +(define (eu-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-eu-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-eu-intra-label-sep))) + (sep (assoc name (eu-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-eu-label-title-sep) + (list)) + +(define (eu-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-eu-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-eu-label-title-sep))) + (sep (assoc name (eu-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (eu-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (eu-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (eu-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (eu-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-eu$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (eu-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-eu-start-quote% (dingbat "ldquo")) + +(define %gentext-eu-end-quote% (dingbat "rdquo")) + +(define %gentext-eu-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-eu-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-eu-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-eu-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-eu-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-eu-page% "") + +(define %gentext-eu-and% "∧") + +(define %gentext-eu-listcomma% "&listcomma;") + +(define %gentext-eu-lastlistcomma% "&lastlistcomma;") + +(define %gentext-eu-bibl-pages% "&Pgs;") + +(define %gentext-eu-endnotes% "&Notes;") + +(define %gentext-eu-table-endnotes% "&TableNotes;:") + +(define %gentext-eu-index-see% "&See;") + +(define %gentext-eu-index-seealso% "&SeeAlso;") + + +(define (gentext-eu-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-eu-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-eu-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-eu-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-eu-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-eu-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1eu.ent b/common/dbl1eu.ent new file mode 100644 index 0000000..522b938 --- /dev/null +++ b/common/dbl1eu.ent @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1fi.dsl b/common/dbl1fi.dsl new file mode 100644 index 0000000..e69031c --- /dev/null +++ b/common/dbl1fi.dsl @@ -0,0 +1,444 @@ + +%fi.words; +]> + + + + + +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (fi-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (fi-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "%t")) + (list (normalize "article") (string-append %gentext-fi-start-quote% + "%t" + %gentext-fi-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "%t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "%t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "%t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "%t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "%t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "%t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "%t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "%t")) + (list (normalize "sidebar") "%t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-fi-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (fi-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (fi-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-fi-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (fi-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") "&Chapter;") + (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") "&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") "&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 (gentext-fi-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (fi-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-fi-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-fi-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-fi-intra-label-sep) + (list)) + +(define (fi-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-fi-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-fi-intra-label-sep))) + (sep (assoc name (fi-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-fi-label-title-sep) + (list)) + +(define (fi-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-fi-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-fi-label-title-sep))) + (sep (assoc name (fi-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (fi-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (fi-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (fi-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (fi-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-fi$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (fi-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-fi-start-quote% (dingbat "ldquo")) + +(define %gentext-fi-end-quote% (dingbat "rdquo")) + +(define %gentext-fi-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-fi-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-fi-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-fi-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-fi-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-fi-page% "") + +(define %gentext-fi-and% "∧") + +(define %gentext-fi-listcomma% "&listcomma;") + +(define %gentext-fi-lastlistcomma% "&lastlistcomma;") + +(define %gentext-fi-bibl-pages% "&Pgs;") + +(define %gentext-fi-endnotes% "&Notes;") + +(define %gentext-fi-table-endnotes% "&TableNotes;:") + +(define %gentext-fi-index-see% "&See;") + +(define %gentext-fi-index-seealso% "&SeeAlso;") + + +(define (gentext-fi-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-fi-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-fi-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-fi-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-fi-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-fi-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + + diff --git a/common/dbl1fi.ent b/common/dbl1fi.ent new file mode 100644 index 0000000..ab4fc67 --- /dev/null +++ b/common/dbl1fi.ent @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1fr.dsl b/common/dbl1fr.dsl new file mode 100644 index 0000000..381c099 --- /dev/null +++ b/common/dbl1fr.dsl @@ -0,0 +1,436 @@ + +%fr.words; +]> + + + + + +;; $Id: dbl1fr.dsl,v 1.3 2002/02/20 16:32:35 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; +;; Contributors: +;; Rainer Feuerstein, fire@informatik.uni-wuerzburg.de +;; Christian Leutloff, leutloff@sundancer.oche.de +;; Eric Bischoff, e.bischoff@noos.fr +;; Frederik Fouvry, fouvry@CoLi.Uni-SB.DE + +(define (fr-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (fr-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "l'annexe intitulée %t")) + (list (normalize "article") (string-append %gentext-fr-start-quote% + "%t" + %gentext-fr-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "le chapitre intitulé %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "la section intitulée %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "la section intitulée %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "la section intitulée %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "la section intitulée %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "la section intitulée %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "la section intitulée %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "la section intitulée %t")) + (list (normalize "sidebar") "&sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-fr-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (fr-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (fr-auto-xref-indirect-connector before) + (literal " ∈ ")) + +;; Should the TOC come first or last? +;; +(define %generate-fr-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (fr-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") "&Chapter;") + (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") "&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") "&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 (gentext-fr-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (fr-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-fr-element-name : &unexpectedelementname; : " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-fr-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-fr-intra-label-sep) + (list)) + +(define (fr-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-fr-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-fr-intra-label-sep))) + (sep (assoc name (fr-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-fr-label-title-sep) + (list)) + +(define (fr-label-title-sep) + (list + (list (normalize "abstract") "\U-00A0;: ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "chapter") ". ") + (list (normalize "equation") ". ") + (list (normalize "example") ". ") + (list (normalize "figure") ". ") + (list (normalize "footnote") ". ") + (list (normalize "glosssee") "\U-00A0;: ") + (list (normalize "glossseealso") "\U-00A0;: ") + (list (normalize "important") "\U-00A0;: ") + (list (normalize "note") "\U-00A0;: ") + (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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") "\U-00A0;: ") + (list (normalize "warning") "") + )) + +(define (gentext-fr-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-fr-label-title-sep))) + (sep (assoc name (fr-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (fr-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (fr-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (fr-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (fr-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-fr$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (fr-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;\U-00A0;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + ; nbsp; +(define %gentext-fr-start-quote% (string-append (dingbat "laquo") "\U-00A0;")) + +(define %gentext-fr-end-quote% (string-append "\U-00A0;" (dingbat "raquo"))) + +(define %gentext-fr-start-nested-quote% (string-append (dingbat "lsaquo") "\U-00A0;")) + +(define %gentext-fr-end-nested-quote% (string-append (dingbat "rsaquo") "\U-00A0;")) + +(define %gentext-fr-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-fr-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-fr-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-fr-page% "") + +(define %gentext-fr-and% "∧") + +(define %gentext-fr-listcomma% "&listcomma;") + +(define %gentext-fr-lastlistcomma% "&lastlistcomma;") + +(define %gentext-fr-bibl-pages% "&Pgs;") + +(define %gentext-fr-endnotes% "&Notes;") + +(define %gentext-fr-table-endnotes% "&TableNotes;\U-00A0;:") + +(define %gentext-fr-index-see% "&See;") + +(define %gentext-fr-index-seealso% "&SeeAlso;") + +(define (gentext-fr-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-fr-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-fr-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-fr-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-fr-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-fr-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + diff --git a/common/dbl1fr.ent b/common/dbl1fr.ent new file mode 100644 index 0000000..c22f22e --- /dev/null +++ b/common/dbl1fr.ent @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1hu.dsl b/common/dbl1hu.dsl new file mode 100644 index 0000000..180bdb3 --- /dev/null +++ b/common/dbl1hu.dsl @@ -0,0 +1,447 @@ + +%hu.words; +]> + + + + + +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; +;; Contributors: +;; Hojtsy Gabor, hgoba@freemail.c3.hu +;; + +(define (hu-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (hu-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "%n &Appendix;" + "%t")) + (list (normalize "article") (string-append %gentext-hu-start-quote% + "%t" + %gentext-hu-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "%n &chapter;" + "%t")) + (list (normalize "equation") "%n &Equation;") + (list (normalize "example") "%n &Example;") + (list (normalize "figure") "%n &Figure;") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "%n &Part;") + (list (normalize "preface") "%t") + (list (normalize "procedure") "%n, %t &Procedure; ") + (list (normalize "reference") "%n, %t &Reference; ") + (list (normalize "section") (if %section-autolabel% + "%n &Section;" + "%t")) + (list (normalize "sect1") (if %section-autolabel% + "%n &Section;" + "%t")) + (list (normalize "sect2") (if %section-autolabel% + "%n &Section;" + "%t")) + (list (normalize "sect3") (if %section-autolabel% + "%n &Section;" + "%t")) + (list (normalize "sect4") (if %section-autolabel% + "%n &Section;" + "%t")) + (list (normalize "sect5") (if %section-autolabel% + "%n &Section;" + "%t")) + (list (normalize "simplesect") (if %section-autolabel% + "%n &Section;" + "%t")) + (list (normalize "sidebar") "%t") + (list (normalize "step") "%n &step;") + (list (normalize "table") "%n &Table;"))) + +(define (gentext-hu-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (hu-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (hu-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-hu-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (hu-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") "&Chapter;") + (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") "&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") "&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 (gentext-hu-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (hu-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-hu-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-hu-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-hu-intra-label-sep) + (list)) + +(define (hu-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-hu-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-hu-intra-label-sep))) + (sep (assoc name (hu-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-hu-label-title-sep) + (list)) + +(define (hu-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-hu-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-hu-label-title-sep))) + (sep (assoc name (hu-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (hu-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (hu-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (hu-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (hu-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-hu$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (hu-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-hu-start-quote% (dingbat "ldquo")) + +(define %gentext-hu-end-quote% (dingbat "rdquo")) + +(define %gentext-hu-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-hu-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-hu-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-hu-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-hu-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-hu-page% "") + +(define %gentext-hu-and% "∧") + +(define %gentext-hu-listcomma% "&listcomma;") + +(define %gentext-hu-lastlistcomma% "&lastlistcomma;") + +(define %gentext-hu-bibl-pages% "&Pgs;") + +(define %gentext-hu-endnotes% "&Notes;") + +(define %gentext-hu-table-endnotes% "&TableNotes;:") + +(define %gentext-hu-index-see% "&See;") + +(define %gentext-hu-index-seealso% "&SeeAlso;") + + +(define (gentext-hu-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-hu-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-hu-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-hu-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-hu-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-hu-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + + diff --git a/common/dbl1hu.ent b/common/dbl1hu.ent new file mode 100644 index 0000000..3eb1e59 --- /dev/null +++ b/common/dbl1hu.ent @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1id.dsl b/common/dbl1id.dsl new file mode 100644 index 0000000..bd70530 --- /dev/null +++ b/common/dbl1id.dsl @@ -0,0 +1,608 @@ + +%id.words; +]> + + + + + +;; $Id: dbl1id.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; +;; Contributors: +;; Mohammad DAMT, mdamt@cdl2000.com +;; + +(define (id-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (id-appendix-xref-string gi-or-name) + (if %chapter-autolabel% + "&Appendix; %n" + "&appendix; berjudul %t")) + +(define (id-article-xref-string gi-or-name) + (string-append %gentext-id-start-quote% + "%t" + %gentext-id-end-quote%)) + +(define (id-bibliography-xref-string gi-or-name) + "%t") + +(define (id-book-xref-string gi-or-name) + "%t") + +(define (id-chapter-xref-string gi-or-name) + (if %chapter-autolabel% + "&Chapter; %n" + "&chapter; berjudul %t")) + +(define (id-equation-xref-string gi-or-name) + "&Equation; %n") + +(define (id-example-xref-string gi-or-name) + "&Example; %n") + +(define (id-figure-xref-string gi-or-name) + "&Figure; %n") + +(define (id-glossary-xref-string gi-or-name) + "%t") + +(define (id-index-xref-string gi-or-name) + "%t") + +(define (id-listitem-xref-string gi-or-name) + "%n") + +(define (id-part-xref-string gi-or-name) + "&Part; %n") + +(define (id-preface-xref-string gi-or-name) + "%t") + +(define (id-procedure-xref-string gi-or-name) + "&Procedure; %n, %t") + +(define (id-reference-xref-string gi-or-name) + "&Reference; %n, %t") + +(define (id-sectioning-xref-string gi-or-name) + (if %section-autolabel% + "&Section; %n" + "§ion; berjudul %t")) + +(define (id-sect1-xref-string gi-or-name) + (id-sectioning-xref-string gi-or-name)) + +(define (id-sect2-xref-string gi-or-name) + (id-sectioning-xref-string gi-or-name)) + +(define (id-sect3-xref-string gi-or-name) + (id-sectioning-xref-string gi-or-name)) + +(define (id-sect4-xref-string gi-or-name) + (id-sectioning-xref-string gi-or-name)) + +(define (id-sect5-xref-string gi-or-name) + (id-sectioning-xref-string gi-or-name)) + +(define (id-section-xref-string gi-or-name) + (id-sectioning-xref-string gi-or-name)) + +(define (id-sidebar-xref-string gi-or-name) + "the &sidebar; %t") + +(define (id-step-xref-string gi-or-name) + "&step; %n") + +(define (id-table-xref-string gi-or-name) + "&Table; %n") + +(define (id-default-xref-string gi-or-name) + (let* ((giname (if (string? gi-or-name) gi-or-name (gi gi-or-name))) + (msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)) + +(define (gentext-id-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname))) + (cond + ((equal? name (normalize "appendix")) (id-appendix-xref-string gind)) + ((equal? name (normalize "article")) (id-article-xref-string gind)) + ((equal? name (normalize "bibliography")) (id-bibliography-xref-string gind)) + ((equal? name (normalize "book")) (id-book-xref-string gind)) + ((equal? name (normalize "chapter")) (id-chapter-xref-string gind)) + ((equal? name (normalize "equation")) (id-equation-xref-string gind)) + ((equal? name (normalize "example")) (id-example-xref-string gind)) + ((equal? name (normalize "figure")) (id-figure-xref-string gind)) + ((equal? name (normalize "glossary")) (id-glossary-xref-string gind)) + ((equal? name (normalize "index")) (id-index-xref-string gind)) + ((equal? name (normalize "listitem")) (id-listitem-xref-string gind)) + ((equal? name (normalize "part")) (id-part-xref-string gind)) + ((equal? name (normalize "preface")) (id-preface-xref-string gind)) + ((equal? name (normalize "procedure")) (id-procedure-xref-string gind)) + ((equal? name (normalize "reference")) (id-reference-xref-string gind)) + ((equal? name (normalize "sect1")) (id-sect1-xref-string gind)) + ((equal? name (normalize "sect2")) (id-sect2-xref-string gind)) + ((equal? name (normalize "sect3")) (id-sect3-xref-string gind)) + ((equal? name (normalize "sect4")) (id-sect4-xref-string gind)) + ((equal? name (normalize "sect5")) (id-sect5-xref-string gind)) + ((equal? name (normalize "section")) (id-section-xref-string gind)) + ((equal? name (normalize "simplesect")) (id-section-xref-string gind)) + ((equal? name (normalize "sidebar")) (id-sidebar-xref-string gind)) + ((equal? name (normalize "step")) (id-step-xref-string gind)) + ((equal? name (normalize "table")) (id-table-xref-string gind)) + (else (id-default-xref-string gind))))) + +(define (id-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-id-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; +(define id-abstract-name "&Abstract;") +(define id-answer-name "&Answer;") +(define id-appendix-name "&Appendix;") +(define id-article-name "&Article;") +(define id-bibliography-name "&Bibliography;") +(define id-book-name "&Book;") +(define id-calloutlist-name "") +(define id-caution-name "&Caution;") +(define id-chapter-name "&Chapter;") +(define id-copyright-name "&Copyright;") +(define id-dedication-name "&Dedication;") +(define id-edition-name "&Edition;") +(define id-equation-name "&Equation;") +(define id-example-name "&Example;") +(define id-figure-name "&Figure;") +(define id-glossary-name "&Glossary;") +(define id-glosssee-name "&GlossSee;") +(define id-glossseealso-name "&GlossSeeAlso;") +(define id-important-name "&Important;") +(define id-index-name "&Index;") +(define id-colophon-name "&Colophon;") +(define id-setindex-name "&SetIndex;") +(define id-isbn-name "&isbn;") +(define id-legalnotice-name "&LegalNotice;") +(define id-msgaud-name "&MsgAud;") +(define id-msglevel-name "&MsgLevel;") +(define id-msgorig-name "&MsgOrig;") +(define id-note-name "&Note;") +(define id-part-name "&Part;") +(define id-preface-name "&Preface;") +(define id-procedure-name "&Procedure;") +(define id-pubdate-name "&Published;") +(define id-question-name "&Question;") +(define id-refentry-name "&RefEntry;") +(define id-reference-name "&Reference;") +(define id-refname-name "&RefName;") +(define id-revhistory-name "&RevHistory;") +(define id-refsect1-name "&RefSection;") +(define id-refsect2-name "&RefSection;") +(define id-refsect3-name "&RefSection;") +(define id-refsynopsisdiv-name "&RefSynopsisDiv;") +(define id-revision-name "&Revision;") +(define id-sect1-name "&Section;") +(define id-sect2-name "&Section;") +(define id-sect3-name "&Section;") +(define id-sect4-name "&Section;") +(define id-sect5-name "&Section;") +(define id-section-name "&Section;") +(define id-simplesect-name "&Section;") +(define id-seeie-name "&See;") +(define id-seealsoie-name "&Seealso;") +(define id-set-name "&Set;") +(define id-sidebar-name "&Sidebar;") +(define id-step-name "&step;") +(define id-table-name "&Table;") +(define id-tip-name "&Tip;") +(define id-toc-name "&TableofContents;") +(define id-warning-name "&Warning;") + +(define (gentext-id-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname))) + (cond + ((equal? name (normalize "abstract")) id-abstract-name) + ((equal? name (normalize "answer")) id-answer-name) + ((equal? name (normalize "appendix")) id-appendix-name) + ((equal? name (normalize "article")) id-article-name) + ((equal? name (normalize "bibliography")) id-bibliography-name) + ((equal? name (normalize "book")) id-book-name) + ((equal? name (normalize "calloutlist")) id-calloutlist-name) + ((equal? name (normalize "caution")) id-caution-name) + ((equal? name (normalize "chapter")) id-chapter-name) + ((equal? name (normalize "copyright")) id-copyright-name) + ((equal? name (normalize "dedication")) id-dedication-name) + ((equal? name (normalize "edition")) id-edition-name) + ((equal? name (normalize "equation")) id-equation-name) + ((equal? name (normalize "example")) id-example-name) + ((equal? name (normalize "figure")) id-figure-name) + ((equal? name (normalize "glossary")) id-glossary-name) + ((equal? name (normalize "glosssee")) id-glosssee-name) + ((equal? name (normalize "glossseealso")) id-glossseealso-name) + ((equal? name (normalize "important")) id-important-name) + ((equal? name (normalize "index")) id-index-name) + ((equal? name (normalize "colophon")) id-colophon-name) + ((equal? name (normalize "setindex")) id-setindex-name) + ((equal? name (normalize "isbn")) id-isbn-name) + ((equal? name (normalize "legalnotice")) id-legalnotice-name) + ((equal? name (normalize "msgaud")) id-msgaud-name) + ((equal? name (normalize "msglevel")) id-msglevel-name) + ((equal? name (normalize "msgorig")) id-msgorig-name) + ((equal? name (normalize "note")) id-note-name) + ((equal? name (normalize "part")) id-part-name) + ((equal? name (normalize "preface")) id-preface-name) + ((equal? name (normalize "procedure")) id-procedure-name) + ((equal? name (normalize "pubdate")) id-pubdate-name) + ((equal? name (normalize "question")) id-question-name) + ((equal? name (normalize "refentry")) id-refentry-name) + ((equal? name (normalize "reference")) id-reference-name) + ((equal? name (normalize "refname")) id-refname-name) + ((equal? name (normalize "revhistory")) id-revhistory-name) + ((equal? name (normalize "refsect1")) id-refsect1-name) + ((equal? name (normalize "refsect2")) id-refsect2-name) + ((equal? name (normalize "refsect3")) id-refsect3-name) + ((equal? name (normalize "refsynopsisdiv")) id-refsynopsisdiv-name) + ((equal? name (normalize "revision")) id-revision-name) + ((equal? name (normalize "sect1")) id-sect1-name) + ((equal? name (normalize "sect2")) id-sect2-name) + ((equal? name (normalize "sect3")) id-sect3-name) + ((equal? name (normalize "sect4")) id-sect4-name) + ((equal? name (normalize "sect5")) id-sect5-name) + ((equal? name (normalize "section")) id-section-name) + ((equal? name (normalize "simplesect")) id-simplesect-name) + ((equal? name (normalize "seeie")) id-seeie-name) + ((equal? name (normalize "seealsoie")) id-seealsoie-name) + ((equal? name (normalize "set")) id-set-name) + ((equal? name (normalize "sidebar")) id-sidebar-name) + ((equal? name (normalize "step")) id-step-name) + ((equal? name (normalize "table")) id-table-name) + ((equal? name (normalize "tip")) id-tip-name) + ((equal? name (normalize "toc")) id-toc-name) + ((equal? name (normalize "warning")) id-warning-name) + (else (let* ((msg (string-append "gentext-id-element-name: &unexpectedelementname;: " name)) + (err (node-list-error msg (current-node)))) + msg))))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-id-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define id-equation-intra-label-sep "-") +(define id-informalequation-intra-label-sep "-") +(define id-example-intra-label-sep "-") +(define id-figure-intra-label-sep "-") +(define id-listitem-intra-label-sep ".") +(define id-procedure-intra-label-sep ".") +(define id-refentry-intra-label-sep ".") +(define id-reference-intra-label-sep ".") +(define id-refname-intra-label-sep ", ") +(define id-refsect1-intra-label-sep ".") +(define id-refsect2-intra-label-sep ".") +(define id-refsect3-intra-label-sep ".") +(define id-sect1-intra-label-sep ".") +(define id-sect2-intra-label-sep ".") +(define id-sect3-intra-label-sep ".") +(define id-sect4-intra-label-sep ".") +(define id-sect5-intra-label-sep ".") +(define id-section-intra-label-sep ".") +(define id-simplesect-intra-label-sep ".") +(define id-step-intra-label-sep ".") +(define id-table-intra-label-sep "-") +(define id-_pagenumber-intra-label-sep "-") +(define id-default-intra-label-sep "") + +(define (gentext-id-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname))) + (cond + ((equal? name (normalize "equation")) id-equation-intra-label-sep) + ((equal? name (normalize "informalequation")) id-informalequation-intra-label-sep) + ((equal? name (normalize "example")) id-example-intra-label-sep) + ((equal? name (normalize "figure")) id-figure-intra-label-sep) + ((equal? name (normalize "listitem")) id-listitem-intra-label-sep) + ((equal? name (normalize "procedure")) id-procedure-intra-label-sep) + ((equal? name (normalize "refentry")) id-refentry-intra-label-sep) + ((equal? name (normalize "reference")) id-reference-intra-label-sep) + ((equal? name (normalize "refname")) id-refname-intra-label-sep) + ((equal? name (normalize "refsect1")) id-refsect1-intra-label-sep) + ((equal? name (normalize "refsect2")) id-refsect2-intra-label-sep) + ((equal? name (normalize "refsect3")) id-refsect3-intra-label-sep) + ((equal? name (normalize "sect1")) id-sect1-intra-label-sep) + ((equal? name (normalize "sect2")) id-sect2-intra-label-sep) + ((equal? name (normalize "sect3")) id-sect3-intra-label-sep) + ((equal? name (normalize "sect4")) id-sect4-intra-label-sep) + ((equal? name (normalize "sect5")) id-sect5-intra-label-sep) + ((equal? name (normalize "section")) id-section-intra-label-sep) + ((equal? name (normalize "simplesect")) id-simplesect-intra-label-sep) + ((equal? name (normalize "step")) id-step-intra-label-sep) + ((equal? name (normalize "table")) id-table-intra-label-sep) + ((equal? name (normalize "_pagenumber")) id-_pagenumber-intra-label-sep) + (else id-default-intra-label-sep)))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define id-abstract-label-title-sep ": ") +(define id-answer-label-title-sep " ") +(define id-appendix-label-title-sep ". ") +(define id-caution-label-title-sep "") +(define id-chapter-label-title-sep ". ") +(define id-equation-label-title-sep ". ") +(define id-example-label-title-sep ". ") +(define id-figure-label-title-sep ". ") +(define id-footnote-label-title-sep ". ") +(define id-glosssee-label-title-sep ": ") +(define id-glossseealso-label-title-sep ": ") +(define id-important-label-title-sep ": ") +(define id-note-label-title-sep ": ") +(define id-orderedlist-label-title-sep ". ") +(define id-part-label-title-sep ". ") +(define id-procedure-label-title-sep ". ") +(define id-prefix-label-title-sep ". ") +(define id-question-label-title-sep " ") +(define id-refentry-label-title-sep "") +(define id-reference-label-title-sep ". ") +(define id-refsect1-label-title-sep ". ") +(define id-refsect2-label-title-sep ". ") +(define id-refsect3-label-title-sep ". ") +(define id-sect1-label-title-sep ". ") +(define id-sect2-label-title-sep ". ") +(define id-sect3-label-title-sep ". ") +(define id-sect4-label-title-sep ". ") +(define id-sect5-label-title-sep ". ") +(define id-section-label-title-sep ". ") +(define id-simplesect-label-title-sep ". ") +(define id-seeie-label-title-sep " ") +(define id-seealsoie-label-title-sep " ") +(define id-step-label-title-sep ". ") +(define id-table-label-title-sep ". ") +(define id-tip-label-title-sep ": ") +(define id-warning-label-title-sep "") +(define id-default-label-title-sep "") + +(define (gentext-id-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname))) + (cond + ((equal? name (normalize "abstract")) id-abstract-label-title-sep) + ((equal? name (normalize "answer")) id-answer-label-title-sep) + ((equal? name (normalize "appendix")) id-appendix-label-title-sep) + ((equal? name (normalize "caution")) id-caution-label-title-sep) + ((equal? name (normalize "chapter")) id-chapter-label-title-sep) + ((equal? name (normalize "equation")) id-equation-label-title-sep) + ((equal? name (normalize "example")) id-example-label-title-sep) + ((equal? name (normalize "figure")) id-figure-label-title-sep) + ((equal? name (normalize "footnote")) id-footnote-label-title-sep) + ((equal? name (normalize "glosssee")) id-glosssee-label-title-sep) + ((equal? name (normalize "glossseealso")) id-glossseealso-label-title-sep) + ((equal? name (normalize "important")) id-important-label-title-sep) + ((equal? name (normalize "note")) id-note-label-title-sep) + ((equal? name (normalize "orderedlist")) id-orderedlist-label-title-sep) + ((equal? name (normalize "part")) id-part-label-title-sep) + ((equal? name (normalize "procedure")) id-procedure-label-title-sep) + ((equal? name (normalize "prefix")) id-prefix-label-title-sep) + ((equal? name (normalize "question")) id-question-label-title-sep) + ((equal? name (normalize "refentry")) id-refentry-label-title-sep) + ((equal? name (normalize "reference")) id-reference-label-title-sep) + ((equal? name (normalize "refsect1")) id-refsect1-label-title-sep) + ((equal? name (normalize "refsect2")) id-refsect2-label-title-sep) + ((equal? name (normalize "refsect3")) id-refsect3-label-title-sep) + ((equal? name (normalize "sect1")) id-sect1-label-title-sep) + ((equal? name (normalize "sect2")) id-sect2-label-title-sep) + ((equal? name (normalize "sect3")) id-sect3-label-title-sep) + ((equal? name (normalize "sect4")) id-sect4-label-title-sep) + ((equal? name (normalize "sect5")) id-sect5-label-title-sep) + ((equal? name (normalize "section")) id-section-label-title-sep) + ((equal? name (normalize "simplesect")) id-simplesect-label-title-sep) + ((equal? name (normalize "seeie")) id-seeie-label-title-sep) + ((equal? name (normalize "seealsoie")) id-seealsoie-label-title-sep) + ((equal? name (normalize "step")) id-step-label-title-sep) + ((equal? name (normalize "table")) id-table-label-title-sep) + ((equal? name (normalize "tip")) id-tip-label-title-sep) + ((equal? name (normalize "warning")) id-warning-label-title-sep) + (else id-default-label-title-sep)))) + +(define (id-set-label-number-format gind) "1") +(define (id-book-label-number-format gind) "1") +(define (id-prefix-label-number-format gind) "1") +(define (id-part-label-number-format gind) "I") +(define (id-chapter-label-number-format gind) "1") +(define (id-appendix-label-number-format gind) "A") +(define (id-reference-label-number-format gind) "I") +(define (id-example-label-number-format gind) "1") +(define (id-figure-label-number-format gind) "1") +(define (id-table-label-number-format gind) "1") +(define (id-procedure-label-number-format gind) "1") +(define (id-step-label-number-format gind) "1") +(define (id-refsect1-label-number-format gind) "1") +(define (id-refsect2-label-number-format gind) "1") +(define (id-refsect3-label-number-format gind) "1") +(define (id-sect1-label-number-format gind) "1") +(define (id-sect2-label-number-format gind) "1") +(define (id-sect3-label-number-format gind) "1") +(define (id-sect4-label-number-format gind) "1") +(define (id-sect5-label-number-format gind) "1") +(define (id-section-label-number-format gind) "1") +(define (id-default-label-number-format gind) "1") + +(define (id-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname))) + (cond + ((equal? name (normalize "set")) (id-set-label-number-format gind)) + ((equal? name (normalize "book")) (id-book-label-number-format gind)) + ((equal? name (normalize "prefix")) (id-prefix-label-number-format gind)) + ((equal? name (normalize "part")) (id-part-label-number-format gind)) + ((equal? name (normalize "chapter")) (id-chapter-label-number-format gind)) + ((equal? name (normalize "appendix")) (id-appendix-label-number-format gind)) + ((equal? name (normalize "reference")) (id-reference-label-number-format gind)) + ((equal? name (normalize "example")) (id-example-label-number-format gind)) + ((equal? name (normalize "figure")) (id-figure-label-number-format gind)) + ((equal? name (normalize "table")) (id-table-label-number-format gind)) + ((equal? name (normalize "procedure")) (id-procedure-label-number-format gind)) + ((equal? name (normalize "step")) (id-step-label-number-format gind)) + ((equal? name (normalize "refsect1")) (id-refsect1-label-number-format gind)) + ((equal? name (normalize "refsect2")) (id-refsect2-label-number-format gind)) + ((equal? name (normalize "refsect3")) (id-refsect3-label-number-format gind)) + ((equal? name (normalize "sect1")) (id-sect1-label-number-format gind)) + ((equal? name (normalize "sect2")) (id-sect2-label-number-format gind)) + ((equal? name (normalize "sect3")) (id-sect3-label-number-format gind)) + ((equal? name (normalize "sect4")) (id-sect4-label-number-format gind)) + ((equal? name (normalize "sect5")) (id-sect5-label-number-format gind)) + ((equal? name (normalize "section")) (id-section-label-number-format gind)) + (else (id-default-label-number-format gind))))) + +(define ($lot-title-id$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname))) + (cond ((equal? name (normalize "table")) "&ListofTables;") + ((equal? name (normalize "example")) "&ListofExamples;") + ((equal? name (normalize "figure")) "&ListofFigures;") + ((equal? name (normalize "equation")) "&ListofEquations;") + (else (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg))))) + +(define %gentext-id-start-quote% (dingbat "ldquo")) + +(define %gentext-id-end-quote% (dingbat "rdquo")) + +(define %gentext-id-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-id-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-id-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-id-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-id-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-id-page% "") + +(define %gentext-id-and% "∧") + +(define %gentext-id-listcomma% "&listcomma;") + +(define %gentext-id-lastlistcomma% "&lastlistcomma;") + +(define %gentext-id-bibl-pages% "&Pgs;") + +(define %gentext-id-endnotes% "&Notes;") + +(define %gentext-id-table-endnotes% "&TableNotes;:") + +(define %gentext-id-index-see% "&See;") + +(define %gentext-id-index-seealso% "&SeeAlso;") + + +(define (gentext-id-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-id-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-id-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-id-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-id-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-id-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1id.ent b/common/dbl1id.ent new file mode 100644 index 0000000..afde4d3 --- /dev/null +++ b/common/dbl1id.ent @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1it.dsl b/common/dbl1it.dsl new file mode 100644 index 0000000..791eb10 --- /dev/null +++ b/common/dbl1it.dsl @@ -0,0 +1,471 @@ + +%it.words; +]> + + + + + +;; $Id: dbl1it.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; Contributors: +;; camille@mandrakesoft.com + +(define (it-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (it-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "&appendix; %t")) + (list (normalize "article") (string-append %gentext-it-start-quote% + "%t" + %gentext-it-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "il &chapter; %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "la &Section; %n" + "la §ion; %t")) + (list (normalize "sect1") (if %section-autolabel% + "la &Section; %n" + "la §ion; %t")) + (list (normalize "sect2") (if %section-autolabel% + "la &Section; %n" + "la §ion; %t")) + (list (normalize "sect3") (if %section-autolabel% + "la &Section; %n" + "la §ion; %t")) + (list (normalize "sect4") (if %section-autolabel% + "la &Section; %n" + "la §ion; %t")) + (list (normalize "sect5") (if %section-autolabel% + "la &Section; %n" + "la §ion; %t")) + (list (normalize "simplesect") (if %section-autolabel% + "la &Section; %n" + "la §ion; %t")) + (list (normalize "sidebar") "the &sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-it-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (it-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (it-auto-xref-indirect-connector before) + (cond + ((member (gi before) + (list (normalize "part") + (normalize "set") + (normalize "revision") + (normalize "dedication") + (normalize "bibliography") + (normalize "preface") + (normalize "figure") + (normalize "procedure") + (normalize "sidebar") + (normalize "table") + (normalize "sect1") + (normalize "sect2") + (normalize "sect3") + (normalize "sect4") + (normalize "sect5") + (normalize "simplesect"))) + (literal " nella ")) + ((member (gi before) + (list (normalize "appendix") + (normalize "index") + (normalize "abstract") + (normalize "equation") + (normalize "example") + (normalize "article"))) + (literal " nell'")) + ((member (gi before) + (list (normalize "book") + (normalize "chapter") + (normalize "step") + (normalize "reference") + (normalize "glossary"))) + (literal " nel ")) +;; This is supposed never to be triggered! +;; I think the above conditions cover all the possible kinds of link +;; target containers (it's probably a superset, indeed). If they +;; don't, add the offending element to the correspondant list. + (else + (literal "[&unexpectedelementname;]")))) + +;; Should the TOC come first or last? +;; +(define %generate-it-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (it-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") "&Chapter;") + (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") "&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") "&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 (gentext-it-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (it-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-it-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-it-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-it-intra-label-sep) + (list)) + +(define (it-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-it-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-it-intra-label-sep))) + (sep (assoc name (it-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-it-label-title-sep) + (list)) + +(define (it-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-it-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-it-label-title-sep))) + (sep (assoc name (it-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (it-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (it-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (it-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (it-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-it$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (it-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-it-start-quote% (dingbat "ldquo")) + +(define %gentext-it-end-quote% (dingbat "rdquo")) + +(define %gentext-it-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-it-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-it-by% "") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-it-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-it-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-it-page% "") + +(define %gentext-it-and% "∧") + +(define %gentext-it-listcomma% "&listcomma;") + +(define %gentext-it-lastlistcomma% "&lastlistcomma;") + +(define %gentext-it-bibl-pages% "&Pgs;") + +(define %gentext-it-endnotes% "&Notes;") + +(define %gentext-it-table-endnotes% "&TableNotes;:") + +(define %gentext-it-index-see% "&See;") + +(define %gentext-it-index-seealso% "&SeeAlso;") + + +(define (gentext-it-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-it-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-it-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-it-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-it-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-it-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + + diff --git a/common/dbl1it.ent b/common/dbl1it.ent new file mode 100644 index 0000000..49937d7 --- /dev/null +++ b/common/dbl1it.ent @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1ja.dsl b/common/dbl1ja.dsl new file mode 100644 index 0000000..6d4acd0 --- /dev/null +++ b/common/dbl1ja.dsl @@ -0,0 +1,445 @@ + +%ja.words; +]> + + + + + +;; $Id: dbl1ja.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; Contributors: +;; Karl Critz, kcritz@mathworks.com, contributed the original dbl1ja.ent file +;; ISHIDA Eri, eri@laser5.co.jp +;; Ryan Shaw, ryan@silveregg.co.jp + +(define (ja-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (ja-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix;%n" + "%t&appendix;")) + (list (normalize "article") (string-append %gentext-ja-start-quote% + "%t" + %gentext-ja-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter1;%n&Chapter2;" + "%t&chapter;")) + (list (normalize "equation") "&Equation;%n") + (list (normalize "example") "&Example;%n") + (list (normalize "figure") "&Figure;%n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part;%n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure;%n, %t") + (list (normalize "reference") "&Reference;%n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section;%n" + "%t§ion;")) + (list (normalize "sect1") (if %section-autolabel% + "&Section;%n" + "%t§ion;")) + (list (normalize "sect2") (if %section-autolabel% + "&Section;%n" + "%t§ion;")) + (list (normalize "sect3") (if %section-autolabel% + "&Section;%n" + "%t§ion;")) + (list (normalize "sect4") (if %section-autolabel% + "&Section;%n" + "%t§ion;")) + (list (normalize "sect5") (if %section-autolabel% + "&Section;%n" + "%t§ion;")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section;%n" + "%t§ion;")) + (list (normalize "sidebar") "%t&sidebar;") + (list (normalize "step") "&step;%n") + (list (normalize "table") "&Table;%n"))) + +(define (gentext-ja-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (ja-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (ja-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal "∈")) + ((equal? (gi before) (normalize "chapter")) + (literal "∈")) + ((equal? (gi before) (normalize "sect1")) + (literal "∈")) + (else + (literal "∈")))) + +;; Should the TOC come first or last? +;; +(define %generate-ja-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (ja-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") "&Chapter1;") + (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") "&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") "&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 (gentext-ja-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (ja-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-ja-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-ja-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-ja-intra-label-sep) + (list)) + +(define (ja-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-ja-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-ja-intra-label-sep))) + (sep (assoc name (ja-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-ja-label-title-sep) + (list)) + +(define (ja-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "chapter") "&Chapter2;") + (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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-ja-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-ja-label-title-sep))) + (sep (assoc name (ja-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (ja-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (ja-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (ja-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (ja-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-ja$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (ja-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-ja-start-quote% (dingbat "ldquo")) + +(define %gentext-ja-end-quote% (dingbat "rdquo")) + +(define %gentext-ja-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-ja-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-ja-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-ja-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-ja-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-ja-page% "") + +(define %gentext-ja-and% "∧") + +(define %gentext-ja-listcomma% "&listcomma;") + +(define %gentext-ja-lastlistcomma% "&lastlistcomma;") + +(define %gentext-ja-bibl-pages% "&Pgs;") + +(define %gentext-ja-endnotes% "&Notes;") + +(define %gentext-ja-table-endnotes% "&TableNotes;:") + +(define %gentext-ja-index-see% "&See;") + +(define %gentext-ja-index-seealso% "&SeeAlso;") + + +(define (gentext-ja-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-ja-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-ja-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-ja-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-ja-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-ja-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + + diff --git a/common/dbl1ja.ent b/common/dbl1ja.ent new file mode 100644 index 0000000..c59b92d --- /dev/null +++ b/common/dbl1ja.ent @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1ko.dsl b/common/dbl1ko.dsl new file mode 100644 index 0000000..cf80905 --- /dev/null +++ b/common/dbl1ko.dsl @@ -0,0 +1,455 @@ + +%ko.words; +]> + + + + + +;; +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; Contributor: +;; Park Yong Joo (yongjoo@kldp.org) 2001/01/06 +;; + +(define (ko-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, Surname, FirstName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. SurNameFirstName [OtherName], Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + + + ;; Format is "SurNameFirstName" for Korean naming rules. + (if has_s (string-append + (if has_h " " "") + (data-of (node-list-first s_nl))) "") + (if has_f (string-append + (if (or has_h) " " "") + (data-of (node-list-first f_nl))) "") + ;; If you need "SurName FirstName" format, + ;; comment out upper 6 lines and use this. + ;; (if has_s (string-append + ;; (if has_h " " "") + ;; (data-of (node-list-first s_nl))) "") + ;; (if has_f (string-append + ;; (if (or has_h has_s) " " "") + ;; (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_s has_f ) " " "") + (data-of (node-list-first o_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (ko-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "\U-C81C;\U-BAA9;\U-C774; %t\U-C778; &appendix;")) + (list (normalize "article") (string-append %gentext-ko-start-quote% + "%t" + %gentext-ko-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "%n\U-C7A5;" + "`%t' &chapter;")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "%n &Part;") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "%n\U-C808;" + "`%t' §ion;")) + (list (normalize "sect1") (if %section-autolabel% + "%n\U-C808;" + "`%t' §ion;")) + (list (normalize "sect2") (if %section-autolabel% + "%n\U-C808;" + "`%t' §ion;")) + (list (normalize "sect3") (if %section-autolabel% + "%n\U-C808;" + "`%t' §ion;")) + (list (normalize "sect4") (if %section-autolabel% + "%n\U-C808;" + "`%t' §ion;")) + (list (normalize "sect5") (if %section-autolabel% + "%n\U-C808;" + "`%t' §ion;")) + (list (normalize "simplesect") (if %section-autolabel% + "%n\U-C808;" + "`%t' §ion;")) + (list (normalize "sidebar") "&sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-ko-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (ko-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (ko-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal "\U-C758; ")) + ((equal? (gi before) (normalize "chapter")) + (literal "\U-C758; ")) + ((equal? (gi before) (normalize "sect1")) + (literal "\U-C758; ")) + (else + (literal "\U-C758; ")))) + +;; Should the TOC come first or last? +;; +(define %generate-ko-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (ko-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") "&Chapter;") + (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") "&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") "&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 (gentext-ko-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (ko-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-ko-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-ko-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-ko-intra-label-sep) + (list)) + +(define (ko-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-ko-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-ko-intra-label-sep))) + (sep (assoc name (ko-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-ko-label-title-sep) + (list)) + +(define (ko-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-ko-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-ko-label-title-sep))) + (sep (assoc name (ko-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (ko-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (ko-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (ko-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (ko-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-ko$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (ko-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-ko-start-quote% (dingbat "ldquo")) + +(define %gentext-ko-end-quote% (dingbat "rdquo")) + +(define %gentext-ko-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-ko-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-ko-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-ko-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-ko-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-ko-page% "") + +(define %gentext-ko-and% "∧") + +(define %gentext-ko-listcomma% "&listcomma;") + +(define %gentext-ko-lastlistcomma% "&lastlistcomma;") + +(define %gentext-ko-bibl-pages% "&Pgs;") + +(define %gentext-ko-endnotes% "&Notes;") + +(define %gentext-ko-table-endnotes% "&TableNotes;:") + +(define %gentext-ko-index-see% "&See;") + +(define %gentext-ko-index-seealso% "&SeeAlso;") + + +(define (gentext-ko-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-ko-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-ko-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-ko-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-ko-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-ko-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1ko.ent b/common/dbl1ko.ent new file mode 100644 index 0000000..d23e973 --- /dev/null +++ b/common/dbl1ko.ent @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1nl.dsl b/common/dbl1nl.dsl new file mode 100644 index 0000000..a8590d1 --- /dev/null +++ b/common/dbl1nl.dsl @@ -0,0 +1,440 @@ + +%nl.words; +]> + + + + + +;; $Id: dbl1nl.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- +;; +;; This is the Dutch localization +;; +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; Contributors: +;; Hugo van der Kooij, hvdkooij@caiw.nl +;; Frederik Fouvry, fouvry@essex.ac.uk + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (nl-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (nl-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "&appendix; %t")) + (list (normalize "article") (string-append %gentext-nl-start-quote% + "%t" + %gentext-nl-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "&chapter; %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "§ion; %t")) + (list (normalize "sidebar") "&sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-nl-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (nl-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (nl-auto-xref-indirect-connector before) + (literal " ∈ ")) + +;; Should the TOC come first or last? +;; +(define %generate-nl-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (nl-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") "&Chapter;") + (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") "&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") "&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 (gentext-nl-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (nl-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-nl-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-nl-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-nl-intra-label-sep) + (list)) + +(define (nl-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-nl-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-nl-intra-label-sep))) + (sep (assoc name (nl-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-nl-label-title-sep) + (list)) + +(define (nl-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-nl-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-nl-label-title-sep))) + (sep (assoc name (nl-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (nl-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (nl-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (nl-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (nl-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-nl$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (nl-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-nl-start-quote% (dingbat "ldquo")) + +(define %gentext-nl-end-quote% (dingbat "rdquo")) + +(define %gentext-nl-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-nl-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-nl-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-nl-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-nl-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-nl-page% "") + +(define %gentext-nl-and% "∧") + +(define %gentext-nl-listcomma% "&listcomma;") + +(define %gentext-nl-lastlistcomma% "&lastlistcomma;") + +(define %gentext-nl-bibl-pages% "&Pgs;") + +(define %gentext-nl-endnotes% "&Notes;") + +(define %gentext-nl-table-endnotes% "&TableNotes;:") + +(define %gentext-nl-index-see% "&See;") + +(define %gentext-nl-index-seealso% "&SeeAlso;") + + +(define (gentext-nl-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-nl-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-nl-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-nl-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-nl-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-nl-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + + diff --git a/common/dbl1nl.ent b/common/dbl1nl.ent new file mode 100644 index 0000000..d6d5e03 --- /dev/null +++ b/common/dbl1nl.ent @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1nn.dsl b/common/dbl1nn.dsl new file mode 100644 index 0000000..e026f98 --- /dev/null +++ b/common/dbl1nn.dsl @@ -0,0 +1,445 @@ + +%nn.words; +]> + + + + + +;; $Id: dbl1nn.dsl,v 1.1 2001/11/14 20:57:53 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (nn-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (nn-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "the &appendix; called %t")) + (list (normalize "article") (string-append %gentext-nn-start-quote% + "%t" + %gentext-nn-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "the &chapter; called %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sidebar") "the &sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-nn-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (nn-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (nn-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-nn-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (nn-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") "&Chapter;") + (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") "&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") "&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 (gentext-nn-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (nn-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-nn-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-nn-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-nn-intra-label-sep) + (list)) + +(define (nn-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-nn-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-nn-intra-label-sep))) + (sep (assoc name (nn-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-nn-label-title-sep) + (list)) + +(define (nn-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-nn-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-nn-label-title-sep))) + (sep (assoc name (nn-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (nn-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (nn-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (nn-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (nn-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-nn$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (nn-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-nn-start-quote% (dingbat "ldquo")) + +(define %gentext-nn-end-quote% (dingbat "rdquo")) + +(define %gentext-nn-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-nn-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-nn-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-nn-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-nn-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-nn-page% "") + +(define %gentext-nn-and% "∧") + +(define %gentext-nn-listcomma% "&listcomma;") + +(define %gentext-nn-lastlistcomma% "&lastlistcomma;") + +(define %gentext-nn-bibl-pages% "&Pgs;") + +(define %gentext-nn-endnotes% "&Notes;") + +(define %gentext-nn-table-endnotes% "&TableNotes;:") + +(define %gentext-nn-index-see% "&See;") + +(define %gentext-nn-index-seealso% "&SeeAlso;") + + +(define (gentext-nn-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-nn-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-nn-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-nn-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-nn-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-nn-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + + diff --git a/common/dbl1nn.ent b/common/dbl1nn.ent new file mode 100644 index 0000000..f1f449a --- /dev/null +++ b/common/dbl1nn.ent @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1no.dsl b/common/dbl1no.dsl new file mode 100644 index 0000000..4077e74 --- /dev/null +++ b/common/dbl1no.dsl @@ -0,0 +1,437 @@ + +%lat1; + +%no.words; +]> + + + + + +;; $Id: dbl1no.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; Norsk Bokm\U-00E5;l localization. (a-ring) +;; Translated by Stig S. Bakken, ssb@guardian.no +;; Send changes to Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (no-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (no-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "tillegget kalt %t")) + (list (normalize "article") (string-append %gentext-no-start-quote% + "%t" + %gentext-no-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "kapittelet kalt %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "seksjonen kalt %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "seksjonen kalt %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "seksjonen kalt %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "seksjonen kalt %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "seksjonen kalt %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "seksjonen kalt %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "seksjonen kalt %t")) + (list (normalize "sidebar") "&sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-no-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (no-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (no-auto-xref-indirect-connector before) + (literal " ∈ ")) + +;; Should the TOC come first or last? +;; +(define %generate-no-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (no-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") "&Chapter;") + (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") "&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") "&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 (gentext-no-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (no-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-no-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-no-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-no-intra-label-sep) + (list)) + +(define (no-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-no-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-no-intra-label-sep))) + (sep (assoc name (no-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-no-label-title-sep) + (list)) + +(define (no-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-no-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-no-label-title-sep))) + (sep (assoc name (no-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (no-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (no-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (no-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (no-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-no$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (no-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-no-start-quote% (dingbat "ldquo")) + +(define %gentext-no-end-quote% (dingbat "rdquo")) + +(define %gentext-no-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-no-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-no-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-no-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-no-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-no-page% "") + +(define %gentext-no-and% "∧") + +(define %gentext-no-listcomma% "&listcomma;") + +(define %gentext-no-lastlistcomma% "&lastlistcomma;") + +(define %gentext-no-bibl-pages% "&Pgs;") + +(define %gentext-no-endnotes% "&Notes;") + +(define %gentext-no-table-endnotes% "&TableNotes;:") + +(define %gentext-no-index-see% "&See;") + +(define %gentext-no-index-seealso% "&SeeAlso;") + + +(define (gentext-no-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-no-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-no-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-no-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-no-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-no-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + + diff --git a/common/dbl1no.ent b/common/dbl1no.ent new file mode 100644 index 0000000..9ef8ad2 --- /dev/null +++ b/common/dbl1no.ent @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1null.dsl b/common/dbl1null.dsl new file mode 100644 index 0000000..d95bbb4 --- /dev/null +++ b/common/dbl1null.dsl @@ -0,0 +1,12 @@ + + + + + + +;; No definitions... + + + + diff --git a/common/dbl1pl.dsl b/common/dbl1pl.dsl new file mode 100644 index 0000000..fe73170 --- /dev/null +++ b/common/dbl1pl.dsl @@ -0,0 +1,434 @@ + +%pl.words; +]> + + + + + +;; $Id: dbl1pl.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; Polish localization. + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; Contributors: +;; Rafa\263 Kleger-Rudomin, ip011@osi.gda.pl + +(define (pl-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (pl-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "dodatek %t")) + (list (normalize "article") (string-append %gentext-pl-start-quote% + "%t" + %gentext-pl-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "rozdzia³ %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "sekcja %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "sekcja %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "sekcja %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "sekcja %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "sekcja %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "sekcja %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "sekcja %t")) + (list (normalize "sidebar") "&sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-pl-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (pl-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (pl-auto-xref-indirect-connector before) + (literal " ∈ ")) + +;; Should the TOC come first or last? +;; +(define %generate-pl-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (pl-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") "&Chapter;") + (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") "&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") "&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 (gentext-pl-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (pl-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-pl-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-pl-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-pl-intra-label-sep) + (list)) + +(define (pl-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-pl-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-pl-intra-label-sep))) + (sep (assoc name (pl-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-pl-label-title-sep) + (list)) + +(define (pl-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-pl-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-pl-label-title-sep))) + (sep (assoc name (pl-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (pl-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (pl-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (pl-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (pl-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-pl$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (pl-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-pl-start-quote% (dingbat "ldquor")) + +(define %gentext-pl-end-quote% (dingbat "rdquor")) + +(define %gentext-pl-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-pl-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-pl-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-pl-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-pl-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-pl-page% "") + +(define %gentext-pl-and% "∧") + +(define %gentext-pl-listcomma% "&listcomma;") + +(define %gentext-pl-lastlistcomma% "&lastlistcomma;") + +(define %gentext-pl-bibl-pages% "&Pgs;") + +(define %gentext-pl-endnotes% "&Notes;") + +(define %gentext-pl-table-endnotes% "&TableNotes;:") + +(define %gentext-pl-index-see% "&See;") + +(define %gentext-pl-index-seealso% "&SeeAlso;") + + +(define (gentext-pl-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-pl-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-pl-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-pl-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-pl-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-pl-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + + diff --git a/common/dbl1pl.ent b/common/dbl1pl.ent new file mode 100644 index 0000000..35e015f --- /dev/null +++ b/common/dbl1pl.ent @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1pt.dsl b/common/dbl1pt.dsl new file mode 100644 index 0000000..34da271 --- /dev/null +++ b/common/dbl1pt.dsl @@ -0,0 +1,433 @@ + +%pt.words; +]> + + + + + +;; $Id: dbl1pt.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (pt-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (pt-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "o &appendix; %t")) + (list (normalize "article") (string-append %gentext-pt-start-quote% + "%t" + %gentext-pt-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "o &chapter; %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "o §ion; %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "o §ion; %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "o §ion; %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "o §ion; %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "o §ion; %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "o §ion; %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "o §ion; %t")) + (list (normalize "sidebar") "&sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-pt-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (pt-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (pt-auto-xref-indirect-connector before) + (literal " ∈ ")) + +;; Should the TOC come first or last? +;; +(define %generate-pt-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (pt-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") "&Chapter;") + (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") "&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") "&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 (gentext-pt-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (pt-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-pt-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-pt-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-pt-intra-label-sep) + (list)) + +(define (pt-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-pt-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-pt-intra-label-sep))) + (sep (assoc name (pt-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-pt-label-title-sep) + (list)) + +(define (pt-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-pt-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-pt-label-title-sep))) + (sep (assoc name (pt-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (pt-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (pt-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (pt-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (pt-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-pt$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (pt-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-pt-start-quote% (dingbat "ldquo")) + +(define %gentext-pt-end-quote% (dingbat "rdquo")) + +(define %gentext-pt-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-pt-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-pt-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-pt-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-pt-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-pt-page% "") + +(define %gentext-pt-and% "∧") + +(define %gentext-pt-listcomma% "&listcomma;") + +(define %gentext-pt-lastlistcomma% "&lastlistcomma;") + +(define %gentext-pt-bibl-pages% "&Pgs;") + +(define %gentext-pt-endnotes% "&Notes;") + +(define %gentext-pt-table-endnotes% "&TableNotes;:") + +(define %gentext-pt-index-see% "&See;") + +(define %gentext-pt-index-seealso% "&SeeAlso;") + + +(define (gentext-pt-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-pt-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-pt-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-pt-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-pt-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-pt-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1pt.ent b/common/dbl1pt.ent new file mode 100644 index 0000000..a73f9b6 --- /dev/null +++ b/common/dbl1pt.ent @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1ptbr.dsl b/common/dbl1ptbr.dsl new file mode 100644 index 0000000..c711af4 --- /dev/null +++ b/common/dbl1ptbr.dsl @@ -0,0 +1,434 @@ + +%ptbr.words; +]> + + + + + +;; $Id: dbl1ptbr.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (ptbr-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (ptbr-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "o &appendix; %t")) + (list (normalize "article") (string-append %gentext-ptbr-start-quote% + "%t" + %gentext-ptbr-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "o &chapter; %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "a §ion; %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "a §ion; %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "a §ion; %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "a §ion; %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "a §ion; %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "a §ion; %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "a §ion; %t")) + (list (normalize "sidebar") "&sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-ptbr-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (ptbr-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (ptbr-auto-xref-indirect-connector before) + (literal " ∈ ")) + +;; Should the TOC come first or last? +;; +(define %generate-ptbr-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (ptbr-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") "&Chapter;") + (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 "notes") "&Notes;") + (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") "&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") "&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 (gentext-ptbr-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (ptbr-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-ptbr-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-ptbr-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-ptbr-intra-label-sep) + (list)) + +(define (ptbr-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-ptbr-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-ptbr-intra-label-sep))) + (sep (assoc name (ptbr-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-ptbr-label-title-sep) + (list)) + +(define (ptbr-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-ptbr-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-ptbr-label-title-sep))) + (sep (assoc name (ptbr-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (ptbr-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (ptbr-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (ptbr-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (ptbr-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-ptbr$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (ptbr-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-ptbr-start-quote% (dingbat "ldquo")) + +(define %gentext-ptbr-end-quote% (dingbat "rdquo")) + +(define %gentext-ptbr-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-ptbr-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-ptbr-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-ptbr-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-ptbr-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-ptbr-page% "") + +(define %gentext-ptbr-and% "∧") + +(define %gentext-ptbr-listcomma% "&listcomma;") + +(define %gentext-ptbr-lastlistcomma% "&lastlistcomma;") + +(define %gentext-ptbr-bibl-pages% "&Pgs;") + +(define %gentext-ptbr-endnotes% "&Notes;") + +(define %gentext-ptbr-table-endnotes% "&TableNotes;:") + +(define %gentext-ptbr-index-see% "&See;") + +(define %gentext-ptbr-index-seealso% "&SeeAlso;") + + +(define (gentext-ptbr-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-ptbr-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-ptbr-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-ptbr-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-ptbr-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-ptbr-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1ptbr.ent b/common/dbl1ptbr.ent new file mode 100644 index 0000000..5c5200f --- /dev/null +++ b/common/dbl1ptbr.ent @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1ro.dsl b/common/dbl1ro.dsl new file mode 100644 index 0000000..81886ba --- /dev/null +++ b/common/dbl1ro.dsl @@ -0,0 +1,434 @@ + +%lat1; + +%lat2; + +%ro.words; +]> + + + + + +;; $Id: dbl1ro.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; Provided by Dan N. Pomohaci +;; Updated by Claudiu Costin + +(define (ro-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (ro-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "the &appendix; called %t")) + (list (normalize "article") (string-append %gentext-ro-start-quote% + "%t" + %gentext-ro-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "the &chapter; called %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "§ion; numit\U-0103; %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "§ion; numit\U-0103; %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "§ion; numit\U-0103; %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "§ion; numit\U-0103; %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "§ion; numit\U-0103; %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "§ion; numit\U-0103; %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "§ion; numit\U-0103; %t")) + (list (normalize "sidebar") "the &sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-ro-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (ro-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (ro-auto-xref-indirect-connector before) + (literal " ∈ ")) + +;; Should the TOC come first or last? +;; +(define %generate-ro-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (ro-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") "&Chapter;") + (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") "&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") "&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 (gentext-ro-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (ro-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-ro-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-ro-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-ro-intra-label-sep) + (list)) + +(define (ro-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-ro-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-ro-intra-label-sep))) + (sep (assoc name (ro-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-ro-label-title-sep) + (list)) + +(define (ro-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-ro-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-ro-label-title-sep))) + (sep (assoc name (ro-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (ro-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (ro-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (ro-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (ro-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-ro$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (ro-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-ro-start-quote% (dingbat "ldquo")) + +(define %gentext-ro-end-quote% (dingbat "rdquo")) + +(define %gentext-ro-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-ro-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-ro-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-ro-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-ro-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-ro-page% "") + +(define %gentext-ro-and% "∧") + +(define %gentext-ro-listcomma% "&listcomma;") + +(define %gentext-ro-lastlistcomma% "&lastlistcomma;") + +(define %gentext-ro-bibl-pages% "&Pgs;") + +(define %gentext-ro-endnotes% "&Notes;") + +(define %gentext-ro-table-endnotes% "&TableNotes;:") + +(define %gentext-ro-index-see% "&See;") + +(define %gentext-ro-index-seealso% "&SeeAlso;") + + +(define (gentext-ro-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-ro-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-ro-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-ro-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-ro-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-ro-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + diff --git a/common/dbl1ro.ent b/common/dbl1ro.ent new file mode 100644 index 0000000..8ddd35b --- /dev/null +++ b/common/dbl1ro.ent @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1ru.dsl b/common/dbl1ru.dsl new file mode 100644 index 0000000..96746c8 --- /dev/null +++ b/common/dbl1ru.dsl @@ -0,0 +1,446 @@ + +%cyr1; + +%ru.words; +]> + + + + + +;; $Id: dbl1ru.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; This is revised Russian Localization version by Norman Walsh, modified by +;; Ilia V. Kouznetsov, ilia@syntext.com + +;; Suggestion of I. Kouznetsov: According to my experience of writing +;; documentation, Russian Words for cross references had better be +;; abbreviated (just like it is usually done in Russian documents) +;; because the ends of not abbreviated cross references may vary from +;; place to place due to the cases of Russian language. Due to this reason +;; entities with ".abr" syffix are added. + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (ru-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (ru-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix.abr; %n" + "&Appendix.abr; %t")) + (list (normalize "article") (string-append %gentext-ru-start-quote% + "%t" + %gentext-ru-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter.abr; %n" + "&Chapter.abr; %t")) + (list (normalize "equation") "&Equation.abr; %n") + (list (normalize "example") "&Example.abr; %n") + (list (normalize "figure") "&Figure.abr; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part.abr; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure.abr; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section.abr; %n" + "&Section.abr; %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section.abr; %n" + "&Section.abr; %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section.abr; %n" + "&Section.abr; %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section.abr; %n" + "&Section.abr; %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section.abr; %n" + "&Section.abr; %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section.abr; %n" + "&Section.abr; %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section.abr; %n" + "&Section.abr; %t")) + (list (normalize "sidebar") "&sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table.abr; %n"))) + +(define (gentext-ru-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (ru-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (ru-auto-xref-indirect-connector before) + (literal " ∈ ")) + +;; Should the TOC come first or last? +;; +(define %generate-ru-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (ru-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") "&Chapter;") + (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") "&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") "&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 (gentext-ru-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (ru-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-ru-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-ru-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-ru-intra-label-sep) + (list)) + +(define (ru-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-ru-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-ru-intra-label-sep))) + (sep (assoc name (ru-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-ru-label-title-sep) + (list)) + +(define (ru-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-ru-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-ru-label-title-sep))) + (sep (assoc name (ru-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (ru-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (ru-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (ru-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (ru-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-ru$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (ru-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-ru-start-quote% (dingbat "ldquo")) + +(define %gentext-ru-end-quote% (dingbat "rdquo")) + +(define %gentext-ru-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-ru-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-ru-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-ru-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-ru-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-ru-page% "") + +(define %gentext-ru-and% "∧") + +(define %gentext-ru-listcomma% "&listcomma;") + +(define %gentext-ru-lastlistcomma% "&lastlistcomma;") + +(define %gentext-ru-bibl-pages% "&Pgs;") + +(define %gentext-ru-endnotes% "&Notes;") + +(define %gentext-ru-table-endnotes% "&TableNotes;:") + +(define %gentext-ru-index-see% "&See;") + +(define %gentext-ru-index-seealso% "&SeeAlso;") + + +(define (gentext-ru-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-ru-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-ru-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-ru-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-ru-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-ru-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + + diff --git a/common/dbl1ru.ent b/common/dbl1ru.ent new file mode 100644 index 0000000..055846b --- /dev/null +++ b/common/dbl1ru.ent @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1sk.dsl b/common/dbl1sk.dsl new file mode 100644 index 0000000..60fb9b3 --- /dev/null +++ b/common/dbl1sk.dsl @@ -0,0 +1,442 @@ + +%sk.words; +]> + + + + + +;; $Id: dbl1sk.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; Contributors: +;; Ralf Schleitzer, ralf.schleitzer@ixos.de + +(define (sk-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (sk-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "&appendix; nazvan\U-00E1; %t")) + (list (normalize "article") (string-append %gentext-sk-start-quote% + "%t" + %gentext-sk-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "&chapter; nazvan\U-00E1; %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "§ion; nazvan\U-00E1; %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "§ion; nazvan\U-00E1; %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "§ion; nazvan\U-00E1; %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "§ion; nazvan\U-00E1; %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "§ion; nazvan\U-00E1; %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "§ion; nazvan\U-00E1; %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "§ion; nazvan\U-00E1; %t")) + (list (normalize "sidebar") "&sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-sk-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (sk-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (sk-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-sk-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (sk-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") "&Chapter;") + (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") "&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") "&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 (gentext-sk-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (sk-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-sk-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-sk-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-sk-intra-label-sep) + (list)) + +(define (sk-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-sk-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-sk-intra-label-sep))) + (sep (assoc name (sk-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-sk-label-title-sep) + (list)) + +(define (sk-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-sk-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-sk-label-title-sep))) + (sep (assoc name (sk-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (sk-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (sk-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (sk-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (sk-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-sk$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (sk-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-sk-start-quote% "\U-201E;") + +(define %gentext-sk-end-quote% "\U-201C;") + +(define %gentext-sk-start-nested-quote% "\U-201A;") + +(define %gentext-sk-end-nested-quote% "\U-2018;") + +(define %gentext-sk-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-sk-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-sk-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-sk-page% "") + +(define %gentext-sk-and% "∧") + +(define %gentext-sk-listcomma% "&listcomma;") + +(define %gentext-sk-lastlistcomma% "&lastlistcomma;") + +(define %gentext-sk-bibl-pages% "&Pgs;") + +(define %gentext-sk-endnotes% "&Notes;") + +(define %gentext-sk-table-endnotes% "&TableNotes;:") + +(define %gentext-sk-index-see% "&See;") + +(define %gentext-sk-index-seealso% "&SeeAlso;") + + +(define (gentext-sk-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-sk-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-sk-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-sk-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-sk-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-sk-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1sk.ent b/common/dbl1sk.ent new file mode 100644 index 0000000..1d1fd30 --- /dev/null +++ b/common/dbl1sk.ent @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1sl.dsl b/common/dbl1sl.dsl new file mode 100644 index 0000000..aee1071 --- /dev/null +++ b/common/dbl1sl.dsl @@ -0,0 +1,446 @@ + +%lat2; + +%sl.words; +]> + + + + + +;; $Id: dbl1sl.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (sl-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (sl-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "the &appendix; called %t")) + (list (normalize "article") (string-append %gentext-sl-start-quote% + "%t" + %gentext-sl-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "the &chapter; called %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sidebar") "the &sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-sl-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (sl-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (sl-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-sl-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (sl-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") "&Chapter;") + (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") "&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") "&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 (gentext-sl-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (sl-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-sl-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-sl-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-sl-intra-label-sep) + (list)) + +(define (sl-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-sl-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-sl-intra-label-sep))) + (sep (assoc name (sl-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-sl-label-title-sep) + (list)) + +(define (sl-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-sl-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-sl-label-title-sep))) + (sep (assoc name (sl-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (sl-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (sl-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (sl-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (sl-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-sl$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (sl-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-sl-start-quote% (dingbat "ldquo")) + +(define %gentext-sl-end-quote% (dingbat "rdquo")) + +(define %gentext-sl-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-sl-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-sl-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-sl-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-sl-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-sl-page% "") + +(define %gentext-sl-and% "∧") + +(define %gentext-sl-listcomma% "&listcomma;") + +(define %gentext-sl-lastlistcomma% "&lastlistcomma;") + +(define %gentext-sl-bibl-pages% "&Pgs;") + +(define %gentext-sl-endnotes% "&Notes;") + +(define %gentext-sl-table-endnotes% "&TableNotes;:") + +(define %gentext-sl-index-see% "&See;") + +(define %gentext-sl-index-seealso% "&SeeAlso;") + + +(define (gentext-sl-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-sl-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-sl-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-sl-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-sl-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-sl-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1sl.ent b/common/dbl1sl.ent new file mode 100644 index 0000000..18d61f8 --- /dev/null +++ b/common/dbl1sl.ent @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1sr.dsl b/common/dbl1sr.dsl new file mode 100644 index 0000000..8879bf7 --- /dev/null +++ b/common/dbl1sr.dsl @@ -0,0 +1,446 @@ + +%lat2; + +%sr.words; +]> + + + + + +;; $Id: dbl1sr.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (sr-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (sr-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "the &appendix; called %t")) + (list (normalize "article") (string-append %gentext-sr-start-quote% + "%t" + %gentext-sr-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "the &chapter; called %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sidebar") "the &sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-sr-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (sr-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (sr-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-sr-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (sr-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") "&Chapter;") + (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") "&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") "&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 (gentext-sr-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (sr-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-sr-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-sr-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-sr-intra-label-sep) + (list)) + +(define (sr-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-sr-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-sr-intra-label-sep))) + (sep (assoc name (sr-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-sr-label-title-sep) + (list)) + +(define (sr-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-sr-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-sr-label-title-sep))) + (sep (assoc name (sr-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (sr-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (sr-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (sr-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (sr-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-sr$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (sr-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-sr-start-quote% (dingbat "ldquo")) + +(define %gentext-sr-end-quote% (dingbat "rdquo")) + +(define %gentext-sr-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-sr-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-sr-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-sr-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-sr-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-sr-page% "") + +(define %gentext-sr-and% "∧") + +(define %gentext-sr-listcomma% "&listcomma;") + +(define %gentext-sr-lastlistcomma% "&lastlistcomma;") + +(define %gentext-sr-bibl-pages% "&Pgs;") + +(define %gentext-sr-endnotes% "&Notes;") + +(define %gentext-sr-table-endnotes% "&TableNotes;:") + +(define %gentext-sr-index-see% "&See;") + +(define %gentext-sr-index-seealso% "&SeeAlso;") + + +(define (gentext-sr-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-sr-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-sr-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-sr-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-sr-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-sr-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1sr.ent b/common/dbl1sr.ent new file mode 100644 index 0000000..0a24815 --- /dev/null +++ b/common/dbl1sr.ent @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1sv.dsl b/common/dbl1sv.dsl new file mode 100644 index 0000000..cb5df12 --- /dev/null +++ b/common/dbl1sv.dsl @@ -0,0 +1,448 @@ + +%sv.words; +]> + + + + + +;; $Id: dbl1sv.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; +;; Contributors: +;; Marcus Better, marcus@dactylis.se +;; + +(define (sv-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (sv-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "&Appendix; som &called; %t")) + (list (normalize "article") (string-append %gentext-sv-start-quote% + "%t" + %gentext-sv-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "&Chapter; som &called; %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "&Section; som &called; %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "&Section; som &called; %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "&Section; som &called; %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "&Section; som &called; %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "&Section; som &called; %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "&Section; som &called; %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "&Section; som &called; %t")) + (list (normalize "sidebar") "&sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-sv-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (sv-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (sv-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " in ")) + ((equal? (gi before) (normalize "chapter")) + (literal " in ")) + ((equal? (gi before) (normalize "sect1")) + (literal " in ")) + (else + (literal " in ")))) + +;; Should the TOC come first or last? +;; +(define %generate-sv-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (sv-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") "&Chapter;") + (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") "&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") "&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 (gentext-sv-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (sv-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-sv-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-sv-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-sv-intra-label-sep) + (list)) + +(define (sv-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-sv-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-sv-intra-label-sep))) + (sep (assoc name (sv-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-sv-label-title-sep) + (list)) + +(define (sv-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-sv-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-sv-label-title-sep))) + (sep (assoc name (sv-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (sv-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (sv-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (sv-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (sv-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-sv$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (sv-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-sv-start-quote% (dingbat "ldquo")) + +(define %gentext-sv-end-quote% (dingbat "rdquo")) + +(define %gentext-sv-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-sv-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-sv-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-sv-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-sv-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-sv-page% "") + +(define %gentext-sv-and% "∧") + +(define %gentext-sv-listcomma% "&listcomma;") + +(define %gentext-sv-lastlistcomma% "&lastlistcomma;") + +(define %gentext-sv-bibl-pages% "&Pgs;") + +(define %gentext-sv-endnotes% "&Notes;") + +(define %gentext-sv-table-endnotes% "&TableNotes;:") + +(define %gentext-sv-index-see% "&See;") + +(define %gentext-sv-index-seealso% "&SeeAlso;") + + +(define (gentext-sv-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-sv-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-sv-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-sv-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-sv-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-sv-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + + diff --git a/common/dbl1sv.ent b/common/dbl1sv.ent new file mode 100644 index 0000000..16232b6 --- /dev/null +++ b/common/dbl1sv.ent @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1th.ent b/common/dbl1th.ent new file mode 100644 index 0000000..54d5ad2 --- /dev/null +++ b/common/dbl1th.ent @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1tr.dsl b/common/dbl1tr.dsl new file mode 100644 index 0000000..8351218 --- /dev/null +++ b/common/dbl1tr.dsl @@ -0,0 +1,443 @@ + +%tr.words; +]> + + + + + +;; $Id: dbl1tr.dsl,v 1.2 2002/06/06 13:19:30 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; Modified for Turkish by Baurjan Ismagulov, ibr@gantek.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (tr-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (tr-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "the &appendix; called %t")) + (list (normalize "article") (string-append %gentext-tr-start-quote% + "%t" + %gentext-tr-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "the &chapter; called %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sidebar") "the &sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-tr-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (tr-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (tr-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-tr-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (tr-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") "&Chapter;") + (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") "&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") "&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 (gentext-tr-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (tr-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-tr-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-tr-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the separator to be inserted +;; between multiple occurrences of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-tr-intra-label-sep) + (list)) + +(define (tr-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-tr-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-tr-intra-label-sep))) + (sep (assoc name (tr-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the separator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-tr-label-title-sep) + (list)) + +(define (tr-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-tr-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (sep (assoc name (tr-label-title-sep)))) + (if sep + (car (cdr sep)) + ""))) + +(define (tr-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (tr-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (tr-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (tr-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-tr$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (tr-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-tr-start-quote% (dingbat "ldquo")) + +(define %gentext-tr-end-quote% (dingbat "rdquo")) + +(define %gentext-tr-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-tr-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-tr-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-tr-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-tr-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-tr-page% "") + +(define %gentext-tr-and% "∧") + +(define %gentext-tr-listcomma% "&listcomma;") + +(define %gentext-tr-lastlistcomma% "&lastlistcomma;") + +(define %gentext-tr-bibl-pages% "&Pgs;") + +(define %gentext-tr-endnotes% "&Notes;") + +(define %gentext-tr-table-endnotes% "&TableNotes;:") + +(define %gentext-tr-index-see% "&See;") + +(define %gentext-tr-index-seealso% "&SeeAlso;") + + +(define (gentext-tr-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-tr-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-tr-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-tr-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-tr-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-tr-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1tr.ent b/common/dbl1tr.ent new file mode 100644 index 0000000..a8c79f8 --- /dev/null +++ b/common/dbl1tr.ent @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1uk.dsl b/common/dbl1uk.dsl new file mode 100644 index 0000000..2c92f2c --- /dev/null +++ b/common/dbl1uk.dsl @@ -0,0 +1,444 @@ + +%uk.words; +]> + + + + + +;; $Id: dbl1uk.dsl,v 1.1 2001/11/14 20:57:53 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (uk-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (uk-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "the &appendix; called %t")) + (list (normalize "article") (string-append %gentext-uk-start-quote% + "%t" + %gentext-uk-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "the &chapter; called %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sidebar") "the &sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-uk-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (uk-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (uk-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-uk-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (uk-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") "&Chapter;") + (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") "&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") "&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 (gentext-uk-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (uk-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-uk-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-uk-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-uk-intra-label-sep) + (list)) + +(define (uk-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-uk-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-uk-intra-label-sep))) + (sep (assoc name (uk-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-uk-label-title-sep) + (list)) + +(define (uk-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-uk-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-uk-label-title-sep))) + (sep (assoc name (uk-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (uk-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (uk-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (uk-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (uk-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-uk$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (uk-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-uk-start-quote% (dingbat "ldquo")) + +(define %gentext-uk-end-quote% (dingbat "rdquo")) + +(define %gentext-uk-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-uk-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-uk-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-uk-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-uk-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-uk-page% "") + +(define %gentext-uk-and% "∧") + +(define %gentext-uk-listcomma% "&listcomma;") + +(define %gentext-uk-lastlistcomma% "&lastlistcomma;") + +(define %gentext-uk-bibl-pages% "&Pgs;") + +(define %gentext-uk-endnotes% "&Notes;") + +(define %gentext-uk-table-endnotes% "&TableNotes;:") + +(define %gentext-uk-index-see% "&See;") + +(define %gentext-uk-index-seealso% "&SeeAlso;") + + +(define (gentext-uk-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-uk-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-uk-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-uk-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-uk-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-uk-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1uk.ent b/common/dbl1uk.ent new file mode 100644 index 0000000..330357e --- /dev/null +++ b/common/dbl1uk.ent @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1xh.dsl b/common/dbl1xh.dsl new file mode 100644 index 0000000..7a77b66 --- /dev/null +++ b/common/dbl1xh.dsl @@ -0,0 +1,444 @@ + +%xh.words; +]> + + + + + +;; $Id: dbl1xh.dsl,v 1.1 2001/11/14 20:57:53 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; + +(define (xh-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (xh-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "the &appendix; called %t")) + (list (normalize "article") (string-append %gentext-xh-start-quote% + "%t" + %gentext-xh-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "&Chapter; %n" + "the &chapter; called %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "&Part; %n") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect1") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect2") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect3") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect4") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sect5") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "simplesect") (if %section-autolabel% + "&Section; %n" + "the §ion; called %t")) + (list (normalize "sidebar") "the &sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-xh-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (xh-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (xh-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-xh-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (xh-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") "&Chapter;") + (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") "&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") "&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 (gentext-xh-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (xh-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-xh-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-xh-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-xh-intra-label-sep) + (list)) + +(define (xh-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-xh-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-xh-intra-label-sep))) + (sep (assoc name (xh-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-xh-label-title-sep) + (list)) + +(define (xh-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-xh-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-xh-label-title-sep))) + (sep (assoc name (xh-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (xh-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (xh-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (xh-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (xh-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-xh$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (xh-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-xh-start-quote% (dingbat "ldquo")) + +(define %gentext-xh-end-quote% (dingbat "rdquo")) + +(define %gentext-xh-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-xh-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-xh-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-xh-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-xh-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-xh-page% "") + +(define %gentext-xh-and% "∧") + +(define %gentext-xh-listcomma% "&listcomma;") + +(define %gentext-xh-lastlistcomma% "&lastlistcomma;") + +(define %gentext-xh-bibl-pages% "&Pgs;") + +(define %gentext-xh-endnotes% "&Notes;") + +(define %gentext-xh-table-endnotes% "&TableNotes;:") + +(define %gentext-xh-index-see% "&See;") + +(define %gentext-xh-index-seealso% "&SeeAlso;") + + +(define (gentext-xh-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-xh-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-xh-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-xh-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-xh-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-xh-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1xh.ent b/common/dbl1xh.ent new file mode 100644 index 0000000..e26c10c --- /dev/null +++ b/common/dbl1xh.ent @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1zhcn.dsl b/common/dbl1zhcn.dsl new file mode 100644 index 0000000..1c57574 --- /dev/null +++ b/common/dbl1zhcn.dsl @@ -0,0 +1,447 @@ + +%zhcn.words; +]> + + + + + +;; $Id: dbl1zhcn.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; +;; Contributors: +;; Frederik Fouvry +;; + +(define (zhcn-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (zhcn-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "the &appendix; called %t")) + (list (normalize "article") (string-append %gentext-zhcn-start-quote% + "%t" + %gentext-zhcn-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "µÚ %n &Chapter;" + "the &chapter; called %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "µÚ %n &Part;") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "µÚ %n §ion;" + "the §ion; called %t")) + (list (normalize "sect1") (if %section-autolabel% + "µÚ %n §ion;" + "the §ion; called %t")) + (list (normalize "sect2") (if %section-autolabel% + "µÚ %n §ion;" + "the §ion; called %t")) + (list (normalize "sect3") (if %section-autolabel% + "µÚ %n §ion;" + "the §ion; called %t")) + (list (normalize "sect4") (if %section-autolabel% + "µÚ %n §ion;" + "the §ion; called %t")) + (list (normalize "sect5") (if %section-autolabel% + "µÚ %n §ion;" + "the §ion; called %t")) + (list (normalize "simplesect") (if %section-autolabel% + "µÚ %n §ion;" + "the §ion; called %t")) + (list (normalize "sidebar") "&sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-zhcn-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (zhcn-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (zhcn-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-zhcn-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (zhcn-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") "&Chapter;") + (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") "&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") "&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 (gentext-zhcn-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (zhcn-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-zhcn-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-zhcn-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-zhcn-intra-label-sep) + (list)) + +(define (zhcn-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-zhcn-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-zhcn-intra-label-sep))) + (sep (assoc name (zhcn-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-zhcn-label-title-sep) + (list)) + +(define (zhcn-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-zhcn-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-zhcn-label-title-sep))) + (sep (assoc name (zhcn-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (zhcn-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (zhcn-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (zhcn-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (zhcn-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-zhcn$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (zhcn-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-zhcn-start-quote% (dingbat "ldquo")) + +(define %gentext-zhcn-end-quote% (dingbat "rdquo")) + +(define %gentext-zhcn-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-zhcn-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-zhcn-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-zhcn-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-zhcn-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-zhcn-page% "") + +(define %gentext-zhcn-and% "∧") + +(define %gentext-zhcn-listcomma% "&listcomma;") + +(define %gentext-zhcn-lastlistcomma% "&lastlistcomma;") + +(define %gentext-zhcn-bibl-pages% "&Pgs;") + +(define %gentext-zhcn-endnotes% "&Notes;") + +(define %gentext-zhcn-table-endnotes% "&TableNotes;:") + +(define %gentext-zhcn-index-see% "&See;") + +(define %gentext-zhcn-index-seealso% "&SeeAlso;") + + +(define (gentext-zhcn-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-zhcn-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-zhcn-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-zhcn-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-zhcn-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-zhcn-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1zhcn.ent b/common/dbl1zhcn.ent new file mode 100644 index 0000000..c2742db --- /dev/null +++ b/common/dbl1zhcn.ent @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbl1zhtw.dsl b/common/dbl1zhtw.dsl new file mode 100644 index 0000000..1b49250 --- /dev/null +++ b/common/dbl1zhtw.dsl @@ -0,0 +1,447 @@ + +%zhtw.words; +]> + + + + + +;; $Id: dbl1zhtw.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ----------------------------- Localization ----------------------------- + +;; If you create a new version of this file, please send it to +;; Norman Walsh, ndw@nwalsh.com + +;; The generated text for cross references to elements. See dblink.dsl +;; for a discussion of how substitution is performed on the %x +;; keywords. +;; +;; Contributors: +;; Frederik Fouvry +;; + +(define (zhtw-author-string #!optional (author (current-node))) + ;; Return a formatted string representation of the contents of: + ;; AUTHOR: + ;; Handles Honorific, FirstName, SurName, and Lineage. + ;; If %author-othername-in-middle% is #t, also OtherName + ;; Handles *only* the first of each. + ;; Format is "Honorific. FirstName [OtherName] SurName, Lineage" + ;; CORPAUTHOR: + ;; returns (data corpauthor) + (let* ((h_nl (select-elements (descendants author) (normalize "honorific"))) + (f_nl (select-elements (descendants author) (normalize "firstname"))) + (o_nl (select-elements (descendants author) (normalize "othername"))) + (s_nl (select-elements (descendants author) (normalize "surname"))) + (l_nl (select-elements (descendants author) (normalize "lineage"))) + (has_h (not (node-list-empty? h_nl))) + (has_f (not (node-list-empty? f_nl))) + (has_o (and %author-othername-in-middle% + (not (node-list-empty? o_nl)))) + (has_s (not (node-list-empty? s_nl))) + (has_l (not (node-list-empty? l_nl)))) + (if (or (equal? (gi author) (normalize "author")) + (equal? (gi author) (normalize "editor")) + (equal? (gi author) (normalize "othercredit"))) + (string-append + (if has_h (string-append (data-of (node-list-first h_nl)) + %honorific-punctuation%) "") + (if has_f (string-append + (if has_h " " "") + (data-of (node-list-first f_nl))) "") + (if has_o (string-append + (if (or has_h has_f) " " "") + (data-of (node-list-first o_nl))) "") + (if has_s (string-append + (if (or has_h has_f has_o) " " "") + (data-of (node-list-first s_nl))) "") + (if has_l (string-append ", " (data-of (node-list-first l_nl))) "")) + (data-of author)))) + +(define (zhtw-xref-strings) + (list (list (normalize "appendix") (if %chapter-autolabel% + "&Appendix; %n" + "the &appendix; called %t")) + (list (normalize "article") (string-append %gentext-zhtw-start-quote% + "%t" + %gentext-zhtw-end-quote%)) + (list (normalize "bibliography") "%t") + (list (normalize "book") "%t") + (list (normalize "chapter") (if %chapter-autolabel% + "µÚ %n &Chapter;" + "the &chapter; called %t")) + (list (normalize "equation") "&Equation; %n") + (list (normalize "example") "&Example; %n") + (list (normalize "figure") "&Figure; %n") + (list (normalize "glossary") "%t") + (list (normalize "index") "%t") + (list (normalize "listitem") "%n") + (list (normalize "part") "µÚ %n &Part;") + (list (normalize "preface") "%t") + (list (normalize "procedure") "&Procedure; %n, %t") + (list (normalize "reference") "&Reference; %n, %t") + (list (normalize "section") (if %section-autolabel% + "µÚ %n §ion;" + "the §ion; called %t")) + (list (normalize "sect1") (if %section-autolabel% + "µÚ %n §ion;" + "the §ion; called %t")) + (list (normalize "sect2") (if %section-autolabel% + "µÚ %n §ion;" + "the §ion; called %t")) + (list (normalize "sect3") (if %section-autolabel% + "µÚ %n §ion;" + "the §ion; called %t")) + (list (normalize "sect4") (if %section-autolabel% + "µÚ %n §ion;" + "the §ion; called %t")) + (list (normalize "sect5") (if %section-autolabel% + "µÚ %n §ion;" + "the §ion; called %t")) + (list (normalize "simplesect") (if %section-autolabel% + "µÚ %n §ion;" + "the §ion; called %t")) + (list (normalize "sidebar") "&sidebar; %t") + (list (normalize "step") "&step; %n") + (list (normalize "table") "&Table; %n"))) + +(define (gentext-zhtw-xref-strings gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (xref (assoc name (zhtw-xref-strings)))) + (if xref + (car (cdr xref)) + (let* ((msg (string-append "[&xrefto; " + (if giname giname "&nonexistantelement;") + " &unsupported;]")) + (err (node-list-error msg (current-node)))) + msg)))) + +(define (zhtw-auto-xref-indirect-connector before) + ;; In English, the (cond) is unnecessary since the word is always the + ;; same, but in other languages, that's not the case. I've set this + ;; one up with the (cond) so it stands as an example. + (cond + ((equal? (gi before) (normalize "book")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "chapter")) + (literal " ∈ ")) + ((equal? (gi before) (normalize "sect1")) + (literal " ∈ ")) + (else + (literal " ∈ ")))) + +;; Should the TOC come first or last? +;; +(define %generate-zhtw-toc-in-front% #t) + +;; gentext-element-name returns the generated text that should be +;; used to make reference to the selected element. +;; + +(define (zhtw-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") "&Chapter;") + (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") "&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") "&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 (gentext-zhtw-element-name gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (pname (assoc name (zhtw-element-name)))) + (if pname + (car (cdr pname)) + (let* ((msg (string-append + "gentext-zhtw-element-name: &unexpectedelementname;: " + name)) + (err (node-list-error msg (current-node)))) + msg)))) + +;; gentext-element-name-space returns gentext-element-name with a +;; trailing space, if gentext-element-name isn't "". +;; +(define (gentext-zhtw-element-name-space giname) + (string-with-space (gentext-element-name giname))) + +;; gentext-intra-label-sep returns the seperator to be inserted +;; between multiple occurances of a label (or parts of a label) +;; for the specified element. Most of these are for enumerated +;; labels like "Figure 2-4", but this function is used elsewhere +;; (e.g. REFNAME) with a little abuse. +;; + +(define (local-zhtw-intra-label-sep) + (list)) + +(define (zhtw-intra-label-sep) + (list + (list (normalize "equation") "-") + (list (normalize "informalequation") "-") + (list (normalize "example") "-") + (list (normalize "figure") "-") + (list (normalize "listitem") ".") + (list (normalize "procedure") ".") + (list (normalize "refentry") ".") + (list (normalize "reference") ".") + (list (normalize "refname") ", ") + (list (normalize "refsect1") ".") + (list (normalize "refsect2") ".") + (list (normalize "refsect3") ".") + (list (normalize "sect1") ".") + (list (normalize "sect2") ".") + (list (normalize "sect3") ".") + (list (normalize "sect4") ".") + (list (normalize "sect5") ".") + (list (normalize "section") ".") + (list (normalize "simplesect") ".") + (list (normalize "step") ".") + (list (normalize "table") "-") + (list (normalize "_pagenumber") "-") + )) + +(define (gentext-zhtw-intra-label-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-zhtw-intra-label-sep))) + (sep (assoc name (zhtw-intra-label-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +;; gentext-label-title-sep returns the seperator to be inserted +;; between a label and the text following the label for the +;; specified element. Most of these are for use between +;; enumerated labels and titles like "1. Chapter One Title", but +;; this function is used elsewhere (e.g. NOTE) with a little +;; abuse. +;; + +(define (local-zhtw-label-title-sep) + (list)) + +(define (zhtw-label-title-sep) + (list + (list (normalize "abstract") ": ") + (list (normalize "answer") " ") + (list (normalize "appendix") ". ") + (list (normalize "caution") "") + (list (normalize "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") ". ") + (list (normalize "sect2") ". ") + (list (normalize "sect3") ". ") + (list (normalize "sect4") ". ") + (list (normalize "sect5") ". ") + (list (normalize "section") ". ") + (list (normalize "simplesect") ". ") + (list (normalize "seeie") " ") + (list (normalize "seealsoie") " ") + (list (normalize "step") ". ") + (list (normalize "table") ". ") + (list (normalize "tip") ": ") + (list (normalize "warning") "") + )) + +(define (gentext-zhtw-label-title-sep gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (lsep (assoc name (local-zhtw-label-title-sep))) + (sep (assoc name (zhtw-label-title-sep)))) + (if lsep + (car (cdr lsep)) + (if sep + (car (cdr sep)) + "")))) + +(define (zhtw-label-number-format-list) + (list + (list (normalize "set") "1") + (list (normalize "book") "1") + (list (normalize "prefix") "1") + (list (normalize "part") "I") + (list (normalize "chapter") "1") + (list (normalize "appendix") "A") + (list (normalize "reference") "I") + (list (normalize "example") "1") + (list (normalize "figure") "1") + (list (normalize "table") "1") + (list (normalize "procedure") "1") + (list (normalize "step") "1") + (list (normalize "refsect1") "1") + (list (normalize "refsect2") "1") + (list (normalize "refsect3") "1") + (list (normalize "sect1") "1") + (list (normalize "sect2") "1") + (list (normalize "sect3") "1") + (list (normalize "sect4") "1") + (list (normalize "sect5") "1") + (list (normalize "section") "1") + )) + +(define (zhtw-label-number-format gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (format (assoc name (zhtw-label-number-format-list)))) + (if format + (car (cdr format)) + "1"))) + +(define (zhtw-lot-title) + (list + (list (normalize "table") "&ListofTables;") + (list (normalize "example") "&ListofExamples;") + (list (normalize "figure") "&ListofFigures;") + (list (normalize "equation") "&ListofEquations;") + )) + +(define ($lot-title-zhtw$ gind) + (let* ((giname (if (string? gind) gind (gi gind))) + (name (normalize giname)) + (title (assoc name (zhtw-lot-title)))) + (if title + (car (cdr title)) + (let* ((msg (string-append "&ListofUnknown;: " name)) + (err (node-list-error msg (current-node)))) + msg)))) + +(define %gentext-zhtw-start-quote% (dingbat "ldquo")) + +(define %gentext-zhtw-end-quote% (dingbat "rdquo")) + +(define %gentext-zhtw-start-nested-quote% (dingbat "lsquo")) + +(define %gentext-zhtw-end-nested-quote% (dingbat "rsquo")) + +(define %gentext-zhtw-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous + ;; Authored "by" Jane Doe + +(define %gentext-zhtw-edited-by% "&Editedby;") + ;; "Edited by" Jane Doe + +(define %gentext-zhtw-revised-by% "&Revisedby;") + ;; "Revised by" Jane Doe + +(define %gentext-zhtw-page% "") + +(define %gentext-zhtw-and% "∧") + +(define %gentext-zhtw-listcomma% "&listcomma;") + +(define %gentext-zhtw-lastlistcomma% "&lastlistcomma;") + +(define %gentext-zhtw-bibl-pages% "&Pgs;") + +(define %gentext-zhtw-endnotes% "&Notes;") + +(define %gentext-zhtw-table-endnotes% "&TableNotes;:") + +(define %gentext-zhtw-index-see% "&See;") + +(define %gentext-zhtw-index-seealso% "&SeeAlso;") + + +(define (gentext-zhtw-nav-prev prev) + (make sequence (literal "&nav-prev;"))) + +(define (gentext-zhtw-nav-prev-sibling prevsib) + (make sequence (literal "&nav-prev-sibling;"))) + +(define (gentext-zhtw-nav-next-sibling nextsib) + (make sequence (literal "&nav-next-sibling;"))) + +(define (gentext-zhtw-nav-next next) + (make sequence (literal "&nav-next;"))) + +(define (gentext-zhtw-nav-up up) + (make sequence (literal "&nav-up;"))) + +(define (gentext-zhtw-nav-home home) + (make sequence (literal "&nav-home;"))) + + + + + diff --git a/common/dbl1zhtw.ent b/common/dbl1zhtw.ent new file mode 100644 index 0000000..3bfaee1 --- /dev/null +++ b/common/dbl1zhtw.ent @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/dbtable.dsl b/common/dbtable.dsl new file mode 100644 index 0000000..ca9fcbc --- /dev/null +++ b/common/dbtable.dsl @@ -0,0 +1,244 @@ +;; $Id: dbtable.dsl,v 1.1 2001/04/02 21:40:27 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; +;; This file contains table functions common to both print and HTML +;; versions of the DocBook stylesheets. +;; + +;; If **ANY** change is made to this file, you _MUST_ alter the +;; following definition: + +(define %docbook-common-table-version% + "Modular DocBook Stylesheet Common Table Functions") + +;; == Table Support ===================================================== + +;; ---------------------------------------------------------------------- +;; Functions for finding/retrieving table attributes + +(define (tgroup-align tgroup) + (attribute-string (normalize "align") tgroup)) + +(define (tgroup-colsep tgroup) + (attribute-string (normalize "colsep") tgroup)) + +(define (tgroup-rowsep tgroup) + (attribute-string (normalize "rowsep") tgroup)) + +;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +(define (find-tgroup #!optional (nd (current-node))) + ;; for our purposes, an entrytbl functions as a tgroup. + ;; ENTRYTBL IS ONLY SUPPORTED IN THE HTML BACKEND!!! + (if (or (equal? (gi nd) (normalize "tgroup")) + (equal? (gi nd) (normalize "entrytbl"))) + nd + (if (node-list-empty? (ancestor (normalize "entrytbl") nd)) + (ancestor (normalize "tgroup") nd) + (ancestor (normalize "entrytbl") nd)))) + +(define (find-colspec colname) + (let* ((tgroup (find-tgroup)) + (colspecs (select-elements (descendants tgroup) + (normalize "colspec")))) + (let loop ((nl colspecs)) + (if (node-list-empty? nl) + ;; we've run out of places to look, stop looking... + (error (string-append "Could not find COLSPEC named " colname)) + (if (equal? colname + (attribute-string (normalize "colname") + (node-list-first nl))) + (node-list-first nl) + (loop (node-list-rest nl))))))) + +(define (find-colspec-by-number colnum) + (let* ((tgroup (find-tgroup)) + (colspecs (select-elements (children tgroup) (normalize "colspec")))) + (let loop ((nl colspecs)) + (if (node-list-empty? nl) + ;; we've run out of places to look, stop looking... + (empty-node-list) + (if (equal? (colspec-colnum (node-list-first nl)) colnum) + (node-list-first nl) + (loop (node-list-rest nl))))))) + +(define (colspec-align colspec) + (attribute-string (normalize "align") colspec)) + +(define (colspec-char colspec) + (attribute-string (normalize "char") colspec)) + +(define (colspec-charoff colspec) + (let ((charoff (attribute-string (normalize "charoff") colspec))) + (if charoff + (string->number charoff) + #f))) + +(define (colspec-colnum colspec) + ;; returns the column number of the associated colspec...which is + ;; either the value of COLNUM or obtained by counting + (let* ((tgroup (find-tgroup colspec)) + (colspecs (select-elements (children tgroup) (normalize "colspec")))) + (if (attribute-string (normalize "colnum") colspec) + (string->number (attribute-string (normalize "colnum") colspec)) + (let loop ((nl colspecs) (curcol 1)) + (let ((colnum (attribute-string (normalize "colnum") (node-list-first nl)))) + (if (node-list=? (node-list-first nl) colspec) + curcol + (if colnum + (loop (node-list-rest nl) (+ (string->number colnum) 1)) + (loop (node-list-rest nl) (+ curcol 1))))))))) + +(define (colspec-colname colspec) + (attribute-string (normalize "colname") colspec)) + +(define (colspec-colsep colspec) + (attribute-string (normalize "colsep") colspec)) + +(define (colspec-colwidth colspec) + (if (attribute-string (normalize "colwidth") colspec) + (attribute-string (normalize "colwidth") colspec) + "1*")) + +(define (colspec-rowsep colspec) + (attribute-string (normalize "rowsep") colspec)) + +;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +(define (find-spanspec spanname) + (let* ((tgroup (find-tgroup)) + (spanspecs (select-elements (descendants tgroup) + (normalize (normalize "spanspec"))))) + (let loop ((nl spanspecs)) + (if (node-list-empty? nl) + (error (string-append "Could not find SPANSPEC named " spanname)) + (if (equal? spanname + (attribute-string (normalize "spanname") + (node-list-first nl))) + (node-list-first nl) + (loop (node-list-rest nl))))))) + +(define (spanspec-align spanspec) + (attribute-string (normalize "align") spanspec)) + +(define (spanspec-char spanspec) + (attribute-string (normalize "char") spanspec)) + +(define (spanspec-charoff spanspec) + (let ((charoff (attribute-string (normalize "charoff") spanspec))) + (if charoff + (string->number charoff) + #f))) + +(define (spanspec-colsep spanspec) + (attribute-string (normalize "colsep") spanspec)) + +(define (spanspec-nameend spanspec) + (attribute-string (normalize "nameend") spanspec)) + +(define (spanspec-namest spanspec) + (attribute-string (normalize "namest") spanspec)) + +(define (spanspec-rowsep spanspec) + (attribute-string (normalize "rowsep") spanspec)) + +(define (spanspec-spanname spanspec) + (attribute-string (normalize "spanname") spanspec)) + +;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +;; Calculate spans + +(define (hspan entry) + ;; Returns the horizontal span of an entry + (let* ((spanname (attribute-string (normalize "spanname") entry)) + (namest (if spanname + (spanspec-namest (find-spanspec spanname)) + (attribute-string (normalize "namest") entry))) + (nameend (if spanname + (spanspec-nameend (find-spanspec spanname)) + (attribute-string (normalize "nameend") entry))) + (colst (if namest + (colspec-colnum (find-colspec namest)) + #f)) + (colend (if nameend + (colspec-colnum (find-colspec nameend)) + #f))) + (if (and namest nameend) + (+ (- colend colst) 1) + 1))) + +(define (vspan entry) + ;; Returns the vertical span of an entry. Note that this is one more + ;; than the specified MOREROWS attribute. + (let* ((morerows (attribute-string (normalize "morerows") entry))) + (if morerows + (+ (string->number morerows) 1) + 1))) + +;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +;; Update the "overhang" list + +(define (adjust-overhang overhang oldoverhang entry) + (let* ((colst (cell-column-number entry oldoverhang)) + (span (hspan entry))) + (if (> (vspan entry) 1) + (list-put overhang colst (- (vspan entry) 1) span) + overhang))) + +(define (overhang-skip overhang startcol) + (if (> startcol (length overhang)) + ;; this is a _broken_ table. should I output a debug message!? + startcol + (let loop ((overtail (list-tail overhang (- startcol 1))) (col startcol)) + (if (null? overtail) + col + (if (equal? (car overtail) 0) + col + (loop (cdr overtail) (+ col 1))))))) + +(define (update-overhang row oldoverhang) + (let loop ((overhang (decrement-list-members oldoverhang)) + (entries (node-list-filter-out-pis (children row)))) + (if (node-list-empty? entries) + overhang + (loop (adjust-overhang overhang oldoverhang + (node-list-first entries)) + (node-list-rest entries))))) + +;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +;; Calculate information about cells + +(define (cell-prev-cell entry) + ;; Return the cell which precedes entry in the current row. + (let loop ((nd (ipreced entry))) + (if (node-list-empty? nd) + nd + (if (equal? (node-property 'class-name nd) 'element) + nd + (loop (ipreced nd)))))) + +(define (cell-column-number entry overhang) + (let* ((entry (ancestor-member entry (list (normalize "entry") (normalize "entrytbl")))) + (row (ancestor (normalize "row") entry)) + (preventry (cell-prev-cell entry)) + (prevspan (if (node-list-empty? preventry) 1 (hspan preventry))) + (colname (attribute-string (normalize "colname") entry)) + (namest (attribute-string (normalize "namest") entry)) + (nameend (attribute-string (normalize "nameend") entry)) + (spanname (attribute-string (normalize "spanname") entry))) + (if colname + (colspec-colnum (find-colspec colname)) + (if spanname + (colspec-colnum (find-colspec + (spanspec-namest (find-spanspec spanname)))) + (if namest + (colspec-colnum (find-colspec namest)) + (if (node-list-empty? preventry) + (overhang-skip overhang 1) + (overhang-skip overhang + (+ (cell-column-number preventry overhang) + prevspan)))))))) + +;; ====================================================================== diff --git a/contrib/html/ChangeLog b/contrib/html/ChangeLog new file mode 100644 index 0000000..e33fa27 --- /dev/null +++ b/contrib/html/ChangeLog @@ -0,0 +1,4 @@ +2001-04-02 Norman Walsh + + * short-biblioentry.dsl: New file. + diff --git a/contrib/html/short-biblioentry.dsl b/contrib/html/short-biblioentry.dsl new file mode 100644 index 0000000..87d1b10 --- /dev/null +++ b/contrib/html/short-biblioentry.dsl @@ -0,0 +1,30 @@ + +]> + + + + + +(define (biblioentry-inline-elements) + (list (normalize "abbrev") + (normalize "title") + (normalize "subtitle") + (normalize "author") + (normalize "authorgroup") + (normalize "copyright") + (normalize "date") + (normalize "edition") + (normalize "pagenums") + (normalize "pubdate") + (normalize "publisher"))) + +(define (biblioentry-block-elements) + '()) + + + + + + + diff --git a/contrib/imagemap/ChangeLog b/contrib/imagemap/ChangeLog new file mode 100644 index 0000000..f659572 --- /dev/null +++ b/contrib/imagemap/ChangeLog @@ -0,0 +1,4 @@ +2001-04-02 Norman Walsh + + * imagemap.dsl, testdoc.sgm, testimg.jpg: New file. + diff --git a/contrib/imagemap/imagemap.dsl b/contrib/imagemap/imagemap.dsl new file mode 100644 index 0000000..d5bb4d8 --- /dev/null +++ b/contrib/imagemap/imagemap.dsl @@ -0,0 +1,77 @@ + +]> + + + + + +(element (graphicco areaspec) + (make element gi: "MAP" + attributes: (list (list "NAME" (element-id))) + (let loop ((nl (select-elements (descendants (current-node)) + (normalize "area")))) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (make-html-area (node-list-first nl)) + (loop (node-list-rest nl))))))) + +(define ($graphic$ fileref + #!optional (format #f) (alt #f) (align #f)) + (let* ((csim? (equal? (gi (parent (current-node))) + (normalize "graphicco"))) + (ismap (if csim? + '(("ISMAP" "ISMAP")) + '())) + (usemap (if csim? + (let* ((graphicco (parent (current-node))) + (areaspec (select-elements + (children graphicco) + (normalize "areaspec")))) + (list (list "USEMAP" + (string-append "#" + (attribute-string + (normalize "id") + areaspec))))) + '())) + (border (if csim? '(("BORDER" "0")) '())) + (img-attr (append + (list (list "SRC" (graphic-file fileref))) + (if align (list (list "ALIGN" align)) '()) + (if image-library (graphic-attrs fileref alt) '()) + ismap + usemap + border))) + (make empty-element gi: "IMG" + attributes: img-attr))) + +(define (make-html-area area) + (let* ((shape (attribute-string (normalize "otherunits") area)) + (coords (attribute-string (normalize "coords") area)) + (idrefs (attribute-string (normalize "linkends") area)) + (idlist (if idrefs + (split idrefs) + '())) + (target (if idrefs + (element-with-id (car idlist)) + (empty-node-list))) + (href (attribute-string (normalize "label") area))) + (if (node-list-empty? target) + (process-children) + (if idrefs + (make empty-element gi: "AREA" + attributes: (list (list "SHAPE" shape) + (list "COORDS" coords) + (list "HREF" (href-to target)))) + (make empty-element gi: "AREA" + attributes: (list (list "SHAPE" shape) + (list "COORDS" coords) + (list "HREF" href))))))) + + + + + + + diff --git a/contrib/imagemap/testdoc.sgm b/contrib/imagemap/testdoc.sgm new file mode 100644 index 0000000..27a833b --- /dev/null +++ b/contrib/imagemap/testdoc.sgm @@ -0,0 +1,29 @@ + + + +Test Chapter + +First para + + + + + + + + + + +Second para + +test1 +test1 + +test2 +test2 + +test3 +test3 + + + diff --git a/contrib/imagemap/testimg.jpg b/contrib/imagemap/testimg.jpg new file mode 100644 index 0000000000000000000000000000000000000000..16b0e92909eff9b700c6051e1253642963cd606f GIT binary patch literal 6690 zcmb7JXH*lwvJPFUbft#SLsN=?6d`~@0tkjCU7GaXyL3TmA%KWn2VLjp;{yVL zY}W*Z1^I<}`GNfZa6)#um4=#z>Be{4FJI$DokVxWuwc5A6TL@jnCnL(B5t;r^v10vIUB zE{RdF05kxH14tD4Kk+{F`=Fydt6kcOf!>N`uy#I85(rQgO%U9ReYR%=)a|ux zQzEP=POs_0xco)1rHWlg!m+Rn=t_250Ib=v^4W z3rH>^hSStT7)jZDPdwKdXm0jKjR$lX5sG!fX3dRjs;>KkcyNjcFV*h9x&U6YPSQ z?f%)cZ_`vM-1B>Hu(=$1-F$Fu3G+1Z&tGY&$X69=Z6&_885MSQ+y!Mj^(tvTZ^BcLWtT#u9L zsZP^m(YK+HM9~xxPmc!@a5!t0DeMX0^HIS~Oor-xl z%|@??x34);R0UrEJ{3&klq<2@vD&Ft@Jit8EgHhvuM~IuP>Zb~adSvQr{5Qp%zeKB z_vQ&Q{qLM$!*kc;oYjuwW~EbMv)HbzACJB|?e1&m_JmA%6oTLSSGFspa9K?7(wwvi zeb|M7#X5VbHAiGa_mXLS39pQ%yaPNF>({2L^44|hlZw?vU^Mj?fH2?W`EOqMMM6Ge z!7B{c!iR7iX|(wP=#NafnS4kE?qNq}u_}fGsE^+ofe%9mSfe(>@qN8p2-_xGyByX) zuf{5RPk$I}uz3u?bTGR-rtWk0;@gpJ-(+qdHQvZml(2L9w$B%By%?aCmn5eLCTivP z)rOE!(NVall=fj4S!|@0xj#JPG|XHL;k4D42jbc>{_H6BN|nh}*d$hE_E6xI@AFC~ zU_pA@>1X?za#3zgGG%zkjHsUfonOTlfEED(Br-z{i54OO#EX6nFGoe3#YcGW1ux%B z5glYb;lI^B$M48Fj|DQ_h_W_5!!M2?j5@z)M|`{hV50ml0Ql*SgW}Q*&rYSoCf^;5 ze$Mj4FLMWQBKc3fyZ120^&ptljZ|JDmvb_LITmTS`30#-w*8A|9hEM(4 z@Hr%6(o@n+N|-}Hy!1EBNEiW+n4SpB6@%U3XjuI1D%FVkdFmweSY-T19reoy-b7k) zhB-U$y@|eQVpf|1P9XmFTO6M>6qMQKSv;H}z1geWnJ=g|7WcG}s-1M1kRu&{T>= zJ^Pf@-=XDJvNNI!HF!y$Jqs~8vw6V)g?QAUA7MeE-*fl0BGQ96m-U)%(E6dKJK66d zXg?O_#1WT`?lpi;R(81qO8le~Z{iTQFv8G#_0U=K&ap2fnl_@qsz2Ijd3HE&m0DqT z$gX@e+QVj-cE95Gwv5(t#hHsiBT!SzxDw@{rzwhwE$;W>6d18AnDc3pWDSs!%MN_3 zU+1Fk^ZZ$4ralxbc{O=J_!@g&JS+XvefGRhYscn4hJWar>{dQ5FqN#bnOQ6D=^va| zqS8Hhr1!uD{RJazxvd&`Q}K-+=gCt0joW#?F0J-5(|7MSyt@zKw#w;^ zx^}3l@$#h>oltwFBECHr6amxkKhWkv`GkkqpQ<_%?uq1U$&c>Z3|* zefjOcc_@=)e15+UD^O#``{m4?U0Fij5A}n>=cg#KmnKy&Tzpl~Z{q$m5U1YfpcxTV z(F_4@o2w6R5-_88NVjt_R-#{{;@AWNghQq~V&h-9iOTEd!2BAQ!t>@q5?3DFjiuOQ zxBz^7h(QD_ezaeSWg#N=L`5ZDxC{pQ`#QOU4Z_|c%dLUh(&Aw4C$OgsFGn-g{ptv9 zm?&{$A)9jR6;+{yJH$%VUy&~6B-X?#)g&t_``1wO<0Q0eXQ-zces6oo$FFQ>k6KCE z{%N%IuEYDjNKCPg`;{LVutOu^jr6q54=!F800zewpJv|ZeRw6fFT+Bgj$$%c3l5L~ zo}k_R`mFWr4yD~q9)Tl`T?(WTX7Nj(xiaLIF&|TJiIl^_pcxB^6t#CsQ{Y$UAFXH4 zJx3=HLZ49)35EC6WnWw~UEWVxSZTUN@3EEaT^GthKeo@_MU>d5H4g8t_Bh~nsK^`x z!;B>{Q-O^{ml&BDzkG6C*31z30q-ay0#Q#z0~Y{Kz)S`-5?uv@-$lJ)9lN5vTWoS) zn56B>6B}h3i7);AznXZ!Irb3ndlSL4hZvY~@cfnqPk?jP;vG|+ z0T%;32DM6>mlnUY{=`(4G^%r3`B?B6tlY;L<&s;GU5Sw&aPN*+2&&Aw*JsubqfNoS zDk2SDdyQ57l&`!l{oz)i&5eeHL3ddH3e9Is-1+#~u>Wwg&5!PMCYN647vs0jx$^Dc zW25poKd8!m0ww83<4?$KN!dY^wV78gauFC`Nj=3inDEZ6G)lO#+G;)cUB)%Zr}c$; zCF0h|gLX%n+>QKTOq5bzUh`M{yA>3Tl}sq-rjJ#&UtVD(hQ=n1-`K^I0&5#f(uNnq3w-(z znpF_UYQ`098eRS~@WU{h_cgA(BZvrS{ry|ilNep$tRT+}B&$-(>eeyI*KYe7ePO!T zGtUAMU-qj-(K6QMn{EB6tKK{VRI{V=A%+=;co zm!b<8dC>t{nDzwF8>N5#7N0EqbY%0B|Y_*N&U6mS6$ zkjz8U!T%l1TKISKv-Wr#WkS>>&ioU{Z-N1kt4*PRMl+fh!&znkXA7{u_I@&S$@j3?{6weOI0Ltt0CJIUP_k^#ybIbYmkk z3~C-T#;*$Q7i)Iv1Yhf8A)Ik9YIp2y#k1ymWiK0nbZdD|4$U>E(BkxR`DC55P!*bp z!?`!D7M%TZZ>v+%A7YfkuNaBonN*6veEVS;?N|3oQ&5I3VZ}zN13of_kD4sM2CEh7 z5C+_8VwSVEs+Pm@`zIa`CIQI_MLCR6gS>3AuBtQydsZ1H6-smZv=jwzTlgf;)a@r1MBNJa+R?f(PX=`=Rqugs_#8mZr$d5 zBE!WGip1$iEb-?udRN3Y5M~x)RZi=}4sN&LeFCOZ?H-r^n0ya0Vd1O;F=pkn$J027 zKq=2s**Vh83VCGmes*K5Hj?KqT_)a2XC+$1!^V#M4 z8YxyZ1%dsE=9i!_`|jKJ$EMxMu5orOnZu2s*Hd!zPhGm-N*GhF2Wc)|0NAhhNUUWo zDOuxl1EfNkYln*899VkSv9i(mmDQ`XUB1?6jV=JWAM+lCW5oChxD+MB>g9Gpc#&>v z_XpgwlU)1k%OA!13#gS| zEsdTFD&A5wF|Mkul)fP>7T*=2N)u7q?QY&ulHMBURr~C3A47)@?!;lSr-iB;-6KQnKia_vT~8%B;#-oERcPote=kWRT;>noo&8eqLlC$;a!qqP8K25})uo zNA-7Ab;i>%T{yDz5*CJN#-_lu`BKi$d#t4~S0s2a9>&pBByE9ybWBi4AN6Wr!(2_B z!@17j)y7Ffp;>RcWh)i263|fSAF__B_j7#D#D@c}(%EMRavGE_-xzNCy4rKFkjZ}s zneutE1Z{5#))3LBo1N|jvyB`%G+2Y|FQ3c?EpYf#x%Zrj>L8>r07(^J6xSVsE?Ib) zmit3P0J^8+D{wo^%g(XZv5#Cb=F@|x@K`49<-Yle&k7Lr?WmSg;+ckBRIt$JTj&

QfG+h{sr~Bd$CQfspcP$puPt6?XL$J7|h1ZPjuLVABjJRMlfPy$H z_CKx*x&k289zD8=kot=J$xdLyyCR;Ea5Ic?VcMLm6g*VnZGT9lytmqtR(u-{Y||dE zIm`XEK7^L$@B(0X1lv;TbD67iZXb4~+VIx8C!9kBibh!GW|RL0-3vX=eu*i84|Mz6eQ zl&{TB7q+@(yR4YMpo<>7HxJSD*GyOVNi@ySE@4)h?xoE+vKMaash^)uasFWC4ey@a zA2g-x%W$T^{^}$mE5OIhf2FQ&{T!15 z8GyCyIA;&8`U@`wg}X*1@8FKN2C`$D959#_Jehum)Xg@Igs&&+#lumvqs4n`6;_im zSVv2#7Gs#hNDGnmPu@ha8pH|~?in8`kb~*34y_s$T#z#|<9yzs)}iCAC7f)KO6Mcb zpeTeE_ZIr8#i~?#XJs1;1@V1TTP94l8P64!1ho+wZ7@~pM4rK5h+#BjdU{-4q<&9; zrRtDkhI>km%CXTt0sDjH)X=MbXcXh;qMELpwT(^T)%I@06;Y=F?&JRk|NihWC#Ed0 zfkQM%`C+T%Y1JA2{di3cUOl#Hg$7Wrh|r?ZA?Y?_!VU%s>^R8RJQKZVB=1h$4MgMh z+;jL=k;vcUn-b$kP##j`*qD2Gue(dju}3UV!^6{Op$$FF3Y+amQSLIj@k^ReXSIY< zW$`DOaf8d-w)_p)jpD^$_h66gUAqm-UR2{z`Dqk%(jXTo#mQY=Y@`asH-OwI=*UET z*vn7$D4n<&a-E*34@WE$RSRlnHQ8cTL`kL!VKspOuPyljt{xJh30d=Az`%4t1XQmq zq-gv#>q%TG^n~o7bRycjVfJ?pf_2g@#ITBO^z9W|8D%RTIBxHLO6+&|ovVd`eP?pv z8p6HTM5T}9%5>!g!4CUQ987m5phN&M6ZHOf&GF`H4T7{X%MWSP`T%W)I4~%F%7#^d z#l6bZvP?tA7e_~`a{zlG76~gBJUwyiZr2P`cS_Ro9SIN%89HzKM@Bl#nzJ-I8@I0N zBVJeQX}@-GhdaKLN9nLCO=x>k!iyFgs{QS#pq{ITUuPXlAGj#~~- z^KFraJUE|80L!Pm7J)zudmhyjM!4@Cw*iqQ`8w;n)!e<(p?s;EbJD39Z=otgbF3*w zLvI$!!$b2Z+pM)jxy@PGM>fsK;DK*%Hi((t8`-E$g3SzVY}co|(J{u3T3AnIe&iRy zS~?FWIF`7W_B*O#M4IG~wRrU|raY}oX}(=Cv{{0Jr`Vp+lU7-uj)4NvpCKI`jB+k$ zI}$n<33BnAvzR=qX!{II;~&M?aizL<$0oPNaitX7yfR<&@t)b#n26`~L?CcwU6pT; zn_#gG=$DkCcDs)68)4_Xspj;>{+ZAMl|X}=#4=5jGH*d8&ieRD5#3sJe3nrVoANM` z6H3B-%c~Ii?BrM3i5G#Y9+YFPSJ>LvhHhA`{|UAnt&&c(nA^|Lx(1DISPvIq?6f(j>jiSrdDc`@s$ zesQmj)?HIPnQfn!Y7B1QSQ>j9STSdD%e95A*XsFg!kqX@ZzF9Uf7TVo2Tvj5l-;C@_pS z3)9CTm5rhpn-h9;;(YEnaN~O9>~o$Njf{t@l1M_HwTDxxGjruhn(6~up-1F2u8|~2 z?BCF!HY>9P$LW5PN6QROHy2a6^3C&jgHRC9qlwQ-=zU$Glc~W;QKyxK1Ol_@D$5r9 zRYJ-_tYCqRP*VS=Lfx39me^mkJd~%T?T1B$!(2KB_n0I@aZZ-%m@j2yEnn*7I5>nN zV4QSjeZN%b#I!Zt0222!-ed~b72@;o60-&Vn_KhW?->Y}ODWpGO-tw9$G%Q5O%aL! zApn3>drrUxk@QPK*gEO!u776uL3ZS0?XBh%D}BlFAn}sPvCEn^g8K{X$V%tbXrf(= zp2f7#8%xTzO`2NwQO?>c%p!RyEPXtb7W>1WyO~gK(p=iKw(*78Rd9}m>%)SNRI;lr zdOEqF0Hj6-l?1||lpAH>adnTfn?T9c>oKY~xE!9{T?Qhtq`a1TcETf-Aob6u;*#37 zd~U_3E*1|5ux^XNhRU-;zP2tF9tWPqz+Hb zQmk>rM^&m+<8@ort9PwbHb|Pmdj`vQA_t4pJq?fhQ=PG!5O9jhwwwNhH7snG${oCl zq1}kT-y)juQ|;eeLr&+84c3^Ll8u8{mcjf}3eUVZ_(mpOafIu(qfM?DDhXs5*PdM; z_q%e<`~q;x)jz6c6tP&q8hn&&##a)f%%C_9(bTfmWkx2xS-;xh>WpwWbzLz?=-ZR= z{BQ*;WDCOZ&IYogYJYp2P2`IG;(HQ0J-Q7sM#a2|FW1t7sE!?S9Q~)Af&Z|9@SmAM HF6RCV7BP(I literal 0 HcmV?d00001 diff --git a/contrib/print/ChangeLog b/contrib/print/ChangeLog new file mode 100644 index 0000000..e33fa27 --- /dev/null +++ b/contrib/print/ChangeLog @@ -0,0 +1,4 @@ +2001-04-02 Norman Walsh + + * short-biblioentry.dsl: New file. + diff --git a/contrib/print/short-biblioentry.dsl b/contrib/print/short-biblioentry.dsl new file mode 100644 index 0000000..131b86b --- /dev/null +++ b/contrib/print/short-biblioentry.dsl @@ -0,0 +1,30 @@ + +]> + + + + + +(define (biblioentry-inline-elements) + (list (normalize "abbrev") + (normalize "title") + (normalize "subtitle") + (normalize "author") + (normalize "authorgroup") + (normalize "copyright") + (normalize "date") + (normalize "edition") + (normalize "pagenums") + (normalize "pubdate") + (normalize "publisher"))) + +(define (biblioentry-block-elements) + '()) + + + + + + + diff --git a/contrib/renumberinpart/ChangeLog b/contrib/renumberinpart/ChangeLog new file mode 100644 index 0000000..ab93b29 --- /dev/null +++ b/contrib/renumberinpart/ChangeLog @@ -0,0 +1,4 @@ +2001-04-02 Norman Walsh + + * renumberinpart.dsl, test.sgm: New file. + diff --git a/contrib/renumberinpart/renumberinpart.dsl b/contrib/renumberinpart/renumberinpart.dsl new file mode 100644 index 0000000..a6eb52e --- /dev/null +++ b/contrib/renumberinpart/renumberinpart.dsl @@ -0,0 +1,28 @@ + + + +]]> + + +]]> +]> + + + + + +(define (chapter-number-restart-list cmp) (list (normalize "book") + (normalize "part"))) +(define (appendix-number-restart-list cmp) (list (normalize "book") + (normalize "part") + (normalize "article"))) + + + + + + + diff --git a/contrib/renumberinpart/test.sgm b/contrib/renumberinpart/test.sgm new file mode 100644 index 0000000..41ad428 --- /dev/null +++ b/contrib/renumberinpart/test.sgm @@ -0,0 +1,19 @@ + +test book +test part I +first chapter in part I +para + +second chapter in part I +para + + +test part II +first chapter in part II +para + +second chapter in part II +para + + + diff --git a/contrib/subdoc/ChangeLog b/contrib/subdoc/ChangeLog new file mode 100644 index 0000000..12e9222 --- /dev/null +++ b/contrib/subdoc/ChangeLog @@ -0,0 +1,5 @@ +2001-04-02 Norman Walsh + + * book.sgm, subdoc.dsl, subdoc.dtd, subdoc1.sgm, subdoc2.sgm, subdocbc.mod: + New file. + diff --git a/contrib/subdoc/book.sgm b/contrib/subdoc/book.sgm new file mode 100644 index 0000000..654770a --- /dev/null +++ b/contrib/subdoc/book.sgm @@ -0,0 +1,13 @@ + + +]> +Book Title +Chapter Title + +This is a test. + + + + + diff --git a/contrib/subdoc/subdoc.dsl b/contrib/subdoc/subdoc.dsl new file mode 100644 index 0000000..e9e7268 --- /dev/null +++ b/contrib/subdoc/subdoc.dsl @@ -0,0 +1,35 @@ + +]> + + + + + + + +(element subdocsection + (let* ((subdoc (attribute-string (normalize "subdoc"))) + (targfile (entity-generated-system-id subdoc)) + (targdoc (sgml-parse targfile)) + (targroot (node-property 'document-element targdoc))) + (process-node-list targroot))) + + + + + + + + diff --git a/contrib/subdoc/subdoc.dtd b/contrib/subdoc/subdoc.dtd new file mode 100644 index 0000000..81a4521 --- /dev/null +++ b/contrib/subdoc/subdoc.dtd @@ -0,0 +1,22 @@ + + + + + + + +%docbook; + + + + + diff --git a/contrib/subdoc/subdoc1.sgm b/contrib/subdoc/subdoc1.sgm new file mode 100644 index 0000000..e625d11 --- /dev/null +++ b/contrib/subdoc/subdoc1.sgm @@ -0,0 +1,6 @@ + +

A SubDoc Section + +This was included as a subdoc. + +
diff --git a/contrib/subdoc/subdoc2.sgm b/contrib/subdoc/subdoc2.sgm new file mode 100644 index 0000000..64298e1 --- /dev/null +++ b/contrib/subdoc/subdoc2.sgm @@ -0,0 +1,6 @@ + +
Another SubDoc Section + +This was also included as a subdoc. + +
diff --git a/contrib/subdoc/subdocbc.mod b/contrib/subdoc/subdocbc.mod new file mode 100644 index 0000000..dd1d57e --- /dev/null +++ b/contrib/subdoc/subdocbc.mod @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + diff --git a/dtds/dbdsssl/ChangeLog b/dtds/dbdsssl/ChangeLog new file mode 100644 index 0000000..ddf4754 --- /dev/null +++ b/dtds/dbdsssl/ChangeLog @@ -0,0 +1,4 @@ +2001-04-02 Norman Walsh + + * dbdsssl.dtd: New file. + diff --git a/dtds/dbdsssl/dbdsssl.dtd b/dtds/dbdsssl/dbdsssl.dtd new file mode 100644 index 0000000..171d857 --- /dev/null +++ b/dtds/dbdsssl/dbdsssl.dtd @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + +%docbook; + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dtds/decls/ChangeLog b/dtds/decls/ChangeLog new file mode 100644 index 0000000..3134eba --- /dev/null +++ b/dtds/decls/ChangeLog @@ -0,0 +1,4 @@ +2001-04-02 Norman Walsh + + * docbook.dcl, xml.dcl: New file. + diff --git a/dtds/decls/docbook.dcl b/dtds/decls/docbook.dcl new file mode 100644 index 0000000..bb3a754 --- /dev/null +++ b/dtds/decls/docbook.dcl @@ -0,0 +1,106 @@ + diff --git a/dtds/decls/xml.dcl b/dtds/decls/xml.dcl new file mode 100644 index 0000000..fed2103 --- /dev/null +++ b/dtds/decls/xml.dcl @@ -0,0 +1,179 @@ +" + PIC "?>" + SHORTREF NONE + + NAMES + SGMLREF + + QUANTITY NONE + + ENTITIES + "amp" 38 + "lt" 60 + "gt" 62 + "quot" 34 + "apos" 39 + + FEATURES + MINIMIZE + DATATAG NO + OMITTAG NO + RANK NO + SHORTTAG + STARTTAG + EMPTY NO + UNCLOSED NO + NETENABL IMMEDNET + ENDTAG + EMPTY NO + UNCLOSED NO + ATTRIB + DEFAULT YES + OMITNAME NO + VALUE NO + EMPTYNRM YES + IMPLYDEF + ATTLIST NO + DOCTYPE NO + ELEMENT NO + ENTITY NO + NOTATION NO + LINK + SIMPLE NO + IMPLICIT NO + EXPLICIT NO + OTHER + CONCUR NO + SUBDOC NO + FORMAL NO + URN NO + KEEPRSRE YES + VALIDITY TYPE + ENTITIES + REF ANY + INTEGRAL YES + APPINFO NONE + SEEALSO "ISO 8879:1986//NOTATION + Extensible Markup Language (XML) 1.0//EN" +> diff --git a/dtds/html/ChangeLog b/dtds/html/ChangeLog new file mode 100644 index 0000000..fb1c4f0 --- /dev/null +++ b/dtds/html/ChangeLog @@ -0,0 +1,5 @@ +2001-04-02 Norman Walsh + + * ISOlat1.gml, catalog, dbhtml.dcl, dbhtml.dtd, test.htm: + New file. + diff --git a/dtds/html/ISOlat1.gml b/dtds/html/ISOlat1.gml new file mode 100644 index 0000000..88ad6f2 --- /dev/null +++ b/dtds/html/ISOlat1.gml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dtds/html/catalog b/dtds/html/catalog new file mode 100644 index 0000000..9edf124 --- /dev/null +++ b/dtds/html/catalog @@ -0,0 +1,3 @@ +PUBLIC "-//Norman Walsh//DTD DocBook HTML 1.0//EN" dbhtml.dtd +PUBLIC "ISO 8879-1986//ENTITIES Added Latin 1//EN//HTML" ISOlat1.gml +SGMLDECL dbhtml.dcl diff --git a/dtds/html/dbhtml.dcl b/dtds/html/dbhtml.dcl new file mode 100644 index 0000000..95eaf2a --- /dev/null +++ b/dtds/html/dbhtml.dcl @@ -0,0 +1,76 @@ + diff --git a/dtds/html/dbhtml.dtd b/dtds/html/dbhtml.dtd new file mode 100644 index 0000000..c9ccc61 --- /dev/null +++ b/dtds/html/dbhtml.dtd @@ -0,0 +1,604 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +%ISOlat1; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dtds/html/test.htm b/dtds/html/test.htm new file mode 100644 index 0000000..a350dbf --- /dev/null +++ b/dtds/html/test.htm @@ -0,0 +1,13 @@ + + + +Title + + +

Foo!

+

Para +

  1. Bar! +
+

+ + diff --git a/dtds/imagelib/ChangeLog b/dtds/imagelib/ChangeLog new file mode 100644 index 0000000..d84499a --- /dev/null +++ b/dtds/imagelib/ChangeLog @@ -0,0 +1,4 @@ +2001-04-02 Norman Walsh + + * imagelib.dtd: New file. + diff --git a/dtds/imagelib/imagelib.dtd b/dtds/imagelib/imagelib.dtd new file mode 100644 index 0000000..d2c9329 --- /dev/null +++ b/dtds/imagelib/imagelib.dtd @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dtds/olink/ChangeLog b/dtds/olink/ChangeLog new file mode 100644 index 0000000..437e797 --- /dev/null +++ b/dtds/olink/ChangeLog @@ -0,0 +1,4 @@ +2001-04-02 Norman Walsh + + * olinksum.dtd: New file. + diff --git a/dtds/olink/olinksum.dtd b/dtds/olink/olinksum.dtd new file mode 100644 index 0000000..46d83d9 --- /dev/null +++ b/dtds/olink/olinksum.dtd @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + diff --git a/frames/ChangeLog b/frames/ChangeLog new file mode 100644 index 0000000..bace2af --- /dev/null +++ b/frames/ChangeLog @@ -0,0 +1,5 @@ +2001-04-02 Norman Walsh + + * README, docbook.css, docbook.js, frames.dsl, frames.htm, navbar.htm: + New file. + diff --git a/frames/README b/frames/README new file mode 100644 index 0000000..81a0096 --- /dev/null +++ b/frames/README @@ -0,0 +1,76 @@ +README for the DocBook Stylesheets Frame Support + +Introduction +------------ + +Support for frames is a common request. Supporting frames with +a stylesheet that builds a frames-only version of a document has +never been very appealing to me, so I haven't bothered. (The +main problem is that this approach doesn't help solve the +difficult problem of the navigation frame.) + +Recent changes to the stylesheets have made another approach +practical. The files in this directory provide frames support +using a set of techniques that require almost no modification +to the HTML. The single required change is a link to a CSS +stylesheet. + +One benefit of this technique is that I can imaging framed and +non-framed versions of a document using exactly the same files +(with symbolic links, or something). The only difference +between the two versions would be the CSS stylesheet applied. + +The downside to this technique is that it requires a fairly modern +browser. In order for this to work, your browser must support: + + - Frames + - Dynamic HTML + - CSS + +At present, only IE 4.01SP1 (or later, presumably) is supported. +In particular, Netscape is not supported. + + ************************************************************* + * I tried for several days to make this implementation work * + * in Netscape. As near as I can tell, Netscape through * + * version 4.5 simply does not have enough power in its * + * object model to make this practical. If you can make it * + * work, I'd be delighted to include support for Netscape, * + * but I'm not going to spend anymore time on it in the near * + * future. * + ************************************************************* + +I'm really disappointed that I can't get this working under some +browser other than IE. + +Installation +------------ + +1. Create a directory to hold your framed document +2. Copy docbook.css, docbook.js, *.htm, and the ../images/toc-*.gif images + into that directory. +3. Process your document with the frames.dsl stylesheet (or an extension + thereof). +4. Fire up your browser and point it at frames.htm. If your document isn't + a "", you'll have to edit frames.htm to make the body frame load + correctly the first time. + +Warranty +-------- + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL NORMAN WALSH OR ANY OTHER +CONTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Contacting the Author +--------------------- + +These stylesheets are maintained by Norman Walsh, . + +The best way to reach norm is by email. You will find additional +contact information at http://nwalsh.com/~ndw/ diff --git a/frames/docbook.css b/frames/docbook.css new file mode 100644 index 0000000..0f90516 --- /dev/null +++ b/frames/docbook.css @@ -0,0 +1,12 @@ +.NAVHEADER { display: none } +.NAVFOOTER { display: none } +.TOC { display: none } + +.NAVTOC { margin-left: 15; + display: none } + +.NAVBTN { font-size: 10pt } + +.TOCTITLE { font-size: 10pt; + color: blue; + text-decoration: underline; } diff --git a/frames/docbook.js b/frames/docbook.js new file mode 100644 index 0000000..9e2f4ce --- /dev/null +++ b/frames/docbook.js @@ -0,0 +1,86 @@ +function toggleDiv(id) { + // Find element with ID "id" and toggle its display property. + // By convention, the ID of the corresponding +/- image is "${id}IMG". + var div = eval("document.all." + id); + var img = eval("document.all." + id + "IMG"); + var display = div.style.display; + + if (display != "block") { + div.style.display = "block"; + img.src = "toc-minus.gif"; + } else { + div.style.display = "none"; + img.src = "toc-plus.gif"; + } +} + +function link_href(rel) { + // Find the LINK element (in the body document) with the specified REL + // and return its HREF. Return "" if no such LINK can be found. + var body = parent.frames[1].document; + var links = body.all.tags("LINK"); + for (i=0; i +]> + + + + + +(define %stylesheet-version% + "Modular DocBook HTML Frames Stylesheet version 1.0") + +(define %stylesheet% "docbook.css"); + +(root + (make sequence + (process-children) + (with-mode manifest + (process-children)) + (make-dhtml-toc))) + +(define (make-dhtml-toc) + (make entity + system-id: "toc.htm" + (make element gi: "HTML" + (make element gi: "HEAD" + (make element gi: "TITLE" (literal "DocBook TOC")) + ($standard-html-header$) + (make element gi: "SCRIPT" + attributes: '(("SRC" "docbook.js")) + (empty-sosofo))) + (make element gi: "BODY" + (make element gi: "DIV" + (with-mode dhtmltoc + (process-children))))))) + +(define (dhtml-toc-entry nd gilist) + (let* ((subdivnodes (node-list-filter-by-gi (children nd) gilist)) + (subdivs (and (> (node-list-length subdivnodes) 0) + (not (node-list=? nd (sgml-root-element))))) + (imgsrc (if subdivs + "toc-plus.gif" + "toc-blank.gif")) + (imgatt (list (list "SRC" imgsrc) + (list "BORDER" "0") + (list "ID" (string-append (generate-anchor) "IMG")))) + (span (if subdivs + (make element gi: "SPAN" + attributes: (list + (list "CLASS" "TOGGLE") + (list "onClick" + (string-append + "toggleDiv('" + (generate-anchor) + "')"))) + (make empty-element gi: "IMG" + attributes: imgatt)) + (make element gi: "SPAN" + attributes: '(("CLASS" "TOGGLE")) + (make empty-element gi: "IMG" + attributes: imgatt))))) + (if (node-list=? nd (sgml-root-element)) + (make sequence + (make element gi: "NOBR" + (make element gi: "SPAN" + attributes: (list ;(list "HREF" (href-to (current-node))) + (list "onClick" (string-append + "load_body(\"" + (href-to (current-node)) + "\")")) + (list "CLASS" "TOCTITLE")) + (element-title-sosofo (current-node)))) + (make element gi: "DIV" + (process-children))) + (make sequence + (make element gi: "NOBR" + span + (make element gi: "SPAN" + attributes: (list ;(list "HREF" (href-to (current-node))) + (list "onClick" (string-append + "load_body(\"" + (href-to (current-node)) + "\")")) + (list "CLASS" "TOCTITLE")) + (element-title-sosofo (current-node)))) + (make element gi: "DIV" + attributes: (list (list "CLASS" "NAVTOC") + (list "ID" (generate-anchor))) + (process-children)))))) + +(mode dhtmltoc + (default (empty-sosofo)) + + (element set (dhtml-toc-entry (current-node) + (list (normalize "book")))) + + (element book (dhtml-toc-entry (current-node) + (list (normalize "part") + (normalize "preface") + (normalize "chapter") + (normalize "appendix") + (normalize "reference")))) + + (element preface (dhtml-toc-entry (current-node) + (list (normalize "sect1")))) + + (element part (dhtml-toc-entry (current-node) + (list (normalize "preface") + (normalize "chapter") + (normalize "appendix") + (normalize "reference")))) + + (element chapter (dhtml-toc-entry (current-node) + (list (normalize "sect1")))) + + (element appendix (dhtml-toc-entry (current-node) + (list (normalize "sect1")))) + + (element sect1 (dhtml-toc-entry (current-node) '())) + + (element reference (dhtml-toc-entry (current-node) + (list (normalize "refentry")))) + + (element refentry (dhtml-toc-entry (current-node) '())) +) + + + + + + + diff --git a/frames/frames.htm b/frames/frames.htm new file mode 100644 index 0000000..85a607a --- /dev/null +++ b/frames/frames.htm @@ -0,0 +1,19 @@ + + +Frames Example + + + + + + + + + +<body> +Your browser does not support frames. +</body> + + + \ No newline at end of file diff --git a/frames/navbar.htm b/frames/navbar.htm new file mode 100644 index 0000000..2fd6529 --- /dev/null +++ b/frames/navbar.htm @@ -0,0 +1,31 @@ + + +Navigation + + + + + + + diff --git a/html/ChangeLog b/html/ChangeLog new file mode 100644 index 0000000..187f25e --- /dev/null +++ b/html/ChangeLog @@ -0,0 +1,349 @@ +2004-10-10 + + * dbhtml.dsl, dbparam.dsl, dbttlpg.dsl: Support for specifying a system ID for the HTML output documents, required + for better parsing in contemporary browsers. A default system ID is set + if %html40% is true. + +2004-10-09 + + * docbook.dsl: New Bulgarian translation by Viktor Vasilev (SF patch #1040075) + +2004-09-23 + + * dbprocdr.dsl: Add CSS decoration of procedure steps (RFE #1033197) + +2004-09-17 + + * docbook.dsl: Bosnian translation by Kemal Skripic + +2004-09-14 + + * dbinline.dsl: Fix for bug #860398: Change uses of $var-seq$ to something more appropriate. + +2004-07-11 + + * version.dsl: Closes Bug 912831: the last character of VERSION was being cut off. + +2003-05-28 Adam Di Carlo + + * dbblock.dsl: HTML attribs for comments variablized for maintenance. + +2003-04-29 Adam Di Carlo + + * dbcompon.dsl: Finding the subtitle for a component should use the parent title if + set; this is consistent with how the title is already set; + closes SF bug 613773. + +2003-04-28 Adam Di Carlo + + * dbpi.dsl: Ensure dbhtml-findvalue can handle the pi-field-list being a non-pair, + which may occur in some poorly formed dbhtml PIs; returns #f in this + case. + +2003-04-27 Adam Di Carlo + + * dbcompon.dsl: Simplify some code, no functional changes + +2003-04-26 Adam Di Carlo + + * dbcallou.dsl, dbparam.dsl: callout graphics and admonition graphics, if needed, share a single + variable, %stock-graphics-extension% -- "stock" here referring to + standard, stock images, e.g., not per document images; this closes + Debian Bug#187429 + +2003-04-12 Adam Di Carlo + + * dbadmon.dsl: VALIGN should be MIDDLE, not CENTER; closes Debian Bug#187569 + +2003-04-05 Adam Di Carlo + + * dblists.dsl: back out my last change; there are 4 places taht use this and until I + understand how varlistentry-term-too-long? is supposed to work at all + I better not mess with it + + * dblists.dsl: termlength in varlist is measurement-to-length, not string->number + +2003-03-25 Adam Di Carlo + + * db31.dsl, dbblock.dsl, dbcompon.dsl, dbgraph.dsl, dbqanda.dsl, dbsect.dsl, docbook.dsl: + move data from db31 into its proper component files + +2003-03-21 Adam Di Carlo + + * Makefile: Don't hardcode DSSSL file list, use $(wildcard *.dsl); clean is cleaner + +2003-02-12 Adam Di Carlo + + * db31.dsl, dbhtml.dsl, dbinline.dsl, dbttlpg.dsl: Deprecate TT; use CODE, KBD, SAMP, or VAR instead. + + acronym make's use of HTML4's ACRONYM element if %html40% + + abbrev make's use of HTML4's ABBR element if %html40% + + * dbparam.dsl: Emit a HTML 4.0.1 doctype by default if %html40%, this seems like a + good idea. + + Update %spacing-paras% and %html40% docs a bit, without changing their + settings. + +2003-02-11 Adam Di Carlo + + * dbtable.dsl: If %html40%, create col elements representing colspecs (implied or + explicit), and don't emit widths on each and every cell. + + If %html40%, set the tbody valign properly. + + If %html40%, allow relative column sizes such as "1*", thus we're not + emitting 50% when we mean 1* (out of 1*, 1*); the effect is that we're + not forcing pgwide if it's not turned on. + + Don't set valign on entries, set them on rows (unless they really are + set on the entries). + + Some rewriting for speed/efficiency (doens't seem to make much + difference in my timing testing though) + +2003-02-09 Adam Di Carlo + + * dbtable.dsl: Improve table rendering using frame and border attributes on HTML + tables, conditional on HTML4 support being on. + + The following cases in table.006.xml are now fixed: outer edit (table + frame but no rowsep nor colseps); rows (frame is topbot, rowsep but no + colsep); columns; tic tac toc (no frame, colsep and rowsep). + + Note we still have no way (yet) to override colsep/rowsep in either + colspec or in the individual rows, but I'm working on colspec -> + colgroup. + +2003-02-07 Adam Di Carlo + + * dbblock.dsl: move the anchor closer to the content in informal-objects; no way to + get around empty A element in this case + + * dbsect.dsl, dbttlpg.dsl: "title" changes to "title" -- weblint says we should + avoid empty A elements + + * dbtable.dsl: fix a div-by-zero error identified in informaltable.015.xml; would + cause loss of a table header column in some cases + +2003-01-21 Adam Di Carlo + + * dbblock.dsl: formal and informal objects reset the processing mode, this closes + Debian#79432f; so is still in special mode, + but is not; test is legalnotice.001.xml + +2003-01-20 Adam Di Carlo + + * dbgraph.dsl: correct this error: html/dbgraph.dsl:68:1:E: 1st argument for + primitive "append" of wrong type: "#" not a + list, fix and report from Christopher B. Browne + +2003-01-15 Adam Di Carlo + + * dbadmon.dsl, dbautoc.dsl, dbbibl.dsl, dbblock.dsl, dbcallou.dsl, dbcompon.dsl, dbdivis.dsl, dbefsyn.dsl, dbfootn.dsl, dbgloss.dsl, dbgraph.dsl, dbhtml.dsl, dbindex.dsl, dbinfo.dsl, dbinline.dsl, dblink.dsl, dblists.dsl, dblot.dsl, dbmath.dsl, dbmsgset.dsl, dbprocdr.dsl, dbrfntry.dsl, dbsect.dsl, dbsynop.dsl, dbtable.dsl, dbtitle.dsl, dbttlpg.dsl, dbverb.dsl, docbook.dsl: + update docbook URL to http://docbook.sourceforge.net/projects/dsssl/; + N.B.: credit for the group option and repeating goes to John Daily + + * dblink.dsl: xref to varlistentry using the term, patch from Jens Emmerich; closes + bug 520561 + + * dbsynop.dsl: Patch #562401 , elipsis should be + outside of group, reference test cmdsynopsis.003 + +2003-01-14 Adam Di Carlo + + * dbblock.dsl: define a $remark$ function, unifying comment and remark element + rendering; remarks within paras are now rendering using a span rather + than p so they mark up as inline text decoration + +2002-12-16 Adam Di Carlo + + * dbblock.dsl, dbparam.dsl: %epigraph-start-col% and %epigraph-content-col% allows customization + of epigraph positioning; %blockquote-start-col% and + %blockquote-end-col% parameters allows customization of the whitespace + around blockquote + +2002-06-09 Norman Walsh + + * dbbibl.dsl, dbttlpg.dsl: Fix bug #502337: remove 'by' from copyright statements + +2002-05-21 Norman Walsh + + * dbttlpg.dsl: Make sure email addresses in info elements are links + +2002-05-12 Norman Walsh + + * dbttlpg.dsl: Bug #494693: bad formalpara formatting on title pages + + * dbverb.dsl: Bugs #429663 and #474328 fixed (allow external linespecific content to be indented and numbered). Eight bit or unicode external linespecific content may be problematic though. + +2002-05-09 Norman Walsh + + * dbgraph.dsl: Bug #448732: make image-library work with imagedata + + * dblink.dsl: Allow xref to refnamediv + +2002-05-06 Norman Walsh + + * dbbibl.dsl: Fix broken style attribute on biblioentries + +2002-04-29 Norman Walsh + + * dbefsyn.dsl: Format synopsis elements correctly outside of classsynopsis + +2002-04-21 Norman Walsh + + * db31.dsl, dbadmon.dsl, dbblock.dsl, dbcompon.dsl, dbdivis.dsl, dbgloss.dsl, dbindex.dsl, dblists.dsl, dbrfntry.dsl, dbsect.dsl, dbtable.dsl, dbttlpg.dsl: + Make sure named anchors are closed + +2002-03-24 Adam Di Carlo + + * Makefile: add a clean rule here + +2002-03-21 Norman Walsh + + * dbfootn.dsl: Fix footnote bugs (Adam, please double-check) + +2002-03-20 Norman Walsh + + * dbefsyn.dsl: Support freestanding {method,field,constructor,destructor}synopsis + +2002-03-16 Adam Di Carlo + + * dbfootn.dsl: footnotes go in a CSS class "footnote"; reduce code, additional modularity -- to change footnote rendering, + you just have to provide a different "$footnote-literal$" procedure + +2002-02-22 Norman Walsh + + * dblink.dsl: Add element-page-number-sosofo back in; always produce "???" + +2002-02-20 Norman Walsh + + * dblink.dsl: Remove bogus page-number rules + +2002-01-03 Norman Walsh + + * dbindex.dsl: Wrap DIVs around index lists + +2001-12-06 Norman Walsh + + * db31.dsl, dbadmon.dsl, dbblock.dsl, dbcompon.dsl, dbdivis.dsl, dbgloss.dsl, dbindex.dsl, dblists.dsl, dbrfntry.dsl, dbsect.dsl, dbttlpg.dsl: + Make anchors empty so that they don't imply style for the things they wrap + +2001-12-01 Norman Walsh + + * docbook.dsl: Bug #462406 legalnotice-link breaks HTML manifest + +2001-11-30 Norman Walsh + + * dbsect.dsl: Patch #473116: Section levels + +2001-11-18 Norman Walsh + + * dbparam.dsl: Bug #482355: use legalnotice id when use-id-as-filename is true + +2001-11-14 Norman Walsh + + * docbook.dsl: Added Basque, Nynorsk, Ukranian, and Xhosa + +2001-11-03 Norman Walsh + + * dbinline.dsl: Support pubwork=article on citetitle + +2001-10-13 Jirka Kosek + + * dbinline.dsl: Fixed bug #470840 - added support for methodname. + +2001-10-01 Norman Walsh + + * dbverb.dsl: Support linenumbering attribute on verbatim environments + +2001-09-29 Norman Walsh + + * dbcallou.dsl: Bug #449494: make callouts work even if they appear on the last line of a verbatim environment + +2001-09-23 Norman Walsh + + * db31.dsl: ImageData should use the image function from dbgraph.dsl + + * dbgraph.dsl: Patch #421990: support width and depth attributes on graphics + + * dbverb.dsl: Patch #461901, make %fix-para-wrappers% affect verbatim + +2001-09-18 Nik Clayton + + * dbcompon.dsl, dbparam.dsl: Add $generate-article-lot-list$, initially empty, which controls what + whether or not a list of titles is generated for articles. + + Currently HTML only. + +2001-08-30 Norman Walsh + + * db31.dsl: Fix XML/SGML discrepancy wrt normalization of notation names; move some common stuff into dbcommon + +2001-08-25 Norman Walsh + + * dbinline.dsl: Fix erroneous literals + + * dbsect.dsl: Bug #451005: no id anchor for bridgehead + +2001-08-06 Norman Walsh + + * dbinline.dsl, dbparam.dsl: Support 'bold' and 'strong' roles on emphasis in the expected way, added %{emphasis,phrase}-propagates-style% parameters + +2001-07-05 Norman Walsh + + * dbautoc.dsl, dbhtml.dsl: Patch #420730, use dingbat-sosofo instead of literal to create emdash + + * dbnavig.dsl: Patch #418401, add accesskey attributes to HTML navigation + + * dbparam.dsl: Patch #420012, Add colon to content-title-end-punct + +2001-07-04 + + * docbook.dsl: Added Afrikaans and Turkish + +2001-05-11 Norman Walsh + + * docbook.dsl: Support Serbian and Traditional Chinese + +2001-05-04 Norman Walsh + + * dbprocdr.dsl: Support links to procedures and steps + +2001-05-03 Jirka Kosek + + * dbinline.dsl: Attributes marked up by are now in monospace (same as in XSL and print DSSSL). + +2001-04-21 Norman Walsh + + * dbblock.dsl: Output anchors for formalparas with IDs + + * dbinline.dsl: Bug #417697: workaround Netscape limitation with trade named entity. + +2001-04-20 Norman Walsh + + * dbbibl.dsl: Make sure anchors are produced for bibliomixed elements + +2001-04-18 Norman Walsh + + * dbinline.dsl, dbparam.dsl: Bug #413982, easy support for man page CGI links on citerefentry + +2001-04-16 Norman Walsh + + * dbnavig.dsl: Added summary attribute to navigation tables + +2001-04-04 Norman Walsh + + * Makefile: New file. + +2001-04-03 Norman Walsh + + * db31.dsl: Fix bug 412548, allow WMF in media objects + +2001-04-02 Norman Walsh + + * .cvsignore, catalog, db31.dsl, dbadmon.dsl, dbautoc.dsl, dbbibl.dsl, dbblock.dsl, dbcallou.dsl, dbchunk.dsl, dbcompon.dsl, dbdivis.dsl, dbefsyn.dsl, dbfootn.dsl, dbgloss.dsl, dbgraph.dsl, dbhtml.dsl, dbindex.dsl, dbinfo.dsl, dbinline.dsl, dblink.dsl, dblists.dsl, dblot.dsl, dbmath.dsl, dbmsgset.dsl, dbnavig.dsl, dbparam.dsl, dbpi.dsl, dbprocdr.dsl, dbrfntry.dsl, dbsect.dsl, dbsynop.dsl, dbtable.dsl, dbtitle.dsl, dbttlpg.dsl, dbverb.dsl, docbook.dsl, version.dsl: + New file. + diff --git a/html/XREF b/html/XREF new file mode 100644 index 0000000..3ec54e8 --- /dev/null +++ b/html/XREF @@ -0,0 +1,2 @@ +Symbol Defined In Used In +================== ============================= ============================= diff --git a/html/catalog b/html/catalog new file mode 100644 index 0000000..f5ce23a --- /dev/null +++ b/html/catalog @@ -0,0 +1,3 @@ +CATALOG "../catalog" + + diff --git a/html/dbadmon.dsl b/html/dbadmon.dsl new file mode 100644 index 0000000..06834f2 --- /dev/null +++ b/html/dbadmon.dsl @@ -0,0 +1,171 @@ +;; $Id: dbadmon.dsl,v 1.5 2003/04/12 17:30:56 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ============================ ADMONITIONS ============================= + +(define ($graphical-admonition$) + (let* ((adm (current-node)) + (id (attribute-string (normalize "id"))) + (title (select-elements (children adm) + (normalize "title"))) + (title? (not (node-list-empty? title))) + (adm-title (if title? + (with-mode title-sosofo-mode + (process-node-list (node-list-first title))) + (literal (gentext-element-name adm)))) + (gr-cell (make element gi: "TD" + attributes: (list + (list "WIDTH" + ($admon-graphic-width$)) + (list "ALIGN" "CENTER") + (list "VALIGN" "TOP")) + (make empty-element gi: "IMG" + attributes: (list + (list "SRC" + (root-rel-path + ($admon-graphic$))) + (list "HSPACE" "5") + (list "ALT" + (gentext-element-name adm)))))) + (ttl-cell (make element gi: "TH" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "MIDDLE")) + (make element gi: "B" adm-title))) + (body-cell (make element gi: "TD" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP")) + (process-children)))) + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi adm))) + (if id + (make element gi: "A" + attributes: (list (list "NAME" id)) + (empty-sosofo)) + (empty-sosofo)) + (if %spacing-paras% + (make element gi: "P" (empty-sosofo)) + (empty-sosofo)) + (make element gi: "TABLE" + attributes: (list (list "CLASS" (gi)) + (list "WIDTH" ($table-width$)) + (list "BORDER" "0")) + (if title? + (make sequence + (make element gi: "TR" + gr-cell + ttl-cell) + (make element gi: "TR" + (make element gi: "TD" + (make entity-ref name: "nbsp")) + body-cell)) + (make sequence + (make element gi: "TR" + gr-cell + body-cell))))))) + +(define ($admonition$) + (let ((id (attribute-string (normalize "id")))) + (if %admon-graphics% + ($graphical-admonition$) + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + ;; The DIV isn't strictly necessary, of course, but it + ;; is consistent with the graphical-admonition case. + (make element gi: "BLOCKQUOTE" + attributes: (list + (list "CLASS" (gi))) + (if id + (make element gi: "A" + attributes: (list (list "NAME" id)) + (empty-sosofo)) + (empty-sosofo)) + (process-children)))))) + +(define ($admonpara$) + (let* ((title (select-elements + (children (parent (current-node))) (normalize "title"))) + (has-title (not (node-list-empty? title))) + (adm-title (if has-title + (make sequence + (with-mode title-sosofo-mode + (process-node-list (node-list-first title))) + (literal (gentext-label-title-sep + (gi (parent (current-node)))))) + (literal + (gentext-element-name + (gi (parent (current-node)))) + (gentext-label-title-sep + (gi (parent (current-node)))))))) + (make element gi: "P" + (if (and (not %admon-graphics%) (= (child-number) 1)) + (make element gi: "B" + adm-title) + (empty-sosofo)) + (process-children)))) + +(element important ($admonition$)) +(element (important title) (empty-sosofo)) +(element (important para) ($admonpara$)) +(element (important simpara) ($admonpara$)) +(element note ($admonition$)) +(element (note title) (empty-sosofo)) +(element (note para) ($admonpara$)) +(element (note simpara) ($admonpara$)) +(element tip ($admonition$)) +(element (tip title) (empty-sosofo)) +(element (tip para) ($admonpara$)) +(element (tip simpara) ($admonpara$)) + +;; perils are given special treatment by generating a centered title +;; and throwing a box around them +;; +(define ($peril$) + (let* ((title (select-elements + (children (current-node)) (normalize "title"))) + (has-title (not (node-list-empty? title))) + (adm-title (if has-title + (make sequence + (with-mode title-sosofo-mode + (process-node-list (node-list-first title)))) + (literal + (gentext-element-name + (gi (current-node)))))) + (id (attribute-string (normalize "id")))) + (if %admon-graphics% + ($graphical-admonition$) + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + ;; The DIV isn't strictly necessary, of course, but it + ;; is consistent with the graphical-admonition case. + (if %spacing-paras% + (make element gi: "P" (empty-sosofo)) + (empty-sosofo)) + (make element gi: "TABLE" + attributes: (list + (list "CLASS" (gi)) + (list "BORDER" "1") + (list "WIDTH" ($table-width$))) + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "CENTER")) + (make element gi: "B" + (if id + (make element gi: "A" + attributes: (list (list "NAME" id)) + (empty-sosofo)) + (empty-sosofo)) + adm-title))) + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (process-children)))))))) + +(element caution ($peril$)) +(element warning ($peril$)) +(element (caution title) (empty-sosofo)) +(element (warning title) (empty-sosofo)) diff --git a/html/dbautoc.dsl b/html/dbautoc.dsl new file mode 100644 index 0000000..c2f2b9b --- /dev/null +++ b/html/dbautoc.dsl @@ -0,0 +1,128 @@ +;; $Id: dbautoc.dsl,v 1.3 2003/01/15 08:24:13 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ========================== TABLE OF CONTENTS ========================= + +;; Returns the depth of auto TOC that should be made at the nd-level +(define (toc-depth nd) + (if (string=? (gi nd) (normalize "book")) + 3 + 1)) + +(define (toc-entry tocentry) + (make element gi: "DT" + (make sequence + (if (equal? (element-label tocentry) "") + (empty-sosofo) + (make sequence + (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))) + + ;; 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))))) + +(define (toc-annotation tocentry) + ;; only handles refentry at the moment + (let* ((refnamediv (select-elements (children tocentry) + (normalize "refnamediv"))) + (refpurpose (select-elements (children refnamediv) + (normalize "refpurpose")))) + (process-node-list (children refpurpose)))) + +(define (build-toc nd depth #!optional (chapter-toc? #f) (first? #t)) + (let ((toclist (toc-list-filter + (node-list-filter-by-gi (children nd) + (append (division-element-list) + (component-element-list) + (section-element-list))))) + (wrappergi (if first? "DIV" "DD")) + (wrapperattr (if first? '(("CLASS" "TOC")) '()))) + (if (or (<= depth 0) + (node-list-empty? toclist) + (and chapter-toc? + (not %force-chapter-toc%) + (<= (node-list-length toclist) 1))) + (empty-sosofo) + (make element gi: wrappergi + attributes: wrapperattr + (make element gi: "DL" + (if first? + (make element gi: "DT" + (make element gi: "B" + (literal (gentext-element-name (normalize "toc"))))) + (empty-sosofo)) + (let loop ((nl toclist)) + (if (node-list-empty? nl) + (empty-sosofo) + (sosofo-append + (toc-entry (node-list-first nl)) + (build-toc (node-list-first nl) + (- depth 1) chapter-toc? #f) + (loop (node-list-rest nl)))))))))) + +;; Print the LOT entry +(define (lot-entry tocentry) + (make element gi: "DT" + (make sequence + (if (equal? (element-label tocentry) "") + (empty-sosofo) + (make sequence + (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)))))) + +;; Build a LOT starting at nd for all the lotgi's it contains. +;; The optional arguments are used on recursive calls to build-toc +;; and shouldn't be set by the initial caller... +;; + +(define (build-lot nd lotgi) + (let* ((lotlist (select-elements (descendants nd) + (normalize lotgi)))) + (if (node-list-empty? lotlist) + (empty-sosofo) + (make element gi: "DIV" + attributes: '(("CLASS" "LOT")) + (make element gi: "DL" + attributes: '(("CLASS" "LOT")) + (make element gi: "DT" + (make element gi: "B" + (literal ($lot-title$ + (gi (node-list-first lotlist)))))) + (let loop ((lote lotlist)) + (if (node-list-empty? lote) + (empty-sosofo) + (make sequence + (lot-entry (node-list-first lote)) + (loop (node-list-rest lote)))))))))) diff --git a/html/dbbibl.dsl b/html/dbbibl.dsl new file mode 100644 index 0000000..daa8af6 --- /dev/null +++ b/html/dbbibl.dsl @@ -0,0 +1,997 @@ +;; $Id: dbbibl.dsl,v 1.5 2003/01/15 08:24:13 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ......................... BIBLIOGRAPHY PARAMS ......................... + +;; these should be in dbparam... +(define %biblsep% ", ") +(define %biblend% ".") +(define bibltable #f) + +(define (bibliography-table) + (let* ((bibliography (ancestor-member (current-node) + (list (normalize "bibliography")))) + (biblpi (dbhtml-value bibliography "bibliography-format"))) + (and (or bibltable (equal? biblpi "table")) + (not (equal? biblpi "list"))))) + +(define %biblioentry-in-entry-order% #t) + +;; .................... BIBLIOGRAPHY and BIBLIODIV ...................... + +(define (bibliography-content) + ;; Note that the code below works for both the case where the bibliography + ;; has BIBLIODIVs and the case where it doesn't, by the slightly subtle + ;; fact that if it does, then allentries will be (empty-node-list). + (let* ((allbibcontent (children (current-node))) + (prebibcontent (node-list-filter-by-not-gi + allbibcontent + (list (normalize "biblioentry") + (normalize "bibliomixed")))) + (allentries (node-list-filter-by-gi + allbibcontent + (list (normalize "biblioentry") + (normalize "bibliomixed")))) + (entries (if biblio-filter-used + (biblio-filter allentries) + allentries))) + (make sequence + (process-node-list prebibcontent) + (if (bibliography-table) + (make element gi: "TABLE" + attributes: '(("BORDER" "0")) + (process-node-list entries)) + (process-node-list entries))))) + +(element (book bibliography) + (let ((title (element-title-sosofo (current-node))) + (body (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + ($component-separator$) + ($component-title$) + (bibliography-content)))) + (html-document title body))) + +(element (article bibliography) + (let ((title (element-title-sosofo (current-node))) + (body (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + ($component-separator$) + ($component-title$) + (bibliography-content)))) + (html-document title body))) + +(element bibliography + ;; A bibliography that's inside something else...or root + (if (sgml-root-element? (current-node)) + (let ((title (element-title-sosofo (current-node))) + (body (make sequence + (make element gi: "A" + attributes: (list (list "NAME" + (element-id))) + (empty-sosofo)) + ($component-separator$) + ($component-title$) + (bibliography-content)))) + (html-document title body)) + (let* ((sect (ancestor-member (current-node) + (append (section-element-list) + (component-element-list)))) + (hlevel (+ (SECTLEVEL sect) 1)) + (helem (string-append "H" (number->string (+ hlevel 1))))) + (make sequence + (make element gi: helem + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (element-title-sosofo (current-node)))) + (bibliography-content))))) + +(element (bibliography title) (empty-sosofo)) + +(element bibliodiv + (let* ((allentries (node-list-filter-by-gi (children (current-node)) + (list (normalize "biblioentry") + (normalize "bibliomixed")))) + (entries (if biblio-filter-used + (biblio-filter allentries) + allentries))) + (if (and biblio-filter-used (node-list-empty? entries)) + (empty-sosofo) + (make sequence + ($section-separator$) + ($section-title$) + (if (bibliography-table) + (make element gi: "TABLE" + attributes: '(("BORDER" "0")) + (process-node-list entries)) + (process-node-list entries)))))) + +(element (bibliodiv title) (empty-sosofo)) + +;; ..................... BIBLIOGRAPHY ENTRIES ......................... + +(define (biblioentry-inline-sep node rest) + ;; Output the character that should separate inline node from rest + (cond + ((and (equal? (gi node) (normalize "title")) + (equal? (gi (node-list-first rest)) (normalize "subtitle"))) + (make element gi: "I" + (literal ": "))) + (else + (literal %biblsep%)))) + +(define (biblioentry-inline-end blocks) + ;; Output the character that should occur at the end of inline + (literal %biblend%)) + +(define (biblioentry-block-sep node rest) + ;; Output the character that should separate block node from rest + (empty-sosofo)) + +(define (biblioentry-block-end) + ;; Output the character that should occur at the end of block + (empty-sosofo)) + +(define (nontable-biblioentry + xreflabel leading-abbrev inline-children block-children) + (let ((has-leading-abbrev? + (not (or (node-list-empty? leading-abbrev) biblio-number)))) + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (make element gi: "P" + (if (or biblio-number xreflabel has-leading-abbrev?) + (make sequence + (literal "[") + + (if biblio-number + (literal (number->string (bibentry-number + (current-node)))) + (empty-sosofo)) + + (if xreflabel + (literal xreflabel) + (empty-sosofo)) + + (if has-leading-abbrev? + (with-mode biblioentry-inline-mode + (process-node-list leading-abbrev)) + (empty-sosofo)) + + (literal "]") + (make entity-ref name: "nbsp")) + (empty-sosofo)) + + (let loop ((nl inline-children)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (with-mode biblioentry-inline-mode + (process-node-list (node-list-first nl))) + (if (node-list-empty? (node-list-rest nl)) + (biblioentry-inline-end block-children) + (biblioentry-inline-sep (node-list-first nl) + (node-list-rest nl))) + (loop (node-list-rest nl)))))) + + (make element gi: "DIV" + attributes: '(("CLASS" "BIBLIOENTRYBLOCK") + ("STYLE" "margin-left: 0.5in")) + (let loop ((nl block-children)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (with-mode biblioentry-block-mode + (process-node-list (node-list-first nl))) + (if (node-list-empty? (node-list-rest nl)) + (biblioentry-block-end) + (biblioentry-block-sep (node-list-first nl) + (node-list-rest nl))) + (loop (node-list-rest nl))))))))) + +(define (table-biblioentry + xreflabel leading-abbrev inline-children block-children) + (let ((has-leading-abbrev? + (not (or (node-list-empty? leading-abbrev) biblio-number)))) + (make element gi: "TR" + (make element gi: "TD" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("WIDTH" "10%")) + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + + (if (or biblio-number xreflabel has-leading-abbrev?) + (make sequence + (literal "[") + + (if biblio-number + (literal (number->string (bibentry-number + (current-node)))) + (empty-sosofo)) + + (if xreflabel + (literal xreflabel) + (empty-sosofo)) + + (if has-leading-abbrev? + (with-mode biblioentry-inline-mode + (process-node-list leading-abbrev)) + (empty-sosofo)) + + (literal "]")) + (make entity-ref name: "nbsp"))) + + (make element gi: "TD" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("WIDTH" "90%")) + (make element gi: "P" + (let loop ((nl inline-children)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (with-mode biblioentry-inline-mode + (process-node-list (node-list-first nl))) + (if (node-list-empty? (node-list-rest nl)) + (biblioentry-inline-end block-children) + (biblioentry-inline-sep (node-list-first nl) + (node-list-rest nl))) + (loop (node-list-rest nl)))))) + + (let loop ((nl block-children)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (with-mode biblioentry-block-mode + (process-node-list (node-list-first nl))) + (if (node-list-empty? (node-list-rest nl)) + (biblioentry-block-end) + (biblioentry-block-sep (node-list-first nl) + (node-list-rest nl))) + (loop (node-list-rest nl))))) + + (if (node-list-empty? block-children) + (empty-sosofo) + (make element gi: "P" + ;; get the table row spacing right + (empty-sosofo))))))) + +(element biblioentry + (let* ((expanded-children (expand-children + (children (current-node)) + (biblioentry-flatten-elements))) + (all-inline-children (if %biblioentry-in-entry-order% + (titlepage-gi-list-by-nodelist + (biblioentry-inline-elements) + expanded-children) + (titlepage-gi-list-by-elements + (biblioentry-inline-elements) + expanded-children))) + (block-children (if %biblioentry-in-entry-order% + (titlepage-gi-list-by-nodelist + (biblioentry-block-elements) + expanded-children) + (titlepage-gi-list-by-elements + (biblioentry-block-elements) + expanded-children))) + (leading-abbrev (if (equal? (normalize "abbrev") + (gi (node-list-first + all-inline-children))) + (node-list-first all-inline-children) + (empty-node-list))) + (inline-children (if (node-list-empty? leading-abbrev) + all-inline-children + (node-list-rest all-inline-children))) + (has-leading-abbrev? (not (node-list-empty? leading-abbrev))) + (xreflabel (if (or has-leading-abbrev? biblio-number) + #f + (attribute-string (normalize "xreflabel"))))) + (if (bibliography-table) + (table-biblioentry xreflabel leading-abbrev inline-children block-children) + (nontable-biblioentry xreflabel leading-abbrev inline-children block-children)))) + +(mode biblioentry-inline-mode + (element abbrev + (make sequence + (process-children))) + + (element affiliation + (let ((inline-children (node-list-filter-by-not-gi + (children (current-node)) + (list (normalize "address"))))) + (let loop ((nl inline-children)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (process-node-list (node-list-first nl)) + (if (node-list-empty? (node-list-rest nl)) + (empty-sosofo) + (literal ", ")) + (loop (node-list-rest nl))))))) + + (element artpagenums + (make sequence + (process-children))) + + (element author + (make element gi: "SPAN" + attributes: '(("CLASS" "AUTHOR")) + (literal (author-list-string)))) + + (element authorgroup + (process-children)) + + (element authorinitials + (make sequence + (process-children))) + + (element collab + (let* ((nl (children (current-node))) + (collabname (node-list-first nl)) + (affil (node-list-rest nl))) + (make sequence + (process-node-list collabname) + (if (node-list-empty? affil) + (empty-sosofo) + (let loop ((nl affil)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (literal ", ") + (process-node-list (node-list-first nl)) + (loop (node-list-rest nl))))))))) + + (element (collab collabname) + (process-children)) + + (element confgroup + (let ((inline-children (node-list-filter-by-not-gi + (children (current-node)) + (list (normalize "address"))))) + (let loop ((nl inline-children)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (process-node-list (node-list-first nl)) + (if (node-list-empty? (node-list-rest nl)) + (empty-sosofo) + (literal ", ")) + (loop (node-list-rest nl))))))) + + (element contractnum + (process-children)) + + (element contractsponsor + (process-children)) + + (element contrib + (process-children)) + + (element copyright + ;; Just print the year(s) + (let ((years (select-elements (children (current-node)) + (normalize "year")))) + (process-node-list years))) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element corpauthor + (make sequence + (process-children))) + + (element corpname + (make sequence + (process-children))) + + (element date + (make sequence + (process-children))) + + (element edition + (make sequence + (process-children))) + + (element editor + (make element gi: "SPAN" + attributes: '(("CLASS" "EDITOR")) + (if (first-sibling?) + (make sequence + (literal (gentext-edited-by)) + (literal " ")) + (empty-sosofo)) + (literal (author-list-string)))) + + (element firstname + (make sequence + (process-children))) + + (element honorific + (make sequence + (process-children))) + + (element invpartnumber + (make sequence + (process-children))) + + (element isbn + (make sequence + (process-children))) + + (element issn + (make sequence + (process-children))) + + (element issuenum + (make sequence + (process-children))) + + (element lineage + (make sequence + (process-children))) + + (element orgname + (make sequence + (process-children))) + + (element othercredit + (make element gi: "SPAN" + attributes: '(("CLASS" "OTHERCREDIT")) + (literal (author-list-string)))) + + (element othername + (make sequence + (process-children))) + + (element pagenums + (make sequence + (process-children))) + + (element productname + (make sequence + ($charseq$) +; this is actually a problem since "trade" is the default value for +; the class attribute. we can put this back in in DocBook 5.0, when +; class becomes #IMPLIED +; (if (equal? (attribute-string "class") (normalize "trade")) +; (dingbat-sosofo "trademark") +; (empty-sosofo)) + )) + + (element productnumber + (make sequence + (process-children))) + + (element pubdate + (make sequence + (process-children))) + + (element publisher + (let ((pubname (select-elements (children (current-node)) + (normalize "publishername"))) + (cities (select-elements (descendants (current-node)) + (normalize "city")))) + (make sequence + (process-node-list pubname) + (if (node-list-empty? cities) + (empty-sosofo) + (literal ", ")) + (process-node-list cities)))) + + (element publishername + (make sequence + (process-children))) + + (element (publisher address city) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element pubsnumber + (make sequence + (process-children))) + + (element releaseinfo + (make sequence + (process-children))) + + (element seriesvolnums + (make sequence + (process-children))) + + (element subtitle + (make element gi: "I" + (process-children))) + + (element surname + (make sequence + (process-children))) + + (element title + (make element gi: "I" + (process-children))) + + (element titleabbrev + (make sequence + (process-children))) + + (element volumenum + (make sequence + (process-children))) + + (element (bibliomixed title) + (make element gi: "I" + (process-children))) + + (element (bibliomixed subtitle) + (make element gi: "I" + (process-children))) + + (element (biblioset title) + (let ((rel (case-fold-up + (inherited-attribute-string (normalize "relation"))))) + (cond + ((equal? rel "ARTICLE") (make sequence + (literal (gentext-start-quote)) + (process-children) + (literal (gentext-end-quote)))) + (else (make element gi: "I" + (process-children)))))) + + (element (bibliomset title) + (let ((rel (case-fold-up + (inherited-attribute-string (normalize "relation"))))) + (cond + ((equal? rel "ARTICLE") (make sequence + (literal (gentext-start-quote)) + (process-children) + (literal (gentext-end-quote)))) + (else (make element gi: "I" + (process-children)))))) +) + +(mode biblioentry-block-mode + (element abstract + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element (abstract title) + (make element gi: "P" + (make element gi: "B" + (process-children)))) + + (element address + ($linespecific-display$ %indent-address-lines% %number-address-lines%)) + + (element authorblurb + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element printhistory + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + + (element revhistory + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "TABLE" + attributes: (list + (list "WIDTH" ($table-width$)) + (list "BORDER" "0")) + (make sequence + (make element gi: "TR" + (make element gi: "TH" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("COLSPAN" "3")) + (make element gi: "B" + (literal (gentext-element-name + (gi (current-node))))))) + (process-children))))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (node-list-filter-by-gi + (descendants (current-node)) + (list (normalize "revremark") + (normalize "revdescription"))))) + (make sequence + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revnumber)) + (make sequence + (literal (gentext-element-name-space + (gi (current-node)))) + (process-node-list revnumber)) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revdate)) + (process-node-list revdate) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revauthor)) + (make sequence + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT") + (list "COLSPAN" "3")) + (if (not (node-list-empty? revremark)) + (process-node-list revremark) + (empty-sosofo))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + (element (revision revdescription) (process-children)) + + (element seriesinfo + ;; This is a nearly biblioentry recursively... + (let* ((expanded-children (expand-children + (children (current-node)) + (biblioentry-flatten-elements))) + (all-inline-children (if %biblioentry-in-entry-order% + (titlepage-gi-list-by-nodelist + (biblioentry-inline-elements) + expanded-children) + (titlepage-gi-list-by-elements + (biblioentry-inline-elements) + expanded-children))) + (block-children (if %biblioentry-in-entry-order% + (titlepage-gi-list-by-nodelist + (biblioentry-block-elements) + expanded-children) + (titlepage-gi-list-by-elements + (biblioentry-block-elements) + expanded-children))) + (inline-children all-inline-children)) + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "P" + (let loop ((nl inline-children)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (with-mode biblioentry-inline-mode + (process-node-list (node-list-first nl))) + (if (node-list-empty? (node-list-rest nl)) + (biblioentry-inline-end block-children) + (biblioentry-inline-sep (node-list-first nl) + (node-list-rest nl))) + (loop (node-list-rest nl)))))) + + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (let loop ((nl block-children)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (with-mode biblioentry-block-mode + (process-node-list (node-list-first nl))) + (if (node-list-empty? (node-list-rest nl)) + (biblioentry-block-end) + (biblioentry-block-sep (node-list-first nl) + (node-list-rest nl))) + (loop (node-list-rest nl))))))))) +) + +(define (nontable-bibliomixed + xreflabel leading-abbrev inline-children) + (let* ((has-leading-abbrev? (not (node-list-empty? leading-abbrev)))) + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + + (if (or biblio-number xreflabel has-leading-abbrev?) + (make sequence + (literal "[") + + (if biblio-number + (literal (number->string (bibentry-number + (current-node)))) + (empty-sosofo)) + + (if xreflabel + (literal xreflabel) + (empty-sosofo)) + + (if has-leading-abbrev? + (with-mode biblioentry-inline-mode + (process-node-list leading-abbrev)) + (empty-sosofo)) + + (literal "]") + (make entity-ref name: "nbsp")) + (empty-sosofo)) + + (with-mode biblioentry-inline-mode + (process-node-list inline-children)))))) + +(define (table-bibliomixed + xreflabel leading-abbrev inline-children) + (let* ((has-leading-abbrev? (not (node-list-empty? leading-abbrev)))) + (make element gi: "TR" + (make element gi: "TD" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("WIDTH" "10%")) + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + + (if (or biblio-number xreflabel has-leading-abbrev?) + (make sequence + (literal "[") + + (if biblio-number + (literal (number->string (bibentry-number + (current-node)))) + (empty-sosofo)) + + (if xreflabel + (literal xreflabel) + (empty-sosofo)) + + (if has-leading-abbrev? + (with-mode biblioentry-inline-mode + (process-node-list leading-abbrev)) + (empty-sosofo)) + + (literal "]")) + (make entity-ref name: "nbsp"))) + + (make element gi: "TD" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("WIDTH" "90%")) + (with-mode biblioentry-inline-mode + (process-node-list inline-children)))))) + +(element bibliomixed + (let* ((all-inline-children (children (current-node))) + (leading-abbrev (if (equal? (normalize "abbrev") + (gi (node-list-first + all-inline-children))) + (node-list-first all-inline-children) + (empty-node-list))) + (inline-children (if (node-list-empty? leading-abbrev) + all-inline-children + (node-list-rest all-inline-children))) + (has-leading-abbrev? (not (node-list-empty? leading-abbrev))) + (xreflabel (if (or has-leading-abbrev? biblio-number) + #f + (attribute-string (normalize "xreflabel"))))) + (if (bibliography-table) + (table-bibliomixed xreflabel leading-abbrev inline-children) + (nontable-bibliomixed xreflabel leading-abbrev inline-children)))) + +;; ....................... BIBLIOGRAPHY ELEMENTS ....................... + +;; These are element construction rules for bibliography elements that +;; may occur outside of a BIBLIOENTRY or BIBLIOMIXED. + +(element bibliomisc (process-children)) +(element bibliomset (process-children)) +(element biblioset (process-children)) +(element bookbiblio (process-children)) + +(element street ($charseq$)) +(element pob ($charseq$)) +(element postcode ($charseq$)) +(element city ($charseq$)) +(element state ($charseq$)) +(element country ($charseq$)) +(element phone ($charseq$)) +(element fax ($charseq$)) +(element otheraddr ($charseq$)) +(element affiliation ($charseq$)) +(element shortaffil ($charseq$)) +(element jobtitle ($charseq$)) +(element orgdiv ($charseq$)) +(element artpagenums ($charseq$)) + +(element author + (make sequence + (literal (author-list-string)))) + +(element authorgroup (process-children)) + +(element collab (process-children)) +(element collabname ($charseq$)) +(element authorinitials ($charseq$)) +(element confgroup (process-children)) +(element confdates ($charseq$)) +(element conftitle ($charseq$)) +(element confnum ($charseq$)) +(element confsponsor ($charseq$)) +(element contractnum ($charseq$)) +(element contractsponsor ($charseq$)) + +(element copyright + (make sequence + (literal (gentext-element-name (gi (current-node)))) + (make entity-ref name: "nbsp") + (dingbat-sosofo "copyright") + (make entity-ref name: "nbsp") + (process-children))) + +(element year + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (literal " ")))) + +(element holder ($charseq$)) + +(element corpauthor + (make sequence + (literal (author-list-string)))) + +(element corpname ($charseq$)) +(element date ($charseq$)) +(element edition ($charseq$)) +(element editor ($charseq$)) +(element isbn ($charseq$)) +(element issn ($charseq$)) +(element invpartnumber ($charseq$)) +(element issuenum ($charseq$)) + +(element legalnotice ($semiformal-object$)) +(element (legalnotice title) (empty-sosofo)) + +(element modespec (empty-sosofo)) + +(element orgname ($charseq$)) + +(element othercredit + (make sequence + (literal (author-list-string)))) + +(element pagenums ($charseq$)) +(element contrib ($charseq$)) + +(element firstname ($charseq$)) +(element honorific ($charseq$)) +(element lineage ($charseq$)) +(element othername ($charseq$)) +(element surname ($charseq$)) + +(element printhistory (empty-sosofo)) + + (element productname + (make sequence + ($charseq$) +; this is actually a problem since "trade" is the default value for +; the class attribute. we can put this back in in DocBook 5.0, when +; class becomes #IMPLIED +; (if (equal? (attribute-string "class") (normalize "trade")) +; (dingbat-sosofo "trademark") +; (empty-sosofo)) + )) + +(element productnumber ($charseq$)) +(element pubdate ($charseq$)) +(element publisher (process-children)) +(element publishername ($charseq$)) +(element pubsnumber ($charseq$)) +(element releaseinfo (empty-sosofo)) +(element revision ($charseq$)) +(element revnumber ($charseq$)) +(element revremark ($charseq$)) +(element revdescription ($block-container$)) +(element seriesvolnums ($charseq$)) +(element volumenum ($charseq$)) + +(element (bookbiblio revhistory) ($book-revhistory$)) + +;; The (element (bookinfo revhistory)) construction rule is in dbinfo.dsl +;; It calls $book-revhistory$... +(define ($book-revhistory$) + (make element gi: "DIV" + attributes: (list + (list "CLASS" (gi))) + (make element gi: "TABLE" + attributes: (list + (list "WIDTH" ($table-width$)) + (list "BORDER" "0")) + (make sequence + (make element gi: "TR" + (make element gi: "TH" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("COLSPAN" "3")) + (make element gi: "B" + (literal (gentext-element-name + (gi (current-node))))))) + (process-children))))) + +(element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (node-list-filter-by-gi + (descendants (current-node)) + (list (normalize "revremark") + (normalize "revdescription"))))) + (make sequence + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revnumber)) + (make sequence + (literal (gentext-element-name-space + (gi (current-node)))) + (process-node-list revnumber)) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revdate)) + (process-node-list revdate) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revauthor)) + (make sequence + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT") + (list "COLSPAN" "3")) + (if (not (node-list-empty? revremark)) + (process-node-list revremark) + (empty-sosofo))))))) + +(element (revision revnumber) (process-children-trim)) +(element (revision date) (process-children-trim)) +(element (revision authorinitials) (process-children-trim)) +(element (revision revremark) (process-children-trim)) diff --git a/html/dbblock.dsl b/html/dbblock.dsl new file mode 100644 index 0000000..966cd1c --- /dev/null +++ b/html/dbblock.dsl @@ -0,0 +1,306 @@ +;; $Id: dbblock.dsl,v 1.11 2003/05/28 16:48:47 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +(element highlights ($block-container$)) + +(element revhistory ($book-revhistory$)) + +(element blockquote + (let ((id (element-id)) + (attrib (select-elements (children (current-node)) + (normalize "attribution"))) + (startc (list (list "WIDTH" %blockquote-start-col%))) + (endc (list (list "WIDTH" %blockquote-end-col%))) + (paras (node-list-filter-by-not-gi + (children (current-node)) + (list (normalize "attribution"))))) + (make sequence + (if id + (make element gi: "A" + attributes: (list (list "NAME" id)) + (empty-sosofo)) + (empty-sosofo)) + + (if (node-list-empty? attrib) + (make element gi: "BLOCKQUOTE" + attributes: '(("CLASS" "BLOCKQUOTE")) + (process-children)) + (make element gi: "TABLE" + attributes: '(("BORDER" "0") + ("WIDTH" "100%") + ("CELLSPACING" "0") + ("CELLPADDING" "0") + ("CLASS" "BLOCKQUOTE")) + (make element gi: "TR" + (make element gi: "TD" + attributes: (append startc + '(("VALIGN" "TOP"))) + (make entity-ref name: "nbsp")) + (make element gi: "TD" + attributes: '(("VALIGN" "TOP")) + (process-node-list paras)) + (make element gi: "TD" + attributes: (append endc + '(("VALIGN" "TOP"))) + (make entity-ref name: "nbsp"))) + (make element gi: "TR" + (make element gi: "TD" + attributes: '(("COLSPAN" "2") + ("ALIGN" "RIGHT") + ("VALIGN" "TOP")) + (make sequence + (literal "--") + (process-node-list attrib))) + (make element gi: "TD" + attributes: endc + (make entity-ref name: "nbsp")))))))) + +(element epigraph + (let* ((attrib (select-elements (children (current-node)) + (normalize "attribution"))) + (startcol (list (list "WIDTH" %epigraph-start-col%))) + (contentcol (list (list "WIDTH" %epigraph-content-col%))) + (paras (node-list-filter-by-not-gi + (children (current-node)) + (list (normalize "attribution"))))) + (make element gi: "TABLE" + attributes: '(("BORDER" "0") + ("WIDTH" "100%") + ("CELLSPACING" "0") + ("CELLPADDING" "0") + ("CLASS" "EPIGRAPH")) + (make element gi: "TR" + (make element gi: "TD" + attributes: startcol + (make entity-ref name: "nbsp")) + (make element gi: "TD" + attributes: (append contentcol + '(("ALIGN" "LEFT") + ("VALIGN" "TOP"))) + (make element gi: "I" + (process-node-list paras)))) + (if (node-list-empty? attrib) + (empty-sosofo) + (make element gi: "TR" + (make element gi: "TD" + attributes: startcol + (make entity-ref name: "nbsp")) + (make element gi: "TD" + attributes: (append contentcol + '(("ALIGN" "RIGHT") + ("VALIGN" "TOP"))) + (make element gi: "I" + (process-node-list attrib)))))))) + +(element attribution ($charseq$)) + +(element (epigraph para) + (make element gi: "P" + (make element gi: "I" + (process-children-trim)))) + +(element para ($paragraph$)) +(element simpara ($paragraph$)) + +(element formalpara + (make element gi: "DIV" + attributes: (list + (list "CLASS" (gi))) + (make element gi: "P" + (if (attribute-string (normalize "id")) + (make element gi: "A" + attributes: (list + (list "NAME" + (attribute-string + (normalize "id")))) + (empty-sosofo)) + (empty-sosofo)) + (process-children)))) + +(element (formalpara title) ($runinhead$)) + +(element (formalpara para) + (process-children)) + +(element sidebar + (make element gi: "TABLE" + attributes: (list + (list "CLASS" (gi)) + (list "BORDER" "1") + (list "CELLPADDING" "5")) + (make element gi: "TR" + (make element gi: "TD" + ($semiformal-object$))))) + +(element (sidebar title) + (empty-sosofo)) + +(element abstract + (make element gi: "BLOCKQUOTE" + attributes: '(("CLASS" "ABSTRACT")) + ($semiformal-object$))) + +(element (abstract title) (empty-sosofo)) + +(element authorblurb ($block-container$)) + +(element ackno ($paragraph$)) + +(define ($inline-object$) + (process-children)) + +(define ($informal-object$ #!optional (rule-before? #f) (rule-after? #f)) + (let ((id (element-id))) + (make element gi: "DIV" + attributes: (list + (list "CLASS" (gi))) + (if %spacing-paras% + (make element gi: "P" (empty-sosofo)) + (empty-sosofo)) + + (if rule-before? + (make empty-element gi: "HR") + (empty-sosofo)) + + (if id + ;; empty A is a little evil but for instance you can't + ;; wrap TABLE within A + (make element gi: "A" + attributes: (list (list "NAME" id)) + (empty-sosofo)) + (empty-sosofo)) + + ;; reset the mode to make processing of elements within an + ;; informal object not subject to whatever mode they would + ;; be in on the top level; e.g., + ;; bookinfo-legalnotice-productname distinguished from + ;; bookinfo-productname + (with-mode #f + (process-children)) + + (if rule-after? + (make empty-element gi: "HR") + (empty-sosofo)) + + (if %spacing-paras% + (make element gi: "P" (empty-sosofo)) + (empty-sosofo))))) + +(define (object-title-after #!optional (node (current-node))) + (if (member (gi node) ($object-titles-after$)) + #t + #f)) + +(define (named-formal-objects) + (list (normalize "figure") + (normalize "table") + (normalize "example") + (normalize "equation"))) + +(define ($formal-object$ #!optional (rule-before? #f) (rule-after? #f)) + (let* ((nsep (gentext-label-title-sep (gi))) + (id (element-id)) + (title-inline-sosofo + (make sequence + (if (member (gi) (named-formal-objects)) + (make sequence + (literal (gentext-element-name (gi))) + (if (string=? (element-label) "") + (literal nsep) + (literal " " (element-label) nsep))) + (empty-sosofo)) + (with-mode title-mode + (process-node-list + (select-elements (children (current-node)) + (normalize "title")))))) + (title-sosofo (make element gi: "P" + (make element gi: "B" + title-inline-sosofo))) + + ;; reset the mode to make processing of elements within an + ;; formal object not subject to whatever mode they would be + ;; in on the top level; e.g., + ;; bookinfo-legalnotice-productname distinguished from + ;; bookinfo-productname + (object-sosofo (with-mode #f + (process-children)))) + (make element gi: "DIV" + attributes: (list + (list "CLASS" (gi))) + + (if rule-before? + (make empty-element gi: "HR") + (empty-sosofo)) + + (if id + (make element gi: "A" + attributes: (list + (list "NAME" id)) + (empty-sosofo)) + (empty-sosofo)) + + (if (object-title-after) + (make sequence + object-sosofo + title-sosofo) + (make sequence + title-sosofo + object-sosofo)) + + (if rule-after? + (make empty-element gi: "HR") + (empty-sosofo))))) + +(define ($semiformal-object$) + ;; semiformal means optional title... + (if (node-list-empty? (select-elements (children (current-node)) + (normalize "title"))) + ($informal-object$) + ($formal-object$))) + +(element example + ($formal-object$ %example-rules% %example-rules%)) + +(element (example title) (empty-sosofo)) ; don't show caption below example + +(element informalexample + ($informal-object$ %informalexample-rules% %informalexample-rules%)) + +(element informalfigure + ($informal-object$ %informalfigure-rules% %informalfigure-rules%)) + +(element (figure title) (empty-sosofo)) ; don't show caption below figure + +(element figure + ($formal-object$ %figure-rules% %figure-rules%)) + +(element informaltable + ($informal-object$ %informaltable-rules% %informaltable-rules%)) + +(element table + ($formal-object$ %table-rules% %table-rules%)) + +(element (table title) (empty-sosofo)) + +;; remark and comment use the same rendering +(define ($remark$) + (if %show-comments% + (let ((inpara (equal? (gi (parent (current-node))) (normalize "para"))) + (attrib '(("CLASS" "COMMENT")))) + (if inpara + (make element gi: "SPAN" + attributes: attrib + (process-children)) + (make element gi: "P" + attributes: attrib + (process-children)))) + (empty-sosofo))) + +(element comment ($remark$)) + +;; In DocBook V4.0 comment became remark +(element remark ($remark$)) + diff --git a/html/dbcallou.dsl b/html/dbcallou.dsl new file mode 100644 index 0000000..c3d1297 --- /dev/null +++ b/html/dbcallou.dsl @@ -0,0 +1,206 @@ +;; $Id: dbcallou.dsl,v 1.4 2003/04/26 18:36:22 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; The support provided below is a little primitive because there's no way +;; to do line-addressing in Jade. +;; +;; CO's are supported with the CO element or, in SCREENCO and +;; PROGRAMLISTINGCO only, AREAs. +;; +;; Notes on the use of AREAs: +;; +;; - Processing is very slow. Jade loops through each AREA for +;; every column on every line. +;; - Only the LINECOLUMN units are supported, and they are #IMPLIED +;; - If a COORDS only specifies a line, the %callout-default-col% will +;; be used for the column. +;; - If the column is beyond the end of the line, that will work OK, but +;; if more than one callout has to get placed beyond the end of the same +;; line, that doesn't work so well. +;; - Embedded tabs foul up the column counting. +;; - Embedded markup fouls up the column counting. +;; - Embedded markup with embedded line breaks fouls up the line counting. +;; - The callout bugs occur immediately before the LINE COLUMN specified. +;; - You can't point to an AREASET, that doesn't make any sense in HTML +;; since it would imply a one-to-many link +;; +;; There's still no support for a stylesheet drawing the callouts on a +;; GRAPHIC, and I don't think there ever will be. +;; + +(element areaspec (empty-sosofo)) +(element area (empty-sosofo)) +(element areaset (empty-sosofo)) + +(element co + ($callout-mark$ (current-node) #t)) + +(element programlistingco (process-children)) +(element screenco (process-children)) +(element graphicco (process-children)) + +(element (screenco screen) + ($callout-verbatim-display$ %indent-screen-lines% %number-screen-lines%)) + +(element (programlistingco programlisting) + ($callout-verbatim-display$ %indent-programlisting-lines% + %number-programlisting-lines%)) + +;; ---------------------------------------------------------------------- + +(define ($callout-bug$ conumber) + (let ((number (if conumber (format-number conumber "1") "0"))) + (if conumber + (if %callout-graphics% + (if (<= conumber %callout-graphics-number-limit%) + (make empty-element gi: "IMG" + attributes: (list (list "SRC" + (root-rel-path + (string-append + %callout-graphics-path% + number + %stock-graphics-extension%))) + (list "HSPACE" "0") + (list "VSPACE" "0") + (list "BORDER" "0") + (list "ALT" + (string-append + "(" number ")")))) + (make element gi: "B" + (literal "(" (format-number conumber "1") ")"))) + (make element gi: "B" + (literal "(" (format-number conumber "1") ")"))) + (make element gi: "B" + (literal "(??)"))))) + +(define ($callout-mark$ co anchor?) + ;; Print the callout mark for co + (let* ((id (attribute-string (normalize "id") co)) + (attr (if anchor? + (list (list "NAME" id)) + (list (list "HREF" (href-to co)))))) + (make element gi: "A" + attributes: attr + (if (equal? (gi co) (normalize "co")) + ($callout-bug$ (if (node-list-empty? co) + #f + (child-number co))) + (let ((areanum (if (node-list-empty? co) + 0 + (if (equal? (gi (parent co)) (normalize "areaset")) + (absolute-child-number (parent co)) + (absolute-child-number co))))) + ($callout-bug$ (if (node-list-empty? co) + #f + areanum))))))) + +(define ($look-for-callout$ line col #!optional (eol? #f)) + ;; Look to see if a callout should be printed at line col, and print + ;; it if it should + (let* ((areaspec (select-elements (children (parent (current-node))) + (normalize "areaspec"))) + (areas (expand-children (children areaspec) + (list (normalize "areaset"))))) + (let loop ((areanl areas)) + (if (node-list-empty? areanl) + (empty-sosofo) + (make sequence + (if ($callout-area-match$ (node-list-first areanl) line col eol?) + ($callout-area-format$ (node-list-first areanl) line col eol?) + (empty-sosofo)) + (loop (node-list-rest areanl))))))) + +(define ($callout-area-match$ area line col eol?) + ;; Does AREA area match line col? + (let* ((coordlist (split (attribute-string (normalize "coords") area))) + (aline (string->number (car coordlist))) + (acol (if (null? (cdr coordlist)) + #f + (string->number (car (cdr coordlist))))) + (units (if (inherited-attribute-string (normalize "units") area) + (inherited-attribute-string (normalize "units") area) + (normalize "linecolumn")))) + (and (equal? units (normalize "linecolumn")) + (or + (and (equal? line aline) + (equal? col acol)) + (and (equal? line aline) + eol? + (or (not acol) (> acol col))))))) + +(define ($callout-area-format$ area line col eol?) + ;; Format AREA area at the appropriate place + (let* ((coordlist (split (attribute-string (normalize "coords") area))) + (aline (string->number (car coordlist))) + (acol (if (null? (cdr coordlist)) + #f + (string->number (car (cdr coordlist)))))) + (if (and (equal? line aline) + eol? + (or (not acol) (> acol col))) + (make sequence + (let loop ((atcol col)) + (if (>= atcol (if acol acol %callout-default-col%)) + (empty-sosofo) + (make sequence + (literal " ") + (loop (+ atcol 1))))) + ($callout-mark$ area #t)) + ($callout-mark$ area #t)))) + +(define ($callout-verbatim-display$ indent line-numbers?) + (let* ((content (make element gi: "PRE" + attributes: (list + (list "CLASS" (gi))) + ($callout-verbatim-content$ indent line-numbers?)))) + (if %shade-verbatim% + (make element gi: "TABLE" + attributes: ($shade-verbatim-attr$) + (make element gi: "TR" + (make element gi: "TD" + content))) + content))) + +(define ($callout-verbatim-content$ indent line-numbers?) + ;; Print linespecific content in a callout with line numbers + (make sequence + ($line-start$ indent line-numbers? 1) + (let loop ((kl (children (current-node))) + (linecount 1) + (colcount 1) + (res (empty-sosofo))) + (if (node-list-empty? kl) + (sosofo-append res + ($look-for-callout$ linecount colcount #t) + (empty-sosofo)) + (loop + (node-list-rest kl) + (if (char=? (node-property 'char (node-list-first kl) + default: #\U-0000) #\U-000D) + (+ linecount 1) + linecount) + (if (char=? (node-property 'char (node-list-first kl) + default: #\U-0000) #\U-000D) + 1 + (if (char=? (node-property 'char (node-list-first kl) + default: #\U-0000) #\U-0000) + colcount + (+ colcount 1))) + (let ((c (node-list-first kl))) + (if (char=? (node-property 'char c default: #\U-0000) + #\U-000D) + (sosofo-append res + ($look-for-callout$ linecount colcount #t) + (process-node-list c) + ($line-start$ indent + line-numbers? + (+ linecount 1))) + (sosofo-append res + ($look-for-callout$ linecount colcount) + (process-node-list c))))))))) + +;; EOF dbcallout.dsl + diff --git a/html/dbchunk.dsl b/html/dbchunk.dsl new file mode 100644 index 0000000..3321569 --- /dev/null +++ b/html/dbchunk.dsl @@ -0,0 +1,492 @@ +;; $Id: dbchunk.dsl,v 1.1 2001/04/02 21:40:27 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +(define (chunk-element-list) + (list (normalize "preface") + (normalize "chapter") + (normalize "appendix") + (normalize "article") + (normalize "glossary") + (normalize "bibliography") + (normalize "index") + (normalize "colophon") + (normalize "setindex") + (normalize "reference") + (normalize "refentry") + (normalize "part") + (normalize "sect1") + (normalize "section") + (normalize "book") ;; just in case nothing else matches... + (normalize "set") ;; sets are definitely chunks... + )) + +(define (chunk-skip-first-element-list) + (list (normalize "sect1") + (normalize "section"))) + +(define (chunk-section-depth) + 1) + +(define (section-element-depth #!optional (section (current-node))) + (if (node-list-empty? section) + 0 + (if (equal? (gi section) (normalize "section")) + (length (hierarchical-number-recursive + (normalize "section") + section)) + (section-element-depth (parent section))))) + +(define (is-first-element nd) + (equal? (child-number nd) 1)) + +(define (combined-chunk? #!optional (nd (current-node))) + (or + ;; if it's a section and the parent element is also a section + ;; and its depth is less than or equal to chunk-section-depth + (and (equal? (gi nd) (normalize "section")) + (not (node-list-empty? (parent nd))) + (equal? (gi (parent nd)) (normalize "section")) + (>= (section-element-depth nd) (chunk-section-depth))) + ;; if it's the first skipped chunk in a chunk + (and (not (node-list-empty? nd)) + (member (gi nd) (chunk-element-list)) + (is-first-element nd) + (member (gi nd) (chunk-skip-first-element-list))) + ;; or if it's a chunk in a partintro + (and (member (gi nd) (chunk-element-list)) + (has-ancestor-member? nd (list (normalize "partintro")))))) + +(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 or article. + ;; 5. And except for sections, which are only chunks if they + ;; are not too deep + ;; + (let* ((notchunk (or (and (equal? (gi nd) (normalize "bibliography")) + (not (or (equal? (gi (parent nd)) (normalize "book")) + (equal? (gi (parent nd)) (normalize "article"))))) + (and (equal? (gi nd) (normalize "section")) + (equal? (gi (parent nd)) (normalize "section")) + (>= (section-element-depth nd) + (chunk-section-depth))))) + (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)) + (if (combined-chunk? nd) + #f + maybechunk) + #f))))) + +(define (html-prefix nd) + (let ((dbhtml-prefix (inherited-dbhtml-value nd "prefix"))) + (if dbhtml-prefix + dbhtml-prefix + %html-prefix%))) + +(define (id-based-filename nd) + (if (and %use-id-as-filename% + (attribute-string (normalize "id") nd)) + (case-fold-down (attribute-string (normalize "id") nd)) + #f)) + +(define (book-html-base nd) + (let ((number (number->string (all-element-number nd))) + ;(number (pad-string (number->string 3) 2 "0")) + (prefix (html-prefix nd)) + (pibase (or + (inherited-dbhtml-value nd "basename") + (inherited-pi-value nd "html-basename"))) + (idbase (id-based-filename nd))) + (if idbase + (string-append (if prefix prefix "") idbase) + (string-append (if prefix prefix "") + (if pibase pibase "book") number)))) + +(define (division-html-base nd) + (let* ((number (number->string (all-element-number nd))) + (prefix (html-prefix nd)) + (pibase (or + (inherited-dbhtml-value nd "basename") + (inherited-pi-value nd "html-basename"))) + (idbase (id-based-filename nd)) + (base (cond (pibase pibase) + (idbase idbase) + ((equal? (gi nd) (normalize "set")) "s") + ((equal? (gi nd) (normalize "preface")) "f") + ((equal? (gi nd) (normalize "chapter")) "c") + ((equal? (gi nd) (normalize "article")) "t") + ((equal? (gi nd) (normalize "appendix")) "a") + ((equal? (gi nd) (normalize "part")) "p") + ((equal? (gi nd) (normalize "reference")) "r") + ((equal? (gi nd) (normalize "glossary")) "g") + ((equal? (gi nd) (normalize "bibliography")) "b") + ((equal? (gi nd) (normalize "index")) "i") + ((equal? (gi nd) (normalize "setindex")) "n") + ((equal? (gi nd) (normalize "refentry")) "r") + ;; "x" is section + (else "z")))) + (if idbase + (string-append (if prefix prefix "") idbase) + (if pibase + (string-append (if prefix prefix "") pibase number) + (string-append (if prefix prefix "") base number))))) + +(define (component-html-base nd) + (division-html-base nd)) + +(define (section-html-base nd) + ;; Now that I'm using all-element-number, there's no point in basing + ;; it off the component-html-base at all... + (let* ((number (number->string (all-element-number nd))) + (prefix (html-prefix nd)) + (pibase (or + (inherited-dbhtml-value nd "basename") + (inherited-pi-value nd "html-basename"))) + (idbase (id-based-filename nd)) + (base (if pibase + (string-append (if prefix prefix "") pibase) + (string-append (if prefix prefix "") "x")))) + (if idbase + (string-append (if prefix prefix "") idbase) + (if (chunk? nd) + (string-append base number) + base)))) + +(define (element-html-base nd) + (let* ((number (number->string (all-element-number nd))) + (prefix (html-prefix nd)) + (pibase (or + (inherited-dbhtml-value nd "basename") + (inherited-pi-value nd "html-basename"))) + (idbase (id-based-filename nd)) + (base (if pibase + (string-append (if prefix prefix "") pibase) + (string-append (if prefix prefix "") + (case-fold-down (gi nd)))))) + (if idbase + (string-append (if prefix prefix "") idbase) + (string-append base number)))) + +;; Returns the filename of the html file that contains elemnode, without +;; any leading path information +(define (html-base-filename #!optional (input_nd (current-node))) + (let* ((nd (chunk-parent input_nd)) + (base (cond ((member (gi nd) (book-element-list)) + (book-html-base nd)) + ((member (gi nd) (division-element-list)) + (division-html-base nd)) + ((member (gi nd) (component-element-list)) + (component-html-base nd)) + ((member (gi nd) (section-element-list)) + (section-html-base nd)) + (else (element-html-base input_nd)))) + ;; If this chunk-level element isn't a chunk, get the pifile from + ;; the parent element. + (pifile (if (chunk? nd) + (or + (dbhtml-value nd "filename") + (pi-value nd "html-filename")) + (or + (dbhtml-value (parent nd) "filename") + (pi-value (parent nd) "html-filename")))) + (language (if %html-use-lang-in-filename% + (if (inherited-attribute-string (normalize "lang") nd) + (inherited-attribute-string (normalize "lang") nd) + %default-language%) + "")) + (ext (if %html-use-lang-in-filename% + (string-append "." language %html-ext%) + %html-ext%))) + (if (and %root-filename% (node-list=? (sgml-root-element) nd)) + (string-append %root-filename% ext) + (if pifile + pifile + (string-append base ext))))) + +(define (root-rel-path filename #!optional (node (current-node))) + ;; Return the filename relative to the root path + (string-append (copy-string "../" (directory-depth (html-file node))) + filename)) + +;; Returns the filename of the html file that contains elemnode +;; +(define (html-file #!optional (input_nd (current-node))) + (let* ((cp-nd (chunk-parent input_nd)) + ;; If the sgml-root-element is at a level below the chunking + ;; level, then cp-nd will return an empty-node-list. In this + ;; case, we want to return the root-element. + (nd (if (node-list-empty? cp-nd) + (sgml-root-element) + cp-nd)) + (base-filename (html-base-filename nd)) + (pidir (or + (inherited-dbhtml-value nd "dir") + (inherited-pi-value nd "html-dir")))) + (if (and %root-filename% (node-list=? (sgml-root-element) nd)) + base-filename + (if pidir + (string-append pidir "/" base-filename) + base-filename)))) + +(define (href-to target) + ;; Return the HTML HREF for the given node. If nochunks is true, just + ;; return the fragment identifier. + (let* ((id (element-id target)) + (curdepth (directory-depth (html-file (current-node)))) + (entfile (html-file target)) + (fragid (if (chunk? target) + "" + (string-append "#" id)))) + (if nochunks + fragid + (string-append (copy-string "../" curdepth) entfile fragid)))) + +(define (html-entity-file htmlfilename) + ;; Returns the filename that should be used for _writing_ htmlfilename. + ;; This may differ from the filename used in referencing it. (The point + ;; is that you can force the stylesheets to write the chunked files + ;; somewhere else, if you want.) + (let* ((pi-outputdir (dbhtml-value (sgml-root-element) "output-dir")) + (outputdir (if pi-outputdir + pi-outputdir + %output-dir%))) + (if (and use-output-dir outputdir) + (string-append outputdir "/" htmlfilename) + htmlfilename))) + +;; Split node list nl at nd; return '(nodes-prev-to-nd nodes-following-nd) +;; Note that nd does not appear in either return list. +(define (split-node-list nd nodelist) + (let loop ((prev (empty-node-list)) + (nl nodelist)) + (if (node-list-empty? nl) + (list prev (empty-node-list)) + (if (node-list=? (node-list-first nl) nd) + (list prev (node-list-rest nl)) + (loop (node-list prev (node-list-first nl)) + (node-list-rest nl)))))) + +(define (navigate-to? nd) + #t) + +(define (chunk-parent #!optional (nd (current-node))) + (let ((cp (let loop ((p (chunk-level-parent nd))) + (if (or (node-list-empty? p) (chunk? p)) + p + (chunk-parent (parent p)))))) + cp)) +; (if (node-list-empty? cp) +; ;; if there's no chunk-parent, return the root node +; (sgml-root-element) +; ;; otherwise, return the parent that we found +; cp))) + +(define (chunk-level-parent #!optional (nd (current-node))) + (ancestor-member nd (chunk-element-list))) + +(define (chunk-children #!optional (nd (current-node))) + (node-list-filter-by-gi (children nd) (chunk-element-list))) + +(define (ifollow-by-gi nd gilist) + (let loop ((next (ifollow nd))) + (if (node-list-empty? next) + (empty-node-list) + (if (member (gi next) gilist) + next + (loop (ifollow next)))))) + +(define (ipreced-by-gi nd gilist) + (let loop ((prev (ipreced nd))) + (if (node-list-empty? prev) + (empty-node-list) + (if (member (gi prev) gilist) + prev + (loop (ipreced prev)))))) + +(define (last-chunk-element nd) + (let ((clc (node-list-filter-by-gi (children nd) (chunk-element-list)))) + (if (node-list-empty? clc) + nd + (last-chunk-element (node-list-last clc))))) + +(define (next-chunk-skip-children #!optional (elem (current-node))) + (let* ((nd (chunk-level-parent elem)) + (psl (node-list-filter-by-gi (children (parent nd)) + (chunk-element-list))) + (nextlist (car (cdr (split-node-list nd psl))))) + (if (node-list-empty? nextlist) + (if (node-list-empty? (parent nd)) + (empty-node-list) + (next-chunk-skip-children (parent nd))) + (node-list-first nextlist)))) + +(define (next-chunk-with-children #!optional (elem (current-node))) + (let* ((nd (chunk-level-parent elem)) + (clc (chunk-children nd)) + (ns (ifollow-by-gi nd (chunk-element-list)))) + (if (node-list-empty? clc) + (if (node-list-empty? ns) + (next-chunk-skip-children (parent nd)) + (node-list-first ns)) + ;; If the first of the chunk-children (clc) of this element + ;; isn't its own chunk, skip over it, otherwise it's next. + (if (chunk? (node-list-first clc)) + (node-list-first clc) + (next-chunk-with-children (node-list-first clc)))))) +;; (if (> (node-list-length clc) 1) +;; (node-list-first (node-list-rest clc)) +;; (next-chunk-skip-children nd)))))) + +(define (abs-prev-chunk #!optional (elem (current-node))) + (let* ((nd (chunk-parent elem)) + (pse (ipreced-by-gi nd (chunk-element-list))) + (ps (chunk-parent pse))) + (if (node-list-empty? ps) + (parent nd) + (last-chunk-element ps)))) + +(define (prev-chunk-element #!optional (elem (current-node))) + (let* ((nd (chunk-parent elem)) + (prev (chunk-parent (abs-prev-chunk nd)))) + ;; There's a special case here. abs-prev-chunk always returns the last + ;; chunk element of the preceding element if we walk up the tree. This + ;; assures that the last section of the preceding chapter is the "prev" + ;; element of the current chapter. + ;; + ;; However, if chunk-skip-first-element is in use, then abs-prev-chunk + ;; gets fooled when it tries to find the element that precedes the + ;; second child element that's in chunk-skip-first-element list. + ;; + ;; For example, if SECT1 is in chunk-skip-first-element then the + ;; chunk that precedes the second SECT1 in a CHAPTER is the CHAPTER + ;; (not the first SECT1 because the first SECT1 is "skipped", + ;; it's in the CHAPTER chunk). Confused yet? + ;; + ;; Ok, now unfortunately, what abs-prev-chunk returns is the last child + ;; of the CHAPTER, so instead of going from the second SECT1 to the + ;; CHAPTER, we go from the second SECT1 to the last SECT1 of the CHAPTER. + ;; + ;; I can't think of a good way to handle this except to test for it + ;; right up front. I wonder if all this skip stuff was really worth it? + ;; + (if (and (member (gi elem) (chunk-skip-first-element-list)) + (equal? (child-number elem) 2)) + ;; this is the second child, the prev node is the parent. + (parent elem) + ;; otherwise, do the "normal" thing to find it: + (if (node-list-empty? prev) + prev + (if (combined-chunk? prev) + (parent prev) + (if (and (chunk? nd) + (chunk? prev) + (navigate-to? prev)) + prev + (prev-chunk-element prev))))))) + +(define (abs-prev-peer-chunk-element #!optional (elem (current-node))) + ;; Returns the previous element that is a sibling or parent of the + ;; current element. Absolute in this case refers to the fact that + ;; it returns the immediate predecessor without regard for whether or + ;; not it is a chunk. + (let* ((psibling (if (node-list-empty? (preced elem)) + (empty-node-list) + (node-list-last (preced elem))))) + (if (node-list-empty? psibling) + (parent elem) + psibling))) + +(define (prev-peer-chunk-element #!optional (elem (current-node))) + (let loop ((nd (chunk-level-parent elem))) + (if (node-list-empty? nd) + (empty-node-list) + (if (and (chunk? (abs-prev-peer-chunk-element nd)) + (navigate-to? (abs-prev-peer-chunk-element nd))) + (abs-prev-peer-chunk-element nd) + (loop (abs-prev-peer-chunk-element nd)))))) + +(define (prev-major-component-chunk-element #!optional (elem (current-node)) (in-chain #f)) + ;; Return the prev major component of the document that is a sibling (or + ;; ancestor) of the starting element. This is essentially 'prev-sibling' + ;; but skips over things that aren't chunks. + (if (or (navigate-to? elem) in-chain) + (if (member (gi elem) (major-component-element-list)) + (if (node-list-empty? (node-list-last-element (preced elem))) + (prev-chunk-element elem) + (let ((nd (node-list-last-element (preced elem)))) + (if (navigate-to? nd) + nd + (prev-major-component-chunk-element nd #t)))) + (ancestor-member elem (major-component-element-list))) + (empty-node-list))) + +(define (abs-next-chunk #!optional (elem (current-node)) (children-ok? #t)) + (let* ((nd (chunk-level-parent elem)) + (clc (if children-ok? (chunk-children nd) (empty-node-list))) + (ns (ifollow-by-gi nd (chunk-element-list)))) + (if (node-list-empty? clc) + (if (node-list-empty? ns) + (if (node-list-empty? (parent nd)) + (empty-node-list) + (abs-next-chunk (parent nd) #f)) + (node-list-first ns)) + (node-list-first clc)))) + +(define (next-chunk-element #!optional (elem (current-node))) + (let ((next (abs-next-chunk elem))) + (if (node-list-empty? next) + (empty-node-list) + (if (chunk? next) + (if (navigate-to? next) + next + (next-chunk-element next)) + (next-chunk-element next))))) + +(define (abs-next-peer-chunk-element #!optional (elem (current-node))) + (let* ((fsibling (if (node-list-empty? (follow elem)) + (empty-node-list) + (node-list-first (follow elem))))) + (if (node-list-empty? fsibling) + (if (node-list-empty? (parent elem)) + (empty-node-list) + (abs-next-peer-chunk-element (parent elem))) + fsibling))) + +(define (next-peer-chunk-element #!optional (elem (current-node))) + (let loop ((nd (chunk-level-parent elem))) + (if (node-list-empty? nd) + (empty-node-list) + (if (and (chunk? (abs-next-peer-chunk-element nd)) + (navigate-to? (abs-next-peer-chunk-element nd))) + (abs-next-peer-chunk-element nd) + (loop (abs-next-peer-chunk-element nd)))))) + +(define (next-major-component-chunk-element #!optional (elem (current-node)) (in-chain #f)) + ;; Return the next major component of the document that is not a descendant + ;; of the starting element. This is essentially 'next-sibling' but skips + ;; over things that aren't chunks. + (if (or (navigate-to? elem) in-chain) + (if (member (gi elem) (major-component-element-list)) + (if (node-list-empty? (node-list-first-element (follow elem))) + (next-major-component-chunk-element (parent elem)) + (let ((nd (node-list-first-element (follow elem)))) + (if (navigate-to? nd) + nd + (next-major-component-chunk-element nd #t)))) + (ancestor-member elem (major-component-element-list))) + (empty-node-list))) + +;; EOF dbchunk.dsl \ No newline at end of file diff --git a/html/dbcompon.dsl b/html/dbcompon.dsl new file mode 100644 index 0000000..250726d --- /dev/null +++ b/html/dbcompon.dsl @@ -0,0 +1,199 @@ +;; $Id: dbcompon.dsl,v 1.8 2003/04/29 05:49:21 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ============================= COMPONENTS ============================= +;; +;; in docbook, components are containers at the chapter/appendix level + +(define ($component$) + (html-document + (with-mode head-title-mode + (literal (element-title-string (current-node)))) + ($component-body$))) + +(define ($component-separator$) + (if (or (not nochunks) (node-list=? (current-node) (sgml-root-element))) + (empty-sosofo) + (make empty-element gi: "HR"))) + +(define ($component-body$) + (let* ((epigraph (let loop ((nl (children (current-node)))) + (if (node-list-empty? nl) + nl + (let ((first-gi (gi (node-list-first nl)))) + (if (equal? first-gi (normalize "epigraph")) + (node-list-first nl) + (if (or (equal? first-gi (normalize "title")) + (equal? first-gi (normalize "subtitle")) + (equal? first-gi (normalize "titleabbrev")) + (equal? first-gi (normalize "docinfo")) + (equal? first-gi (normalize "chapterinfo")) + (equal? first-gi (normalize "appendixinfo"))) + (loop (node-list-rest nl)) + (loop (empty-node-list)))))))) + (notepigraph (let loop ((nl (children (current-node))) + (ch (empty-node-list))) + (if (node-list-empty? nl) + ch + (if (node-list=? (node-list-first nl) epigraph) + (loop (node-list-rest nl) ch) + (loop (node-list-rest nl) + (node-list ch (node-list-first nl)))))))) + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + ($component-separator$) + ($component-title$) + (process-node-list epigraph) + (if ($generate-chapter-toc$) + ($chapter-toc$) + (empty-sosofo)) + (process-node-list notepigraph)))) + +(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 (gentext-element-name-space (gi)) + (element-label (current-node)) + (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))))))) + +(define ($chapter-toc$) + ;; Called by the TITLE element so that it can come after the TITLE + (build-toc (ancestor-member (current-node) (component-element-list)) + (toc-depth + (ancestor-member (current-node) (component-element-list))) + #t)) + +(element appendix ($component$)) +(element (appendix title) (empty-sosofo)) + +(element chapter ($component$)) +(element (chapter title) (empty-sosofo)) + +(element preface ($component$)) +(element (preface title) (empty-sosofo)) + +;; Dedication is empty except in a special mode so that it can be +;; reordered (made to come before the TOCs)...see dbttlpg.dsl +;; Dedication is empty except in a special mode so that it can be +;; reordered (made to come before the TOCs) + +(element dedication (empty-sosofo)) + +(mode dedication-page-mode + (element dedication + (html-document + (with-mode head-title-mode + (literal (element-title-string (current-node)))) + (make sequence + ($component-separator$) + ($component-title$) + (process-children)))) + (element (dedication title) (empty-sosofo)) +) + +(element colophon ($component$)) + +;; Articles are like components, except that if they may have much +;; more formal title pages (created with article-titlepage). +;; +(element article + (let* ((info (node-list-filter-by-gi (children (current-node)) + (list (normalize "artheader") + (normalize "articleinfo")))) + (ititle (select-elements (children info) (normalize "title"))) + (title (if (node-list-empty? ititle) + (select-elements (children (current-node)) + (normalize "title")) + (node-list-first ititle))) + (tsosofo (with-mode head-title-mode + (process-node-list title))) + (nl (titlepage-info-elements (current-node) info))) + (html-document + tsosofo + (make element gi: "DIV" + attributes: '(("CLASS" "ARTICLE")) + (if %generate-article-titlepage% + (make sequence + (article-titlepage nl 'recto) + (article-titlepage nl 'verso)) + ($component-title$)) + + (if (not (generate-toc-in-front)) + (process-children) + (empty-sosofo)) + + (if %generate-article-toc% + (make sequence + (build-toc (current-node) + (toc-depth (current-node)))) + (empty-sosofo)) + + (let loop ((gilist ($generate-article-lot-list$))) + (if (null? gilist) + (empty-sosofo) + (if (not (node-list-empty? + (select-elements (descendants (current-node)) + (car gilist)))) + (make sequence + (build-lot (current-node) (car gilist)) + (loop (cdr gilist))) + (loop (cdr gilist))))) + + (if (generate-toc-in-front) + (process-children) + (empty-sosofo)))))) + +(element (article title) (empty-sosofo)) + +(element (article appendix) ($section$)) ;; this is a special case diff --git a/html/dbdivis.dsl b/html/dbdivis.dsl new file mode 100644 index 0000000..9d622b8 --- /dev/null +++ b/html/dbdivis.dsl @@ -0,0 +1,176 @@ +;; $Id: dbdivis.dsl,v 1.4 2003/01/15 08:24:13 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ============================= DIVISIONS ============================== + +(element set + (let* ((setinfo (select-elements (children (current-node)) (normalize "setinfo"))) + (ititle (select-elements (children setinfo) (normalize "title"))) + (title (if (node-list-empty? ititle) + (select-elements (children (current-node)) (normalize "title")) + (node-list-first ititle))) + (nl (titlepage-info-elements (current-node) setinfo)) + (tsosofo (with-mode head-title-mode + (process-node-list title)))) + (html-document + tsosofo + (make element gi: "DIV" + attributes: '(("CLASS" "SET")) + + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + + (if %generate-set-titlepage% + (make sequence + (set-titlepage nl 'recto) + (set-titlepage nl 'verso)) + (empty-sosofo)) + + (if (not (generate-toc-in-front)) + (process-children) + (empty-sosofo)) + + (if %generate-set-toc% + (make sequence + (build-toc (current-node) (toc-depth (current-node)))) + (empty-sosofo)) + + (if (generate-toc-in-front) + (process-children) + (empty-sosofo)))))) + +(element (set title) (empty-sosofo)) + +(element book + (let* ((bookinfo (select-elements (children (current-node)) (normalize "bookinfo"))) + (ititle (select-elements (children bookinfo) (normalize "title"))) + (title (if (node-list-empty? ititle) + (select-elements (children (current-node)) (normalize "title")) + (node-list-first ititle))) + (nl (titlepage-info-elements (current-node) bookinfo)) + (tsosofo (with-mode head-title-mode + (process-node-list title))) + (dedication (select-elements (children (current-node)) (normalize "dedication")))) + (html-document + tsosofo + (make element gi: "DIV" + attributes: '(("CLASS" "BOOK")) + + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + + (if %generate-book-titlepage% + (make sequence + (book-titlepage nl 'recto) + (book-titlepage nl 'verso)) + (empty-sosofo)) + + (if (node-list-empty? dedication) + (empty-sosofo) + (with-mode dedication-page-mode + (process-node-list dedication))) + + (if (not (generate-toc-in-front)) + (process-children) + (empty-sosofo)) + + (if %generate-book-toc% + (build-toc (current-node) (toc-depth (current-node))) + (empty-sosofo)) + + (let loop ((gilist ($generate-book-lot-list$))) + (if (null? gilist) + (empty-sosofo) + (if (not (node-list-empty? + (select-elements (descendants (current-node)) + (car gilist)))) + (make sequence + (build-lot (current-node) (car gilist)) + (loop (cdr gilist))) + (loop (cdr gilist))))) + + + (if (generate-toc-in-front) + (process-children) + (empty-sosofo)))))) + +(element (book title) (empty-sosofo)) + +(element part + (let* ((partinfo (select-elements (children (current-node)) + (normalize "docinfo"))) + (partintro (select-elements (children (current-node)) + (normalize "partintro"))) + (nl (titlepage-info-elements + (current-node) + partinfo + (if %generate-partintro-on-titlepage% + partintro + (empty-node-list)))) + (ititle (select-elements (children partinfo) (normalize "title"))) + (title (if (node-list-empty? ititle) + (select-elements (children (current-node)) (normalize "title")) + (node-list-first ititle))) + (tsosofo (with-mode head-title-mode + (process-node-list title)))) + (html-document + tsosofo + (make element gi: "DIV" + attributes: '(("CLASS" "PART")) + + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + + (if %generate-part-titlepage% + (make sequence + (part-titlepage nl 'recto) + (part-titlepage nl 'verso)) + (empty-sosofo)) + + (if (not (generate-toc-in-front)) + (process-children) + (empty-sosofo)) + + (if (and (not (node-list-empty? partintro)) + (not %generate-partintro-on-titlepage%)) + ($process-partintro$ partintro) + (empty-sosofo)) + + (if (and %generate-part-toc% + (not %generate-part-toc-on-titlepage%)) + (make sequence + (build-toc (current-node) + (toc-depth (current-node)))) + (empty-sosofo)) + + (if (generate-toc-in-front) + (process-children) + (empty-sosofo)))))) + +(element (part title) (empty-sosofo)) + +(element partintro (empty-sosofo)) + +(element (partintro title) + (make element gi: "H1" + (process-children))) + +(element (partintro sect1) + ($section-body$)) + +(define ($process-partintro$ partintro) + (make element gi: "DIV" + attributes: (list (list "CLASS" "PARTINTRO")) + + (make element gi: "A" + attributes: (list (list "NAME" (element-id partintro))) + (empty-sosofo)) + + (process-node-list (children partintro)) + (make-endnotes partintro))) diff --git a/html/dbefsyn.dsl b/html/dbefsyn.dsl new file mode 100644 index 0000000..c737003 --- /dev/null +++ b/html/dbefsyn.dsl @@ -0,0 +1,824 @@ +;; $Id: dbefsyn.dsl,v 1.4 2003/01/15 08:24:13 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ============================ CLASS SYNOPSIS ============================= + +(define %indent-classsynopsisinfo-lines% #f) +(define %number-classsynopsisinfo-lines% #f) + +(define %default-classsynopsis-language% "java") + +(element classsynopsis + (let ((language (if (attribute-string (normalize "language")) + (attribute-string (normalize "language")) + %default-classsynopsis-language%))) + (case language + (("java") (with-mode cs-java-mode + (process-node-list (current-node)))) + (("perl") (with-mode cs-perl-mode + (process-node-list (current-node)))) + (("idl") (with-mode cs-idl-mode + (process-node-list (current-node)))) + (("cpp") (with-mode cs-cpp-mode + (process-node-list (current-node)))) + (("python") (with-mode cs-python-mode + (process-node-list (current-node)))) + (else (with-mode cs-java-mode + (process-node-list (current-node))))))) + +(element methodsynopsis + (let ((language (if (attribute-string (normalize "language")) + (attribute-string (normalize "language")) + %default-classsynopsis-language%))) + (case language + (("java") (with-mode cs-java-mode + (process-node-list (current-node)))) + (("perl") (with-mode cs-perl-mode + (process-node-list (current-node)))) + (("idl") (with-mode cs-idl-mode + (process-node-list (current-node)))) + (("cpp") (with-mode cs-cpp-mode + (process-node-list (current-node)))) + (("python") (with-mode cs-python-mode + (process-node-list (current-node)))) + (else (with-mode cs-java-mode + (process-node-list (current-node))))))) + +(element fieldsynopsis + (let ((language (if (attribute-string (normalize "language")) + (attribute-string (normalize "language")) + %default-classsynopsis-language%))) + (case language + (("java") (with-mode cs-java-mode + (process-node-list (current-node)))) + (("perl") (with-mode cs-perl-mode + (process-node-list (current-node)))) + (("idl") (with-mode cs-idl-mode + (process-node-list (current-node)))) + (("cpp") (with-mode cs-cpp-mode + (process-node-list (current-node)))) + (("python") (with-mode cs-python-mode + (process-node-list (current-node)))) + (else (with-mode cs-java-mode + (process-node-list (current-node))))))) + +(element constructorsynopsis + (let ((language (if (attribute-string (normalize "language")) + (attribute-string (normalize "language")) + %default-classsynopsis-language%))) + (case language + (("java") (with-mode cs-java-mode + (process-node-list (current-node)))) + (("perl") (with-mode cs-perl-mode + (process-node-list (current-node)))) + (("idl") (with-mode cs-idl-mode + (process-node-list (current-node)))) + (("cpp") (with-mode cs-cpp-mode + (process-node-list (current-node)))) + (("python") (with-mode cs-python-mode + (process-node-list (current-node)))) + (else (with-mode cs-java-mode + (process-node-list (current-node))))))) + +(element destructorsynopsis + (let ((language (if (attribute-string (normalize "language")) + (attribute-string (normalize "language")) + %default-classsynopsis-language%))) + (case language + (("java") (with-mode cs-java-mode + (process-node-list (current-node)))) + (("perl") (with-mode cs-perl-mode + (process-node-list (current-node)))) + (("idl") (with-mode cs-idl-mode + (process-node-list (current-node)))) + (("cpp") (with-mode cs-cpp-mode + (process-node-list (current-node)))) + (("python") (with-mode cs-python-mode + (process-node-list (current-node)))) + (else (with-mode cs-java-mode + (process-node-list (current-node))))))) + +;; ===== Java ======================================================== + +(mode cs-java-mode + +(element classsynopsis + (let* ((classes (select-elements (children (current-node)) + (normalize "ooclass"))) + (classname (node-list-first classes)) + (superclasses (node-list-rest classes))) + (make element gi: "pre" + attributes: '(("class" "classsynopsis")) + (process-node-list classname) + (process-node-list superclasses) + (literal "{&#RE;") + (process-node-list + (node-list-filter-by-gi + (children (current-node)) + (list (normalize "constructorsynopsis") + (normalize "destructorsynopsis") + (normalize "fieldsynopsis") + (normalize "methodsynopsis") + (normalize "classsynopsisinfo")))) + (literal "}")))) + +(element classsynopsisinfo + ($verbatim-display$ %indent-classsynopsisinfo-lines% + %number-classsynopsisinfo-lines%)) + +(element ooclass + (make sequence + (if (first-sibling?) + (literal " ") + (literal ", ")) + (make element gi: "SPAN" + attributes: '(("class" "ooclass")) + (process-children)))) + +(element oointerface + (make sequence + (if (first-sibling?) + (literal " ") + (literal ", ")) + (make element gi: "SPAN" + attributes: '(("class" "oointerface")) + (process-children)))) + +(element ooexception + (make sequence + (if (first-sibling?) + (literal " ") + (literal ", ")) + (make element gi: "SPAN" + attributes: '(("class" "ooexception")) + (process-children)))) + +(element modifier + (make element gi: "span" + attributes: '(("class" "modifier")) + (process-children) + (literal " "))) + +(element classname + (if (first-sibling?) + (make sequence + (literal "class ") + (make element gi: "span" + attributes: '(("class" "classname")) + (process-children) + (literal " ")) + (if (last-sibling?) + (empty-sosofo) + (literal "extends "))) + (make sequence + (make element gi: "span" + attributes: '(("class" "superclass")) + (process-children)) + (if (last-sibling?) + (literal " ") + (literal ", "))))) + +(element fieldsynopsis + (make element gi: "code" + attributes: '(("class" "fieldsynopsis")) + (literal " ") + (process-children) + (literal ";&#RE;"))) + +(element type + (make element gi: "span" + attributes: '(("class" "type")) + (process-children) + (literal " "))) + +(element varname + (make element gi: "span" + attributes: '(("class" "varname")) + (process-children))) + +(element initializer + (make element gi: "span" + attributes: '(("class" "initializer")) + (literal " = ") + (process-children))) + +(element constructorsynopsis + (java-method-synopsis)) + +(element destructorsynopsis + (java-method-synopsis)) + +(element methodsynopsis + (java-method-synopsis)) + +(element void + (make element gi: "span" + attributes: '(("class" "void")) + (literal "void "))) + +(element methodname + (process-children)) + +(element methodparam + (make element gi: "span" + attributes: '(("class" "methodparam")) + (if (first-sibling?) + (empty-sosofo) + (literal ", ")) + (process-children))) + +(element parameter + (make element gi: "span" + attributes: '(("class" "parameter")) + (process-children))) + +(element exceptionname + (make element gi: "span" + attributes: '(("class" "exceptionname")) + (if (first-sibling?) + (literal "&#RE; throws ") + (literal ", ")) + (process-children))) +) + +(define (java-method-synopsis #!optional (nd (current-node))) + (let* ((modifiers (select-elements (children nd) + (normalize "modifier"))) + (notmod (node-list-filter-by-not-gi + (children nd) + (list (normalize "modifier")))) + (type (if (equal? (gi (node-list-first notmod)) + (normalize "methodname")) + (empty-node-list) + (node-list-first notmod))) + (methodname (select-elements (children nd) + (normalize "methodname"))) + (param (node-list-filter-by-gi (node-list-rest notmod) + (list (normalize "methodparam")))) + (excep (select-elements (children nd) + (normalize "exceptionname")))) + (make element gi: "code" + attributes: (list (list "class" (gi nd))) + (if (first-sibling?) + (literal "&#RE;") + (empty-sosofo)) + (literal " ") + (process-node-list modifiers) + (process-node-list type) + (process-node-list methodname) + (literal "(") + (process-node-list param) + (literal ")") + (process-node-list excep) + (literal ";&#RE;")))) + +;; ===== C++ ========================================================= + +(mode cs-cpp-mode + +(element classsynopsis + (let* ((classes (node-list-filter-by-gi (children (current-node)) + (list (normalize "classname") + (normalize "modifier")))) + (classname (let loop ((nl classes) (cn (empty-node-list))) + (if (node-list-empty? nl) + cn + (if (equal? (gi (node-list-first nl)) + (normalize "classname")) + (node-list cn (node-list-first nl)) + (loop (node-list-rest nl) + (node-list cn (node-list-first nl))))))) + + (superclasses (let loop ((nl classes)) + (if (node-list-empty? nl) + (empty-node-list) + (if (equal? (gi (node-list-first nl)) + (normalize "classname")) + (node-list-rest nl) + (loop (node-list-rest nl))))))) + (make element gi: "pre" + attributes: '(("class" "classsynopsis")) + (process-node-list classname) + (process-node-list superclasses) + (literal "{&#RE;") + (process-node-list + (node-list-filter-by-gi + (children (current-node)) + (list (normalize "constructorsynopsis") + (normalize "destructorsynopsis") + (normalize "fieldsynopsis") + (normalize "methodsynopsis") + (normalize "classsynopsisinfo")))) + (literal "}")))) + +(element classsynopsisinfo + ($verbatim-display$ %indent-classsynopsisinfo-lines% + %number-classsynopsisinfo-lines%)) + +(element modifier + (make element gi: "span" + attributes: '(("class" "modifier")) + (process-children) + (literal " "))) + +(element classname + (if (first-sibling?) + (make sequence + (literal "class ") + (make element gi: "span" + attributes: '(("class" "classname")) + (process-children)) + (if (last-sibling?) + (empty-sosofo) + (literal ": "))) + (make sequence + (make element gi: "span" + attributes: '(("class" "superclass")) + (process-children)) + (if (last-sibling?) + (literal " ") + (literal ", "))))) + +(element fieldsynopsis + (make element gi: "code" + attributes: '(("class" "fieldsynopsis")) + (literal " ") + (process-children) + (literal ";&#RE;"))) + +(element type + (make element gi: "span" + attributes: '(("class" "type")) + (process-children) + (literal " "))) + +(element varname + (make element gi: "span" + attributes: '(("class" "varname")) + (process-children))) + +(element initializer + (make element gi: "span" + attributes: '(("class" "initializer")) + (literal " = ") + (process-children))) + +(element constructorsynopsis + (cpp-method-synopsis)) + +(element destructorsynopsis + (cpp-method-synopsis)) + +(element methodsynopsis + (cpp-method-synopsis)) + +(element void + (make element gi: "span" + attributes: '(("class" "void")) + (literal "void "))) + +(element methodname + (process-children)) + +(element methodparam + (make element gi: "span" + attributes: '(("class" "methodparam")) + (if (first-sibling?) + (empty-sosofo) + (literal ", ")) + (process-children))) + +(element parameter + (make element gi: "span" + attributes: '(("class" "parameter")) + (process-children))) + +(element exceptionname + (make element gi: "span" + attributes: '(("class" "exceptionname")) + (if (first-sibling?) + (literal "&#RE; throws ") + (literal ", ")) + (process-children))) +) + +(define (cpp-method-synopsis #!optional (nd (current-node))) + (let* ((modifiers (select-elements (children nd) + (normalize "modifier"))) + (notmod (node-list-filter-by-not-gi + (children nd) + (list (normalize "modifier")))) + (type (if (equal? (gi (node-list-first notmod)) + (normalize "methodname")) + (empty-node-list) + (node-list-first notmod))) + (methodname (select-elements (children nd) + (normalize "methodname"))) + (param (node-list-filter-by-gi (node-list-rest notmod) + (list (normalize "methodparam")))) + (excep (select-elements (children nd) + (normalize "exceptionname")))) + (make element gi: "code" + attributes: (list (list "class" (gi nd))) + (if (first-sibling?) + (literal "&#RE;") + (empty-sosofo)) + (literal " ") + (process-node-list modifiers) + (process-node-list type) + (process-node-list methodname) + (literal "(") + (process-node-list param) + (literal ")") + (process-node-list excep) + (literal ";&#RE;")))) + +;; ===== Perl ======================================================== + +(mode cs-perl-mode + +(element classsynopsis + (let* ((modifiers (select-elements (children (current-node)) + (normalize "modifier"))) + (classes (select-elements (children (current-node)) + (normalize "classname"))) + (classname (node-list-first classes)) + (superclasses (node-list-rest classes))) + (make element gi: "pre" + attributes: '(("class" "classsynopsis")) + (literal "package ") + (process-node-list classname) + (literal ";&#RE;") + (if (node-list-empty? superclasses) + (empty-sosofo) + (make sequence + (literal "@ISA = ("); + (process-node-list superclasses) + (literal ";&#RE;"))) + (process-node-list + (node-list-filter-by-gi + (children (current-node)) + (list (normalize "constructorsynopsis") + (normalize "destructorsynopsis") + (normalize "fieldsynopsis") + (normalize "methodsynopsis") + (normalize "classsynopsisinfo"))))))) + +(element classsynopsisinfo + ($verbatim-display$ %indent-classsynopsisinfo-lines% + %number-classsynopsisinfo-lines%)) + +(element modifier + (literal "Perl ClassSynopses don't use Modifiers")) + +(element classname + (if (first-sibling?) + (make element gi: "span" + attributes: '(("class" "classname")) + (process-children)) + (make sequence + (make element gi: "span" + attributes: '(("class" "superclass")) + (process-children)) + (if (last-sibling?) + (empty-sosofo) + (literal ", "))))) + +(element fieldsynopsis + (make element gi: "code" + attributes: '(("class" "fieldsynopsis")) + (literal " "); + (process-children) + (literal ";&#RE;"))) + +(element type + (make element gi: "span" + attributes: '(("class" "type")) + (process-children) + (literal " "))) + +(element varname + (make element gi: "span" + attributes: '(("class" "varname")) + (process-children))) + +(element initializer + (make element gi: "span" + attributes: '(("class" "initializer")) + (literal " = ") + (process-children) + (literal " "))) + +(element constructorsynopsis + (perl-method-synopsis)) + +(element destructorsynopsis + (perl-method-synopsis)) + +(element methodsynopsis + (perl-method-synopsis)) + +(element void + (empty-sosofo)) + +(element methodname + (make element gi: "span" + attributes: '(("class" "methodname")) + (process-children))) + +(element methodparam + (make element gi: "span" + attributes: '(("class" "methodparam")) + (if (first-sibling?) + (empty-sosofo) + (literal ", ")) + (process-children))) + +(element parameter + (make element gi: "span" + attributes: '(("class" "parameter")) + (process-children))) + +(element exceptionname + (literal "Perl ClassSynopses don't use Exceptions")) + +) + +(define (perl-method-synopsis #!optional (nd (current-node))) + (let* ((modifiers (select-elements (children nd) + (normalize "modifier"))) + (notmod (node-list-filter-by-not-gi + (children nd) + (list (normalize "modifier")))) + (type (if (equal? (gi (node-list-first notmod)) + (normalize "methodname")) + (empty-node-list) + (node-list-first notmod))) + (methodname (select-elements (children nd) + (normalize "methodname"))) + (param (node-list-filter-by-gi (node-list-rest notmod) + (list (normalize "type") + (normalize "void")))) + (excep (select-elements (children nd) + (normalize "exceptionname")))) + (make element gi: "code" + attributes: (list (list "class" (gi nd))) + (literal "sub ") + (process-node-list modifiers) + (process-node-list type) + (process-node-list methodname) + (literal " { ... }")))) + +;; ===== IDL ========================================================= + +(mode cs-idl-mode + +(element classsynopsis + (let* ((modifiers (select-elements (children (current-node)) + (normalize "modifier"))) + (classes (select-elements (children (current-node)) + (normalize "classname"))) + (classname (node-list-first classes)) + (superclasses (node-list-rest classes))) + (make element gi: "pre" + attributes: '(("class" "classsynopsis")) + (literal "interface ") + (process-node-list modifiers) + (process-node-list classname) + (if (node-list-empty? superclasses) + (literal " ") + (make sequence + (literal " : ") + (process-node-list superclasses))) + (literal " {&#RE;") + (process-node-list + (node-list-filter-by-gi + (children (current-node)) + (list (normalize "constructorsynopsis") + (normalize "destructorsynopsis") + (normalize "fieldsynopsis") + (normalize "methodsynopsis") + (normalize "classsynopsisinfo")))) + (literal "}")))) + +(element classsynopsisinfo + ($verbatim-display$ %indent-classsynopsisinfo-lines% + %number-classsynopsisinfo-lines%)) + +(element modifier + (make element gi: "span" + attributes: '(("class" "modifier")) + (process-children) + (literal " "))) + +(element classname + (if (first-sibling?) + (make element gi: "span" + attributes: '(("class" "classname")) + (process-children)) + (make sequence + (make element gi: "span" + attributes: '(("class" "superclass")) + (process-children)) + (if (last-sibling?) + (empty-sosofo) + (literal ", "))))) + +(element fieldsynopsis + (make element gi: "code" + attributes: '(("class" "fieldsynopsis")) + (literal " "); + (process-children) + (literal ";&#RE;"))) + +(element type + (make element gi: "span" + attributes: '(("class" "type")) + (process-children) + (literal " "))) + +(element varname + (make element gi: "span" + attributes: '(("class" "varname")) + (process-children))) + +(element initializer + (make element gi: "span" + attributes: '(("class" "initializer")) + (literal " = ") + (process-children) + (literal " "))) + +(element constructorsynopsis + (idl-method-synopsis)) + +(element destructorsynopsis + (idl-method-synopsis)) + +(element methodsynopsis + (idl-method-synopsis)) + +(element void + (make element gi: "span" + attributes: '(("class" "void")) + (literal "void "))) + +(element methodname + (make element gi: "span" + attributes: '(("class" "methodname")) + (process-children))) + +(element methodparam + (make element gi: "span" + attributes: '(("class" "methodparam")) + (if (first-sibling?) + (empty-sosofo) + (literal ", ")) + (process-children))) + +(element parameter + (make element gi: "span" + attributes: '(("class" "parameter")) + (process-children))) + +(element exceptionname + (make element gi: "span" + attributes: '(("class" "exceptionname")) + (if (first-sibling?) + (literal " raises(") + (literal ", ")) + (process-children) + (if (last-sibling?) + (literal ")") + (empty-sosofo)))) +) + +(define (idl-method-synopsis #!optional (nd (current-node))) + (let* ((modifiers (select-elements (children nd) + (normalize "modifier"))) + (notmod (node-list-filter-by-not-gi + (children nd) + (list (normalize "modifier")))) + (type (if (equal? (gi (node-list-first notmod)) + (normalize "methodname")) + (empty-node-list) + (node-list-first notmod))) + (methodname (select-elements (children nd) + (normalize "methodname"))) + (param (node-list-filter-by-gi (node-list-rest notmod) + (list (normalize "methodparam")))) + (excep (select-elements (children nd) + (normalize "exceptionname")))) + (make element gi: "code" + attributes: (list (list "class" (gi nd))) + (literal " ") + (process-node-list modifiers) + (process-node-list type) + (process-node-list methodname) + (literal "(") + (process-node-list param) + (literal ")") + (process-node-list excep) + (literal ";&#RE;")))) + +;; ===== Python ======================================================= +;; Contributed by Lane Stevens, lane@cycletime.com + +(mode cs-python-mode + (element classsynopsis + (let* ((classes (select-elements (children (current-node)) + (normalize "ooclass"))) + (classname (node-list-first classes)) + (superclasses (node-list-rest classes))) + (make element gi: "pre" + attributes: '(("class" "classsynopsis")) + (literal "class ") + (process-node-list classname) + (literal "(") + (process-node-list superclasses) + (literal ") :") + (process-node-list + (node-list-filter-by-gi + (children (current-node)) + (list (normalize "constructorsynopsis") + (normalize "destructorsynopsis") + (normalize "fieldsynopsis") + (normalize "methodsynopsis") + (normalize "classsynopsisinfo")))) + ) + ) + ) + + (element ooclass + (make sequence + (make element gi: "SPAN" + attributes: '(("class" "ooclass")) + (process-children) + (cond + ((first-sibling?) (literal " ")) + ((last-sibling?) (empty-sosofo)) + (#t (literal ", ")) + ) + ) + ) + ) + + (element classname + (if (first-sibling?) + (make element gi: "SPAN" + attributes: '(("class" "classname")) + (process-children)) + (make element gi: "SPAN" + attributes: '(("class" "superclass"))) + ) + ) + + (element methodsynopsis + (python-method-synopsis)) + + (element initializer + (make element gi: "SPAN" + attributes: '(("class" "initializer")) + (literal " = ") + (process-children))) + + (element methodname + (process-children)) + + (element methodparam + (make element gi: "SPAN" + attributes: '(("class" "methodparam")) + (process-children) + (if (last-sibling?) + (empty-sosofo) + (literal ", ")) + ) + ) + + + (element parameter + (make element gi: "SPAN" + attributes: '(("class" "parameter")) + (process-children))) + + + ) + +(define (python-method-synopsis #!optional (nd (current-node))) + (let* ((the-method-name (select-elements (children nd) (normalize "methodname"))) + (the-method-params (select-elements (children nd) (normalize "methodparam")))) + (make element gi: "code" + attributes: (list (list "class" (gi nd))) + (literal " def ") + (process-node-list the-method-name) + (literal "(") + (process-node-list the-method-params) + (literal ") :") + ) + ) + ) + +;; EOF diff --git a/html/dbfootn.dsl b/html/dbfootn.dsl new file mode 100644 index 0000000..cd4ad06 --- /dev/null +++ b/html/dbfootn.dsl @@ -0,0 +1,249 @@ +;; $Id: dbfootn.dsl,v 1.4 2003/01/15 08:24:13 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ====================================================================== +;; Handle footnotes in body text + +(element footnote ;; A footnote inserts a reference to itself + (let ((id (if (attribute-string (normalize "id")) + (attribute-string (normalize "id")) + (generate-anchor)))) + (make element gi: "A" + attributes: (list + (list "NAME" id) + (list "HREF" (string-append "#FTN." id))) + ($footnote-literal$ (current-node))))) + +(element footnoteref + (let* ((target (element-with-id (attribute-string (normalize "linkend")))) + (id (if (attribute-string (normalize "id") target) + (attribute-string (normalize "id") target) + (generate-anchor target))) + (curdepth (directory-depth (html-file (current-node)))) + (entfile (html-file target)) + ;; can't use (href-to) here because we tinker with the fragid + (href (if nochunks + (string-append "#FTN." id) + (string-append (copy-string "../" curdepth) + entfile "#FTN." id)))) + (make element gi: "A" + attributes: (list + (list "HREF" href)) + ($footnote-literal$ target)))) + +(define (count-footnote? footnote) + ;; don't count footnotes in comments (unless you're showing comments) + ;; or footnotes in tables which are handled locally in the table + (if (or (and (has-ancestor-member? footnote (list (normalize "comment"))) + (not %show-comments%)) + (has-ancestor-member? footnote (list (normalize "tgroup")))) + #f + #t)) + +(define ($chunk-footnote-number$ footnote) + ;; This is more complex than it at first appears because footnotes + ;; can be in Comments which may be suppressed. + (let* ((footnotes (select-elements + (descendants (chunk-parent footnote)) + (normalize "footnote")))) + (let loop ((nl footnotes) (num 1)) + (if (node-list-empty? nl) + 0 + (if (node-list=? (node-list-first nl) footnote) + num + (if (count-footnote? (node-list-first nl)) + (loop (node-list-rest nl) (+ num 1)) + (loop (node-list-rest nl) num))))))) + +(define ($footnote-literal$ node) + (make element gi: "SPAN" + attributes: (list + (list "CLASS" "footnote")) + (literal + (string-append + "[" ($footnote-number$ node) "]")))) + +(define ($table-footnote-number$ footnote) + (let* ((chunk (ancestor (normalize "tgroup") footnote)) + (footnotes (select-elements (descendants chunk) (normalize "footnote")))) + (let loop ((nl footnotes) (num 1)) + (if (node-list-empty? nl) + 0 + (if (node-list=? footnote (node-list-first nl)) + num + (loop (node-list-rest nl) + (+ num 1))))))) + +(define ($footnote-number$ footnote) + (if (node-list-empty? (ancestor (normalize "tgroup") footnote)) + (format-number ($chunk-footnote-number$ footnote) "1") + (format-number ($table-footnote-number$ footnote) "a"))) + +(mode footnote-mode + (element footnote + (process-children)) + + (element (footnote para) + (let ((id (if (attribute-string (normalize "id") (parent (current-node))) + (attribute-string (normalize "id") (parent (current-node))) + (generate-anchor (parent (current-node)))))) + (make element gi: "P" + (if (= (child-number) 1) + (make sequence + (make element gi: "A" + attributes: (list + (list "NAME" (string-append "FTN." id)) + (list "HREF" (href-to (parent (current-node))))) + ($footnote-literal$ (parent (current-node)))) + (literal " ")) + (literal "")) + (process-children)))) +) + +(define (non-table-footnotes footnotenl) + (let loop ((nl footnotenl) (result (empty-node-list))) + (if (node-list-empty? nl) + result + (if (has-ancestor-member? (node-list-first nl) + (list (normalize "tgroup"))) + (loop (node-list-rest nl) + result) + (loop (node-list-rest nl) + (node-list result (node-list-first nl))))))) + +(define (make-endnotes #!optional (node (current-node))) + (if %footnotes-at-end% + (let* ((allfootnotes (select-elements (descendants node) + (normalize "footnote"))) + (allntfootnotes (non-table-footnotes allfootnotes)) + (this-chunk (chunk-parent node)) + (chunkfootnotes (let loop ((fn allntfootnotes) + (chunkfn (empty-node-list))) + (if (node-list-empty? fn) + chunkfn + (if (node-list=? this-chunk + (chunk-parent + (node-list-first fn))) + (loop (node-list-rest fn) + (node-list chunkfn + (node-list-first fn))) + (loop (node-list-rest fn) + chunkfn))))) + (footnotes (let loop ((nl chunkfootnotes) + (fnlist (empty-node-list))) + (if (node-list-empty? nl) + fnlist + (if (count-footnote? (node-list-first nl)) + (loop (node-list-rest nl) + (node-list fnlist + (node-list-first nl))) + (loop (node-list-rest nl) + fnlist)))))) + (if (node-list-empty? footnotes) + (empty-sosofo) + (if (and #f + ;; there was a time when make-endnotes was called in + ;; more places, and this code prevented footnotes from + ;; being output more than once. now that it's only + ;; called in footer-navigation, this code isn't necessary + ;; and does the wrong thing if -V nochunks is specified. + (or (equal? (gi node) (normalize "reference")) + (equal? (gi node) (normalize "part")) + (equal? (gi node) (normalize "set")) + (equal? (gi node) (normalize "book")))) + (empty-sosofo) ;; Each RefEntry/Component does its own... + (make sequence + (make-endnote-header) + (make element gi: "TABLE" + attributes: '(("BORDER" "0") + ("CLASS" "FOOTNOTES") + ("WIDTH" "100%")) + (with-mode endnote-mode + (process-node-list footnotes))))))) + (empty-sosofo))) + +(define (make-endnote-header) + (let ((headsize (if (equal? (gi) (normalize "refentry")) "H2" "H3"))) + (make element gi: headsize + attributes: '(("CLASS" "FOOTNOTES")) + (literal (gentext-endnotes))))) + +(mode endnote-mode + (element footnote + (let ((id (if (attribute-string (normalize "id") (current-node)) + (attribute-string (normalize "id") (current-node)) + (generate-anchor (current-node))))) + (make sequence + (make element gi: "TR" + (make element gi: "TD" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("WIDTH" "5%")) + (make element gi: "A" + attributes: (list + (list "NAME" (string-append "FTN." id)) + (list "HREF" (href-to (current-node)))) + ($footnote-literal$ (current-node)))) + (make element gi: "TD" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("WIDTH" "95%")) + (process-children)))))) +) + +;; ====================================================================== +;; Handle table footnotes + +(define (table-footnote-number footnote) + (format-number (component-child-number footnote + (list (normalize "table") + (normalize "informaltable"))) + "a")) + +(element (entry para footnote) + (make element gi: "SUP" + (literal (table-footnote-number (current-node))))) + +(define (make-table-endnote-header) + (make sequence + (literal (gentext-table-endnotes)) + (make empty-element gi: "BR"))) + +(define (make-table-endnotes) + (let* ((footnotes (select-elements (descendants (current-node)) + (normalize "footnote"))) + (tgroup (ancestor-member (current-node) (list (normalize "tgroup")))) + (cols (string->number (attribute-string (normalize "cols") tgroup)))) + (if (node-list-empty? footnotes) + (empty-sosofo) + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "COLSPAN" (number->string cols))) + (make-table-endnote-header) + (with-mode table-footnote-mode + (process-node-list footnotes))))))) + +(mode table-footnote-mode + (element footnote + (process-children)) + + (element (footnote para) + (let* ((target (parent (current-node))) + (fnnum (table-footnote-number target)) + (idstr (if (attribute-string (normalize "id") target) + (attribute-string (normalize "id") target) + (generate-anchor target)))) + (make sequence + (if (= (child-number) 1) + (make element gi: "A" + attributes: (list (list "NAME" (string-append "FTN." idstr))) + (literal fnnum + (gentext-label-title-sep (normalize "footnote")))) + (empty-sosofo)) + (process-children) + (make empty-element gi: "BR"))))) + diff --git a/html/dbgloss.dsl b/html/dbgloss.dsl new file mode 100644 index 0000000..3e83a20 --- /dev/null +++ b/html/dbgloss.dsl @@ -0,0 +1,193 @@ +;; $Id: dbgloss.dsl,v 1.4 2003/01/15 08:24:13 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ========================= GLOSSARY ELEMENTS ========================== + +;; HACK ALERT! There is no top-level wrapper around one or more GLOSSENTRYs, +;; so this code has to look around and output the right thing for the +;; front matter and then the GLOSSENTRYs. Ugh. + +(define ($glossary-frontmatter$) + (let loop ((nl (children (current-node))) (headlist (empty-node-list))) + (if (node-list-empty? nl) + headlist + (if (equal? (gi (node-list-first nl)) (normalize "glossentry")) + headlist + (loop (node-list-rest nl) (node-list + headlist + (node-list-first nl))))))) + +(define ($glossary-glossentrys$) + (let loop ((nl (children (current-node))) (gelist (empty-node-list))) + (if (node-list-empty? nl) + gelist + (loop (node-list-rest nl) + (if (equal? (gi (node-list-first nl)) (normalize "glossentry")) + (node-list gelist (node-list-first nl)) + gelist))))) + +(define ($glossary-body$) + (make element gi: "DIV" + attributes: '(("CLASS" "GLOSSARY")) + ($component-title$) + (process-node-list ($glossary-frontmatter$)) + (if (not (node-list-empty? ($glossary-glossentrys$))) + (make element gi: "DL" + (process-node-list ($glossary-glossentrys$))) + (empty-sosofo)))) + +(element glossary + (html-document (with-mode head-title-mode + (literal (element-title-string (current-node)))) + ($glossary-body$))) + +(element (glossary title) (empty-sosofo)) + +(element glossdiv + (make element gi: "DIV" + attributes: (list + (list "CLASS" (gi))) + ($section-title$) + (process-node-list ($glossary-frontmatter$)) + (if (not (node-list-empty? ($glossary-glossentrys$))) + (make element gi: "DL" + (process-node-list ($glossary-glossentrys$))) + (empty-sosofo)))) + +(element (glossdiv title) (empty-sosofo)) + +(element glosslist + (make element gi: "DIV" + attributes: (list + (list "CLASS" (gi))) + (make element gi: "DL" + (process-children)))) + +(element glossentry (process-children)) + +(element (glossentry glossterm) + (let ((id (attribute-string (normalize "id") (parent (current-node))))) + (make element gi: "DT" + (if id + (make sequence + (make element gi: "A" + attributes: (list + (list "NAME" id)) + (empty-sosofo)) + (make element gi: "B" + (process-children))) + (make element gi: "B" + (process-children)))))) + +(element (glossentry acronym) + (make sequence + (literal " (") + (process-children) + (literal ")"))) + +(element (glossentry abbrev) (empty-sosofo)) + +(element (glossentry glossdef) + (make element gi: "DD" + (process-children))) + +(element (glossterm revhistory) + (empty-sosofo)) + +(element (glossentry glosssee) + (make element gi: "DD" + (if (attribute-string (normalize "otherterm")) + (make element gi: "P" + (make element gi: "EM" + (literal (gentext-element-name (gi)) + (gentext-label-title-sep (gi)))) + (make element gi: "A" + attributes: (list (list "HREF" + (link-target + (attribute-string + (normalize "otherterm"))))) + (with-mode otherterm + (process-element-with-id + (attribute-string (normalize "otherterm")))))) + (process-children)))) + +;; When we hit the first GLOSSSEEALSO, process all of them as a node-list +(element glossseealso + (if (first-sibling?) + (make element gi: "P" + (make sequence + (make element gi: "EM" + (literal (gentext-element-name (gi)) + (gentext-label-title-sep (gi)))) + (with-mode glossseealso + (process-node-list + (select-elements (children (parent)) '(glossseealso)))) + (literal "."))) + (empty-sosofo))) + +(mode glossseealso + (element glossseealso + (make sequence + (if (first-sibling?) + (empty-sosofo) + (make element gi: "EM" + (literal ", "))) + (if (attribute-string (normalize "otherterm")) ;; but this should be required... + (make element gi: "A" + attributes: (list (list "HREF" + (link-target + (attribute-string + (normalize "otherterm"))))) + (with-mode otherterm + (process-element-with-id + (attribute-string (normalize "otherterm"))))) + (process-children))))) + +;; This is referenced within the GLOSSSEE and GLOSSSEEALSO element +;; construction expressions. The OTHERTERM attributes on GLOSSSEE and +;; GLOSSSEEALSO (should) refer to GLOSSENTRY elements but we're only +;; interested in the text within the GLOSSTERM. Discard the revision +;; history and the definition from the referenced term. +(mode otherterm + (element glossterm + (process-children)) + (element glossdef + (empty-sosofo)) + (element revhistory + (empty-sosofo)) + (element glosssee + (empty-sosofo)) + (element (glossentry acronym) + (empty-sosofo)) + (element (glossentry abbrev) + (empty-sosofo))) + +;; an inline gloss term +(element glossterm + (let* ((linkend (attribute-string (normalize "linkend")))) + (if linkend + (make element gi: "A" + attributes: (list (list "HREF" (href-to (element-with-id + linkend)))) + ($italic-seq$)) + ($italic-seq$)))) + +;; a first glossterm +(element firstterm + (let* ((linkend (attribute-string (normalize "linkend"))) + (sosofo (if linkend + (make element gi: "A" + attributes: (list (list "HREF" + (href-to + (element-with-id + linkend)))) + ($italic-seq$)) + ($italic-seq$)))) + (if firstterm-bold + (make element gi: "B" + sosofo) + sosofo))) + diff --git a/html/dbgraph.dsl b/html/dbgraph.dsl new file mode 100644 index 0000000..d3c0371 --- /dev/null +++ b/html/dbgraph.dsl @@ -0,0 +1,218 @@ +;; $Id: dbgraph.dsl,v 1.6 2003/03/25 19:53:40 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ==================== GRAPHICS ==================== + +(define (graphic-file filename) + (let ((ext (file-extension filename))) + (if (or (not filename) + (not %graphic-default-extension%) + (member ext %graphic-extensions%)) + filename + (string-append filename "." %graphic-default-extension%)))) + +(define (graphic-attrs imagefile instance-alt) + (let* ((grove (sgml-parse image-library-filename)) + (imagelib (node-property 'document-element + (node-property 'grove-root grove))) + (images (select-elements (children imagelib) "image")) + (image (let loop ((imglist images)) + (if (node-list-empty? imglist) + #f + (if (equal? (attribute-string + "filename" + (node-list-first imglist)) + imagefile) + (node-list-first imglist) + (loop (node-list-rest imglist)))))) + (prop (if image + (select-elements (children image) "properties") + #f)) + (metas (if prop + (select-elements (children prop) "meta") + #f)) + (attrs (if metas + (let loop ((meta metas) (attrlist '())) + (if (node-list-empty? meta) + attrlist + (if (equal? (attribute-string + "imgattr" + (node-list-first meta)) + "yes") + (loop (node-list-rest meta) + (append attrlist + (list + (list + (attribute-string + "name" + (node-list-first meta)) + (attribute-string + "content" + (node-list-first meta)))))) + (loop (node-list-rest meta) attrlist)))) + '())) + (width (if prop (attribute-string "width" prop) #f)) + (height (if prop (attribute-string "height" prop) #f)) + (alttext (if image + (select-elements (children image) "alttext") + (empty-node-list))) + (alt (if instance-alt + instance-alt + (if (node-list-empty? alttext) + #f + (data alttext))))) + (if (or width height alt (not (null? attrs))) + (append + attrs + (if width (list (list "WIDTH" width)) '()) + (if height (list (list "HEIGHT" height)) '()) + (if (not (node-list-empty? alttext)) (list (list "ALT" alt)) '())) + '()))) + +(define ($graphic$ fileref + #!optional (format #f) (alt #f) (align #f) (width #f) (height #f)) + (let ((img-attr (append + (list (list "SRC" (graphic-file fileref))) + (if align (list (list "ALIGN" align)) '()) + (if width (list (list "WIDTH" width)) '()) + (if height (list (list "HEIGHT" height)) '()) + (if image-library (graphic-attrs fileref alt) '())))) + (make empty-element gi: "IMG" + attributes: img-attr))) + +(define ($img$ #!optional (nd (current-node)) (alt #f)) + ;; This function now supports an extension to DocBook. It's + ;; either a clever trick or an ugly hack, depending on your + ;; point of view, but it'll hold us until XLink is finalized + ;; and we can extend DocBook the "right" way. + ;; + ;; If the entity passed to GRAPHIC has the FORMAT + ;; "LINESPECIFIC", either because that's what's specified or + ;; because it's the notation of the supplied ENTITYREF, then + ;; the text of the entity is inserted literally (via Jade's + ;; read-entity external procedure). + ;; + (let* ((fileref (attribute-string (normalize "fileref") nd)) + (entityref (attribute-string (normalize "entityref") nd)) + (format (if (attribute-string (normalize "format") nd) + (attribute-string (normalize "format") nd) + (if entityref + (entity-notation entityref) + #f))) + (align (attribute-string (normalize "align") nd)) + (width (attribute-string (normalize "width") nd)) + (height (attribute-string (normalize "depth") nd))) + (if (or fileref entityref) + (if (equal? format (normalize "linespecific")) + (if fileref + (include-file fileref) + (include-file (entity-generated-system-id entityref))) + (if fileref + ($graphic$ fileref format alt align width height) + ($graphic$ (system-id-filename entityref) + format alt align width height))) + (empty-sosofo)))) + +(element graphic + (make element gi: "P" + ($img$))) + +(element inlinegraphic + ($img$)) + +;; ====================================================================== +;; MediaObject and friends... + +(define preferred-mediaobject-notations + (list "JPG" "JPEG" "PNG" "linespecific")) + +(define preferred-mediaobject-extensions + (list "jpeg" "jpg" "png" "avi" "mpg" "mpeg" "qt")) + +(define acceptable-mediaobject-notations + (list "GIF" "GIF87a" "GIF89a" "BMP" "WMF")) + +(define acceptable-mediaobject-extensions + (list "gif" "bmp" "wmf")) + +(element mediaobject + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "P" + ($mediaobject$)))) + +(element inlinemediaobject + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + ($mediaobject$))) + +(element mediaobjectco + (process-children)) + +(element imageobjectco + (process-children)) + +(element objectinfo + (empty-sosofo)) + +(element videoobject + (process-children)) + +(element videodata + (let ((filename (data-filename (current-node)))) + (make element gi: "EMBED" + attributes: (list (list "SRC" filename))))) + +(element audioobject + (process-children)) + +(element audiodata + (let ((filename (data-filename (current-node)))) + (make element gi: "EMBED" + attributes: (list (list "SRC" filename))))) + +(element imageobject + (process-children)) + +(element imagedata + (let* ((filename (data-filename (current-node))) + (mediaobj (parent (parent (current-node)))) + (textobjs (select-elements (children mediaobj) + (normalize "textobject"))) + (alttext (let loop ((nl textobjs) (alttext #f)) + (if (or alttext (node-list-empty? nl)) + alttext + (let ((phrase (select-elements + (children + (node-list-first nl)) + (normalize "phrase")))) + (if (node-list-empty? phrase) + (loop (node-list-rest nl) #f) + (loop (node-list-rest nl) + (data (node-list-first phrase)))))))) + (fileref (attribute-string (normalize "fileref"))) + (entityref (attribute-string (normalize "entityref"))) + (format (if (attribute-string (normalize "format")) + (attribute-string (normalize "format")) + (if entityref + (entity-notation entityref) + #f)))) + (if (equal? format (normalize "linespecific")) + (if fileref + (include-file fileref) + (include-file (entity-generated-system-id entityref))) + ($img$ (current-node) alttext)))) + +(element textobject + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + +(element caption + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + diff --git a/html/dbhtml.dsl b/html/dbhtml.dsl new file mode 100644 index 0000000..e23f56b --- /dev/null +++ b/html/dbhtml.dsl @@ -0,0 +1,446 @@ +;; $Id: dbhtml.dsl,v 1.5 2004/10/10 11:55:10 petere78 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ====================================================================== +;; HTML Linking... +;; + +(define (element-id #!optional (nd (current-node))) + ;; IDs of TITLEs are the IDs of the PARENTs + (let ((elem (if (equal? (gi nd) + (normalize "title")) + (parent nd) + nd))) + (if (attribute-string (normalize "id") elem) + (attribute-string (normalize "id") elem) + (generate-anchor elem)))) + +(define (link-target idstring) + ;; Return the HTML HREF for the given idstring. For RefEntrys, this is + ;; just the name of the file, for anything else it's the name of the file + ;; with the fragment identifier for the specified id. + (href-to (element-with-id idstring))) + +(define (generate-anchor #!optional (nd (current-node))) + (string-append "AEN" (number->string (all-element-number nd)))) + +(define (generate-xptr #!optional (nd (current-node))) + ;; returns the location of the current node in a modified xptr + ;; syntax. This used to be used to calculate unique anchor names + ;; in the HTML document. all-element-number seems like a better + ;; way to go...so this function is probably never called anymore. + (let loop ((suffix "") + (nd nd)) + (let ((eid (id nd))) + (if eid + (string-append "I(" + eid + ")" + (if (= (string-length suffix) 0) + "" + (string-append "C" + suffix))) + (let ((par (parent nd))) + (if (not (node-list-empty? par)) + (loop (string-append "(" + (number->string (child-number nd)) + "," + (gi nd) + ")" + suffix) + par) + (string-append (if (= (string-length suffix) 0) + "R" + "R,C") + suffix))))))) + +;; ====================================================================== +;; HTML output +;; + +(define (html-document title-sosofo body-sosofo) + (let* (;; Let's look these up once, so that we can avoid calculating + ;; them over and over again. + (prev (prev-chunk-element)) + (next (next-chunk-element)) + (prevm (prev-major-component-chunk-element)) + (nextm (next-major-component-chunk-element)) + (navlist (list prev next prevm nextm)) + + ;; Let's make it possible to control the output even in the + ;; nochunks case. Note: in the nochunks case, (chunk?) will + ;; return #t for only the root element. + (make-entity? (and (or (not nochunks) rootchunk) + (chunk?))) + + (make-head? (or make-entity? + (and nochunks + (node-list=? (current-node) + (sgml-root-element))))) + (doc-sosofo + (if make-head? + (make element gi: "HTML" + (make element gi: "HEAD" + (make element gi: "TITLE" title-sosofo) + ($standard-html-header$ prev next prevm nextm)) + (make element gi: "BODY" + attributes: (append + (list (list "CLASS" (gi))) + %body-attr%) + (header-navigation (current-node) navlist) + body-sosofo + (footer-navigation (current-node) navlist))) + body-sosofo))) + (if make-entity? + (make entity + system-id: (html-entity-file (html-file)) + (html-doctype) + doc-sosofo) + (if (node-list=? (current-node) (sgml-root-element)) + (make sequence + (html-doctype) + doc-sosofo) + doc-sosofo)))) + +(define (html-doctype) + (cond + ((and %html-pubid% %html-sysid%) + (make document-type + name: "HTML" + public-id: %html-pubid% + system-id: %html-sysid%)) + (%html-pubid% + (make document-type + name: "HTML" + public-id: %html-pubid%)) + (%html-sysid% + (make document-type + name: "HTML" + system-id: %html-sysid%)) + (else + (empty-sosofo)))) + +(define ($standard-html-header$ #!optional + (prev (prev-chunk-element)) + (next (next-chunk-element)) + (prevm (prev-major-component-chunk-element)) + (nextm (next-major-component-chunk-element))) + ;; A hook function to add additional tags to the HEAD of your HTML files + (let* ((info (info-element)) + (kws (select-elements (descendants info) (normalize "keyword"))) + (home (nav-home (current-node))) + (up (parent (current-node)))) + (make sequence + ;; Add the META NAME=GENERATOR tag + (make empty-element gi: "META" + attributes: (list (list "NAME" "GENERATOR") + (list "CONTENT" (stylesheet-version)))) + + ;; Add the LINK REV=MADE tag + (if %link-mailto-url% + (make empty-element gi: "LINK" + attributes: (list (list "REV" "MADE") + (list "HREF" %link-mailto-url%))) + (empty-sosofo)) + + ;; Add the LINK REL=HOME tag + (if (nav-home? (current-node)) + (make empty-element gi: "LINK" + attributes: (append '(("REL" "HOME")) + (if (equal? (element-title-string home) + "") + '() + (list + (list "TITLE" + (element-title-string home)))) + (list (list "HREF" (href-to home))))) + (empty-sosofo)) + + ;; Add the LINK REL=UP tag + (if (nav-up? (current-node)) + (if (or (node-list-empty? up) + (node-list=? up (sgml-root-element))) + (empty-sosofo) + (make empty-element gi: "LINK" + attributes: (append '(("REL" "UP")) + (if (equal? (element-title-string up) + "") + '() + (list + (list "TITLE" + (element-title-string up)))) + (list (list "HREF" (href-to up)))))) + (empty-sosofo)) + + ;; Add the LINK REL=PREVIOUS tag + (if (node-list-empty? prev) + (empty-sosofo) + (make empty-element gi: "LINK" + attributes: (append '(("REL" "PREVIOUS")) + (if (equal? (element-title-string prev) "") + '() + (list + (list "TITLE" + (element-title-string prev)))) + (list (list "HREF" (href-to prev)))))) + + ;; Add the LINK REL=NEXT tag + (if (node-list-empty? next) + (empty-sosofo) + (make empty-element gi: "LINK" + attributes: (append '(("REL" "NEXT")) + (if (equal? (element-title-string next) "") + '() + (list + (list "TITLE" + (element-title-string next)))) + (list (list "HREF" (href-to next)))))) + + ;; Add META NAME=KEYWORD tags + (let loop ((nl kws)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (make empty-element gi: "META" + attributes: (list (list "NAME" "KEYWORD") + (list "CONTENT" (data (node-list-first nl))))) + (loop (node-list-rest nl))))) + + ;; Add LINK REL=STYLESHEET tag + (if %stylesheet% + (make empty-element gi: "LINK" + attributes: (list (list "REL" "STYLESHEET") + (list "TYPE" %stylesheet-type%) + (list "HREF" %stylesheet%))) + (empty-sosofo)) + + ($user-html-header$ home up prev next)))) + +(define ($user-html-header$ #!optional + (home (empty-node-list)) + (up (empty-node-list)) + (prev (empty-node-list)) + (next (empty-node-list))) + ;; Add additional header tags. + (let loop ((tl %html-header-tags%)) + (if (null? tl) + (empty-sosofo) + (make sequence + (make empty-element gi: (car (car tl)) + attributes: (cdr (car tl))) + (loop (cdr tl)))))) + +(define ($html-body-start$) + (empty-sosofo)) + +(define ($html-body-content-start$) + (empty-sosofo)) + +(define ($html-body-content-end$) + (empty-sosofo)) + +(define ($html-body-end$) + (empty-sosofo)) + +(define (dingbat usrname) + ;; Print dingbats and other characters selected by name + (let ((name (case-fold-down usrname))) + (case name + ;; For backward compatibility + (("copyright") "(C)") + (("trademark") "TM") + + ;; Straight out of Unicode + (("ldquo") "\"") + (("rdquo") "\"") + (("lsquo") "'") + (("rsquo") "'") + (("ldquor") "\"") + (("rdquor") "\"") + (("raquo") ">>") + (("laquo") "<<") + (("rsaquo") ">") + (("lsaquo") "<") + (("nbsp") " ") + (("en-dash") "-") + (("em-dash") "--") + (("en-space") " ") + (("em-space") " ") + (("bullet") "*") + (("copyright-sign") "(C)") + (("registered-sign") "(R)") + (else + (let ((err (debug (string-append "No dingbat defined for: " name)))) + "*"))))) + +(define (dingbat-sosofo usrname) + ;; Print dingbats and other characters selected by name + (let ((name (case-fold-down usrname))) + (case name + ;; For backward compatibility + (("copyright") (make entity-ref name: "copy")) + (("trademark") (make entity-ref name: "trade")) + + ;; Straight out of Unicode + (("ldquo") (literal "\"")) + (("rdquo") (literal "\"")) + (("lsquo") "'") + (("rsquo") "'") + (("raquo") (literal "\"")) + (("laquo") (literal "\"")) + (("rsaquo") (literal "\"")) + (("lsaquo") (literal "\"")) + (("nbsp") (make entity-ref name: "nbsp")) + (("en-dash") (literal "-")) + (("em-dash") (literal "--")) + (("en-space") (make entity-ref name: "nbsp")) + (("em-space") (make sequence + (make entity-ref name: "nbsp") + (make entity-ref name: "nbsp"))) + (("bullet") (literal "*")) + (("copyright-sign") (make entity-ref name: "copy")) + (("registered-sign") (literal "(R)")) + (else + (let ((err (debug (string-append "No dingbat defined for: " name)))) + (literal "*")))))) + +(define (para-check #!optional (place 'stop)) + (let ((inpara (equal? (gi (parent (current-node))) (normalize "para")))) + (if (and %fix-para-wrappers% inpara) + (if (equal? place 'stop) + (make formatting-instruction data: "</P>") + (make formatting-instruction data: "<P>")) + (empty-sosofo)))) + +;; ====================================================================== +;; HTML element functions + +(define ($block-container$) + (make element gi: "DIV" + attributes: (list + (list "CLASS" (gi))) + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (process-children))) + +(define ($paragraph$ #!optional (para-wrapper "P")) + (let ((footnotes (select-elements (descendants (current-node)) + (normalize "footnote"))) + (tgroup (have-ancestor? (normalize "tgroup")))) + (make sequence + (make element gi: para-wrapper + attributes: (append + (if %default-quadding% + (list (list "ALIGN" %default-quadding%)) + '())) + (process-children)) + (if (or %footnotes-at-end% tgroup (node-list-empty? footnotes)) + (empty-sosofo) + (make element gi: "BLOCKQUOTE" + attributes: (list + (list "CLASS" "FOOTNOTES")) + (with-mode footnote-mode + (process-node-list footnotes))))))) + +(define ($indent-para-container$) + (make element gi: "BLOCKQUOTE" + attributes: (list + (list "CLASS" (gi))) + (process-children))) + +(define ($bold-seq$ #!optional (sosofo (process-children))) + (make element gi: "B" + attributes: (list + (list "CLASS" (gi))) + sosofo)) + +(define ($italic-seq$ #!optional (sosofo (process-children))) + (make element gi: "I" + attributes: (list + (list "CLASS" (gi))) + sosofo)) + +(define ($bold-italic-seq$ #!optional (sosofo (process-children))) + (make element gi: "B" + attributes: (list + (list "CLASS" (gi))) + (make element gi: "I" + sosofo))) + +(define ($mono-seq$ #!optional (sosofo (process-children))) + ;; please avoid using this, TT is presentational + (make element gi: "TT" + attributes: (list + (list "CLASS" (gi))) + sosofo)) + +(define ($code-seq$ #!optional (sosofo (process-children))) + ;; fragments of computer code + (make element gi: "CODE" + attributes: (list + (list "CLASS" (gi))) + sosofo)) + +(define ($samp-seq$ #!optional (sosofo (process-children))) + ;; sample output from programs, scripts, etc + (make element gi: "SAMP" + attributes: (list + (list "CLASS" (gi))) + sosofo)) + +(define ($kbd-seq$ #!optional (sosofo (process-children))) + ;; text to be entered by the user + (make element gi: "KBD" + attributes: (list + (list "CLASS" (gi))) + sosofo)) + +(define ($abbr-seq$ #!optional (sosofo (process-children))) + ;; abbreviated form + ;; FIXME: html4 only + (make element gi: "ABBR" + attributes: (list + (list "CLASS" (gi))) + sosofo)) + +(define ($acronym-seq$ #!optional (sosofo (process-children))) + ;; FIXME: html4 only + (make element gi: "ACRONYM" + attributes: (list + (list "CLASS" (gi))) + sosofo)) + +(define ($var-seq$ #!optional (sosofo (process-children))) + ;; variable or program argument + (make element gi: "VAR" + attributes: (list + (list "CLASS" (gi))) + sosofo)) + +(define ($italic-mono-seq$ #!optional (sosofo (process-children))) + (make element gi: "TT" + attributes: (list + (list "CLASS" (gi))) + (make element gi: "I" + sosofo))) + +(define ($bold-mono-seq$ #!optional (sosofo (process-children))) + (make element gi: "TT" + attributes: (list + (list "CLASS" (gi))) + (make element gi: "B" + sosofo))) + +(define ($charseq$ #!optional (sosofo (process-children))) + (make element gi: "SPAN" + attributes: (list + (list "CLASS" (gi))) + sosofo)) + +;; EOF dbhtml.dsl + + diff --git a/html/dbindex.dsl b/html/dbindex.dsl new file mode 100644 index 0000000..e73a1d5 --- /dev/null +++ b/html/dbindex.dsl @@ -0,0 +1,374 @@ +;; $Id: dbindex.dsl,v 1.5 2003/01/15 08:24:13 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ................... INDEX TERMS (EMBEDDED MARKERS) ................... + +(element indexterm + (if html-index + (let* ((id (if (attribute-string (normalize "id")) + (attribute-string (normalize "id")) + (generate-anchor)))) + (make element gi: "A" + attributes: (list (list "NAME" id)) + (empty-sosofo))) + (empty-sosofo))) + +(element primary (empty-sosofo)) +(element secondary (empty-sosofo)) +(element tertiary (empty-sosofo)) +(element see (empty-sosofo)) +(element seealso (empty-sosofo)) + +;; =========================== INDEX ELEMENTS =========================== + +(element (setindex title) (empty-sosofo)) +(element setindex + (let ((preamble (node-list-filter-by-not-gi + (children (current-node)) + (list (normalize "indexentry")))) + (entries (node-list-filter-by-gi + (children (current-node)) + (list (normalize "indexentry"))))) + (html-document + (with-mode head-title-mode + (literal (element-title-string (current-node)))) + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + ($component-separator$) + ($component-title$) + (process-node-list preamble) + (if (node-list-empty? entries) + (empty-sosofo) + (make element gi: "DL" + (process-node-list entries))))))) + +(element (index title) (empty-sosofo)) +(element index + (let ((preamble (node-list-filter-by-not-gi + (children (current-node)) + (list (normalize "indexentry")))) + (entries (node-list-filter-by-gi + (children (current-node)) + (list (normalize "indexentry"))))) + (html-document + (with-mode head-title-mode + (literal (element-title-string (current-node)))) + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + ($component-separator$) + ($component-title$) + (process-node-list preamble) + (if (node-list-empty? entries) + (empty-sosofo) + (make element gi: "DL" + (process-node-list entries))))))) + + +(element (indexdiv title) (empty-sosofo)) +(element indexdiv + (let ((preamble (node-list-filter-by-not-gi + (children (current-node)) + (list (normalize "indexentry")))) + (entries (node-list-filter-by-gi + (children (current-node)) + (list (normalize "indexentry"))))) + (html-document + (with-mode head-title-mode + (literal (element-title-string (current-node)))) + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + ($section-separator$) + ($section-title$) + (process-node-list preamble) + (if (node-list-empty? entries) + (empty-sosofo) + (make element gi: "DL" + (process-node-list entries))))))) + +(define (break-node-list nodes breakatgi) + ;; Given a _node_ list "PRIM SEC TERT SEC SEC TERT PRIM SEC PRIM PRIM" + ;; and the breakatgi of "PRIM", returns the _list_ of _node_ lists: + ;; '("PRIM SEC TERT SEC SEC TERT" "PRIM SEC" "PRIM" "PRIM") + (let loop ((nl nodes) (result '()) (curlist (empty-node-list))) + (if (node-list-empty? nl) + (if (node-list-empty? curlist) + result + (append result (list curlist))) + (if (equal? (gi (node-list-first nl)) breakatgi) + (loop (node-list-rest nl) + (if (node-list-empty? curlist) + result + (append result (list curlist))) + (node-list-first nl)) + (loop (node-list-rest nl) + result + (node-list curlist (node-list-first nl))))))) + +(define (process-primary primnode secnl) + (let ((see? (equal? (gi (node-list-first secnl)) + (normalize "seeie"))) + (seealso? (equal? (gi (node-list-first secnl)) + (normalize "seealsoie"))) + (second (break-node-list secnl (normalize "secondaryie")))) + (if (or see? seealso?) + (process-terminal primnode secnl #t) + (make sequence + (process-nonterminal primnode) + (if (node-list-empty? secnl) + (empty-sosofo) + (make element gi: "DD" + (make element gi: "DL" + (let sloop ((secs second)) + (if (null? secs) + (empty-sosofo) + (make sequence + (let* ((nodes (car secs)) + (sec (node-list-first nodes)) + (terts (node-list-rest nodes))) + (process-secondary sec terts)) + (sloop (cdr secs)))))))))))) + +(define (process-secondary secnode tertnl) + (let ((see? (equal? (gi (node-list-first tertnl)) + (normalize "seeie"))) + (seealso? (equal? (gi (node-list-first tertnl)) + (normalize "seealsoie"))) + (tert (break-node-list tertnl (normalize "tertiaryie")))) + (if (or see? seealso?) + (process-terminal secnode tertnl) + (make sequence + (process-nonterminal secnode) + (make element gi: "DD" + (make element gi: "DL" + (let tloop ((terts tert)) + (if (null? terts) + (empty-sosofo) + (make sequence + (let* ((nodes (car terts)) + (tert (node-list-first nodes)) + (sees (node-list-rest nodes))) + (process-tertiary tert sees)) + (tloop (cdr terts))))))))))) + +(define (process-tertiary tertnode seenl) + (process-terminal tertnode seenl)) + +(define (process-terminal node seenl #!optional (output-id #f)) + (let ((id (attribute-string (normalize "id") (parent node)))) + (make sequence + (make element gi: "DT" + (if id + (make element gi: "A" + attributes: (list (list "NAME" id)) + (empty-sosofo)) + (empty-sosofo)) + (process-node-list node)) + (if (node-list-empty? seenl) + (empty-sosofo) + (make element gi: "DD" + (make element gi: "DL" + (let loop ((nl seenl)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (make element gi: "DT" + (process-node-list + (node-list-first nl))) + (loop (node-list-rest nl))))))))))) + +(define (process-nonterminal node) + (make element gi: "DT" + (process-node-list node))) + +(element indexentry + (let* ((primary (break-node-list (children (current-node)) + (normalize "primaryie")))) + (make sequence + (let ploop ((prims primary)) + (if (null? prims) + (empty-sosofo) + (make sequence + (let* ((nodes (car prims)) + (prim (node-list-first nodes)) + (secs (node-list-rest nodes))) + (process-primary prim secs)) + (ploop (cdr prims)))))))) + +(element primaryie (process-children)) +(element secondaryie (process-children)) +(element tertiaryie (process-children)) + +(define (indexentry-link nd) + (let* ((preferred (not (node-list-empty? + (select-elements (children (current-node)) + (normalize "emphasis")))))) + (make element gi: "A" + attributes: (list (list "HREF" + (attribute-string (normalize "url")))) + (process-children)))) + +(element (primaryie ulink) + (indexentry-link (current-node))) + +(element (secondaryie ulink) + (indexentry-link (current-node))) + +(element (tertiaryie ulink) + (indexentry-link (current-node))) + +(element seeie + (let ((linkend (attribute-string (normalize "linkend")))) + (if linkend + (make element gi: "A" + attributes: (list (list "HREF" + (href-to (element-with-id linkend)))) + (literal (gentext-element-name (current-node))) + (literal (gentext-label-title-sep (current-node))) + (process-children)) + (make sequence + (literal (gentext-element-name (current-node))) + (literal (gentext-label-title-sep (current-node))) + (process-children))))) + +(element seealsoie + (let* ((alinkends (attribute-string (normalize "linkends"))) + (linkends (if alinkends + (split alinkends) + '())) + (linkend (if alinkends + (car linkends) + #f))) + (if linkend + (make element gi: "A" + attributes: (list (list "HREF" + (href-to (element-with-id linkend)))) + (literal (gentext-element-name (current-node))) + (literal (gentext-label-title-sep (current-node))) + (process-children)) + (make sequence + (literal (gentext-element-name (current-node))) + (literal (gentext-label-title-sep (current-node))) + (process-children))))) + +;; =====================HTML INDEX PROCESSING ============================== + +(define (htmlnewline) + (make formatting-instruction data: " ")) + +(define (htmlindexattr attr) + (if (attribute-string (normalize attr)) + (make sequence + (make formatting-instruction data: attr) + (make formatting-instruction data: " ") + (make formatting-instruction data: (attribute-string + (normalize attr))) + (htmlnewline)) + (empty-sosofo))) + +(define (htmlindexterm) + (let* ((attr (gi (current-node))) + (content (data (current-node))) + (string (string-replace content " " " ")) + (sortas (attribute-string (normalize "sortas")))) + (make sequence + (make formatting-instruction data: attr) + (if sortas + (make sequence + (make formatting-instruction data: "[") + (make formatting-instruction data: sortas) + (make formatting-instruction data: "]")) + (empty-sosofo)) + (make formatting-instruction data: " ") + (make formatting-instruction data: string) + (htmlnewline)))) + +(define (htmlindexzone zone) + (let loop ((idlist (split zone))) + (if (null? idlist) + (empty-sosofo) + (make sequence + (htmlindexzone1 (car idlist)) + (loop (cdr idlist)))))) + +(define (htmlindexzone1 id) + (let* ((target (ancestor-member (element-with-id id) + (append (book-element-list) + (division-element-list) + (component-element-list) + (section-element-list)))) + (title (string-replace (element-title-string target) " " " "))) + (make sequence + (make formatting-instruction data: "ZONE ") + (make formatting-instruction data: (href-to target)) + (htmlnewline) + + (make formatting-instruction data: "TITLE ") + (make formatting-instruction data: title) + (htmlnewline)))) + +(mode htmlindex + ;; this mode is really just a hack to get at the root element + (root (process-children)) + + (default + (if (node-list=? (current-node) (sgml-root-element)) + (make entity + system-id: (html-entity-file html-index-filename) + (process-node-list (select-elements + (descendants (current-node)) + (normalize "indexterm")))) + (empty-sosofo))) + + (element indexterm + (let* ((target (ancestor-member (current-node) + (append (book-element-list) + (division-element-list) + (component-element-list) + (section-element-list)))) + (title (string-replace (element-title-string target) " " " "))) + (make sequence + (make formatting-instruction data: "INDEXTERM ") + (make formatting-instruction data: (href-to target)) + (htmlnewline) + + (make formatting-instruction data: "INDEXPOINT ") + (make formatting-instruction data: (href-to (current-node))) + (htmlnewline) + + (make formatting-instruction data: "TITLE ") + (make formatting-instruction data: title) + (htmlnewline) + + (htmlindexattr "scope") + (htmlindexattr "significance") + (htmlindexattr "class") + (htmlindexattr "id") + (htmlindexattr "startref") + + (if (attribute-string (normalize "zone")) + (htmlindexzone (attribute-string (normalize "zone"))) + (empty-sosofo)) + + (process-children) + + (make formatting-instruction data: "/INDEXTERM") + (htmlnewline)))) + + (element primary + (htmlindexterm)) + + (element secondary + (htmlindexterm)) + + (element tertiary + (htmlindexterm)) + + (element see + (htmlindexterm)) + + (element seealso + (htmlindexterm)) +) diff --git a/html/dbinfo.dsl b/html/dbinfo.dsl new file mode 100644 index 0000000..5d03246 --- /dev/null +++ b/html/dbinfo.dsl @@ -0,0 +1,879 @@ +;; $Id: dbinfo.dsl,v 1.2 2003/01/15 08:24:13 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ................................ INFO ................................ + +;; Rather than make the *INFO containers empty-sosofos, we make them +;; process-children and then make all of the elements they may contain +;; empty in this context. The advantage here is that we can then +;; more easily override some of them in stylesheets that use this one. + +;; SetInfo is handled differently in dbdivis.dsl by using a +;; special mode... + +(element setinfo (empty-sosofo)) + +(element (setinfo abbrev) (process-children)) +(element (setinfo abstract) (process-children)) +(element (setinfo address) (process-children)) +(element (setinfo affiliation) (process-children)) +(element (setinfo artpagenums) (process-children)) +(element (setinfo author) (process-children)) +(element (setinfo authorblurb) (process-children)) +(element (setinfo authorgroup) (process-children)) +(element (setinfo authorinitials) (process-children)) +(element (setinfo bibliomisc) (process-children)) +(element (setinfo biblioset) (process-children)) +(element (setinfo collab) (process-children)) +(element (setinfo confgroup) (process-children)) +(element (setinfo contractnum) (process-children)) +(element (setinfo contractsponsor) (process-children)) +(element (setinfo contrib) (process-children)) +(element (setinfo copyright) (process-children)) +(element (setinfo corpauthor) (process-children)) +(element (setinfo corpname) (process-children)) +(element (setinfo date) (process-children)) +(element (setinfo edition) (process-children)) +(element (setinfo editor) (process-children)) +(element (setinfo firstname) (process-children)) +(element (setinfo graphic) (process-children)) +(element (setinfo honorific) (process-children)) +(element (setinfo invpartnumber) (process-children)) +(element (setinfo isbn) (process-children)) +(element (setinfo issn) (process-children)) +(element (setinfo issuenum) (process-children)) +(element (setinfo itermset) (process-children)) +(element (setinfo keywordset) (process-children)) +(element (setinfo legalnotice) ($semiformal-object$)) +(element (setinfo lineage) (process-children)) +(element (setinfo modespec) (process-children)) +(element (setinfo orgname) (process-children)) +(element (setinfo othercredit) (process-children)) +(element (setinfo othername) (process-children)) +(element (setinfo pagenums) (process-children)) +(element (setinfo printhistory) (process-children)) +(element (setinfo productname) (process-children)) +(element (setinfo productnumber) (process-children)) +(element (setinfo pubdate) (process-children)) +(element (setinfo publisher) (process-children)) +(element (setinfo publishername) (process-children)) +(element (setinfo pubsnumber) (process-children)) +(element (setinfo releaseinfo) (process-children)) +(element (setinfo revhistory) ($book-revhistory$)) +(element (setinfo seriesvolnums) (process-children)) +(element (setinfo subjectset) (process-children)) +(element (setinfo subtitle) (process-children)) +(element (setinfo surname) (process-children)) +(element (setinfo title) (process-children)) +(element (setinfo titleabbrev) (process-children)) +(element (setinfo volumenum) (process-children)) + +;; BookInfo is handled differently in dbdivis.dsl by using a +;; special mode... + +(element bookinfo (empty-sosofo)) + +(element (bookinfo abbrev) (process-children)) +(element (bookinfo abstract) (process-children)) +(element (bookinfo address) (process-children)) +(element (bookinfo affiliation) (process-children)) +(element (bookinfo artpagenums) (process-children)) +(element (bookinfo author) (process-children)) +(element (bookinfo authorblurb) (process-children)) +(element (bookinfo authorgroup) (process-children)) +(element (bookinfo authorinitials) (process-children)) +(element (bookinfo bibliomisc) (process-children)) +(element (bookinfo biblioset) (process-children)) +(element (bookinfo bookbiblio) (process-children)) +(element (bookinfo collab) (process-children)) +(element (bookinfo confgroup) (process-children)) +(element (bookinfo contractnum) (process-children)) +(element (bookinfo contractsponsor) (process-children)) +(element (bookinfo contrib) (process-children)) +(element (bookinfo copyright) (process-children)) +(element (bookinfo corpauthor) (process-children)) +(element (bookinfo corpname) (process-children)) +(element (bookinfo date) (process-children)) +(element (bookinfo edition) (process-children)) +(element (bookinfo editor) (process-children)) +(element (bookinfo firstname) (process-children)) +(element (bookinfo graphic) (process-children)) +(element (bookinfo honorific) (process-children)) +(element (bookinfo invpartnumber) (process-children)) +(element (bookinfo isbn) (process-children)) +(element (bookinfo issn) (process-children)) +(element (bookinfo issuenum) (process-children)) +(element (bookinfo itermset) (process-children)) +(element (bookinfo keywordset) (process-children)) +(element (bookinfo legalnotice) ($semiformal-object$)) +(element (bookinfo lineage) (process-children)) +(element (bookinfo modespec) (process-children)) +(element (bookinfo orgname) (process-children)) +(element (bookinfo othercredit) (process-children)) +(element (bookinfo othername) (process-children)) +(element (bookinfo pagenums) (process-children)) +(element (bookinfo printhistory) (process-children)) +(element (bookinfo productname) (process-children)) +(element (bookinfo productnumber) (process-children)) +(element (bookinfo pubdate) (process-children)) +(element (bookinfo publisher) (process-children)) +(element (bookinfo publishername) (process-children)) +(element (bookinfo pubsnumber) (process-children)) +(element (bookinfo releaseinfo) (process-children)) +(element (bookinfo revhistory) ($book-revhistory$)) +(element (bookinfo seriesvolnums) (process-children)) +(element (bookinfo subjectset) (process-children)) +(element (bookinfo subtitle) (process-children)) +(element (bookinfo surname) (process-children)) +(element (bookinfo title) (process-children)) +(element (bookinfo titleabbrev) (process-children)) +(element (bookinfo volumenum) (process-children)) + +(element docinfo (empty-sosofo)) + +(element (docinfo abbrev) (empty-sosofo)) + +(element (docinfo abstract) + (make element gi: "DIV" + attributes: '(("CLASS" "ABSTRACT")) + (process-children))) + +(element (docinfo abstract para) + (make element gi: "P" + (process-children-trim))) + +(element (docinfo address) (empty-sosofo)) +(element (docinfo affiliation) (empty-sosofo)) +(element (docinfo artpagenums) (empty-sosofo)) +(element (docinfo author) (empty-sosofo)) +(element (docinfo authorblurb) (empty-sosofo)) +(element (docinfo authorgroup) (empty-sosofo)) +(element (docinfo authorinitials) (empty-sosofo)) +(element (docinfo bibliomisc) (empty-sosofo)) +(element (docinfo biblioset) (empty-sosofo)) +(element (docinfo collab) (empty-sosofo)) +(element (docinfo confgroup) (empty-sosofo)) +(element (docinfo contractnum) (empty-sosofo)) +(element (docinfo contractsponsor) (empty-sosofo)) +(element (docinfo contrib) (empty-sosofo)) +(element (docinfo copyright) (empty-sosofo)) +(element (docinfo corpauthor) (empty-sosofo)) +(element (docinfo corpname) (empty-sosofo)) +(element (docinfo date) (empty-sosofo)) +(element (docinfo edition) (empty-sosofo)) +(element (docinfo editor) (empty-sosofo)) +(element (docinfo firstname) (empty-sosofo)) +(element (docinfo graphic) (empty-sosofo)) +(element (docinfo honorific) (empty-sosofo)) +(element (docinfo invpartnumber) (empty-sosofo)) +(element (docinfo isbn) (empty-sosofo)) +(element (docinfo issn) (empty-sosofo)) +(element (docinfo issuenum) (empty-sosofo)) +(element (docinfo itermset) (empty-sosofo)) +(element (docinfo keywordset) (empty-sosofo)) +(element (docinfo legalnotice) (empty-sosofo)) +(element (docinfo lineage) (empty-sosofo)) +(element (docinfo modespec) (empty-sosofo)) +(element (docinfo orgname) (empty-sosofo)) +(element (docinfo othercredit) (empty-sosofo)) +(element (docinfo othername) (empty-sosofo)) +(element (docinfo pagenums) (empty-sosofo)) +(element (docinfo printhistory) (empty-sosofo)) +(element (docinfo productname) (empty-sosofo)) +(element (docinfo productnumber) (empty-sosofo)) +(element (docinfo pubdate) (empty-sosofo)) +(element (docinfo publisher) (empty-sosofo)) +(element (docinfo publishername) (empty-sosofo)) +(element (docinfo pubsnumber) (empty-sosofo)) +(element (docinfo releaseinfo) (empty-sosofo)) +(element (docinfo revhistory) (empty-sosofo)) +(element (docinfo seriesvolnums) (empty-sosofo)) +(element (docinfo subjectset) (empty-sosofo)) +(element (docinfo subtitle) (empty-sosofo)) +(element (docinfo surname) (empty-sosofo)) +(element (docinfo title) (empty-sosofo)) +(element (docinfo titleabbrev) (empty-sosofo)) +(element (docinfo volumenum) (empty-sosofo)) + +(element sect1info (process-children)) + +(element (sect1info abbrev) (empty-sosofo)) +(element (sect1info abstract) (empty-sosofo)) +(element (sect1info address) (empty-sosofo)) +(element (sect1info affiliation) (empty-sosofo)) +(element (sect1info artpagenums) (empty-sosofo)) +(element (sect1info author) (empty-sosofo)) +(element (sect1info authorblurb) (empty-sosofo)) +(element (sect1info authorgroup) (empty-sosofo)) +(element (sect1info authorinitials) (empty-sosofo)) +(element (sect1info bibliomisc) (empty-sosofo)) +(element (sect1info biblioset) (empty-sosofo)) +(element (sect1info collab) (empty-sosofo)) +(element (sect1info confgroup) (empty-sosofo)) +(element (sect1info contractnum) (empty-sosofo)) +(element (sect1info contractsponsor) (empty-sosofo)) +(element (sect1info contrib) (empty-sosofo)) +(element (sect1info copyright) (empty-sosofo)) +(element (sect1info corpauthor) (empty-sosofo)) +(element (sect1info corpname) (empty-sosofo)) +(element (sect1info date) (empty-sosofo)) +(element (sect1info edition) (empty-sosofo)) +(element (sect1info editor) (empty-sosofo)) +(element (sect1info firstname) (empty-sosofo)) +(element (sect1info graphic) (empty-sosofo)) +(element (sect1info honorific) (empty-sosofo)) +(element (sect1info invpartnumber) (empty-sosofo)) +(element (sect1info isbn) (empty-sosofo)) +(element (sect1info issn) (empty-sosofo)) +(element (sect1info issuenum) (empty-sosofo)) +(element (sect1info itermset) (empty-sosofo)) +(element (sect1info keywordset) (empty-sosofo)) +(element (sect1info legalnotice) (empty-sosofo)) +(element (sect1info lineage) (empty-sosofo)) +(element (sect1info modespec) (empty-sosofo)) +(element (sect1info orgname) (empty-sosofo)) +(element (sect1info othercredit) (empty-sosofo)) +(element (sect1info othername) (empty-sosofo)) +(element (sect1info pagenums) (empty-sosofo)) +(element (sect1info printhistory) (empty-sosofo)) +(element (sect1info productname) (empty-sosofo)) +(element (sect1info productnumber) (empty-sosofo)) +(element (sect1info pubdate) (empty-sosofo)) +(element (sect1info publisher) (empty-sosofo)) +(element (sect1info publishername) (empty-sosofo)) +(element (sect1info pubsnumber) (empty-sosofo)) +(element (sect1info releaseinfo) (empty-sosofo)) +(element (sect1info revhistory) (empty-sosofo)) +(element (sect1info seriesvolnums) (empty-sosofo)) +(element (sect1info subjectset) (empty-sosofo)) +(element (sect1info subtitle) (empty-sosofo)) +(element (sect1info surname) (empty-sosofo)) +(element (sect1info title) (empty-sosofo)) +(element (sect1info titleabbrev) (empty-sosofo)) +(element (sect1info volumenum) (empty-sosofo)) + +(element sect2info (process-children)) + +(element (sect2info abbrev) (empty-sosofo)) +(element (sect2info abstract) (empty-sosofo)) +(element (sect2info address) (empty-sosofo)) +(element (sect2info affiliation) (empty-sosofo)) +(element (sect2info artpagenums) (empty-sosofo)) +(element (sect2info author) (empty-sosofo)) +(element (sect2info authorblurb) (empty-sosofo)) +(element (sect2info authorgroup) (empty-sosofo)) +(element (sect2info authorinitials) (empty-sosofo)) +(element (sect2info bibliomisc) (empty-sosofo)) +(element (sect2info biblioset) (empty-sosofo)) +(element (sect2info collab) (empty-sosofo)) +(element (sect2info confgroup) (empty-sosofo)) +(element (sect2info contractnum) (empty-sosofo)) +(element (sect2info contractsponsor) (empty-sosofo)) +(element (sect2info contrib) (empty-sosofo)) +(element (sect2info copyright) (empty-sosofo)) +(element (sect2info corpauthor) (empty-sosofo)) +(element (sect2info corpname) (empty-sosofo)) +(element (sect2info date) (empty-sosofo)) +(element (sect2info edition) (empty-sosofo)) +(element (sect2info editor) (empty-sosofo)) +(element (sect2info firstname) (empty-sosofo)) +(element (sect2info graphic) (empty-sosofo)) +(element (sect2info honorific) (empty-sosofo)) +(element (sect2info invpartnumber) (empty-sosofo)) +(element (sect2info isbn) (empty-sosofo)) +(element (sect2info issn) (empty-sosofo)) +(element (sect2info issuenum) (empty-sosofo)) +(element (sect2info itermset) (empty-sosofo)) +(element (sect2info keywordset) (empty-sosofo)) +(element (sect2info legalnotice) (empty-sosofo)) +(element (sect2info lineage) (empty-sosofo)) +(element (sect2info modespec) (empty-sosofo)) +(element (sect2info orgname) (empty-sosofo)) +(element (sect2info othercredit) (empty-sosofo)) +(element (sect2info othername) (empty-sosofo)) +(element (sect2info pagenums) (empty-sosofo)) +(element (sect2info printhistory) (empty-sosofo)) +(element (sect2info productname) (empty-sosofo)) +(element (sect2info productnumber) (empty-sosofo)) +(element (sect2info pubdate) (empty-sosofo)) +(element (sect2info publisher) (empty-sosofo)) +(element (sect2info publishername) (empty-sosofo)) +(element (sect2info pubsnumber) (empty-sosofo)) +(element (sect2info releaseinfo) (empty-sosofo)) +(element (sect2info revhistory) (empty-sosofo)) +(element (sect2info seriesvolnums) (empty-sosofo)) +(element (sect2info subjectset) (empty-sosofo)) +(element (sect2info subtitle) (empty-sosofo)) +(element (sect2info surname) (empty-sosofo)) +(element (sect2info title) (empty-sosofo)) +(element (sect2info titleabbrev) (empty-sosofo)) +(element (sect2info volumenum) (empty-sosofo)) + +(element sect3info (process-children)) + +(element (sect3info abbrev) (empty-sosofo)) +(element (sect3info abstract) (empty-sosofo)) +(element (sect3info address) (empty-sosofo)) +(element (sect3info affiliation) (empty-sosofo)) +(element (sect3info artpagenums) (empty-sosofo)) +(element (sect3info author) (empty-sosofo)) +(element (sect3info authorblurb) (empty-sosofo)) +(element (sect3info authorgroup) (empty-sosofo)) +(element (sect3info authorinitials) (empty-sosofo)) +(element (sect3info bibliomisc) (empty-sosofo)) +(element (sect3info biblioset) (empty-sosofo)) +(element (sect3info collab) (empty-sosofo)) +(element (sect3info confgroup) (empty-sosofo)) +(element (sect3info contractnum) (empty-sosofo)) +(element (sect3info contractsponsor) (empty-sosofo)) +(element (sect3info contrib) (empty-sosofo)) +(element (sect3info copyright) (empty-sosofo)) +(element (sect3info corpauthor) (empty-sosofo)) +(element (sect3info corpname) (empty-sosofo)) +(element (sect3info date) (empty-sosofo)) +(element (sect3info edition) (empty-sosofo)) +(element (sect3info editor) (empty-sosofo)) +(element (sect3info firstname) (empty-sosofo)) +(element (sect3info graphic) (empty-sosofo)) +(element (sect3info honorific) (empty-sosofo)) +(element (sect3info invpartnumber) (empty-sosofo)) +(element (sect3info isbn) (empty-sosofo)) +(element (sect3info issn) (empty-sosofo)) +(element (sect3info issuenum) (empty-sosofo)) +(element (sect3info itermset) (empty-sosofo)) +(element (sect3info keywordset) (empty-sosofo)) +(element (sect3info legalnotice) (empty-sosofo)) +(element (sect3info lineage) (empty-sosofo)) +(element (sect3info modespec) (empty-sosofo)) +(element (sect3info orgname) (empty-sosofo)) +(element (sect3info othercredit) (empty-sosofo)) +(element (sect3info othername) (empty-sosofo)) +(element (sect3info pagenums) (empty-sosofo)) +(element (sect3info printhistory) (empty-sosofo)) +(element (sect3info productname) (empty-sosofo)) +(element (sect3info productnumber) (empty-sosofo)) +(element (sect3info pubdate) (empty-sosofo)) +(element (sect3info publisher) (empty-sosofo)) +(element (sect3info publishername) (empty-sosofo)) +(element (sect3info pubsnumber) (empty-sosofo)) +(element (sect3info releaseinfo) (empty-sosofo)) +(element (sect3info revhistory) (empty-sosofo)) +(element (sect3info seriesvolnums) (empty-sosofo)) +(element (sect3info subjectset) (empty-sosofo)) +(element (sect3info subtitle) (empty-sosofo)) +(element (sect3info surname) (empty-sosofo)) +(element (sect3info title) (empty-sosofo)) +(element (sect3info titleabbrev) (empty-sosofo)) +(element (sect3info volumenum) (empty-sosofo)) + +(element sect4info (process-children)) + +(element (sect4info abbrev) (empty-sosofo)) +(element (sect4info abstract) (empty-sosofo)) +(element (sect4info address) (empty-sosofo)) +(element (sect4info affiliation) (empty-sosofo)) +(element (sect4info artpagenums) (empty-sosofo)) +(element (sect4info author) (empty-sosofo)) +(element (sect4info authorblurb) (empty-sosofo)) +(element (sect4info authorgroup) (empty-sosofo)) +(element (sect4info authorinitials) (empty-sosofo)) +(element (sect4info bibliomisc) (empty-sosofo)) +(element (sect4info biblioset) (empty-sosofo)) +(element (sect4info collab) (empty-sosofo)) +(element (sect4info confgroup) (empty-sosofo)) +(element (sect4info contractnum) (empty-sosofo)) +(element (sect4info contractsponsor) (empty-sosofo)) +(element (sect4info contrib) (empty-sosofo)) +(element (sect4info copyright) (empty-sosofo)) +(element (sect4info corpauthor) (empty-sosofo)) +(element (sect4info corpname) (empty-sosofo)) +(element (sect4info date) (empty-sosofo)) +(element (sect4info edition) (empty-sosofo)) +(element (sect4info editor) (empty-sosofo)) +(element (sect4info firstname) (empty-sosofo)) +(element (sect4info graphic) (empty-sosofo)) +(element (sect4info honorific) (empty-sosofo)) +(element (sect4info invpartnumber) (empty-sosofo)) +(element (sect4info isbn) (empty-sosofo)) +(element (sect4info issn) (empty-sosofo)) +(element (sect4info issuenum) (empty-sosofo)) +(element (sect4info itermset) (empty-sosofo)) +(element (sect4info keywordset) (empty-sosofo)) +(element (sect4info legalnotice) (empty-sosofo)) +(element (sect4info lineage) (empty-sosofo)) +(element (sect4info modespec) (empty-sosofo)) +(element (sect4info orgname) (empty-sosofo)) +(element (sect4info othercredit) (empty-sosofo)) +(element (sect4info othername) (empty-sosofo)) +(element (sect4info pagenums) (empty-sosofo)) +(element (sect4info printhistory) (empty-sosofo)) +(element (sect4info productname) (empty-sosofo)) +(element (sect4info productnumber) (empty-sosofo)) +(element (sect4info pubdate) (empty-sosofo)) +(element (sect4info publisher) (empty-sosofo)) +(element (sect4info publishername) (empty-sosofo)) +(element (sect4info pubsnumber) (empty-sosofo)) +(element (sect4info releaseinfo) (empty-sosofo)) +(element (sect4info revhistory) (empty-sosofo)) +(element (sect4info seriesvolnums) (empty-sosofo)) +(element (sect4info subjectset) (empty-sosofo)) +(element (sect4info subtitle) (empty-sosofo)) +(element (sect4info surname) (empty-sosofo)) +(element (sect4info title) (empty-sosofo)) +(element (sect4info titleabbrev) (empty-sosofo)) +(element (sect4info volumenum) (empty-sosofo)) + +(element sect5info (process-children)) + +(element (sect5info abbrev) (empty-sosofo)) +(element (sect5info abstract) (empty-sosofo)) +(element (sect5info address) (empty-sosofo)) +(element (sect5info affiliation) (empty-sosofo)) +(element (sect5info artpagenums) (empty-sosofo)) +(element (sect5info author) (empty-sosofo)) +(element (sect5info authorblurb) (empty-sosofo)) +(element (sect5info authorgroup) (empty-sosofo)) +(element (sect5info authorinitials) (empty-sosofo)) +(element (sect5info bibliomisc) (empty-sosofo)) +(element (sect5info biblioset) (empty-sosofo)) +(element (sect5info collab) (empty-sosofo)) +(element (sect5info confgroup) (empty-sosofo)) +(element (sect5info contractnum) (empty-sosofo)) +(element (sect5info contractsponsor) (empty-sosofo)) +(element (sect5info contrib) (empty-sosofo)) +(element (sect5info copyright) (empty-sosofo)) +(element (sect5info corpauthor) (empty-sosofo)) +(element (sect5info corpname) (empty-sosofo)) +(element (sect5info date) (empty-sosofo)) +(element (sect5info edition) (empty-sosofo)) +(element (sect5info editor) (empty-sosofo)) +(element (sect5info firstname) (empty-sosofo)) +(element (sect5info graphic) (empty-sosofo)) +(element (sect5info honorific) (empty-sosofo)) +(element (sect5info invpartnumber) (empty-sosofo)) +(element (sect5info isbn) (empty-sosofo)) +(element (sect5info issn) (empty-sosofo)) +(element (sect5info issuenum) (empty-sosofo)) +(element (sect5info itermset) (empty-sosofo)) +(element (sect5info keywordset) (empty-sosofo)) +(element (sect5info legalnotice) (empty-sosofo)) +(element (sect5info lineage) (empty-sosofo)) +(element (sect5info modespec) (empty-sosofo)) +(element (sect5info orgname) (empty-sosofo)) +(element (sect5info othercredit) (empty-sosofo)) +(element (sect5info othername) (empty-sosofo)) +(element (sect5info pagenums) (empty-sosofo)) +(element (sect5info printhistory) (empty-sosofo)) +(element (sect5info productname) (empty-sosofo)) +(element (sect5info productnumber) (empty-sosofo)) +(element (sect5info pubdate) (empty-sosofo)) +(element (sect5info publisher) (empty-sosofo)) +(element (sect5info publishername) (empty-sosofo)) +(element (sect5info pubsnumber) (empty-sosofo)) +(element (sect5info releaseinfo) (empty-sosofo)) +(element (sect5info revhistory) (empty-sosofo)) +(element (sect5info seriesvolnums) (empty-sosofo)) +(element (sect5info subjectset) (empty-sosofo)) +(element (sect5info subtitle) (empty-sosofo)) +(element (sect5info surname) (empty-sosofo)) +(element (sect5info title) (empty-sosofo)) +(element (sect5info titleabbrev) (empty-sosofo)) +(element (sect5info volumenum) (empty-sosofo)) + +(element refsect1info (process-children)) + +(element (refsect1info abbrev) (empty-sosofo)) +(element (refsect1info abstract) (empty-sosofo)) +(element (refsect1info address) (empty-sosofo)) +(element (refsect1info affiliation) (empty-sosofo)) +(element (refsect1info artpagenums) (empty-sosofo)) +(element (refsect1info author) (empty-sosofo)) +(element (refsect1info authorblurb) (empty-sosofo)) +(element (refsect1info authorgroup) (empty-sosofo)) +(element (refsect1info authorinitials) (empty-sosofo)) +(element (refsect1info bibliomisc) (empty-sosofo)) +(element (refsect1info biblioset) (empty-sosofo)) +(element (refsect1info collab) (empty-sosofo)) +(element (refsect1info confgroup) (empty-sosofo)) +(element (refsect1info contractnum) (empty-sosofo)) +(element (refsect1info contractsponsor) (empty-sosofo)) +(element (refsect1info contrib) (empty-sosofo)) +(element (refsect1info copyright) (empty-sosofo)) +(element (refsect1info corpauthor) (empty-sosofo)) +(element (refsect1info corpname) (empty-sosofo)) +(element (refsect1info date) (empty-sosofo)) +(element (refsect1info edition) (empty-sosofo)) +(element (refsect1info editor) (empty-sosofo)) +(element (refsect1info firstname) (empty-sosofo)) +(element (refsect1info graphic) (empty-sosofo)) +(element (refsect1info honorific) (empty-sosofo)) +(element (refsect1info invpartnumber) (empty-sosofo)) +(element (refsect1info isbn) (empty-sosofo)) +(element (refsect1info issn) (empty-sosofo)) +(element (refsect1info issuenum) (empty-sosofo)) +(element (refsect1info itermset) (empty-sosofo)) +(element (refsect1info keywordset) (empty-sosofo)) +(element (refsect1info legalnotice) (empty-sosofo)) +(element (refsect1info lineage) (empty-sosofo)) +(element (refsect1info modespec) (empty-sosofo)) +(element (refsect1info orgname) (empty-sosofo)) +(element (refsect1info othercredit) (empty-sosofo)) +(element (refsect1info othername) (empty-sosofo)) +(element (refsect1info pagenums) (empty-sosofo)) +(element (refsect1info printhistory) (empty-sosofo)) +(element (refsect1info productname) (empty-sosofo)) +(element (refsect1info productnumber) (empty-sosofo)) +(element (refsect1info pubdate) (empty-sosofo)) +(element (refsect1info publisher) (empty-sosofo)) +(element (refsect1info publishername) (empty-sosofo)) +(element (refsect1info pubsnumber) (empty-sosofo)) +(element (refsect1info releaseinfo) (empty-sosofo)) +(element (refsect1info revhistory) (empty-sosofo)) +(element (refsect1info seriesvolnums) (empty-sosofo)) +(element (refsect1info subjectset) (empty-sosofo)) +(element (refsect1info subtitle) (empty-sosofo)) +(element (refsect1info surname) (empty-sosofo)) +(element (refsect1info title) (empty-sosofo)) +(element (refsect1info titleabbrev) (empty-sosofo)) +(element (refsect1info volumenum) (empty-sosofo)) + +(element refsect2info (process-children)) + +(element (refsect2info abbrev) (empty-sosofo)) +(element (refsect2info abstract) (empty-sosofo)) +(element (refsect2info address) (empty-sosofo)) +(element (refsect2info affiliation) (empty-sosofo)) +(element (refsect2info artpagenums) (empty-sosofo)) +(element (refsect2info author) (empty-sosofo)) +(element (refsect2info authorblurb) (empty-sosofo)) +(element (refsect2info authorgroup) (empty-sosofo)) +(element (refsect2info authorinitials) (empty-sosofo)) +(element (refsect2info bibliomisc) (empty-sosofo)) +(element (refsect2info biblioset) (empty-sosofo)) +(element (refsect2info collab) (empty-sosofo)) +(element (refsect2info confgroup) (empty-sosofo)) +(element (refsect2info contractnum) (empty-sosofo)) +(element (refsect2info contractsponsor) (empty-sosofo)) +(element (refsect2info contrib) (empty-sosofo)) +(element (refsect2info copyright) (empty-sosofo)) +(element (refsect2info corpauthor) (empty-sosofo)) +(element (refsect2info corpname) (empty-sosofo)) +(element (refsect2info date) (empty-sosofo)) +(element (refsect2info edition) (empty-sosofo)) +(element (refsect2info editor) (empty-sosofo)) +(element (refsect2info firstname) (empty-sosofo)) +(element (refsect2info graphic) (empty-sosofo)) +(element (refsect2info honorific) (empty-sosofo)) +(element (refsect2info invpartnumber) (empty-sosofo)) +(element (refsect2info isbn) (empty-sosofo)) +(element (refsect2info issn) (empty-sosofo)) +(element (refsect2info issuenum) (empty-sosofo)) +(element (refsect2info itermset) (empty-sosofo)) +(element (refsect2info keywordset) (empty-sosofo)) +(element (refsect2info legalnotice) (empty-sosofo)) +(element (refsect2info lineage) (empty-sosofo)) +(element (refsect2info modespec) (empty-sosofo)) +(element (refsect2info orgname) (empty-sosofo)) +(element (refsect2info othercredit) (empty-sosofo)) +(element (refsect2info othername) (empty-sosofo)) +(element (refsect2info pagenums) (empty-sosofo)) +(element (refsect2info printhistory) (empty-sosofo)) +(element (refsect2info productname) (empty-sosofo)) +(element (refsect2info productnumber) (empty-sosofo)) +(element (refsect2info pubdate) (empty-sosofo)) +(element (refsect2info publisher) (empty-sosofo)) +(element (refsect2info publishername) (empty-sosofo)) +(element (refsect2info pubsnumber) (empty-sosofo)) +(element (refsect2info releaseinfo) (empty-sosofo)) +(element (refsect2info revhistory) (empty-sosofo)) +(element (refsect2info seriesvolnums) (empty-sosofo)) +(element (refsect2info subjectset) (empty-sosofo)) +(element (refsect2info subtitle) (empty-sosofo)) +(element (refsect2info surname) (empty-sosofo)) +(element (refsect2info title) (empty-sosofo)) +(element (refsect2info titleabbrev) (empty-sosofo)) +(element (refsect2info volumenum) (empty-sosofo)) + +(element refsect3info (process-children)) + +(element (refsect3info abbrev) (empty-sosofo)) +(element (refsect3info abstract) (empty-sosofo)) +(element (refsect3info address) (empty-sosofo)) +(element (refsect3info affiliation) (empty-sosofo)) +(element (refsect3info artpagenums) (empty-sosofo)) +(element (refsect3info author) (empty-sosofo)) +(element (refsect3info authorblurb) (empty-sosofo)) +(element (refsect3info authorgroup) (empty-sosofo)) +(element (refsect3info authorinitials) (empty-sosofo)) +(element (refsect3info bibliomisc) (empty-sosofo)) +(element (refsect3info biblioset) (empty-sosofo)) +(element (refsect3info collab) (empty-sosofo)) +(element (refsect3info confgroup) (empty-sosofo)) +(element (refsect3info contractnum) (empty-sosofo)) +(element (refsect3info contractsponsor) (empty-sosofo)) +(element (refsect3info contrib) (empty-sosofo)) +(element (refsect3info copyright) (empty-sosofo)) +(element (refsect3info corpauthor) (empty-sosofo)) +(element (refsect3info corpname) (empty-sosofo)) +(element (refsect3info date) (empty-sosofo)) +(element (refsect3info edition) (empty-sosofo)) +(element (refsect3info editor) (empty-sosofo)) +(element (refsect3info firstname) (empty-sosofo)) +(element (refsect3info graphic) (empty-sosofo)) +(element (refsect3info honorific) (empty-sosofo)) +(element (refsect3info invpartnumber) (empty-sosofo)) +(element (refsect3info isbn) (empty-sosofo)) +(element (refsect3info issn) (empty-sosofo)) +(element (refsect3info issuenum) (empty-sosofo)) +(element (refsect3info itermset) (empty-sosofo)) +(element (refsect3info keywordset) (empty-sosofo)) +(element (refsect3info legalnotice) (empty-sosofo)) +(element (refsect3info lineage) (empty-sosofo)) +(element (refsect3info modespec) (empty-sosofo)) +(element (refsect3info orgname) (empty-sosofo)) +(element (refsect3info othercredit) (empty-sosofo)) +(element (refsect3info othername) (empty-sosofo)) +(element (refsect3info pagenums) (empty-sosofo)) +(element (refsect3info printhistory) (empty-sosofo)) +(element (refsect3info productname) (empty-sosofo)) +(element (refsect3info productnumber) (empty-sosofo)) +(element (refsect3info pubdate) (empty-sosofo)) +(element (refsect3info publisher) (empty-sosofo)) +(element (refsect3info publishername) (empty-sosofo)) +(element (refsect3info pubsnumber) (empty-sosofo)) +(element (refsect3info releaseinfo) (empty-sosofo)) +(element (refsect3info revhistory) (empty-sosofo)) +(element (refsect3info seriesvolnums) (empty-sosofo)) +(element (refsect3info subjectset) (empty-sosofo)) +(element (refsect3info subtitle) (empty-sosofo)) +(element (refsect3info surname) (empty-sosofo)) +(element (refsect3info title) (empty-sosofo)) +(element (refsect3info titleabbrev) (empty-sosofo)) +(element (refsect3info volumenum) (empty-sosofo)) + +(element seriesinfo (process-children)) + +(element (seriesinfo abbrev) (empty-sosofo)) +(element (seriesinfo abstract) (empty-sosofo)) +(element (seriesinfo address) (empty-sosofo)) +(element (seriesinfo affiliation) (empty-sosofo)) +(element (seriesinfo artpagenums) (empty-sosofo)) +(element (seriesinfo author) (empty-sosofo)) +(element (seriesinfo authorblurb) (empty-sosofo)) +(element (seriesinfo authorgroup) (empty-sosofo)) +(element (seriesinfo authorinitials) (empty-sosofo)) +(element (seriesinfo bibliomisc) (empty-sosofo)) +(element (seriesinfo biblioset) (empty-sosofo)) +(element (seriesinfo collab) (empty-sosofo)) +(element (seriesinfo confgroup) (empty-sosofo)) +(element (seriesinfo contractnum) (empty-sosofo)) +(element (seriesinfo contractsponsor) (empty-sosofo)) +(element (seriesinfo contrib) (empty-sosofo)) +(element (seriesinfo copyright) (empty-sosofo)) +(element (seriesinfo corpauthor) (empty-sosofo)) +(element (seriesinfo corpname) (empty-sosofo)) +(element (seriesinfo date) (empty-sosofo)) +(element (seriesinfo edition) (empty-sosofo)) +(element (seriesinfo editor) (empty-sosofo)) +(element (seriesinfo firstname) (empty-sosofo)) +(element (seriesinfo honorific) (empty-sosofo)) +(element (seriesinfo invpartnumber) (empty-sosofo)) +(element (seriesinfo isbn) (empty-sosofo)) +(element (seriesinfo issn) (empty-sosofo)) +(element (seriesinfo issuenum) (empty-sosofo)) +(element (seriesinfo lineage) (empty-sosofo)) +(element (seriesinfo orgname) (empty-sosofo)) +(element (seriesinfo othercredit) (empty-sosofo)) +(element (seriesinfo othername) (empty-sosofo)) +(element (seriesinfo pagenums) (empty-sosofo)) +(element (seriesinfo printhistory) (empty-sosofo)) +(element (seriesinfo productname) (empty-sosofo)) +(element (seriesinfo productnumber) (empty-sosofo)) +(element (seriesinfo pubdate) (empty-sosofo)) +(element (seriesinfo publisher) (empty-sosofo)) +(element (seriesinfo publishername) (empty-sosofo)) +(element (seriesinfo pubsnumber) (empty-sosofo)) +(element (seriesinfo releaseinfo) (empty-sosofo)) +(element (seriesinfo revhistory) (empty-sosofo)) +(element (seriesinfo seriesvolnums) (empty-sosofo)) +(element (seriesinfo subtitle) (empty-sosofo)) +(element (seriesinfo surname) (empty-sosofo)) +(element (seriesinfo title) (empty-sosofo)) +(element (seriesinfo titleabbrev) (empty-sosofo)) +(element (seriesinfo volumenum) (empty-sosofo)) + +(element artheader (empty-sosofo)) + +(element (artheader abbrev) (empty-sosofo)) +(element (artheader abstract) (empty-sosofo)) +(element (artheader address) (empty-sosofo)) +(element (artheader affiliation) (empty-sosofo)) +(element (artheader artpagenums) (empty-sosofo)) +(element (artheader author) (empty-sosofo)) +(element (artheader authorblurb) (empty-sosofo)) +(element (artheader authorgroup) (empty-sosofo)) +(element (artheader authorinitials) (empty-sosofo)) +(element (artheader bibliomisc) (empty-sosofo)) +(element (artheader biblioset) (empty-sosofo)) +(element (artheader bookbiblio) (empty-sosofo)) +(element (artheader collab) (empty-sosofo)) +(element (artheader confgroup) (empty-sosofo)) +(element (artheader contractnum) (empty-sosofo)) +(element (artheader contractsponsor) (empty-sosofo)) +(element (artheader contrib) (empty-sosofo)) +(element (artheader copyright) (empty-sosofo)) +(element (artheader corpauthor) (empty-sosofo)) +(element (artheader corpname) (empty-sosofo)) +(element (artheader date) (empty-sosofo)) +(element (artheader edition) (empty-sosofo)) +(element (artheader editor) (empty-sosofo)) +(element (artheader firstname) (empty-sosofo)) +(element (artheader honorific) (empty-sosofo)) +(element (artheader invpartnumber) (empty-sosofo)) +(element (artheader isbn) (empty-sosofo)) +(element (artheader issn) (empty-sosofo)) +(element (artheader issuenum) (empty-sosofo)) +(element (artheader lineage) (empty-sosofo)) +(element (artheader orgname) (empty-sosofo)) +(element (artheader othercredit) (empty-sosofo)) +(element (artheader othername) (empty-sosofo)) +(element (artheader pagenums) (empty-sosofo)) +(element (artheader printhistory) (empty-sosofo)) +(element (artheader productname) (empty-sosofo)) +(element (artheader productnumber) (empty-sosofo)) +(element (artheader pubdate) (empty-sosofo)) +(element (artheader publisher) (empty-sosofo)) +(element (artheader publishername) (empty-sosofo)) +(element (artheader pubsnumber) (empty-sosofo)) +(element (artheader releaseinfo) (empty-sosofo)) +(element (artheader revhistory) (empty-sosofo)) +(element (artheader seriesvolnums) (empty-sosofo)) +(element (artheader subtitle) (empty-sosofo)) +(element (artheader surname) (empty-sosofo)) +(element (artheader title) (empty-sosofo)) +(element (artheader titleabbrev) (empty-sosofo)) +(element (artheader volumenum) (empty-sosofo)) + +(element articleinfo (empty-sosofo)) + +(element (articleinfo abbrev) (empty-sosofo)) +(element (articleinfo abstract) (empty-sosofo)) +(element (articleinfo address) (empty-sosofo)) +(element (articleinfo affiliation) (empty-sosofo)) +(element (articleinfo artpagenums) (empty-sosofo)) +(element (articleinfo author) (empty-sosofo)) +(element (articleinfo authorblurb) (empty-sosofo)) +(element (articleinfo authorgroup) (empty-sosofo)) +(element (articleinfo authorinitials) (empty-sosofo)) +(element (articleinfo bibliomisc) (empty-sosofo)) +(element (articleinfo biblioset) (empty-sosofo)) +(element (articleinfo bookbiblio) (empty-sosofo)) +(element (articleinfo collab) (empty-sosofo)) +(element (articleinfo confgroup) (empty-sosofo)) +(element (articleinfo contractnum) (empty-sosofo)) +(element (articleinfo contractsponsor) (empty-sosofo)) +(element (articleinfo contrib) (empty-sosofo)) +(element (articleinfo copyright) (empty-sosofo)) +(element (articleinfo corpauthor) (empty-sosofo)) +(element (articleinfo corpname) (empty-sosofo)) +(element (articleinfo date) (empty-sosofo)) +(element (articleinfo edition) (empty-sosofo)) +(element (articleinfo editor) (empty-sosofo)) +(element (articleinfo firstname) (empty-sosofo)) +(element (articleinfo honorific) (empty-sosofo)) +(element (articleinfo invpartnumber) (empty-sosofo)) +(element (articleinfo isbn) (empty-sosofo)) +(element (articleinfo issn) (empty-sosofo)) +(element (articleinfo issuenum) (empty-sosofo)) +(element (articleinfo lineage) (empty-sosofo)) +(element (articleinfo orgname) (empty-sosofo)) +(element (articleinfo othercredit) (empty-sosofo)) +(element (articleinfo othername) (empty-sosofo)) +(element (articleinfo pagenums) (empty-sosofo)) +(element (articleinfo printhistory) (empty-sosofo)) +(element (articleinfo productname) (empty-sosofo)) +(element (articleinfo productnumber) (empty-sosofo)) +(element (articleinfo pubdate) (empty-sosofo)) +(element (articleinfo publisher) (empty-sosofo)) +(element (articleinfo publishername) (empty-sosofo)) +(element (articleinfo pubsnumber) (empty-sosofo)) +(element (articleinfo releaseinfo) (empty-sosofo)) +(element (articleinfo revhistory) (empty-sosofo)) +(element (articleinfo seriesvolnums) (empty-sosofo)) +(element (articleinfo subtitle) (empty-sosofo)) +(element (articleinfo surname) (empty-sosofo)) +(element (articleinfo title) (empty-sosofo)) +(element (articleinfo titleabbrev) (empty-sosofo)) +(element (articleinfo volumenum) (empty-sosofo)) + +(element refsynopsisdivinfo (process-children)) + +(element (refsynopsisdivinfo graphic) (empty-sosofo)) +(element (refsynopsisdivinfo legalnotice) (empty-sosofo)) +(element (refsynopsisdivinfo modespec) (empty-sosofo)) +(element (refsynopsisdivinfo subjectset) (empty-sosofo)) +(element (refsynopsisdivinfo keywordset) (empty-sosofo)) +(element (refsynopsisdivinfo itermset) (empty-sosofo)) +(element (refsynopsisdivinfo abbrev) (empty-sosofo)) +(element (refsynopsisdivinfo abstract) (empty-sosofo)) +(element (refsynopsisdivinfo address) (empty-sosofo)) +(element (refsynopsisdivinfo artpagenums) (empty-sosofo)) +(element (refsynopsisdivinfo author) (empty-sosofo)) +(element (refsynopsisdivinfo authorgroup) (empty-sosofo)) +(element (refsynopsisdivinfo authorinitials) (empty-sosofo)) +(element (refsynopsisdivinfo bibliomisc) (empty-sosofo)) +(element (refsynopsisdivinfo biblioset) (empty-sosofo)) +(element (refsynopsisdivinfo collab) (empty-sosofo)) +(element (refsynopsisdivinfo confgroup) (empty-sosofo)) +(element (refsynopsisdivinfo contractnum) (empty-sosofo)) +(element (refsynopsisdivinfo contractsponsor) (empty-sosofo)) +(element (refsynopsisdivinfo copyright) (empty-sosofo)) +(element (refsynopsisdivinfo corpauthor) (empty-sosofo)) +(element (refsynopsisdivinfo corpname) (empty-sosofo)) +(element (refsynopsisdivinfo date) (empty-sosofo)) +(element (refsynopsisdivinfo edition) (empty-sosofo)) +(element (refsynopsisdivinfo editor) (empty-sosofo)) +(element (refsynopsisdivinfo invpartnumber) (empty-sosofo)) +(element (refsynopsisdivinfo isbn) (empty-sosofo)) +(element (refsynopsisdivinfo issn) (empty-sosofo)) +(element (refsynopsisdivinfo issuenum) (empty-sosofo)) +(element (refsynopsisdivinfo orgname) (empty-sosofo)) +(element (refsynopsisdivinfo othercredit) (empty-sosofo)) +(element (refsynopsisdivinfo pagenums) (empty-sosofo)) +(element (refsynopsisdivinfo printhistory) (empty-sosofo)) +(element (refsynopsisdivinfo productname) (empty-sosofo)) +(element (refsynopsisdivinfo productnumber) (empty-sosofo)) +(element (refsynopsisdivinfo pubdate) (empty-sosofo)) +(element (refsynopsisdivinfo publisher) (empty-sosofo)) +(element (refsynopsisdivinfo publishername) (empty-sosofo)) +(element (refsynopsisdivinfo pubsnumber) (empty-sosofo)) +(element (refsynopsisdivinfo releaseinfo) (empty-sosofo)) +(element (refsynopsisdivinfo revhistory) (empty-sosofo)) +(element (refsynopsisdivinfo seriesvolnums) (empty-sosofo)) +(element (refsynopsisdivinfo subtitle) (empty-sosofo)) +(element (refsynopsisdivinfo title) (empty-sosofo)) +(element (refsynopsisdivinfo titleabbrev) (empty-sosofo)) +(element (refsynopsisdivinfo volumenum) (empty-sosofo)) +(element (refsynopsisdivinfo honorific) (empty-sosofo)) +(element (refsynopsisdivinfo firstname) (empty-sosofo)) +(element (refsynopsisdivinfo surname) (empty-sosofo)) +(element (refsynopsisdivinfo lineage) (empty-sosofo)) +(element (refsynopsisdivinfo othername) (empty-sosofo)) +(element (refsynopsisdivinfo affiliation) (empty-sosofo)) +(element (refsynopsisdivinfo authorblurb) (empty-sosofo)) +(element (refsynopsisdivinfo contrib) (empty-sosofo)) + +(element appendixinfo (empty-sosofo)) +(element bibliographyinfo (empty-sosofo)) +(element chapterinfo (empty-sosofo)) +(element glossaryinfo (empty-sosofo)) +(element indexinfo (empty-sosofo)) +(element partinfo (empty-sosofo)) +(element prefaceinfo (empty-sosofo)) +(element refentryinfo (empty-sosofo)) +(element referenceinfo (empty-sosofo)) +(element setindexinfo (empty-sosofo)) +(element sidebarinfo (empty-sosofo)) diff --git a/html/dbinline.dsl b/html/dbinline.dsl new file mode 100644 index 0000000..2f274b9 --- /dev/null +++ b/html/dbinline.dsl @@ -0,0 +1,312 @@ +;; $Id: dbinline.dsl,v 1.11 2004/09/14 14:47:10 petere78 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ============================== INLINES =============================== + +(element abbrev (if %html40% + ($abbr-seq$) + ($charseq$))) +(element acronym (if %html40% + ($acronym-seq$) + ($charseq$))) +(element accel ($charseq$)) +(element action ($charseq$)) +(element application ($charseq$)) +(element classname ($code-seq$)) +(element constant ($code-seq$)) +(element command ($bold-seq$)) +(element computeroutput ($samp-seq$)) +(element database ($charseq$)) + +(element email + ($code-seq$ + (make sequence + (literal "<") + (make element gi: "A" + attributes: (list (list "HREF" + (string-append "mailto:" + (data (current-node))))) + (process-children)) + (literal ">")))) + +(element errorcode ($charseq$)) +(element errorname ($charseq$)) +(element errortype ($charseq$)) +(element envar ($code-seq$)) +(element filename ($mono-seq$)) ; unsure +(element function ($code-seq$)) +(element guibutton ($charseq$)) +(element guiicon ($charseq$)) +(element guilabel ($charseq$)) +(element guimenu ($charseq$)) +(element guimenuitem ($charseq$)) +(element guisubmenu ($charseq$)) +(element hardware ($charseq$)) +(element interface ($charseq$)) +(element interfacedefinition ($charseq$)) +(element keycap ($bold-seq$)) +(element keycode ($charseq$)) + +(element keycombo + (let* ((action (attribute-string (normalize "action"))) + (joinchar + (cond + ((equal? action (normalize "seq")) " ") ;; space + ((equal? action (normalize "simul")) "+") ;; + + ((equal? action (normalize "press")) "-") ;; ? I don't know + ((equal? action (normalize "click")) "-") ;; ? what to do + ((equal? action (normalize "double-click")) "-") ;; ? about the rest + ((equal? action (normalize "other")) "-") ;; ? of these + (else "-")))) + (let loop ((nl (children (current-node))) (count 1)) + (if (node-list-empty? nl) + (empty-sosofo) + (if (equal? count 1) + (make sequence + (process-node-list (node-list-first nl)) + (loop (node-list-rest nl) (+ count 1))) + (make sequence + (literal joinchar) + (process-node-list (node-list-first nl)) + (loop (node-list-rest nl) (+ count 1)))))))) + +(element keysym ($charseq$)) +(element literal ($mono-seq$)) +(element medialabel ($italic-seq$)) + +(element menuchoice + (let* ((shortcut (select-elements (children (current-node)) + (normalize "shortcut"))) + (items (node-list-filter-by-not-gi + (children (current-node)) + (list (normalize "shortcut"))))) + (make sequence + (let loop ((nl items) (first? #t)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (if first? + (process-node-list (node-list-first nl)) + (make sequence + (if (or (equal? (gi (node-list-first nl)) + (normalize "guimenuitem")) + (equal? (gi (node-list-first nl)) + (normalize "guisubmenu"))) + (make sequence + (literal "-") + (make entity-ref name: "gt")) + (literal "+")) + (process-node-list (node-list-first nl)))) + (loop (node-list-rest nl) #f)))) + (if (node-list-empty? shortcut) + (empty-sosofo) + (make sequence + (literal " (") + (process-node-list shortcut) + (literal ")")))))) + +(element methodname ($code-seq$)) +(element shortcut ($bold-seq$)) +(element mousebutton ($charseq$)) +(element option ($code-seq$)) + +(element optional + (make sequence + (literal %arg-choice-opt-open-str%) + ($charseq$) + (literal %arg-choice-opt-close-str%))) + +(element parameter ($code-seq$)) +(element property ($charseq$)) +(element prompt ($samp-seq$)) +(element replaceable ($italic-mono-seq$)) +(element returnvalue ($charseq$)) +(element structfield ($code-seq$)) +(element structname ($code-seq$)) +(element symbol ($code-seq$)) +(element systemitem ($charseq$)) ; ambiguous, should look at class +(element token ($charseq$)) +(element type ($charseq$)) ; ambiguous +(element userinput ($kbd-seq$)) +(element varname ($code-seq$)) + +(element citation + (if biblio-citation-check + (let* ((bgraphies (select-elements (descendants (sgml-root-element)) + (normalize "bibliography"))) + (bchildren1 (expand-children bgraphies + (list (normalize "bibliography")))) + (bchildren2 (expand-children bchildren1 + (list (normalize "bibliodiv")))) + (bibentries (node-list-filter-by-gi + bchildren2 + (list (normalize "biblioentry") + (normalize "bibliomixed"))))) + (let loop ((bibs bibentries)) + (if (node-list-empty? bibs) + (make sequence + (error (string-append "Cannot find citation: " + (data (current-node)))) + (literal "[") ($charseq$) (literal "]")) + (if (citation-matches-target? (current-node) + (node-list-first bibs)) + (make element gi: "A" + attributes: (list + (list "HREF" (href-to + (node-list-first bibs)))) + (literal "[") ($charseq$) (literal "]")) + (loop (node-list-rest bibs)))))) + (make sequence + (literal "[") ($charseq$) (literal "]")))) + +(element citerefentry + (if %citerefentry-link% + (make element gi: "A" + attributes: (list (list "HREF" ($generate-citerefentry-link$))) + (if %refentry-xref-italic% + ($italic-seq$) + ($charseq$))) + (if %refentry-xref-italic% + ($italic-seq$) + ($charseq$)))) + +(define ($generate-citerefentry-link$) + (empty-sosofo)) + +(define ($x-generate-citerefentry-link$) + (let* ((refentrytitle (select-elements (children (current-node)) + (normalize "refentrytitle"))) + (manvolnum (select-elements (children (current-node)) + (normalize "manvolnum")))) + (string-append "http://example.com/cgi-bin/man.cgi?" + (data refentrytitle) + "(" + (data manvolnum) + ")"))) + +(element citetitle + (if (equal? (attribute-string (normalize "pubwork")) "article") + (make sequence + (literal (gentext-start-quote)) + (process-children) + (literal (gentext-end-quote))) + ($italic-seq$))) + +(element emphasis + (let* ((class (if (and (attribute-string (normalize "role")) + %emphasis-propagates-style%) + (attribute-string (normalize "role")) + "emphasis"))) + (make element gi: "SPAN" + attributes: (list (list "CLASS" class)) + (if (and (attribute-string (normalize "role")) + (or (equal? (attribute-string (normalize "role")) "strong") + (equal? (attribute-string (normalize "role")) "bold"))) + ($bold-seq$) + ($italic-seq$))))) + +(element foreignphrase ($italic-seq$)) +(element markup ($charseq$)) + +(element phrase + (let* ((class (if (and (attribute-string (normalize "role")) + %phrase-propagates-style%) + (attribute-string (normalize "role")) + "phrase"))) + (make element gi: "SPAN" + attributes: (list (list "CLASS" class)) + ($charseq$)))) + +(element quote + (let* ((hnr (hierarchical-number-recursive (normalize "quote") + (current-node))) + (depth (length hnr))) + (make element gi: "SPAN" + attributes: '(("CLASS" "QUOTE")) + (if (equal? (modulo depth 2) 1) + (make sequence + (literal (gentext-start-nested-quote)) + (process-children) + (literal (gentext-end-nested-quote))) + (make sequence + (literal (gentext-start-quote)) + (process-children) + (literal (gentext-end-quote))))))) + +(element sgmltag + (let ((class (if (attribute-string (normalize "class")) + (attribute-string (normalize "class")) + (normalize "element")))) +")))) + ((equal? class (normalize "genentity")) ($code-seq$ (make sequence + (literal "&") + (process-children) + (literal ";")))) + ((equal? class (normalize "numcharref")) ($code-seq$ (make sequence + (literal "&#") + (process-children) + (literal ";")))) + ((equal? class (normalize "paramentity")) ($code-seq$ (make sequence + (literal "%") + (process-children) + (literal ";")))) + ((equal? class (normalize "pi")) ($code-seq$ (make sequence + (literal "")))) + ((equal? class (normalize "xmlpi")) ($code-seq$ (make sequence + (literal "")))) + ((equal? class (normalize "starttag")) ($code-seq$ (make sequence + (literal "<") + (process-children) + (literal ">")))) + ((equal? class (normalize "emptytag")) ($code-seq$ (make sequence + (literal "<") + (process-children) + (literal "/>")))) + ((equal? class (normalize "sgmlcomment")) ($code-seq$ (make sequence + (literal "")))) +]]> + (else ($charseq$))))) + +(element trademark + (make sequence + ($charseq$) + (cond + ((equal? (attribute-string "class") (normalize "copyright")) + (make entity-ref name: "copy")) + ((equal? (attribute-string "class") (normalize "registered")) + (make entity-ref name: "reg")) + ((equal? (attribute-string "class") (normalize "service")) + (make element gi: "SUP" + (literal "SM"))) + (else + (make entity-ref name: "#8482"))))) + +(element wordasword ($italic-seq$)) + +(element lineannotation + (process-children)) + +(element superscript + (make element gi: "SUP" + (process-children))) + +(element subscript + (make element gi: "SUB" + (process-children))) diff --git a/html/dblink.dsl b/html/dblink.dsl new file mode 100644 index 0000000..2f9c2cc --- /dev/null +++ b/html/dblink.dsl @@ -0,0 +1,433 @@ +;; $Id: dblink.dsl,v 1.6 2003/01/15 08:24:13 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ========================= LINKS AND ANCHORS ========================== + +(element link + (let* ((endterm (attribute-string (normalize "endterm"))) + (linkend (attribute-string (normalize "linkend"))) + (target (element-with-id linkend)) + (etarget (if endterm + (element-with-id endterm) + (empty-node-list)))) + ;; It isn't necessary to catch either of these errors. The normal + ;; ID/IDREF processing in Jade will catch them, and if -wno-idref + ;; is used, then it's your gun, your bullet, and your foot. +;; (if (node-list-empty? target) +;; (error (string-append "Link to missing ID '" linkend "'")) +;; (empty-sosofo)) +;; (if (and endterm (node-list-empty? etarget)) +;; (error (string-append "EndTerm to missing ID '" endterm "' on Link")) +;; (empty-sosofo)) + (if (node-list-empty? target) + (process-children) + (make element gi: "A" + attributes: (list (list "HREF" (href-to target))) + (if (and endterm (not (node-list-empty? etarget))) + (with-mode xref-endterm-mode (process-node-list etarget)) + (process-children)))))) + +(element ulink + (make element gi: "A" + attributes: (list + (list "HREF" (attribute-string (normalize "url"))) + (list "TARGET" "_top")) + (if (node-list-empty? (children (current-node))) + (literal (attribute-string (normalize "url"))) + (process-children)))) + +(element anchor + (make element gi: "A" + attributes: (list + (list "NAME" (attribute-string (normalize "id")))) + (empty-sosofo))) + +(element beginpage (empty-sosofo)) + +;; ====================================================================== + +(define (olink-link) + ;; This is an olink without a TARGETDOCENT, treat it as a link within + ;; the same document. + (let* ((localinfo (normalize (attribute-string (normalize "localinfo")))) + (target (element-with-id localinfo)) + (linkmode (attribute-string (normalize "linkmode"))) + (modespec (if linkmode (element-with-id linkmode) (empty-node-list))) + (xreflabel (if (node-list-empty? modespec) + #f + (attribute-string (normalize "xreflabel") modespec))) + (href (if (node-list-empty? target) + (error + (string-append "OLink to missing ID '" localinfo "'")) + (href-to target))) + (linktext (strip (data-of (current-node))))) + (make element gi: "A" + attributes: (list (list "HREF" href) + (list "CLASS" "OLINK")) + (if (equal? linktext "") + (if xreflabel + (xref-general target xreflabel) + (xref-general target)) + (process-children))))) + +(define (olink-href target modespec) + (let* ((pubid (entity-public-id target)) + (sysid (system-id-filename target)) + (localinfo (normalize (attribute-string (normalize "localinfo")))) + (qident (if pubid + (string-append %olink-pubid% (url-encode-string pubid)) + (string-append %olink-sysid% (url-encode-string sysid)))) + (qfragid (if localinfo + (string-append %olink-fragid% + (url-encode-string localinfo)) + "")) + (lb-href (string-append %olink-resolution% qident qfragid)) + (modetext (if (node-list-empty? modespec) "" (data-of modespec))) + (href (if (equal? (strip modetext) "") + lb-href + (if localinfo + (string-append + modetext "#" (url-encode-string localinfo)) + modetext)))) + href)) + +(define (olink-simple) + ;; Assumptions: + ;; - The TARGETDOCENT is identified by a public ID + ;; - LOLCALINFO contains the ID value (i.e. HREF fragment identifier) of + ;; the target resource + ;; - If the element has no content, the title extracted by + ;; (olink-resource-title) should be used + ;; - The (olink-resource-title) function can deduce the title from + ;; the pubid and the sysid + ;; - %olink-resolution% is the prefix to use on URLs (to point to a + ;; cgi-bin script, or whatever you can make work for you) + ;; - %olink-pubid% identifies the pubid in the query + ;; - %olink-fragid% identifies the fragment identifier in the query + (let* ((target (attribute-string (normalize "targetdocent"))) + (pubid (entity-public-id target)) + (sysid (system-id-filename target)) + (title (olink-resource-title pubid sysid)) + (href (olink-href target (empty-node-list))) + (linktext (strip (data-of (current-node))))) + (make element gi: "A" + attributes: (list (list "HREF" href) + (list "CLASS" "OLINK")) + (if (equal? linktext "") + (make element gi: "I" (literal title)) + (process-children))))) + +(define (olink-outline-xref olroot target linktext) + (let* ((name (attribute-string (normalize "name") target)) + (label (attribute-string (normalize "label") target)) + (title (select-elements (children target) (normalize "ttl"))) + (substitute (list + (list "%g" (if name (literal name) (literal ""))) + (list "%n" (if label (literal label) (literal ""))) + (list "%t" (with-mode olink-title-mode + (process-node-list title))))) + (tlist (match-split-list linktext (assoc-objs substitute)))) + (string-list-sosofo tlist substitute))) + +(define (olink-outline) + (let* ((target (attribute-string (normalize "targetdocent"))) + (localinfo (normalize (attribute-string (normalize "localinfo")))) + (sysid (entity-generated-system-id target)) + (basename (trim-string sysid '(".sgm" ".xml" ".sgml"))) + (olinkfile (string-append basename %olink-outline-ext%)) + (olinkdoc (sgml-parse olinkfile)) + (olinkroot (node-property 'document-element olinkdoc)) + (olnode (if localinfo + (element-with-id localinfo olinkroot) + olinkroot)) + (linkmode (attribute-string (normalize "linkmode"))) + (modespec (if linkmode (element-with-id linkmode) (empty-node-list))) + (xreflabel (if (node-list-empty? modespec) + "" + (attribute-string (normalize "xreflabel") modespec))) + (href (if (equal? (attribute-string (normalize "type")) "href") + (attribute-string (normalize "href") olnode) + (olink-href target modespec))) + (linktext (strip (data-of (current-node))))) + (make element gi: "A" + attributes: (list (list "HREF" href) + (list "CLASS" "OLINK")) + (if (equal? linktext "") + (olink-outline-xref olinkroot olnode xreflabel) + (process-children))))) + +(element olink + (if (not (attribute-string (normalize "targetdocent"))) + (olink-link) + (if (attribute-string (normalize "linkmode")) + (olink-outline) + (olink-simple)))) + +(mode olink-title-mode + (default (process-children)) + + (element ttl + (make element gi: "I" + (process-children))) + + (element it + (make element gi: "I" + (process-children))) + + (element tt + (make element gi: "TT" + (process-children))) + + (element sub + (make element gi: "SUB" + (process-children))) + + (element sup + (make element gi: "SUP" + (process-children))) +) + +;; ====================================================================== + +(element xref + (let* ((endterm (attribute-string (normalize "endterm"))) + (linkend (attribute-string (normalize "linkend"))) + (target (element-with-id linkend)) + (xreflabel (if (node-list-empty? target) + #f + (attribute-string (normalize "xreflabel") target)))) + (if (node-list-empty? target) + (error (string-append "XRef LinkEnd to missing ID '" linkend "'")) + (make element gi: "A" + attributes: (list + (list "HREF" (href-to target))) + (if xreflabel + (literal xreflabel) + (if endterm + (if (node-list-empty? (element-with-id endterm)) + (error (string-append + "XRef EndTerm to missing ID '" + endterm "'")) + (with-mode xref-endterm-mode + (process-node-list (element-with-id endterm)))) + (cond + ((or (equal? (gi target) (normalize "biblioentry")) + (equal? (gi target) (normalize "bibliomixed"))) + ;; xref to the bibliography is a special case + (xref-biblioentry target)) + ((equal? (gi target) (normalize "co")) + ;; callouts are a special case + ($callout-mark$ target #f)) + ((equal? (gi target) (normalize "listitem")) + ;; listitems are a special case + (if (equal? (gi (parent target)) (normalize "orderedlist")) + (literal (orderedlist-listitem-label-recursive target)) + (error (string-append "XRef to LISTITEM only supported in ORDEREDLISTs")))) + ((equal? (gi target) (normalize "varlistentry")) + (xref-varlistentry target)) + ((equal? (gi target) (normalize "question")) + ;; questions and answers are (yet another) special case + (make sequence + (literal (gentext-element-name target)) + (literal (gentext-label-title-sep target)) + (literal (question-answer-label target)))) + ((equal? (gi target) (normalize "answer")) + ;; questions and answers are (yet another) special case + (make sequence + (literal (gentext-element-name target)) + (literal (gentext-label-title-sep target)) + (literal (question-answer-label target)))) + ((equal? (gi target) (normalize "refentry")) + ;; so are refentrys + (xref-refentry target)) + ((equal? (gi target) (normalize "refnamediv")) + ;; and refnamedivs + (xref-refnamediv target)) + ((equal? (gi target) (normalize "glossentry")) + ;; as are glossentrys + (xref-glossentry target)) + ((equal? (gi target) (normalize "author")) + ;; and authors + (xref-author target)) + ((equal? (gi target) (normalize "authorgroup")) + ;; and authorgroups + (xref-authorgroup target)) +; this doesn't really work very well yet +; ((equal? (gi target) (normalize "substeps")) +; ;; and substeps +; (xref-substeps target)) + (else + (xref-general target))))))))) + +(define (xref-refentry target) +;; refmeta/refentrytitle, refmeta/manvolnum, refnamediv/refdescriptor, +;; refnamediv/refname + (let* ((refmeta (select-elements (children target) + (normalize "refmeta"))) + (refnamediv (select-elements (children target) + (normalize "refnamediv"))) + (rfetitle (select-elements (children refmeta) + (normalize "refentrytitle"))) + (manvolnum (select-elements (children refmeta) + (normalize "manvolnum"))) + (refdescrip (select-elements (children refnamediv) + (normalize "refdescriptor"))) + (refname (select-elements (children refnamediv) + (normalize "refname"))) + + (title (if (node-list-empty? rfetitle) + (if (node-list-empty? refdescrip) + (node-list-first refname) + (node-list-first refdescrip)) + (node-list-first rfetitle))) + + (xsosofo (make sequence + (process-node-list (children title)) + (if (and %refentry-xref-manvolnum% + (not (node-list-empty? manvolnum))) + (process-node-list manvolnum) + (empty-sosofo))))) + + (make sequence + (if %refentry-xref-italic% + (make element gi: "I" + xsosofo) + xsosofo)))) + +(define (xref-refnamediv target) + (let* ((refname (select-elements (children target) + (normalize "refname"))) + + (title (node-list-first refname)) + + (xsosofo (make sequence + (process-node-list (children title))))) + (make sequence + (if %refentry-xref-italic% + (make element gi: "I" + xsosofo) + xsosofo)))) + +(define (xref-varlistentry target) + (let ((terms (select-elements (children target) + (normalize "term")))) + (with-mode xref-varlistentry-mode + (process-node-list (node-list-first terms))))) + +(define (xref-glossentry target) + (let ((glossterms (select-elements (children target) + (normalize "glossterm")))) + (with-mode xref-glossentry-mode + (process-node-list (node-list-first glossterms))))) + +(define (xref-author target) + (literal (author-string target))) + +(define (xref-authorgroup target) + ;; it's a quirk of author-list-string that it needs to point to + ;; one of the authors in the authorgroup, not the authorgroup. + ;; go figure. + (let loop ((author (select-elements (children target) (normalize "author")))) + (if (node-list-empty? author) + (empty-sosofo) + (make sequence + (literal (author-list-string (node-list-first author))) + (loop (node-list-rest author)))))) + +;(define (xref-substeps target) +; (let* ((steps (select-elements (children target) (normalize "step"))) +; (firststep (node-list-first steps)) +; (laststep (node-list-last steps)) +; (firstlabel (auto-xref-direct firststep)) +; (lastlabel (auto-xref-direct laststep "%n"))) +; (make sequence +; firstlabel +; (literal "-") +; lastlabel))) + +(define (xref-general target #!optional (xref-string #f)) + ;; This function is used by both XREF and OLINK (when no TARGETDOCENT + ;; is specified). The only case where xref-string is supplied is + ;; on OLINK. + (let ((label (attribute-string (normalize "xreflabel") target))) + (if xref-string + (auto-xref target xref-string) + (if label + (xreflabel-sosofo label) + (auto-xref target))))) + +(define (xref-biblioentry target) + (let* ((abbrev (node-list-first + (node-list-filter-out-pis (children target)))) + (label (attribute-string (normalize "xreflabel") target))) + + (if biblio-xref-title + (let* ((citetitles (select-elements (descendants target) + (normalize "citetitle"))) + (titles (select-elements (descendants target) + (normalize "title"))) + (title (if (node-list-empty? citetitles) + (node-list-first titles) + (node-list-first citetitles)))) + (with-mode xref-title-mode + (process-node-list title))) + (if biblio-number + (make sequence + (literal "[" (number->string (bibentry-number target)) "]")) + (if label + (make sequence + (literal "[" label "]")) + (if (equal? (gi abbrev) (normalize "abbrev")) + (make sequence + (process-node-list abbrev)) + (make sequence + (literal "[" (id target) "]")))))))) + +(mode xref-endterm-mode + (default + (make element gi: "I" + (process-children-trim)))) + +(define (xreflabel-sosofo xreflabel) + (make element gi: "I" + (literal xreflabel))) + +;; Returns the title of the element as a sosofo, italicized for xref. +;; +(define (element-title-xref-sosofo nd) + (make element gi: "I" + (element-title-sosofo nd))) + +(mode xref-title-mode + (element title + (make element gi: "I" + (process-children-trim))) + + (element citetitle + (make element gi: "I" + (process-children-trim))) + + (element refname + (process-children-trim)) + + (element refentrytitle + (process-children-trim))) + +(mode xref-varlistentry-mode + (element term + ($italic-seq$))) + +(mode xref-glossentry-mode + (element glossterm + ($italic-seq$))) + +;; ====================================================================== + +(define (element-page-number-sosofo target) + (literal "???")) + +;; ====================================================================== + diff --git a/html/dblists.dsl b/html/dblists.dsl new file mode 100644 index 0000000..1585c2c --- /dev/null +++ b/html/dblists.dsl @@ -0,0 +1,435 @@ +;; $Id: dblists.dsl,v 1.6 2003/04/05 21:39:15 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; =============================== LISTS ================================ + +(element orderedlist + (let* ((depth (length (hierarchical-number-recursive + (normalize "orderedlist")))) + (numeration (attribute-string (normalize "numeration"))) + (firstitem (node-list-first + (select-elements (children (current-node)) + (normalize "listitem")))) + (start (orderedlist-listitem-number firstitem)) + (rawnum (cond + ((equal? numeration (normalize "arabic")) 0) + ((equal? numeration (normalize "loweralpha")) 1) + ((equal? numeration (normalize "lowerroman")) 2) + ((equal? numeration (normalize "upperalpha")) 3) + ((equal? numeration (normalize "upperroman")) 4) + (else (modulo depth 5)))) + (type (case rawnum + ((0) "1") + ((1) "a") + ((2) "i") + ((3) "A") + ((4) "I")))) + (make sequence + (if %spacing-paras% + (make element gi: "P" (empty-sosofo)) + (empty-sosofo)) + (para-check) + (process-node-list (select-elements (children (current-node)) + (normalize "title"))) + (make element gi: "OL" + attributes: (append + (if (equal? start 1) + '() + (list (list "START" (number->string start)))) + (if (equal? (attribute-string (normalize "spacing")) + (normalize "compact")) + '(("COMPACT" "COMPACT")) + '()) + (list (list "TYPE" type))) + (process-node-list (select-elements (children (current-node)) + (normalize "listitem")))) + (para-check 'restart)))) + +(element (orderedlist title) + (make element gi: "P" + (make element gi: "B" + (process-children)))) + +(element itemizedlist + (make sequence + (if %spacing-paras% + (make element gi: "P" (empty-sosofo)) + (empty-sosofo)) + (para-check) + (process-node-list (select-elements (children (current-node)) + (normalize "title"))) + (make element gi: "UL" + attributes: (if (equal? (attribute-string (normalize "spacing")) (normalize "compact")) + '(("COMPACT" "COMPACT")) + '()) + (process-node-list (select-elements (children (current-node)) + (normalize "listitem")))) + (para-check 'restart))) + +(element listitem + (let* ((override (inherited-attribute-string (normalize "override"))) + (mark (inherited-attribute-string (normalize "mark"))) + (usemark (if override override mark)) + (cssmark (if (and usemark (assoc usemark %css-liststyle-alist%)) + (car (cdr (assoc usemark %css-liststyle-alist%))) + usemark)) + (cssstyle (if (and %css-decoration% cssmark) + (list (list "STYLE" + (string-append "list-style-type: " + cssmark))) + '()))) + (make element gi: "LI" + attributes: cssstyle + (if (attribute-string (normalize "id")) + (make element gi: "A" + attributes: (list + (list "NAME" (attribute-string (normalize "id")))) + (empty-sosofo)) + (empty-sosofo)) + (process-children)))) + +(element (orderedlist listitem simpara) + (let* ((spacing (inherited-attribute-string (normalize "spacing"))) + (listitem (parent (current-node))) + (lichildren (node-list-filter-out-pis + (children listitem))) + (childcount (node-list-length lichildren))) + (if (and (equal? spacing (normalize "compact")) + (equal? childcount 1)) + ($paragraph$ "SPAN") + (next-match)))) + +(element (itemizedlist listitem simpara) + (let* ((spacing (inherited-attribute-string (normalize "spacing"))) + (listitem (parent (current-node))) + (lichildren (node-list-filter-out-pis + (children listitem))) + (childcount (node-list-length lichildren))) + (if (and (equal? spacing (normalize "compact")) + (equal? childcount 1)) + ($paragraph$ "SPAN") + (next-match)))) + +(element variablelist + (let* ((termlength (if (attribute-string (normalize "termlength")) + (string->number + (attribute-string (normalize "termlength"))) + %default-variablelist-termlength%)) + (too-long? (variablelist-term-too-long? termlength))) + (make sequence + (if %spacing-paras% + (make element gi: "P" (empty-sosofo)) + (empty-sosofo)) + (para-check) + + (if (and (or (and termlength (not too-long?)) + %always-format-variablelist-as-table%) + (or %may-format-variablelist-as-table% + %always-format-variablelist-as-table%)) + (make element gi: "TABLE" + attributes: '(("CLASS" "VARIABLELIST") + ("BORDER" "0") + ("CELLSPACING" "1") + ("CELLPADDING" "1")) + (if %html40% + (make element gi: "TBODY" + (with-mode variablelist-table + (process-children))) + (with-mode variablelist-table + (process-children)))) + (make sequence + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-node-list + (select-elements (children (current-node)) + (normalize "title"))) + (make element gi: "DL" + (process-node-list + (select-elements (children (current-node)) + (normalize "varlistentry"))))))) + (para-check 'restart)))) + +(element varlistentry + (let ((terms (select-elements (children (current-node)) (normalize "term"))) + (listitem (select-elements (children (current-node)) (normalize "listitem")))) + (make sequence + (make element gi: "DT" + (if (attribute-string (normalize "id")) + (make sequence + (make element gi: "A" + attributes: (list + (list "NAME" (attribute-string (normalize "id")))) + (empty-sosofo)) + (process-node-list terms)) + (process-node-list terms))) + (process-node-list listitem)))) + +(element (varlistentry term) + (make sequence + (process-children-trim) + (if (not (last-sibling?)) + (literal ", ") + (literal "")))) + +(element (varlistentry listitem) + (make element gi: "DD" + (process-children))) + +(mode variablelist-table + (element (variablelist title) + (make element gi: "TR" + attributes: '(("CLASS" "TITLE")) + (make element gi: "TH" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("COLSPAN" "3")) + (process-children)))) + + (element varlistentry + (let* ((terms (select-elements (children (current-node)) + (normalize "term"))) + (listitem (select-elements (children (current-node)) + (normalize "listitem"))) + (termlen (if (attribute-string (normalize "termlength") + (parent (current-node))) + (string->number (attribute-string + (normalize "termlength") + (parent (current-node)))) + %default-variablelist-termlength%)) + (too-long? (varlistentry-term-too-long? (current-node) termlen))) + (if too-long? + (make sequence + (make element gi: "TR" + (make element gi: "TD" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("COLSPAN" "3")) + (make element gi: "A" + attributes: (list + (list "NAME" (element-id))) + (empty-sosofo)) + (process-node-list terms))) + (make element gi: "TR" + (make element gi: "TD" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("WIDTH" "5")) + ;; where terms would have gone + (make entity-ref name: "nbsp")) + (make element gi: "TD" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("WIDTH" "5")) + ;; just a little spacer + (make entity-ref name: "nbsp")) + (make element gi: "TD" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP")) + (process-node-list listitem)))) + (make element gi: "TR" + (make element gi: "TD" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP")) + (make element gi: "A" + attributes: (list + (list "NAME" (element-id))) + (empty-sosofo)) + (process-node-list terms)) + (make element gi: "TD" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("WIDTH" "5")) + ;; just a little spacer + (make entity-ref name: "nbsp")) + (make element gi: "TD" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP")) + (process-node-list listitem)))))) + + (element (varlistentry term) + (make sequence + (if %css-decoration% + (make element gi: "SPAN" + attributes: '(("STYLE" "white-space: nowrap")) + (process-children-trim)) + (make element gi: "NOBR" + (process-children-trim))) + (if (not (last-sibling?)) + (literal ", ") + (literal "")))) + + (element (varlistentry listitem) + (process-children)) +) + +(define (simplelist-table majororder cols members) + (let* ((termcount (node-list-length members)) + (rows (quotient (+ termcount (- cols 1)) cols)) + (htmlrows (let rowloop ((rownum 1)) + (if (> rownum rows) + (empty-sosofo) + (make sequence + (simplelist-row rownum majororder + rows cols members) + (rowloop (+ rownum 1))))))) + (make sequence + (if %spacing-paras% + (make element gi: "P" (empty-sosofo)) + (empty-sosofo)) + (make element gi: "TABLE" + attributes: '(("BORDER" "0")) + (if %html40% + (make element gi: "TBODY" + htmlrows) + htmlrows)) + (if %spacing-paras% + (make element gi: "P" (empty-sosofo)) + (empty-sosofo))))) + +(define (simplelist-row rownum majororder rows cols members) + (make element gi: "TR" + (let colloop ((colnum 1)) + (if (> colnum cols) + (empty-sosofo) + (make sequence + (simplelist-entry rownum colnum majororder rows cols members) + (colloop (+ colnum 1))))))) + +(define (simplelist-entry rownum colnum majororder rows cols members) + (let ((membernum (if (equal? majororder 'row) + (+ (* (- rownum 1) cols) colnum) + (+ (* (- colnum 1) rows) rownum))) + (attlist (if %simplelist-column-width% + (list (list "WIDTH" %simplelist-column-width%)) + '()))) + (let loop ((nl members) (count membernum)) + (if (<= count 1) + (make element gi: "TD" + attributes: attlist + (if (node-list-empty? nl) + (make entity-ref name: "nbsp") + (process-node-list (node-list-first nl)))) + (loop (node-list-rest nl) (- count 1)))))) + +(element simplelist + (let ((type (attribute-string "type")) + (cols (if (attribute-string "columns") + (if (> (string->number (attribute-string "columns")) 0) + (string->number (attribute-string "columns")) + 1) + 1)) + (members (select-elements (children (current-node)) (normalize "member")))) + (cond + ((equal? type (normalize "inline")) + (process-children)) + ((equal? type (normalize "vert")) + (simplelist-table 'column cols members)) + ((equal? type (normalize "horiz")) + (simplelist-table 'row cols members))))) + +(element member + (let ((type (inherited-attribute-string (normalize "type")))) + (if (equal? type (normalize "inline")) + (make sequence + (process-children-trim) + (if (not (last-sibling?)) + (literal ", ") + (literal ""))) + (process-children)))) + +(element segmentedlist (process-children)) +(element (segmentedlist title) ($lowtitle$ 6)) + +(element segtitle (empty-sosofo)) + +(mode seglist-in-seg + (element segtitle + (process-children))) + +(element seglistitem (process-children)) +(element seg + (let* ((seg-num (child-number (current-node))) + (seglist (parent (parent (current-node)))) + (segtitle (nth-node (select-elements + (descendants seglist) (normalize "segtitle")) seg-num))) + + ;; Note: segtitle is only going to be the right thing in a well formed + ;; SegmentedList. If there are too many Segs or too few SegTitles, + ;; you'll get something odd...maybe an error + + (with-mode seglist-in-seg + (make element gi: "P" + (make element gi: "B" + (sosofo-append (process-node-list segtitle)) + (literal ": ")) + (process-children))))) + +(element calloutlist + (let* ((nsep (gentext-label-title-sep (gi))) + (id (attribute-string (normalize "id"))) + (titlesosofo (make sequence + (literal (gentext-element-name (gi))) + (if (string=? (element-label) "") + (literal nsep) + (literal " " (element-label) nsep)) + (element-title-sosofo)))) + (make element gi: "DIV" + attributes: (list + (list "CLASS" (gi))) + (if (node-list-empty? + (select-elements (children (current-node)) (normalize "title"))) + (empty-sosofo) + (make element gi: "P" + (make element gi: "B" + (if id + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" id)) + (empty-sosofo)) + titlesosofo) + titlesosofo)))) + (make element gi: "DL" + attributes: '(("COMPACT" "COMPACT")) + (process-children))))) + +(element (calloutlist title) (empty-sosofo)) + +(element callout + (process-children)) + +(element (calloutlist callout) + (process-children)) + +(element (calloutlist callout para) + (let ((footnotes (select-elements (descendants (current-node)) + (normalize "footnote")))) + (make sequence + (if (= (child-number) 1) + (let* ((ilevel (length (hierarchical-number-recursive + (normalize "calloutlist")))) + (arearefs (inherited-attribute-string (normalize "arearefs"))) + (idlist (split arearefs))) + (make sequence + (make element gi: "DT" + (let loop ((ids idlist)) + (if (null? ids) + (empty-sosofo) + (make sequence + ($callout-mark$ (element-with-id (car ids)) #f) + (loop (cdr ids)))))) + (make element gi: "DD" + (process-children)))) + (make element gi: "DD" + (make element gi: "P" + (process-children)))) + + (if (or %footnotes-at-end% (node-list-empty? footnotes)) + (empty-sosofo) + (make element gi: "BLOCKQUOTE" + attributes: (list + (list "CLASS" "FOOTNOTES")) + (with-mode footnote-mode + (process-node-list footnotes))))))) diff --git a/html/dblot.dsl b/html/dblot.dsl new file mode 100644 index 0000000..5524bd6 --- /dev/null +++ b/html/dblot.dsl @@ -0,0 +1,24 @@ +;; $Id: dblot.dsl,v 1.2 2003/01/15 08:24:13 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; need test cases to do toc/lot; do these later + +(element toc (empty-sosofo)) +(element (toc title) (empty-sosofo)) +(element tocfront ($paragraph$)) +(element tocentry ($paragraph$)) +(element tocpart (process-children)) +(element tocchap (process-children)) +(element toclevel1 (process-children)) +(element toclevel2 (process-children)) +(element toclevel3 (process-children)) +(element toclevel4 (process-children)) +(element toclevel5 (process-children)) +(element tocback ($paragraph$)) +(element lot (empty-sosofo)) +(element (lot title) (empty-sosofo)) +(element lotentry ($paragraph$)) + diff --git a/html/dbmath.dsl b/html/dbmath.dsl new file mode 100644 index 0000000..c72d9ed --- /dev/null +++ b/html/dbmath.dsl @@ -0,0 +1,67 @@ +;; $Id: dbmath.dsl,v 1.2 2003/01/15 08:24:13 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +(define %equation-autolabel% #f) + +(element equation + ;; derived from $semiformal-object$ + (if (node-list-empty? (select-elements (children (current-node)) + (normalize "title"))) + ($informal-object$ %informalequation-rules% %informalequation-rules%) + ($formal-object$ %informalequation-rules% %informalequation-rules%))) + +(element (equation title) (empty-sosofo)) +(element (equation alt) (empty-sosofo)) +(element (equation graphic) + (let ((alttag (select-elements (children (parent)) (normalize "alt")))) + (if alttag + ($img$ (current-node) (data alttag)) + ($img$)))) + +(element informalequation + ;; Derived from informal-object + (let ((rule-before? %informalequation-rules%) + (rule-after? %informalequation-rules%)) + (if %equation-autolabel% + (make sequence + (if rule-before? + (make empty-element gi: "HR") + (empty-sosofo)) + (make element gi: "TABLE" + attributes: '(("CLASS" "INFORMALEQUATION") + ("WIDTH" "100%") + ("BORDER" "0")) + (make element gi: "TR" + (make element gi: "TD" + attributes: '(("VALIGN" "MIDDLE") + ("ALIGN" "LEFT")) + (process-children)) + (make element gi: "TD" + attributes: '(("VALIGN" "MIDDLE") + ("ALIGN" "RIGHT") + ("WIDTH" "100")) + (literal "(" + (element-label (current-node)) + ")")))) + (if rule-after? + (make empty-element gi: "HR") + (empty-sosofo))) + ($informal-object$ rule-before? rule-after?)))) + +(element (informalequation alt) (empty-sosofo)) +(element (informalequation graphic) + (let ((alttag (select-elements (children (parent)) (normalize "alt")))) + (if alttag + ($img$ (current-node) (data alttag)) + ($img$)))) + +(element inlineequation ($inline-object$)) +(element (inlineequation alt) (empty-sosofo)) +(element (inlineequation graphic) + (let ((alttag (select-elements (children (parent)) (normalize "alt")))) + (if alttag + ($img$ (current-node) (data alttag)) + ($img$)))) diff --git a/html/dbmsgset.dsl b/html/dbmsgset.dsl new file mode 100644 index 0000000..6f6fb6e --- /dev/null +++ b/html/dbmsgset.dsl @@ -0,0 +1,42 @@ +;; $Id: dbmsgset.dsl,v 1.2 2003/01/15 08:24:13 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ======================== ERROR MESSAGES (ETC.) ======================= + +(element msgset (process-children)) + +(element msgentry ($block-container$)) + +(element simplemsgentry ($block-container$)) + +(element msg ($block-container$)) + +(element msgmain (process-children)) + +(element msgsub + (process-children)) + +(element msgrel (empty-sosofo)) + +(element msgtext (process-children)) + +(element msginfo ($indent-para-container$)) + +(define ($genhead-para$ headtext) + (make element gi: "P" + (make element gi: "B" + (literal + (string-append headtext ": "))) + (process-children))) + +(element msglevel ($genhead-para$ (gentext-element-name (current-node)))) +(element msgorig ($genhead-para$ (gentext-element-name (current-node)))) +(element msgaud ($genhead-para$ (gentext-element-name (current-node)))) + +(element msgexplan ($indent-para-container$)) +(element (msgexplan title) ($runinhead$)) +(element (msgexplan para) (make sequence (process-children))) + diff --git a/html/dbnavig.dsl b/html/dbnavig.dsl new file mode 100644 index 0000000..eabcead --- /dev/null +++ b/html/dbnavig.dsl @@ -0,0 +1,1058 @@ +;; $Id: dbnavig.dsl,v 1.3 2001/07/05 12:08:42 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; The header of a chunk has this form: +;; +;; +-----------------------------------------+ +;; | nav-banner | +;; +------------+---------------+------------| +;; | prevlink | nav-context | nextlink | +;; +-----------------------------------------+ + +(define (nav-banner? elemnode) + ;; This node has a banner if: + ;; 1. There's an inherited dbhtml PI value for "banner-text" and that + ;; value is not the empty string, or + ;; 2. The element is not the root element + (let ((banner (inherited-dbhtml-value elemnode "banner-text"))) + (or (and banner (not (string=? banner ""))) + (not (node-list=? elemnode (sgml-root-element)))))) + +(define (nav-banner elemnode) + (let* ((rootelem (sgml-root-element)) + (info (info-element rootelem)) + (subtitle-child (select-elements (children rootelem) + (normalize "subtitle"))) + (subtitle-info (select-elements (children info) + (normalize "subtitle"))) + (subtitle (if (node-list-empty? subtitle-info) + subtitle-child + subtitle-info)) + (banner-text (inherited-dbhtml-value elemnode "banner-text")) + (banner-href (inherited-dbhtml-value elemnode "banner-href")) + (banner (if (and banner-text (not (string=? banner-text ""))) + (literal banner-text) + (make sequence + (element-title-sosofo rootelem) + (if (node-list-empty? subtitle) + (empty-sosofo) + (make sequence + (literal ": ") + (with-mode subtitle-mode + (process-node-list subtitle)))))))) + (make sequence + (if banner-href + (make element gi: "A" + attributes: (list (list "HREF" banner-href)) + banner) + banner)))) + +(define (nav-context? elemnode) + ;; Print a context header if + ;; 1. There's an inherited dbhtml PI value for "context-text" and that + ;; value is not the empty string, or + ;; 2. The chunk is a top level section and the parent component + ;; isn't the same as the root element (which appears in the nav-banner). + ;; + (let* ((context-text (inherited-dbhtml-value elemnode "context-text")) + (rootelem (sgml-root-element)) + (component (ancestor-member elemnode + (append (book-element-list) + (division-element-list) + (component-element-list)))) + (gencontext (and (or (equal? (gi elemnode) (normalize "sect1")) + (equal? (gi elemnode) (normalize "section"))) + (not (node-list=? component rootelem))))) + (or gencontext + (and context-text (not (string=? context-text "")))))) + +(define (nav-context elemnode) + ;; Print the context string for elemnode. If there's an inherited + ;; dbhtml value for 'context-text', use that. Otherwise, use the + ;; title of the parent component... + (let* ((context-href (inherited-dbhtml-value elemnode "context-href"))) + (if (nav-context? elemnode) + (if context-href + (make element gi: "A" + attributes: (list (list "HREF" context-href)) + (nav-context-sosofo elemnode)) + (nav-context-sosofo elemnode)) + (empty-sosofo)))) + +(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"))) + (empty-sosofo) + (literal (gentext-element-name-space (gi component)))) + (element-label-sosofo component) + (literal (gentext-label-title-sep (gi component))) + (element-title-sosofo component)))))) + +;; The footer of a chunk has this form: +;; +;; +----------------------------------------+ +;; | prevlink | nav-home | nextlink | +;; +------------+--------------+------------| +;; | p. title | nav-up | n. title | +;; +-----------------------------------------+ + +(define (nav-home? elemnode) + (not (node-list=? elemnode (sgml-root-element)))) + +(define (nav-home elemnode) + (sgml-root-element)) + +(define (nav-home-link elemnode) + (let ((home (nav-home elemnode)) + (home-text (inherited-dbhtml-value elemnode "home-text"))) + (if (node-list=? elemnode home) + (make entity-ref name: "nbsp") + (make element gi: "A" + attributes: (list + (list "HREF" + (href-to home)) + (list "ACCESSKEY" "H")) + (if home-text + (literal home-text) + (gentext-nav-home home)))))) + +;; nav-up is displayed in the bottom center of the footer-navigation +;; table. The definition below will show "Up" for nested components +;; (the component wrapping a section, the division wrapping a component +;; etc.). It can be abused for other things, such as an index... +;; +(define (nav-up? elemnode) + (let ((up (parent elemnode)) + (up-text (inherited-dbhtml-value elemnode "up-text"))) + (if (and up-text (not (string=? up-text ""))) + #t + (if (or (node-list-empty? up) + (node-list=? up (sgml-root-element)) + (equal? (gi up) (normalize "bookinfo")) + (equal? (gi up) (normalize "docinfo")) + (equal? (gi up) (normalize "setinfo"))) + #f + #t)))) + +(define (nav-up elemnode) + (let* ((up (parent elemnode)) + (up-href (inherited-dbhtml-value elemnode "up-href")) + (uplink? (not (or (node-list-empty? up) + (node-list=? up (sgml-root-element))))) + (href (if up-href + up-href + (if uplink? + (href-to up) + #f)))) + (if href + (make element gi: "A" + attributes: (list + (list "HREF" href) + (list "ACCESSKEY" "U")) + (nav-up-sosofo elemnode)) + (nav-up-sosofo elemnode)))) + +(define (nav-up-sosofo elemnode) + (let* ((up (parent elemnode)) + (up-text (inherited-dbhtml-value elemnode "up-text"))) + (if (and up-text (not (string=? up-text ""))) + (literal up-text) + (if (or (node-list-empty? up) + (node-list=? up (sgml-root-element))) + (make entity-ref name: "nbsp") + (gentext-nav-up up))))) + +(define (nav-footer elemnode) + (empty-sosofo)) + +;; ====================================================================== + +(define (header-navigation nd #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element nd) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element nd) + (list-ref navlist 1))) + (prevm (if (null? navlist) + (prev-major-component-chunk-element nd) + (list-ref navlist 2))) + (nextm (if (null? navlist) + (next-major-component-chunk-element nd) + (list-ref navlist 3))) + (rnavlist (list prev next prevm nextm))) + (make sequence + ($html-body-start$) + (if %header-navigation% + (cond + ((equal? (gi nd) (normalize "set")) + (set-header-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "book")) + (book-header-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "part")) + (part-header-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "preface")) + (preface-header-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "chapter")) + (chapter-header-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "article")) + (article-header-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "appendix")) + (appendix-header-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "reference")) + (reference-header-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "refentry")) + (refentry-header-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "glossary")) + (glossary-header-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "bibliography")) + (bibliography-header-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "index")) + (index-header-navigation nd rnavlist)) + ;; LegalNotice only happens when %generate-legalnotice-link% is #t + ((equal? (gi nd) (normalize "legalnotice")) + (default-header-navigation nd + (empty-node-list) (empty-node-list) + (empty-node-list) (empty-node-list))) + ((member (gi nd) (section-element-list)) + (section-header-navigation nd rnavlist)) + (else (default-header-navigation nd prev next prevm nextm))) + (empty-sosofo)) + ($user-header-navigation$ prev next prevm nextm) + ($html-body-content-start$)))) + +(define (footer-navigation nd #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element nd) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element nd) + (list-ref navlist 1))) + (prevm (if (null? navlist) + (prev-major-component-chunk-element nd) + (list-ref navlist 2))) + (nextm (if (null? navlist) + (next-major-component-chunk-element nd) + (list-ref navlist 3))) + (rnavlist (list prev next prevm nextm))) + (make sequence + (make-endnotes) + ($html-body-content-end$) + ($user-footer-navigation$ prev next prevm nextm) + (if %footer-navigation% + (cond + ((equal? (gi nd) (normalize "set")) + (set-footer-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "book")) + (book-footer-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "part")) + (part-footer-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "preface")) + (preface-footer-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "chapter")) + (chapter-footer-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "article")) + (article-footer-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "appendix")) + (appendix-footer-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "reference")) + (reference-footer-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "refentry")) + (refentry-footer-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "glossary")) + (glossary-footer-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "bibliography")) + (bibliography-footer-navigation nd rnavlist)) + ((equal? (gi nd) (normalize "index")) + (index-footer-navigation nd rnavlist)) + ;; LegalNotice only happens when %generate-legalnotice-link% is #t + ((equal? (gi nd) (normalize "legalnotice")) + (default-footer-navigation nd + (empty-node-list) (empty-node-list) + (empty-node-list) (empty-node-list))) + ((member (gi nd) (section-element-list)) + (section-footer-navigation nd rnavlist)) + (else (default-footer-navigation nd prev next prevm nextm))) + (empty-sosofo)) + (nav-footer nd) + ($html-body-end$)))) + +(define (set-header-navigation elemnode #!optional (navlist '())) + (empty-sosofo)) + +(define (book-header-navigation elemnode #!optional (navlist '())) + (empty-sosofo)) + +(define (part-header-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-header-navigation elemnode prev next prevsib nextsib))) + +(define (preface-header-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-header-navigation elemnode prev next prevsib nextsib))) + +(define (chapter-header-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-header-navigation elemnode prev next prevsib nextsib))) + +(define (appendix-header-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-header-navigation elemnode prev next prevsib nextsib))) + +(define (article-header-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (if (node-list=? elemnode (sgml-root-element)) + (empty-sosofo) + (default-header-navigation elemnode prev next prevsib nextsib)))) + +(define (glossary-header-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-header-navigation elemnode prev next prevsib nextsib))) + +(define (bibliography-header-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-header-navigation elemnode prev next prevsib nextsib))) + +(define (index-header-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-header-navigation elemnode prev next prevsib nextsib))) + +(define (reference-header-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-header-navigation elemnode prev next prevsib nextsib))) + +(define (refentry-header-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-header-navigation elemnode prev next prevsib nextsib))) + +(define (section-header-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-header-navigation elemnode prev next prevsib nextsib))) + +(define (set-footer-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-footer-navigation elemnode prev next prevsib nextsib))) + +(define (book-footer-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-footer-navigation elemnode prev next prevsib nextsib))) + +(define (part-footer-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-footer-navigation elemnode prev next prevsib nextsib))) + +(define (preface-footer-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-footer-navigation elemnode prev next prevsib nextsib))) + +(define (chapter-footer-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-footer-navigation elemnode prev next prevsib nextsib))) + +(define (appendix-footer-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-footer-navigation elemnode prev next prevsib nextsib))) + +(define (article-footer-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-footer-navigation elemnode prev next prevsib nextsib))) + +(define (glossary-footer-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-footer-navigation elemnode prev next prevsib nextsib))) + +(define (bibliography-footer-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-footer-navigation elemnode prev next prevsib nextsib))) + +(define (index-footer-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-footer-navigation elemnode prev next prevsib nextsib))) + +(define (reference-footer-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-footer-navigation elemnode prev next prevsib nextsib))) + +(define (refentry-footer-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-footer-navigation elemnode prev next prevsib nextsib))) + +(define (section-footer-navigation elemnode #!optional (navlist '())) + (let* ((prev (if (null? navlist) + (prev-chunk-element elemnode) + (list-ref navlist 0))) + (next (if (null? navlist) + (next-chunk-element elemnode) + (list-ref navlist 1))) + (prevsib (if (null? navlist) + (prev-major-component-chunk-element elemnode) + (list-ref navlist 2))) + (nextsib (if (null? navlist) + (next-major-component-chunk-element elemnode) + (list-ref navlist 3)))) + (default-footer-navigation elemnode prev next prevsib nextsib))) + +;; ---------------------------------------------------------------------- + +(define (default-header-nav-tbl-ff elemnode prev next prevsib nextsib) + (let* ((r1? (nav-banner? elemnode)) + (r1-sosofo (make element gi: "TR" + (make element gi: "TH" + attributes: (list + (list "COLSPAN" "5") + (list "ALIGN" "center") + (list "VALIGN" "bottom")) + (nav-banner elemnode)))) + (r2? (or (not (node-list-empty? prev)) + (not (node-list-empty? next)) + (not (node-list-empty? prevsib)) + (not (node-list-empty? nextsib)) + (nav-context? elemnode))) + (r2-sosofo (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "WIDTH" "10%") + (list "ALIGN" "left") + (list "VALIGN" "top")) + (if (node-list-empty? prev) + (make entity-ref name: "nbsp") + (make element gi: "A" + attributes: (list + (list "HREF" + (href-to + prev)) + (list "ACCESSKEY" + "P")) + (gentext-nav-prev prev)))) + (make element gi: "TD" + attributes: (list + (list "WIDTH" "10%") + (list "ALIGN" "left") + (list "VALIGN" "top")) + (if (node-list-empty? prevsib) + (make entity-ref name: "nbsp") + (make element gi: "A" + attributes: (list + (list "HREF" + (href-to + prevsib))) + (gentext-nav-prev-sibling prevsib)))) + (make element gi: "TD" + attributes: (list + (list "WIDTH" "60%") + (list "ALIGN" "center") + (list "VALIGN" "bottom")) + (nav-context elemnode)) + (make element gi: "TD" + attributes: (list + (list "WIDTH" "10%") + (list "ALIGN" "right") + (list "VALIGN" "top")) + (if (node-list-empty? nextsib) + (make entity-ref name: "nbsp") + (make element gi: "A" + attributes: (list + (list "HREF" + (href-to + nextsib))) + (gentext-nav-next-sibling nextsib)))) + (make element gi: "TD" + attributes: (list + (list "WIDTH" "10%") + (list "ALIGN" "right") + (list "VALIGN" "top")) + (if (node-list-empty? next) + (make entity-ref name: "nbsp") + (make element gi: "A" + attributes: (list + (list "HREF" + (href-to + next)) + (list "ACCESSKEY" + "N")) + (gentext-nav-next next))))))) + (if (or r1? r2?) + (make element gi: "DIV" + attributes: '(("CLASS" "NAVHEADER")) + (make element gi: "TABLE" + attributes: (list + (list "SUMMARY" "Header navigation table") + (list "WIDTH" %gentext-nav-tblwidth%) + (list "BORDER" "0") + (list "CELLPADDING" "0") + (list "CELLSPACING" "0")) + (if r1? r1-sosofo (empty-sosofo)) + (if r2? r2-sosofo (empty-sosofo))) + (make empty-element gi: "HR" + attributes: (list + (list "ALIGN" "LEFT") + (list "WIDTH" %gentext-nav-tblwidth%)))) + (empty-sosofo)))) + +(define (default-header-nav-tbl-noff elemnode prev next prevsib nextsib) + (let* ((r1? (nav-banner? elemnode)) + (r1-sosofo (make element gi: "TR" + (make element gi: "TH" + attributes: (list + (list "COLSPAN" "3") + (list "ALIGN" "center")) + (nav-banner elemnode)))) + (r2? (or (not (node-list-empty? prev)) + (not (node-list-empty? next)) + (nav-context? elemnode))) + (r2-sosofo (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "WIDTH" "10%") + (list "ALIGN" "left") + (list "VALIGN" "bottom")) + (if (node-list-empty? prev) + (make entity-ref name: "nbsp") + (make element gi: "A" + attributes: (list + (list "HREF" + (href-to + prev)) + (list "ACCESSKEY" + "P")) + (gentext-nav-prev prev)))) + (make element gi: "TD" + attributes: (list + (list "WIDTH" "80%") + (list "ALIGN" "center") + (list "VALIGN" "bottom")) + (nav-context elemnode)) + (make element gi: "TD" + attributes: (list + (list "WIDTH" "10%") + (list "ALIGN" "right") + (list "VALIGN" "bottom")) + (if (node-list-empty? next) + (make entity-ref name: "nbsp") + (make element gi: "A" + attributes: (list + (list "HREF" + (href-to + next)) + (list "ACCESSKEY" + "N")) + (gentext-nav-next next))))))) + (if (or r1? r2?) + (make element gi: "DIV" + attributes: '(("CLASS" "NAVHEADER")) + (make element gi: "TABLE" + attributes: (list + (list "SUMMARY" "Header navigation table") + (list "WIDTH" %gentext-nav-tblwidth%) + (list "BORDER" "0") + (list "CELLPADDING" "0") + (list "CELLSPACING" "0")) + (if r1? r1-sosofo (empty-sosofo)) + (if r2? r2-sosofo (empty-sosofo))) + (make empty-element gi: "HR" + attributes: (list + (list "ALIGN" "LEFT") + (list "WIDTH" %gentext-nav-tblwidth%)))) + (empty-sosofo)))) + +(define (default-header-nav-notbl-ff elemnode prev next prevsib nextsib) + (make element gi: "DIV" + attributes: '(("CLASS" "NAVHEADER")) + (if (nav-banner? elemnode) + (make element gi: "H1" + (nav-banner elemnode)) + (empty-sosofo)) + + (if (and (node-list-empty? prev) + (node-list-empty? prevsib) + (node-list-empty? nextsib) + (node-list-empty? next)) + (empty-sosofo) + (make element gi: "P" + (if (node-list-empty? next) + (empty-sosofo) + (make sequence + (make element gi: "A" + attributes: (list + (list "HREF" (href-to next)) + (list "ACCESSKEY" "N")) + (gentext-nav-next next)))) + + (if (node-list-empty? prev) + (empty-sosofo) + (make sequence + (if (node-list-empty? next) + (empty-sosofo) + (literal ", ")) + (make element gi: "A" + attributes: (list + (list "HREF" (href-to prev)) + (list "ACCESSKEY" "P")) + (gentext-nav-prev prev)))) + + (if (node-list-empty? nextsib) + (empty-sosofo) + (make sequence + (if (and (node-list-empty? next) + (node-list-empty? prev)) + (empty-sosofo) + (literal ", ")) + (make element gi: "A" + attributes: (list + (list "HREF" (href-to nextsib))) + (gentext-nav-next-sibling nextsib)))) + + (if (node-list-empty? prevsib) + (empty-sosofo) + (make sequence + (if (and (node-list-empty? next) + (node-list-empty? prev) + (node-list-empty? nextsib)) + (empty-sosofo) + (literal ", ")) + (make element gi: "A" + attributes: (list + (list "HREF" (href-to prevsib))) + (gentext-nav-prev-sibling prevsib)))))) + + (if (nav-context? elemnode) + (make element gi: "H2" + (nav-context elemnode)) + (empty-sosofo)) + + (make empty-element gi: "HR"))) + +(define (default-header-nav-notbl-noff elemnode prev next prevsib nextsib) + (default-header-nav-notbl-ff elemnode prev next + (empty-node-list) (empty-node-list))) + +(define (default-header-navigation elemnode prev next prevsib nextsib) + (if %gentext-nav-use-tables% + (if %gentext-nav-use-ff% + (default-header-nav-tbl-ff elemnode prev next prevsib nextsib) + (default-header-nav-tbl-noff elemnode prev next prevsib nextsib)) + (if %gentext-nav-use-ff% + (default-header-nav-notbl-ff elemnode prev next prevsib nextsib) + (default-header-nav-notbl-noff elemnode prev next prevsib nextsib)))) + +(define (default-footer-navigation elemnode prev next prevsib nextsib) + (if %gentext-nav-use-tables% + (default-footer-nav-tbl elemnode prev next prevsib nextsib) + (default-footer-nav-notbl elemnode prev next prevsib nextsib))) + +(define (default-footer-nav-tbl elemnode prev next prevsib nextsib) + (let ((r1? (or (not (node-list-empty? prev)) + (not (node-list-empty? next)) + (nav-home? elemnode))) + (r2? (or (not (node-list-empty? prev)) + (not (node-list-empty? next)) + (nav-up? elemnode))) + + (r1-sosofo (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "WIDTH" "33%") + (list "ALIGN" "left") + (list "VALIGN" "top")) + (if (node-list-empty? prev) + (make entity-ref name: "nbsp") + (make element gi: "A" + attributes: (list + (list "HREF" (href-to + prev)) + (list "ACCESSKEY" + "P")) + (gentext-nav-prev prev)))) + (make element gi: "TD" + attributes: (list + (list "WIDTH" "34%") + (list "ALIGN" "center") + (list "VALIGN" "top")) + (nav-home-link elemnode)) + (make element gi: "TD" + attributes: (list + (list "WIDTH" "33%") + (list "ALIGN" "right") + (list "VALIGN" "top")) + (if (node-list-empty? next) + (make entity-ref name: "nbsp") + (make element gi: "A" + attributes: (list + (list "HREF" (href-to + next)) + (list "ACCESSKEY" + "N")) + (gentext-nav-next next)))))) + (r2-sosofo (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "WIDTH" "33%") + (list "ALIGN" "left") + (list "VALIGN" "top")) + (if (node-list-empty? prev) + (make entity-ref name: "nbsp") + (element-title-sosofo prev))) + (make element gi: "TD" + attributes: (list + (list "WIDTH" "34%") + (list "ALIGN" "center") + (list "VALIGN" "top")) + (if (nav-up? elemnode) + (nav-up elemnode) + (make entity-ref name: "nbsp"))) + (make element gi: "TD" + attributes: (list + (list "WIDTH" "33%") + (list "ALIGN" "right") + (list "VALIGN" "top")) + (if (node-list-empty? next) + (make entity-ref name: "nbsp") + (element-title-sosofo next)))))) + (if (or r1? r2?) + (make element gi: "DIV" + attributes: '(("CLASS" "NAVFOOTER")) + (make empty-element gi: "HR" + attributes: (list + (list "ALIGN" "LEFT") + (list "WIDTH" %gentext-nav-tblwidth%))) + (make element gi: "TABLE" + attributes: (list + (list "SUMMARY" "Footer navigation table") + (list "WIDTH" %gentext-nav-tblwidth%) + (list "BORDER" "0") + (list "CELLPADDING" "0") + (list "CELLSPACING" "0")) + (if r1? r1-sosofo (empty-sosofo)) + (if r2? r2-sosofo (empty-sosofo)))) + (empty-sosofo)))) + +(define (default-footer-nav-notbl elemnode prev next prevsib nextsib) + (make element gi: "DIV" + attributes: '(("CLASS" "NAVFOOTER")) + (make empty-element gi: "HR") + + (if (nav-home? elemnode) + (nav-home-link elemnode) + (empty-sosofo)) + + (if (nav-up? elemnode) + (make sequence + (if (nav-home? elemnode) + (literal ", ") + (empty-sosofo)) + (nav-up elemnode)) + (empty-sosofo)) + + (if (or (nav-home? elemnode) (nav-up? elemnode)) + (make empty-element gi: "BR") + (empty-sosofo)) + + (if (node-list-empty? prev) + (empty-sosofo) + (make sequence + (make element gi: "A" + attributes: (list + (list "HREF" (href-to prev)) + (list "ACCESSKEY" "P")) + (gentext-nav-prev prev)) + (literal ": " (element-title-string prev)) + (make empty-element gi: "BR"))) + + (if (node-list-empty? next) + (empty-sosofo) + (make sequence + (make element gi: "A" + attributes: (list + (list "HREF" (href-to next)) + (list "ACCESSKEY" "N")) + (gentext-nav-next next)) + (literal ": " (element-title-string next)) + (make empty-element gi: "BR"))))) + +(define ($user-header-navigation$ #!optional + (prev (empty-node-list)) + (next (empty-node-list)) + (prevm (empty-node-list)) + (nextm (empty-node-list))) + (empty-sosofo)) + +(define ($user-footer-navigation$ #!optional + (prev (empty-node-list)) + (next (empty-node-list)) + (prevm (empty-node-list)) + (nextm (empty-node-list))) + (empty-sosofo)) + +;; EOF dbnavig.dsl; diff --git a/html/dbparam.dsl b/html/dbparam.dsl new file mode 100644 index 0000000..c913cb8 --- /dev/null +++ b/html/dbparam.dsl @@ -0,0 +1,1723 @@ + + + + + + +;; $Id: dbparam.dsl,v 1.10 2004/10/10 11:55:10 petere78 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://www.nwalsh.com/docbook/dsssl/ +;; + +;; === Book intro, for dsl2man ========================================== + +DocBook HTML Parameters +;; Part of the Modular DocBook Stylesheet distribution +;; NormanWalsh +;; +;; $Revision: 1.10 $ +;; 199719981999 +;; Norman Walsh +;; +;; +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +;; OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +;; NONINFRINGEMENT. IN NO EVENT SHALL NORMAN WALSH OR ANY OTHER +;; CONTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +;; OTHER DEALINGS IN THE SOFTWARE. +;; +;; +;; +;; +;; Please direct all questions, bug reports, or suggestions for changes +;; to Norman Walsh, <ndw@nwalsh.com>. +;; +;; +;; See http://nwalsh.com/docbook/dsssl/ for more information. +;; +;; /DOCINFO +]]> + +;; REFERENCE TOC/LOT Apparatus + +(define %generate-set-toc% + ;; REFENTRY generate-set-toc + ;; PURP Should a Table of Contents be produced for Sets? + ;; DESC + ;; If true, a Table of Contents will be generated for each 'Set'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %generate-book-toc% + ;; REFENTRY generate-book-toc + ;; PURP Should a Table of Contents be produced for Books? + ;; DESC + ;; If true, a Table of Contents will be generated for each 'Book'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define ($generate-book-lot-list$) + ;; REFENTRY generate-book-lot-list + ;; PURP Which Lists of Titles should be produced for Books? + ;; DESC + ;; This parameter should be a list (possibly empty) of the elements + ;; for which Lists of Titles should be produced for each 'Book'. + ;; + ;; It is meaningless to put elements that do not have titles in this + ;; list. If elements with optional titles are placed in this list, only + ;; the instances of those elements that do have titles will appear in + ;; the LOT. + ;; + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (list (normalize "table") +(normalize "figure") +(normalize "example") +(normalize "equation"))) + +(define %generate-part-toc% + ;; REFENTRY generate-part-toc + ;; PURP Should a Table of Contents be produced for Parts? + ;; DESC + ;; If true, a Table of Contents will be generated for each 'Part'. + ;; Note: '%generate-part-toc-on-titlepage%' controls whether the Part TOC + ;; is placed on the bottom of the part titlepage or on page(s) of its own. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %generate-part-toc-on-titlepage% + ;; REFENTRY generate-part-toc-on-titlepage + ;; PURP Should the Part TOC appear on the Part title page? + ;; DESC + ;; If true, the Part TOC will be placed on the Part title page. If false, + ;; the TOC will be placed on separate page(s) after the Part title page. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define $generate-chapter-toc$ + ;; REFENTRY generate-chapter-toc + ;; PURP Should a Chapter Table of Contents be produced? + ;; DESC + ;; If true, an automatically generated + ;; chapter TOC should be included. By default, it's true. It's false if + ;; the output is going to a single file and the current node isn't the + ;; root element. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (lambda () + (or (not nochunks) +(node-list=? (current-node) (sgml-root-element))))) + +(define %force-chapter-toc% + ;; REFENTRY force-chapter-toc + ;; PURP Force a chapter TOC even if it includes only a single entry + ;; DESC + ;; Force chapter toc indicates whether or not an automatically generated + ;; chapter TOC should be included even if it has only one entry. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %generate-article-toc% + ;; REFENTRY generate-article-toc + ;; PURP Should a Table of Contents be produced for Articles? + ;; DESC + ;; If true, a Table of Contents will be generated for each 'Article'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define ($generate-article-lot-list$) + ;; REFENTRY generate-article-lot-list + ;; PURP Which Lists of Titles should be produced for Books? + ;; DESC + ;; This parameter should be a list (possibly empty) of the elements + ;; for which Lists of Titles shold be produced for each 'Article'. + ;; + ;; It is meaningless to put elements that do not have titles in this + ;; list. If elements with optional titles are placed in this list, only + ;; the instances of those elements that do have titles will appear in + ;; the LOT. + ;; + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY +(list)) + +(define %generate-reference-toc% + ;; REFENTRY generate-reference-toc + ;; PURP Should a Table of Contents be produced for References? + ;; DESC + ;; If true, a Table of Contents will be generated for each 'Reference'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %generate-reference-toc-on-titlepage% + ;; REFENTRY generate-reference-toc-on-titlepage + ;; PURP Should the Reference TOC appear on the Reference title page? + ;; DESC + ;; If true, the Reference TOC will be placed on the Reference title page. + ;; If false, + ;; the TOC will be placed after the Reference title page. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %annotate-toc% + ;; REFENTRY annotate-toc + ;; PURP Annotate TOC entries + ;; DESC + ;; If #t, TOC entries will be annotated (e.g., the RefPurpose + ;; of a RefEntry will be displayed in the TOC). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define ($generate-qandaset-toc$) + ;; REFENTRY generate-qandaset-toc + ;; PURP Should a QandASet Table of Contents be produced? + ;; DESC + ;; If true, an automatically generated TOC is produced for each + ;; QandASet. + ;; /DESC + ;; /REFENTRY + #t) + +;; REFERENCE Titlepages + +(define %generate-set-titlepage% + ;; REFENTRY generate-set-titlepage + ;; PURP Should a set title page be produced? + ;; DESC + ;; If true, a title page will be generated for each 'Set'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %generate-book-titlepage% + ;; REFENTRY generate-book-titlepage + ;; PURP Should a book title page be produced? + ;; DESC + ;; If true, a title page will be generated for each 'Book'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %generate-part-titlepage% + ;; REFENTRY generate-part-titlepage + ;; PURP Should a part title page be produced? + ;; DESC + ;; If true, a title page will be generated for each 'Part'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %generate-partintro-on-titlepage% + ;; REFENTRY generate-partintro-on-titlepage + ;; PURP Should the PartIntro appear on the Part/Reference title page? + ;; DESC + ;; If true, the PartIntro content will appear on the title page of + ;; Parts and References. If false, + ;; it will be placed on separate page(s) after the title page. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %generate-reference-titlepage% + ;; REFENTRY generate-reference-titlepage + ;; PURP Should a reference title page be produced? + ;; DESC + ;; If true, a title page will be generated for each 'Reference'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %generate-article-titlepage% + ;; REFENTRY generate-article-titlepage + ;; PURP Should an article title page be produced? + ;; DESC + ;; If true, a title page will be generated for each 'Article'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %titlepage-in-info-order% + ;; REFENTRY titlepage-in-info-order + ;; PURP Place elements on title page in document order? + ;; DESC + ;; If true, the elements on the title page will be set in the order that + ;; they appear in the *info element. Otherwise, they will be set in + ;; the order specified in the *-titlepage-*-elements list. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %generate-legalnotice-link% + ;; REFENTRY generate-legalnotice-link + ;; PURP Should legal notices be a link to a separate file? + ;; DESC + ;; If true, legal notices will be references to a separate file. + ;; Note: the support for this handles the case where a single *INFO + ;; node contains several distinct legal notices, but won't + ;; handle multiple legal notices in different *INFO nodes. + ;; (Each set will overwrite the previous.) A more complex + ;; approach could be implemented, but this is sufficient for + ;; the current demand. Let me know... + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define ($legalnotice-link-file$ legalnotice) + ;; REFENTRY legalnotice-link-file + ;; PURP Name of output file for legal notices + ;; DESC + ;; Name of the output file for legal notices if + ;; '%generate-legalnotice-link%' is true. Since several legal notices + ;; may occur (in a Set of Books, for example), this is no longer a fixed + ;; filename. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (if (and %use-id-as-filename% (attribute-string (normalize "id") legalnotice)) + (string-append (attribute-string (normalize "id") legalnotice) + %html-ext%) + (string-append "ln" + (number->string (all-element-number legalnotice)) + %html-ext%))) + +(define %author-othername-in-middle% + ;; REFENTRY othername-in-middle + ;; PURP Author OTHERNAME appears between FIRSTNAME and SURNAME? + ;; DESC + ;; If true, the OTHERNAME of an AUTHOR appears between the + ;; FIRSTNAME and SURNAME. Otherwise, OTHERNAME is suppressed. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +;; REFERENCE Admonitions + +(define %admon-graphics% + ;; REFENTRY admon-graphics + ;; PURP Use graphics in admonitions? + ;; DESC + ;; If true, admonitions are presented in an alternate style that uses + ;; a graphic. Default graphics are provided in the distribution. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %admon-graphics-path% + ;; REFENTRY admon-graphics-path + ;; PURP Path to admonition graphics + ;; DESC + ;; Sets the path, probably relative to the directory where the HTML + ;; files are created, to the admonition graphics. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "../images/") + +(define ($admon-graphic$ #!optional (nd (current-node))) + ;; REFENTRY admon-graphic + ;; PURP Admonition graphic file + ;; DESC + ;; Given an admonition node, returns the name of the graphic that should + ;; be used for that admonition. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (cond ((equal? (gi nd) (normalize "tip")) + (string-append %admon-graphics-path% "tip" %stock-graphics-extension%)) + ((equal? (gi nd) (normalize "note")) + (string-append %admon-graphics-path% "note" %stock-graphics-extension%)) + ((equal? (gi nd) (normalize "important")) + (string-append %admon-graphics-path% "important" %stock-graphics-extension%)) + ((equal? (gi nd) (normalize "caution")) + (string-append %admon-graphics-path% "caution" %stock-graphics-extension%)) + ((equal? (gi nd) (normalize "warning")) + (string-append %admon-graphics-path% "warning" %stock-graphics-extension%)) + (else (error (string-append (gi nd) " is not an admonition."))))) + +(define ($admon-graphic-width$ #!optional (nd (current-node))) + ;; REFENTRY admon-graphic-width + ;; PURP Admonition graphic file width + ;; DESC + ;; Given an admonition node, returns the width of the graphic that will + ;; be used for that admonition. + ;; + ;; All of the default graphics in the distribution are 25 pixels wide. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "25") + +;; REFERENCE Callouts + +(define %callout-graphics% + ;; REFENTRY callout-graphics + ;; PURP Use graphics in callouts? + ;; DESC + ;; If true, callouts are presented with graphics (e.g., reverse-video + ;; circled numbers instead of "(1)", "(2)", etc.). + ;; Default graphics are provided in the distribution. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %callout-graphics-path% + ;; REFENTRY callout-graphics-path + ;; PURP Path to callout graphics + ;; DESC + ;; Sets the path, probably relative to the directory where the HTML + ;; files are created, to the callout graphics. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "../images/callouts/") + +(define %callout-graphics-number-limit% + ;; REFENTRY callout-graphics-number-limit + ;; PURP Number of largest callout graphic + ;; DESC + ;; If '%callout-graphics%' is true, graphics are used to represent + ;; callout numbers. The value of '%callout-graphics-number-limit%' is + ;; the largest number for which a graphic exists. If the callout number + ;; exceeds this limit, the default presentation "(nnn)" will always + ;; be used. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 10) + +;; REFERENCE VariableLists + +(define %always-format-variablelist-as-table% + ;; REFENTRY always-format-variablelist-as-table + ;; PURP Always format VariableLists as tables? + ;; DESC + ;; When a 'VariableList' is formatted, if any of the + ;; terms in the list are too long, the whole list is formatted as a + ;; list. + ;; + ;; If '%always-format-variablelist-as-table%' is + ;; '#t', the 'VariableList' will be + ;; formatted as a table, even if some terms are too long. The terms that + ;; are too long will format span above their associated description. + ;; /DESC + ;; /REFENTRY + #f) + +(define %default-variablelist-termlength% + ;; REFENTRY default-variablelist-termlength + ;; PURP Default term length on variablelists + ;; DESC + ;; When formatting a 'VariableList', this value is + ;; used as the default term length, if no 'TermLength' is specified. + ;; + ;; If all of the terms in a list shorter than the term length, the + ;; stylesheet may format them "side-by-side" in a table. + ;; /DESC + ;; /REFENTRY + 20) + +(define %may-format-variablelist-as-table% + ;; REFENTRY may-format-variablelist-as-table + ;; PURP Format VariableLists as tables? + ;; DESC + ;; If '%may-format-variablelist-as-table%' is + ;; '#t', a 'VariableList' will be + ;; formatted as a table, if *all of* + ;; the terms are shorter than the specified + ;; 'TermLength'. + ;; /DESC + ;; /REFENTRY + #f) + +;; REFERENCE Navigation + +(define %header-navigation% + ;; REFENTRY header-navigation + ;; PURP Should navigation links be added to the top of each page? + ;; DESC + ;; If '#t', navigation links will be added to the top of each page. + ;; If '#f', no navigation links will be added. Note that this has + ;; no effect on '($user-header-navigation$)', which will still be + ;; called (but does nothing by default). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %footer-navigation% + ;; REFENTRY footer-navigation + ;; PURP Should navigation links be added to the bottom of each page? + ;; DESC + ;; If '#t', navigation links will be added to the bottom of each page. + ;; If '#f', no navigation links will be added. Note that this has + ;; no effect on '($user-footer-navigation$)' or '(nav-footer)', which + ;; will still be called (but do nothing by default). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %gentext-nav-tblwidth% + ;; REFENTRY gentext-nav-tblwidth + ;; PURP If using tables for navigation, how wide should the tables be? + ;; DESC + ;; If tables are used for navigation (see '%gentext-nav-use-tables%'), + ;; how wide should the tables be? + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "100%") + +(define %gentext-nav-use-ff% + ;; REFENTRY gentext-nav-use-ff + ;; PURP Add "fast-forward" to the navigation links? + ;; DESC + ;; Do you want "fast-forward" navigation? Probably not is my guess. + ;; I'm not sure this works real well yet. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %gentext-nav-use-tables% + ;; REFENTRY gentext-nav-use-tables + ;; PURP Use tables to build the navigation headers and footers? + ;; DESC + ;; If true, HTML TABLEs will be used to format the header and footer + ;; navigation information. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +;; REFERENCE Verbatim Environments + +(define %indent-address-lines% + ;; REFENTRY indent-address-lines + ;; PURP Indent lines in a 'Address'? + ;; DESC + ;; If not '#f', each line in the display will be indented + ;; with the content of this variable. Usually it is set to some number + ;; of spaces, but you can indent with any string you wish. + ;; /DESC + ;; /REFENTRY + #f) + +(define %indent-funcsynopsisinfo-lines% + ;; REFENTRY indent-funcsynopsisinfo-lines + ;; PURP Indent lines in a 'FuncSynopsisInfo'? + ;; DESC + ;; If not '#f', each line in the display will be indented + ;; with the content of this variable. Usually it is set to some number + ;; of spaces, but you can indent with any string you wish. + ;; /DESC + ;; /REFENTRY + #f) + +(define %indent-literallayout-lines% + ;; REFENTRY indent-literallayout-lines + ;; PURP Indent lines in a 'LiteralLayout'? + ;; DESC + ;; If not '#f', each line in the display will be indented + ;; with the content of this variable. Usually it is set to some number + ;; of spaces, but you can indent with any string you wish. + ;; /DESC + ;; /REFENTRY + #f) + +(define %indent-programlisting-lines% + ;; REFENTRY indent-programlisting-lines + ;; PURP Indent lines in a 'ProgramListing'? + ;; DESC + ;; If not '#f', each line in the display will be indented + ;; with the content of this variable. Usually it is set to some number + ;; of spaces, but you can indent with any string you wish. + ;; /DESC + ;; /REFENTRY + #f) + +(define %indent-screen-lines% + ;; REFENTRY indent-screen-lines + ;; PURP Indent lines in a 'Screen'? + ;; DESC + ;; If not '#f', each line in the display will be indented + ;; with the content of this variable. Usually it is set to some number + ;; of spaces, but you can indent with any string you wish. + ;; /DESC + ;; /REFENTRY + #f) + +(define %indent-synopsis-lines% + ;; REFENTRY indent-synopsis-lines + ;; PURP Indent lines in a 'Synopsis'? + ;; DESC + ;; If not '#f', each line in the display will be indented + ;; with the content of this variable. Usually it is set to some number + ;; of spaces, but you can indent with any string you wish. + ;; /DESC + ;; /REFENTRY + #f) + +(define %number-address-lines% + ;; REFENTRY number-address-lines + ;; PURP Enumerate lines in a 'Address'? + ;; DESC + ;; If true, lines in each 'Address' will be enumerated. + ;; See also '%linenumber-mod%', '%linenumber-length%', + ;; '%linenumber-padchar%', and '($linenumber-space$)'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %number-funcsynopsisinfo-lines% + ;; REFENTRY number-funcsynopsisinfo-lines + ;; PURP Enumerate lines in a 'FuncSynopsisInfo'? + ;; DESC + ;; If true, lines in each 'FuncSynopsisInfo' will be enumerated. + ;; See also '%linenumber-mod%', '%linenumber-length%', + ;; '%linenumber-padchar%', and '($linenumber-space$)'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %number-literallayout-lines% + ;; REFENTRY number-literallayout-lines + ;; PURP Enumerate lines in a 'LiteralLayout'? + ;; DESC + ;; If true, lines in each 'LiteralLayout' will be enumerated. + ;; See also '%linenumber-mod%', '%linenumber-length%', + ;; '%linenumber-padchar%', and '($linenumber-space$)'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %number-programlisting-lines% + ;; REFENTRY number-programlisting-lines + ;; PURP Enumerate lines in a 'ProgramListing'? + ;; DESC + ;; If true, lines in each 'ProgramListing' will be enumerated. + ;; See also '%linenumber-mod%', '%linenumber-length%', + ;; '%linenumber-padchar%', and '($linenumber-space$)'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %number-screen-lines% + ;; REFENTRY number-screen-lines + ;; PURP Enumerate lines in a 'Screen'? + ;; DESC + ;; If true, lines in each 'Screen' will be enumerated. + ;; See also '%linenumber-mod%', '%linenumber-length%', + ;; '%linenumber-padchar%', and '($linenumber-space$)'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %number-synopsis-lines% + ;; REFENTRY number-synopsis-lines + ;; PURP Enumerate lines in a 'Synopsis'? + ;; DESC + ;; If true, lines in each 'Synopsis' will be enumerated. + ;; See also '%linenumber-mod%', '%linenumber-length%', + ;; '%linenumber-padchar%', and '($linenumber-space$)'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %linenumber-length% + ;; REFENTRY linenumber-length + ;; PURP Width of line numbers in enumerated environments + ;; DESC + ;; Line numbers will be padded to '%linenumber-length%' + ;; characters. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 3) + +(define %linenumber-mod% + ;; REFENTRY linenumber-mod + ;; PURP Controls line-number frequency in enumerated environments. + ;; DESC + ;; Every '%linenumber-mod%' line will be enumerated. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 5) + +(define %linenumber-padchar% + ;; REFENTRY linenumber-padchar + ;; PURP Pad character in line numbers + ;; DESC + ;; Line numbers will be padded (on the left) with '%linenumber-padchar%'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + " ") + +(define ($linenumber-space$) + ;; REFENTRY linenumber-space + ;; PURP Returns the sosofo which separates line numbers from the text + ;; DESC + ;; The sosofo returned by '($linenumber-space$)' is placed + ;; between the line number and the corresponding line in + ;; enumerated environments. + ;; + ;; Note: '%linenumber-padchar%'s are separated from lines + ;; that are not enumerated (because they don't match '%linenumber-mod%'). + ;; In other words, '($linenumber-space$)' occurs + ;; on every line. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (make entity-ref name: "nbsp")) + +(define %shade-verbatim% + ;; REFENTRY shade-verbatim + ;; PURP Should verbatim environments be shaded? + ;; DESC + ;; If true, a table with '($shade-verbatim-attr$)' attributes will be + ;; wrapped around each verbatim environment. This gives the effect + ;; of a shaded verbatim environment. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define ($shade-verbatim-attr$) + ;; REFENTRY shade-verbatim-attr + ;; PURP Attributes used to create a shaded verbatim environment. + ;; DESC + ;; See '%shade-verbatim%' + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (list + (list "BORDER" "0") + (list "BGCOLOR" "#E0E0E0") + (list "WIDTH" ($table-width$)))) + +(define %callout-default-col% + ;; REFENTRY callout-default-col + ;; PURP Default column for callouts + ;; DESC + ;; If the coordinates of a callout include only a line number, the callout + ;; bug will appear in column '%callout-default-col%'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 60) + +;; REFERENCE Labelling + +(define %chapter-autolabel% + ;; REFENTRY chapter-autolabel + ;; PURP Are chapters enumerated? + ;; DESC + ;; If true, chapters will be enumerated. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %section-autolabel% + ;; REFENTRY section-autolabel + ;; PURP Are sections enumerated? + ;; DESC + ;; If true, unlabeled sections will be enumerated. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %label-preface-sections% + ;; REFENTRY label-preface-sections + ;; PURP Are sections in the Preface enumerated? + ;; DESC + ;; If true, unlabeled sections in the Preface will be enumerated + ;; if '%section-autolabel%' is true. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %qanda-inherit-numeration% + ;; REFENTRY qanda-inherit-numeration + ;; PURP Should numbered questions inherit the surrounding numeration? + ;; DESC + ;; If true, question numbers are prefixed with the surrounding + ;; component or section number. Has no effect unless + ;; '%section-autolabel%' is also true. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +;; REFERENCE Tables + +(define %cals-table-class% + ;; REFENTRY cals-table-class + ;; PURP Class attribute for CALS tables + ;; DESC + ;; This value, if not '#f', will be used as the value of the CLASS + ;; attribute on CALS tables. This allows the HTML stylesheet to + ;; distinguish between HTML tables generated from tables in the + ;; source document from HTML tables generated for other reasons + ;; (simplelists and navigation, for example). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "CALSTABLE") + +(define ($table-element-list$) + ;; REFENTRY table-element-list + ;; PURP List of table element names + ;; DESC + ;; The list of table elements in the DTD. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (list (normalize "table") (normalize "informaltable"))) + +(define ($table-width$) + ;; REFENTRY table-width + ;; PURP Calculate table width + ;; DESC + ;; This function is called to calculate the width of tables that should + ;; theoretically be "100%" wide. Unfortunately, in HTML, a 100% width + ;; table in a list hangs off the right side of the browser window. (Who's + ;; mistake was that!). So this function provides a way to massage + ;; the width appropriately. + ;; + ;; This version is fairly dumb. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (if (has-ancestor-member? (current-node) '("LISTITEM")) + "90%" + "100%")) + +(define %simplelist-column-width% + ;; REFENTRY simplelist-column-width + ;; PURP Width of columns in tabular simple lists + ;; DESC + ;; If SimpleLists are presented in a table, how wide should the table + ;; columns be? If '#f', no width will be specified. + ;; + ;; If not #f, this value should be a string (it will be used in the WIDTH + ;; attribute on the TD for each table entry). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %epigraph-start-col% + ;; REFENTRY epigraph-start-col + ;; PURP Size of start indent for epigraphs. + ;; DESC + ;; Width of the table column which provides a starting indent for + ;; epigraphs, expressed as a percentage. + ;; AUTHOR Ola Lundqvist + ;; /REFENTRY + "45%") + +(define %epigraph-content-col% + ;; REFENTRY epigraph-content-col + ;; PURP Size of epigraph text column. + ;; DESC + ;; Width of the table column which contains the contents of + ;; epigraphs, expressed as a percentage. + ;; AUTHOR Ola Lundqvist + ;; /REFENTRY + "45%") + +(define %blockquote-start-col% + ;; REFENTRY blockquote-start-col + ;; PURP Size of start indent for blockquoted text. + ;; DESC + ;; Width of the table column which provides a starting indent for + ;; blockquoted text, expressed as a percentage. + ;; AUTHOR Ola Lundqvist + ;; /REFENTRY + "10%") + +(define %blockquote-end-col% + ;; REFENTRY blockquote-end-col + ;; PURP Size of end indent for blockquoted text. + ;; DESC + ;; Width of the table column which provides and end indent after + ;; blockquoted text, expressed as a percentage. + ;; AUTHOR Ola Lundqvist + ;; /REFENTRY + "10%") + + +;; REFERENCE Bibliographies + +(define biblio-citation-check + ;; REFENTRY biblio-citation-check + ;; PURP Check citations + ;; DESC + ;; If true, the content of CITATIONs will be checked against possible + ;; biblioentries. If the citation cannot be found, an error is issued + ;; and the citation is generated. If the citation is found, it is generated + ;; with a cross reference to the appropriate biblioentry. + ;; + ;; A citation matches if the content of the citation element matches the + ;; ID, XREFLABEL, or leading ABBREV of a biblioentry. + ;; + ;; This setting may have significant performance implications on large + ;; documents, hence it is false by default. + ;; + ;; (This option can conveniently be set with '-V biblio-citation-check' + ;; on the Jade command line). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define biblio-filter-used + ;; REFENTRY filter-used + ;; PURP Suppress unreferenced bibliography entries + ;; DESC + ;; If true, bibliography entries which are not cited are suppressed. + ;; A biblioentry is cited if an XREF or LINK matches its ID, or if + ;; a CITE element matches its + ;; ID, XREFLABEL, or leading ABBREV. + ;; + ;; A BIBLIOGRAPHY with no entries will still be output (making a whole + ;; component conditional would be _A LOT_ of work and seems unnecessary), + ;; but BIBLIDIVs with no entries will be suppressed. + ;; + ;; This setting may have significant performance implications, + ;; hence it is false by default. + ;; + ;; (This option can conveniently be set with '-V biblio-filter-used' on the + ;; Jade command line). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define biblio-number + ;; REFENTRY biblio-number + ;; PURP Enumerate bibliography entries + ;; DESC + ;; If true, bibliography entries will be numbered. If you cross-reference + ;; bibliography entries, you should probably use biblio-number or + ;; consistently use XREFLABEL or ABBREV. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define biblio-xref-title + ;; REFENTRY biblio-xref-title + ;; PURP Use the titles of bibliography entries in XREFs + ;; DESC + ;; If true, cross references to bibliography entries will use the + ;; title of the entry as the cross reference text. Otherwise, either + ;; the number (see 'biblio-number') or XREFLABEL/ABBREV will be used. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +;; REFERENCE OLinks + +(define %olink-fragid% + ;; REFENTRY olink-fragid + ;; PURP Portion of the URL which identifies the fragment identifier + ;; DESC + ;; Portion of the URL which identifies the fragment identifier + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "&fragid=") + +(define %olink-outline-ext% + ;; REFENTRY olink-outline-ext + ;; PURP Extension for olink outline file + ;; DESC + ;; The extension used to find the outline information file. When searching + ;; for outline information about a document, the extension is discarded + ;; from the system ID of the file and '%olinke-outline-ext%' is appended. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + ".olink") + +(define %olink-pubid% + ;; REFENTRY olink-pubid + ;; PURP Portion of the URL which identifies the public identifier + ;; DESC + ;; Portion of the URL which identifies the public identifier + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "pubid=") + +(define %olink-resolution% + ;; REFENTRY olink-resolution + ;; PURP URL script for OLink resolution + ;; DESC + ;; OLink resolution requires a server component, '%olink-resolution%' + ;; identifies that component. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "/cgi-bin/olink?") + +(define %olink-sysid% + ;; REFENTRY olink-sysid + ;; PURP Portion of the URL which identifies the system identifier + ;; DESC + ;; Portion of the URL which identifies the system identifier. System + ;; identifiers are only used if no public identifier is provided. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "sysid=") + +;; REFERENCE Graphics + +(define %graphic-default-extension% + ;; REFENTRY graphic-default-extension + ;; PURP Default extension for graphic FILEREFs + ;; DESC + ;; The '%graphic-default-extension%' will be + ;; added to the end of all 'fileref' filenames on + ;; 'Graphic's if they do not end in one of the + ;; '%graphic-extensions%'. Set this to '#f' + ;; to turn off this feature. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %stock-graphics-extension% + ;; REFENTRY stock-graphics-extension + ;; PURP Suffix for "stock" graphic files + ;; DESC + ;; The extension to for the graphic files which ship with the + ;; Modular DocBook Stylesheet distribution. This applies to callout + ;; graphics and admonition graphics. Should include the intervening + ;; period in the suffix, if any. + ;; /DESC + ;; AUTHOR Yann Dirson, Adam Di Carlo + ;; /REFENTRY + ".gif") + +(define %graphic-extensions% + ;; REFENTRY graphic-extensions + ;; PURP List of graphic filename extensions + ;; DESC + ;; The list of extensions which may appear on a 'fileref' + ;; on a 'Graphic' which are indicative of graphic formats. + ;; + ;; Filenames that end in one of these extensions will not have + ;; the '%graphic-default-extension%' added to them. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + '("gif" "jpg" "jpeg" "png" "tif" "tiff" "eps" "epsf")) + +(define image-library + ;; REFENTRY image-library + ;; PURP Load image library database for additional info about images? + ;; DESC + ;; If true, an image library database is loaded and extra information + ;; about web graphics is retrieved from it. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define image-library-filename + ;; REFENTRY image-library-filename + ;; PURP Name of the image library database + ;; DESC + ;; If 'image-library' is true, then the database is loaded from + ;; 'image-library-filename'. It's a current limitation that only a + ;; single database can be loaded. + ;; + ;; The image library database is stored in a separate directory + ;; because it must be parsed with the XML declaration. The only + ;; practical way to accomplish this with Jade, if you are processing a + ;; document that uses another declaration, is by having a catalog + ;; file in the directory that contains the image library that + ;; specifies the SGMLDECL. (So if it was in the same directory + ;; as your document, your document would also be parsed with the + ;; XML declaration, which may not be correct.) + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "imagelib/imagelib.xml") + +;; REFERENCE HTML Parameters and Chunking + +(define %body-attr% + ;; REFENTRY body-attr + ;; PURP What attributes should be hung off of BODY? + ;; DESC + ;; A list of the the BODY attributes that should be generated. + ;; The format is a list of lists, each interior list contains the + ;; name and value of a BODY attribute. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (list + (list "BGCOLOR" "#FFFFFF") + (list "TEXT" "#000000") + (list "LINK" "#0000FF") + (list "VLINK" "#840084") + (list "ALINK" "#0000FF"))) + +(define %html-prefix% + ;; REFENTRY html-prefix + ;; PURP Add the specified prefix to HTML output filenames + ;; DESC + ;; The specified prefix will be added to all HTML output filenames. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "") + +(define %html-use-lang-in-filename% + ;; REFENTRY html-use-lang-in-filename + ;; PURP Add the source language code to the HTML output filename? + ;; DESC + ;; If '#t', the source language code (or the default language code, if + ;; none is specified), will be added to the filename of each HTML + ;; output file. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %html-ext% + ;; REFENTRY html-ext + ;; PURP Default extension for HTML output files + ;; DESC + ;; The default extension for HTML output files. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + ".htm") + +(define %html-header-tags% + ;; REFENTRY html-header-tags + ;; PURP What additional HEAD tags should be generated? + ;; DESC + ;; A list of the the HTML HEAD tags that should be generated. + ;; The format is a list of lists, each interior list consists + ;; of a tag name and a set of attribute/value pairs: + ;; '(("META" ("NAME" "name") ("CONTENT" "content"))) + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + '()) + +(define %html-pubid% + ;; REFENTRY html-pubid + ;; PURP What public ID are you declaring your HTML compliant with? + ;; DESC + ;; The public ID used in output HTML files. If '#f', then no public ID + ;; is produced. If both this and %html-sysid% are '#f', then no + ;; doctype declaration is produced. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (if %html40% + "-//W3C//DTD HTML 4.01 Transitional//EN" + #f)) + +(define %html-sysid% + ;; REFENTRY html-sysid + ;; PURP What system ID are you declaring your HTML compliant with? + ;; DESC + ;; The system ID used in output HTML files. If '#f', then no system ID + ;; is produced. If both this and %html-pubid% are '#f', then no + ;; doctype declaration is produced. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (if %html40% + "http://www.w3.org/TR/html4/loose.dtd" + #f)) + +(define %root-filename% + ;; REFENTRY root-filename + ;; PURP Name for the root HTML document + ;; DESC + ;; The filename of the root HTML document (e.g, "index"). + ;; If '#f', then a default name will be selected based on the element + ;; type of the root element (e.g, book1.htm, set1.htm, c1.htm, etc.). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define html-index + ;; REFENTRY html-index + ;; PURP HTML indexing? + ;; DESC + ;; Turns on HTML indexing. If true, then index data will be written + ;; to the file defined by 'html-index-filename'. This data can be + ;; collated and turned into a DocBook index with bin/collateindex.pl. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define html-index-filename + ;; REFENTRY html-index-filename + ;; PURP Name of HTML index file + ;; DESC + ;; The name of the file to which index data will be written if + ;; 'html-index' is not '#f'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "HTML.index") + +(define html-manifest + ;; REFENTRY html-manifest + ;; PURP Write a manifest? + ;; DESC + ;; If not '#f' then the list of HTML files created by the stylesheet + ;; will be written to the file named by 'html-manifest-filename'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define html-manifest-filename + ;; REFENTRY html-manifest-filename + ;; PURP Name of HTML manifest file + ;; DESC + ;; The name of the file to which a manifest will be written if + ;; 'html-manifest' is not '#f'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "HTML.manifest") + +(define nochunks + ;; REFENTRY nochunks + ;; PURP Suppress chunking of output pages + ;; DESC + ;; If true, the entire source document is formatted as a single HTML + ;; document and output on stdout. + ;; (This option can conveniently be set with '-V nochunks' on the + ;; Jade command line). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define rootchunk + ;; REFENTRY rootchunk + ;; PURP Make a chunk for the root element when nochunks is used + ;; DESC + ;; If true, a chunk will be created for the root element, even though + ;; nochunks is specified. This option has no effect if nochunks is not + ;; true. + ;; (This option can conveniently be set with '-V rootchunk' on the + ;; Jade command line). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define use-output-dir + ;; REFENTRY use-output-dir + ;; PURP If an output-dir is specified, should it be used? + ;; DESC + ;; If true, chunks will be written to the 'output-dir' instead of + ;; the current directory. + ;; (This option can conveniently be set with '-V use-output-dir' on the + ;; Jade command line). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %output-dir% + ;; REFENTRY output-dir + ;; PURP The directory to which HTML files should be written + ;; DESC + ;; The output directory can be set in two ways. An individual document + ;; can specify 'output-dir="directory"' in the dbhtml PI, or the stylesheet + ;; can specify the '%output-dir%'. If both are specified, the PI value + ;; will be used. + ;; + ;; Note: the output directory is ignored if 'use-output-dir' is not '#t'. + ;; (This allows the author to test stylesheets and documents without + ;; accidentally overwriting existing documents.) + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %stylesheet% + ;; REFENTRY stylesheet + ;; PURP Name of the stylesheet to use + ;; DESC + ;; The name of the stylesheet to place in the HTML LINK TAG, or '#f' to + ;; suppress the stylesheet LINK. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %stylesheet-type% + ;; REFENTRY stylesheet-type + ;; PURP The type of the stylesheet to use + ;; DESC + ;; The type of the stylesheet to place in the HTML LINK TAG. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "text/css") + +(define %use-id-as-filename% + ;; REFENTRY use-id-as-filename + ;; PURP Use ID attributes as name for component HTML files? + ;; DESC + ;; If '%use-id-as-filename%' is true, the stylesheet will use the + ;; value of the ID attribute on a component as the base filename instead + ;; of using the auto-generated base. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %citerefentry-link% + ;; REFENTRY citerefentry-link + ;; PURP Generate URL links when cross-referencing RefEntrys? + ;; DESC + ;; If true, a web link will be generated, presumably + ;; to an online man->HTML gateway. The text of the link is + ;; generated by the $generate-citerefentry-link$ function. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +;; REFERENCE RefEntries and FuncSynopses + +(define %refentry-generate-name% + ;; REFENTRY refentry-generate-name + ;; PURP Output NAME header before 'RefName'(s)? + ;; DESC + ;; If true, a "NAME" section title is output before the list + ;; of 'RefName's. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %refentry-xref-italic% + ;; REFENTRY refentry-xref-italic + ;; PURP Use italic text when cross-referencing RefEntrys? + ;; DESC + ;; If true, italics are used when cross-referencing RefEntrys, either + ;; with XRef or CiteRefEntry. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %refentry-xref-manvolnum% + ;; REFENTRY refentry-xref-manvolnum + ;; PURP Output manvolnum as part of RefEntry cross-reference? + ;; DESC + ;; If true, the manvolnum is used when cross-referencing RefEntrys, either + ;; with XRef or CiteRefEntry. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %funcsynopsis-decoration% + ;; REFENTRY funcsynopsis-decoration + ;; PURP Decorate elements of a FuncSynopsis? + ;; DESC + ;; If true, elements of the FuncSynopsis will be decorated (e.g. bold or + ;; italic). The decoration is controlled by functions that can be redefined + ;; in a customization layer. See 'edbsynop.dsl'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %funcsynopsis-style% + ;; REFENTRY funcsynopsis-style + ;; PURP What style of 'FuncSynopsis' should be generated? + ;; DESC + ;; If '%funcsynopsis-style%' is 'ansi', + ;; ANSI-style function synopses are generated for a 'FuncSynopsis', + ;; otherwise KR-style function synopses are generated. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 'ansi) + +;; REFERENCE HTML Content and CSS + +(define %html40% + ;; REFENTRY html40 + ;; PURP Generate HTML 4.0 + ;; DESC + ;; If '%html40%' is true then the output more closely resembles HTML 4.0. + ;; In particular, the HTML table module includes COL, THEAD, TBODY, and TFOOT + ;; elements, and the output documents have a proper doctype declaration. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %css-decoration% + ;; REFENTRY css-decoration + ;; PURP Enable CSS decoration of elements + ;; DESC + ;; If '%css-decoration%' is turned on then HTML elements produced by the + ;; stylesheet may be decorated with STYLE attributes. For example, the + ;; LI tags produced for list items may include a fragment of CSS in the + ;; STYLE attribute which sets the CSS property "list-style-type". + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %css-liststyle-alist% + ;; REFENTRY css-liststyle-alist + ;; PURP Map DocBook OVERRIDE and MARK attributes to CSS + ;; DESC + ;; If '%css-decoration%' is turned on then the list-style-type property of + ;; list items will be set to reflect the list item style selected in the + ;; DocBook instance. This associative list maps the style type names used + ;; in your instance to the appropriate CSS names. If no mapping exists, + ;; the name from the instance will be used. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + '(("bullet" "disc") + ("box" "square"))) + +(define %fix-para-wrappers% + ;; REFENTRY fix-para-wrappers + ;; PURP Block element in para hack + ;; DESC + ;; Block elements are allowed in PARA in DocBook, but not in P in + ;; HTML. With '%fix-para-wrappers%' turned on, the stylesheets attempt + ;; to avoid putting block elements in HTML P tags by outputting + ;; additional end/begin P pairs around them. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %spacing-paras% + ;; REFENTRY spacing-paras + ;; PURP Block-element spacing hack + ;; DESC + ;; Should extraneous "P" tags be output to force the correct vertical + ;; spacing around things like tables. This is ugly because different + ;; browsers do different things. Turning this one can also create + ;; illegal HTML. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %emphasis-propagates-style% + ;; REFENTRY emphasis-propagates-style + ;; PURP Support propagating emphasis role attributes to HTML + ;; DESC + ;; Should the role attribute of emphasis be propagated to HTML as + ;; a class attribute value? + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %phrase-propagates-style% + ;; REFENTRY phrase-propagates-style + ;; PURP Support propagating phrase role attributes to HTML + ;; DESC + ;; Should the role attribute of phrase be propagated to HTML as + ;; a class attribute value? + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +;; REFERENCE Object Rules + +(define %example-rules% + ;; REFENTRY example-rules + ;; PURP Specify rules before and after an Example + ;; DESC + ;; If '#t', rules will be drawn before and after each + ;; 'Example'. + ;; /DESC + ;; /REFENTRY + #f) + +(define %figure-rules% + ;; REFENTRY figure-rules + ;; PURP Specify rules before and after an Figure + ;; DESC + ;; If '#t', rules will be drawn before and after each + ;; 'Figure'. + ;; /DESC + ;; /REFENTRY + #f) + +(define %table-rules% + ;; REFENTRY table-rules + ;; PURP Specify rules before and after an Table + ;; DESC + ;; If '#t', rules will be drawn before and after each + ;; 'Table'. + ;; /DESC + ;; /REFENTRY + #f) + +(define %equation-rules% + ;; REFENTRY equation-rules + ;; PURP Specify rules before and after an Equation + ;; DESC + ;; If '#t', rules will be drawn before and after each + ;; 'Equation'. + ;; /DESC + ;; /REFENTRY + #f) + +(define %informalexample-rules% + ;; REFENTRY informalexample-rules + ;; PURP Specify rules before and after an InformalExample + ;; DESC + ;; If '#t', rules will be drawn before and after each + ;; 'InformalExample'. + ;; /DESC + ;; /REFENTRY + #f) + +(define %informalfigure-rules% + ;; REFENTRY informalfigure-rules + ;; PURP Specify rules before and after an InformalFigure + ;; DESC + ;; If '#t', rules will be drawn before and after each + ;; 'InformalFigure'. + ;; /DESC + ;; /REFENTRY + #f) + +(define %informaltable-rules% + ;; REFENTRY informaltable-rules + ;; PURP Specify rules before and after an InformalTable + ;; DESC + ;; If '#t', rules will be drawn before and after each + ;; 'InformalTable'. + ;; /DESC + ;; /REFENTRY + #f) + +(define %informalequation-rules% + ;; REFENTRY informalequation-rules + ;; PURP Specify rules before and after an InformalEquation + ;; DESC + ;; If '#t', rules will be drawn before and after each + ;; 'InformalEquation'. + ;; /DESC + ;; /REFENTRY + #f) + +;; REFERENCE Miscellaneous + +(define %content-title-end-punct% + ;; REFENTRY content-title-end-punct + ;; PURP List of punctuation chars at the end of a run-in head + ;; DESC + ;; If a run-in head ends in any of these characters, the + ;; '%default-title-end-punct%' is not used. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + '(#\. #\! #\? #\:)) + +(define %honorific-punctuation% + ;; REFENTRY honorific-punctuation + ;; PURP Punctuation to follow honorifics in names + ;; DESC + ;; The honorific punctuation is placed after the honorific in + ;; a name. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + ".") + +(define %default-quadding% + ;; REFENTRY default-quadding + ;; PURP The default quadding + ;; DESC + ;; At present, this is only used on paragraphs. It specifies the + ;; value of the ALIGN attribute on the paragraph. This would be better + ;; done with CSS, but not all browsers support it yet and this has been + ;; oft requested functionality. + ;; + ;; A value of #f suppresses the ALIGN attribute altogether. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %default-simplesect-level% + ;; REFENTRY default-simplesect-level + ;; PURP Default section level for 'SimpleSect's. + ;; DESC + ;; If 'SimpleSect's appear inside other section-level + ;; elements, they are rendered at the appropriate section level, but if they + ;; appear in a component-level element, they are rendered at + ;; '%default-simplesect-level%'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 4) + +(define %default-title-end-punct% + ;; REFENTRY default-title-end-punct + ;; PURP Default punctuation at the end of a run-in head. + ;; DESC + ;; The punctuation used at the end of a run-in head (e.g. on FORMALPARA). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + ".") + +(define %footnotes-at-end% + ;; REFENTRY footnotes-at-end + ;; PURP Should footnotes appear at the end of HTML pages? + ;; DESC + ;; If '#t', footnotes will be placed at the end of each HTML page + ;; instead of immediately following the place where they occur. + ;; Note: support for this feature is dependent on the processing + ;; performed by the (footer-navigation) function; if you replace + ;; that function, make sure that you're replacement calls + ;; (make-endnotes). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %link-mailto-url% + ;; REFENTRY link-mailto-url + ;; PURP Mailto URL for LINK REL=made + ;; DESC + ;; If not '#f', the '%link-mailto-url%' address will be used in a + ;; LINK REL=made element in the HTML HEAD. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %show-comments% + ;; REFENTRY show-comments + ;; PURP Display Comment elements? + ;; DESC + ;; If true, comments will be displayed, otherwise they are suppressed. + ;; Comments here refers to the 'Comment' element, which will be renamed + ;; 'Remark' in DocBook V4.0, not SGML/XML comments which are unavailable. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %writing-mode% + ;; REFENTRY writing-mode + ;; PURP The writing mode + ;; DESC + ;; The writing mode is either 'left-to-right', or + ;; 'right-to-left'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 'left-to-right) + +(define ($object-titles-after$) + ;; REFENTRY object-titles-after + ;; PURP List of objects who's titles go after the object + ;; DESC + ;; Titles of formal objects (Figures, Equations, Tables, etc.) + ;; in this list will be placed below the object instead of above it. + ;; + ;; This is a list of element names, for example: + ;; '(list (normalize "figure") (normalize "table"))'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + '()) + +(define firstterm-bold + ;; REFENTRY firstterm-bold + ;; PURP Make FIRSTTERM elements bold? + ;; DESC + ;; If '#t', FIRSTTERMs will be bold, to distinguish them from + ;; simple GLOSSTERMs. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(declare-initial-value writing-mode %writing-mode%) + + + + diff --git a/html/dbpi.dsl b/html/dbpi.dsl new file mode 100644 index 0000000..12ca0f6 --- /dev/null +++ b/html/dbpi.dsl @@ -0,0 +1,62 @@ +;; $Id: dbpi.dsl,v 1.2 2003/04/28 05:18:24 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +(define (pi-value component piname) + ;; Returns the value of the (?piname value) PI (if one exists) + ;; as a child of component, otherwise returns #f + ;; + (let loop ((nl (select-by-class (children component) 'pi))) + (if (node-list-empty? nl) + #f + (let ((pidata (node-property 'system-data (node-list-first nl)))) + (if (and (> (string-length pidata) (string-length piname)) + (equal? piname + (substring pidata 0 (string-length piname)))) + (substring pidata + (+ (string-length piname) 1) + (string-length pidata)) + (loop (node-list-rest nl))))))) + +(define (inherited-pi-value component piname) + (let loop ((value #f) (nd component)) + (if (or value (node-list-empty? nd)) + value + (loop (pi-value nd piname) (parent nd))))) + +(define (dbhtml-findvalue pi-field-list name) + ;; pi-field-list is '(pitarget name1 value1 name2 value2 ...) + (let loop ((slist (cdr pi-field-list))) + (if (or (null? slist) + (not (pair? slist))) + #f + (if (string=? (car slist) name) + (car (cdr slist)) + (loop (cdr (cdr slist))))))) + +(define (dbhtml-value component name) + ;; Returns the value of "name='value'" in the <?dbhtml ...> PI + (let loop ((nl (select-by-class (children component) 'pi))) + (if (node-list-empty? nl) + #f + (let* ((pidata (node-property 'system-data (node-list-first nl))) + (pilist (if (and (> (string-length pidata) 7) + (string=? (substring pidata 0 7) "dbhtml ")) + (parse-starttag-pi pidata) + '())) + (value (if (null? pilist) #f (dbhtml-findvalue pilist name)))) + (if value + value + (loop (node-list-rest nl))))))) + +(define (inherited-dbhtml-value component name) + (let loop ((value #f) (nd component)) + (if (or value (node-list-empty? nd)) + value + (loop (dbhtml-value nd name) (parent nd))))) + +;; EOF dbpi.dsl + + diff --git a/html/dbprocdr.dsl b/html/dbprocdr.dsl new file mode 100644 index 0000000..f853583 --- /dev/null +++ b/html/dbprocdr.dsl @@ -0,0 +1,69 @@ +;; $Id: dbprocdr.dsl,v 1.4 2004/09/23 20:34:58 petere78 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ============================= PROCEDURES ============================= + +(define (PROCSTEP ilvl) + (if (> ilvl 1) 2.0em 1.8em)) + +(element procedure + (let ((titles (select-elements (children (current-node)) (normalize "title"))) + (preamble (node-list-filter-by-not-gi (children (current-node)) + (list (normalize "step")))) + (steps (node-list-filter-by-gi (children (current-node)) + (list (normalize "step")))) + (id (attribute-string (normalize "id")))) + (make element gi: "DIV" + attributes: (list + (list "CLASS" (gi))) + (if (not (node-list-empty? titles)) + (make element gi: "P" + (make element gi: "B" + (make sequence + (if id + (make element gi: "A" + attributes: (list + (list "NAME" id)) + (empty-sosofo)) + (empty-sosofo)) + (with-mode title-mode + (process-node-list titles))))) + (if id + (make element gi: "A" + attributes: (list + (list "NAME" id)) + (empty-sosofo)) + (empty-sosofo))) + (process-node-list preamble) + (make element gi: "OL" + attributes: (list + (list "TYPE" ($proc-hierarch-number-format$ 1))) + (process-node-list steps))))) + +(element (procedure title) (empty-sosofo)) + +(element substeps + (make element gi: "OL" + attributes: (list + (list "CLASS" "SUBSTEPS") + (list "TYPE" ($proc-hierarch-number-format$ + (+ ($proc-step-depth$ (current-node)) 1)))) + (process-children))) + +(element step + (let ((id (attribute-string (normalize "id")))) + (make sequence + (make element gi: "LI" + attributes: (list (list "CLASS" (gi))) + (if id + (make element gi: "A" + attributes: (list + (list "NAME" id)) + (empty-sosofo)) + (empty-sosofo)) + (process-children))))) + + diff --git a/html/dbqanda.dsl b/html/dbqanda.dsl new file mode 100644 index 0000000..633b26e --- /dev/null +++ b/html/dbqanda.dsl @@ -0,0 +1,172 @@ +;; $Id: dbqanda.dsl,v 1.1 2003/03/25 19:53:41 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ============================== QANDASET ============================== + +(define (qanda-defaultlabel) + (normalize "number")) + +(define (qanda-section-level) + ;; FIXME: what if they nest inside each other? + (let* ((enclsect (ancestor-member (current-node) + (list (normalize "section") + (normalize "simplesect") + (normalize "sect5") + (normalize "sect4") + (normalize "sect3") + (normalize "sect2") + (normalize "sect1") + (normalize "refsect3") + (normalize "refsect2") + (normalize "refsect1"))))) + (SECTLEVEL enclsect))) + +(define (qandadiv-section-level) + (let ((depth (length (hierarchical-number-recursive + (normalize "qandadiv"))))) + (+ (qanda-section-level) depth))) + +(element qandaset + (let ((title (select-elements (children (current-node)) + (normalize "title"))) + ;; process title and rest separately so that we can put the TOC + ;; in the rigth place... + (rest (node-list-filter-by-not-gi (children (current-node)) + (list (normalize "title"))))) + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-node-list title) + (if ($generate-qandaset-toc$) + (process-qanda-toc) + (empty-sosofo)) + (process-node-list rest)))) + +(element (qandaset title) + (let* ((htmlgi (string-append "H" (number->string + (+ (qanda-section-level) 1))))) + (make element gi: htmlgi + attributes: (list (list "CLASS" (gi (current-node)))) + (process-children)))) + +(element qandadiv + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + +(element (qandadiv title) + (let* ((hnr (hierarchical-number-recursive (normalize "qandadiv") + (current-node))) + (number (let loop ((numlist hnr) (number "") (sep "")) + (if (null? numlist) + number + (loop (cdr numlist) + (string-append number + sep + (number->string (car numlist))) + ".")))) + (htmlgi (string-append "H" (number->string + (+ (qandadiv-section-level) 1))))) + (make element gi: htmlgi + (make element gi: "A" + attributes: (list (list "NAME" (element-id + (parent (current-node))))) + (empty-sosofo)) + (literal number ". ") + (process-children)))) + +(element qandaentry + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + +(element question + (let* ((chlist (children (current-node))) + (firstch (node-list-first chlist)) + (restch (node-list-rest chlist))) + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "P" + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (make element gi: "B" + (literal (question-answer-label (current-node)) " ")) + (process-node-list (children firstch))) + (process-node-list restch)))) + +(element answer + (let* ((inhlabel (inherited-attribute-string (normalize "defaultlabel"))) + (deflabel (if inhlabel inhlabel (qanda-defaultlabel))) + (label (attribute-string (normalize "label"))) + (chlist (children (current-node))) + (firstch (node-list-first chlist)) + (restch (node-list-rest chlist))) + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "P" + (make element gi: "B" + (literal (question-answer-label (current-node)) " ")) + (process-node-list (children firstch))) + (process-node-list restch)))) + +;; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = + +(define (process-qanda-toc #!optional (node (current-node))) + (let* ((divs (node-list-filter-by-gi (children node) + (list (normalize "qandadiv")))) + (entries (node-list-filter-by-gi (children node) + (list (normalize "qandaentry")))) + (inhlabel (inherited-attribute-string (normalize "defaultlabel"))) + (deflabel (if inhlabel inhlabel (qanda-defaultlabel)))) + (make element gi: "DL" + (with-mode qandatoc + (process-node-list divs)) + (with-mode qandatoc + (process-node-list entries))))) + +(mode qandatoc + (element qandadiv + (let ((title (select-elements (children (current-node)) + (normalize "title")))) + (make sequence + (make element gi: "DT" + (process-node-list title)) + (make element gi: "DD" + (process-qanda-toc))))) + + (element (qandadiv title) + (let* ((hnr (hierarchical-number-recursive (normalize "qandadiv") + (current-node))) + (number (let loop ((numlist hnr) (number "") (sep "")) + (if (null? numlist) + number + (loop (cdr numlist) + (string-append number + sep + (number->string (car numlist))) + "."))))) + (make sequence + (literal number ". ") + (make element gi: "A" + attributes: (list (list "HREF" + (href-to (parent (current-node))))) + (process-children))))) + + (element qandaentry + (process-children)) + + (element question + (let* ((chlist (children (current-node))) + (firstch (node-list-first chlist))) + (make element gi: "DT" + (literal (question-answer-label (current-node)) " ") + (make element gi: "A" + attributes: (list (list "HREF" (href-to (current-node)))) + (process-node-list (children firstch)))))) + + (element answer + (empty-sosofo)) +) diff --git a/html/dbrfntry.dsl b/html/dbrfntry.dsl new file mode 100644 index 0000000..4c487eb --- /dev/null +++ b/html/dbrfntry.dsl @@ -0,0 +1,170 @@ +;; $Id: dbrfntry.dsl,v 1.4 2003/01/15 08:24:13 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; =========================== REFERENCE PAGES ========================== + +;;(element reference ($component$)) + +(element reference + (let* ((refinfo (select-elements (children (current-node)) + (normalize "docinfo"))) + (refintro (select-elements (children (current-node)) + (normalize "partintro"))) + (nl (titlepage-info-elements + (current-node) + refinfo + (if %generate-partintro-on-titlepage% + refintro + (empty-node-list))))) + (html-document + (with-mode head-title-mode + (literal (element-title-string (current-node)))) + (make sequence + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + + (if %generate-reference-titlepage% + (make sequence + (reference-titlepage nl 'recto) + (reference-titlepage nl 'verso)) + (empty-sosofo)) + + (if (not (generate-toc-in-front)) + (process-children) + (empty-sosofo)) + + (if (and (not (node-list-empty? refintro)) + (not %generate-partintro-on-titlepage%)) + ($process-partintro$ refintro) + (empty-sosofo)) + + (if (and %generate-reference-toc% + (not %generate-reference-toc-on-titlepage%)) + (make sequence + (build-toc (current-node) + (toc-depth (current-node)))) + (empty-sosofo)) + + (if (generate-toc-in-front) + (process-children) + (empty-sosofo))))))) + +;; If each RefEntry begins on a new page, this title is going to wind +;; up on its own page, too, so make it a divtitlepage instead. Otherwise, +;; just let it be a component title. +(element (reference title) + (empty-sosofo)) + +(mode refentry-head-title-mode + (default (process-children)) + + (element refnamediv + (let* ((refdesc (select-elements (children (current-node)) + (normalize "refdescriptor"))) + (refname (select-elements (children (current-node)) + (normalize "refname"))) + (title (if (node-list-empty? refdesc) + (node-list-first refname) + (node-list-first refdesc)))) + (process-node-list title))) + + (element refdescriptor + (process-children)) + + (element refname + (process-children)) + + (element graphic (empty-sosofo)) + (element inlinegraphic (empty-sosofo))) + +(define ($refentry-body$) + (let ((id (element-id (current-node)))) + (make sequence + (make element gi: "H1" + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" id)) + (empty-sosofo)) + (element-title-sosofo (current-node)))) + (process-children)))) + +(element refentry + (html-document (with-mode refentry-head-title-mode + (literal (element-title-string (current-node)))) + ($refentry-body$))) + +(element refmeta (empty-sosofo)) + +(element manvolnum + ;; only called for xrefs and citerefentry + (if %refentry-xref-manvolnum% + (sosofo-append + (literal "(") + (process-children) + (literal ")")) + (empty-sosofo))) + +(element refmiscinfo (empty-sosofo)) + +(element refentrytitle ($charseq$)) + +(element refnamediv ($block-container$)) + +(element refname + (make sequence + (if (and %refentry-generate-name% (first-sibling? (current-node))) + ($lowtitlewithsosofo$ 2 (literal (gentext-element-name + (gi (current-node))))) + (empty-sosofo)) + (make sequence + (process-children) + (if (last-sibling? (current-node)) + (empty-sosofo) + (literal (gentext-intra-label-sep (gi (current-node)))))))) + +(element refpurpose + (make sequence + (make entity-ref name: "nbsp") + (literal (dingbat "em-dash")) + (make entity-ref name: "nbsp") + (process-children))) + +(element refdescriptor (empty-sosofo)) ;; TO DO: finish this + +(element refclass + (let ((role (attribute-string (normalize "role")))) + (make element gi: "P" + (make element gi: "B" + (literal + (if role + (string-append role ": ") + ""))) + (process-children-trim)))) + +(element refsynopsisdiv + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (make element gi: "H2" + (element-title-sosofo (current-node))) + (process-children))) + +(element (refsynopsisdiv title) (empty-sosofo)) + +(element refsect1 ($block-container$)) +(element (refsect1 title) ($lowtitle$ 2)) +(element refsect2 ($block-container$)) +(element (refsect2 title) ($lowtitle$ 3)) +(element refsect3 ($block-container$)) +(element (refsect3 title) ($lowtitle$ 4)) + + diff --git a/html/dbsect.dsl b/html/dbsect.dsl new file mode 100644 index 0000000..151fc49 --- /dev/null +++ b/html/dbsect.dsl @@ -0,0 +1,160 @@ +;; $Id: dbsect.dsl,v 1.8 2003/03/25 19:53:41 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ============================== SECTIONS ============================== + +(define (SECTLEVEL #!optional (sect (current-node))) + (section-level-by-node (not nochunks) sect)) + +;; BRIDGEHEAD isn't a proper section, but appears to be a section title +(element bridgehead + (let* ((renderas (attribute-string "renderas")) + ;; the apparent section level + (hlevel + ;; if not real section level, then get the apparent level + ;; from "renderas" + (if renderas + (section-level-by-gi (not nochunks) (normalize renderas)) + ;; else use the real level + (SECTLEVEL))) + (helem + (string-append "H" (number->string hlevel)))) + (make element gi: helem + attributes: '(("CLASS" "BRIDGEHEAD")) + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (process-children)))) + +(define ($section-separator$) + (let* (;; There are several situations in which we don't want a + ;; separator here: + ;; 1. This document is being chunked: + (chunks (not nochunks)) + ;; 2. This node is the root element of the document: + (isroot (node-list=? (current-node) (sgml-root-element))) + ;; 3. This node is the first section in the root element + ;; and no other content (except the *info elements and + ;; the title) precedes it. This means that the + ;; titlepage-separator was the last thing we put out. + ;; No one expects two separators in a row, or the Spanish + ;; inquisition. + (s1ofrt (node-list=? (parent (current-node)) (sgml-root-element))) + (precnd (ipreced (current-node))) + (infond (info-element (parent (current-node)))) + (isfirst (or (equal? (gi precnd) (normalize "title")) + (node-list=? precnd infond)))) + (if (or chunks isroot isfirst) + (empty-sosofo) + (make empty-element gi: "HR")))) + +(define ($section$) + (html-document (with-mode head-title-mode + (literal (element-title-string (current-node)))) + ($section-body$))) + +(define ($section-body$) + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + ($section-separator$) + ($section-title$) + + (if (not (node-list-empty? (select-elements (children (current-node)) + (normalize "refentry")))) + (build-toc (current-node) 1) + (empty-sosofo)) + + (process-children))) + +(define ($section-title$) + (let* ((sect (current-node)) + (info (info-element)) + (subtitles (select-elements (children info) (normalize "subtitle"))) + (renderas (inherited-attribute-string (normalize "renderas") sect)) + ;; the apparent section level + (hlevel + ;; if not real section level, then get the apparent level + ;; from "renderas" + (if renderas + (section-level-by-gi (not nochunks) (normalize renderas)) + ;; else use the real level + (SECTLEVEL))) + (h1elem + (string-append "H" (number->string hlevel))) + (h2elem + (string-append "H" (number->string (+ hlevel 1)))) + (name (element-id)) + (isep (gentext-intra-label-sep (gi sect))) + (nsep (gentext-label-title-sep (gi sect)))) + (make sequence + (make element gi: h1elem + attributes: (list (list "CLASS" (gi sect))) + (make element gi: "A" + attributes: (list (list "NAME" name)) + (make sequence + (if (string=? (element-label (current-node)) "") + (empty-sosofo) + (literal (element-label (current-node)) nsep)) + (element-title-sosofo sect)))) + (if (node-list-empty? subtitles) + (empty-sosofo) + (with-mode subtitle-mode + (make element gi: h2elem + (process-node-list subtitles)))) + ($proc-section-info$ info)))) + +(define ($proc-section-info$ info) + (cond ((equal? (gi) (normalize "sect1")) + ($sect1-info$ info)) + ((equal? (gi) (normalize "sect2")) + ($sect2-info$ info)) + ((equal? (gi) (normalize "sect3")) + ($sect3-info$ info)) + ((equal? (gi) (normalize "sect4")) + ($sect4-info$ info)) + ((equal? (gi) (normalize "sect5")) + ($sect5-info$ info)) + ((equal? (gi) (normalize "section")) + ($section-info$ info)) + ((equal? (gi) (normalize "refsect1")) + ($refsect1-info$ info)) + ((equal? (gi) (normalize "refsect2")) + ($refsect2-info$ info)) + ((equal? (gi) (normalize "refsect3")) + ($refsect3-info$ info)) + (else (empty-sosofo)))) + +(define ($sect1-info$ info) (empty-sosofo)) +(define ($sect2-info$ info) (empty-sosofo)) +(define ($sect3-info$ info) (empty-sosofo)) +(define ($sect4-info$ info) (empty-sosofo)) +(define ($sect5-info$ info) (empty-sosofo)) +(define ($section-info$ info) (empty-sosofo)) +(define ($refsect1-info$ info) (empty-sosofo)) +(define ($refsect2-info$ info) (empty-sosofo)) +(define ($refsect3-info$ info) (empty-sosofo)) + +(element section ($section$)) +(element (section title) (empty-sosofo)) + +(element sect1 ($section$)) +(element (sect1 title) (empty-sosofo)) + +(element sect2 ($section$)) +(element (sect2 title) (empty-sosofo)) + +(element sect3 ($section$)) +(element (sect3 title) (empty-sosofo)) + +(element sect4 ($section$)) +(element (sect4 title) (empty-sosofo)) + +(element sect5 ($section$)) +(element (sect5 title) (empty-sosofo)) + +(element simplesect ($section$)) +(element (simplesect title) (empty-sosofo)) + diff --git a/html/dbsynop.dsl b/html/dbsynop.dsl new file mode 100644 index 0000000..f4f7a7e --- /dev/null +++ b/html/dbsynop.dsl @@ -0,0 +1,201 @@ +;; $Id: dbsynop.dsl,v 1.3 2003/01/15 08:24:13 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ========================= SYNTAX DEFINITIONS ========================= + +(element synopsis ($verbatim-display$ %indent-synopsis-lines% + %number-synopsis-lines%)) +(element cmdsynopsis ($paragraph$)) + +;; Support for ARG provided by James Bostock, augmented by norm +;; + +(element (cmdsynopsis command) + (make sequence + (if (first-sibling? (current-node)) + (empty-sosofo) + (make empty-element gi: "BR")) + (next-match) + (literal " "))) + +(element group + (let ((choice (attribute-string (normalize "choice"))) + (rep (attribute-string (normalize "rep"))) + (sepchar (if (inherited-attribute-string (normalize "sepchar")) + (inherited-attribute-string (normalize "sepchar")) + " "))) + (make sequence + (if (equal? (absolute-child-number (current-node)) 1) + (empty-sosofo) + (literal sepchar)) + (cond + ((equal? choice (normalize "plain")) + (literal %arg-choice-plain-open-str%)) + ((equal? choice (normalize "req")) + (literal %arg-choice-req-open-str%)) + ((equal? choice (normalize "opt")) + (literal %arg-choice-opt-open-str%)) + (else (literal %arg-choice-def-open-str%))) + (process-children) + (cond + ((equal? choice (normalize "plain")) + (literal %arg-choice-plain-close-str%)) + ((equal? choice (normalize "req")) + (literal %arg-choice-req-close-str%)) + ((equal? choice (normalize "opt")) + (literal %arg-choice-opt-close-str%)) + (else (literal %arg-choice-def-close-str%))) + (cond + ((equal? rep (normalize "repeat")) + (literal %arg-rep-repeat-str%)) + ((equal? rep (normalize "norepeat")) + (literal %arg-rep-norepeat-str%)) + (else (literal %arg-rep-def-str%)))))) + +(element arg + (let ((choice (attribute-string (normalize "choice"))) + (rep (attribute-string (normalize "rep"))) + (sepchar (if (inherited-attribute-string (normalize "sepchar")) + (inherited-attribute-string (normalize "sepchar")) + " "))) + (make sequence + (if (equal? (absolute-child-number (current-node)) 1) + (empty-sosofo) + (literal sepchar)) + (cond + ((equal? choice (normalize "plain")) + (literal %arg-choice-plain-open-str%)) + ((equal? choice (normalize "req")) (literal %arg-choice-req-open-str%)) + ((equal? choice (normalize "opt")) (literal %arg-choice-opt-open-str%)) + (else (literal %arg-choice-def-open-str%))) + (process-children) + (cond + ((equal? rep (normalize "repeat")) (literal %arg-rep-repeat-str%)) + ((equal? rep (normalize "norepeat")) (literal %arg-rep-norepeat-str%)) + (else (literal %arg-rep-def-str%))) + (cond + ((equal? choice (normalize "plain")) (literal %arg-choice-plain-close-str%)) + ((equal? choice (normalize "req")) (literal %arg-choice-req-close-str%)) + ((equal? choice (normalize "opt")) (literal %arg-choice-opt-close-str%)) + (else (literal %arg-choice-def-close-str%)))))) + + +(element (group arg) + (let ((choice (attribute-string (normalize "choice"))) + (rep (attribute-string (normalize "rep")))) + (make sequence + (if (not (first-sibling? (current-node))) + (literal %arg-or-sep%) + (empty-sosofo)) + (process-children)))) + +(element sbr + (make empty-element gi: "BR")) + +;; ---------------------------------------------------------------------- +;; Syntax highlighting... + +(define (funcsynopsis-function #!optional (sosofo (process-children))) + (make element gi: "B" + attributes: '(("CLASS" "FSFUNC")) + sosofo)) + +(define (paramdef-parameter #!optional (sosofo (process-children))) + (make element gi: "VAR" + attributes: '(("CLASS" "PDPARAM")) + sosofo)) + +;; ---------------------------------------------------------------------- + +(element synopfragmentref + (let* ((target (element-with-id (attribute-string (normalize "linkend")))) + (snum (child-number target))) + (make element gi: "I" + (make element gi: "A" + attributes: (list + (list "HREF" (href-to target))) + (literal "(" (number->string snum) ")")) + (process-children)))) + +(element synopfragment + (let ((id (element-id (current-node))) + (snum (child-number (current-node)))) + (make element gi: "P" + (make element gi: "A" + attributes: (list + (list "NAME" id)) + (literal "(" (number->string snum) ")")) + (make entity-ref name: "nbsp") + (process-children)))) + +(element funcsynopsis ($informal-object$)) + +(element funcsynopsisinfo ($verbatim-display$ %indent-funcsynopsisinfo-lines% + %number-funcsynopsisinfo-lines%)) + +(element funcprototype + (let ((paramdefs (select-elements (children (current-node)) (normalize "paramdef")))) + (make sequence + (make element gi: "P" + (make element gi: "CODE" + (process-children) + (if (equal? %funcsynopsis-style% 'kr) + (with-mode kr-funcsynopsis-mode + (process-node-list paramdefs)) + (empty-sosofo))))))) + +(element funcdef + (make element gi: "CODE" + attributes: '(("CLASS" "FUNCDEF")) + (process-children))) + +(element (funcdef function) + (if %funcsynopsis-decoration% + (funcsynopsis-function) + (process-children))) + +(element void + (if (equal? %funcsynopsis-style% 'ansi) + (literal "(void);") + (literal "();"))) + +(element varargs (literal "(...);")) + +(element paramdef + (let ((param (select-elements (children (current-node)) (normalize "parameter")))) + (make sequence + (if (equal? (child-number (current-node)) 1) + (literal "(") + (empty-sosofo)) + (if (equal? %funcsynopsis-style% 'ansi) + (process-children) + (process-node-list param)) + (if (equal? (gi (ifollow (current-node))) (normalize "paramdef")) + (literal ", ") + (literal ");"))))) + +(element (paramdef parameter) + (make sequence + (if %funcsynopsis-decoration% + (paramdef-parameter) + (process-children)) + (if (equal? (gi (ifollow (current-node))) (normalize "parameter")) + (literal ", ") + (empty-sosofo)))) + +(element funcparams + (make sequence + (literal "(") + (process-children) + (literal ")"))) + +(mode kr-funcsynopsis-mode + (element paramdef + (make sequence + (make empty-element gi: "BR") + (process-children) + (literal ";")))) + diff --git a/html/dbtable.dsl b/html/dbtable.dsl new file mode 100644 index 0000000..91387b0 --- /dev/null +++ b/html/dbtable.dsl @@ -0,0 +1,494 @@ +;; $Id: dbtable.dsl,v 1.6 2003/02/11 01:20:04 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; +;; Table support completely reimplemented by norm 15/16 Nov 1997. +;; Adapted from print support. +;; +;; ====================================================================== +;; +;; This code is intended to implement the SGML Open Exchange Table Model +;; (http://www.sgmlopen.org/sgml/docs/techpubs.htm) as far as is possible +;; in HTML. There are a few areas where this code probably fails to +;; perfectly implement the model: +;; +;; - Mixed column width units (4*+2pi) are not supported. +;; - The behavior that results from mixing relative units with +;; absolute units has not been carefully considered. +;; +;; ====================================================================== +;; +;; My goal in reimplementing the table model was to provide correct +;; formatting in tables that use MOREROWS. The difficulty is that +;; correct formatting depends on calculating the column into which +;; an ENTRY will fall. +;; +;; This is a non-trivial problem because MOREROWS can hang down from +;; preceding rows and ENTRYs may specify starting columns (skipping +;; preceding ones). +;; +;; A simple, elegant recursive algorithm exists. Unfortunately it +;; requires calculating the column number of every preceding cell +;; in the entire table. Without memoization, performance is unacceptable +;; even in relatively small tables (5x5, for example). +;; +;; In order to avoid recursion, the algorithm used below is one that +;; works forward from the beginning of the table and "passes along" +;; the relevant information (column number of the preceding cell and +;; overhang from the MOREROWS in preceding rows). +;; +;; Unfortunately, this means that element construction rules +;; can't always be used to fire the appropriate rule. Instead, +;; each TGROUP has to process each THEAD/BODY/FOOT explicitly. +;; And each of those must process each ROW explicitly, then each +;; ENTRY/ENTRYTBL explicitly. +;; +;; ---------------------------------------------------------------------- +;; +;; I attempted to simplify this code by relying on inheritence from +;; table-column flow objects, but that wasn't entirely successful. +;; Horizontally spanning cells didn't seem to inherit from table-column +;; flow objects that didn't specify equal spanning. There seemed to +;; be other problems as well, but they could have been caused by coding +;; errors on my part. +;; +;; Anyway, by the time I understood how I could use table-column +;; flow objects for inheritence, I'd already implemented all the +;; machinery below to "work it out by hand". +;; +;; ====================================================================== +;; NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE +;; ---------------------------------------------------------------------- +;; A fairly large chunk of this code is in dbcommon.dsl! +;; ====================================================================== + +;; Default for COLSEP/ROWSEP if unspecified +(define %cals-rule-default% "0") + +;; Default for VALIGN if unspecified +(define %cals-valign-default% "TOP") + +;; ====================================================================== +;; Convert colwidth units into table-unit measurements + +(define (colwidth-length lenstr) + (if (string? lenstr) + (let ((number (length-string-number-part lenstr)) + (units (length-string-unit-part lenstr))) + (if (or (string=? units "*") (string=? number "")) + ;; relative units or no number, give up + 0pt + (if (string=? units "") + ;; no units, default to pixels + (* (string->number number) 1px) + (let* ((unum (string->number number)) + (uname (case-fold-down units))) + (case uname + (("mm") (* unum 1mm)) + (("cm") (* unum 1cm)) + (("in") (* unum 1in)) + (("pi") (* unum 1pi)) + (("pt") (* unum 1pt)) + (("px") (* unum 1px)) + ;; unrecognized units; use pixels + (else (* unum 1px))))))) + ;; lenstr is not a string...probably #f + 0pt)) + +(define (cals-relative-colwidth? colwidth) + (if (string? colwidth) + (let ((strlen (string-length colwidth))) + (if (string=? colwidth "*") + #t + (string=? (substring colwidth (- strlen 1) strlen) "*"))) + #f)) + +(define (cals-relative-colwidth colwidth) + (let ((number (length-string-number-part colwidth)) + (units (length-string-unit-part colwidth))) + (if (string=? units "*") + (if (string=? number "") + 1 + (string->number number)) + 0))) + +(define (cell-relative-colwidth cell relative) + ;; given a cell and a relative width, work out the HTML cell WIDTH attribute + (let* ((tgroup (find-tgroup cell)) + (pgwide? (equal? (attribute-string (normalize "pgwide") (parent tgroup)) "1"))) + (if (and (not pgwide?) %html40%) + ;; html4 allows widths like "1*", we don't wanna use 50% if pgwide is not on + (string-append (number->string relative) "*") + (let loop ((colspecs (select-elements (children tgroup) + (normalize "colspec"))) + (reltotal 0)) + (if (not (node-list-empty? colspecs)) + (loop (node-list-rest colspecs) + (+ reltotal (cals-relative-colwidth + (colspec-colwidth + (node-list-first colspecs))))) + (if (equal? reltotal 0) + "" + (string-append (number->string (round (* (/ relative reltotal) 100))) "%"))))))) + +(define (cell-colwidth cell colnum) + ;; return the width of a cell, or "" if not specified + (let* ((entry (ancestor-member cell (list (normalize "entry") + (normalize "entrytbl")))) + (colspec (find-colspec-by-number colnum)) + (colwidth (colspec-colwidth colspec)) + (width (round (/ (colwidth-length colwidth) 1px)))) + (if (node-list-empty? colspec) + "" + (if (and (equal? (hspan entry) 1) colwidth) + (if (cals-relative-colwidth? colwidth) + (cell-relative-colwidth cell (cals-relative-colwidth colwidth)) + (number->string width)) + "")))) + +;; ====================================================================== + +(define (cell-align cell colnum) + ;; horizontal alignment for the cell, or "" if not set; efficiency + ;; here is important + (let* ((entry (ancestor-member cell (list (normalize "entry") + (normalize "entrytbl")))) + (spanname (attribute-string (normalize "spanname") entry))) + (if (attribute-string (normalize "align") entry) + (attribute-string (normalize "align") entry) + (if (and spanname (spanspec-align (find-spanspec spanname))) + (spanspec-align (find-spanspec spanname)) + (if %html40% + ;; no need to set align explictly, let COL do the work + "" + (if (colspec-align (find-colspec-by-number colnum)) + (colspec-align (find-colspec-by-number colnum)) + (let ((tgroup (find-tgroup entry))) + (if (tgroup-align tgroup) + (tgroup-align tgroup) + (normalize "left"))))))))) + +(define (cell-valign cell colnum) + ;; vertical alignment for the cell, or "" if not set; efficiency + ;; here is important + (let ((entry (ancestor-member cell (list (normalize "entry") + (normalize "entrytbl"))))) + (if (attribute-string (normalize "valign") entry) + (attribute-string (normalize "valign") entry) + ""))) + +(define ($table-frame$ table) + ;; determine the proper setting for the html 4 FRAME attribute + (let* ((wrapper (parent (current-node))) + (frameattr (attribute-string (normalize "frame") wrapper))) + (if (and %html40% frameattr) + (cond + ((equal? frameattr (normalize "all")) + (list (list "FRAME" "border"))) + ((equal? frameattr (normalize "bottom")) + (list (list "FRAME" "below"))) + ((equal? frameattr (normalize "none")) + (list (list "FRAME" "void"))) + ((equal? frameattr (normalize "sides")) + (list (list "FRAME" "vsides"))) + ((equal? frameattr (normalize "top")) + (list (list "FRAME" "above"))) + ((equal? frameattr (normalize "topbot")) + (list (list "FRAME" "hsides"))) + (else '())) + '()))) + +(define ($table-border$ table) + ;; determine the proper setting for the html 4 BORDER attribute (cell frames) + ;; FIXME: rules can be overriden by COLSPEC elements, use "group" value? + (let* ((wrapper (parent (current-node))) + (rowsepattr (or (attribute-string (normalize "rowsep") (current-node)) + (attribute-string (normalize "rowsep") wrapper))) + (colsepattr (or (attribute-string (normalize "colsep") (current-node)) + (attribute-string (normalize "colsep") wrapper)))) + (if (and %html40% (or rowsepattr colsepattr)) + ;; remember there are actually 3 possible values: 0, 1, unset + (cond + ((and (equal? colsepattr "1") (equal? rowsepattr "1")) + (list (list "RULES" "all"))) + ((and (equal? colsepattr "0") (equal? rowsepattr "0")) + (list (list "RULES" "none"))) + ((and (equal? colsepattr "1") (equal? rowsepattr "0")) + (list (list "RULES" "cols"))) + ((and (equal? colsepattr "0") (equal? rowsepattr "1")) + (list (list "RULES" "rows"))) + (else '())) ; if rowsep set but not colsep, ignore it + '()))) + +;; ====================================================================== +;; Element rules + +(element tgroup + (let* ((wrapper (parent (current-node))) + (frameattr (attribute-string (normalize "frame") wrapper)) + (pgwide (attribute-string (normalize "pgwide") wrapper))) + (make element gi: "TABLE" + attributes: (append + (if (equal? frameattr (normalize "none")) + '(("BORDER" "0")) + '(("BORDER" "1"))) + ($table-frame$ (current-node)) + ($table-border$ (current-node)) + (if (equal? pgwide "1") + (list (list "WIDTH" ($table-width$))) + '()) + (if %cals-table-class% + (list (list "CLASS" %cals-table-class%)) + '())) + ($process-colspecs$ (current-node)) + (process-node-list (select-elements (children (current-node)) (normalize "thead"))) + (process-node-list (select-elements (children (current-node)) (normalize "tbody"))) + (process-node-list (select-elements (children (current-node)) (normalize "tfoot"))) + (make-table-endnotes)))) + +(element entrytbl ;; sortof like a tgroup... + (let* ((wrapper (parent (parent (parent (parent (current-node)))))) + ;; table tgroup tbody row + (frameattr (attribute-string (normalize "frame") wrapper)) + (tgrstyle (attribute-string (normalize "tgroupstyle")))) + (make element gi: "TABLE" + attributes: (append + (if (and (or (equal? frameattr (normalize "none")) + (equal? tgrstyle (normalize "noborder"))) + (not (equal? tgrstyle (normalize "border")))) + '(("BORDER" "0")) + '(("BORDER" "1"))) + ($table-frame$ (current-node)) + ($table-border$ (current-node)) + (if %cals-table-class% + (list (list "CLASS" %cals-table-class%)) + '())) + ($process-colspecs$ (current-node)) + (process-node-list (select-elements (children (current-node)) (normalize "thead"))) + (process-node-list (select-elements (children (current-node)) (normalize "tbody")))))) + +(element colspec + ;; now handled by $process-colspecs$ + (empty-sosofo)) + +(element spanspec + (empty-sosofo)) + +(element thead + ;; note that colspec/spanspec in thead isn't supported by HTML table model + (if %html40% + (make element gi: "THEAD" + ($process-table-body$ (current-node))) + ($process-table-body$ (current-node)))) + +(element tfoot + ;; note that colspec/spanspec in tfoot isn't supported by HTML table model + (if %html40% + (make element gi: "TFOOT" + ($process-table-body$ (current-node))) + ($process-table-body$ (current-node)))) + +(element tbody + (if %html40% + (make element gi: "TBODY" + attributes: (if (attribute-string (normalize "valign")) + (list (list "VALIGN" (attribute-string (normalize "valign")))) + '()) + ($process-table-body$ (current-node))) + ($process-table-body$ (current-node)))) + +(element row + (empty-sosofo)) ;; this should never happen, they're processed explicitly + +(element entry + (empty-sosofo)) ;; this should never happen, they're processed explicitly + +;; ====================================================================== +;; Functions that handle processing of table bodies, rows, and cells + +(define ($process-colspecs$ tgroup) + ;; given tgroup or entrytbl, convert the colspecs to HTML4 COL elements + (if (not %html40%) + (empty-sosofo) + (let ((cols (string->number (attribute-string (normalize "cols"))))) + (let loop ((colnum 1)) + (if (> colnum cols) + (empty-sosofo) + (make sequence + (let* ((colspec (find-colspec-by-number colnum)) + (colwidth (colspec-colwidth colspec))) + (if (node-list-empty? colspec) + (make empty-element gi: "COL") + (make empty-element gi: "COL" + attributes: + (append + (if colwidth + (list (list "WIDTH" + (if (cals-relative-colwidth? colwidth) + (cell-relative-colwidth colspec (cals-relative-colwidth colwidth)) + (number->string (round (/ (colwidth-length colwidth) 1px)))))) + '()) + (if (attribute-string (normalize "align") colspec) + (list (list "ALIGN" (attribute-string (normalize "align") colspec))) + '()) + (if (attribute-string (normalize "char") colspec) + (list (list "CHAR" (attribute-string (normalize "char") colspec))) + '()) + (if (attribute-string (normalize "charoff") colspec) + (list (list "CHAROFF" (attribute-string (normalize "charoff") colspec))) + '()) + (if (attribute-string (normalize "colname") colspec) + (list (list "TITLE" (attribute-string (normalize "colname") colspec))) + '()))))) + (loop (+ colnum 1)))))))) + +(define ($process-table-body$ body) + (let* ((tgroup (find-tgroup body)) + (cols (string->number (attribute-string (normalize "cols") + tgroup)))) + (let loop ((rows (select-elements (children body) (normalize "row"))) + (overhang (constant-list 0 cols))) + (if (node-list-empty? rows) + (empty-sosofo) + (make sequence + ($process-row$ (node-list-first rows) overhang) + (loop (node-list-rest rows) + (update-overhang (node-list-first rows) overhang))))))) + +(define ($process-row$ row overhang) + ;; FIXME: rowsep + (let* ((tgroup (find-tgroup row)) + (rowcells (node-list-filter-out-pis (children row))) + (rowalign (attribute-string (normalize "valign") row)) + (maxcol (string->number (attribute-string (normalize "cols") tgroup))) + (lastentry (node-list-last rowcells))) + (make element gi: "TR" + attributes: (append + (if rowalign + (list (list "VALIGN" rowalign)) + '()) + '()) + (let loop ((cells rowcells) + (prevcell (empty-node-list))) + (if (node-list-empty? cells) + (empty-sosofo) + (make sequence + ($process-cell$ (node-list-first cells) + prevcell overhang) + (loop (node-list-rest cells) + (node-list-first cells))))) + + ;; add any necessary empty cells to the end of the row + (let loop ((colnum (overhang-skip overhang + (+ (cell-column-number + lastentry overhang) + (hspan lastentry))))) + (if (> colnum maxcol) + (empty-sosofo) + (make sequence + (make element gi: "TD" + (make entity-ref name: "nbsp")) + (loop (overhang-skip overhang (+ colnum 1))))))))) + +(define (empty-cell? entry) + ;; Return #t if and only if entry is empty (or contains only PIs) + (let loop ((nl (children entry))) + (if (node-list-empty? nl) + #t + (let* ((node (node-list-first nl)) + (nodeclass (node-property 'class-name node)) + (nodechar (if (equal? nodeclass 'data-char) + (node-property 'char node) + #f)) + (whitespace? (and (equal? nodeclass 'data-char) + (or (equal? nodechar #\space) + (equal? (data node) " ") + (equal? (data node) " ") + (equal? (data node) " "))))) + (if (not (or (equal? (node-property 'class-name node) 'pi) + whitespace?)) + #f + (loop (node-list-rest nl))))))) + +(define ($process-cell$ entry preventry overhang) + (let* ((colnum (cell-column-number entry overhang)) + (lastcellcolumn (if (node-list-empty? preventry) + 0 + (- (+ (cell-column-number preventry overhang) + (hspan preventry)) + 1))) + (lastcolnum (if (> lastcellcolumn 0) + (overhang-skip overhang lastcellcolumn) + 0)) + (htmlgi (if (have-ancestor? (normalize "tbody") entry) + "TD" + "TH"))) + (make sequence + (if (node-list-empty? (preced entry)) + (if (attribute-string (normalize "id") (parent entry)) + (make element gi: "A" + attributes: (list + (list + "NAME" + (attribute-string (normalize "id") + (parent entry)))) + (empty-sosofo)) + (empty-sosofo)) + (empty-sosofo)) + + (if (attribute-string (normalize "id") entry) + (make element gi: "A" + attributes: (list + (list + "NAME" + (attribute-string (normalize "id") entry))) + (empty-sosofo)) + (empty-sosofo)) + + ;; This is a little bit complicated. We want to output empty cells + ;; to skip over missing data. We start count at the column number + ;; arrived at by adding 1 to the column number of the previous entry + ;; and skipping over any MOREROWS overhanging entrys. Then for each + ;; iteration, we add 1 and skip over any overhanging entrys. + (let loop ((count (overhang-skip overhang (+ lastcolnum 1)))) + (if (>= count colnum) + (empty-sosofo) + (make sequence + (make element gi: htmlgi + (make entity-ref name: "nbsp") +;; (literal (number->string lastcellcolumn) ", ") +;; (literal (number->string lastcolnum) ", ") +;; (literal (number->string (hspan preventry)) ", ") +;; (literal (number->string colnum ", ")) +;; ($debug-pr-overhang$ overhang) + ) + (loop (overhang-skip overhang (+ count 1)))))) + + ;; Now we've output empty cells for any missing entries, so we + ;; are ready to output the cell for this entry... + (make element gi: htmlgi + attributes: (append + (if (> (hspan entry) 1) + (list (list "COLSPAN" (number->string (hspan entry)))) + '()) + (if (> (vspan entry) 1) + (list (list "ROWSPAN" (number->string (vspan entry)))) + '()) + (if (and (not %html40%) (not (equal? (cell-colwidth entry colnum) ""))) + (list (list "WIDTH" (cell-colwidth entry colnum))) + '()) + (if (not (equal? (cell-align entry colnum) "")) + (list (list "ALIGN" (cell-align entry colnum))) + '()) + (if (not (equal? (cell-valign entry colnum) "")) + (list (list "VALIGN" (cell-valign entry colnum))) + '())) + (if (empty-cell? entry) + (make entity-ref name: "nbsp") + (if (equal? (gi entry) (normalize "entrytbl")) + (process-node-list entry) + (process-node-list (children entry)))))))) + +;; EOF dbtable.dsl + diff --git a/html/dbtitle.dsl b/html/dbtitle.dsl new file mode 100644 index 0000000..b56225c --- /dev/null +++ b/html/dbtitle.dsl @@ -0,0 +1,67 @@ +;; $Id: dbtitle.dsl,v 1.2 2003/01/15 08:24:13 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; So we can pass different sosofo's to this routine and get identical +;; treatment (see REFNAME in dbrfntry.dsl) +;; +(define ($lowtitlewithsosofo$ tlevel sosofo) + (let ((tgi (cond + ((equal? tlevel 1) "H1") + ((equal? tlevel 2) "H2") + ((equal? tlevel 3) "H3") + ((equal? tlevel 4) "H4") + ((equal? tlevel 5) "H5") + (else "P")))) + (if (< tlevel 6) + (make element gi: tgi + sosofo) + (make element gi: "P" + (make element gi: "B" + sosofo))))) + +(define ($lowtitle$ tlevel) + ($lowtitlewithsosofo$ tlevel (process-children))) + +(define ($runinhead$) + (let* ((title (data (current-node))) + (titlelen (string-length title)) + (lastchar (if (> titlelen 0) + (string-ref title (- titlelen 1)) + ".")) + (punct (if (or (= titlelen 0) + (member lastchar %content-title-end-punct%)) + "" + %default-title-end-punct%))) + (make element gi: "B" + (process-children) + (literal punct " ")))) + +(element title + (make element gi: "P" + (make element gi: "B" + (process-children-trim)))) + +(element titleabbrev (empty-sosofo)) + +(mode title-mode + (element title + (process-children))) + +(mode subtitle-mode + (element subtitle + (make sequence + (literal (if (first-sibling?) + "" + "; ")) + (process-children)))) + +(mode head-title-mode + ;; TITLE in an HTML HEAD + (default + (process-children)) + + (element graphic (empty-sosofo)) + (element inlinegraphic (empty-sosofo))) diff --git a/html/dbttlpg.dsl b/html/dbttlpg.dsl new file mode 100644 index 0000000..ebeb5fa --- /dev/null +++ b/html/dbttlpg.dsl @@ -0,0 +1,4588 @@ +;; $Id: dbttlpg.dsl,v 1.10 2004/10/10 11:55:10 petere78 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +(define (have-sibling? sibling-gi #!optional (node (current-node))) + (let loop ((nl (children (parent node)))) + (if (node-list-empty? nl) + #f + (if (equal? (gi (node-list-first nl)) sibling-gi) + #t + (loop (node-list-rest nl)))))) + +(define (titlepage-content? elements gis) + (let giloop ((gilist gis)) + (if (null? gilist) + #f + (if (not (node-list-empty? (node-list-filter-by-gi + elements + (list (car gilist))))) + #t + (giloop (cdr gilist)))))) + +(define (titlepage-gi-list-by-elements elements nodelist) + ;; Elements is a list of GIs. Nodelist is a list of nodes. + ;; This function returns all of the nodes in nodelist that + ;; are in elements in the order they occur in elements. + (let loop ((gilist elements) (rlist (empty-node-list))) + (if (null? gilist) + rlist + (loop (cdr gilist) + (node-list rlist (node-list-filter-by-gi + nodelist (list (car gilist)))))))) + +(define (titlepage-gi-list-by-nodelist elements nodelist) + ;; Elements is a list of GIs. Nodelist is a list of nodes. + ;; This function returns all of the nodes in nodelist that + ;; are in elements in the order they occur in nodelist. + (let loop ((nl nodelist) (rlist (empty-node-list))) + (if (node-list-empty? nl) + rlist + (if (member (gi (node-list-first nl)) elements) + (loop (node-list-rest nl) + (node-list rlist (node-list-first nl))) + (loop (node-list-rest nl) rlist))))) + +(define (titlepage-nodelist elements nodelist) + ;; We expand BOOKBIBLIO, BIBLIOMISC, and BIBLIOSET in the element + ;; list because that level of wrapper usually isn't significant. + (let ((exp-nodelist (expand-children nodelist (list (normalize "bookbiblio") + (normalize "bibliomisc") + (normalize "biblioset"))))) + (if %titlepage-in-info-order% + (titlepage-gi-list-by-nodelist elements exp-nodelist) + (titlepage-gi-list-by-elements elements exp-nodelist)))) + +(define (titlepage-recto-legalnotice #!optional (node (current-node))) + (let ((notices (select-elements + (children (parent node)) + (normalize "legalnotice"))) + (copyrights (select-elements + (children (parent node)) + (normalize "copyright")))) + (if (and %generate-legalnotice-link% + (not nochunks)) + ;; Divert the contents of legal to another file. It will be xref'd + ;; from the Copyright. + (if (first-sibling? node) + (make sequence + (make entity + system-id: (html-entity-file + ($legalnotice-link-file$ node)) + (html-doctype) + (make element gi: "HTML" + (make element gi: "HEAD" + ($standard-html-header$)) + (make element gi: "BODY" + attributes: %body-attr% + (header-navigation node) + ($semiformal-object$) + (with-mode legal-notice-link-mode + (process-node-list (node-list-rest notices))) + (footer-navigation node)))) + (if (node-list-empty? copyrights) + (make element gi: "A" + attributes: (list + (list "HREF" + ($legalnotice-link-file$ + node))) + (literal (gentext-element-name node))) + (empty-sosofo))) + (empty-sosofo)) + ($semiformal-object$)))) + +(define (titlepage-recto-copyright #!optional (node (current-node))) + (let ((years (select-elements (descendants node) + (normalize "year"))) + (holders (select-elements (descendants node) + (normalize "holder"))) + (legalnotice (select-elements (children (parent node)) + (normalize "legalnotice")))) + (make element gi: "P" + attributes: (list + (list "CLASS" (gi))) + (if (and %generate-legalnotice-link% + (not nochunks) + (not (node-list-empty? legalnotice))) + (make sequence + (make element gi: "A" + attributes: (list + (list "HREF" + ($legalnotice-link-file$ + (node-list-first legalnotice)))) + (literal (gentext-element-name (gi node)))) + (literal " ") + (dingbat-sosofo "copyright") + (literal " ") + (process-node-list years) + (literal " ") + (process-node-list holders)) + (make sequence + (literal (gentext-element-name (gi node))) + (literal " ") + (dingbat-sosofo "copyright") + (literal " ") + (process-node-list years) + (literal " ") + (process-node-list holders)))))) + +;; == Title pages for SETs ============================================== + +(define (set-titlepage-recto-elements) + (list (normalize "title") + (normalize "subtitle") + (normalize "graphic") + (normalize "mediaobject") + (normalize "corpauthor") + (normalize "authorgroup") + (normalize "author") + (normalize "editor") + (normalize "copyright") + (normalize "legalnotice"))) + +(define (set-titlepage-verso-elements) '()) + +(define (set-titlepage-content? elements side) + (titlepage-content? elements (if (equal? side 'recto) + (set-titlepage-recto-elements) + (set-titlepage-verso-elements)))) + +(define (set-titlepage elements #!optional (side 'recto)) + (let ((nodelist (titlepage-nodelist + (if (equal? side 'recto) + (set-titlepage-recto-elements) + (set-titlepage-verso-elements)) + elements))) + (if (set-titlepage-content? elements side) + (make element gi: "DIV" + attributes: '(("CLASS" "TITLEPAGE")) + (let loop ((nl nodelist) (lastnode (empty-node-list))) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (if (or (node-list-empty? lastnode) + (not (equal? (gi (node-list-first nl)) + (gi lastnode)))) + (set-titlepage-before (node-list-first nl) side) + (empty-sosofo)) + (cond + ((equal? (gi (node-list-first nl)) (normalize "abbrev")) + (set-titlepage-abbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "abstract")) + (set-titlepage-abstract (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "address")) + (set-titlepage-address (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "affiliation")) + (set-titlepage-affiliation (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "artpagenums")) + (set-titlepage-artpagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "author")) + (set-titlepage-author (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorblurb")) + (set-titlepage-authorblurb (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorgroup")) + (set-titlepage-authorgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorinitials")) + (set-titlepage-authorinitials (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bibliomisc")) + (set-titlepage-bibliomisc (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "biblioset")) + (set-titlepage-biblioset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bookbiblio")) + (set-titlepage-bookbiblio (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "citetitle")) + (set-titlepage-citetitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "collab")) + (set-titlepage-collab (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "confgroup")) + (set-titlepage-confgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractnum")) + (set-titlepage-contractnum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractsponsor")) + (set-titlepage-contractsponsor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contrib")) + (set-titlepage-contrib (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "copyright")) + (set-titlepage-recto-copyright (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpauthor")) + (set-titlepage-corpauthor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpname")) + (set-titlepage-corpname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "date")) + (set-titlepage-date (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "edition")) + (set-titlepage-edition (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "editor")) + (set-titlepage-editor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "firstname")) + (set-titlepage-firstname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "graphic")) + (set-titlepage-graphic (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "honorific")) + (set-titlepage-honorific (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "indexterm")) + (set-titlepage-indexterm (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "invpartnumber")) + (set-titlepage-invpartnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "isbn")) + (set-titlepage-isbn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issn")) + (set-titlepage-issn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issuenum")) + (set-titlepage-issuenum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "itermset")) + (set-titlepage-itermset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "keywordset")) + (set-titlepage-keywordset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "legalnotice")) + (set-titlepage-recto-legalnotice (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "lineage")) + (set-titlepage-lineage (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "mediaobject")) + (set-titlepage-modespec (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "modespec")) + (set-titlepage-modespec (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "orgname")) + (set-titlepage-orgname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othercredit")) + (set-titlepage-othercredit (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othername")) + (set-titlepage-othername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pagenums")) + (set-titlepage-pagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "printhistory")) + (set-titlepage-printhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productname")) + (set-titlepage-productname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productnumber")) + (set-titlepage-productnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubdate")) + (set-titlepage-pubdate (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publisher")) + (set-titlepage-publisher (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publishername")) + (set-titlepage-publishername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubsnumber")) + (set-titlepage-pubsnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "releaseinfo")) + (set-titlepage-releaseinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "revhistory")) + (set-titlepage-revhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesinfo")) + (set-titlepage-seriesinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesvolnums")) + (set-titlepage-seriesvolnums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subjectset")) + (set-titlepage-subjectset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subtitle")) + (set-titlepage-subtitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "surname")) + (set-titlepage-surname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "title")) + (set-titlepage-title (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "titleabbrev")) + (set-titlepage-titleabbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "volumenum")) + (set-titlepage-volumenum (node-list-first nl) side)) + (else + (set-titlepage-default (node-list-first nl) side))) + (loop (node-list-rest nl) (node-list-first nl))))) + (set-titlepage-separator side)) + (empty-sosofo)))) + +(define (set-titlepage-separator side) + (empty-sosofo)) + +(define (set-titlepage-before node side) + (empty-sosofo)) + +(define (set-titlepage-default node side) + (let ((foo (debug (string-append "No set-titlepage-* for " (gi node) "!")))) + (empty-sosofo))) + +(define (set-titlepage-element node side) + (if (equal? side 'recto) + (with-mode set-titlepage-recto-mode + (process-node-list node)) + (with-mode set-titlepage-verso-mode + (process-node-list node)))) + +(define (set-titlepage-abbrev node side) + (set-titlepage-element node side)) +(define (set-titlepage-abstract node side) + (set-titlepage-element node side)) +(define (set-titlepage-address node side) + (set-titlepage-element node side)) +(define (set-titlepage-affiliation node side) + (set-titlepage-element node side)) +(define (set-titlepage-artpagenums node side) + (set-titlepage-element node side)) +(define (set-titlepage-author node side) + (set-titlepage-element node side)) +(define (set-titlepage-authorblurb node side) + (set-titlepage-element node side)) +(define (set-titlepage-authorgroup node side) + (set-titlepage-element node side)) +(define (set-titlepage-authorinitials node side) + (set-titlepage-element node side)) +(define (set-titlepage-bibliomisc node side) + (set-titlepage-element node side)) +(define (set-titlepage-biblioset node side) + (set-titlepage node side)) +(define (set-titlepage-bookbiblio node side) + (set-titlepage node side)) +(define (set-titlepage-citetitle node side) + (set-titlepage-element node side)) +(define (set-titlepage-collab node side) + (set-titlepage-element node side)) +(define (set-titlepage-confgroup node side) + (set-titlepage-element node side)) +(define (set-titlepage-contractnum node side) + (set-titlepage-element node side)) +(define (set-titlepage-contractsponsor node side) + (set-titlepage-element node side)) +(define (set-titlepage-contrib node side) + (set-titlepage-element node side)) +(define (set-titlepage-recto-copyright node side) + (set-titlepage-element node side)) + +(define (set-titlepage-corpauthor node side) + (if (equal? side 'recto) + (set-titlepage-element node side) + (if (first-sibling? node) + (make element gi: "P" + attributes: (list (list "CLASS" (gi node))) + (with-mode set-titlepage-verso-mode + (process-node-list + (select-elements (children (parent node)) + (normalize "corpauthor"))))) + (empty-sosofo)))) + +(define (set-titlepage-corpname node side) + (set-titlepage-element node side)) +(define (set-titlepage-date node side) + (set-titlepage-element node side)) +(define (set-titlepage-edition node side) + (set-titlepage-element node side)) +(define (set-titlepage-editor node side) + (set-titlepage-element node side)) +(define (set-titlepage-firstname node side) + (set-titlepage-element node side)) +(define (set-titlepage-graphic node side) + (set-titlepage-element node side)) +(define (set-titlepage-honorific node side) + (set-titlepage-element node side)) +(define (set-titlepage-indexterm node side) + (set-titlepage-element node side)) +(define (set-titlepage-invpartnumber node side) + (set-titlepage-element node side)) +(define (set-titlepage-isbn node side) + (set-titlepage-element node side)) +(define (set-titlepage-issn node side) + (set-titlepage-element node side)) +(define (set-titlepage-issuenum node side) + (set-titlepage-element node side)) +(define (set-titlepage-itermset node side) + (set-titlepage-element node side)) +(define (set-titlepage-keywordset node side) + (set-titlepage-element node side)) +(define (set-titlepage-recto-legalnotice node side) + (set-titlepage-element node side)) +(define (set-titlepage-lineage node side) + (set-titlepage-element node side)) +(define (set-titlepage-mediaobject node side) + (set-titlepage-element node side)) +(define (set-titlepage-modespec node side) + (set-titlepage-element node side)) +(define (set-titlepage-orgname node side) + (set-titlepage-element node side)) +(define (set-titlepage-othercredit node side) + (set-titlepage-element node side)) +(define (set-titlepage-othername node side) + (set-titlepage-element node side)) +(define (set-titlepage-pagenums node side) + (set-titlepage-element node side)) +(define (set-titlepage-printhistory node side) + (set-titlepage-element node side)) +(define (set-titlepage-productname node side) + (set-titlepage-element node side)) +(define (set-titlepage-productnumber node side) + (set-titlepage-element node side)) +(define (set-titlepage-pubdate node side) + (set-titlepage-element node side)) +(define (set-titlepage-publisher node side) + (set-titlepage-element node side)) +(define (set-titlepage-publishername node side) + (set-titlepage-element node side)) +(define (set-titlepage-pubsnumber node side) + (set-titlepage-element node side)) +(define (set-titlepage-releaseinfo node side) + (set-titlepage-element node side)) +(define (set-titlepage-revhistory node side) + (set-titlepage-element node side)) +(define (set-titlepage-seriesinfo node side) + (set-titlepage-element node side)) +(define (set-titlepage-seriesvolnums node side) + (set-titlepage-element node side)) +(define (set-titlepage-subjectset node side) + (set-titlepage-element node side)) +(define (set-titlepage-subtitle node side) + (set-titlepage-element node side)) +(define (set-titlepage-surname node side) + (set-titlepage-element node side)) +(define (set-titlepage-title node side) + (set-titlepage-element node side)) +(define (set-titlepage-titleabbrev node side) + (set-titlepage-element node side)) +(define (set-titlepage-volumenum node side) + (set-titlepage-element node side)) + +(mode set-titlepage-recto-mode + (element para + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element abstract + (make element gi: "DIV" + ($semiformal-object$))) + + (element (abstract title) (empty-sosofo)) + + (element address + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element author + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (literal author-name))) + (process-node-list author-affil)))) + + (element authorblurb + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element authorgroup + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (process-children)))) + + (element copyright + (titlepage-recto-copyright)) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element (copyright holder) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element corpauthor + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element edition + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make entity-ref name: "nbsp") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + (let ((editor-name (author-string))) + (make sequence + (if (first-sibling?) + (make element gi: "H4" + attributes: (list (list "CLASS" "EDITEDBY")) + (literal (gentext-edited-by))) + (empty-sosofo)) + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (literal editor-name))))) + + (element graphic + (let* ((nd (current-node)) + (fileref (attribute-string (normalize "fileref") nd)) + (entattr (attribute-string (normalize "entityref") nd)) + (entityref (if entattr + (entity-system-id entattr) + #f)) + (format (attribute-string (normalize "format"))) + (align (attribute-string (normalize "align"))) + (attr (append + (if align + (list (list "ALIGN" align)) + '()) + (if entityref + (list (list "SRC" (graphic-file entityref))) + (list (list "SRC" (graphic-file fileref)))) + (list (list "ALT" "")) + ))) + (if (or fileref entityref) + (make empty-element gi: "IMG" + attributes: attr) + (empty-sosofo)))) + + (element legalnotice + (titlepage-recto-legalnotice)) + + (element (legalnotice title) (empty-sosofo)) + + (element pubdate + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element publisher + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element publishername + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element pubsnumber + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element releaseinfo + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element revhistory + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "TABLE" + attributes: (list + (list "WIDTH" ($table-width$)) + (list "BORDER" "0")) + (make sequence + (make element gi: "TR" + (make element gi: "TH" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("COLSPAN" "3")) + (make element gi: "B" + (literal (gentext-element-name + (gi (current-node))))))) + (process-children))))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark")))) + (make sequence + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revnumber)) + (make sequence + (literal (gentext-element-name-space + (gi (current-node)))) + (process-node-list revnumber)) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revdate)) + (process-node-list revdate) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revauthor)) + (make sequence + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT") + (list "COLSPAN" "3")) + (if (not (node-list-empty? revremark)) + (process-node-list revremark) + (empty-sosofo))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + + (element subtitle + (make element gi: "H2" + attributes: (list (list "CLASS" (gi))) + (process-children-trim))) + + (element title + (make element gi: "H1" + attributes: (list (list "CLASS" (gi))) + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (with-mode title-mode + (process-children-trim))))) + + (element (formalpara title) ($runinhead$)) +) + +(mode set-titlepage-verso-mode + (element abstract ($semiformal-object$)) + (element (abstract title) (empty-sosofo)) + + (element address + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element author + ;; Print the author name. Handle the case where there's no AUTHORGROUP + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (not in-group) + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-by)) + (make entity-ref name: "nbsp") + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (literal (author-list-string)))) + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (literal (author-list-string)))))) + + (element authorgroup + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-by)) + (make entity-ref name: "nbsp") + (process-children-trim))) + + (element copyright + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-element-name (current-node))) + (make entity-ref name: "nbsp") + (dingbat-sosofo "copyright") + (make entity-ref name: "nbsp") + (process-children))) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (literal " ")))) + + (element (copyright holder) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element corpauthor + (make sequence + (if (first-sibling?) + (if (equal? (gi (parent (current-node))) (normalize "authorgroup")) + (empty-sosofo) + (literal (gentext-by) " ")) + (literal ", ")) + (process-children))) + + (element edition + (make element gi: "P" + (process-children) + (make entity-ref name: "nbsp") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + ;; Print the editor name. + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (or #t (not in-group)) ; nevermind, always put out the Edited by + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (make sequence + (literal (gentext-edited-by)) + (make entity-ref name: "nbsp") + (literal (author-string)))) + (literal (author-string))))) + + (element legalnotice + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + ($semiformal-object$))) + + (element (legalnotice title) (empty-sosofo)) + + (element pubdate + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-element-name-space (gi (current-node)))) + (process-children))) + + (element revhistory + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "TABLE" + attributes: (list + (list "WIDTH" ($table-width$)) + (list "BORDER" "0")) + (make sequence + (make element gi: "TR" + (make element gi: "TH" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("COLSPAN" "3")) + (make element gi: "B" + (literal (gentext-element-name + (gi (current-node))))))) + (process-children))))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark")))) + (make sequence + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revnumber)) + (make sequence + (literal (gentext-element-name-space + (gi (current-node)))) + (process-node-list revnumber)) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revdate)) + (process-node-list revdate) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revauthor)) + (make sequence + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT") + (list "COLSPAN" "3")) + (if (not (node-list-empty? revremark)) + (process-node-list revremark) + (empty-sosofo))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + + (element subtitle + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element title + (make element gi: "H2" + attributes: (list (list "CLASS" (gi))) + (with-mode title-mode + (process-children)))) + + (element (formalpara title) ($runinhead$)) +) + +;; == Title pages for BOOKs ============================================= + +(define (book-titlepage-recto-elements) + (list (normalize "title") + (normalize "subtitle") + (normalize "graphic") + (normalize "mediaobject") + (normalize "corpauthor") + (normalize "authorgroup") + (normalize "author") + (normalize "editor") + (normalize "copyright") + (normalize "abstract") + (normalize "legalnotice"))) + +(define (book-titlepage-verso-elements) '()) + +(define (book-titlepage-content? elements side) + (titlepage-content? elements (if (equal? side 'recto) + (book-titlepage-recto-elements) + (book-titlepage-verso-elements)))) + +(define (book-titlepage elements #!optional (side 'recto)) + (let ((nodelist (titlepage-nodelist + (if (equal? side 'recto) + (book-titlepage-recto-elements) + (book-titlepage-verso-elements)) + elements))) + (if (book-titlepage-content? elements side) + (make element gi: "DIV" + attributes: '(("CLASS" "TITLEPAGE")) + (let loop ((nl nodelist) (lastnode (empty-node-list))) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (if (or (node-list-empty? lastnode) + (not (equal? (gi (node-list-first nl)) + (gi lastnode)))) + (book-titlepage-before (node-list-first nl) side) + (empty-sosofo)) + (cond + ((equal? (gi (node-list-first nl)) (normalize "abbrev")) + (book-titlepage-abbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "abstract")) + (book-titlepage-abstract (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "address")) + (book-titlepage-address (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "affiliation")) + (book-titlepage-affiliation (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "artpagenums")) + (book-titlepage-artpagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "author")) + (book-titlepage-author (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorblurb")) + (book-titlepage-authorblurb (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorgroup")) + (book-titlepage-authorgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorinitials")) + (book-titlepage-authorinitials (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bibliomisc")) + (book-titlepage-bibliomisc (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "biblioset")) + (book-titlepage-biblioset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bookbiblio")) + (book-titlepage-bookbiblio (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "citetitle")) + (book-titlepage-citetitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "collab")) + (book-titlepage-collab (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "confgroup")) + (book-titlepage-confgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractnum")) + (book-titlepage-contractnum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractsponsor")) + (book-titlepage-contractsponsor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contrib")) + (book-titlepage-contrib (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "copyright")) + (book-titlepage-recto-copyright (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpauthor")) + (book-titlepage-corpauthor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpname")) + (book-titlepage-corpname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "date")) + (book-titlepage-date (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "edition")) + (book-titlepage-edition (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "editor")) + (book-titlepage-editor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "firstname")) + (book-titlepage-firstname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "graphic")) + (book-titlepage-graphic (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "honorific")) + (book-titlepage-honorific (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "indexterm")) + (book-titlepage-indexterm (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "invpartnumber")) + (book-titlepage-invpartnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "isbn")) + (book-titlepage-isbn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issn")) + (book-titlepage-issn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issuenum")) + (book-titlepage-issuenum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "itermset")) + (book-titlepage-itermset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "keywordset")) + (book-titlepage-keywordset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "legalnotice")) + (book-titlepage-recto-legalnotice (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "lineage")) + (book-titlepage-lineage (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "mediaobject")) + (book-titlepage-mediaobject (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "modespec")) + (book-titlepage-modespec (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "orgname")) + (book-titlepage-orgname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othercredit")) + (book-titlepage-othercredit (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othername")) + (book-titlepage-othername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pagenums")) + (book-titlepage-pagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "printhistory")) + (book-titlepage-printhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productname")) + (book-titlepage-productname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productnumber")) + (book-titlepage-productnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubdate")) + (book-titlepage-pubdate (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publisher")) + (book-titlepage-publisher (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publishername")) + (book-titlepage-publishername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubsnumber")) + (book-titlepage-pubsnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "releaseinfo")) + (book-titlepage-releaseinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "revhistory")) + (book-titlepage-revhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesinfo")) + (book-titlepage-seriesinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesvolnums")) + (book-titlepage-seriesvolnums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subjectset")) + (book-titlepage-subjectset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subtitle")) + (book-titlepage-subtitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "surname")) + (book-titlepage-surname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "title")) + (book-titlepage-title (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "titleabbrev")) + (book-titlepage-titleabbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "volumenum")) + (book-titlepage-volumenum (node-list-first nl) side)) + (else + (book-titlepage-default (node-list-first nl) side))) + (loop (node-list-rest nl) (node-list-first nl))))) + (book-titlepage-separator side)) + (empty-sosofo)))) + +(define (book-titlepage-separator side) + (if (equal? side 'recto) + (make empty-element gi: "HR") + (empty-sosofo))) + +(define (book-titlepage-before node side) + (empty-sosofo)) + +(define (book-titlepage-default node side) + (let ((foo (debug (string-append "No book-titlepage-* for " (gi node) "!")))) + (empty-sosofo))) + +(define (book-titlepage-element node side) + (if (equal? side 'recto) + (with-mode book-titlepage-recto-mode + (process-node-list node)) + (with-mode book-titlepage-verso-mode + (process-node-list node)))) + +(define (book-titlepage-abbrev node side) + (book-titlepage-element node side)) +(define (book-titlepage-abstract node side) + (book-titlepage-element node side)) +(define (book-titlepage-address node side) + (book-titlepage-element node side)) +(define (book-titlepage-affiliation node side) + (book-titlepage-element node side)) +(define (book-titlepage-artpagenums node side) + (book-titlepage-element node side)) +(define (book-titlepage-author node side) + (book-titlepage-element node side)) +(define (book-titlepage-authorblurb node side) + (book-titlepage-element node side)) +(define (book-titlepage-authorgroup node side) + (book-titlepage-element node side)) +(define (book-titlepage-authorinitials node side) + (book-titlepage-element node side)) +(define (book-titlepage-bibliomisc node side) + (book-titlepage-element node side)) +(define (book-titlepage-biblioset node side) + (book-titlepage node side)) +(define (book-titlepage-bookbiblio node side) + (book-titlepage node side)) +(define (book-titlepage-citetitle node side) + (book-titlepage-element node side)) +(define (book-titlepage-collab node side) + (book-titlepage-element node side)) +(define (book-titlepage-confgroup node side) + (book-titlepage-element node side)) +(define (book-titlepage-contractnum node side) + (book-titlepage-element node side)) +(define (book-titlepage-contractsponsor node side) + (book-titlepage-element node side)) +(define (book-titlepage-contrib node side) + (book-titlepage-element node side)) +(define (book-titlepage-recto-copyright node side) + (book-titlepage-element node side)) + +(define (book-titlepage-corpauthor node side) + (if (equal? side 'recto) + (book-titlepage-element node side) + (if (first-sibling? node) + (make element gi: "P" + attributes: (list (list "CLASS" (gi node))) + (with-mode book-titlepage-verso-mode + (process-node-list + (select-elements (children (parent node)) + (normalize "corpauthor"))))) + (empty-sosofo)))) + +(define (book-titlepage-corpname node side) + (book-titlepage-element node side)) +(define (book-titlepage-date node side) + (book-titlepage-element node side)) +(define (book-titlepage-edition node side) + (book-titlepage-element node side)) +(define (book-titlepage-editor node side) + (book-titlepage-element node side)) +(define (book-titlepage-firstname node side) + (book-titlepage-element node side)) +(define (book-titlepage-graphic node side) + (book-titlepage-element node side)) +(define (book-titlepage-honorific node side) + (book-titlepage-element node side)) +(define (book-titlepage-indexterm node side) + (book-titlepage-element node side)) +(define (book-titlepage-invpartnumber node side) + (book-titlepage-element node side)) +(define (book-titlepage-isbn node side) + (book-titlepage-element node side)) +(define (book-titlepage-issn node side) + (book-titlepage-element node side)) +(define (book-titlepage-issuenum node side) + (book-titlepage-element node side)) +(define (book-titlepage-itermset node side) + (book-titlepage-element node side)) +(define (book-titlepage-keywordset node side) + (book-titlepage-element node side)) +(define (book-titlepage-recto-legalnotice node side) + (book-titlepage-element node side)) +(define (book-titlepage-lineage node side) + (book-titlepage-element node side)) +(define (book-titlepage-mediaobject node side) + (book-titlepage-element node side)) +(define (book-titlepage-modespec node side) + (book-titlepage-element node side)) +(define (book-titlepage-orgname node side) + (book-titlepage-element node side)) +(define (book-titlepage-othercredit node side) + (book-titlepage-element node side)) +(define (book-titlepage-othername node side) + (book-titlepage-element node side)) +(define (book-titlepage-pagenums node side) + (book-titlepage-element node side)) +(define (book-titlepage-printhistory node side) + (book-titlepage-element node side)) +(define (book-titlepage-productname node side) + (book-titlepage-element node side)) +(define (book-titlepage-productnumber node side) + (book-titlepage-element node side)) +(define (book-titlepage-pubdate node side) + (book-titlepage-element node side)) +(define (book-titlepage-publisher node side) + (book-titlepage-element node side)) +(define (book-titlepage-publishername node side) + (book-titlepage-element node side)) +(define (book-titlepage-pubsnumber node side) + (book-titlepage-element node side)) +(define (book-titlepage-releaseinfo node side) + (book-titlepage-element node side)) +(define (book-titlepage-revhistory node side) + (book-titlepage-element node side)) +(define (book-titlepage-seriesinfo node side) + (book-titlepage-element node side)) +(define (book-titlepage-seriesvolnums node side) + (book-titlepage-element node side)) +(define (book-titlepage-subjectset node side) + (book-titlepage-element node side)) +(define (book-titlepage-subtitle node side) + (book-titlepage-element node side)) +(define (book-titlepage-surname node side) + (book-titlepage-element node side)) +(define (book-titlepage-title node side) + (book-titlepage-element node side)) +(define (book-titlepage-titleabbrev node side) + (book-titlepage-element node side)) +(define (book-titlepage-volumenum node side) + (book-titlepage-element node side)) + +(mode titlepage-address-mode + (default (process-children)) + + (element email + ($code-seq$ + (make sequence + (literal "<") + (make element gi: "A" + attributes: (list (list "HREF" + (string-append "mailto:" + (data (current-node))))) + (process-children)) + (literal ">"))))) + +(mode book-titlepage-recto-mode + (element abbrev + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element abstract + (make element gi: "DIV" + ($semiformal-object$))) + + (element (abstract title) (empty-sosofo)) + + (element address + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element affiliation + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element artpagenums + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element author + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (literal author-name))) + (process-node-list author-affil)))) + + (element authorblurb + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element authorgroup + (process-children)) + + (element authorinitials + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element bibliomisc (process-children)) + (element bibliomset (process-children)) + + (element collab + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element confgroup + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element contractnum + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element contractsponsor + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element contrib + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element copyright + (titlepage-recto-copyright)) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element (copyright holder) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element corpauthor + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element corpname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element date + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element edition + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make entity-ref name: "nbsp") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + (let ((editor-name (author-string))) + (make sequence + (if (first-sibling?) + (make element gi: "H4" + attributes: (list (list "CLASS" "EDITEDBY")) + (literal (gentext-edited-by))) + (empty-sosofo)) + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (literal editor-name))))) + + (element firstname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element graphic + (let* ((nd (current-node)) + (fileref (attribute-string (normalize "fileref") nd)) + (entattr (attribute-string (normalize "entityref") nd)) + (entityref (if entattr + (entity-system-id entattr) + #f)) + (format (attribute-string (normalize "format"))) + (align (attribute-string (normalize "align"))) + (attr (append + (if align + (list (list "ALIGN" align)) + '()) + (if entityref + (list (list "SRC" (graphic-file entityref))) + (list (list "SRC" (graphic-file fileref)))) + (list (list "ALT" "")) + ))) + (if (or fileref entityref) + (make empty-element gi: "IMG" + attributes: attr) + (empty-sosofo)))) + + (element honorific + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element isbn + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element issn + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element itermset (empty-sosofo)) + + (element invpartnumber + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element issuenum + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element jobtitle + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element keywordset (empty-sosofo)) + + (element legalnotice + (titlepage-recto-legalnotice)) + + (element (legalnotice title) (empty-sosofo)) + + (element lineage + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element modespec (empty-sosofo)) + + (element orgdiv + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element orgname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element othercredit + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (literal author-name))) + (process-node-list author-affil)))) + + (element othername + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element pagenums + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element printhistory + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element productname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element productnumber + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element pubdate + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element publisher + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element publishername + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element pubsnumber + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element releaseinfo + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element revhistory + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "TABLE" + attributes: (list + (list "WIDTH" ($table-width$)) + (list "BORDER" "0")) + (make sequence + (make element gi: "TR" + (make element gi: "TH" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("COLSPAN" "3")) + (make element gi: "B" + (literal (gentext-element-name + (gi (current-node))))))) + (process-children))))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark")))) + (make sequence + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revnumber)) + (make sequence + (literal (gentext-element-name-space + (gi (current-node)))) + (process-node-list revnumber)) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revdate)) + (process-node-list revdate) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revauthor)) + (make sequence + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT") + (list "COLSPAN" "3")) + (if (not (node-list-empty? revremark)) + (process-node-list revremark) + (empty-sosofo))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + + (element seriesvolnums + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element shortaffil + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element subjectset (empty-sosofo)) + + (element subtitle + (make element gi: "H2" + attributes: (list (list "CLASS" (gi))) + (process-children-trim))) + + (element surname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element title + (make element gi: "H1" + attributes: (list (list "CLASS" (gi))) + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (with-mode title-mode + (process-children-trim))))) + + (element (formalpara title) ($runinhead$)) + + (element titleabbrev (empty-sosofo)) + + (element volumenum + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) +) + +(mode book-titlepage-verso-mode + (element abbrev + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element abstract + (make element gi: "DIV" + ($semiformal-object$))) + + (element (abstract title) (empty-sosofo)) + + (element address + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element affiliation + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element artpagenums + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element author + ;; Print the author name. Handle the case where there's no AUTHORGROUP + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (not in-group) + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-by)) + (make entity-ref name: "nbsp") + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (literal (author-list-string)))) + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (literal (author-list-string)))))) + + (element authorblurb + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element authorgroup + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-by)) + (make entity-ref name: "nbsp") + (process-children-trim))) + + (element authorinitials + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element bibliomisc (process-children)) + (element bibliomset (process-children)) + + (element collab + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element confgroup + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element contractnum + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element contractsponsor + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element contrib + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element copyright + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-element-name (current-node))) + (make entity-ref name: "nbsp") + (dingbat-sosofo "copyright") + (make entity-ref name: "nbsp") + (process-children))) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (literal " ")))) + + (element (copyright holder) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element corpauthor + (make sequence + (if (first-sibling?) + (if (equal? (gi (parent (current-node))) (normalize "authorgroup")) + (empty-sosofo) + (literal (gentext-by) " ")) + (literal ", ")) + (process-children))) + + (element corpname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element date + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element edition + (make element gi: "P" + (process-children) + (make entity-ref name: "nbsp") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + ;; Print the editor name. + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (or #t (not in-group)) ; nevermind, always put out the Edited by + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (make sequence + (literal (gentext-edited-by)) + (make entity-ref name: "nbsp") + (literal (author-string)))) + (literal (author-string))))) + + (element firstname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element graphic + (let* ((nd (current-node)) + (fileref (attribute-string (normalize "fileref") nd)) + (entattr (attribute-string (normalize "entityref") nd)) + (entityref (if entattr + (entity-system-id entattr) + #f)) + (format (attribute-string (normalize "format"))) + (align (attribute-string (normalize "align"))) + (attr (append + (if align + (list (list "ALIGN" align)) + '()) + (if entityref + (list (list "SRC" (graphic-file entityref))) + (list (list "SRC" (graphic-file fileref)))) + (list (list "ALT" "")) + ))) + (if (or fileref entityref) + (make empty-element gi: "IMG" + attributes: attr) + (empty-sosofo)))) + + (element honorific + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element isbn + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element issn + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element itermset (empty-sosofo)) + + (element invpartnumber + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element issuenum + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element jobtitle + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element keywordset (empty-sosofo)) + + (element legalnotice + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + ($semiformal-object$))) + + (element (legalnotice title) (empty-sosofo)) + + (element lineage + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element modespec (empty-sosofo)) + + (element orgdiv + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element orgname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element othercredit + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (literal author-name))) + (process-node-list author-affil)))) + + (element othername + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element pagenums + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element printhistory + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element productname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element productnumber + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element pubdate + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-element-name-space (gi (current-node)))) + (process-children))) + + (element publisher + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element publishername + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element pubsnumber + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element releaseinfo + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element revhistory + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "TABLE" + attributes: (list + (list "WIDTH" ($table-width$)) + (list "BORDER" "0")) + (make sequence + (make element gi: "TR" + (make element gi: "TH" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("COLSPAN" "3")) + (make element gi: "B" + (literal (gentext-element-name + (gi (current-node))))))) + (process-children))))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark")))) + (make sequence + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revnumber)) + (make sequence + (literal (gentext-element-name-space + (gi (current-node)))) + (process-node-list revnumber)) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revdate)) + (process-node-list revdate) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revauthor)) + (make sequence + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT") + (list "COLSPAN" "3")) + (if (not (node-list-empty? revremark)) + (process-node-list revremark) + (empty-sosofo))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + + (element seriesvolnums + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element shortaffil + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element subjectset (empty-sosofo)) + + (element subtitle + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element surname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element title + (make element gi: "H2" + attributes: (list (list "CLASS" (gi))) + (with-mode title-mode + (process-children)))) + + (element (formalpara title) ($runinhead$)) + + (element titleabbrev (empty-sosofo)) + + (element volumenum + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) +) + +(mode legal-notice-link-mode + (element legalnotice + ($semiformal-object$))) + +;; == Title pages for PARTs ============================================= + +(define (part-titlepage-recto-elements) + (list (normalize "title") + (normalize "subtitle"))) + +(define (part-titlepage-verso-elements) + '()) + +(define (part-titlepage-content? elements side) + (titlepage-content? elements (if (equal? side 'recto) + (part-titlepage-recto-elements) + (part-titlepage-verso-elements)))) + +(define (part-titlepage elements #!optional (side 'recto)) + (let ((nodelist (titlepage-nodelist + (if (equal? side 'recto) + (part-titlepage-recto-elements) + (part-titlepage-verso-elements)) + elements)) + ;; partintro is a special case... + (partintro (node-list-first + (node-list-filter-by-gi elements + (list (normalize "partintro")))))) + (if (part-titlepage-content? elements side) + (make element gi: "DIV" + attributes: '(("CLASS" "TITLEPAGE")) + (let loop ((nl nodelist) (lastnode (empty-node-list))) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (if (or (node-list-empty? lastnode) + (not (equal? (gi (node-list-first nl)) + (gi lastnode)))) + (part-titlepage-before (node-list-first nl) side) + (empty-sosofo)) + (cond + ((equal? (gi (node-list-first nl)) (normalize "abbrev")) + (part-titlepage-abbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "abstract")) + (part-titlepage-abstract (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "address")) + (part-titlepage-address (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "affiliation")) + (part-titlepage-affiliation (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "artpagenums")) + (part-titlepage-artpagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "author")) + (part-titlepage-author (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorblurb")) + (part-titlepage-authorblurb (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorgroup")) + (part-titlepage-authorgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorinitials")) + (part-titlepage-authorinitials (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bibliomisc")) + (part-titlepage-bibliomisc (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "biblioset")) + (part-titlepage-biblioset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bookbiblio")) + (part-titlepage-bookbiblio (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "citetitle")) + (part-titlepage-citetitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "collab")) + (part-titlepage-collab (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "confgroup")) + (part-titlepage-confgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractnum")) + (part-titlepage-contractnum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractsponsor")) + (part-titlepage-contractsponsor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contrib")) + (part-titlepage-contrib (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "copyright")) + (part-titlepage-recto-copyright (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpauthor")) + (part-titlepage-corpauthor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpname")) + (part-titlepage-corpname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "date")) + (part-titlepage-date (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "edition")) + (part-titlepage-edition (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "editor")) + (part-titlepage-editor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "firstname")) + (part-titlepage-firstname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "graphic")) + (part-titlepage-graphic (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "honorific")) + (part-titlepage-honorific (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "indexterm")) + (part-titlepage-indexterm (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "invpartnumber")) + (part-titlepage-invpartnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "isbn")) + (part-titlepage-isbn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issn")) + (part-titlepage-issn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issuenum")) + (part-titlepage-issuenum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "itermset")) + (part-titlepage-itermset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "keywordset")) + (part-titlepage-keywordset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "legalnotice")) + (part-titlepage-recto-legalnotice (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "lineage")) + (part-titlepage-lineage (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "mediaobject")) + (part-titlepage-mediaobject (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "modespec")) + (part-titlepage-modespec (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "orgname")) + (part-titlepage-orgname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othercredit")) + (part-titlepage-othercredit (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othername")) + (part-titlepage-othername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pagenums")) + (part-titlepage-pagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "printhistory")) + (part-titlepage-printhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productname")) + (part-titlepage-productname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productnumber")) + (part-titlepage-productnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubdate")) + (part-titlepage-pubdate (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publisher")) + (part-titlepage-publisher (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publishername")) + (part-titlepage-publishername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubsnumber")) + (part-titlepage-pubsnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "releaseinfo")) + (part-titlepage-releaseinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "revhistory")) + (part-titlepage-revhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesinfo")) + (part-titlepage-seriesinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesvolnums")) + (part-titlepage-seriesvolnums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subjectset")) + (part-titlepage-subjectset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subtitle")) + (part-titlepage-subtitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "surname")) + (part-titlepage-surname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "title")) + (part-titlepage-title (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "titleabbrev")) + (part-titlepage-titleabbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "volumenum")) + (part-titlepage-volumenum (node-list-first nl) side)) + (else + (part-titlepage-default (node-list-first nl) side))) + (loop (node-list-rest nl) (node-list-first nl))))) + + ;; PartIntro is a special case + (if (and (equal? side 'recto) + (not (node-list-empty? partintro)) + %generate-partintro-on-titlepage%) + ($process-partintro$ partintro) + (empty-sosofo)) + + (if (and %generate-part-toc% + %generate-part-toc-on-titlepage% + (equal? side 'recto)) + (make display-group + (build-toc (current-node) (toc-depth (current-node)))) + (empty-sosofo)) + + (part-titlepage-separator side)) + (empty-sosofo)))) + +(define (part-titlepage-separator side) + (empty-sosofo)) + +(define (part-titlepage-before node side) + (empty-sosofo)) + +(define (part-titlepage-default node side) + (let ((foo (debug (string-append "No part-titlepage-* for " (gi node) "!")))) + (empty-sosofo))) + +(define (part-titlepage-element node side) + (if (equal? side 'recto) + (with-mode part-titlepage-recto-mode + (process-node-list node)) + (with-mode part-titlepage-verso-mode + (process-node-list node)))) + +(define (part-titlepage-abbrev node side) + (part-titlepage-element node side)) +(define (part-titlepage-abstract node side) + (part-titlepage-element node side)) +(define (part-titlepage-address node side) + (part-titlepage-element node side)) +(define (part-titlepage-affiliation node side) + (part-titlepage-element node side)) +(define (part-titlepage-artpagenums node side) + (part-titlepage-element node side)) +(define (part-titlepage-author node side) + (part-titlepage-element node side)) +(define (part-titlepage-authorblurb node side) + (part-titlepage-element node side)) +(define (part-titlepage-authorgroup node side) + (part-titlepage-element node side)) +(define (part-titlepage-authorinitials node side) + (part-titlepage-element node side)) +(define (part-titlepage-bibliomisc node side) + (part-titlepage-element node side)) +(define (part-titlepage-biblioset node side) + (part-titlepage node side)) +(define (part-titlepage-bookbiblio node side) + (part-titlepage node side)) +(define (part-titlepage-citetitle node side) + (part-titlepage-element node side)) +(define (part-titlepage-collab node side) + (part-titlepage-element node side)) +(define (part-titlepage-confgroup node side) + (part-titlepage-element node side)) +(define (part-titlepage-contractnum node side) + (part-titlepage-element node side)) +(define (part-titlepage-contractsponsor node side) + (part-titlepage-element node side)) +(define (part-titlepage-contrib node side) + (part-titlepage-element node side)) +(define (part-titlepage-recto-copyright node side) + (part-titlepage-element node side)) +(define (part-titlepage-corpauthor node side) + (part-titlepage-element node side)) +(define (part-titlepage-corpname node side) + (part-titlepage-element node side)) +(define (part-titlepage-date node side) + (part-titlepage-element node side)) +(define (part-titlepage-edition node side) + (part-titlepage-element node side)) +(define (part-titlepage-editor node side) + (part-titlepage-element node side)) +(define (part-titlepage-firstname node side) + (part-titlepage-element node side)) +(define (part-titlepage-graphic node side) + (part-titlepage-element node side)) +(define (part-titlepage-honorific node side) + (part-titlepage-element node side)) +(define (part-titlepage-indexterm node side) + (part-titlepage-element node side)) +(define (part-titlepage-invpartnumber node side) + (part-titlepage-element node side)) +(define (part-titlepage-isbn node side) + (part-titlepage-element node side)) +(define (part-titlepage-issn node side) + (part-titlepage-element node side)) +(define (part-titlepage-issuenum node side) + (part-titlepage-element node side)) +(define (part-titlepage-itermset node side) + (part-titlepage-element node side)) +(define (part-titlepage-keywordset node side) + (part-titlepage-element node side)) +(define (part-titlepage-recto-legalnotice node side) + (part-titlepage-element node side)) +(define (part-titlepage-lineage node side) + (part-titlepage-element node side)) +(define (part-titlepage-mediaobject node side) + (part-titlepage-element node side)) +(define (part-titlepage-modespec node side) + (part-titlepage-element node side)) +(define (part-titlepage-orgname node side) + (part-titlepage-element node side)) +(define (part-titlepage-othercredit node side) + (part-titlepage-element node side)) +(define (part-titlepage-othername node side) + (part-titlepage-element node side)) +(define (part-titlepage-pagenums node side) + (part-titlepage-element node side)) +(define (part-titlepage-partintro node side) + (part-titlepage-element node side)) +(define (part-titlepage-printhistory node side) + (part-titlepage-element node side)) +(define (part-titlepage-productname node side) + (part-titlepage-element node side)) +(define (part-titlepage-productnumber node side) + (part-titlepage-element node side)) +(define (part-titlepage-pubdate node side) + (part-titlepage-element node side)) +(define (part-titlepage-publisher node side) + (part-titlepage-element node side)) +(define (part-titlepage-publishername node side) + (part-titlepage-element node side)) +(define (part-titlepage-pubsnumber node side) + (part-titlepage-element node side)) +(define (part-titlepage-releaseinfo node side) + (part-titlepage-element node side)) +(define (part-titlepage-revhistory node side) + (part-titlepage-element node side)) +(define (part-titlepage-seriesinfo node side) + (part-titlepage-element node side)) +(define (part-titlepage-seriesvolnums node side) + (part-titlepage-element node side)) +(define (part-titlepage-subjectset node side) + (part-titlepage-element node side)) +(define (part-titlepage-subtitle node side) + (part-titlepage-element node side)) +(define (part-titlepage-surname node side) + (part-titlepage-element node side)) +(define (part-titlepage-title node side) + (part-titlepage-element node side)) +(define (part-titlepage-titleabbrev node side) + (part-titlepage-element node side)) +(define (part-titlepage-volumenum node side) + (part-titlepage-element node side)) + + +(mode part-titlepage-recto-mode + (element para + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element abstract + (make element gi: "DIV" + ($semiformal-object$))) + + (element (abstract title) (empty-sosofo)) + + (element address + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element author + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (literal author-name))) + (process-node-list author-affil)))) + + (element authorblurb + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element authorgroup + (process-children)) + + (element copyright + (titlepage-recto-copyright)) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element (copyright holder) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element corpauthor + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element edition + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make entity-ref name: "nbsp") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + (let ((editor-name (author-string))) + (make sequence + (if (first-sibling?) + (make element gi: "H4" + attributes: (list (list "CLASS" "EDITEDBY")) + (literal (gentext-edited-by))) + (empty-sosofo)) + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (literal editor-name))))) + + (element graphic + (let* ((nd (current-node)) + (fileref (attribute-string (normalize "fileref") nd)) + (entattr (attribute-string (normalize "entityref") nd)) + (entityref (if entattr + (entity-system-id entattr) + #f)) + (format (attribute-string (normalize "format"))) + (align (attribute-string (normalize "align"))) + (attr (append + (if align + (list (list "ALIGN" align)) + '()) + (if entityref + (list (list "SRC" (graphic-file entityref))) + (list (list "SRC" (graphic-file fileref)))) + (list (list "ALT" "")) + ))) + (if (or fileref entityref) + (make empty-element gi: "IMG" + attributes: attr) + (empty-sosofo)))) + + (element legalnotice + (titlepage-recto-legalnotice)) + + (element (legalnotice title) (empty-sosofo)) + + (element revhistory + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "TABLE" + attributes: (list + (list "WIDTH" ($table-width$)) + (list "BORDER" "0")) + (make sequence + (make element gi: "TR" + (make element gi: "TH" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("COLSPAN" "3")) + (make element gi: "B" + (literal (gentext-element-name + (gi (current-node))))))) + (process-children))))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark")))) + (make sequence + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revnumber)) + (make sequence + (literal (gentext-element-name-space + (gi (current-node)))) + (process-node-list revnumber)) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revdate)) + (process-node-list revdate) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revauthor)) + (make sequence + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT") + (list "COLSPAN" "3")) + (if (not (node-list-empty? revremark)) + (process-node-list revremark) + (empty-sosofo))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + + (element subtitle + (make element gi: "H2" + attributes: (list (list "CLASS" (gi))) + (process-children-trim))) + + (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-label-title-sep (gi division)))) + (with-mode title-mode + (process-children))))) + + (element (formalpara title) ($runinhead$)) +) + +(mode part-titlepage-verso-mode + (element abstract ($semiformal-object$)) + (element (abstract title) (empty-sosofo)) + + (element address + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element author + ;; Print the author name. Handle the case where there's no AUTHORGROUP + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (not in-group) + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-by)) + (make entity-ref name: "nbsp") + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (literal (author-list-string)))) + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (literal (author-list-string)))))) + + (element authorgroup + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-by)) + (make entity-ref name: "nbsp") + (process-children-trim))) + + (element copyright + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-element-name (current-node))) + (make entity-ref name: "nbsp") + (dingbat-sosofo "copyright") + (make entity-ref name: "nbsp") + (process-children))) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (literal " ")))) + + (element (copyright holder) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element corpauthor + (make sequence + (if (first-sibling?) + (if (equal? (gi (parent (current-node))) (normalize "authorgroup")) + (empty-sosofo) + (literal (gentext-by) " ")) + (literal ", ")) + (process-children))) + + (element edition + (make element gi: "P" + (process-children) + (make entity-ref name: "nbsp") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + ;; Print the editor name. + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (or #t (not in-group)) ; nevermind, always put out the Edited by + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (make sequence + (literal (gentext-edited-by)) + (make entity-ref name: "nbsp") + (literal (author-string)))) + (literal (author-string))))) + + (element legalnotice + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + ($semiformal-object$))) + + (element (legalnotice title) (empty-sosofo)) + + (element pubdate + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-element-name-space (gi (current-node)))) + (process-children))) + + (element revhistory + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "TABLE" + attributes: (list + (list "WIDTH" ($table-width$)) + (list "BORDER" "0")) + (make sequence + (make element gi: "TR" + (make element gi: "TH" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("COLSPAN" "3")) + (make element gi: "B" + (literal (gentext-element-name + (gi (current-node))))))) + (process-children))))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark")))) + (make sequence + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revnumber)) + (make sequence + (literal (gentext-element-name-space + (gi (current-node)))) + (process-node-list revnumber)) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revdate)) + (process-node-list revdate) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revauthor)) + (make sequence + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT") + (list "COLSPAN" "3")) + (if (not (node-list-empty? revremark)) + (process-node-list revremark) + (empty-sosofo))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + + (element subtitle + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element title + (make element gi: "H2" + attributes: (list (list "CLASS" (gi))) + (with-mode title-mode + (process-children)))) + + (element (formalpara title) ($runinhead$)) +) + +;; == Title pages for ARTICLEs ========================================== +;; +;; Note: Article title pages are a little different in that they do not +;; create their own simple-page-sequence. +;; + +(define (article-titlepage-recto-elements) + (list (normalize "title") + (normalize "subtitle") + (normalize "corpauthor") + (normalize "authorgroup") + (normalize "author") + (normalize "releaseinfo") + (normalize "copyright") + (normalize "pubdate") + (normalize "revhistory") + (normalize "abstract"))) + +(define (article-titlepage-verso-elements) + '()) + +(define (article-titlepage-content? elements side) + (titlepage-content? elements (if (equal? side 'recto) + (article-titlepage-recto-elements) + (article-titlepage-verso-elements)))) + +(define (article-titlepage elements #!optional (side 'recto)) + (let ((nodelist (titlepage-nodelist + (if (equal? side 'recto) + (article-titlepage-recto-elements) + (article-titlepage-verso-elements)) + elements))) + (if (article-titlepage-content? elements side) + (make element gi: "DIV" + attributes: '(("CLASS" "TITLEPAGE")) + (let loop ((nl nodelist) (lastnode (empty-node-list))) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (if (or (node-list-empty? lastnode) + (not (equal? (gi (node-list-first nl)) + (gi lastnode)))) + (article-titlepage-before (node-list-first nl) side) + (empty-sosofo)) + (cond + ((equal? (gi (node-list-first nl)) (normalize "abbrev")) + (article-titlepage-abbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "abstract")) + (article-titlepage-abstract (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "address")) + (article-titlepage-address (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "affiliation")) + (article-titlepage-affiliation (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "artpagenums")) + (article-titlepage-artpagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "author")) + (article-titlepage-author (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorblurb")) + (article-titlepage-authorblurb (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorgroup")) + (article-titlepage-authorgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorinitials")) + (article-titlepage-authorinitials (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bibliomisc")) + (article-titlepage-bibliomisc (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "biblioset")) + (article-titlepage-biblioset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bookbiblio")) + (article-titlepage-bookbiblio (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "citetitle")) + (article-titlepage-citetitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "collab")) + (article-titlepage-collab (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "confgroup")) + (article-titlepage-confgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractnum")) + (article-titlepage-contractnum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractsponsor")) + (article-titlepage-contractsponsor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contrib")) + (article-titlepage-contrib (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "copyright")) + (article-titlepage-recto-copyright (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpauthor")) + (article-titlepage-corpauthor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpname")) + (article-titlepage-corpname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "date")) + (article-titlepage-date (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "edition")) + (article-titlepage-edition (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "editor")) + (article-titlepage-editor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "firstname")) + (article-titlepage-firstname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "graphic")) + (article-titlepage-graphic (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "honorific")) + (article-titlepage-honorific (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "indexterm")) + (article-titlepage-indexterm (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "invpartnumber")) + (article-titlepage-invpartnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "isbn")) + (article-titlepage-isbn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issn")) + (article-titlepage-issn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issuenum")) + (article-titlepage-issuenum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "itermset")) + (article-titlepage-itermset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "keywordset")) + (article-titlepage-keywordset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "legalnotice")) + (article-titlepage-recto-legalnotice (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "lineage")) + (article-titlepage-lineage (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "mediaobject")) + (article-titlepage-mediaobject (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "modespec")) + (article-titlepage-modespec (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "orgname")) + (article-titlepage-orgname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othercredit")) + (article-titlepage-othercredit (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othername")) + (article-titlepage-othername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pagenums")) + (article-titlepage-pagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "printhistory")) + (article-titlepage-printhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productname")) + (article-titlepage-productname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productnumber")) + (article-titlepage-productnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubdate")) + (article-titlepage-pubdate (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publisher")) + (article-titlepage-publisher (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publishername")) + (article-titlepage-publishername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubsnumber")) + (article-titlepage-pubsnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "releaseinfo")) + (article-titlepage-releaseinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "revhistory")) + (article-titlepage-revhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesinfo")) + (article-titlepage-seriesinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesvolnums")) + (article-titlepage-seriesvolnums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subjectset")) + (article-titlepage-subjectset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subtitle")) + (article-titlepage-subtitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "surname")) + (article-titlepage-surname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "title")) + (article-titlepage-title (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "titleabbrev")) + (article-titlepage-titleabbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "volumenum")) + (article-titlepage-volumenum (node-list-first nl) side)) + (else + (article-titlepage-default (node-list-first nl) side))) + (loop (node-list-rest nl) (node-list-first nl))))) + (article-titlepage-separator side)) + (empty-sosofo)))) + +(define (article-titlepage-separator side) + (make empty-element gi: "HR")) + +(define (article-titlepage-before node side) + (empty-sosofo)) + +(define (article-titlepage-default node side) + (let ((foo (debug (string-append "No article-titlepage-* for " (gi node) "!")))) + (empty-sosofo))) + +(define (article-titlepage-element node side) + (if (equal? side 'recto) + (with-mode article-titlepage-recto-mode + (process-node-list node)) + (with-mode article-titlepage-verso-mode + (process-node-list node)))) + +(define (article-titlepage-abbrev node side) + (article-titlepage-element node side)) +(define (article-titlepage-abstract node side) + (article-titlepage-element node side)) +(define (article-titlepage-address node side) + (article-titlepage-element node side)) +(define (article-titlepage-affiliation node side) + (article-titlepage-element node side)) +(define (article-titlepage-artpagenums node side) + (article-titlepage-element node side)) +(define (article-titlepage-author node side) + (article-titlepage-element node side)) +(define (article-titlepage-authorblurb node side) + (article-titlepage-element node side)) +(define (article-titlepage-authorgroup node side) + (article-titlepage-element node side)) +(define (article-titlepage-authorinitials node side) + (article-titlepage-element node side)) +(define (article-titlepage-bibliomisc node side) + (article-titlepage-element node side)) +(define (article-titlepage-biblioset node side) + (article-titlepage node side)) +(define (article-titlepage-bookbiblio node side) + (article-titlepage node side)) +(define (article-titlepage-citetitle node side) + (article-titlepage-element node side)) +(define (article-titlepage-collab node side) + (article-titlepage-element node side)) +(define (article-titlepage-confgroup node side) + (article-titlepage-element node side)) +(define (article-titlepage-contractnum node side) + (article-titlepage-element node side)) +(define (article-titlepage-contractsponsor node side) + (article-titlepage-element node side)) +(define (article-titlepage-contrib node side) + (article-titlepage-element node side)) +(define (article-titlepage-recto-copyright node side) + (article-titlepage-element node side)) +(define (article-titlepage-corpauthor node side) + (article-titlepage-element node side)) +(define (article-titlepage-corpname node side) + (article-titlepage-element node side)) +(define (article-titlepage-date node side) + (article-titlepage-element node side)) +(define (article-titlepage-edition node side) + (article-titlepage-element node side)) +(define (article-titlepage-editor node side) + (article-titlepage-element node side)) +(define (article-titlepage-firstname node side) + (article-titlepage-element node side)) +(define (article-titlepage-graphic node side) + (article-titlepage-element node side)) +(define (article-titlepage-honorific node side) + (article-titlepage-element node side)) +(define (article-titlepage-indexterm node side) + (article-titlepage-element node side)) +(define (article-titlepage-invpartnumber node side) + (article-titlepage-element node side)) +(define (article-titlepage-isbn node side) + (article-titlepage-element node side)) +(define (article-titlepage-issn node side) + (article-titlepage-element node side)) +(define (article-titlepage-issuenum node side) + (article-titlepage-element node side)) +(define (article-titlepage-itermset node side) + (article-titlepage-element node side)) +(define (article-titlepage-keywordset node side) + (article-titlepage-element node side)) +(define (article-titlepage-recto-legalnotice node side) + (article-titlepage-element node side)) +(define (article-titlepage-lineage node side) + (article-titlepage-element node side)) +(define (article-titlepage-mediaobject node side) + (article-titlepage-element node side)) +(define (article-titlepage-modespec node side) + (article-titlepage-element node side)) +(define (article-titlepage-orgname node side) + (article-titlepage-element node side)) +(define (article-titlepage-othercredit node side) + (article-titlepage-element node side)) +(define (article-titlepage-othername node side) + (article-titlepage-element node side)) +(define (article-titlepage-pagenums node side) + (article-titlepage-element node side)) +(define (article-titlepage-partintro node side) + (article-titlepage-element node side)) +(define (article-titlepage-printhistory node side) + (article-titlepage-element node side)) +(define (article-titlepage-productname node side) + (article-titlepage-element node side)) +(define (article-titlepage-productnumber node side) + (article-titlepage-element node side)) +(define (article-titlepage-pubdate node side) + (article-titlepage-element node side)) +(define (article-titlepage-publisher node side) + (article-titlepage-element node side)) +(define (article-titlepage-publishername node side) + (article-titlepage-element node side)) +(define (article-titlepage-pubsnumber node side) + (article-titlepage-element node side)) +(define (article-titlepage-releaseinfo node side) + (article-titlepage-element node side)) +(define (article-titlepage-revhistory node side) + (article-titlepage-element node side)) +(define (article-titlepage-seriesinfo node side) + (article-titlepage-element node side)) +(define (article-titlepage-seriesvolnums node side) + (article-titlepage-element node side)) +(define (article-titlepage-subjectset node side) + (article-titlepage-element node side)) +(define (article-titlepage-subtitle node side) + (article-titlepage-element node side)) +(define (article-titlepage-surname node side) + (article-titlepage-element node side)) +(define (article-titlepage-title node side) + (article-titlepage-element node side)) +(define (article-titlepage-titleabbrev node side) + (article-titlepage-element node side)) +(define (article-titlepage-volumenum node side) + (article-titlepage-element node side)) + +(mode article-titlepage-recto-mode + (element abbrev + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element abstract + (make element gi: "DIV" + ($semiformal-object$))) + + (element (abstract title) (empty-sosofo)) + + (element address + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element affiliation + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element artpagenums + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element author + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (literal author-name))) + (process-node-list author-affil)))) + + (element authorblurb + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element authorgroup + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (process-children))) + + (element authorinitials + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element bibliomisc (process-children)) + (element bibliomset (process-children)) + + (element collab + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element confgroup + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element contractnum + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element contractsponsor + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element contrib + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element copyright + (titlepage-recto-copyright)) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element (copyright holder) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element corpauthor + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element corpname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element date + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element edition + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make entity-ref name: "nbsp") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + (let ((editor-name (author-string))) + (make sequence + (if (first-sibling?) + (make element gi: "H4" + attributes: (list (list "CLASS" "EDITEDBY")) + (literal (gentext-edited-by))) + (empty-sosofo)) + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (literal editor-name))))) + + (element firstname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element graphic + (let* ((nd (current-node)) + (fileref (attribute-string (normalize "fileref") nd)) + (entattr (attribute-string (normalize "entityref") nd)) + (entityref (if entattr + (entity-system-id entattr) + #f)) + (format (attribute-string (normalize "format"))) + (align (attribute-string (normalize "align"))) + (attr (append + (if align + (list (list "ALIGN" align)) + '()) + (if entityref + (list (list "SRC" (graphic-file entityref))) + (list (list "SRC" (graphic-file fileref)))) + (list (list "ALT" "")) + ))) + (if (or fileref entityref) + (make empty-element gi: "IMG" + attributes: attr) + (empty-sosofo)))) + + (element honorific + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element isbn + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element issn + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element itermset (empty-sosofo)) + + (element invpartnumber + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element issuenum + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element jobtitle + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element keywordset (empty-sosofo)) + + (element legalnotice + (titlepage-recto-legalnotice)) + + (element (legalnotice title) (empty-sosofo)) + + (element lineage + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element modespec (empty-sosofo)) + + (element orgdiv + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element orgname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element othercredit + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (literal author-name))) + (process-node-list author-affil)))) + + (element othername + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element pagenums + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element printhistory + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element productname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element productnumber + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element pubdate + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element publisher + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element publishername + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element pubsnumber + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element releaseinfo + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element revhistory + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "TABLE" + attributes: (list + (list "WIDTH" ($table-width$)) + (list "BORDER" "0")) + (make sequence + (make element gi: "TR" + (make element gi: "TH" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("COLSPAN" "3")) + (make element gi: "B" + (literal (gentext-element-name + (gi (current-node))))))) + (process-children))))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark")))) + (make sequence + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revnumber)) + (make sequence + (literal (gentext-element-name-space + (gi (current-node)))) + (process-node-list revnumber)) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revdate)) + (process-node-list revdate) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revauthor)) + (make sequence + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT") + (list "COLSPAN" "3")) + (if (not (node-list-empty? revremark)) + (process-node-list revremark) + (empty-sosofo))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + + (element seriesvolnums + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element shortaffil + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element subjectset (empty-sosofo)) + + (element subtitle + (make element gi: "H2" + attributes: (list (list "CLASS" (gi))) + (process-children-trim))) + + (element surname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element title + (make element gi: "H1" + attributes: (list (list "CLASS" (gi))) + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (with-mode title-mode + (process-children-trim))))) + + (element (formalpara title) ($runinhead$)) + + (element titleabbrev + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element volumenum + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) +) + +(mode article-titlepage-verso-mode + (element abbrev + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element abstract + (make element gi: "DIV" + ($semiformal-object$))) + + (element (abstract title) (empty-sosofo)) + + (element address + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element affiliation + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element artpagenums + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element author + ;; Print the author name. Handle the case where there's no AUTHORGROUP + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (not in-group) + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-by)) + (make entity-ref name: "nbsp") + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (literal (author-list-string)))) + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (literal (author-list-string)))))) + + (element authorblurb + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element authorgroup + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-by)) + (make entity-ref name: "nbsp") + (process-children-trim))) + + (element authorinitials + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element bibliomisc (process-children)) + (element bibliomset (process-children)) + + (element collab + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element confgroup + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element contractnum + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element contractsponsor + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element contrib + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element copyright + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-element-name (current-node))) + (make entity-ref name: "nbsp") + (dingbat-sosofo "copyright") + (make entity-ref name: "nbsp") + (process-children))) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (literal " ")))) + + (element (copyright holder) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element corpauthor + (make sequence + (if (first-sibling?) + (if (equal? (gi (parent (current-node))) (normalize "authorgroup")) + (empty-sosofo) + (literal (gentext-by) " ")) + (literal ", ")) + (process-children))) + + (element corpname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element date + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element edition + (make element gi: "P" + (process-children) + (make entity-ref name: "nbsp") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + ;; Print the editor name. + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (or #t (not in-group)) ; nevermind, always put out the Edited by + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (make sequence + (literal (gentext-edited-by)) + (make entity-ref name: "nbsp") + (literal (author-string)))) + (literal (author-string))))) + + (element firstname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element graphic + (let* ((nd (current-node)) + (fileref (attribute-string (normalize "fileref") nd)) + (entattr (attribute-string (normalize "entityref") nd)) + (entityref (if entattr + (entity-system-id entattr) + #f)) + (format (attribute-string (normalize "format"))) + (align (attribute-string (normalize "align"))) + (attr (append + (if align + (list (list "ALIGN" align)) + '()) + (if entityref + (list (list "SRC" (graphic-file entityref))) + (list (list "SRC" (graphic-file fileref)))) + (list (list "ALT" "")) + ))) + (if (or fileref entityref) + (make empty-element gi: "IMG" + attributes: attr) + (empty-sosofo)))) + + (element honorific + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element isbn + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element issn + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element itermset (empty-sosofo)) + + (element invpartnumber + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element issuenum + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element jobtitle + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element keywordset (empty-sosofo)) + + (element legalnotice + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + ($semiformal-object$))) + + (element (legalnotice title) (empty-sosofo)) + + (element lineage + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element modespec (empty-sosofo)) + + (element orgdiv + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element orgname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element othercredit + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (literal author-name))) + (process-node-list author-affil)))) + + (element othername + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element pagenums + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element printhistory + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element productname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element productnumber + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element pubdate + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-element-name-space (gi (current-node)))) + (process-children))) + + (element publisher + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element publishername + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element pubsnumber + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element releaseinfo + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element revhistory + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "TABLE" + attributes: (list + (list "WIDTH" ($table-width$)) + (list "BORDER" "0")) + (make sequence + (make element gi: "TR" + (make element gi: "TH" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("COLSPAN" "3")) + (make element gi: "B" + (literal (gentext-element-name + (gi (current-node))))))) + (process-children))))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark")))) + (make sequence + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revnumber)) + (make sequence + (literal (gentext-element-name-space + (gi (current-node)))) + (process-node-list revnumber)) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revdate)) + (process-node-list revdate) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revauthor)) + (make sequence + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT") + (list "COLSPAN" "3")) + (if (not (node-list-empty? revremark)) + (process-node-list revremark) + (empty-sosofo))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + + (element seriesvolnums + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element shortaffil + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element subjectset (empty-sosofo)) + + (element subtitle + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element surname + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element title + (make element gi: "H2" + attributes: (list (list "CLASS" (gi))) + (with-mode title-mode + (process-children)))) + + (element (formalpara title) ($runinhead$)) + + (element titleabbrev + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) + + (element volumenum + (make element gi: "SPAN" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make empty-element gi: "BR"))) +) + +;; == Title pages for REFERENCEs ======================================== + +(define (reference-titlepage-recto-elements) + (list (normalize "title") + (normalize "subtitle") + (normalize "corpauthor") + (normalize "authorgroup") + (normalize "author") + (normalize "editor"))) + +(define (reference-titlepage-verso-elements) + '()) + +(define (reference-titlepage-content? elements side) + (titlepage-content? elements (if (equal? side 'recto) + (reference-titlepage-recto-elements) + (reference-titlepage-verso-elements)))) + +(define (reference-titlepage elements #!optional (side 'recto)) + (let ((nodelist (titlepage-nodelist + (if (equal? side 'recto) + (reference-titlepage-recto-elements) + (reference-titlepage-verso-elements)) + elements)) + ;; partintro is a special case... + (partintro (node-list-first + (node-list-filter-by-gi elements + (list (normalize "partintro")))))) + (if (reference-titlepage-content? elements side) + (make element gi: "DIV" + attributes: '(("CLASS" "TITLEPAGE")) + (let loop ((nl nodelist) (lastnode (empty-node-list))) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (if (or (node-list-empty? lastnode) + (not (equal? (gi (node-list-first nl)) + (gi lastnode)))) + (reference-titlepage-before (node-list-first nl) side) + (empty-sosofo)) + (cond + ((equal? (gi (node-list-first nl)) (normalize "abbrev")) + (reference-titlepage-abbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "abstract")) + (reference-titlepage-abstract (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "address")) + (reference-titlepage-address (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "affiliation")) + (reference-titlepage-affiliation (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "artpagenums")) + (reference-titlepage-artpagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "author")) + (reference-titlepage-author (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorblurb")) + (reference-titlepage-authorblurb (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorgroup")) + (reference-titlepage-authorgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorinitials")) + (reference-titlepage-authorinitials (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bibliomisc")) + (reference-titlepage-bibliomisc (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "biblioset")) + (reference-titlepage-biblioset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bookbiblio")) + (reference-titlepage-bookbiblio (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "citetitle")) + (reference-titlepage-citetitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "collab")) + (reference-titlepage-collab (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "confgroup")) + (reference-titlepage-confgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractnum")) + (reference-titlepage-contractnum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractsponsor")) + (reference-titlepage-contractsponsor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contrib")) + (reference-titlepage-contrib (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "copyright")) + (reference-titlepage-recto-copyright (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpauthor")) + (reference-titlepage-corpauthor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpname")) + (reference-titlepage-corpname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "date")) + (reference-titlepage-date (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "edition")) + (reference-titlepage-edition (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "editor")) + (reference-titlepage-editor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "firstname")) + (reference-titlepage-firstname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "graphic")) + (reference-titlepage-graphic (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "honorific")) + (reference-titlepage-honorific (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "indexterm")) + (reference-titlepage-indexterm (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "invpartnumber")) + (reference-titlepage-invpartnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "isbn")) + (reference-titlepage-isbn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issn")) + (reference-titlepage-issn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issuenum")) + (reference-titlepage-issuenum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "itermset")) + (reference-titlepage-itermset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "keywordset")) + (reference-titlepage-keywordset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "legalnotice")) + (reference-titlepage-recto-legalnotice (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "lineage")) + (reference-titlepage-lineage (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "mediaobject")) + (reference-titlepage-mediaobject (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "modespec")) + (reference-titlepage-modespec (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "orgname")) + (reference-titlepage-orgname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othercredit")) + (reference-titlepage-othercredit (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othername")) + (reference-titlepage-othername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pagenums")) + (reference-titlepage-pagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "printhistory")) + (reference-titlepage-printhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productname")) + (reference-titlepage-productname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productnumber")) + (reference-titlepage-productnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubdate")) + (reference-titlepage-pubdate (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publisher")) + (reference-titlepage-publisher (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publishername")) + (reference-titlepage-publishername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubsnumber")) + (reference-titlepage-pubsnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "releaseinfo")) + (reference-titlepage-releaseinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "revhistory")) + (reference-titlepage-revhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesinfo")) + (reference-titlepage-seriesinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesvolnums")) + (reference-titlepage-seriesvolnums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subjectset")) + (reference-titlepage-subjectset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subtitle")) + (reference-titlepage-subtitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "surname")) + (reference-titlepage-surname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "title")) + (reference-titlepage-title (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "titleabbrev")) + (reference-titlepage-titleabbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "volumenum")) + (reference-titlepage-volumenum (node-list-first nl) side)) + (else + (reference-titlepage-default (node-list-first nl) side))) + (loop (node-list-rest nl) (node-list-first nl))))) + + ;; PartIntro is a special case + (if (and (equal? side 'recto) + (not (node-list-empty? partintro)) + %generate-partintro-on-titlepage%) + ($process-partintro$ partintro) + (empty-sosofo)) + + (if (and %generate-reference-toc% + %generate-reference-toc-on-titlepage% + (equal? side 'recto)) + (make display-group + (build-toc (current-node) + (toc-depth (current-node)))) + (empty-sosofo)) + + (reference-titlepage-separator side)) + (empty-sosofo)))) + +(define (reference-titlepage-separator side) + (empty-sosofo)) + +(define (reference-titlepage-before node side) + (empty-sosofo)) + +(define (reference-titlepage-default node side) + (let ((foo (debug (string-append "No reference-titlepage-* for " (gi node) "!")))) + (empty-sosofo))) + +(define (reference-titlepage-element node side) + (if (equal? side 'recto) + (with-mode reference-titlepage-recto-mode + (process-node-list node)) + (with-mode reference-titlepage-verso-mode + (process-node-list node)))) + +(define (reference-titlepage-abbrev node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-abstract node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-address node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-affiliation node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-artpagenums node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-author node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-authorblurb node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-authorgroup node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-authorinitials node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-bibliomisc node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-biblioset node side) + (reference-titlepage node side)) +(define (reference-titlepage-bookbiblio node side) + (reference-titlepage node side)) +(define (reference-titlepage-citetitle node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-collab node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-confgroup node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-contractnum node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-contractsponsor node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-contrib node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-recto-copyright node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-corpauthor node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-corpname node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-date node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-edition node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-editor node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-firstname node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-graphic node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-honorific node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-indexterm node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-invpartnumber node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-isbn node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-issn node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-issuenum node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-itermset node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-keywordset node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-recto-legalnotice node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-lineage node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-mediaobject node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-modespec node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-orgname node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-othercredit node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-othername node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-pagenums node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-printhistory node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-productname node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-productnumber node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-pubdate node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-publisher node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-publishername node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-pubsnumber node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-releaseinfo node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-revhistory node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-seriesinfo node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-seriesvolnums node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-subjectset node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-subtitle node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-surname node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-title node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-titleabbrev node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-volumenum node side) + (reference-titlepage-element node side)) + +(mode reference-titlepage-recto-mode + (element para + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element abstract + (make element gi: "DIV" + ($semiformal-object$))) + + (element (abstract title) (empty-sosofo)) + + (element address + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element author + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (literal author-name))) + (process-node-list author-affil)))) + + (element authorblurb + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element authorgroup + (process-children)) + + (element copyright + (titlepage-recto-copyright)) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element (copyright holder) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element corpauthor + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element edition + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (process-children) + (make entity-ref name: "nbsp") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + (let ((editor-name (author-string))) + (make sequence + (if (first-sibling?) + (make element gi: "H4" + attributes: (list (list "CLASS" "EDITEDBY")) + (literal (gentext-edited-by))) + (empty-sosofo)) + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (literal editor-name))))) + + (element graphic + (let* ((nd (current-node)) + (fileref (attribute-string (normalize "fileref") nd)) + (entattr (attribute-string (normalize "entityref") nd)) + (entityref (if entattr + (entity-system-id entattr) + #f)) + (format (attribute-string (normalize "format"))) + (align (attribute-string (normalize "align"))) + (attr (append + (if align + (list (list "ALIGN" align)) + '()) + (if entityref + (list (list "SRC" (graphic-file entityref))) + (list (list "SRC" (graphic-file fileref)))) + (list (list "ALT" "")) + ))) + (if (or fileref entityref) + (make empty-element gi: "IMG" + attributes: attr) + (empty-sosofo)))) + + (element legalnotice + (titlepage-recto-legalnotice)) + + (element (legalnotice title) (empty-sosofo)) + + (element revhistory + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "TABLE" + attributes: (list + (list "WIDTH" ($table-width$)) + (list "BORDER" "0")) + (make sequence + (make element gi: "TR" + (make element gi: "TH" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("COLSPAN" "3")) + (make element gi: "B" + (literal (gentext-element-name + (gi (current-node))))))) + (process-children))))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark")))) + (make sequence + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revnumber)) + (make sequence + (literal (gentext-element-name-space + (gi (current-node)))) + (process-node-list revnumber)) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revdate)) + (process-node-list revdate) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revauthor)) + (make sequence + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT") + (list "COLSPAN" "3")) + (if (not (node-list-empty? revremark)) + (process-node-list revremark) + (empty-sosofo))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + + (element subtitle + (make element gi: "H2" + attributes: (list (list "CLASS" (gi))) + (process-children-trim))) + + (element title + (let ((ref (ancestor-member (current-node) + (list (normalize "reference"))))) + (make element gi: "H1" + attributes: (list (list "CLASS" (gi))) + (literal (element-label ref) + (gentext-label-title-sep (gi ref))) + (with-mode title-mode + (process-children))))) + + (element (formalpara title) ($runinhead$)) +) + +(mode reference-titlepage-verso-mode + (element abstract ($semiformal-object$)) + (element (abstract title) (empty-sosofo)) + + (element address + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element author + ;; Print the author name. Handle the case where there's no AUTHORGROUP + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (not in-group) + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-by)) + (make entity-ref name: "nbsp") + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (literal (author-list-string)))) + (make sequence + (make element gi: "A" + attributes: (list (list "NAME" (element-id))) + (empty-sosofo)) + (literal (author-list-string)))))) + + (element authorgroup + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-by)) + (make entity-ref name: "nbsp") + (process-children-trim))) + + (element copyright + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-element-name (current-node))) + (make entity-ref name: "nbsp") + (dingbat-sosofo "copyright") + (make entity-ref name: "nbsp") + (process-children))) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (literal " ")))) + + (element (copyright holder) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element corpauthor + (make sequence + (if (first-sibling?) + (if (equal? (gi (parent (current-node))) (normalize "authorgroup")) + (empty-sosofo) + (literal (gentext-by) " ")) + (literal ", ")) + (process-children))) + + (element edition + (make element gi: "P" + (process-children) + (make entity-ref name: "nbsp") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + ;; Print the editor name. + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (or #t (not in-group)) ; nevermind, always put out the Edited by + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (make sequence + (literal (gentext-edited-by)) + (make entity-ref name: "nbsp") + (literal (author-string)))) + (literal (author-string))))) + + (element legalnotice + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + ($semiformal-object$))) + + (element (legalnotice title) (empty-sosofo)) + + (element pubdate + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (literal (gentext-element-name-space (gi (current-node)))) + (process-children))) + + (element revhistory + (make element gi: "DIV" + attributes: (list (list "CLASS" (gi))) + (make element gi: "TABLE" + attributes: (list + (list "WIDTH" ($table-width$)) + (list "BORDER" "0")) + (make sequence + (make element gi: "TR" + (make element gi: "TH" + attributes: '(("ALIGN" "LEFT") + ("VALIGN" "TOP") + ("COLSPAN" "3")) + (make element gi: "B" + (literal (gentext-element-name + (gi (current-node))))))) + (process-children))))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark")))) + (make sequence + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revnumber)) + (make sequence + (literal (gentext-element-name-space + (gi (current-node)))) + (process-node-list revnumber)) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revdate)) + (process-node-list revdate) + (empty-sosofo))) + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT")) + (if (not (node-list-empty? revauthor)) + (make sequence + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make element gi: "TR" + (make element gi: "TD" + attributes: (list + (list "ALIGN" "LEFT") + (list "COLSPAN" "3")) + (if (not (node-list-empty? revremark)) + (process-node-list revremark) + (empty-sosofo))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + + (element subtitle + (make element gi: "H3" + attributes: (list (list "CLASS" (gi))) + (process-children))) + + (element title + (make element gi: "H2" + attributes: (list (list "CLASS" (gi))) + (with-mode title-mode + (process-children)))) + + (element (formalpara title) ($runinhead$)) +) diff --git a/html/dbverb.dsl b/html/dbverb.dsl new file mode 100644 index 0000000..30ef4f7 --- /dev/null +++ b/html/dbverb.dsl @@ -0,0 +1,218 @@ +;; $Id: dbverb.dsl,v 1.5 2003/01/15 08:24:14 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +(define ($inpre$) + (let ((wrapper (ancestor-member (current-node) + (list (normalize "address") + (normalize "funcsynopsisinfo") + (normalize "literallayout") + (normalize "programlisting") + (normalize "screen") + (normalize "synopsis"))))) + (if (or (and (equal? wrapper "literallayout") + (not (equal? (attribute-string "class" wrapper) + (normalize "monospaced")))) + (equal? wrapper "address")) + #f + #t))) + +(define ($format-indent$ indent) + ;; This code is made complex by the fact that we need an additional + ;; wrapper and we have to translate spaces into nbsp entity-refs, + ;; if we aren't in a PRE. + ;; + (if ($inpre$) + (literal indent) + (make element gi: "CODE" + ($sp-to-nbsp-sosofo$ indent)))) + +(define ($format-linenumber$ linenumber) + ;; This code is made complex by the fact that we need an additional + ;; wrapper and we have to translate spaces into nbsp entity-refs, + ;; if we aren't in a PRE. + ;; + (if (equal? (remainder linenumber %linenumber-mod%) 0) + (if ($inpre$) + (make sequence + (literal (pad-string (format-number linenumber "1") + %linenumber-length% %linenumber-padchar%)) + ($linenumber-space$)) + (make element gi: "CODE" + ($sp-to-nbsp-sosofo$ + (pad-string (format-number linenumber "1") + %linenumber-length% %linenumber-padchar%)) + ($linenumber-space$))) + (if ($inpre$) + (make sequence + (literal (pad-string "" %linenumber-length% " ")) + ($linenumber-space$)) + (make element gi: "CODE" + ($sp-to-nbsp-sosofo$ + (pad-string "" %linenumber-length% " ")) + ($linenumber-space$))))) + +(define ($line-start$ indent line-numbers? #!optional (line-number 1)) + (make sequence + (if indent + ($format-indent$ indent) + (empty-sosofo)) + (if line-numbers? + ($format-linenumber$ line-number) + (empty-sosofo)))) + +(define ($sp-to-nbsp-sosofo$ string) + ;; Given a string, return it as a sosofo, but replace spaces with + ;; nbsp entity-refs. + (make sequence + (let loop ((charlist (string->list string)) + (res (empty-sosofo))) + (if (null? charlist) + res + (loop + (cdr charlist) + (let ((c (car charlist))) + (if (equal? c #\ ) + (sosofo-append res + (make entity-ref name: "nbsp")) + (sosofo-append res (literal (list->string (list c))))))))))) + +(define ($verbatim-display$ indent line-numbers?) + (let ((content (make element gi: "PRE" + attributes: (list + (list "CLASS" (gi))) + (if (or indent line-numbers?) + ($verbatim-line-by-line$ indent line-numbers?) + (process-children))))) + (if %shade-verbatim% + (make element gi: "TABLE" + attributes: ($shade-verbatim-attr$) + (make element gi: "TR" + (make element gi: "TD" + content))) + (make sequence + (para-check) + content + (para-check 'restart))))) + +(define ($verbatim-line-by-line$ indent line-numbers?) + (let ((expanded-content + ;; this is the content with + ;; inlinemediaobject/imageobject[@format='linespecific'] + ;; expanded + (let loop ((kl (children (current-node))) (rl (empty-node-list))) + (if (node-list-empty? kl) + rl + (if (equal? (gi (node-list-first kl)) + (normalize "inlinemediaobject")) + (let* ((imgobj (node-list-filter-by-gi + (children (node-list-first kl)) + (list (normalize "imageobject")))) + (datobj (node-list-filter-by-gi + (children imgobj) + (list (normalize "imagedata"))))) + (if (and (not (node-list-empty? imgobj)) + (not (node-list-empty? datobj)) + (equal? (attribute-string (normalize "format") datobj) + (normalize "linespecific"))) + (loop (node-list-rest kl) + (node-list rl (string->nodes (include-characters + (if (attribute-string (normalize "fileref") datobj) + (attribute-string (normalize "fileref") datobj) + (entity-generated-system-id (attribute-string (normalize "entityref") datobj))))))) + (loop (node-list-rest kl) + (node-list rl (node-list-first kl))))) + (loop (node-list-rest kl) (node-list rl (node-list-first kl)))))))) + (make sequence + ($line-start$ indent line-numbers? 1) + (let loop ((kl expanded-content) + (linecount 1) + (res (empty-sosofo))) + (if (node-list-empty? kl) + res + (loop + (node-list-rest kl) + (if (char=? (node-property 'char (node-list-first kl) + default: #\U-0000) #\U-000D) + (+ linecount 1) + linecount) + (let ((c (node-list-first kl))) + (if (char=? (node-property 'char c default: #\U-0000) + #\U-000D) + (sosofo-append res + (process-node-list c) + ($line-start$ indent + line-numbers? + (+ linecount 1))) + (sosofo-append res (process-node-list c)))))))))) + +(define ($linespecific-display$ indent line-numbers?) + (make element gi: "P" + attributes: (list (list "CLASS" (gi))) + (make sequence + ($line-start$ indent line-numbers? 1) + (let loop ((kl (children (current-node))) + (linecount 1) + (res (empty-sosofo))) + (if (node-list-empty? kl) + res + (loop + (node-list-rest kl) + (if (char=? (node-property 'char (node-list-first kl) + default: #\U-0000) #\U-000D) + (+ linecount 1) + linecount) + (let ((c (node-list-first kl))) + (if (char=? (node-property 'char c default: #\U-0000) + #\U-000D) + (sosofo-append res + (make empty-element gi: "br") + (process-node-list c) + ($line-start$ indent + line-numbers? + (+ linecount 1))) + (if (char=? (node-property 'char c default: #\U-0000) + #\U-0020) + (sosofo-append res + (make entity-ref name: "nbsp")) + (sosofo-append res (process-node-list c))))))))))) + +(element literallayout + (if (equal? (attribute-string "class") (normalize "monospaced")) + ($verbatim-display$ + %indent-literallayout-lines% + (or %number-literallayout-lines% + (equal? (attribute-string (normalize "linenumbering")) + (normalize "numbered")))) + ($linespecific-display$ + %indent-literallayout-lines% + (or %number-literallayout-lines% + (equal? (attribute-string (normalize "linenumbering")) + (normalize "numbered")))))) + +(element address + ($linespecific-display$ + %indent-address-lines% + (or %number-address-lines% + (equal? (attribute-string (normalize "linenumbering")) + (normalize "numbered"))))) + +(element programlisting + ($verbatim-display$ + %indent-programlisting-lines% + (or %number-programlisting-lines% + (equal? (attribute-string (normalize "linenumbering")) + (normalize "numbered"))))) + +(element screen + ($verbatim-display$ + %indent-screen-lines% + (or %number-screen-lines% + (equal? (attribute-string (normalize "linenumbering")) + (normalize "numbered"))))) + +(element screenshot (process-children)) +(element screeninfo (empty-sosofo)) + diff --git a/html/docbook.dsl b/html/docbook.dsl new file mode 100644 index 0000000..f7f2828 --- /dev/null +++ b/html/docbook.dsl @@ -0,0 +1,242 @@ + +%dbl10n.ent; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]> + + + + + + +;; $Id: docbook.dsl,v 1.9 2004/10/09 21:36:35 petere78 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +(declare-flow-object-class element + "UNREGISTERED::James Clark//Flow Object Class::element") + +(declare-flow-object-class empty-element + "UNREGISTERED::James Clark//Flow Object Class::empty-element") + +(declare-flow-object-class document-type + "UNREGISTERED::James Clark//Flow Object Class::document-type") + +(declare-flow-object-class processing-instruction + "UNREGISTERED::James Clark//Flow Object Class::processing-instruction") + +(declare-flow-object-class entity + "UNREGISTERED::James Clark//Flow Object Class::entity") + +(declare-flow-object-class entity-ref + "UNREGISTERED::James Clark//Flow Object Class::entity-ref") + +(declare-flow-object-class formatting-instruction + "UNREGISTERED::James Clark//Flow Object Class::formatting-instruction") + +(declare-characteristic preserve-sdata? + "UNREGISTERED::James Clark//Characteristic::preserve-sdata?" #t) + +(define debug + (external-procedure "UNREGISTERED::James Clark//Procedure::debug")) + +(define read-entity + (external-procedure "UNREGISTERED::James Clark//Procedure::read-entity")) + +(define all-element-number + (external-procedure "UNREGISTERED::James Clark//Procedure::all-element-number")) + +(root + (make sequence +; (literal +; (debug (node-property 'gi +; (node-property 'document-element (current-node))))) +;(define (docelem node) +; (node-propety 'document-element +; (node-property 'grove-root node))) + (process-children) + (with-mode manifest + (process-children)) + (if html-index + (with-mode htmlindex + (process-children)) + (empty-sosofo)))) + +(mode manifest + ;; this mode is really just a hack to get at the root element + (root (process-children)) + + (default + (if (node-list=? (current-node) (sgml-root-element)) + (if html-manifest + (make entity + system-id: (html-entity-file html-manifest-filename) + (make sequence + (let loop ((node (current-node))) + (if (node-list-empty? node) + (empty-sosofo) + (make sequence + (make formatting-instruction data: (html-file node)) + (make formatting-instruction data: " +") + (loop (next-chunk-element node))))) + (let loop ((nl (select-elements (descendants (current-node)) + (normalize "legalnotice")))) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (if (and %generate-legalnotice-link% + (not nochunks) + (first-sibling? (node-list-first nl)) + ;; Hack: only book legal notices are diverted + (have-ancestor? (normalize "bookinfo") + (node-list-first nl))) + (make sequence + (make formatting-instruction + data: ($legalnotice-link-file$ (node-list-first nl))) + (make formatting-instruction data: " +")) + (empty-sosofo)) + (loop (node-list-rest nl))))))) + (empty-sosofo)) + (empty-sosofo)))) + +;; Make text that comes from unimplemented tags easy to spot +(default + (make element gi: "FONT" + attributes: '(("COLOR" "RED")) + (process-children))) + +&dbcommon.dsl; +&dbctable.dsl; + +&dbl10n.dsl; + +&dbadmon.dsl; +&dbautoc.dsl; +&dbbibl.dsl; +&dbblock.dsl; +&dbcallou.dsl; +&dbcompon.dsl; +&dbdivis.dsl; +&dbfootn.dsl; +&dbgloss.dsl; +&dbgraph.dsl; +&dbhtml.dsl; +&dbindex.dsl; +&dbinfo.dsl; +&dbinline.dsl; +&dblink.dsl; +&dblists.dsl; +&dblot.dsl; +&dbmath.dsl; +&dbmsgset.dsl; +&dbnavig.dsl; +&dbchunk.dsl; +&dbpi.dsl; +&dbprocdr.dsl; +&dbqanda.dsl; +&dbrfntry.dsl; +&dbsect.dsl; +&dbsynop.dsl; +&dbefsyn.dsl; +&dbtable.dsl; +&dbtitle.dsl; +&dbttlpg.dsl; +&dbverb.dsl; +&version.dsl; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/version.dsl b/html/version.dsl new file mode 100644 index 0000000..e6186f6 --- /dev/null +++ b/html/version.dsl @@ -0,0 +1,14 @@ +;; $Id: version.dsl,v 1.2 2004/07/11 06:21:01 nyraghu Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://www.nwalsh.com/docbook/dsssl/ +;; + +;; If **ANY** change is made to this file, you _MUST_ alter the +;; following definition: + +(define (stylesheet-version) + (string-append + "Modular DocBook HTML Stylesheet Version " + ;; Trim off bounding white space. + (strip "&VERSION;"))) diff --git a/images/ChangeLog b/images/ChangeLog new file mode 100644 index 0000000..ec6bbfc --- /dev/null +++ b/images/ChangeLog @@ -0,0 +1,13 @@ +2001-12-06 Adam Di Carlo + + * Make.images, Makefile: image converstion make improvements; if you want to tweak the image conversion stuff, do that in Make.images and that will affect the subdirs too; also, a clean rule + +2001-12-01 Norman Walsh + + * .cvsignore, Makefile: New file. + +2001-04-02 Norman Walsh + + * caution.gif, home.gif, important.gif, next.gif, note.gif, prev.gif, tip.gif, toc-blank.gif, toc-minus.gif, toc-plus.gif, up.gif, warning.gif: + New file. + diff --git a/images/Make.images b/images/Make.images new file mode 100644 index 0000000..277a2d5 --- /dev/null +++ b/images/Make.images @@ -0,0 +1,10 @@ +GIF := $(wildcard *.gif) +EPS := $(GIF:.gif=.eps) +PDF := $(GIF:.gif=.pdf) + +%.eps: %.gif + convert $< $@ + +%.pdf: %.eps + epstopdf --outfile=$@ $< + diff --git a/images/callouts/1.eps b/images/callouts/1.eps new file mode 100644 index 0000000..dc21230 --- /dev/null +++ b/images/callouts/1.eps @@ -0,0 +1,284 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: (ImageMagick) +%%Title: (1.eps) +%%CreationDate: (Fri Nov 5 11:45:40 2004) +%%BoundingBox: 0 0 12 12 +%%HiResBoundingBox: 0 0 12 12 +%%DocumentData: Clean7Bit +%%LanguageLevel: 1 +%%Pages: 1 +%%EndComments + +%%BeginDefaults +%%EndDefaults + +%%BeginProlog +% +% Display a color image. The image is displayed in color on +% Postscript viewers or printers that support color, otherwise +% it is displayed as grayscale. +% +/DirectClassPacket +{ + % + % Get a DirectClass packet. + % + % Parameters: + % red. + % green. + % blue. + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/DirectClassImage +{ + % + % Display a DirectClass image. + % + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { DirectClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayDirectClassPacket } image + } ifelse +} bind def + +/GrayDirectClassPacket +{ + % + % Get a DirectClass packet; convert to grayscale. + % + % Parameters: + % red + % green + % blue + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/GrayPseudoClassPacket +{ + % + % Get a PseudoClass packet; convert to grayscale. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassPacket +{ + % + % Get a PseudoClass packet. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassImage +{ + % + % Display a PseudoClass image. + % + % Parameters: + % class: 0-PseudoClass or 1-Grayscale. + % + currentfile buffer readline pop + token pop /class exch def pop + class 0 gt + { + currentfile buffer readline pop + token pop /depth exch def pop + /grays columns 8 add depth sub depth mul 8 idiv string def + columns rows depth + [ + columns 0 0 + rows neg 0 rows + ] + { currentfile grays readhexstring pop } image + } + { + % + % Parameters: + % colors: number of colors in the colormap. + % colormap: red, green, blue color packets. + % + currentfile buffer readline pop + token pop /colors exch def pop + /colors colors 3 mul def + /colormap colors string def + currentfile colormap readhexstring pop pop + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { PseudoClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayPseudoClassPacket } image + } ifelse + } ifelse +} bind def + +/DisplayImage +{ + % + % Display a DirectClass or PseudoClass image. + % + % Parameters: + % x & y translation. + % x & y scale. + % label pointsize. + % image label. + % image columns & rows. + % class: 0-DirectClass or 1-PseudoClass. + % compression: 0-none or 1-RunlengthEncoded. + % hex color packets. + % + gsave + /buffer 512 string def + /byte 1 string def + /color_packet 3 string def + /pixels 768 string def + + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + x y translate + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + currentfile buffer readline pop + token pop /pointsize exch def pop + /Times-Roman findfont pointsize scalefont setfont + x y scale + currentfile buffer readline pop + token pop /columns exch def + token pop /rows exch def pop + currentfile buffer readline pop + token pop /class exch def pop + currentfile buffer readline pop + token pop /compression exch def pop + class 0 gt { PseudoClassImage } { DirectClassImage } ifelse + grestore +} bind def +%%EndProlog +%%Page: 1 1 +%%PageBoundingBox: 0 0 12 12 +userdict begin +DisplayImage +0 0 +12 12 +12.000000 +12 12 +1 +1 +1 +8 +FFFFF794391010399CF7FFFFFFE73100000829000031E7FFF7310000008CCE00000031 +F78C00004AE7F7CE000000008C3100000000A5CE000000003108000000009CCE00000000 +0808000000009CCE000000000831000000009CCE00000000318C000000009CCE00000000 +8CF7310000008CB500000031F7FFE72900000000000031E7FFFFFFF78C3108083994F7FF +FFend +%%PageTrailer +%%Trailer +%%EOF diff --git a/images/callouts/1.gif b/images/callouts/1.gif new file mode 100644 index 0000000000000000000000000000000000000000..9ee74a0762d99da981a75def4dbbccbca5411ab8 GIT binary patch literal 890 zcmZ?wbhEHbILrGiT1yrAxPN z-Foiax#!QHzkmP!`}gnvN5Nz=J8a#Nh@uACfSzWF_5eg0r%$#Cw92^YR03d7svj6}9 literal 0 HcmV?d00001 diff --git a/images/callouts/1.pdf b/images/callouts/1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..738102db6c55dc9c84f2b64a04115ecf2f4b3e04 GIT binary patch literal 1454 zcmbtUU1%It6i(7o@lt$hun&=3pT2`B^DT3&Pc76|YAfzSE!SdMwO!MCI`B^a?Kk)BO->!X zEuInoOizved2697x9{-v1NWl$9$#Cj{@iu(#Hn|${;}5nBI~?+Z0UXR@YAo%#{T;9 zg-bsj{Am92H!nvPm!CcR#Qb}e$1eJ2%7e4JioacX9=$sK-SS%Nz>H{{xcT?z#-|_l z&bElJ+ZJ0NEw1!GcjwHRuja+x0rdM@H%8pEHQ%}Yp9O=zJX8w1i<5_UyHmL7^=W;A z+l6}Ra8m73O;XQ5h@mL zQ*rZLzzkBZlTUM*B`_sSj+Y@vHw5&K%f7UPNnob(=m=&(dK_Cq8iCaeJ*dt^ybT%G%TmMkz$>4!#}#!zd@9oFv^_h zQIgTg@dD5^5s5ox!?d#$F=(Z3*hQW_!n~JmQ;HOK(?)sB;y8jx+MMLsfELbe zYy$&Qo2oxu+W%`)Q+(;QX4S8)icp39KThlX{v)OQu%grq_fATI1|`r{p_1pWzb`d_ z`$~?GBJY}G5=S~HI|N#Sy;d!YgU0;vqX9}oj8ToTkQP$*q*M4elNai^{*!)Bu1TY4 z=1-qI1VI^7S{!iJ!N&w3u~=PY<1QaTunr8-%?pP$EvVrUyn$&U;IA%hZ(xj45a3pf zh9Wz$UcvEN h9N0J|XIO80#KCGv-tr1*xYFwkV_F#be7%DSbRUJe!KnZM literal 0 HcmV?d00001 diff --git a/images/callouts/10.eps b/images/callouts/10.eps new file mode 100644 index 0000000..2216376 --- /dev/null +++ b/images/callouts/10.eps @@ -0,0 +1,284 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: (ImageMagick) +%%Title: (10.eps) +%%CreationDate: (Fri Nov 5 11:45:40 2004) +%%BoundingBox: 0 0 12 12 +%%HiResBoundingBox: 0 0 12 12 +%%DocumentData: Clean7Bit +%%LanguageLevel: 1 +%%Pages: 1 +%%EndComments + +%%BeginDefaults +%%EndDefaults + +%%BeginProlog +% +% Display a color image. The image is displayed in color on +% Postscript viewers or printers that support color, otherwise +% it is displayed as grayscale. +% +/DirectClassPacket +{ + % + % Get a DirectClass packet. + % + % Parameters: + % red. + % green. + % blue. + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/DirectClassImage +{ + % + % Display a DirectClass image. + % + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { DirectClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayDirectClassPacket } image + } ifelse +} bind def + +/GrayDirectClassPacket +{ + % + % Get a DirectClass packet; convert to grayscale. + % + % Parameters: + % red + % green + % blue + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/GrayPseudoClassPacket +{ + % + % Get a PseudoClass packet; convert to grayscale. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassPacket +{ + % + % Get a PseudoClass packet. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassImage +{ + % + % Display a PseudoClass image. + % + % Parameters: + % class: 0-PseudoClass or 1-Grayscale. + % + currentfile buffer readline pop + token pop /class exch def pop + class 0 gt + { + currentfile buffer readline pop + token pop /depth exch def pop + /grays columns 8 add depth sub depth mul 8 idiv string def + columns rows depth + [ + columns 0 0 + rows neg 0 rows + ] + { currentfile grays readhexstring pop } image + } + { + % + % Parameters: + % colors: number of colors in the colormap. + % colormap: red, green, blue color packets. + % + currentfile buffer readline pop + token pop /colors exch def pop + /colors colors 3 mul def + /colormap colors string def + currentfile colormap readhexstring pop pop + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { PseudoClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayPseudoClassPacket } image + } ifelse + } ifelse +} bind def + +/DisplayImage +{ + % + % Display a DirectClass or PseudoClass image. + % + % Parameters: + % x & y translation. + % x & y scale. + % label pointsize. + % image label. + % image columns & rows. + % class: 0-DirectClass or 1-PseudoClass. + % compression: 0-none or 1-RunlengthEncoded. + % hex color packets. + % + gsave + /buffer 512 string def + /byte 1 string def + /color_packet 3 string def + /pixels 768 string def + + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + x y translate + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + currentfile buffer readline pop + token pop /pointsize exch def pop + /Times-Roman findfont pointsize scalefont setfont + x y scale + currentfile buffer readline pop + token pop /columns exch def + token pop /rows exch def pop + currentfile buffer readline pop + token pop /class exch def pop + currentfile buffer readline pop + token pop /compression exch def pop + class 0 gt { PseudoClassImage } { DirectClassImage } ifelse + grestore +} bind def +%%EndProlog +%%Page: 1 1 +%%PageBoundingBox: 0 0 12 12 +userdict begin +DisplayImage +0 0 +12 12 +12.000000 +12 12 +1 +1 +1 +8 +FFFFFF9C391810398CF7FFFFFFEF3910180008291031DEFFFF3908B5B529DEBDE75229 +F7A521EFFFB5B5B50073DE008C4A0008CEB5D6730031FF2131180000CEB5F7630018FF39 +08180000CEB5EF630021FF39004A0000CEB5CE840039FF1831A50000CEB58CD61094CE00 +8CFF3900BD9C10BDF7D63129F7FFEF3900000000080029DEFFFFFFFF943908082994F7FF +FFend +%%PageTrailer +%%Trailer +%%EOF diff --git a/images/callouts/10.gif b/images/callouts/10.gif new file mode 100644 index 0000000000000000000000000000000000000000..08a248ebcd5298f950a40a905fd8c39d93d7b668 GIT binary patch literal 926 zcmZ?wbhEHbz;J+(mzl?f tVZjwgRz`k}4K`McO%0rqS`r*5KQM%@Vq_?YS@Dq3t&?9Qi-Uu~8UUs={Y3x( literal 0 HcmV?d00001 diff --git a/images/callouts/10.pdf b/images/callouts/10.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c579840d2d14cb35d39d8cbc882ae207af6e5091 GIT binary patch literal 1494 zcmbtUU1%It6i(Vu@KU6e_%G&ytZZwt_uko^&2EW{Cff~3yJnf);KO#?OlR-zPIh)C z&fLhR;7`yzScPhZLTu6p!X)5s-@11P2O@a^N zFtD@Vx#!Gx&i9@1B%-kv;`0N~`5XJ*1v13Y+T9P@+R%1t=2-y-IijGLZZK*?6f;yt zqg1o9G!g+0v#DAF<*_GH_$z-3*FEhWAN#!b(@InJy*GDG^&aUfG#q&4>l5qttb=_< zf4wq&^|Q*%BOlIuQE9q6b*3^?|M>Wtv3r{*=Pu7(wkPK@YYby_pIFmd1&~taawCk{E{B(2EV>fS&{_x=8uIt8p+j#d+>p#98X})^m z(4VJ1XnFqoqx1LNH&QH?*EYTSd(V93_VDcsyQaH+&-RQw<=fCucX3+ZP0eg|Li|Zg zRm@WSN+ArYP@p#O)X)G$2{lhqoMv^k-73R0=3yf7I|F#grY3`aAqYSUb*w>KqYjrU zVOv^~vNYmiLey2_HQIT?)-vl%GAto&k$1&xKvjcJ@azCnAdVgh{paOrv-lhk&@OYDAn_OH6^J=iTf%$s8QS7nb;0H3zowi z&DIAP4EZqG#J$AVUyLluJ?4#WkuVMrf@MMiazMo6R`%aQZmMN_cX(a9#?`#86?bgn zNhzHfl;Z^Z=zznaNTh1BvQ2Y4HI7_RBB_7cn`+-6$?-E@A`+cvH(UEK92~ ze~6oW#W_s)qO8FD!PQtOyc%l_aD7+g1|@FG6<8~|;~cY9-JmxA1Vh(YykCeE%i=31 e{LJ^;%vn&VD$fmu?cwMtPRV921XZdVGXth58)?F9gJz0TnZAK&M|05rWHg6t1z%i3P~6kD5SQv3+Q?5 ZeIS%_c!8-d7f+_b^G0@VQx+BmYXBA|`dI(~ literal 0 HcmV?d00001 diff --git a/images/callouts/2.pdf b/images/callouts/2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3d849508a93b58a05b547ef46e90be04bc70b550 GIT binary patch literal 1483 zcmbtUU1%It6i%92@kV^Au%eJFxUx;{-nlzF`xBRd$#!E*wpnI3P`cSRZ7Y_d&)58^Pe zv){Sr%y-WBo$;pPiCxq$Bk#Lco_+x-Si;uBV<;9Q{md-#Q5*t9B?;Z&%*G^PXq?4a z-YT%pPULW#X(d#d-kFg;kuy@$1HPH*4+h_>wH01DwEz6z%fq8vpL^`nH@8i0!^6f{ zv--og@7EUYI=1jpt?jnVnc710y)#>;Z@+JDX?|(mo?FUoF^r{_DK#B1d?YAbY z9gEIG&TmuIv0tvt#d6!*zrW{t^!nY)^R>@or}pfB_VQ25Z3k%h+PT?t%Qv@)(~1r&7;PU%LEp?2UyNyDT z7bNVi@SZdWnJ^V~R0KkiZp-9Q#=$~h7pgN6byoz(L{Pyl7YCC*z2M+15=>Q;!%(3N zG^nUnPo-v@qa>q}-U86n`2^|e!C~=kGT5!+ zi2F2I)m5QDYHcMBj(WamYKotEv{}q+ zy(2_p|BurOzyC-nKP)IU!@ZeOpg{?IRVe3~?dwVPn^LoR@87@w{{8#^Q7{?;LpB6-Ksf-E7Z^Co8FV97 z99Yo6z{n~UB9M{D#K^$NCBnhbaG<4;pVgy7fw8HfOH_=3VM2lv1EZKgPs|5_h6YBx z;64?HLKOyfVWlfP0mUhe%%UMqIhhVB3>^GvQn3z=4vbt}VPPj;EO26F7va>I!yvrK Tx0}cLl88gYK__lTMh0sD&(;7B literal 0 HcmV?d00001 diff --git a/images/callouts/3.pdf b/images/callouts/3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..63642c0a84ecc18f3be0b6ce2ab2c381ca521d4c GIT binary patch literal 1483 zcmbtUVQ3p=7;ZML@S(CF6$VcC{b`rXCEtB_y(FEbV{MwyZn5E#f-H;ncK0>8?s8Y} zuGr4uHbsQ`Lq!=AI)!0jVf(4B?AOpAb~=V^&e>`~MV)MOfvs!~DfoWZv{_sHAsz?0 zJn#3u_q^}(yw{vbB*Qc!q2@1dzI_78SittaA=KVZb~CH!m2eagg(MBrV-6-sQ}tMa zX|~QfI*{u*Of93)iDz=cH&RY$*cm)N@pb?7-JkskEV}o zzwP$AcgBwl{dse$z0kDv_mg)+=qYi-OZ3pov)bq1KC<&xC3NM&p7U=+y2DTR&dxp= z{vewEMBiFCb^6|$*DlY*{@%BK%eFHIkNxu9$M1%#m18Ym-TULS8yDZtzj$@-*`~2A zSMT4Q`C{V4_`-*3Af0^d=O51WzH01PkS-s+|JT`1Q#*S0Y|?sT>cU4qZM<&3QcCLP z_dg!KbtzOm^n7E>op!zNpn7Hcx9gP+(+|JaVBQ$0FiWq^1)lgU`2_i|7!yzpYORks zH#W>jMlCXuX1bwv+M_rxK$wbf7Z8LTW_eiRG9aQb*B)^+=7K;O$JVmU%M*|glb$lv z=!AssQ7@JCKqgFi9R-0h|)%K3hB{-rs0i|&J>REca#1u z1;_oTzDycZl1*bFB8c_6ew#JZDs70rMyW@6YAv{E;s-s9NOHu|Jj1s9-UUPwc3Cy7 zynrZ-QcdH$@(Wu_7!@SwX(a|E*J4r(Jih9jKw(c-VUoNS zi^tbuF$v^dl^dnt%2ilQc;KApsD{ZL`0irgSI{peifzNjaXZ6$TZ1;{BKgbfdaC33 Plc6*&qvq!Bz9jkw&~Vj& literal 0 HcmV?d00001 diff --git a/images/callouts/4.eps b/images/callouts/4.eps new file mode 100644 index 0000000..b53d038 --- /dev/null +++ b/images/callouts/4.eps @@ -0,0 +1,284 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: (ImageMagick) +%%Title: (4.eps) +%%CreationDate: (Fri Nov 5 11:45:40 2004) +%%BoundingBox: 0 0 12 12 +%%HiResBoundingBox: 0 0 12 12 +%%DocumentData: Clean7Bit +%%LanguageLevel: 1 +%%Pages: 1 +%%EndComments + +%%BeginDefaults +%%EndDefaults + +%%BeginProlog +% +% Display a color image. The image is displayed in color on +% Postscript viewers or printers that support color, otherwise +% it is displayed as grayscale. +% +/DirectClassPacket +{ + % + % Get a DirectClass packet. + % + % Parameters: + % red. + % green. + % blue. + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/DirectClassImage +{ + % + % Display a DirectClass image. + % + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { DirectClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayDirectClassPacket } image + } ifelse +} bind def + +/GrayDirectClassPacket +{ + % + % Get a DirectClass packet; convert to grayscale. + % + % Parameters: + % red + % green + % blue + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/GrayPseudoClassPacket +{ + % + % Get a PseudoClass packet; convert to grayscale. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassPacket +{ + % + % Get a PseudoClass packet. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassImage +{ + % + % Display a PseudoClass image. + % + % Parameters: + % class: 0-PseudoClass or 1-Grayscale. + % + currentfile buffer readline pop + token pop /class exch def pop + class 0 gt + { + currentfile buffer readline pop + token pop /depth exch def pop + /grays columns 8 add depth sub depth mul 8 idiv string def + columns rows depth + [ + columns 0 0 + rows neg 0 rows + ] + { currentfile grays readhexstring pop } image + } + { + % + % Parameters: + % colors: number of colors in the colormap. + % colormap: red, green, blue color packets. + % + currentfile buffer readline pop + token pop /colors exch def pop + /colors colors 3 mul def + /colormap colors string def + currentfile colormap readhexstring pop pop + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { PseudoClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayPseudoClassPacket } image + } ifelse + } ifelse +} bind def + +/DisplayImage +{ + % + % Display a DirectClass or PseudoClass image. + % + % Parameters: + % x & y translation. + % x & y scale. + % label pointsize. + % image label. + % image columns & rows. + % class: 0-DirectClass or 1-PseudoClass. + % compression: 0-none or 1-RunlengthEncoded. + % hex color packets. + % + gsave + /buffer 512 string def + /byte 1 string def + /color_packet 3 string def + /pixels 768 string def + + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + x y translate + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + currentfile buffer readline pop + token pop /pointsize exch def pop + /Times-Roman findfont pointsize scalefont setfont + x y scale + currentfile buffer readline pop + token pop /columns exch def + token pop /rows exch def pop + currentfile buffer readline pop + token pop /class exch def pop + currentfile buffer readline pop + token pop /compression exch def pop + class 0 gt { PseudoClassImage } { DirectClassImage } ifelse + grestore +} bind def +%%EndProlog +%%Page: 1 1 +%%PageBoundingBox: 0 0 12 12 +userdict begin +DisplayImage +0 0 +12 12 +12.000000 +12 12 +1 +1 +1 +8 +FFFFFFAD5229294AA5FFFFFFFFF74A00000029100039E7FFFF4A0000004AFF73000039 +F7AD00000010E7FF73000000944A000000ADA5EF73000000311800005AE710F773000000 +08180021EF7329F78C180000084A0063FFFFFFFFFFA5000031A50000000000F773000000 +8CF73900000000DE6B000029F7FFEF3900000000000029DEFFFFFFF79C311008318CF7FF +FFend +%%PageTrailer +%%Trailer +%%EOF diff --git a/images/callouts/4.gif b/images/callouts/4.gif new file mode 100644 index 0000000000000000000000000000000000000000..a0f99af450b3245469f489fb68dfd97efe94f657 GIT binary patch literal 907 zcmZ?wbhEHb(+bs?md70{Qdj)-@kwVKMF=eV5o(F4k!nJ z@&W@#0fRBeoCOOU8d-!`xQQ#`D@WP$J*xv3y!GnxeHh#mD9T&c6 WG%$&ZBy}V>I504Kv$C-;SOWmX-}gNL literal 0 HcmV?d00001 diff --git a/images/callouts/4.pdf b/images/callouts/4.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6579b8238f49b3ae3e2d8bde79edaceece88b561 GIT binary patch literal 1482 zcmbtUTWB0r7*3)FIhLZ3LKI1k50Ooq=FHjI*-H!yO}4w#W|L)hgV@b##@Un2q_Z<| zW&%ls#3G2M;Dw65qydZD3o25IHfW`#QPf)0Dp>lE2O+lBRuxTO?B_e}@I^iLmMxYl!P&x?OtyyvyK zKWC;-74KjA?doEw^^t`sp(se#maJb>cQ4iLsA+si{fimd@>t-BkCG3N|9br)REB(& zDW@hz8A&KPM&c~1DP86`P74sGUbr&|LKZU|Eb=WNA~V|@vs7loeiD|cCYh5aut7|A z<)KFx6zm*#Vo3+KgemVMBiIw^HVp^b*qHCvh008L-<5r1!l_`Fi;c-{EoLI%cSjW*Y9<1wR2`F3qtM%t|WxQJvu+B1vtMrM;3rv+5KIq}CjlMKd_WwAo@cWOH)Imu@p^b7JPQGt1CD!CbDUQLw zQ>ILrGiT1yrAybYU3>1_xqJ8SJ%9fE{rmUdzkmNf3PwX<$cBIpC7Keup4NR;YA{+@0O$V46_zadfC^9xMiOMmY$WT0RVlt1-q!xk1Mo$Jd zww^0H6b`bmD>I*9aY#7m!6s6)N@PJoN;9W2Z%0d}A|oRwZ(Y;@js(Wm2~2icIWs<| SGIn!ITP&Fokl?_;U=0AIl>emw literal 0 HcmV?d00001 diff --git a/images/callouts/5.pdf b/images/callouts/5.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7497d8d97d97ad3384ca5f0f169c6870ab5d9c03 GIT binary patch literal 1485 zcmbtUZD<>19B->sc&1Wi^Mwj~KCC0%);{-KdP!Pq(Kbt6x7ct=6-*+%U7n`bUGB== zlbKFYhac1yaUhC}_KOfvHyO&#l5RZdg ze*c&IJ^%mjcP+7Sq>Z-wQOifAmtIE-mau(r40U&t1I)_uQ5*n7B@x5q%)umLYMh0c zZf96e4|2J~v>Yl-?@mac`4dvz1HPH*Plo1-+cR$+d+g%So5Q0wzWVIK`;A8$@vu2o zuU=c6FD~74a_Q6J_FEGdic9r7XBwur?U`M zWp}_`o;*7Cb7{6ay>-`*&;Qyw8N6FMy?E{T4+AeuJ^oiypy~Fjg~LyMaNF74_jWy5 zeD72`aqQ8F(odH^p1u0p;iu1kGq1m!ZVMcD50)Rk<&~LJZ*2MV^lNX=@lt;A&NH7k z?`m`(`Eo~NY59v#`O*_No%p@`!@swT7)t~0;M|L6+ESO!@07l~SYAH+y>iEc@63Gt zZL^wMSX|hVooCBazg&LK{R1WUG@nb|x2@sa{Y`a!0d0a=naX6~Nla7BQ2fe48C9T; z>Yx)7Q; z#?T=TG^prSDW&VBmC8PiYo?uDYq3hXn%}uGzeBE9jJ=~iq$yG|At4v;Jj;}v<0QZmDE_Zdu80R?DF40!d z64+jhEDRd+g}Y=)>Y!9oDD6->WQa%Y%)f=aQrq#Re4bpRTGr4HrCOmVVQ`ZHuC%jp z7m%KwipmNO8$nDhp041$n5ec5juUbQds`zm7EAKX U>vGNE-ef2Z1yM`O-oXg^2R`%F)&Kwi literal 0 HcmV?d00001 diff --git a/images/callouts/6.eps b/images/callouts/6.eps new file mode 100644 index 0000000..c0d4341 --- /dev/null +++ b/images/callouts/6.eps @@ -0,0 +1,284 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: (ImageMagick) +%%Title: (6.eps) +%%CreationDate: (Fri Nov 5 11:45:41 2004) +%%BoundingBox: 0 0 12 12 +%%HiResBoundingBox: 0 0 12 12 +%%DocumentData: Clean7Bit +%%LanguageLevel: 1 +%%Pages: 1 +%%EndComments + +%%BeginDefaults +%%EndDefaults + +%%BeginProlog +% +% Display a color image. The image is displayed in color on +% Postscript viewers or printers that support color, otherwise +% it is displayed as grayscale. +% +/DirectClassPacket +{ + % + % Get a DirectClass packet. + % + % Parameters: + % red. + % green. + % blue. + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/DirectClassImage +{ + % + % Display a DirectClass image. + % + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { DirectClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayDirectClassPacket } image + } ifelse +} bind def + +/GrayDirectClassPacket +{ + % + % Get a DirectClass packet; convert to grayscale. + % + % Parameters: + % red + % green + % blue + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/GrayPseudoClassPacket +{ + % + % Get a PseudoClass packet; convert to grayscale. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassPacket +{ + % + % Get a PseudoClass packet. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassImage +{ + % + % Display a PseudoClass image. + % + % Parameters: + % class: 0-PseudoClass or 1-Grayscale. + % + currentfile buffer readline pop + token pop /class exch def pop + class 0 gt + { + currentfile buffer readline pop + token pop /depth exch def pop + /grays columns 8 add depth sub depth mul 8 idiv string def + columns rows depth + [ + columns 0 0 + rows neg 0 rows + ] + { currentfile grays readhexstring pop } image + } + { + % + % Parameters: + % colors: number of colors in the colormap. + % colormap: red, green, blue color packets. + % + currentfile buffer readline pop + token pop /colors exch def pop + /colors colors 3 mul def + /colormap colors string def + currentfile colormap readhexstring pop pop + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { PseudoClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayPseudoClassPacket } image + } ifelse + } ifelse +} bind def + +/DisplayImage +{ + % + % Display a DirectClass or PseudoClass image. + % + % Parameters: + % x & y translation. + % x & y scale. + % label pointsize. + % image label. + % image columns & rows. + % class: 0-DirectClass or 1-PseudoClass. + % compression: 0-none or 1-RunlengthEncoded. + % hex color packets. + % + gsave + /buffer 512 string def + /byte 1 string def + /color_packet 3 string def + /pixels 768 string def + + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + x y translate + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + currentfile buffer readline pop + token pop /pointsize exch def pop + /Times-Roman findfont pointsize scalefont setfont + x y scale + currentfile buffer readline pop + token pop /columns exch def + token pop /rows exch def pop + currentfile buffer readline pop + token pop /class exch def pop + currentfile buffer readline pop + token pop /compression exch def pop + class 0 gt { PseudoClassImage } { DirectClassImage } ifelse + grestore +} bind def +%%EndProlog +%%Page: 1 1 +%%PageBoundingBox: 0 0 12 12 +userdict begin +DisplayImage +0 0 +12 12 +12.000000 +12 12 +1 +1 +1 +8 +FFFFFFAD5229294AA5FFFFFFFFF74A00001829000039E7FFFF4A0000A5EFE7C6080039 +F7AD000073EF1818EF390000944A0000C6A529390800000031180000E7EFCECECE100000 +08180000DECE0008EF730000084A0000BDA50000CE84000031A500006BEF2121F74A0000 +8CF739000094F7F784000029F7FFEF3900000808000029DEFFFFFFF79C390808318CF7FF +FFend +%%PageTrailer +%%Trailer +%%EOF diff --git a/images/callouts/6.gif b/images/callouts/6.gif new file mode 100644 index 0000000000000000000000000000000000000000..4eed9045f360dacf135b5d5a3ad4f7de2d08a655 GIT binary patch literal 917 zcmZ?wbhEHbd-onYcI@1_bJwn2yLa#2^XJdszkmPz`}hB& zU^E1VNC@bFasVhVFmO~cSaM8Ru)v{_MUaK-&IAUA21ZsHxf2Q-6dO3Cj6ygV9voof zRAjP`D rftitsN7m{_fzW|wUg=3p8XFp$PtMWjP6*h+*mRnKZ5bC22ZJ>L^-KDx literal 0 HcmV?d00001 diff --git a/images/callouts/6.pdf b/images/callouts/6.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9e09a3e64022effdcfb40af8317b175595e15802 GIT binary patch literal 1485 zcmbtUTWB0r7*3+};UFTILR*C#k?1yQa^}qJEolszY&OJn+hulx#?6LIcTYBx&d#JW zXJOMyH26|eycD5OlZc87im?ykLs}YW!D36&Ac9EIRM1`oTUXMcul{GU$u=8&5Ql-C z{r<~*=l{QN>Z74>6Kz&d{Wo{t`55`IgssD)sI840U}lDoU_T%#3F`)DHYQ<1<1EBd zR+_c9BZu2e%cA^DV_f=HiAz;4cxGo7`>qt~(x1IMxYYOQ(8$B5-}vtQj$=FUkTF`V z-nn_TP<(Q(xLl}vG=8yAtbS&;W@hKU`L&g`6?=XySz{P$4^62t`MuuNleLdTCR$TJ7`?<8NJ$oxeYEb52=kT(~v0{K~=U!pq6vy`^W* zeE(7L@vq1S{lDCPYNG4L^6_h5_Ptt@n7DJ{%Bi31efaA?7bY+FI5*BL6=sWX|JHc6 zA%FD8Yr`wcWcQ^#xud^-vH#q_b31F!J^xtMuDQccGc#S93_OWxiW!PuIUu7F=gwv~!8o*=M9OnS1= zqXP=M^1M67VNsZhJ}QD$kxt9x(8j@H#V%B0BKoec91}qWyIdShdiAt}6G$*sQ4&Lk z9MGVmTd9<8mX<0zHLe*}W~0SA<#K+@*8DP2a!|`MqPCE@N_x^jQ|IHPqZwv6EYU>WKOH)EqRftI*)fCRAR;mS7)!`Le{#bt6i98F;>gIZ>s3{ui?3IU zd2LmMIN1N=w9fB8Qc4X8O4V?0rzDptfv(cI6tg|u(F3@9#B#Wkvh^{JgUu4%3t9r( zi;;yuW1di}EJp(w6%g8}YuW@8Q@ z?d>I%ILrGiT1)wQIL--MV-0-fP#cJ%9fE{rmUdzkmNf3PwX<$cBIpC#Lmvdq7e|1 J;K0CO4FEWT`ttw) literal 0 HcmV?d00001 diff --git a/images/callouts/7.pdf b/images/callouts/7.pdf new file mode 100644 index 0000000000000000000000000000000000000000..78efe1bd3ba6b3733426294e48aafb62348ff3bd GIT binary patch literal 1479 zcmbtUU1%It6i%uJxfBH(!3UxDCA!rn_uk#i?k1)|lg)n~Qthg7V%l0qo-MOG=bFaDtvwNP3^L{Kc!XkZfxDh1D-Y_d(F58^Pe zv)?)Ao9~|UooR?iqK&L6fEqqueDyt~V2bTSBdD#7^l~dJaySTxN}`4-xPwX5)C7<4 zjIHzbcH|0&Yk4#_^Kg=W6G+mU$9yMez8d(VxKls<+7n+7%ns#le{1TykLxDt@Q^uD zt6uy0%i_}gb4wSCJMT(fC@$4LaB|zsy}L^*3o8pwX(heQG*@mrt|t5^_Lg6)-yWN6 zExV7q%f}~2ep@WHrRyL1W%fp6eXEXtEZ^+YUpn*cD?56o_kVa}yg2*&-HVF@zs?uB zX!(Qb%l((%cx3wZ{XZ<6|LD>_->Kd|=Ld~Pq+|nyOfhXBV***E|4+c>MYOc08IX=os zT+4D2Cr)^A;w8ZHx9{nlYveZhrOr% zcnmX=h+*19{Z(G?m=(jSEl9pbtwv>OCAezfTm6ejv|wd~VO!qWDIyU&uNhW~A_lEg zH7mKF_W(Eo)>B5AK4Zq#;ZWc&Lewx`4E|S6nvc z@L>e&zz|)(a8OYK3LeI5m=c7R$_ra-7^8j|{YH!`bSoAJ!J2H!qYUDskxw{G3KckkX~$BtdQcJ1E1d(WRgfB*jd_wV2TkAl$<7*Zji z1IhuQyuiRw!C=bKvtR)OBdY)l*O3W8aYhyyxg81ujm{imT0Q~{2OQWq_=Hm)R4i;f z%+AZGAR)=X%-qh#X2GKH(CHWhAM**84GPUoEPBPuS_}>*wk(o$WXfnb_<)sN-86#d g!vm%^b_?6A1dHNlj67VX4jv8-3{5Re%uEc{0FL(f8~^|S literal 0 HcmV?d00001 diff --git a/images/callouts/8.pdf b/images/callouts/8.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ad5d6f3097a2d0a3e624bbd81efdda6f0b74900d GIT binary patch literal 1487 zcmbtUZ)h839B$^=hu1m(P<4p7cONR5Tl3zV%O&XyRogV7>*B&C{ZP_K&*W`#S#lTd z-pp*n%^@mmpc6$9Iz*v!lR1Rp+O6B%xBaUkgCPaGFN#Cg5v<+%L8|`VYuc^uu9Im;ZJ+f-(@hzh>lQWan=uCQ5u{iUMuiZ#&JpABl*ZFty*O`&6&jy~vJjE2nuQ%XB zb;#Ekb#ix^k+_y)B*wD3)?rq0N`f%;!ktDCvY5fKELMSt%51Y@Wta_1id$wT!FYf(9 zs-iT84i%t5MYnn>T`a9vc4}NJnz@A*^OPI;ZAip@@xgBR#LMxSv3nEC; z!WZ9giFqwmggDs$<229jKT^sJ2ud!vS5opeD1olBl?=1o(fD>8&6_s2GnQWFIOvh+ zCeRWXUyLja8gqxYdL_w6siaWqQ+zVSV`lc>LQbh^x%=IYTw_{J&+P2q1Vu@m7a8C| z4=dY%w71t)R<+n50y|J7Ene8KD6)bF@dBmoR@87@w{{8#^Q7{?;Ln;Jx zKsf-E7Z^Bd7)&{)ELgz6$SP#Sab*G{BLf2yi;Yc#V*(Qcqe{pQfy5*>PJZbK4g-b5 zP3;1DOdSkD4y}C*d^{B|5>h<5_&x1J92gI`atjw(osm>W8-(SeDVUC!== lfM^2?uY`n+&H{nv#yR|q5*s!IFtac-F-gqOGEiW!1^`9E^gaLp literal 0 HcmV?d00001 diff --git a/images/callouts/9.pdf b/images/callouts/9.pdf new file mode 100644 index 0000000000000000000000000000000000000000..756251ca16cb351029beddabda24a0c396bb8de9 GIT binary patch literal 1488 zcmbtUU1%It6i%uJdo9w33atvgAhEk@_s*T&+0E9l(#>W=f3{s`H+|@KOD4N_Hj7jTf%JegY|2!d7QDYHlXGnOWprI0%SJ;<~|^jY-_l zIE%5Im1mI%a=6X366zm&GA(`MPfK;%J>z3D?NjB=`H43Ue${@mqwC($k&CAr1{!dO z(Os|pdiBfl{G;#Ae_h`EVESBnzW(v?HDeDwHMuamFl$dPWY-wR!aax8lzep8%_AGu zC5E@%bapzo4i9(VxIWpO-SEV<*WO9JWyNe>-^frAXlT)ZFhA>!0xHR(i~WchKe?d zryNpH1qxJqoj%mdNKz{@l3;mVi(36SBSDzTaAy&OY-V!o7qdV_WscQn=a>UiO4?Q~ z#dwCm95LBZf*MgsXzk~1DGsy3RMb%sOpCNwCWkT(7E^Yi3KLOxaq5@|D%j=XV6sck zJ2-;`Qx#<~ROka5R8*^^(&f}jW{bu(!zwP7SfpItA6~h?N|fx;N{pysl2*x%JkZqn zArfuFA@Oa}-lF0rceOW}z?7sCSn^47wXS>2igML35}#44QIT2+E-Lw-LPjLsXXdzW zneN#oL}FG+)6I;8D6~@5%p%KdrS3~q=T4H@DXr9NFx-SlN*`buSqWyB{6c}$vM+kN zHeRl)i=BJ9Ui53FBE-S|AE!lr|B+IzLr|)Rdo?AwN(pq8@5?dU)0W(g+qx`=J2_kL z<+#ZwQ7>o-oG)4y1C4oN+hj=!P%0^u29!Vm;t4DNZy`6;vONbpu3QsZQP1@p@Iq2r z=LQ2j>|?zSAdyH#W&JiQAg}{P((;9aisDyr0WV=n2uvm}Y%XC`@ + + * Makefile: image converstion make improvements; if you want to tweak the image conversion stuff, do that in Make.images and that will affect the subdirs too; also, a clean rule + +2001-12-01 Norman Walsh + + * .cvsignore, Makefile: New file. + +2001-04-02 Norman Walsh + + * 1.gif, 10.gif, 2.gif, 3.gif, 4.gif, 5.gif, 6.gif, 7.gif, 8.gif, 9.gif: + New file. + diff --git a/images/caution.eps b/images/caution.eps new file mode 100644 index 0000000..3f4b400 --- /dev/null +++ b/images/caution.eps @@ -0,0 +1,553 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: (ImageMagick) +%%Title: (caution.eps) +%%CreationDate: (Fri Nov 5 11:45:35 2004) +%%BoundingBox: 0 0 24 24 +%%HiResBoundingBox: 0 0 24 24 +%%DocumentData: Clean7Bit +%%LanguageLevel: 1 +%%Pages: 1 +%%EndComments + +%%BeginDefaults +%%EndDefaults + +%%BeginProlog +% +% Display a color image. The image is displayed in color on +% Postscript viewers or printers that support color, otherwise +% it is displayed as grayscale. +% +/DirectClassPacket +{ + % + % Get a DirectClass packet. + % + % Parameters: + % red. + % green. + % blue. + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/DirectClassImage +{ + % + % Display a DirectClass image. + % + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { DirectClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayDirectClassPacket } image + } ifelse +} bind def + +/GrayDirectClassPacket +{ + % + % Get a DirectClass packet; convert to grayscale. + % + % Parameters: + % red + % green + % blue + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/GrayPseudoClassPacket +{ + % + % Get a PseudoClass packet; convert to grayscale. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassPacket +{ + % + % Get a PseudoClass packet. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassImage +{ + % + % Display a PseudoClass image. + % + % Parameters: + % class: 0-PseudoClass or 1-Grayscale. + % + currentfile buffer readline pop + token pop /class exch def pop + class 0 gt + { + currentfile buffer readline pop + token pop /depth exch def pop + /grays columns 8 add depth sub depth mul 8 idiv string def + columns rows depth + [ + columns 0 0 + rows neg 0 rows + ] + { currentfile grays readhexstring pop } image + } + { + % + % Parameters: + % colors: number of colors in the colormap. + % colormap: red, green, blue color packets. + % + currentfile buffer readline pop + token pop /colors exch def pop + /colors colors 3 mul def + /colormap colors string def + currentfile colormap readhexstring pop pop + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { PseudoClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayPseudoClassPacket } image + } ifelse + } ifelse +} bind def + +/DisplayImage +{ + % + % Display a DirectClass or PseudoClass image. + % + % Parameters: + % x & y translation. + % x & y scale. + % label pointsize. + % image label. + % image columns & rows. + % class: 0-DirectClass or 1-PseudoClass. + % compression: 0-none or 1-RunlengthEncoded. + % hex color packets. + % + gsave + /buffer 512 string def + /byte 1 string def + /color_packet 3 string def + /pixels 768 string def + + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + x y translate + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + currentfile buffer readline pop + token pop /pointsize exch def pop + /Times-Roman findfont pointsize scalefont setfont + x y scale + currentfile buffer readline pop + token pop /columns exch def + token pop /rows exch def pop + currentfile buffer readline pop + token pop /class exch def pop + currentfile buffer readline pop + token pop /compression exch def pop + class 0 gt { PseudoClassImage } { DirectClassImage } ifelse + grestore +} bind def +%%EndProlog +%%Page: 1 1 +%%PageBoundingBox: 0 0 24 24 +userdict begin +DisplayImage +0 0 +24 24 +12.000000 +24 24 +1 +0 +0 +256 +000000 +080800 +101000 +181800 +212100 +313100 +424200 +5A5A00 +636300 +6B6B00 +737300 +7B7B00 +848400 +848473 +8C8C00 +8C8C73 +8C8C8C +949400 +949473 +94947B +9C9C00 +9C9C73 +9C9C7B +9C9C94 +9C9C9C +A5A500 +A5A563 +A5A59C +A5A5A5 +B5B500 +B5B55A +B5B563 +B5B5B5 +BDBD00 +BDBD63 +CECE00 +CECECE +D6D600 +D6D6CE +D6D6D6 +DEDE00 +DEDE31 +DEDE39 +DEDE42 +E7E700 +E7E731 +E7E739 +E7E7E7 +EFEF00 +EFEFEF +F7F700 +F7F710 +F7F718 +F7F731 +F7F7F7 +FFFF00 +FFFF10 +FFFF18 +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A +2F313A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A240D1B313A3A3A3A3A3A3A3A3A +3A3A3A3A3A3A3A3A3A3A24122B1E17313A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A2F0D2B +32341F1C313A3A3A3A3A3A3A3A3A3A3A3A3A3A3A240D35323232321F1B313A3A3A3A3A3A +3A3A3A3A3A3A3A24122A32322C3032341E1C313A3A3A3A3A3A3A3A3A3A3A24132A32321D +05082C32381E1C313A3A3A3A3A3A3A3A3A24122E3232320A00031D3232381E18313A3A3A +3A3A3A3A2F0D2B323232320A00031D323232341F1C313A3A3A3A3A240D35323232323214 +02052532323232321F1B313A3A3A24122A3232323232321D02062C3232323232341E1C31 +3A2F0D2B323232323232322303072C323232323232341A203A311C1E343232323232322C +0309303232323232322A13243A3A311B1F3232323232322C080E3232323232322D12243A +3A3A3A311C1F3432323232250B112C323232322D10243A3A3A3A3A3A311B1E383232320C +0004213232322A12243A3A3A3A3A3A3A3A311C1E3832321904062532322E16243A3A3A3A +3A3A3A3A3A3A311C1E343232252C32322A16243A3A3A3A3A3A3A3A3A3A3A3A311B1F3232 +3232322D12243A3A3A3A3A3A3A3A3A3A3A3A3A3A311C1F3432322D10243A3A3A3A3A3A3A +3A3A3A3A3A3A3A3A3A311B1E382A12243A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A311C +1A13243A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3120243A3A3A3A3A3A3A3A3A3A + +end +%%PageTrailer +%%Trailer +%%EOF diff --git a/images/caution.gif b/images/caution.gif new file mode 100644 index 0000000000000000000000000000000000000000..9cc2e1557447e9252ead07200617c2d56be4ed6f GIT binary patch literal 1039 zcmZ?wbh9u|lwgox_|5Sh{s9!`7`) zTel`}-MV$}UWUDUlh2)FICt*cwQCI5t^vtw_wF&=yJvXsp5?uJPS2k+Jb!NZ{JG`x z=g;52XL$eq{rB$--@gld|1RgdJ(|D$SrA+HAyGpqN^7x16zrMq{!ibMp=6~-(4c99<%wR z=lEzgH#IP+?pT$g`C;jexlBBNo_IO0=v$GV+9Oerpc~DrP;%tKgT`Z#V$4EkL{=v; zaW)#7)%@r_aPX#>5Fh`Y-v{$g32`gkn0k?^DW$2?_JPMq28Kof%}^J&9pNUYcvyH^ zranA$=y~&6-RTjl4}Cj!q>vpuB$~!J1eybAnu8K(Ep1_~ zv_^yQ0!LHDNU3+K5j!t4V#8)is=a{)r+x9(Z`XW$cEOH3>+to<8V`;t8wK*5c7$we zIpgb^xGTQpj}yN5F~;M*uBdmahkM7p*ATiMy3RF(%)=dy(1>!;tKKJ6L#0xRmbo2NL({6Wn+~TITw%?Z@z0%-b ze9K$uA>Z!lNH*5hKAY)&Sc@6#^NsYI@9+gDQlO8bV~_gA*0D=4NqE>3d9 z{WR;rg^J%M6ntQ-xU4(9`r^6fn$D7BWs}Acd>T-GdSKPwJ*w*Z%SXJMj%D>`T>RBO zmanjE45ERfMWMMFMB?JRU3p8;jh(l>^<6(HwI`od84Nu;Z(hPzKR!2or$RIP-r>=b zrc--&ZEmayTrx~rGkRnckd7QhJFOAr!8=i{qDI44LXJcr`GAm(?h+c+Q#Kma(N=~^ zVM~DtgJD7rPcs5T9PJcR3QYpgImNI?DlC{)Dx@0( zXaso`qIBL)VOo|Z$eZ$L)j0IASh_4|BqGD+z*f%C#oDv9{=5ksDhINM5jv=U)Ev6W! z2}5wWl_ce~(WXQ^{E)&3yq@L^RB?%e1}X$KFlDrfP$ZfAhY=1*Js&zn_SY^C8>apK zizsow1}j2b*#G0y$L~KdNY}(3~V)KM$naSzh2R98)3yl@!A# zLoLCvDsGt;YD}V?Mqrp6$1w$t%M~&ujO$qIzlFl3EGNm4gypKEY>cHSXEH1@GJ=DK zxP@|wy`^*s4{?nqqP0?vEc{m{(ieYMKkHLAES_v&N7{jro7xDy-VjMIF|8F3yF1TKR lk}L~-CyE-H+*!Z^@l%B@%nKAJgm(s4$Q4LJ!mP|RXy}<-Pfit2&px)3vi@}Ecoi+!6qxs r(ZS&8c(6lQJMIjJqGMAJzuvhVhQ!S+Y#bZ9V$SZ``nrvgk--`Oh`uWh literal 0 HcmV?d00001 diff --git a/images/home.pdf b/images/home.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3fc4ca9acde9418d7277b8d32b400fabd396d0f2 GIT binary patch literal 1768 zcmbuAeNYr-9LJ#;XMAcX8Azu=c*+4`Kz8?zJ2*k817R3>x%TeT@xa*bo`Z$EU1o2Q zmr|TjoAL$C3X%*e=EzK&5J{wh3P(UhKqo~=D~4hmUM?Vp42qsT4iTLGXxh1%+xz}r z_WL~h`8^k)iBH%-g~>rc>&TIhfC7?`e>n$4M-$12%M!Dp5-T*3z*0X9)Uj1?4~2+@(osKb_9}*6yfrl(pC$UYW*ff6dz!$Bw5Td$ z;A&TJXJ^QYVYjoB2lpgLMTMoU-hV(<5a+!sNI@ z2z9YtLi?M&V@3Nqr+aEUOK;RQb=Ahs4qQDUOtyLzc+TFMn=2W0yfXK7N%=PGJN@GD zs|D>9O>M_R^3U&XGG*sj=0ddttD8bEz7PrV=~`s4A| zrvl60yA(aRsk#dH;)s=mxY7g}{qzvynHQl-XN_3T1Oj={`Z1YyGCFZrY$)!~d>6?5Wx$xYRZg+g{ zRwK^jA_m_{lu2w!-wK5cxTNq!0Ch!qh|n-uh)6*umQnMC&_Lp_TmdOX2EZW!aUzsU zfC7R>Ha=f4A{$0mBk)Eo5)A}~8xl!Y+#?PbY%UZNwIT)>Qc@opV1$V{o)d8!8eH;xVop))P6i5-;6i9}Vvc~WX&Ybg=Z!v3G9d4K=Wk}*@V zcNTaqnW!d#j1jYtSe)Fi{iY~Ci?i~^e{!pJa^3dStq<51eNc+6N({6-l`hEo)& zpr~+#JOam4c+QF61hrlLqdTZ7qs13C5hX*$y=!w3;|IUwr3)SH!wg^m z0sBxCMbk9HFwtm~Wm%4ka~zjSrFfnfgs3PoqR5M)C`p_oNtp~U%d(;-M;tE#f9 zs+uNf+Fok9F6g?b>$0xvh9Me;Vi=lX>~#ae5QHp*5`;2@3WO?zdm}W>lxgy&shXx~ zS(If7mZeyhZdsOXQ?@PGwp}P>3Wb8>Fpk4Jj_5d&<2VQbghB|#5n>VI5keSK7>6*9 zVjRaA;j~5=TV+VdtS)<&%g9QY~O%= z7XY;j7OA?6w;v|56*Y~ecdHNb{&1LE9ljn)G_}UYz~-EotgVY}Evz?ZbCE%Qe&E%) zY<}V(Oy|F(jSa1@cPY<)JylahkCjRbnG=tz+Xi_6x)c0VUzb0)6sbtP2s}RmMz18R z#yc*TK8D9{lr@NK>{~dzUJUjgP1jDAtyKs62bXCuv{Gz3-%{Fm-EzR^i|kg`ckLv7 zzNW*6>`rHW+}9atUH-GWQhsux=hmH1zqW%j>^6Gy!C1?^4Sufw?!N}7=rbeS(9Nw} zU#xlJ{Z4l=S6+E~dQ4iVh%N(IsEk7bujdi{JK_xb(q^ZEYF z19*P6n4LXj-rRrSG{l8bn2d~p+})84gi^*t!;S#K5kI+tAt)H}Q-~RYM@UF1;pqv{ z3`L0Jpp<;;AoP}f5NhCMsmgB+zFKG|J$rEL_24rRQls2mw`=C4&4DA7(GcGIT* zyl{X2rNIryQi?D)U!wW)`Fov6St(uhuGBRkLDqKiweM3mYmKJ2`D*5#&Izt|++EWb zvLKr-AAZ$;&!S_KiG;Rm4{PX4zpN%KoJ#+AHlp1ple+!kjYW%r4CdSAJ4IUD1Cp(I#5eV56yv^eg#h zuF@m@WbT4u#J6+_^@cdLg?@8rjGL5QbTzU1z-zNfZ_SJ72y|_3>dGy+`%Dv0VZfy@8QEH6p>nynEJ^1aOBAQodT}HS3 zHG1*U{l>?9v)%OO;NZBl*oVJo7ANDa*|m4}j}1LMqTOUtJa^vm7PoWqbq71D)kte@ zm0FX2Zr{z(;mf;m+_N&*d7^B*QFAJ_`f#$(Pp{fdkNQt!2j-mI3Ta(qs+xMc-pwxg zO0_jKW<|xyRShu@Vz(8Q6kWRjiAf6 zYkpt%Z*|MZp8txJSE(yrWQTW#iUV8eu_kVpU9E9~%b&HC(xi@w26e!pu%20qhe_HU zOO9OAWp~CDm1zULx-zX7HXlD`-rucB9Uq8YU0^QkDcMVGN%sh;d=u9+Iz)+)fr4UV z6QqC}DsdfC+?~CmzN}}mbXngH&qrM z@A5`R`0JY-+P^d15h5VVa~@GIgFb&^5TXbr1KYF4gb_*6e$rBj0gdy zhLN>#pob4A@J(U(LIxNY#@IeM1gwkrkV*!$p<&kYI!Moi?K?RFV1%Ut>$uP`vR*Ew zVG+bK#i4K*bVvj=Ft(e%6q_p5SNezo!pKRbZtW<9@W?o^Tq!~!3~VJXR>}yGEvEb9EobNef)a}3;uQq!3?V{!8X@9v z9mC%bPYjTn8j`WmCU*=Bcnv!Z+5MWS2zFurkJBW-|42y^!BR2=_otLN)0BX&q=^!O zvg8MBfceoR&Cn7`9?!teb||(QXbBtx?3VF>#w>ZR929lHFqDg74qSUD5Eqcre+%hK zNy;+JQYTk|SSFXmhOGugL2^bx09+myPg0Cn$=DI`G>CY5>eZG)5m68dV;F=^U9cmU zYtMzFU_AzC08z3RtenEQj$mycVW`6=80vxotjdgxQa!GcnDGDMq(5m=gz_ K>gK-we$YRym<4$N literal 0 HcmV?d00001 diff --git a/images/next.eps b/images/next.eps new file mode 100644 index 0000000..ab7f37b --- /dev/null +++ b/images/next.eps @@ -0,0 +1,551 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: (ImageMagick) +%%Title: (next.eps) +%%CreationDate: (Fri Nov 5 11:45:35 2004) +%%BoundingBox: 0 0 35 15 +%%HiResBoundingBox: 0 0 35 15 +%%DocumentData: Clean7Bit +%%LanguageLevel: 1 +%%Pages: 1 +%%EndComments + +%%BeginDefaults +%%EndDefaults + +%%BeginProlog +% +% Display a color image. The image is displayed in color on +% Postscript viewers or printers that support color, otherwise +% it is displayed as grayscale. +% +/DirectClassPacket +{ + % + % Get a DirectClass packet. + % + % Parameters: + % red. + % green. + % blue. + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/DirectClassImage +{ + % + % Display a DirectClass image. + % + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { DirectClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayDirectClassPacket } image + } ifelse +} bind def + +/GrayDirectClassPacket +{ + % + % Get a DirectClass packet; convert to grayscale. + % + % Parameters: + % red + % green + % blue + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/GrayPseudoClassPacket +{ + % + % Get a PseudoClass packet; convert to grayscale. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassPacket +{ + % + % Get a PseudoClass packet. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassImage +{ + % + % Display a PseudoClass image. + % + % Parameters: + % class: 0-PseudoClass or 1-Grayscale. + % + currentfile buffer readline pop + token pop /class exch def pop + class 0 gt + { + currentfile buffer readline pop + token pop /depth exch def pop + /grays columns 8 add depth sub depth mul 8 idiv string def + columns rows depth + [ + columns 0 0 + rows neg 0 rows + ] + { currentfile grays readhexstring pop } image + } + { + % + % Parameters: + % colors: number of colors in the colormap. + % colormap: red, green, blue color packets. + % + currentfile buffer readline pop + token pop /colors exch def pop + /colors colors 3 mul def + /colormap colors string def + currentfile colormap readhexstring pop pop + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { PseudoClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayPseudoClassPacket } image + } ifelse + } ifelse +} bind def + +/DisplayImage +{ + % + % Display a DirectClass or PseudoClass image. + % + % Parameters: + % x & y translation. + % x & y scale. + % label pointsize. + % image label. + % image columns & rows. + % class: 0-DirectClass or 1-PseudoClass. + % compression: 0-none or 1-RunlengthEncoded. + % hex color packets. + % + gsave + /buffer 512 string def + /byte 1 string def + /color_packet 3 string def + /pixels 768 string def + + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + x y translate + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + currentfile buffer readline pop + token pop /pointsize exch def pop + /Times-Roman findfont pointsize scalefont setfont + x y scale + currentfile buffer readline pop + token pop /columns exch def + token pop /rows exch def pop + currentfile buffer readline pop + token pop /class exch def pop + currentfile buffer readline pop + token pop /compression exch def pop + class 0 gt { PseudoClassImage } { DirectClassImage } ifelse + grestore +} bind def +%%EndProlog +%%Page: 1 1 +%%PageBoundingBox: 0 0 35 15 +userdict begin +DisplayImage +0 0 +35 15 +12.000000 +35 15 +1 +0 +0 +256 +008400 +108C10 +218C21 +299429 +319C31 +429C42 +4AA54A +52AD52 +63AD63 +6BB56B +84BD84 +8CC68C +94CE94 +A5CEA5 +ADD6AD +B5DEB5 +C6DEC6 +CEE7CE +D6EFD6 +E7EFE7 +EFF7EF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +151515151515151515151515151515151515151515151515151515151515151515151515 +151515151515151515151515151515151515151515151515151515151515151515151515 +151515151515151515151515151515151515151515151515151515151515151515151515 +1515100F13151512100F1315151515151515151515151515151515151515151515151515 +151204011315150A0A151515151515151515151515091115151515151515151515151515 +150A040415150F1015151210151515151515151505101515151515151515151515151515 +0A13020915100F150F070F0413070115080C0D02070D151515151515151515151515150A +1511010E0F1015041315051115040A0A1515051015151515151515151515151515150A15 +150E010C1015000A0A0A12151000101515051015151515151515151515151515150A1515 +15070010150212151515150A0A0415150510151515151515151515151515151306101515 +15040F150A071512100E0F15040B15050A1115151515151515151515151511100F131515 +131315150D0A1013101113100F13110A1015151515151515151515151515151515151515 +151515151515151515151515151515151515151515151515151515151515151515151515 +151515151515151515151515151515151515151515151515151515151515151515151515 +151515151515151515151515151515151515151515 +end +%%PageTrailer +%%Trailer +%%EOF diff --git a/images/next.gif b/images/next.gif new file mode 100644 index 0000000000000000000000000000000000000000..8c502e740a7380015fe62b5c8c02a71e64e87a11 GIT binary patch literal 964 zcmZ?wbh9u|RA%63_|Cw<(83_lBcRx$s5wQ`aE_tV94D`(UO{VvlGi3@Z_RGm+tPEa zXUe%LOV2G`du{F3ds~m)J9h5*xohvQJ%9iF{rC6(N5N*-O!NFz@VXc@G8x|gJ5|Hx|&`^AIq@7DufTJL=k*SSS$s)v|q2U0#fW|VLhy+z< zR$&&E6#^R%H8b;b_*e)mU}9q9Ws%9a@FBT{fiEEJLgc~*4<eAwF5u#VYwR?e%Shb+u`oHi>KJaB03@|>=hvC84eAr3KCza2Lm7+W|6 WloX~(95gs~e1fv~yck6V25SH<^dGbU literal 0 HcmV?d00001 diff --git a/images/next.pdf b/images/next.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3a36b0a32f7bc1decc60d5a7721e26502df9294e GIT binary patch literal 1737 zcmbuAeM}Q)9LE8HEVoQI;|qUm>9b{IWh&2I%avB4+n|;)1nRZa%$BZ4`v51Uhu7;U zIFQ6Fb1n-G9Yh0|h-GsjE^(QOh&TlXPGHNB8K+Yh7{<-m3`}5-mpxYs70Lcsc4^Y< z_xEz&=jrG7T)aW2-$W%UiTK|8wZ{n>kbp1PMWm#_ZOC0D76TPl7^vr5A`$@9yI2wF zkb`$3t(NeJ0%A)EU*iT7`Ge9#M!X?!YP^!y=a)H89<=r6eQtLV^+qy!s6Dna7TDcv zG;??KvOn;An{4z!w_mo>^qoHtY3lO_*4$~cU-SoB1NB}0z-qgrMP@jBwC;$t?w#oR z^1<&D1_n07{tLwey)}OS zz2=0N9jixrS}omY>55)??}`sE)je!qpRnDWRdsw-`Ji@Y^1->kcc&f8YI}L^mDEGD zZx3qv#Qf85r-#q?Cf_@6`?SG)?MlUq+l%wAUQOMRDBdN1-n+N@wab(D4&N!ajGby` znbU9X?-`%&@*g@A|3F(%ne*3h?LbGyn$A>P;4^-jEV=c;{@JgSJ8Z{B?Y1v2GB&Db zxcJg&W9Eiy{X~^@TwhaluBEXheMmQwKcsHa-B>le*Ri&_{*f?tAclA*>)q*DQ=i5g zHPU{mx@p}?SAiE&OYZvN$a4QKV#0c)}HFDqFjH@csAZ_h}(6-Jl82q zu7JI5CuJ|0f7!FUI`;OCZwnea;AGrp`0$3}=$CViijkhl6OXnGK9?I6)A>R(H;{7u z!r0Ds-}G$tvHcUW3%90*%4*7IMt=O5H6C%Q1jTvn)T?RrsNrT)?y1_&lmk<<7pEJ% z^jBSVeC=6l>e{HYuRj}6ko9X6ayvsv;5!K;2_EU2R!~GpN(vKZswhLyz!o8xjhq~t z#`}PU#9<{3C_10OApyBXpp*zCAcH)-S8yN?X44?>4kHpR5Yr1_W-0EGjtjQ>#0;Z| z2?dnYhaoVdFr9acxQz!$YzL)~6RGb!>i|ktK+uZ^z%0(`0Tx1X$`JVgckp5xl+-O$ zN-dU#D$`k!b@4?DE#@tU^EFHJ!$x5aTZ$l~fhGoKIK@Mng!CVZu?VG!&el-^a(7fO@anA#%JsxOS3&I=+|52XJoIKLi|6~y4qP)SM+5g)%bS5N!{(5PNW literal 0 HcmV?d00001 diff --git a/images/note.eps b/images/note.eps new file mode 100644 index 0000000..8676af6 --- /dev/null +++ b/images/note.eps @@ -0,0 +1,296 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: (ImageMagick) +%%Title: (note.eps) +%%CreationDate: (Fri Nov 5 11:45:35 2004) +%%BoundingBox: 0 0 24 24 +%%HiResBoundingBox: 0 0 24 24 +%%DocumentData: Clean7Bit +%%LanguageLevel: 1 +%%Pages: 1 +%%EndComments + +%%BeginDefaults +%%EndDefaults + +%%BeginProlog +% +% Display a color image. The image is displayed in color on +% Postscript viewers or printers that support color, otherwise +% it is displayed as grayscale. +% +/DirectClassPacket +{ + % + % Get a DirectClass packet. + % + % Parameters: + % red. + % green. + % blue. + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/DirectClassImage +{ + % + % Display a DirectClass image. + % + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { DirectClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayDirectClassPacket } image + } ifelse +} bind def + +/GrayDirectClassPacket +{ + % + % Get a DirectClass packet; convert to grayscale. + % + % Parameters: + % red + % green + % blue + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/GrayPseudoClassPacket +{ + % + % Get a PseudoClass packet; convert to grayscale. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassPacket +{ + % + % Get a PseudoClass packet. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassImage +{ + % + % Display a PseudoClass image. + % + % Parameters: + % class: 0-PseudoClass or 1-Grayscale. + % + currentfile buffer readline pop + token pop /class exch def pop + class 0 gt + { + currentfile buffer readline pop + token pop /depth exch def pop + /grays columns 8 add depth sub depth mul 8 idiv string def + columns rows depth + [ + columns 0 0 + rows neg 0 rows + ] + { currentfile grays readhexstring pop } image + } + { + % + % Parameters: + % colors: number of colors in the colormap. + % colormap: red, green, blue color packets. + % + currentfile buffer readline pop + token pop /colors exch def pop + /colors colors 3 mul def + /colormap colors string def + currentfile colormap readhexstring pop pop + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { PseudoClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayPseudoClassPacket } image + } ifelse + } ifelse +} bind def + +/DisplayImage +{ + % + % Display a DirectClass or PseudoClass image. + % + % Parameters: + % x & y translation. + % x & y scale. + % label pointsize. + % image label. + % image columns & rows. + % class: 0-DirectClass or 1-PseudoClass. + % compression: 0-none or 1-RunlengthEncoded. + % hex color packets. + % + gsave + /buffer 512 string def + /byte 1 string def + /color_packet 3 string def + /pixels 768 string def + + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + x y translate + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + currentfile buffer readline pop + token pop /pointsize exch def pop + /Times-Roman findfont pointsize scalefont setfont + x y scale + currentfile buffer readline pop + token pop /columns exch def + token pop /rows exch def pop + currentfile buffer readline pop + token pop /class exch def pop + currentfile buffer readline pop + token pop /compression exch def pop + class 0 gt { PseudoClassImage } { DirectClassImage } ifelse + grestore +} bind def +%%EndProlog +%%Page: 1 1 +%%PageBoundingBox: 0 0 24 24 +userdict begin +DisplayImage +0 0 +24 24 +12.000000 +24 24 +1 +1 +1 +8 +FFFFFFFFFFFFFFFFFFFFE7E7E7E7E7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBDA594 +A5A5A594A5CEFFFFFFFFFFFFFFFFFFFFFFFFEFC68CA5D6E7EFEFEFE7C69494CEFFFFFFFF +FFFFFFFFFFE794A5DEFFFFFFFFFFFFFFFFFFCE94B5FFFFFFFFFFFFFFEFA5B5FFFFFFFFFF +FFFFFFFFFFFFFFEFA5BDFFFFFFFFFFEF94BDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF94BDFF +FFFFFFCEA5FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFA5DEFFFFFFA5DEFFFFFFFFFFFFFF +FFFFFFFFFFFFFFFFFFFFCEA5FFFFCEA5FFFFFFFFFFC6BDB5BDB5BDDEE7E7E7E7E7FFFFA5 +E7FFA5DEEFD6D6A58CB5CEDED6CE8C84A5A5A5A59494E7B5CEE7A5E79494B5CEFFFFE7CE +94C6CE73BDDEDEDED694CEDE94E7A5D694E7FFFFFFEF94635A4A527B94BDB5B5BDC6EFE7 +94DEA5D694E7FFFFFFBD7BCEDEDEA594FFEFFFEFFFFFFFDE94E7A5DE8CE7FFFFEF947394 +B5BD8CA5FFFFFFFFFFFFFFE794E7A5DE947BA5EFEF6B7BD6CEC67BDEFFFFFFFFFFFFFFE7 +A5FFB5D6FFFFB594CE6BBD8C7363BDFFFFFFFFFFFFFFFFA5CEFFD6A5FFFFEFC67B527394 +84C6FFFFFFFFFFFFFFFFEFA5EFFFFFA5CEFFFFFFDEE7DEE7DEFFFFFFFFFFFFFFFFFFBDBD +FFFFFFD6A5E7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCEA5EFFFFFFFFFB5A5FFFFFFFFFFFF +FFFFFFFFFFFFFFFFFF8CCEFFFFFFFFFFFFBD94EFFFFFFFFFFFFFFFFFFFFFFFCE8CCEFFFF +FFFFFFFFFFFFB594C6EFFFFFFFFFFFFFFFE7B594C6FFFFFFFFFFFFFFFFFFFFD6A58CA5DE +DEE7DECEA58CB5E7FFFFFFFFFFFFFFFFFFFFFFFFFFDECE94949494A5CEEFFFFFFFFFFFFF +FFend +%%PageTrailer +%%Trailer +%%EOF diff --git a/images/note.gif b/images/note.gif new file mode 100644 index 0000000000000000000000000000000000000000..7322e8e40bdc0c3f9f1a09786d42c012a6ab8b0e GIT binary patch literal 1070 zcmV+}1kw9PNk%v~VHf}y0QUd@000010RaL60s{jB1Ox;H1qB8M1_uWR2nYxX2?+`c z3JVJh3=9kn4Gj(s4i66x5D*X%5fKs+5)%^>6ciK{6%`g178e&67#J8C85tTH8XFrM z92^`S9UUGX9v>ecARr(iAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021EG#T7 zEiEoCE-x=HFfcGNF)=bSGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!-Jv}}? zK0iM{KtMo2K|w-7LPJACL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)WtPESuy zP*6}&QBhJ-Qd3h?R8&+|RaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5dU|?Wj zVPRroVq;@tWMpJzWo2e&W@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|dIaBy&OadC2T za&vQYbaZreb#-=jc6WDoczAeud3kzzdV70&e0+R;eSLm@et&;|fPjF3fq{a8f`fyD zgoK2Jg@uNOhKGlTh=_=ZiHVAeii?YjjEszpjg5|uj*pLzkdTm(k&%*;l9Q8@l$4Z} zm6ev3mY0{8n3$NEnVFiJnwy)OoSdAUot>VZo}ZteprD|kp`oIpqNAguq@<*!rKP5( zrl+T;sHmu^si~@}s;jH3tgNi9t*x%EuCK4Ju&}VPv9YqUva_?Zw6wIfwY9dkwzs#p zxVX5vxw*Q!y1To(yu7@dCU$jHda z$;ryf%FD~k%*@Qq&CSlv&d<-!(9qD)(b3Y<($mw^)YR0~)z#M4*4Nk9*x1lt)=I7_<=;-L_>FMg~>g((4 z?Ck9A?d|UF?(gsK@bK{Q@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF){QUg= z{r&#_{{R2~EC2ui02lxm000R70RIUbNbsCNg9H;Q6xgd2rBVHES(3_Ku{tyHgqN;d+?Tzju!Z);;TuQDVJwRQAHSkR)YFdrEO!v&XBk zJwOwl{a4GHz*-^KY@Rd5rovJavBo?tB{Lyo6k9@$D)OJx<0pIB#+rEO&f%|l4*kcd o_`qJ2pi}&6ogi$&oxc>r#EMbwId40)HiwBGBuL!a2L=QHJ43Vzj{pDw literal 0 HcmV?d00001 diff --git a/images/note.pdf b/images/note.pdf new file mode 100644 index 0000000000000000000000000000000000000000..796e43e08aec9a3f4859633a20cd64c9a6429d7b GIT binary patch literal 1686 zcmbuAeM}o=9LIqv>SfWOBf>W2@eicv*1M;rv_;m1mlZeYsMo@#^nbVN@IwA5l9m65cp{R>n(BOEP24o`0kTHC&6gnXOVZ2<@>-YEk ze)s)7&*#^M8x!^GpK#rI@qpAj84)ES zD`!JG9U+K3Vq8RF)stqbTWO~J;$+oTU1=BU!ffx9XML4+D#sS^YRR{s1{Mc`95#=j zhx$9~M%UJleq9%Kzxiz4sQ=^D0ad~48pnIbd-=xk%mAlzd_^g3QdA_5m91K7*cUS< zY!Ut}-M4dOxG^?!)f0p5Tj_dTJ?QS(*!#=NW_xK?-ZvHx!Na|I`B? zN?jW?@=DFe*W!A9y}LEE>458I+n%E>rq;dg6YYJ5hAzcx6@wwFJh|@OX6E}T_K}YL z*(q(6$D?b0xFWjuk9>LKt}gcj11DSB9xG1JOq4v`+{@7JEb^xSNGS?Mz`HfM%fKO1`e+;Bnq zfcu+23NkE2)#~ionbs?|tA^^87f(fMUnqFHso<@HgTn(SuF7xLwvSGg1sHRjF;i&uBJW z`-|&2ANj^?$b_9-*UwLw@9htW^V`wXT8LPi_k8h_#DqkG^ckh52(J|7!^K>bk4Ph9 zN2CGS985e{2rLv1E28k7N#GEVSP>{CoCuOe0_WzfNWh>OdCqD=qJ_jL0&=qp*NDdn zn+nAwlZbHxP^v={7&tP4V?|s>01~Jk$?HU_I|nWxB`d(=MF3>7!zKU=AvvXqOn@u6 zu?;9y^QOXuRBvViBQj3TK3`(avTwb1@p_+8ax3FPB&{XQG`ZP^Z92pvGCm2YrFWBQ z2{h1no>Gkl07;VpP;yG)tLtggJAAa3kX}RkqEf0iI5&)U<nT-KY#PWyn0Z8W_97x+^0RCz&0h z6Jed@L?lP~0v2^TFKC54$|WcOAwex%AX=qTsz5H7*VJmvqjUjwUV{oHZfmhdso`=> zrN)>qSw}%UDoZq#YMBNp%`%PBD)9*~$<;s%<`PXy-LX#O8HW?`_%8%_(8B!!lIA!( hbP~~c!r5F7Nay64UqNJe(X%s9snHPO;hR$R#6K3NM_B*> literal 0 HcmV?d00001 diff --git a/images/prev.eps b/images/prev.eps new file mode 100644 index 0000000..66d6904 --- /dev/null +++ b/images/prev.eps @@ -0,0 +1,551 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: (ImageMagick) +%%Title: (prev.eps) +%%CreationDate: (Fri Nov 5 11:45:35 2004) +%%BoundingBox: 0 0 35 15 +%%HiResBoundingBox: 0 0 35 15 +%%DocumentData: Clean7Bit +%%LanguageLevel: 1 +%%Pages: 1 +%%EndComments + +%%BeginDefaults +%%EndDefaults + +%%BeginProlog +% +% Display a color image. The image is displayed in color on +% Postscript viewers or printers that support color, otherwise +% it is displayed as grayscale. +% +/DirectClassPacket +{ + % + % Get a DirectClass packet. + % + % Parameters: + % red. + % green. + % blue. + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/DirectClassImage +{ + % + % Display a DirectClass image. + % + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { DirectClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayDirectClassPacket } image + } ifelse +} bind def + +/GrayDirectClassPacket +{ + % + % Get a DirectClass packet; convert to grayscale. + % + % Parameters: + % red + % green + % blue + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/GrayPseudoClassPacket +{ + % + % Get a PseudoClass packet; convert to grayscale. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassPacket +{ + % + % Get a PseudoClass packet. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassImage +{ + % + % Display a PseudoClass image. + % + % Parameters: + % class: 0-PseudoClass or 1-Grayscale. + % + currentfile buffer readline pop + token pop /class exch def pop + class 0 gt + { + currentfile buffer readline pop + token pop /depth exch def pop + /grays columns 8 add depth sub depth mul 8 idiv string def + columns rows depth + [ + columns 0 0 + rows neg 0 rows + ] + { currentfile grays readhexstring pop } image + } + { + % + % Parameters: + % colors: number of colors in the colormap. + % colormap: red, green, blue color packets. + % + currentfile buffer readline pop + token pop /colors exch def pop + /colors colors 3 mul def + /colormap colors string def + currentfile colormap readhexstring pop pop + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { PseudoClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayPseudoClassPacket } image + } ifelse + } ifelse +} bind def + +/DisplayImage +{ + % + % Display a DirectClass or PseudoClass image. + % + % Parameters: + % x & y translation. + % x & y scale. + % label pointsize. + % image label. + % image columns & rows. + % class: 0-DirectClass or 1-PseudoClass. + % compression: 0-none or 1-RunlengthEncoded. + % hex color packets. + % + gsave + /buffer 512 string def + /byte 1 string def + /color_packet 3 string def + /pixels 768 string def + + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + x y translate + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + currentfile buffer readline pop + token pop /pointsize exch def pop + /Times-Roman findfont pointsize scalefont setfont + x y scale + currentfile buffer readline pop + token pop /columns exch def + token pop /rows exch def pop + currentfile buffer readline pop + token pop /class exch def pop + currentfile buffer readline pop + token pop /compression exch def pop + class 0 gt { PseudoClassImage } { DirectClassImage } ifelse + grestore +} bind def +%%EndProlog +%%Page: 1 1 +%%PageBoundingBox: 0 0 35 15 +userdict begin +DisplayImage +0 0 +35 15 +12.000000 +35 15 +1 +0 +0 +256 +008400 +108C10 +218C21 +299429 +319C31 +429C42 +4AA54A +52AD52 +6BB56B +73BD73 +84BD84 +8CC68C +94CE94 +A5CEA5 +ADD6AD +C6DEC6 +CEE7CE +D6EFD6 +E7EFE7 +EFF7EF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +141414141414141414141414141414141414141414141414141414141414141414141414 +141414141414141414141414141414141414141414141414141414141414141414141414 +141414141414141414141414141414141414141414141414141414141414141414141414 +141414120F0F0F0F14141414141414141414141414141414141414141414141414141414 +14141409030F090212141414141414141414141414141414141414141414141414141414 +14140A051414030A140F140F141410101414141414141414141414141414141414141414 +140A051414020C10000A030F080C0A081202091410061214141414141414141414141414 +0A020A060A14140014121203141401140D06140D1214141414141414141414141414140A +0514141414140014140F020A0A0A141401120A1414141414141414141414141414140A05 +14141414140014141202141414141409070F141414141414141414141414141414090314 +1414141200121414040D140F12141202141414141414141414141414141414120F0F1014 +1414100F0F1414120B0A1213141410141414141414141414141414141414141414141414 +141414141414141414141414141414141414141414141414141414141414141414141414 +141414141414141414141414141414141414141414141414141414141414141414141414 +141414141414141414141414141414141414141414 +end +%%PageTrailer +%%Trailer +%%EOF diff --git a/images/prev.gif b/images/prev.gif new file mode 100644 index 0000000000000000000000000000000000000000..0894d9ecb26316a61e914879c48520cc8aee392d GIT binary patch literal 944 zcmZ?wbh9u|RA%63_|Cw<(83_lBcRx$s5wQ`aE_tV94D`(UO{VvvbSaz?=5cG+tPEa zXUe%LOV2G`du{Epd&kZ_KX>i@wde1jzyJRJ|0oy@fgv6OI>0Qz0Llvt98(!IIb=LG zEI8QAA*>a1V#7k`W+6F`nhzV2ni%sMgrT8{g_D_uZNY^D443EGIST1`39V>a$f&~eRijiP ybPlVqjKR$hN{*ZiRYDmKlawRc1?88Ba5ye<;N%wZnBfq<^#1+^W@{b}25SIMS`<+L literal 0 HcmV?d00001 diff --git a/images/prev.pdf b/images/prev.pdf new file mode 100644 index 0000000000000000000000000000000000000000..faf3cca2345898649a3504ac88afccae6de35c50 GIT binary patch literal 1693 zcmbtVeM}o=9EODO$1QP2AtQ#QuSNt!`rfq^+KrFM=U{Yn*AnAOfm{0mg>qN#u6%8p znat>%*$^0tK-6JD7SM&s3?NM76z15NEW!w~%w;mk*qVWgfCJwv1qQ@FjF(I9?)iP( z^ZwrFxeL-ICWljUB@xs=ec}|M0wmxL6cW+VFdeb^VgZQ62o001HWBdvCfgVhB_cCt zL9wxfAo7SQCdwMZ4CGa%f%JMYq_N>r=73XXX|2p2%=|RhM%3y_pKIN|6}}*sWqjy6 zw=X(ffo-ze_b)hQj~RY&y1WeoPM6=!w%l)=u4Y&5w@%j+x#lLBuI7WPx~!@kpW4zZ zL!p;1hxy+1>X15iAJM*g z^P^7=oq2aGrqlk%t-dEm&rP1ZF|qW;+`Sto`r+<{n4_k-hoe(7{LsYR?3{7ggYn@e zezLHoYrOF+_m(|YSZ*nuv;1}C%xGWzPLq&U@pH61e|P)f)#X25@9lX|qB+|z=>L6A zPWSWAwWhR*HKhj~=l0)Ue5YDdw^UrMFYP?i-Z~KoYoDq;JrJWz8Y>)0xw!r4Gilpr z%SW|o`wsYr*C^SNuPT=c_q@?~}iNzGHTz{#Z+0 zV_0f$?xE%S>99BFU;2`mp1SU`IdUFWU+em=o%zL;khA<5ZE-oot{i2td-S8}cxb`mX2~K#2-)a}faCW3>ptNJva+!US*! z2c|(u-8`k#TB)Zpfe{%Sm%rL#h4Om7W@G+3QMi{WMv&G(0}WFxn5I=Mhw&*ON_scU zOrU|X)1Xn!ys3i%Q>|o8Jm1Es&CkdFy z6*E@WND>qtCC#w;$QVw!AL6Z|phLW#DYn}XP!mvZtw2VFD$=y-d7>6ciK{6%`g178e&67#J8C85tTH8XFrM z92^`S9UUGX9v>ecARr(iAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021EG#T7 zEiEoCE-x=HFfcGNF)=bSGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!-Jv}}? zK0iM{KtMo2K|w-7LPJACL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)WtPESuy zP*6}&QBhJ-Qd3h?R8&+|RaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5dU|?Wj zVPRroVq;@tWMpJzWo2e&W@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|dIaBy&OadC2T za&vQYbaZreb#-=jc6WDoczAeud3kzzdV70&e0+R;eSLm@et&;|fPjF3fq{a8f`fyD zgoK2Jg@uNOhKGlTh=_=ZiHVAeii?YjjEszpjg5|uj*pLzkdTm(k&%*;l9Q8@l$4Z} zm6ev3mY0{8n3$NEnVFiJnwy)OoSdAUot>VZo}ZteprD|kp`oIpqNAguq@<*!rKP5( zrl+T;sHmu^si~@}s;jH3tgNi9t*x%EuCK4Ju&}VPv9YqUva_?Zw6wIfwY9dkwzs#p zxVX5vxw*Q!y1To(yu7@dCU$jHda z$;ryf%FD~k%*@Qq&CSlv&d<-!(9qD)(b3Y<($mw^)YR0~)z#M4*4Nk9*x1lt)=I7_<=;-L_>FMg~>g((4 z?Ck9A?d|UF?(gsK@bK{Q@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF){QUg= z{r&#_{{R2~EC2ui02u%n000Q;0RIUbNbsCNg9H;Q6nM^9DN3axLUeX-VZwX8CZ4;u zu^}Z&&MY#7=uMQzzXzjLK(DOA}@A62gx007pM9e9q?%bp7<-HvA!GFEE{U`SDUWKJX{{T literal 0 HcmV?d00001 diff --git a/images/tip.pdf b/images/tip.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9daad9a75e63d9ba626d73c1354f1aebcd876ee1 GIT binary patch literal 1641 zcmbtVZ%i9y7>AjV<)+NwbbcW4W)oM?argFr71=B;4H+HHwWzFR>+Skd&b4>t?mB@5 z&=2Yt1tl9eU@jSUbBJKFFpSfo5(bNmIKvVZ%@(yzlvp8gIzZ!lrO*NKgYnX&*WdF# z&;6d~`Tcr14omS)n6DvnMrT@15jsEt;o!4GK>=Bcc)wf?^cbPZVlE&f5s<|JMn)FI z3O-a=NJz4Xm>^Nx^@xl5T;rlro>ZOa`mB5`lI=VD+WztKx4k~1%}J?KU;iMjJ`H&J zYJ$G`!{taUvo|&o$xe5TMPjM0OOe=?8@=97BC*r4w&6%D!^?JOJC1g=9{02!c+0!d z7416d?C5;@?n%Z!8l67nfM?{^gW+>8?Cxwl8SU;fz})`KqYw8r^bRqN!|p$CUO!_ktrl zQo|kF)ok0>Qr>TvubTTd+L7*m=H1;huZ&rn`@5d%c;F2#oZ5x@{oHhC8p99vqYok*Yui7RDiJqI+449s^=m=>l+ zvS+o66|+szDTR<7e4Lz<;bnF?>6O4489Ldk-3@ayJ{L5 zG+KMc#kBVVQ_%tGaOod&-#2Ak|80wBqVv*X!>=bcZ+Q8m^OJkBuJ~0y4$b|3yP+_> zqHR;G<-@;6@2zL^wzt1?#tgP@+>r9<SwBl17pc7Fi@=@i;_*bt2hKVtE0wB#3L6 zae}p0wmD@iApn&+G=W7#774tJ%Sb>GUmQv>QR*&<5s(TM5a%KRau4T|fSXX5(nKY| z6~dSXRH`LX;Yw;Evxt$IfZ$&)u|zp}-n9CBk|?>C2_ljrTt}L1z@R*v zEH9#gF@9I(umeas?SRUs)XBQ>HWP-TO@#6oIvG_`6Tu~e-RUoaEDrOm%n5wFcZwh_ zLXhEjH$^}^N}A#Q$h{NBf0#L0av;&k1VaG?j0EZA>XBQm(^oFr7-CW@c0E-6;8!Ur zmXDuLRpzx?5lUnKkJA#r|451TDwI<3XFVl#k`mUHFU%rQWpk7QTeTp`5-V~c85r{^ zn2WW9|B#fCS+K@bmdDf-rG=2vL8#SfOgL^AeE$}TrwXFVql(Mb&iFa@kS7->xi~q1 zFfMbUd=!!}R#=$OS*?hw2ns+*P%9VE>vS3&r~=EFL5+v1T!3H3AT;9Tuf{07em$ns zV56)#M?vhAH5hJjEe3J#Yca}b!qQ)pYcQ;@XVl+uP8Jz1fJFRO0C8pEegR1f0`{CD fXl!u4N&w25;`WtfMwH`|ff_A-v*cLIiiv*!yPqrO literal 0 HcmV?d00001 diff --git a/images/toc-blank.eps b/images/toc-blank.eps new file mode 100644 index 0000000..aa64e59 --- /dev/null +++ b/images/toc-blank.eps @@ -0,0 +1,300 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: (ImageMagick) +%%Title: (toc-blank.eps) +%%CreationDate: (Fri Nov 5 11:45:36 2004) +%%BoundingBox: 0 0 15 9 +%%HiResBoundingBox: 0 0 15 9 +%%DocumentData: Clean7Bit +%%LanguageLevel: 1 +%%Pages: 1 +%%EndComments + +%%BeginDefaults +%%EndDefaults + +%%BeginProlog +% +% Display a color image. The image is displayed in color on +% Postscript viewers or printers that support color, otherwise +% it is displayed as grayscale. +% +/DirectClassPacket +{ + % + % Get a DirectClass packet. + % + % Parameters: + % red. + % green. + % blue. + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/DirectClassImage +{ + % + % Display a DirectClass image. + % + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { DirectClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayDirectClassPacket } image + } ifelse +} bind def + +/GrayDirectClassPacket +{ + % + % Get a DirectClass packet; convert to grayscale. + % + % Parameters: + % red + % green + % blue + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/GrayPseudoClassPacket +{ + % + % Get a PseudoClass packet; convert to grayscale. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassPacket +{ + % + % Get a PseudoClass packet. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassImage +{ + % + % Display a PseudoClass image. + % + % Parameters: + % class: 0-PseudoClass or 1-Grayscale. + % + currentfile buffer readline pop + token pop /class exch def pop + class 0 gt + { + currentfile buffer readline pop + token pop /depth exch def pop + /grays columns 8 add depth sub depth mul 8 idiv string def + columns rows depth + [ + columns 0 0 + rows neg 0 rows + ] + { currentfile grays readhexstring pop } image + } + { + % + % Parameters: + % colors: number of colors in the colormap. + % colormap: red, green, blue color packets. + % + currentfile buffer readline pop + token pop /colors exch def pop + /colors colors 3 mul def + /colormap colors string def + currentfile colormap readhexstring pop pop + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { PseudoClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayPseudoClassPacket } image + } ifelse + } ifelse +} bind def + +/DisplayImage +{ + % + % Display a DirectClass or PseudoClass image. + % + % Parameters: + % x & y translation. + % x & y scale. + % label pointsize. + % image label. + % image columns & rows. + % class: 0-DirectClass or 1-PseudoClass. + % compression: 0-none or 1-RunlengthEncoded. + % hex color packets. + % + gsave + /buffer 512 string def + /byte 1 string def + /color_packet 3 string def + /pixels 768 string def + + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + x y translate + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + currentfile buffer readline pop + token pop /pointsize exch def pop + /Times-Roman findfont pointsize scalefont setfont + x y scale + currentfile buffer readline pop + token pop /columns exch def + token pop /rows exch def pop + currentfile buffer readline pop + token pop /class exch def pop + currentfile buffer readline pop + token pop /compression exch def pop + class 0 gt { PseudoClassImage } { DirectClassImage } ifelse + grestore +} bind def +%%EndProlog +%%Page: 1 1 +%%PageBoundingBox: 0 0 15 9 +userdict begin +DisplayImage +0 0 +15 9 +12.000000 +15 9 +1 +0 +0 +16 +000000 +800000 +008000 +808000 +000080 +800080 +008080 +C0C0C0 +808080 +FF0000 +00FF00 +FFFF00 +0000FF +FF00FF +00FFFF +FFFFFF +0F0F0F0F080F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F080F +0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F080F080F080F080F +080F080F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F080F0F0F0F0F0F0F0F0F0F0F0F0F +0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F080F0F0F0F0F0F0F0F0F0F +end +%%PageTrailer +%%Trailer +%%EOF diff --git a/images/toc-blank.gif b/images/toc-blank.gif new file mode 100644 index 0000000000000000000000000000000000000000..6c65e3a194c9fc7cf689bfe14d8195bc40d8093b GIT binary patch literal 95 zcmZ?wbhEHbuk@&whU_+wL7l%xqVSOWl-?jltH literal 0 HcmV?d00001 diff --git a/images/toc-blank.pdf b/images/toc-blank.pdf new file mode 100644 index 0000000000000000000000000000000000000000..da88652a692eb0e7ef6b33b103abdc24a837fe3a GIT binary patch literal 1388 zcmbtUO=uHA7_Crx7(`IidJr;~LR8wBNwR4oTCj~NrHu`nw2Emp>t>R!O?K+;6x*Kk z=s_w)MQcS=A_^XQ@t_`5RI1p6Hz{5`6g?>RAbM24*`|$6@gOcCyZgSMec#*nZBsH9 zZ)Pn))HL^H@)puC#p1+Cv~M5j;dVg|;V>XNiCaa<9ZcdyL-H6mMUJ<%Ay+!wD50^L zJ!$$jn5K0H{MTpR^t~$ka`!GAoA0}u9YU8=v-O)FHB2;Qv-wT>$Hmv>rJeVEi(g-q zeVfv7b2AHnTR+^-J}WQXS-SkZytE~2-u5LgPETDOm^xnHzc_OvHGS>yM)OnSwmm!E zFPs{Gz%W>?!(d00=IJ&#&D&kRI{lw3rA1|3RMM2kB@MYGzy#~c+N7~#Td>|2r~^w2N6UZ zZc7|g`XHinSByF)cR{(NBg_<+83Nj3(p7>M9Z+y^Om?Ou=!cnVqa#p|bO>8Q8y73( zJ*YxN^<91wm?$RLqvB%HZRK2?L5ir31~GIP1sY6stCX_U(n@8AA&sIath89BT+NTJ z&94$Ahl~;@dX%Jf(v<_6mK-PTow!v!oAh<)IO1LPCKH&ER07i$8mRX5#;mwWk0SLL zy&6@emEf|w{xlaN@lo59max6qDIzgZGAuho5d$f8!!GblGxKiRE$Jq?lQK#pMUEqg zq^t>^325QL6%R8Ywd&R3p&bi#b+M;sHYmN;8bS^Bf1H;2{Uaqat0--N-+D@cDkbn$ zZq($Czcbl`JBNfTUDL5fB#yLDwhO!j+o&Xqfyex@y#Y!?j8ToTkQR(WJRx#_3wfo& z@elYtyC#f+WeyMQf}*q~iyUw%%;pnC!yazoBQ8YR+A3}vb9f%XRxm_Y4;R(^|j$3>`qOd#^75}gN5lI xdD1bgB6r}!h&_M7yqM@hz~(7i!~0HBcxg#Z8m literal 0 HcmV?d00001 diff --git a/images/toc-minus.pdf b/images/toc-minus.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9aa2dd639ed553a2a57fc73934e77a92fced5f55 GIT binary patch literal 1376 zcmbtUO=}ZT6s=NP7X=&wL?a2SD42suqNocNX9hP}e?M}C!}JoGSv;0e zJ_IsK%L(7@#do8xtDWYT$_JctsTr6_c~M87p~nLzjm&5Y<=-gdg0cY{pRPj>Di~g%=_Wh z;bP&fKQepCS~4@=17DXret$fh{P}6LR$1Uk zuR^=QOR#}bvN(9m7eDS-lpv*wN@-9HL?NE!=HEhIDR+G1KF_X6J#QIPewzse-1-YBBKy)|e z55c-Lg^@Rn4J@O90EimajPJhgGs!g3l?JrH(6gFa)rb6BC5>p zPb=^IX{F_e@6PPo;n&p;^YQgFOT&+{c{H7RvUSIN+hkidJJzm!S$R{f?VYPFS3BC% z3)R}aEIjY}G?#r*tv#$wzpU1FW{n3O$*Gwew?=N9-Fk9m_HJtC_NndW#}5}K=6&g< zq2-}Meo+liT(Rz%?_YHs`gQo?l=%7m*XilYS8slsySx7x_3vHW%|AOo(%V+H9BDcD z)c=~ak1h{J4w{Zbl4 zH0JWMV=xy)OFG<0F_9r4D<(rlXc2{ifr=PR36Ks`*+xSk9_i<{fHp3cqI*!Ci0r$1 z2$)DF*rVcNa?~! zSbzEok$BlQgvD)db_J0bFY1<^Q4j?wHQmm!Oc(VYqLy%z%t`6RQi0(xA}MQ z9?WxBxQ1hu1P*sAbRT#L7EwwT1CRM)2UJA~P^tte4FvrWh$p!Dw~$xL9p8x0vui@n zS;qLtJ}63CqQC$b+~_J5%5FC+xe(~58^Srh6O_4IeB4w z9gC=7;U+AgY{t|OoJv!k0z24@sR3|QQ(jNc=Gu@7Mr_IhjW%PEKk|g5TLtF8ClP!0 mf_X8~IETfPu7)kQ$2gW} literal 0 HcmV?d00001 diff --git a/images/up.eps b/images/up.eps new file mode 100644 index 0000000..e0fd951 --- /dev/null +++ b/images/up.eps @@ -0,0 +1,551 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: (ImageMagick) +%%Title: (up.eps) +%%CreationDate: (Fri Nov 5 11:45:36 2004) +%%BoundingBox: 0 0 35 15 +%%HiResBoundingBox: 0 0 35 15 +%%DocumentData: Clean7Bit +%%LanguageLevel: 1 +%%Pages: 1 +%%EndComments + +%%BeginDefaults +%%EndDefaults + +%%BeginProlog +% +% Display a color image. The image is displayed in color on +% Postscript viewers or printers that support color, otherwise +% it is displayed as grayscale. +% +/DirectClassPacket +{ + % + % Get a DirectClass packet. + % + % Parameters: + % red. + % green. + % blue. + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/DirectClassImage +{ + % + % Display a DirectClass image. + % + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { DirectClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayDirectClassPacket } image + } ifelse +} bind def + +/GrayDirectClassPacket +{ + % + % Get a DirectClass packet; convert to grayscale. + % + % Parameters: + % red + % green + % blue + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/GrayPseudoClassPacket +{ + % + % Get a PseudoClass packet; convert to grayscale. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassPacket +{ + % + % Get a PseudoClass packet. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassImage +{ + % + % Display a PseudoClass image. + % + % Parameters: + % class: 0-PseudoClass or 1-Grayscale. + % + currentfile buffer readline pop + token pop /class exch def pop + class 0 gt + { + currentfile buffer readline pop + token pop /depth exch def pop + /grays columns 8 add depth sub depth mul 8 idiv string def + columns rows depth + [ + columns 0 0 + rows neg 0 rows + ] + { currentfile grays readhexstring pop } image + } + { + % + % Parameters: + % colors: number of colors in the colormap. + % colormap: red, green, blue color packets. + % + currentfile buffer readline pop + token pop /colors exch def pop + /colors colors 3 mul def + /colormap colors string def + currentfile colormap readhexstring pop pop + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { PseudoClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayPseudoClassPacket } image + } ifelse + } ifelse +} bind def + +/DisplayImage +{ + % + % Display a DirectClass or PseudoClass image. + % + % Parameters: + % x & y translation. + % x & y scale. + % label pointsize. + % image label. + % image columns & rows. + % class: 0-DirectClass or 1-PseudoClass. + % compression: 0-none or 1-RunlengthEncoded. + % hex color packets. + % + gsave + /buffer 512 string def + /byte 1 string def + /color_packet 3 string def + /pixels 768 string def + + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + x y translate + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + currentfile buffer readline pop + token pop /pointsize exch def pop + /Times-Roman findfont pointsize scalefont setfont + x y scale + currentfile buffer readline pop + token pop /columns exch def + token pop /rows exch def pop + currentfile buffer readline pop + token pop /class exch def pop + currentfile buffer readline pop + token pop /compression exch def pop + class 0 gt { PseudoClassImage } { DirectClassImage } ifelse + grestore +} bind def +%%EndProlog +%%Page: 1 1 +%%PageBoundingBox: 0 0 35 15 +userdict begin +DisplayImage +0 0 +35 15 +12.000000 +35 15 +1 +0 +0 +256 +008400 +108C10 +218C21 +299429 +319C31 +429C42 +63AD63 +6BB56B +84BD84 +8CC68C +94CE94 +B5DEB5 +C6DEC6 +CEE7CE +D6EFD6 +E7EFE7 +EFF7EF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +111111111111111111111111111111111111111111111111111111111111111111111111 +111111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111110F0B0C0D110D0C0B10111111111111111111111111111111111111 +1111111111111111110603111110040E1111111111111111111111111111111111111111 +111111111111111108051111110811110E0F0D0F11111111111111111111111111111111 +11111111111111080511111108110E05060B050B11111111111111111111111111111111 +11111111111108051111110811110808110F021111111111111111111111111111111111 +111111111108051111110811110808111100111111111111111111111111111111111111 +1111111108051111110911110808110F0211111111111111111111111111111111111111 +1111110F010C110C0A111108040F070A1111111111111111111111111111111111111111 +1111111009080C1111110806080B11111111111111111111111111111111111111111111 +111111111111111111080811111111111111111111111111111111111111111111111111 +111111111111110E07070E11111111111111111111111111111111111111111111111111 +111111111111111111111111111111111111111111111111111111111111111111111111 +111111111111111111111111111111111111111111 +end +%%PageTrailer +%%Trailer +%%EOF diff --git a/images/up.gif b/images/up.gif new file mode 100644 index 0000000000000000000000000000000000000000..e899a272d0f7664bdaee0e02c303f4f69c8ae87b GIT binary patch literal 922 zcmZ?wbh9u|RA%63_|Cw<(83_lBcRx$s5wQ`aE_tV9H->9$=O@8TlTi}9P62KZpzks zTaVp4cJBGPYwxc;fB*db_xJxt!Dt8!mk`haW&s9JUSQy;XHe#l@z}87U^9oXR?LZl z2hFTJQZ5+>5*S){ER>5}6 zi2-c0QL-Xoww`L}Sns93&iB%3k89uTI8#0p%?WhBwtb}hz3LFv=Akpr_hmL^f@*=y zV5TRBqp=5iawdN{70tQR`&BfS?j4H8?*6`~`b0E#IM((>G`6;ydnd=;y1!*#MN3si z+tcSpbI+b#pLsd$U)%TUH!HB!r;k)4?bxh+;sTE$^LJr-hczMFE-CdFDC8h&QiUDuA=xX$c| zInPwybl|5S?>X0dtUuoCgx0-HC;9#-xNSFPiuaGV%uNi8GRI!>vis(qI(=G`d1KHs z?z;5X*wyrj-8BWf>dsu@%G%55d#4NymERn={>a6ftyhM-^waH~el~tRe8Lxs`|scU zSyj_RM>{t69QS`3C>~uK`F(HRkq2##Yn|rjd&d-hW@ky+_Jcow0?8?nJ9V<^Jk_fK>8T`SNDbZF7{<`e1~GKv0M8bR4Zuf} zaJ~^BV|2`(~#Tls(te3Z(Rp(+9C5Fs>>+AUd%mP(VA zMXbVx#Nc9!1>+<{*QCP;-W5`&cmw{UXgeI>v!om_@R^JWFix^-@+_~INfS|_- zXdSIj^-U}@X(7f+sjp#DQMEJ~T(H!wj-sF=B5(>X3W>GT6ts)=EHC(I3X!d3SRsgg z8&Kk*kXK|kmON~IID~ChZsRs}iF@(%Syvs4#WL%9I5pn2>JQ@+BtiTLbGPmUz zqV=mV+F~XWT%JdpO~frLFpJ@qJVj#p5SGYq03?J()(apbio|lNo{7JO8WE^dO1M{6 TSV>9j49eGAD2=Ar<)Hon{!S;N literal 0 HcmV?d00001 diff --git a/images/warning.eps b/images/warning.eps new file mode 100644 index 0000000..dce82d1 --- /dev/null +++ b/images/warning.eps @@ -0,0 +1,553 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: (ImageMagick) +%%Title: (warning.eps) +%%CreationDate: (Fri Nov 5 11:45:36 2004) +%%BoundingBox: 0 0 24 24 +%%HiResBoundingBox: 0 0 24 24 +%%DocumentData: Clean7Bit +%%LanguageLevel: 1 +%%Pages: 1 +%%EndComments + +%%BeginDefaults +%%EndDefaults + +%%BeginProlog +% +% Display a color image. The image is displayed in color on +% Postscript viewers or printers that support color, otherwise +% it is displayed as grayscale. +% +/DirectClassPacket +{ + % + % Get a DirectClass packet. + % + % Parameters: + % red. + % green. + % blue. + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/DirectClassImage +{ + % + % Display a DirectClass image. + % + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { DirectClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayDirectClassPacket } image + } ifelse +} bind def + +/GrayDirectClassPacket +{ + % + % Get a DirectClass packet; convert to grayscale. + % + % Parameters: + % red + % green + % blue + % length: number of pixels minus one of this color (optional). + % + currentfile color_packet readhexstring pop pop + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/GrayPseudoClassPacket +{ + % + % Get a PseudoClass packet; convert to grayscale. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + color_packet 0 get 0.299 mul + color_packet 1 get 0.587 mul add + color_packet 2 get 0.114 mul add + cvi + /gray_packet exch def + compression 0 eq + { + /number_pixels 1 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add def + } ifelse + 0 1 number_pixels 1 sub + { + pixels exch gray_packet put + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassPacket +{ + % + % Get a PseudoClass packet. + % + % Parameters: + % index: index into the colormap. + % length: number of pixels minus one of this color (optional). + % + currentfile byte readhexstring pop 0 get + /offset exch 3 mul def + /color_packet colormap offset 3 getinterval def + compression 0 eq + { + /number_pixels 3 def + } + { + currentfile byte readhexstring pop 0 get + /number_pixels exch 1 add 3 mul def + } ifelse + 0 3 number_pixels 1 sub + { + pixels exch color_packet putinterval + } for + pixels 0 number_pixels getinterval +} bind def + +/PseudoClassImage +{ + % + % Display a PseudoClass image. + % + % Parameters: + % class: 0-PseudoClass or 1-Grayscale. + % + currentfile buffer readline pop + token pop /class exch def pop + class 0 gt + { + currentfile buffer readline pop + token pop /depth exch def pop + /grays columns 8 add depth sub depth mul 8 idiv string def + columns rows depth + [ + columns 0 0 + rows neg 0 rows + ] + { currentfile grays readhexstring pop } image + } + { + % + % Parameters: + % colors: number of colors in the colormap. + % colormap: red, green, blue color packets. + % + currentfile buffer readline pop + token pop /colors exch def pop + /colors colors 3 mul def + /colormap colors string def + currentfile colormap readhexstring pop pop + systemdict /colorimage known + { + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { PseudoClassPacket } false 3 colorimage + } + { + % + % No colorimage operator; convert to grayscale. + % + columns rows 8 + [ + columns 0 0 + rows neg 0 rows + ] + { GrayPseudoClassPacket } image + } ifelse + } ifelse +} bind def + +/DisplayImage +{ + % + % Display a DirectClass or PseudoClass image. + % + % Parameters: + % x & y translation. + % x & y scale. + % label pointsize. + % image label. + % image columns & rows. + % class: 0-DirectClass or 1-PseudoClass. + % compression: 0-none or 1-RunlengthEncoded. + % hex color packets. + % + gsave + /buffer 512 string def + /byte 1 string def + /color_packet 3 string def + /pixels 768 string def + + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + x y translate + currentfile buffer readline pop + token pop /x exch def + token pop /y exch def pop + currentfile buffer readline pop + token pop /pointsize exch def pop + /Times-Roman findfont pointsize scalefont setfont + x y scale + currentfile buffer readline pop + token pop /columns exch def + token pop /rows exch def pop + currentfile buffer readline pop + token pop /class exch def pop + currentfile buffer readline pop + token pop /compression exch def pop + class 0 gt { PseudoClassImage } { DirectClassImage } ifelse + grestore +} bind def +%%EndProlog +%%Page: 1 1 +%%PageBoundingBox: 0 0 24 24 +userdict begin +DisplayImage +0 0 +24 24 +12.000000 +24 24 +1 +0 +0 +256 +080000 +100000 +180000 +210000 +290000 +310000 +420000 +4A0000 +520000 +5A0000 +6B0000 +730000 +7B0000 +840000 +8C0000 +940000 +947B7B +9C5252 +9C5A5A +9C7B7B +A50000 +A53939 +A54A4A +A58484 +A59494 +A5A5A5 +AD0000 +AD3131 +AD9494 +B50000 +B52929 +B58C8C +B59C9C +B5A5A5 +B5B5B5 +BD0000 +BDADAD +BDB5B5 +C60000 +C61010 +C61818 +C6C6C6 +CE0000 +CE1010 +CE1818 +CE2929 +D60000 +D62929 +D6D6D6 +DE0000 +DEDEDE +E70000 +E72121 +E7E7E7 +EF0000 +EF0808 +EFEFEF +F70000 +F7F7F7 +FF0000 +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +FFFFFF +3C3C3C3C3C3C3C32303030303030303030383C3C3C3C3C3C3C3C3C3C3C3C29111E1B1E1B +1E1B1E1B1B1C383C3C3C3C3C3C3C3C3C3C221637393939393939393939281C383C3C3C3C +3C3C3C3829153739393939393939393939392817383C3C3C3C3C3C291237393939393939 +393939393939392819383C3C3C3C2215373939393939391D0F2E3939393939392817383C +3C2916373939393939392304010937393939393939281C38321137393939393939390F01 +01042E393939393939392821301B39393939393939391A02010631393939393939393710 +301E39393939393939392603000837393939393939393710301B39393939393939393105 +010B39393939393939393710301E39393939393939393307010E39393939393939393710 +301B39393939393939393908011439393939393939393710301E3939393939393939390A +021A39393939393939393710301B393939393939393939230D2E39393939393939393710 +301E3939393939393939330C081A39393939393939393710321B39393939393939391A01 +010631393939393939392D18382028393939393939391D030107333939393939392F1332 +3C382028393939393939391D0D2A3939393939392F17323C3C3C381C2739393939393939 +393939393939393410323C3C3C3C3C3A22273939393939393939393939392F10383C3C3C +3C3C3C3C381C28393939393939393939392F17323C3C3C3C3C3C3C3C3C38202837333733 +373337332D10323C3C3C3C3C3C3C3C3C3C3C3A24131313131313131318323C3C3C3C3C3C + +end +%%PageTrailer +%%Trailer +%%EOF diff --git a/images/warning.gif b/images/warning.gif new file mode 100644 index 0000000000000000000000000000000000000000..a5870799fb78fde0c542710b23c350b7605164e9 GIT binary patch literal 1052 zcmeHG&1=(e0DVo%7O{m)rbLXhAE)3Bc4c;@Ai++@GAUcTi$%nOZsHItbBcyR*AF&p zm^%ci5>SzV6bfE`GK5MM$#&QRJy`J4!v@O~A@yPr!5RMtk9#~G@Ae)K-pJ_rp>Uc7 ziw-~o3~UP@zym?xEFc02AO*|-vw#E?02xqhN|KsLsHv1HNgALpfillvbwGtfWa^Z%Nji21e&%sn=PQ#YMFrP z^O>e;0TxYLmSwl?bUJ&$-ahsh_)iP;!^Xcafc}H~G`Ak>lJj)WmUlgKr9}6g9#&V= z&c&jqyYwa#SX_I2V&c-qQs7*1*_+%EZaV@WdJm0PEt+!V`f3joM2X1L_My4D`u3j6vyCXXt z+{WQYgC}$7{kgpPEVcko?zh1;vK8^&#pzQ*mhE>PEhTR(eVdy)=pGVYl)t2ftTQzE zzU^7puUXRbeBm&39nfU1TKR=nbh1$ Qxn7IjbH6=6b-57z3rbJ+&;S4c literal 0 HcmV?d00001 diff --git a/images/warning.pdf b/images/warning.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e86c595e8e7fc8b12f48460eebbbaf56f0dc55ff GIT binary patch literal 1846 zcmbtVdrT8|97mjHJB>ysuvfy*WjOHByXym}BBYc@5No?@!D$6N+oM$4J92jov@;-^ z(}~7MCNLeiMOT?3poSob&*4PT4Ff1aCOQROCTPI=KtcAqQbaWSW7*}ByZd|}_xb(q z^Z8zYCMsqgE|MSt_1#U1`eWf3MQ+cI6?5KF@v}-lZA(zU6^i-3`x$)ET zJUYVGppLUUUB@C@kDPqBw&R^$J*?|MM|tv$y-x;j4?U~4I}6*Ibk)~r|$Gv z>;3)qrDR_@-t)LUGo@n5bK}e_?Y$?~lto-TQ_#4kv_@_1TXrC*NH_icr@cx=z2RhQ zm?C-iu9BSJr!8zaB(?pW8h5|0c~M*WW7WeKLr*HMHcLL6KmEe-3a9emiFLl4mqM?11h z`@*_*ted2tRCi-TkxyY}%YS- zn#64_XItZ^lqH}3%kk$mtQV{(i0f?$i4E#^xb)_03c3g367Ke)d9BRcqs&om}wX z@-Mb4#46WSS9kQsT=!t%lZEANDTOWlj|#3;g5GF!pU-b{J$qok;`Rn>&bhZlzh)LZ z*C*{=zB{J{yVX`@FU}+LHzpMH)3>ji)EmmhL%q-LeR;9w$l(MFH>;GG~?L8k7jI0W%P(orqz>=_iQAx#vj zqKsxTlF0&k42H#0cqSn*#8Na5B!bovl%P1q#u_LNx7WFX{-@ET$?DwKMH!;|9GL4lw#Hrl|O8QQ&e3_+t9 zD`}?n7=pvCBuLss>F43@he$KeX((1pS~DyZ2t`n>*+J>Wvf!kVd4xk!FXv8r+IwwY zUQwsljuZB4tRjSk{Xb5_{Qe^)!%BhDIC#EENjypk>dI&{P;6kVW-*9OV>q5Ou;vUN zgo-dc2xV?2z1L;MVicp^c6v{ zNN46P6vQ)0mNwHS5tYF~JUrZ^wJerOMKFNl2=?*-!7`ad22#NYCKtnxEgXOz!Ei|^ z)WcW|3k`k~3z0xMzm|vL&@HcFAvoNru^29vzKLOS=$x^6m^=iIg0UEm1;3KVv!vNV vvG5lM-0Fhs1t`HV(078Up~>k~1_+C-fxJ(*~1O!B@V~~FU+DxX# literal 0 HcmV?d00001 diff --git a/lib/ChangeLog b/lib/ChangeLog new file mode 100644 index 0000000..a521bda --- /dev/null +++ b/lib/ChangeLog @@ -0,0 +1,36 @@ +2004-10-24 + + * dblib.dsl: Revision 1.6 completely broke PI processing, so back that out for now. + +2003-04-29 Adam Di Carlo + + * dblib.dsl: Fix my-debug so it actually returns what you ask it to. + +2003-04-28 Adam Di Carlo + + * dblib.dsl: Make PI parsing more robust by rewriting parse-pi-attribute and a fix + in parse-starttag-pi. I'm still not entirely happy with the PI + parsing, its probably a little flakey, but it shouldn't completely + bail out when it hits data its not expecting. Closes Debian Bug#186886. + +2003-04-26 Adam Di Carlo + + * dblib.dsl: Fix a typo in the param docs + +2003-04-05 Adam Di Carlo + + * dblib.dsl: xsl stylesheet refers to pica as "pc" rather than "pi", so we allow + either one as a pica + +2002-05-12 Norman Walsh + + * dblib.dsl: Bugs #429663 and #474328 fixed (allow external linespecific content to be indented and numbered). Eight bit or unicode external linespecific content may be problematic though. + +2001-07-10 Norman Walsh + + * dblib.dsl: Bug fix: (strip) was returning the empty string for any string one character long + +2001-04-02 Norman Walsh + + * dblib.dsl: New file. + diff --git a/lib/dblib.dsl b/lib/dblib.dsl new file mode 100644 index 0000000..a896cb2 --- /dev/null +++ b/lib/dblib.dsl @@ -0,0 +1,1858 @@ + + + + + + +;; $Id: dblib.dsl,v 1.8 2004/10/24 01:09:35 petere78 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; +;; This file contains a general library of DSSSL functions. +;; + +;; If **ANY** change is made to this file, you _MUST_ alter the +;; following definition: + +;; REFERENCE Library Version + +(define %library-version% + ;; REFENTRY version + ;; PURP Defines the library version string + ;; DESC + ;; Defines the library version string. + ;; /DESC + ;; /REFENTRY + "Modular DocBook Stylesheet Library") + +;; === Book intro, for dsl2man ========================================== + +DSSSL Library +;; Part of the Modular DocBook Stylesheet distribution +;; NormanWalsh +;; +;; $Revision: 1.8 $ +;; 199719981999 +;; Norman Walsh +;; +;; +;; This software may be distributed under the same terms as Jade: +;; +;; +;; Permission is hereby granted, free of charge, to any person +;; obtaining a copy of this software and associated documentation +;; files (the “Software”), to deal in the Software without +;; restriction, including without limitation the rights to use, +;; copy, modify, merge, publish, distribute, sublicense, and/or +;; sell copies of the Software, and to permit persons to whom the +;; Software is furnished to do so, subject to the following +;; conditions: +;; +;; +;; The above copyright notice and this permission notice shall be +;; included in all copies or substantial portions of the Software. +;; +;; +;; Except as contained in this notice, the names of individuals +;; credited with contribution to this software shall not be used in +;; advertising or otherwise to promote the sale, use or other +;; dealings in this Software without prior written authorization +;; from the individuals in question. +;; +;; +;; Any stylesheet derived from this Software that is publically +;; distributed will be identified with a different name and the +;; version strings in any derived Software will be changed so that +;; no possibility of confusion between the derived package and this +;; Software will exist. +;; +;; +;; +;; +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +;; OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +;; NONINFRINGEMENT. IN NO EVENT SHALL NORMAN WALSH OR ANY OTHER +;; CONTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +;; OTHER DEALINGS IN THE SOFTWARE. +;; +;; +;; +;; Please direct all questions, bug reports, or suggestions for changes +;; to Norman Walsh, <ndw@nwalsh.com>. +;; +;; +;; See http://nwalsh.com/docbook/dsssl/ for more information. +;; +;; /DOCINFO +]]> + +;; === Some additional units ============================================ + +(define-unit pi (/ 1in 6)) ;pica +(define-unit pc (/ 1in 6)) ;pica, another name +(define-unit pt (/ 1in 72)) ;point +(define-unit px (/ 1in 96)) ;pixel + +;; REFERENCE ISO/IEC 10179 + +(define (node-list-reduce nl proc init) + ;; REFENTRY node-list-reduce + ;; PURP Implements node-list-reduce as per ISO/IEC 10179:1996 + ;; DESC + ;; Implements 'node-list-reduce' as per ISO/IEC 10179:1996 + ;; /DESC + ;; AUTHOR From ISO/IEC 10179:1996 + ;; /REFENTRY + (if (node-list-empty? nl) + init + (node-list-reduce (node-list-rest nl) + proc + (proc init (node-list-first nl))))) + +(define (node-list-last nl) + ;; REFENTRY node-list-last + ;; PURP Implements node-list-last as per ISO/IEC 10179:1996 + ;; DESC + ;; Implements 'node-list-last' as per ISO/IEC 10179:1996 + ;; /DESC + ;; AUTHOR From ISO/IEC 10179:1996 + ;; /REFENTRY + (node-list-ref nl + (- (node-list-length nl) 1))) + +(define (node-list-first-element nodelist) + ;; REFENTRY node-list-first-element + ;; PURP Return the first element node in a node list + ;; DESC + ;; This function returns the first node in a node list which is + ;; an element (as opposed to a PI or anything else that might appear + ;; in a node list). + ;; /DESC + ;; /REFENTRY + (let loop ((nl nodelist)) + (if (node-list-empty? nl) + (empty-node-list) + (if (gi (node-list-first nl)) + (node-list-first nl) + (loop (node-list-rest nl)))))) + +(define (node-list-last-element nodelist) + ;; REFENTRY node-list-last-element + ;; PURP Return the last element node in a node list + ;; DESC + ;; This function returns the last node in a node list which is + ;; an element (as opposed to a PI or anything else that might appear + ;; in a node list). + ;; /DESC + ;; /REFENTRY + (let loop ((el (empty-node-list)) (nl nodelist)) + (if (node-list-empty? nl) + el + (if (gi (node-list-first nl)) + (loop (node-list-first nl) (node-list-rest nl)) + (loop el (node-list-rest nl)))))) + +(define (ipreced nl) + ;; REFENTRY ipreced + ;; PURP Implements ipreced as per ISO/IEC 10179:1996 + ;; DESC + ;; Implements 'ipreced' as per ISO/IEC 10179:1996 + ;; /DESC + ;; AUTHOR From ISO/IEC 10179:1996 + ;; /REFENTRY + (node-list-map (lambda (snl) + (let loop ((prev (empty-node-list)) + (rest (siblings snl))) + (cond ((node-list-empty? rest) + (empty-node-list)) + ((node-list=? (node-list-first rest) snl) + prev) + (else + (loop (node-list-first rest) + (node-list-rest rest)))))) + nl)) + + +(define (ifollow nl) + ;; REFENTRY ifollow + ;; PURP Implements ifollow as per ISO/IEC 10179:1996 + ;; DESC + ;; Implements 'ifollow' as per ISO/IEC 10179:1996 + ;; /DESC + ;; AUTHOR From ISO/IEC 10179:1996 + ;; /REFENTRY + (node-list-map (lambda (snl) + (let loop ((rest (siblings snl))) + (cond ((node-list-empty? rest) + (empty-node-list)) + ((node-list=? (node-list-first rest) snl) + (node-list-first (node-list-rest rest))) + (else + (loop (node-list-rest rest)))))) + nl)) + +(define (siblings snl) + ;; REFENTRY siblings + ;; PURP Implements siblings as per ISO/IEC 10179:1996 + ;; DESC + ;; Implements 'siblings' as per ISO/IEC 10179:1996 + ;; /DESC + ;; AUTHOR From ISO/IEC 10179:1996 + ;; /REFENTRY + (children (parent snl))) + +(define (string->list str) + ;; REFENTRY string-2-list + ;; PURP Converts a string into a list of characters. + ;; DESC + ;; Implements 'string->list' as per ISO/IEC 10179:1996 + ;; (clause 8.5.9.9). + ;; /DESC + ;; AUTHOR David Megginson + ;; EMAIL dmeggins@uottawa.ca + ;; /REFENTRY + (let loop ((chars '()) + (k (- (string-length str) 1))) + (if (< k 0) + chars + (loop (cons (string-ref str k) chars) (- k 1))))) + +(define (list->string chars) + ;; REFENTRY list-2-string + ;; PURP Converts a list of characters into a string + ;; DESC + ;; Implements 'list->string' as per ISO/IEC 10179:1996 + ;; (clause 8.5.9.9). + ;; /DESC + ;; AUTHOR David Megginson + ;; EMAIL dmeggins@uottawa.ca + ;; /REFENTRY + (let loop ((cl chars) + (str "")) + (if (null? cl) + str + (loop (cdr cl) + (string-append str (string (car cl))))))) + +;; ====================================================================== + +(define (map f #!rest xs) + ;; REFENTRY map + ;; PURP Implements map + ;; DESC + ;; Implements map + ;; /DESC + ;; AUTHOR From Mulberry Tech. site (need better attribution) + ;; /REFENTRY + (let ((map1 (lambda (f xs) ; bootstrap version for unary F + (let loop ((xs xs)) + (if (null? xs) + '() + (cons (f (car xs)) + (loop (cdr xs)))))))) + (cond ((null? xs) + '()) + ((null? (cdr xs)) + (map1 f (car xs))) + (else + (let loop ((xs xs)) + (if (null? (car xs)) + '() + (cons (apply f (map1 car xs)) + (loop (map1 cdr xs))))))))) + +(define (absolute-child-number #!optional (nd (current-node))) + ;; REFENTRY absolute-child-number + ;; PURP Returns the absolute child number of the specified node + ;; DESC + ;; Returns the child number, regardless of gi, of 'snl' within its + ;; parent. + ;; + ;; Isn't there a better way to get this? + ;; ARGS + ;; ARG snl + ;; The node (singleton node list) whose child number is desired. + ;; /ARG + ;; /ARGS + ;; /DESC + ;; /REFENTRY + (+ (node-list-length (preced nd)) 1)) + +;; REFERENCE Debug + +(define (my-debug x #!optional return-value) + ;; REFENTRY my-debug + ;; PURP A debugging function more helpful than (debug) + ;; DESC + ;; A version of debug that tries to print information more helpful + ;; than "unknown object ...". Will need extending for any further + ;; types added to Jade which don't have useful print methods. + ;; (Should yield more information extracted from each type.) + ;; ARGS + ;; ARG x + ;; The object about which debugging information is desired. + ;; /ARG + ;; /ARGS + ;; /DESC + ;; AUTHOR Tony Graham + ;; /REFENTRY + (let ((msg (debug (cond ((node-list? x) + (if (node-list-empty? x) + (list 'empty-node-list x) + (list (if (named-node-list? x) + 'named-node-list + 'node-list) + (node-list-length x) x))) + ((sosofo? x) + (list 'sosofo x)) + ((procedure? x) + (list 'procedure x)) + ((style? x) + (list 'style x)) + ((address? x) + (list 'address x)) + ((color? x) + (list 'color x)) + ((color-space? x) + (list 'color-space x)) + ((display-space? x) + (list 'display-space x)) + ((inline-space? x) + (list 'inline-space x)) + ((glyph-id? x) + (list 'glyph-id x)) + ((glyph-subst-table? x) + (list 'glyph-subst-table x)) + (else x))))) + return-value)) + +;; REFERENCE Miscellaneous + +(define (string-with-space string #!optional (space " ")) + ;; REFENTRY string-with-space + ;; PURP Returns string with a space appended or the empty string + ;; DESC + ;; If 'string' is not the empty string, returns 'string' with a + ;; 'space' appended. If 'string' is empty, or is not a '(string?)', + ;; returns 'string' unmodified. + ;; ARGS + ;; ARG 'string' + ;; The string onto which a space should be appended. + ;; /ARG + ;; ARG 'space' o + ;; If specified, the space to append. Defaults to a single space. + ;; /ARG + ;; /ARGS + ;; /DESC + ;; /REFENTRY + (if (string? string) + (if (equal? string "") + string + (string-append string space)) + string)) + +;; ====================================================================== + +(define (split str #!optional (whitespace '(#\space))) + ;; REFENTRY split + ;; PURP Splits string at whitespace and returns the resulting list of tokens + ;; DESC + ;; Given a string containing delimited tokens, return a list + ;; of the tokens in string form. + ;; ARGS + ;; ARG 'str' + ;; The string to split. + ;; /ARG + ;; ARG 'whitespace' o + ;; A list of characters that should + ;; be treated as whitespace. + ;; /ARG + ;; /ARGS + ;; /DESC + ;; AUTHOR David Megginson + ;; EMAIL dmeggins@uottawa.ca + ;; /REFENTRY + (let loop ((characters (string->list str)) ; Top-level recursive loop. + (current-word '()) + (tokens '())) + + ; If there are no characters left, + ; then we're done! + (cond ((null? characters) + ; Is there a token in progress? + (if (null? current-word) + (reverse tokens) + (reverse (cons (list->string (reverse current-word)) + tokens)))) + ; If there are characters left, + ; then keep going. + (#t + (let ((c (car characters)) + (rest (cdr characters))) + ; Are we reading a space? + (cond ((member c whitespace) + (if (null? current-word) + (loop rest '() tokens) + (loop rest + '() + (cons (list->string (reverse current-word)) + tokens)))) + ; We are reading a non-space + (#t + (loop rest (cons c current-word) tokens)))))))) + +;; ====================================================================== + +(define (strip str #!optional (stripchars '(#\space #\&#RE #\U-0009))) + ;; REFENTRY strip + ;; PURP Strip leading and trailing characters off of a string + ;; DESC + ;; Strips leading and trailing characters in the 'stripchars' list + ;; off of a string and returns the stripped string. + ;; ARGS + ;; ARG 'str' + ;; The string to strip + ;; /ARG + ;; ARG 'stripchars' o + ;; A list of characters that should + ;; be stripped. + ;; /ARG + ;; /ARGS + ;; /DESC + ;; /REFENTRY + (let* ((startpos (let loop ((count 0)) + (if (>= count (string-length str)) + (string-length str) + (if (member (string-ref str count) stripchars) + (loop (+ count 1)) + count)))) + (tailstr (substring str startpos (string-length str))) + (endpos (let loop ((count (- (string-length tailstr) 1))) + (if (< count 1) + 0 + (if (member (string-ref tailstr count) stripchars) + (loop (- count 1)) + count))))) + (if (or (< endpos 0) + (string=? tailstr "")) + "" + (substring tailstr 0 (+ endpos 1))))) + +;; ====================================================================== + +(define (join slist #!optional (space " ")) + ;; REFENTRY join + ;; PURP Joins a list of strings together + ;; DESC + ;; Given a list of strings and a space string, returns the string + ;; that results from joining all the strings in the list together, + ;; separated by space. + ;; ARGS + ;; ARG 'slist' + ;; The list of strings. + ;; /ARG + ;; ARG 'space' o + ;; The string to place between each member of the list. Defaults to + ;; a single space. + ;; /ARG + ;; /ARGS + ;; /DESC + ;; AUTHOR David Carlisle + ;; /REFENTRY + (letrec ((loop (lambda (l result) + (if (null? l) + result + (loop (cdr l) (cons space (cons (car l) result))))))) + (if (null? slist) + "" + (apply string-append (cons (car slist) + (loop (reverse (cdr slist)) '() )))))) + +;; ====================================================================== + +(define (pad-string string length padchar) + ;; REFENTRY pad-string + ;; PURP Pads a string, in front, to the specified length + ;; DESC + ;; Returns 'string', padded in front with 'padchar' to at least 'length' + ;; Returns 'string' unmodified if 'string' is not a '(string?)', + ;; 'padchar' is not a '(string?)', 'padchar' is the empty string, or if + ;; 'string' is already greater than or equal to 'length' in length. + ;; ARGS + ;; ARG 'string' + ;; The string to pad. + ;; /ARG + ;; ARG 'length' + ;; The desired length. + ;; /ARG + ;; ARG 'padchar' + ;; The character (string, actually) to use as padding. If 'padchar' is + ;; longer than 1 character, the resulting string may be longer than + ;; 'length' when returned. + ;; /ARG + ;; /ARGS + ;; /DESC + ;; /REFENTRY + (if (and (string? string) + (string? padchar) + (> (string-length padchar) 0)) + (let loop ((s string) (count (- length (string-length string)))) + (if (<= count 0) + s + (loop (string-append padchar s) + (- count (string-length padchar))))) + string)) + +;; ====================================================================== + +(define (match-split string target) + ;; REFENTRY match-split + ;; PURP Splits string at target and returns the resulting list of tokens + ;; DESC + ;; Splits string at every occurance of target and returns the result + ;; as a list. Note that 'match-split' returns the occurances of 'target' + ;; in the list of tokens. + ;; ARGS + ;; ARG 'string' + ;; The string to split. + ;; /ARG + ;; ARG 'target' + ;; The string which is a delimiter between tokens + ;; /ARG + ;; /ARGS + ;; /DESC + ;; EXAMPLE + ;; '"this is a test"' split at '"is"' returns + ;; '("th" "is" " " "is" " a test")' + ;; /EXAMPLE + ;; /REFENTRY + (if (string? string) + (let loop ((result '()) (current "") (rest string)) + (if (< (string-length rest) (string-length target)) + (append result (if (equal? (string-append current rest) "") + '() + (list (string-append current rest)))) + (if (equal? target (substring rest 0 (string-length target))) + (loop (append result + (if (equal? current "") + '() + (list current)) + (list target)) + "" + (substring rest (string-length target) + (string-length rest))) + (loop result + (string-append current (substring rest 0 1)) + (substring rest 1 (string-length rest)))))) + (list string))) + +(define (match-split-string-list string-list target) + ;; REFENTRY match-split-string-list + ;; PURP Splits each string in a list of strings and returns the concatenated result list + ;; DESC + ;; Splits each string in 'string-list' at 'target' with '(match-split)', + ;; concatenates the results, and returns a single list of tokens. + ;; ARGS + ;; ARG string-list + ;; The list of strings to split. + ;; /ARG + ;; ARG target + ;; The string which is a delimiter between tokens. + ;; /ARG + ;; /ARGS + ;; /DESC + ;; /REFENTRY + (let loop ((result '()) (sl string-list)) + (if (null? sl) + result + (loop (append result (match-split (car sl) target)) + (cdr sl))))) + +(define (match-split-list string target-list) + ;; REFENTRY match-split-list + ;; PURP Splits a string at a list of targets and returns the resulting list of tokens + ;; DESC + ;; Splits 'string' at every target in 'target-list' with '(match-split)', + ;; returning the whole collection of tokens as a list. + ;; ARGS + ;; ARG string + ;; The string to split. + ;; /ARG + ;; ARG target-list + ;; A list of target strings which are the delimters between tokens. + ;; /ARG + ;; /ARGS + ;; /DESC + ;; /REFENTRY + (let loop ((result (list string)) (tlist target-list)) + (if (null? tlist) + result + (loop (match-split-string-list result (car tlist)) + (cdr tlist))))) + +;; ====================================================================== + +(define (assoc-objs alist) + ;; REFENTRY assoc-objs + ;; PURP Returns a list of the objects in an associative list + ;; DESC + ;; Returns a list of the objects in an associative list. + ;; ARGS + ;; ARG alist + ;; The associative list. An associative list is a list of lists + ;; where each interior list is a pair of elements. + ;; /ARG + ;; /ARGS + ;; /DESC + ;; EXAMPLE + ;; '(assoc-objs (("a" "b") ("c" "d")))' returns '("a" "c")' + ;; /EXAMPLE + ;; /REFENTRY + (let loop ((result '()) (al alist)) + (if (null? al) + result + (loop (append result (list (car (car al)))) (cdr al))))) + +(define (assoc obj alist) + ;; REFENTRY assoc + ;; PURP Returns the association of an object in an associative list + ;; DESC + ;; Given an associative list, returns the pair that has 'obj' as a 'car' + ;; or '#f' if no such pair exists. + ;; ARGS + ;; ARG obj + ;; The associative key to locate. + ;; /ARG + ;; ARG alist + ;; The associative list. + ;; /ARG + ;; /ARGS + ;; /DESC + ;; EXAMPLE + ;; '(assoc "a" (("a" "b") ("c" "d")))' returns '("a" "b")' + ;; /EXAMPLE + ;; /REFENTRY + (let loop ((al alist)) + (if (null? al) + #f + (if (equal? obj (car (car al))) + (car al) + (loop (cdr al)))))) + +(define (match-substitute-sosofo string assoc-list) + ;; REFENTRY match-substitute-sosofo + ;; PURP Return matching sosofo from associative list + ;; DESC + ;; Given a string and an associative list of strings and sosofos, + ;; return the sosofo of the matching string, or return the literal + ;; string as a sosofo. + ;; + ;; (This function is used for a particular task in the DocBook stylesheets. + ;; It may not be particularly general, but it's in 'dblib.dsl' because + ;; there is nothing DTD-specific about it.) + ;; /DESC + ;; /REFENTRY + (if (assoc string assoc-list) + (car (cdr (assoc string assoc-list))) + (literal string))) + +(define (string-list-sosofo string-list assoc-list) + ;; REFENTRY string-list-sosofo + ;; PURP Build sosofo from a list of strings and an associative list + ;; DESC + ;; Take a list of strings and an associative list that maps strings + ;; to sosofos and return an appended sosofo. + ;; + ;; (This function is used for a particular task in the DocBook stylesheets. + ;; It may not be particularly general, but it's in 'dblib.dsl' because + ;; there is nothing DTD-specific about it.) + ;; /DESC + ;; EXAMPLE + ;; Given the string list '("what is " "1" " " "+" " " "1")' + ;; and the associative list + ;; '(("1" (literal "one")) ("2" (literal "two")) ("+" (literal "plus")))', + ;; '(string-list-sosofo)' returns the sequence of sosofos + ;; equivalent to '(literal "what is one plus one")'. + ;; /EXAMPLE + ;; /REFENTRY + (if (null? string-list) + (empty-sosofo) + (sosofo-append (match-substitute-sosofo (car string-list) assoc-list) + (string-list-sosofo (cdr string-list) assoc-list)))) + +;; ====================================================================== + +(define (repl-substring? string target pos) + ;; REFENTRY repl-substring-p + ;; PURP Returns true if the specified substring can be replaced + ;; DESC + ;; Returns '#t' if 'target' occurs at 'pos' in 'string'. + ;; /DESC + ;; /REFENTRY + (let* ((could-match (<= (+ pos (string-length target)) + (string-length string))) + (match (if could-match + (substring string pos (+ pos (string-length target))) ""))) + (and could-match (string=? match target)))) + +(define (repl-substring string target repl pos) + ;; REFENTRY repl-substring + ;; PURP Replace substring in a string + ;; DESC + ;; Replaces 'target' with 'repl' in 'string' at 'pos'. + ;; /DESC + ;; /REFENTRY + (let ((matches (repl-substring? string target pos))) + (if matches + (string-append + (substring string 0 pos) + repl + (substring string + (+ pos (string-length target)) + (string-length string))) + string))) + +(define (repl-substring-list? string replace-list pos) + ;; REFENTRY repl-substring-list-p + ;; PURP Perform repl-substring? with a list of target/replacement pairs + ;; DESC + ;; Returns '#t' if any target in 'replace-list' occurs at 'pos' in 'string'. + ;; ARGS + ;; ARG 'string' + ;; The string in which replacement should be tested. + ;; /ARG + ;; ARG 'replace-list' + ;; A list of target/replacement pairs. This list is just a list of + ;; strings, treated as pairs. For example, '("was" "x" "is" "y")'. + ;; In this example, 'was' may be replaced by 'x' and 'is' may be + ;; replaced by 'y'. + ;; /ARG + ;; ARG 'pos' + ;; The location within 'string' where the test will occur. + ;; /ARG + ;; /ARGS + ;; /DESC + ;; EXAMPLE + ;; '(repl-substring-list? "this is it" ("was" "x" "is" "y") 2)' + ;; returns '#t': "is" could be replaced by "y". + ;; /EXAMPLE + ;; /REFENTRY + (let loop ((list replace-list)) + (let ((target (car list)) + (repl (car (cdr list))) + (rest (cdr (cdr list)))) + (if (repl-substring? string target pos) + #t + (if (null? rest) + #f + (loop rest)))))) + +(define (repl-substring-list-target string replace-list pos) + ;; REFENTRY repl-substring-list-target + ;; PURP Return the target that matches in a string + ;; DESC + ;; Returns the target in 'replace-list' that matches in 'string' at 'pos' + ;; See also 'repl-substring-list?'. + ;; /DESC + ;; /REFENTRY + (let loop ((list replace-list)) + (let ((target (car list)) + (repl (car (cdr list))) + (rest (cdr (cdr list)))) + (if (repl-substring? string target pos) + target + (if (null? rest) + #f + (loop rest)))))) + +(define (repl-substring-list-repl string replace-list pos) + ;; REFENTRY repl-substring-list-repl + ;; PURP Return the replacement that would be used in the string + ;; DESC + ;; Returns the replacement in 'replace-list' that would be used for the + ;; target that matches in 'string' at 'pos' + ;; See also 'repl-substring-list?'. + ;; /DESC + ;; /REFENTRY + (let loop ((list replace-list)) + (let ((target (car list)) + (repl (car (cdr list))) + (rest (cdr (cdr list)))) + (if (repl-substring? string target pos) + repl + (if (null? rest) + #f + (loop rest)))))) + +(define (repl-substring-list string replace-list pos) + ;; REFENTRY repl-substring-list + ;; PURP Replace the first target in the replacement list that matches + ;; DESC + ;; Replaces the first target in 'replace-list' that matches in 'string' + ;; at 'pos' with its replacement. + ;; See also 'repl-substring-list?'. + ;; /DESC + ;; /REFENTRY + (if (repl-substring-list? string replace-list pos) + (let ((target (repl-substring-list-target string replace-list pos)) + (repl (repl-substring-list-repl string replace-list pos))) + (repl-substring string target repl pos)) + string)) + +(define (string-replace string target repl) + ;; REFENTRY string-replace + ;; PURP Replace all occurances of a target substring in a string + ;; DESC + ;; Replaces all occurances of 'target' in 'string' with 'repl'. + ;; /DESC + ;; /REFENTRY + (let loop ((str string) (pos 0)) + (if (>= pos (string-length str)) + str + (loop (repl-substring str target repl pos) + (if (repl-substring? str target pos) + (+ (string-length repl) pos) + (+ 1 pos)))))) + +(define (string-replace-list string replace-list) + ;; REFENTRY string-replace-list + ;; PURP Replace a list of target substrings in a string + ;; DESC + ;; Replaces, in 'string', all occurances of each target in + ;; 'replace-list' with its replacement. + ;; /DESC + ;; /REFENTRY + (let loop ((str string) (pos 0)) + (if (>= pos (string-length str)) + str + (loop (repl-substring-list str replace-list pos) + (if (repl-substring-list? str replace-list pos) + (+ (string-length + (repl-substring-list-repl str replace-list pos)) + pos) + (+ 1 pos)))))) + +;; ====================================================================== + +(define (ancestor-member nd gilist) + ;; REFENTRY ancestor-member + ;; PURP Returns the first ancestor in a list of GIs + ;; DESC + ;; Returns the first ancestor of 'nd' whose GI is a member of 'gilist'. + ;; /DESC + ;; /REFENTRY + (if (node-list-empty? nd) + (empty-node-list) + (if (member (gi nd) gilist) + nd + (ancestor-member (parent nd) gilist)))) + +(define (has-ancestor-member? nd gilist) + ;; REFENTRY has-ancestor-member-p + ;; PURP Returns true if the specified node has one of a set of GIs as an ancestor + ;; DESC + ;; Returns '#t' if 'nd' has an ancestor whose GI is a member of 'gilist'. + ;; /DESC + ;; /REFENTRY + (not (node-list-empty? (ancestor-member nd gilist)))) + +;; ====================================================================== + +(define (descendant-of? ancestor child) + ;; REFENTRY descendant-of-p + ;; PURP Returns true if the child is some descendant of the specified node + ;; DESC + ;; Returns '#t' if 'child' is a descendant of 'ancestor'. + ;; /DESC + ;; /REFENTRY + (let loop ((c child)) + (if (node-list-empty? c) + #f + (if (node-list=? ancestor c) + #t + (loop (parent c)))))) + +;; ====================================================================== + +(define (expand-children nodelist gilist) + ;; REFENTRY expand-children + ;; PURP Expand selected nodes in a node list + ;; DESC + ;; Given a node-list, 'expand-children' replaces all of the members + ;; of the node-list whose GIs are members of 'gilist' with + ;; '(children)'. + ;; + ;; This function can be used to selectively + ;; flatten the hierarchy of a document. + ;; /DESC + ;; EXAMPLE + ;; Suppose that the node list is '(BOOKINFO PREFACE PART APPENDIX)'. + ;; '(expand-children nl ("PART"))' might return + ;; '(BOOKINFO PREFACE CHAPTER CHAPTER APPENDIX)'. + ;; /EXAMPLE + ;; /REFENTRY + (let loop ((nl nodelist) (result (empty-node-list))) + (if (node-list-empty? nl) + result + (if (member (gi (node-list-first nl)) gilist) + (loop (node-list-rest nl) + (node-list result (children (node-list-first nl)))) + (loop (node-list-rest nl) + (node-list result (node-list-first nl))))))) + +;; ====================================================================== + +(define (directory-depth pathname) + ;; REFENTRY directory-depth + ;; PURP Count the directory depth of a path name + ;; DESC + ;; Returns the number of directory levels in 'pathname' + ;; + ;; The pathname must end in a filename. + ;; Further, this function assumes that directories in a pathname are + ;; separated by forward slashes ("/"). + ;; /DESC + ;; EXAMPLE + ;; "filename" => 0, + ;; "foo/filename" => 1, + ;; "foo/bar/filename => 2, + ;; "foo/bar/../filename => 1. + ;; /EXAMPLE + ;; /REFENTRY + (let loop ((count 0) (pathlist (match-split pathname "/"))) + (if (null? pathlist) + (- count 1) ;; pathname should always end in a filename + (if (or (equal? (car pathlist) "/") (equal? (car pathlist) ".")) + (loop count (cdr pathlist)) + (if (equal? (car pathlist) "..") + (loop (- count 1) (cdr pathlist)) + (loop (+ count 1) (cdr pathlist))))))) + + +(define (file-extension filespec) + ;; REFENTRY file-extension + ;; PURP Return the extension of a filename + ;; DESC + ;; Returns the extension of a filename. The extension is the last + ;; "."-delimited part of the name. Returns "" if there is no period + ;; in the filename. + ;; /DESC + ;; /REFENTRY + (if (string? filespec) + (let* ((pathparts (match-split filespec "/")) + (filename (list-ref pathparts (- (length pathparts) 1))) + (fileparts (match-split filename ".")) + (extension (list-ref fileparts (- (length fileparts) 1)))) + (if (> (length fileparts) 1) + extension + "")) + "")) + +;; ====================================================================== + +(define (copy-string string num) + ;; REFENTRY copy-string + ;; PURP Return a string duplicated a specified number of times + ;; DESC + ;; Copies 'string' 'num' times and returns the result. + ;; /DESC + ;; EXAMPLE + ;; (copy-string "x" 3) returns "xxx" + ;; /EXAMPLE + ;; /REFENTRY + (if (<= num 0) + "" + (let loop ((str string) (count (- num 1))) + (if (<= count 0) + str + (loop (string-append str string) (- count 1)))))) + +;; ====================================================================== + +(define (node-list-filter-by-gi nodelist gilist) + ;; REFENTRY node-list-filter-by-gi + ;; PURP Returns selected elements from a node list + ;; DESC + ;; Returns a node list containing all the nodes from 'nodelist' whose + ;; GIs are members of 'gilist'. The order of nodes in the node list + ;; is preserved. + ;; /DESC + ;; /REFENTRY + (let loop ((result (empty-node-list)) (nl nodelist)) + (if (node-list-empty? nl) + result + (if (member (gi (node-list-first nl)) gilist) + (loop (node-list result (node-list-first nl)) + (node-list-rest nl)) + (loop result (node-list-rest nl)))))) + +;; ====================================================================== + +(define (node-list-filter-by-not-gi nodelist gilist) + ;; REFENTRY node-list-filter-by-not-gi + ;; PURP Returns selected elements from a node list + ;; DESC + ;; Returns a node list containing all the nodes from 'nodelist' whose + ;; GIs are NOT members of 'gilist'. The order of nodes in the node list + ;; is preserved. + ;; /DESC + ;; /REFENTRY + (let loop ((result (empty-node-list)) (nl nodelist)) + (if (node-list-empty? nl) + result + (if (member (gi (node-list-first nl)) gilist) + (loop result (node-list-rest nl)) + (loop (node-list result (node-list-first nl)) + (node-list-rest nl)))))) + +;; ====================================================================== + +(define (node-list-filter-out-pis nodelist) + ;; REFENTRY node-list-filter-out-pis + ;; PURP Returns the nodelist with all PIs removed + ;; DESC + ;; Returns a node list containing all the nodes from 'nodelist' that + ;; are not PIs. The order of nodes in the node list is preserved. + ;; /DESC + ;; /REFENTRY + (let loop ((result (empty-node-list)) (nl nodelist)) + (if (node-list-empty? nl) + result + (if (equal? (node-property 'class-name (node-list-first nl)) 'pi) + (loop result (node-list-rest nl)) + (loop (node-list result (node-list-first nl)) + (node-list-rest nl)))))) + +;; ====================================================================== + +(define (node-list-filter-elements nodelist) + ;; REFENTRY node-list-filter-elements + ;; PURP Returns the elements in 'nodelist' + ;; DESC + ;; Returns the elements in 'nodelist' + ;; /DESC + ;; /REFENTRY + (let loop ((result (empty-node-list)) (nl nodelist)) + (if (node-list-empty? nl) + result + (if (equal? (node-property 'class-name (node-list-first nl)) 'element) + (loop (node-list result (node-list-first nl)) + (node-list-rest nl)) + (loop result (node-list-rest nl)))))) + +;; ====================================================================== + +(define (component-descendant-node-list inputnd complist) + ;; REFENTRY component-descendant-node-list + ;; PURP Find all 'inputnd's within an ancestor element + ;; DESC + ;; Finds the first ancestor of 'inputnd' in 'complist' and then returns + ;; a node list of all the 'inputnd's within (that are descendants of) + ;; that ancestor. + ;; /DESC + ;; /REFENTRY + (let ((nd (ancestor-member inputnd complist))) + (select-elements (descendants nd) (gi inputnd)))) + +(define (component-child-number inputnd complist) + ;; REFENTRY component-child-number + ;; PURP Find child-number within a component + ;; DESC + ;; Finds the first ancestor of 'inputnd' in 'complist' and then counts + ;; all the elements of type 'inputnd' from that point on and returns + ;; the number of 'inputnd'. (This is like a 'recursive-child-number' + ;; starting at the first parent of 'inputnd' in 'complist'.) + ;; /DESC + ;; /REFENTRY + (let loop ((nl (component-descendant-node-list inputnd complist)) + (num 1)) + (if (node-list-empty? nl) + 0 + (if (node-list=? (node-list-first nl) inputnd) + num + (if (string=? (gi (node-list-first nl)) (gi inputnd)) + (loop (node-list-rest nl) (+ num 1)) + (loop (node-list-rest nl) num)))))) + +(define (component-list-descendant-node-list inputnd inputlist complist) + ;; REFENTRY component-descendant-list-node-list + ;; PURP Find all elements of a list of elements in a component + ;; DESC + ;; Finds the first ancestor of 'inputnd' in 'complist' and + ;; then returns a list of all the elements in 'inputlist' + ;; within that component. + ;; + ;; WARNING: this requires walking over *all* the descendants + ;; of the ancestor node. This may be *slow*. + ;; /DESC + ;; /REFENTRY + (let ((nd (ancestor-member inputnd complist))) + (let loop ((nl (descendants nd)) (result (empty-node-list))) + (if (node-list-empty? nl) + result + (if (member (gi (node-list-first nl)) inputlist) + (loop (node-list-rest nl) + (node-list result (node-list-first nl))) + (loop (node-list-rest nl) + result)))))) + +(define (component-list-child-number inputnd inputlist complist) + ;; REFENTRY component-list-child-number + ;; PURP Find child-number of a list of children within a component + ;; DESC + ;; Finds the first ancestor of 'inputnd' in 'complist' and + ;; then counts all the elements of the types in 'inputlist' + ;; from that point on and returns the number of 'inputnd'. + ;; + ;; If the node is not found, 0 is returned. + ;; + ;; WARNING: this requires walking over *all* the descendants + ;; of the ancestor node. This may be *slow*. + ;; /DESC + ;; /REFENTRY + (let loop ((nl (component-list-descendant-node-list + inputnd inputlist complist)) + (num 1)) + (if (node-list-empty? nl) + 0 + (if (node-list=? (node-list-first nl) inputnd) + num + (loop (node-list-rest nl) (+ num 1)))))) + +;; ====================================================================== + +(define (expt b n) + ;; REFENTRY expt + ;; PURP Exponentiation + ;; DESC + ;; Returns 'b' raised to the 'n'th power for integer 'n' >= 0. + ;; /DESC + ;; /REFENTRY + ;; + (if (<= n 0) + 1 + (* b (expt b (- n 1))))) + +;; ====================================================================== + +(define (list-member-find element elementlist) + ;; REFENTRY list-member-find + ;; PURP Returns the index of an element in a list + ;; DESC + ;; Returns the index of 'element' in the list 'elementlist'. The + ;; first element in a list has index 0. + ;; /DESC + ;; /REFENTRY + (let loop ((elemlist elementlist) (count 0)) + (if (null? elemlist) + -1 + (if (equal? element (car elemlist)) + count + (loop (cdr elemlist) (+ count 1)))))) + +;; ====================================================================== + +(define default-uppercase-list + ;; REFENTRY + ;; PURP The default list of uppercase characters + ;; DESC + ;; The default list of uppercase characters. The order and sequence + ;; of characters + ;; in this list must match the order and sequence in + ;; 'default-lowercase-list'. + ;; /DESC + ;; /REFENTRY + '(#\A #\B #\C #\D #\E #\F #\G #\H #\I #\J #\K #\L #\M + #\N #\O #\P #\Q #\R #\S #\T #\U #\V #\W #\X #\Y #\Z)) + +(define default-lowercase-list + ;; REFENTRY + ;; PURP The default list of lowercase characters + ;; DESC + ;; The default list of lowercase characters. The order and sequence + ;; of characters + ;; in this list must match the order and sequence in + ;; 'default-uppercase-list'. + ;; /DESC + ;; /REFENTRY + '(#\a #\b #\c #\d #\e #\f #\g #\h #\i #\j #\k #\l #\m + #\n #\o #\p #\q #\r #\s #\t #\u #\v #\w #\x #\y #\z)) + + +(define (case-fold-down-char ch #!optional (uc-list default-uppercase-list) + (lc-list default-lowercase-list)) + ;; REFENTRY + ;; PURP Return the lowercase form of a single character + ;; DESC + ;; Returns the lowercase form of 'ch' if 'ch' is a member of + ;; the uppercase list, otherwise return 'ch'. + ;; + ;; The implied mapping from uppercase to lowercase in the two lists is + ;; one-to-one. The first element of the uppercase list is the uppercase + ;; form of the first element of the lowercase list, and vice versa. + ;; ARGS + ;; ARG 'ch' + ;; The character to fold down. + ;; /ARG + ;; ARG 'uc-list' o + ;; The list of uppercase letters. The default is the list of English + ;; uppercase letters. + ;; /ARG + ;; ARG 'lc-list' o + ;; The list of lowercase letters. The default is the list of English + ;; lowercase letters. + ;; /ARG + ;; /ARGS + ;; /DESC + ;; /REFENTRY + (let ((idx (list-member-find ch uc-list))) + (if (>= idx 0) + (list-ref lc-list idx) + ch))) + +(define (case-fold-up-char ch #!optional (uc-list default-uppercase-list) + (lc-list default-lowercase-list)) + ;; REFENTRY + ;; PURP Return the uppercase form of a single character + ;; DESC + ;; Returns the uppercase form of 'ch' if 'ch' is a member of + ;; 'lowercase-list', otherwise return 'ch'. + ;; + ;; The implied mapping from uppercase to lowercase in the two lists is + ;; one-to-one. The first element of the uppercase list is the uppercase + ;; form of the first element of the lowercase list, and vice versa. + ;; ARGS + ;; ARG 'ch' + ;; The character to fold down. + ;; /ARG + ;; ARG 'uc-list' o + ;; The list of uppercase letters. The default is the list of English + ;; uppercase letters. + ;; /ARG + ;; ARG 'lc-list' o + ;; The list of lowercase letters. The default is the list of English + ;; lowercase letters. + ;; /ARG + ;; /ARGS + ;; /DESC + ;; /REFENTRY + (let ((idx (list-member-find ch lc-list))) + (if (>= idx 0) + (list-ref uc-list idx) + ch))) + +(define (case-fold-down-charlist charlist) + ;; REFENTRY case-fold-down-charlist + ;; PURP Return the list of characters, shifted to lowercase + ;; DESC + ;; Shifts all of the characters in 'charlist' to lowercase with + ;; 'case-fold-down-char'. + ;; /DESC + ;; /REFENTRY + (if (null? charlist) + '() + (cons (case-fold-down-char (car charlist)) + (case-fold-down-charlist (cdr charlist))))) + +(define (case-fold-up-charlist charlist) + ;; REFENTRY case-fold-up-charlist + ;; PURP Return the list of characters, shifted to uppercase + ;; DESC + ;; Shifts all of the characters in 'charlist' to uppercase with + ;; 'case-fold-up-char'. + ;; /DESC + ;; /REFENTRY + (if (null? charlist) + '() + (cons (case-fold-up-char (car charlist)) + (case-fold-up-charlist (cdr charlist))))) + +(define (case-fold-down str) + ;; REFENTRY case-fold-down + ;; PURP Shift a string to lowercase + ;; DESC + ;; Returns 'str' in lowercase. + ;; /REFENTRY + (if (string? str) + (apply string (case-fold-down-charlist (string->list str))) + str)) + +(define (case-fold-up str) + ;; REFENTRY case-fold-up + ;; PURP Shift a string to uppercase + ;; DESC + ;; Returns 'str' in uppercase. + ;; /REFENTRY + (if (string? str) + (apply string (case-fold-up-charlist (string->list str))) + str)) + +;; ====================================================================== + +(define (find-first-char string skipchars findchars #!optional (pos 0)) + ;; REFENTRY find-first-char + ;; PURP Find the first occurance of a character in a string + ;; DESC + ;; Finds first character in 'string' that is in 'findchars', skipping all + ;; occurances of characters in 'skipchars'. Search begins at 'pos'. If + ;; no such characters are found, returns -1. + ;; + ;; If skipchars is empty, skip anything not in findchars + ;; If skipchars is #f, skip nothing + ;; If findchars is empty, the first character not in skipchars is matched + ;; It is an error if findchars is not a string. + ;; It is an error if findchars is empty and skipchars is not a non-empty + ;; string. + ;; /DESC + ;; /REFENTRY + (let ((skiplist (if (string? skipchars) + (string->list skipchars) + '())) + (findlist (string->list findchars))) + (if (and (null? skiplist) (null? findlist)) + ;; this is an error + -2 + (if (or (>= pos (string-length string)) (< pos 0)) + -1 + (let ((ch (string-ref string pos))) + (if (null? skiplist) + ;; try to find first + (if (member ch findlist) + pos + (if (string? skipchars) + (find-first-char string + skipchars findchars (+ 1 pos)) + -1)) + ;; try to skip first + (if (member ch skiplist) + (find-first-char string skipchars findchars (+ 1 pos)) + (if (or (member ch findlist) (null? findlist)) + pos + -1)))))))) + +;; ====================================================================== + +(define (parse-measurement measure) + ;; REFENTRY parse-measurement + ;; PURP Parse a string containing a measurement and return the magnitude and units + ;; DESC + ;; Parse a string containing a measurement, e.g., '"3pi"' or '"2.5in"', + ;; and return the magnitude and units: '(3 "pi")' or '(2.5 "in")'. + ;; + ;; Either element of the list may be '#f' if the string cannot reasonably + ;; be parsed as a measurement. Leading and trailing spaces are ignored. + ;; /DESC + ;; /REFENTRY + (let* ((magstart (find-first-char measure " " "0123456789.")) + (unitstart (find-first-char measure " 0123456789." "")) + (unitend (find-first-char measure "" " " unitstart)) + (magnitude (if (< magstart 0) + #f + (if (< unitstart 0) + (substring measure + magstart + (string-length measure)) + (substring measure magstart unitstart)))) + (unit (if (< unitstart 0) + #f + (if (< unitend 0) + (substring measure + unitstart + (string-length measure)) + (substring measure unitstart unitend))))) + (list magnitude unit))) + +(define unit-conversion-alist + ;; REFENTRY + ;; PURP Defines the base length of specific unit names + ;; DESC + ;; This list identifies the length of each unit. + ;; /DESC + ;; /REFENTRY + (list + '("default" 1pi) + '("mm" 1mm) + '("cm" 1cm) + '("in" 1in) + '("pi" 1pi) + '("pc" 1pi) + '("pt" 1pt) + '("px" 1px) + '("barleycorn" 2pi))) + +(define (measurement-to-length measure) + ;; REFENTRY measurement-to-length + ;; PURP Convert a measurement to a length + ;; DESC + ;; Given a string containing a measurement, return that measurement + ;; as a length. + ;; /DESC + ;; EXAMPLES + ;; '"2.5cm"' returns 2.5cm as a length. '"3.4barleycorn"' returns + ;; 6.8pi. + ;; /EXAMPLES + ;; /REFENTRY + (let* ((pm (car (parse-measurement measure))) + (pu (car (cdr (parse-measurement measure)))) + (magnitude (if pm pm "1")) + (units (if pu pu (if pm "pt" "default"))) + (unitconv (assoc units unit-conversion-alist)) + (factor (if unitconv (car (cdr unitconv)) 1pt))) + (* (string->number magnitude) factor))) + +;; ====================================================================== + +(define (dingbat usrname) + ;; REFENTRY dingbat + ;; PURP Map dingbat names to Unicode characters + ;; DESC + ;; Map a dingbat name to the appropriate Unicode character. + ;; /DESC + ;; /REFENTRY + ;; Print dingbats and other characters selected by name + (let ((name (case-fold-down usrname))) + (case name + ;; For backward compatibility + (("box") "\white-square;") + (("checkbox") "\white-square;") + ;; \check-mark prints the wrong symbol (in Jade 0.8 RTF backend) + (("check") "\heavy-check-mark;") + (("checkedbox") "\ballot-box-with-check;") + (("dash") "\em-dash;") + (("copyright") "\copyright-sign") + + ;; Straight out of Unicode + (("raquo") "\U-00BB;") + (("laquo") "\U-00AB;") + (("rsaquo") "\U-203A;") + (("lsaquo") "\U-2039;") + (("lsquo") "\U-2018;") + (("rsquo") "\U-2019;") + (("ldquo") "\U-201C;") + (("rdquo") "\U-201D;") + (("ldquor") "\U-201E;") + (("rdquor") "\U-201D;") + (("en-dash") "\en-dash;") + (("em-dash") "\em-dash;") + (("en-space") "\U-2002;") + (("em-space") "\U-2003;") + (("bullet") "\bullet;") + (("black-square") "\black-square;") + (("white-square") "\white-square;") + ;; \ballot-box name doesn't work (in Jade 0.8 RTF backend) + ;; and \white-square looks better than \U-2610; anyway + (("ballot-box") "\white-square;") + (("ballot-box-with-check") "\ballot-box-with-check;") + (("ballot-box-with-x") "\ballot-box-with-x;") + ;; \check-mark prints the wrong symbol (in Jade 0.8 RTF backend) + (("check-mark") "\heavy-check-mark;") + ;; \ballot-x prints out the wrong symbol (in Jade 0.8 RTF backend) + (("ballot-x") "\heavy-check-mark;") + (("copyright-sign") "\copyright-sign;") + (("registered-sign") "\registered-sign;") + (else "\bullet;")))) + +;; ====================================================================== + +(define (nth-node nl k) + ;; REFENTRY nth-node + ;; PURP Return a specific node in a node list (by numeric index) + ;; DESC + ;; Returns the 'k'th node in 'nl'. The first node in the node list + ;; has the index "1". + ;; /DESC + ;; /REFENTRY + (if (equal? k 1) + (node-list-first nl) + (nth-node (node-list-rest nl) (- k 1)))) + +;; ====================================================================== + +(define (constant-list value length) + ;; REFENTRY constant-list + ;; PURP Returns a list of the specified value + ;; DESC + ;; Return a list containing 'length' elements, each of 'value'. + ;; /DESC + ;; AUTHOR David Carlisle + ;; EXAMPLE + ;; '(constant-list 0 4)' returns '(0 0 0 0)' + ;; /EXAMPLE + ;; /REFENTRY + (let loop ((count (abs length)) (result '())) + (if (equal? count 0) + result + (loop (- count 1) (cons value result))))) + +(define (list-head inputlist k) + ;; REFENTRY list-head + ;; PURP Return the head of a list + ;; DESC + ;; Returns the list that contains the first 'k' elements of 'inputlist'. + ;; /DESC + ;; EXAMPLE + ;; '(list-head (1 2 3 4) 2)' returns '(1 2)'. + ;; /EXAMPLE + ;; /REFENTRY + (let loop ((l inputlist) (count k) (result '())) + (if (<= count 0) + result + (loop (cdr l) (- count 1) (append result (list (car l))))))) + +(define (list-put vlist ordinal value #!optional (span 1)) + ;; REFENTRY list-put + ;; PURP Replace a specific member of a list + ;; DESC + ;; Replaces the 'ordinal'th value of 'vlist' with 'value'. If 'span' > 1, + ;; replaces 'ordinal' to 'ordinal+span-1' values starting at 'ordinal'. + ;; /DESC + ;; EXAMPLE + ;; '(list-put (1 2 3 4 5) 2 0 2)' returns '(1 0 0 4 5)'. + ;; /EXAMPLE + ;; /REFENTRY + (let loop ((result vlist) (count span) (k ordinal)) + (if (equal? count 0) + result + (let ((head (list-head result (- k 1))) + (tail (list-tail result k))) + (loop (append head (list value) tail) (- count 1) (+ k 1)))))) + +(define (decrement-list-members vlist #!optional (decr 1) (floor 0)) + ;; REFENTRY decrement-list-members + ;; PURP Decrement each member of a list + ;; DESC + ;; Decrement all the values of a list by 'decr', not to fall below 'floor'. + ;; ARGS + ;; ARG 'vlist' + ;; The list of values. All the values of this list should be numeric. + ;; /ARG + ;; ARG 'decr' o + ;; The amount by which each element of the list should be decremented. + ;; The default is 1. + ;; /ARG + ;; ARG 'floor' o + ;; The value below which each member of the list is not allowed to fall. + ;; The default is 0. + ;; /ARG + ;; /ARGS + ;; /DESC + ;; AUTHOR David Carlisle + ;; EXAMPLE + ;; '(decrement-list-members (0 1 2 3 4 5))' => '(0 0 1 2 3 4)'. + ;; /EXAMPLE + ;; /REFENTRY + (map (lambda (a) + (if (<= a (+ decr floor)) + floor + (- a decr))) + vlist)) + +;; ====================================================================== + +(define (sgml-root-element #!optional (grove-node (current-node))) + ;; REFENTRY + ;; PURP Returns the node that is the root element of the current document + ;; DESC + ;; Returns the node that is the root element of the current document + ;; /DESC + ;; /REFENTRY + (node-property 'document-element (node-property 'grove-root grove-node))) + +(define (sgml-root-element? node) + ;; REFENTRY + ;; PURP Test if a node is the root element + ;; DESC + ;; Returns '#t' if node is the root element of the current document. + ;; /DESC + ;; /REFENTRY + (node-list=? node (sgml-root-element node))) + +;; ====================================================================== + +(define (length-string-number-part lenstr) + ;; REFENTRY length-string-number-part + ;; PURP Returns the numeric part of a length string + ;; DESC + ;; Given a length as a string, return the numeric part. + ;; /DESC + ;; EXAMPLE + ;; '"100pt"' returns '"100"'. '"30"' returns '"30"'. + ;; '"in"' returns '""'. + ;; /EXAMPLE + ;; /REFENTRY + (let ((digits '(#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9 #\.))) + (let loop ((chars (string->list lenstr)) + (number-part "")) + (if (or (null? chars) (not (member (car chars) digits))) + number-part + (loop (cdr chars) (string-append number-part + (string (car chars)))))))) + +(define (length-string-unit-part lenstr) + ;; REFENTRY length-string-unit-part + ;; PURP Returns the unit part of a length string + ;; DESC + ;; Given a length as a string, return the units part. + ;; /DESC + ;; EXAMPLE + ;; '"100pt"' returns '"pt"'. '"30"' returns '""'. + ;; '"in"' returns '"in"'. + ;; /EXAMPLE + ;; /REFENTRY + (let ((number-part (length-string-number-part lenstr)) + (strlen (string-length lenstr))) + (if (equal? (string-length number-part) strlen) + "" + (substring lenstr (string-length number-part) strlen)))) + +;; ====================================================================== + +(define (normalize str) + ;; REFENTRY normalize + ;; PURP Normalize the str according to the SGML declaration in effect + ;; DESC + ;; Performs SGML general name normalization on the string; + ;; used to compare attribute names and generic identifiers correctly + ;; according to the SGML declaration in effect; this is necessary + ;; since XML is case-sensitive but the reference concrete syntax and + ;; many SGML DTDs are not. + ;; /DESC + ;; AUTHOR Chris Maden + ;; /REFENTRY + (if (string? str) + (general-name-normalize str + (current-node)) + str)) + +;; ====================================================================== + +(define (node-list->string nodelist) + ;; REFENTRY node-2-string + ;; PURP Return a string representation of the node list + ;; DESC + ;; Builds a string representation of the node list and returns it. + ;; The representation is + ;; + ;; "gi(firstchildgi()secondchildgi(firstgrandchildgi())) secondgi()..." + ;; + ;; This is a debugging function, in case that wasn't obvious... + ;; /DESC + ;; /REFENTRY + (let loop ((nl nodelist) (res "")) + (if (node-list-empty? nl) + res + (loop (node-list-rest nl) + (string-append res + (if (gi (node-list-first nl)) + (string-append + (gi (node-list-first nl)) + "(" + (node-list->string + (children (node-list-first nl))) + ")") + "")))))) + +;; ====================================================================== + +(define (include-file fileref) + ;; REFENTRY include-file + ;; PURP Return the literal content of fileref + ;; DESC + ;; Opens and loads fileref with (read-entity); returns the content + ;; of fileref as a (literal). Trims the last trailing newline off + ;; the file so that "the right thing" happens in asis environments. + ;; /DESC + ;; /REFENTRY + (literal (include-characters fileref))) + +;; ====================================================================== + +(define (include-characters fileref) + ;; REFENTRY include-characters + ;; PURP Return the character content of fileref + ;; DESC + ;; Opens and loads fileref with (read-entity); returns the content + ;; of fileref as characters. Trims the last trailing newline off + ;; the file so that "the right thing" happens in asis environments. + ;; /DESC + ;; /REFENTRY + (let* ((newline #\U-000D) + (file-content (read-entity fileref)) + (file-length (string-length file-content)) + ;; If the last char is a newline, drop it, otherwise print it... + (content (if (equal? newline (string-ref file-content + (- file-length 1))) + (substring file-content 0 (- file-length 1)) + file-content))) + content)) + +;; ====================================================================== + +(define (url-encode-char ch) + ;; REFENTRY url-encode-char + ;; PURP Returns the url-encoded equivalent of a character + ;; DESC + ;; Converts 'ch' to a properly encoded URL character. + ;; /DESC + ;; /REFENTRY + (cond ((char=? ch #\space) "%20") ; space + ((char=? ch #\U-0026) "%26") ; ampersand + ((char=? ch #\?) "%3F") ; question + ((char=? ch #\{) "%7B") ; open curly + ((char=? ch #\}) "%7D") ; close curly + ((char=? ch #\|) "%7C") ; vertical bar + ((char=? ch #\\) "%5C") ; backslash + ((char=? ch #\/) "%2F") ; slash + ((char=? ch #\^) "%5E") ; caret + ((char=? ch #\~) "%7E") ; tilde + ((char=? ch #\[) "%5B") ; open square + ((char=? ch #\]) "%5D") ; close square + ((char=? ch #\`) "%60") ; backtick + ((char=? ch #\%) "%25") ; percent + ((char=? ch #\+) "%2B") ; plus + (else (string ch)))) + +(define (url-encode-string str) + ;; REFENTRY url-encode-string + ;; PURP Returns str with all special characters %-encoded + ;; DESC + ;; Converts 'str' to a properly encoded URL string. Returns str unchanged + ;; if it is not a string. + ;; /DESC + ;; /REFENTRY + (if (string? str) + (let loop ((charlist (string->list str)) (url "")) + (if (null? charlist) + url + (loop (cdr charlist) + (string-append url (url-encode-char (car charlist)))))) + str)) + +;; ====================================================================== + +(define (system-id-filename target) + ;; REFENTRY system-id-filename + ;; PURP Returns the filename part of the system id of target + ;; DESC + ;; The entity-generated-system-id of target seems to begin with a + ;; keyword, usually OSFILE on my system, in angle brackets. + ;; This function removes the leading OSFILE bit. + ;; /DESC + ;; /REFENTRY + (let* ((sysid (entity-generated-system-id target)) + (fnbits (split sysid '(#\>))) + (fntail (cdr fnbits))) + (join fntail "\U-0061;"))) + +;; ====================================================================== + +(define (trim-string str string-list) + ;; REFENTRY trim-string + ;; PURP Trims the tail off of a string + ;; DESC + ;; If 'str' ends with any of the strings in 'string-list', trim that + ;; string off and return the base string. + ;; E.g., '(trim-string "filename.sgm" '(".sgm" ".xml" ".sgml")) + ;; returns "filename". + ;; /DESC + ;; /REFENTRY + (let ((strlen (string-length str))) + (let loop ((sl string-list)) + (if (null? sl) + str + (if (equal? + (substring str (- strlen (string-length (car sl))) strlen) + (car sl)) + (substring str 0 (- strlen (string-length (car sl)))) + (loop (cdr sl))))))) + +;; ====================================================================== + +(define (string-index source target) + ;; REFENTRY string-index + ;; PURP Finds first occurance of 'target' in 'source' + ;; DESC + ;; Returns the position of the first occurance of 'target' in 'source', + ;; or -1 if it does not occur. + ;; /DESC + ;; /REFENTRY + (let loop ((str source) (pos 0)) + (if (< (string-length str) (string-length target)) + -1 + (if (string=? (substring str 0 (string-length target)) target) + pos + (loop (substring str 1 (string-length str)) + (+ pos 1)))))) + +;; ====================================================================== + +(define (parse-pi-attribute pivalues #!optional (skip #f)) + (let* ((equalpos (string-index pivalues "=")) + (name (substring pivalues 0 equalpos)) + (quotchar (substring pivalues (+ equalpos 1) (+ equalpos 2))) + (rest (substring pivalues + (+ equalpos 2) + (string-length pivalues))) + (quotpos (string-index rest quotchar)) + (value (substring rest 0 quotpos)) + (morevals (strip (substring rest + (+ quotpos 1) + (string-length rest))))) + (if skip + morevals + (list name value)))) + +(define (parse-skip-pi-attribute pivalues) + (parse-pi-attribute pivalues #t)) + +(define (parse-starttag-pi pi) + ;; REFENTRY parse-starttag-pi + ;; PURP Parses a structured PI and returns a list of values + ;; DESC + ;; It has become common practice to give PIs structured values. The + ;; result is a PI that looks a lot like a start tag with attributes: + ;; + ;; <?pitarget name1="value1" name2='value2' name3="value '3'"> + ;; + ;; This function parses a PI with this form and returns a list. The + ;; list contains the pitarget and each of the name/value pairs: + ;; + ;; ("pitarget" "name1" "value1" "name2" "value2" "name3" "value '3'") + ;; /DESC + ;; /REFENTRY + (let* ((strippi (strip pi)) + (spacepos (string-index strippi " "))) + (if (< spacepos 0) + (list strippi) + (let* ((pitarget (substring strippi 0 spacepos)) + (pivalues (strip (substring strippi + (+ spacepos 1) + (string-length strippi))))) + (let loop ((values pivalues) (result (list pitarget))) + (if (string=? values "") + result + (loop (parse-skip-pi-attribute values) + (append result (parse-pi-attribute values))))))))) + +;; ====================================================================== + +(define (string->nodes s) + ;; Escape XML characters... + (let* ((achars (string-replace s "&" "&#38;#38;")) + (bchars (string-replace achars "<" "&#38;#60;")) + (cchars (string-replace bchars ">" "&#38;#62;"))) + (let ((doc (string-append "<literal><!DOCTYPE doc [ <!ELEMENT " + "doc - - (#PCDATA)> ]><doc>" cchars ";</doc>"))) + (children (node-property 'docelem (sgml-parse doc)))))) + +;; ====================================================================== + + + + diff --git a/olink/ChangeLog b/olink/ChangeLog new file mode 100644 index 0000000..0243ae3 --- /dev/null +++ b/olink/ChangeLog @@ -0,0 +1,4 @@ +2001-04-02 Norman Walsh + + * olink.dsl: New file. + diff --git a/olink/olink.dsl b/olink/olink.dsl new file mode 100644 index 0000000..72b4f25 --- /dev/null +++ b/olink/olink.dsl @@ -0,0 +1,175 @@ + +]> + + + + + +;; $Id: olink.dsl,v 1.1 2001/04/02 21:40:28 nwalsh Exp $ + +(define %doctype-pubid% "-//Norman Walsh//DTD DocBook OLink Summary V1.1//EN") + +(root + (make sequence + (make document-type + name: "div" + public-id: %doctype-pubid%) + (with-mode olink-mode (process-children)))) + +(define (attrs #!optional (nd (current-node))) + (let* ((id (attribute-string (normalize "id") nd)) + (arch (inherited-attribute-string (normalize "arch") nd)) + (conformance (inherited-attribute-string + (normalize "conformance") nd)) + (os (inherited-attribute-string (normalize "os") nd)) + (revision (inherited-attribute-string (normalize "revision") nd)) + (userlevel (inherited-attribute-string (normalize "userlevel") nd)) + (vendor (inherited-attribute-string (normalize "vendor") nd)) + (label (element-label nd #t)) + (gielem (case-fold-down (gi nd))) + (giname (gentext-element-name (gi nd))) + (href (href-to nd))) + (append + (list (list "type" gielem)) + (list (list "name" giname)) + (list (list "href" href)) + (if id (list (list "id" id)) '()) + (if (equal? label "") '() (list (list "label" label))) + (if arch (list (list "arch" arch)) '()) + (if conformance (list (list "conformance" conformance)) '()) + (if os (list (list "os" os)) '()) + (if revision (list (list "revision" revision)) '()) + (if userlevel (list (list "userlevel" userlevel)) '()) + (if vendor (list (list "vendor" vendor)) '())))) + +(define (div #!optional (nd (current-node))) + (let* ((attributes (attrs nd)) + (xreflabel (attribute-string (normalize "xreflabel") nd)) + (title (if xreflabel + xreflabel + (element-title nd)))) + (make element gi: "div" + attributes: attributes + (make element gi: "ttl" + (if (string? title) + (literal title) + (with-mode olink-title-mode + (process-node-list title)))) + (process-children)))) + +(define (obj #!optional (nd (current-node))) + (let* ((attributes (attrs nd)) + (title (element-title nd))) + (make sequence + (make element gi: "obj" + attributes: attributes + (make element gi: "ttl" + (if (string? title) + (literal title) + (with-mode olink-title-mode + (process-node-list title)))) + (process-children))))) + +(mode olink-mode + (default + ;; process only the element children + (let ((elem (let loop ((nl (children (current-node))) + (elem (empty-node-list))) + (if (node-list-empty? nl) + elem + (if (equal? (node-property 'class-name + (node-list-first nl)) + 'element) + (loop (node-list-rest nl) + (node-list elem (node-list-first nl))) + (loop (node-list-rest nl) elem)))))) + (if (node-list-empty? elem) + (empty-sosofo) + (process-node-list elem)))) + + (element set (div)) + (element book (div)) + (element preface (div)) + (element chapter (div)) + (element appendix (div)) + (element part (div)) + (element reference (div)) + (element article (div)) + (element refentry (div)) + + (element section (div)) + (element sect1 (div)) + (element sect2 (div)) + (element sect3 (div)) + (element sect4 (div)) + (element sect5 (div)) + + (element refsect1 (div)) + (element refsect2 (div)) + (element refsect3 (div)) + + (element figure (obj)) + (element example (obj)) + (element table (obj)) + (element equation + (if (node-list-empty? (select-elements (children (current-node)) + (normalize "title"))) + (empty-sosofo) + (obj))) +) + +(mode olink-title-mode + (default (process-children)) + + (element computeroutput + (make element gi: "tt" + (process-children))) + + (element emphasis + (make element gi: "it" + (process-children))) + + (element filename + (make element gi: "it" + (process-children))) + + (element function + (make element gi: "it" + (process-children))) + + (element literal + (make element gi: "tt" + (process-children))) + + (element markup + (make element gi: "tt" + (process-children))) + + (element quote + (make element gi: "qt" + (process-children))) + + (element replaceable + (make element gi: "it" + (process-children))) + + (element subscript + (make element gi: "sub" + (process-children))) + + (element superscript + (make element gi: "sup" + (process-children))) + + (element userinput + (make element gi: "tt" + (process-children))) +) + + + + + + + diff --git a/packaging/docbook-style-dsssl.Makefile b/packaging/docbook-style-dsssl.Makefile new file mode 100644 index 0000000..d16b2d7 --- /dev/null +++ b/packaging/docbook-style-dsssl.Makefile @@ -0,0 +1,46 @@ +BINDIR = /usr/bin +DESTDIR = /usr/share/sgml/docbook/dsssl-stylesheets-1.74b + +all: install + +install: install-bin install-dtd install-dsl install-img install-misc + +install-bin: + mkdir -p $(BINDIR) + install bin/collateindex.pl $(BINDIR) + +install-dtd: + mkdir -p $(DESTDIR)/dtds/{decls,dbdsssl,html,imagelib,olink} + cp dtds/decls/docbook.dcl $(DESTDIR)/dtds/decls + cp dtds/decls/xml.dcl $(DESTDIR)/dtds/decls + cp dtds/dbdsssl/dbdsssl.dtd $(DESTDIR)/dtds/dbdsssl + cp dtds/html/dbhtml.dtd $(DESTDIR)/dtds/html + cp dtds/html/ISOlat1.gml $(DESTDIR)/dtds/html + cp dtds/imagelib/imagelib.dtd $(DESTDIR)/dtds/imagelib + cp dtds/olink/olinksum.dtd $(DESTDIR)/dtds/olink + +install-dsl: + mkdir -p $(DESTDIR)/{lib,common,html,print,olink} + cp lib/dblib.dsl $(DESTDIR)/lib + cp common/*.dsl $(DESTDIR)/common + cp common/*.ent $(DESTDIR)/common + cp html/*.dsl $(DESTDIR)/html + cp lib/dblib.dsl $(DESTDIR)/lib + cp print/*.dsl $(DESTDIR)/print + cp olink/*.dsl $(DESTDIR)/olink + +install-img: + mkdir -p $(DESTDIR)/images/callouts + cp images/*.gif $(DESTDIR)/images + cp images/callouts/*.gif $(DESTDIR)/images/callouts + +#install-test: +# mkdir -p $(DESTDIR)/test/{cases,imagelib,xml} +# cp test/*.* $(DESTDIR)/test +# cp test/cases/*.* $(DESTDIR)/test/cases +# cp test/imagelib/*.* $(DESTDIR)/test/imagelib +# cp test/xml/*.* $(DESTDIR)/test/xml + +install-misc: + cp catalog $(DESTDIR) + cp VERSION $(DESTDIR) diff --git a/packaging/docbook-style-dsssl.changes b/packaging/docbook-style-dsssl.changes new file mode 100644 index 0000000..8321f55 --- /dev/null +++ b/packaging/docbook-style-dsssl.changes @@ -0,0 +1,3 @@ +* Fri Aug 31 18:32:31 UTC 2012 - tracy.graydon@intel.com +- TIVI-153: Add docbook-style-dssl as dependency for iputils +- Imported from MeeGo trunk diff --git a/packaging/docbook-style-dsssl.spec b/packaging/docbook-style-dsssl.spec new file mode 100644 index 0000000..6f721ef --- /dev/null +++ b/packaging/docbook-style-dsssl.spec @@ -0,0 +1,89 @@ +#specfile originally created for Fedora, modified for Moblin Linux +Name: docbook-style-dsssl +Version: 1.79 +Release: 5 +Group: Applications/Text + +Summary: Norman Walsh's modular stylesheets for DocBook + +License: Freely redistributable without restriction +URL: http://docbook.sourceforge.net/ + +%define openjadever 1.3.2 +Requires: openjade = %{openjadever} +Requires: docbook-dtds >= 1.0-19 +Requires: sgml-common >= 0.5 +Requires: openjade = %{openjadever} +Conflicts: docbook-utils < 0.6.9-4 + +BuildRoot: %{_tmppath}/%{name}-%{version} + +BuildArch: noarch +Source0: http://prdownloads.sourceforge.net/docbook/docbook-dsssl-%{version}.tar.gz +Source1: %{name}.Makefile + + +%description +These DSSSL stylesheets allow to convert any DocBook document to another +printed (for example, RTF or PostScript) or online (for example, HTML) format. +They are highly customizable. + +%prep +%setup -q -n docbook-dsssl-%{version} +cp %{SOURCE1} Makefile + + +%build + + +%install +DESTDIR=$RPM_BUILD_ROOT +rm -rf $RPM_BUILD_ROOT +make install BINDIR=$DESTDIR/usr/bin DESTDIR=$DESTDIR/usr/share/sgml/docbook/dsssl-stylesheets-%{version} +cd .. +ln -s dsssl-stylesheets-%{version} $DESTDIR/usr/share/sgml/docbook/dsssl-stylesheets + + +%clean +rm -rf $RPM_BUILD_ROOT + + +%files +%defattr (-,root,root) +%doc BUGS README ChangeLog WhatsNew +/usr/bin/collateindex.pl +/usr/share/sgml/docbook/dsssl-stylesheets-%{version} +/usr/share/sgml/docbook/dsssl-stylesheets + + +%post +rel=$(echo /etc/sgml/sgml-docbook-3.0-*.cat) +rel=${rel##*-} +rel=${rel%.cat} +for centralized in /etc/sgml/*-docbook-*.cat +do + /usr/bin/install-catalog --remove $centralized \ + /usr/share/sgml/docbook/dsssl-stylesheets-*/catalog \ + >/dev/null 2>/dev/null +done + +for centralized in /etc/sgml/*-docbook-*$rel.cat +do + /usr/bin/install-catalog --add $centralized \ + /usr/share/sgml/openjade-%{openjadever}/catalog \ + > /dev/null 2>/dev/null + /usr/bin/install-catalog --add $centralized \ + /usr/share/sgml/docbook/dsssl-stylesheets-%{version}/catalog \ + > /dev/null 2>/dev/null +done + + +%preun +if [ "$1" = "0" ]; then + for centralized in /etc/sgml/*-docbook-*.cat + do /usr/bin/install-catalog --remove $centralized /usr/share/sgml/openjade-%{openjadever}/catalog > /dev/null 2>/dev/null + /usr/bin/install-catalog --remove $centralized /usr/share/sgml/docbook/dsssl-stylesheets-%{version}/catalog > /dev/null 2>/dev/null + done +fi +exit 0 + diff --git a/print/ChangeLog b/print/ChangeLog new file mode 100644 index 0000000..17e1726 --- /dev/null +++ b/print/ChangeLog @@ -0,0 +1,327 @@ +2004-10-10 + + * dbadmon.dsl: Fix for bug #522140: Keep admonition titles and contents together when + graphics are used. + + * dbcallou.dsl: Synchronized $callout-verbatim-display$ with $verbatim-display$; fixes + bug #517520 (callout ignores width of programlisting) + + * dbttlpg.dsl: Give othercredit some useful rendering in print output, by copying over the + author rendering. Fix author-list-string for authorgroups that contain + both authors and othercredits. (bug #1038081) + +2004-10-09 + + * dbprint.dsl, dbverb.dsl: Patch #571688: Fixes excessive after spacing when a listitem contains + multiple paras or verbatim environments. Patches originally by Tim Waugh + and Tammy Fox. + + * docbook.dsl: New Bulgarian translation by Viktor Vasilev (SF patch #1040075) + +2004-09-17 + + * docbook.dsl: Bosnian translation by Kemal Skripic + +2004-09-14 + + * dbblock.dsl: Fix for bug #502066: Empty ulinks don't generate footnotes, so they should + be omitted from the footnote counting. Patch by Bruce A. Mah. + + * dbprint.dsl: Fix for bug #529969: Make italic monospace and strong monospace inherit + verbatim-size-factor. Patch by David Aumueller. + +2004-07-11 + + * version.dsl: Closes Bug 912831: the last character of VERSION was being cut off. + +2003-12-05 Adam Di Carlo + + * dbdivis.dsl: fix a bug when multiple elements in $generate-book-lot-list$ had content; whitespace and comment updates + +2003-04-29 Adam Di Carlo + + * dbcompon.dsl: Finding the subtitle for a component should use the parent title if + set; this is consistent with how the title is already set; + closes SF bug 613773. + + * dbcompon.dsl: Suppress some cases where components were restarting page numbering, + fix from Ian Castle; closes SF bug 439751. + + * dbparam.dsl: Correct reference to undefined variable + "admon-graphic-default-extension". + + * dbttlpg.dsl: Add elements to print version of article-titlepage-recto-elements so + that it matches the HTML version, fixes SF bug 626909. + +2003-04-26 Adam Di Carlo + + * dbparam.dsl: rename parameter admon-graphic-default-extension to + %admon-graphics-extension% for consistency + + * dbparam.dsl: Note that %admon-graphics-path% requires the trailing directory separator + -- + + * dbparam.dsl: %admon-graphics-extension% will use the old name, + admon-graphic-default-extension, if set + +2003-03-25 Adam Di Carlo + + * db31.dsl, dbblock.dsl, dbcompon.dsl, dbgraph.dsl, dbinline.dsl, dbqanda.dsl, dbsect.dsl, docbook.dsl: + move data from db31 into its proper component files + +2003-03-24 Jirka Kosek + + * dbttlpg.dsl: Added support for revdescription inside revison on titlepages + +2003-03-21 Adam Di Carlo + + * Makefile: Don't hardcode DSSSL file list, use $(wildcard *.dsl); clean is cleaner + +2003-02-17 Adam Di Carlo + + * dbblock.dsl, dbtitle.dsl: More cases where process-children-trim should be used. + + * dbcompon.dsl: Add some comments in the ARTICLE element. + + * dblists.dsl: In process-listitem-content replace (process-node-list (children + (current-node))) with (process-children-trim) -- we need to be + trimming whitespace. Some retabbing. + + * dbprint.dsl: $paragraph$ should use (process-children-trim); this fixes a space + indent in RTF output on all PARAs marked up like: + + Content ... + + * dbtable.dsl: Remove the %cals-cell-before-column-margin% hack for TeX backend, it's + not needed anymore. + +2003-02-13 Adam Di Carlo + + * dbblock.dsl: element footnote/para uses default-text-style; set lines: wrap for the + case of endnotes within verbatim 'asis' environments, but it doesn't + seem to actually help (cf test programlisting.004) + +2003-02-07 Adam Di Carlo + + * dbttlpg.dsl: some space over copyright; fixes Bug #542681 + +2003-01-21 Adam Di Carlo + + * dbparam.dsl: correct discussion of possible settings for %paper-type% and %visual-acuity% + +2003-01-15 Adam Di Carlo + + * dbadmon.dsl, dbautoc.dsl, dbblock.dsl, dbcallou.dsl, dbdivis.dsl, dbefsyn.dsl, dbgloss.dsl, dbgraph.dsl, dbindex.dsl, dbinfo.dsl, dbinline.dsl, dblink.dsl, dblists.dsl, dblot.dsl, dbmath.dsl, dbmsgset.dsl, dbprint.dsl, dbprocdr.dsl, dbrfntry.dsl, dbsect.dsl, dbsynop.dsl, dbtable.dsl, dbtitle.dsl, dbverb.dsl, docbook.dsl, notoc.dsl, plain.dsl: + update docbook URL to http://docbook.sourceforge.net/projects/dsssl/; + N.B.: credit for the group option and repeating goes to John Daily + + * dbblock.dsl, dbparam.dsl: parameters for %formal-object-title-font-weight% + %table-title-font-weight%, reviewed and tested, sourceforge patch #599366 + + * dblink.dsl: xref to varlistentry using the term, patch from Jens Emmerich; closes + bug 520561 + + * dbsect.dsl: make
appear correctly in the PDF bookmark hierarchy; also + fix font size selection for section titles + + corrects sourceforge bugs 589247 and 524028; patch from Carsten Haese + appreciated + + * dbsynop.dsl: Patch #562401 , elipsis should be + outside of group, reference test cmdsynopsis.003 + +2002-12-16 Adam Di Carlo + + * dbblock.dsl, dbparam.dsl: %epigraph-start-indent% and %epigraph-end-indent% parameters allows + customization of epigraph positioning; %blockquote-start-indent% and + %blockquote-end-indent% parameters allows customization control of the + blockquote positioning + +2002-08-08 Adam Di Carlo + + * Makefile: clean rule + +2002-06-29 Norman Walsh + + * dbblock.dsl: Patch #473114: Footnote inherit font family + +2002-06-09 Norman Walsh + + * dbbibl.dsl, dbttlpg.dsl: Fix bug #502337: remove 'by' from copyright statements + +2002-05-22 Norman Walsh + + * dbblock.dsl: Support attribution on blockquote + + * dbinfo.dsl: Support chapterinfo, prefaceinfo, and appendixinfo + +2002-05-12 Norman Walsh + + * dbttlpg.dsl: Bug #494693: bad formalpara formatting on title pages + + * dbverb.dsl: Bugs #429663 and #474328 fixed (allow external linespecific content to be indented and numbered). Eight bit or unicode external linespecific content may be problematic though. + +2002-05-09 Norman Walsh + + * dblink.dsl: Allow xref to refnamediv + + * dblists.dsl: Bug #469318: fix variablelist indents + +2002-04-29 Norman Walsh + + * dbefsyn.dsl, dbverb.dsl: Format synopsis elements correctly outside of classsynopsis + +2002-03-21 Norman Walsh + + * dbautoc.dsl: Find titles in any context + +2002-03-20 Norman Walsh + + * dbefsyn.dsl: Support freestanding {method,field,constructor,destructor}synopsis + +2002-02-20 Norman Walsh + + * dbblock.dsl: Bug #429331: center figure title if image is centered + +2002-02-11 Norman Walsh + + * dbdivis.dsl, dbttlpg.dsl: Patch #502637: avoid blank page between title page recto/verso + + * dbsect.dsl: Add section-info function + +2001-12-01 Norman Walsh + + * dbindex.dsl: Patch #468644: Fix font sizes in index + + * dbprint.dsl: Bug #465133: Insufficient conditions on is-first-para + + * dbttlpg.dsl: Bug #465136: Verso authorgroup broken for editors--still broken but a little better + + * dbttlpg.dsl: Patch #470589: Abstracts indents should be relative + +2001-11-30 Norman Walsh + + * dblink.dsl: Patch #473113: No footnote ulink when text matches + + * dbsect.dsl: Patch #473116: Section levels + + * dbttlpg.dsl: Patch #473115: Heading levels for parts + + * docbook.dsl: Fix typo that causes the print stylesheet to break. + + * docbook.dsl: New file. + +2001-11-27 Norman Walsh + + * dbgloss.dsl, dbindex.dsl: Attempt to handle glossary and index in article correctly + +2001-11-14 Norman Walsh + + * docbook.dsl: branches: 1.5.2; + Added Basque, Nynorsk, Ukranian, and Xhosa + +2001-11-03 Norman Walsh + + * dbinline.dsl: Support pubwork=article on citetitle + +2001-10-13 Jirka Kosek + + * dbinline.dsl: Fixed bug #470840 - added support for methodname. + +2001-10-01 Norman Walsh + + * dbverb.dsl: Support linenumbering attribute on verbatim environments + +2001-09-29 Norman Walsh + + * dbadmon.dsl: Bug #449775: remove broken keep-with-next properties + + * dbcallou.dsl: Bug #449494: make callouts work even if they appear on the last line of a verbatim environment + +2001-09-23 Norman Walsh + + * dblink.dsl: Patch #461352, fix bug with ulink-footnotes and bop-footnotes simultaneously + +2001-08-30 Norman Walsh + + * db31.dsl: Fix XML/SGML discrepancy wrt normalization of notation names; move some common stuff into dbcommon + +2001-08-06 Norman Walsh + + * dbadmon.dsl: Patches #441806, keep with next in admonitions + + * dbinline.dsl: Support 'bold' and 'strong' roles on emphasis in the expected way, added %{emphasis,phrase}-propagates-style% parameters + + * docbook.dsl: Patches #439975, support OpenJade two-sided characteristics + +2001-08-01 Norman Walsh + + * dbttlpg.dsl: Don't suppress keywordset if it's put on the title page + +2001-07-07 Norman Walsh + + * dbdivis.dsl: Don't restart page numbering on ToC pages + + * notoc.dsl: Bug #439065, use correct parameters + +2001-07-05 Norman Walsh + + * dbparam.dsl: Patch #420012, Add colon to content-title-end-punct + +2001-07-04 + + * db31.dsl: Bug #426745, don't make first para of question and answer bold + + * dbblock.dsl: Bug #436220, fix table footnotes when bop-footnotes is #t + + * dbgloss.dsl, dblists.dsl, dbrfntry.dsl, dbtitle.dsl: + Bug #420015: set heading-level appropriately in glossary + + * dblists.dsl: Bug #418633, attempt to fix indentation in variablelists + + * docbook.dsl: Added Afrikaans and Turkish + +2001-05-11 Norman Walsh + + * docbook.dsl: Support Serbian and Traditional Chinese + +2001-05-03 Jirka Kosek + + * dbinline.dsl: Added support for class="xmlpi" and class="emptytag" in . + Element and attribute names displayed in monospace, same way as in HTML by XSL. + +2001-04-27 Norman Walsh + + * db31.dsl: Handle display? property correctly on imagedata graphics + +2001-04-24 Norman Walsh + + * db31.dsl: Bug #418474: only output a space after the qanda label if the label isn't empty + +2001-04-21 Norman Walsh + + * dbautoc.dsl: Make top-level entries in the TOC 'keep-with-next' + +2001-04-16 Norman Walsh + + * dbttlpg.dsl: Bug #414681: add heading-level to set and book titles + +2001-04-15 Norman Walsh + + * dbblock.dsl: Force upright posture and default quadding in footnote text + + * dblists.dsl: Format variablelist title in the table when a variablelist is formatted with a table + +2001-04-04 Norman Walsh + + * Makefile: New file. + +2001-04-03 Norman Walsh + + * db31.dsl: Fix bug 412548, allow WMF in media objects + +2001-04-02 Norman Walsh + + * .cvsignore, catalog, db31.dsl, dbadmon.dsl, dbautoc.dsl, dbbibl.dsl, dbblock.dsl, dbcallou.dsl, dbcompon.dsl, dbdivis.dsl, dbefsyn.dsl, dbgloss.dsl, dbgraph.dsl, dbindex.dsl, dbinfo.dsl, dbinline.dsl, dblink.dsl, dblists.dsl, dblot.dsl, dbmath.dsl, dbmsgset.dsl, dbparam.dsl, dbprint.dsl, dbprocdr.dsl, dbrfntry.dsl, dbsect.dsl, dbsynop.dsl, dbtable.dsl, dbtitle.dsl, dbttlpg.dsl, dbverb.dsl, docbook.dsl, notoc.dsl, plain.dsl, version.dsl: + Initial checkins + diff --git a/print/XREF b/print/XREF new file mode 100644 index 0000000..3ec54e8 --- /dev/null +++ b/print/XREF @@ -0,0 +1,2 @@ +Symbol Defined In Used In +================== ============================= ============================= diff --git a/print/catalog b/print/catalog new file mode 100644 index 0000000..f5ce23a --- /dev/null +++ b/print/catalog @@ -0,0 +1,3 @@ +CATALOG "../catalog" + + diff --git a/print/dbadmon.dsl b/print/dbadmon.dsl new file mode 100644 index 0000000..a765847 --- /dev/null +++ b/print/dbadmon.dsl @@ -0,0 +1,161 @@ +;; $Id: dbadmon.dsl,v 1.5 2004/10/10 14:18:40 petere78 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ============================ ADMONITIONS ============================= + +(define ($graphical-admonition$) + (let* ((adm (current-node)) + (title (select-elements (children adm) + (normalize "title"))) + (title? (not (node-list-empty? title))) + (adm-title (if title? + (with-mode title-sosofo-mode + (process-node-list (node-list-first title))) + (literal (gentext-element-name adm)))) + (graphic (make external-graphic + display?: #f + entity-system-id: ($admon-graphic$))) + (f-child (node-list-first (children (current-node)))) + (r-child (node-list-rest (children (current-node))))) + (make display-group + space-before: %block-sep% + space-after: %block-sep% + start-indent: (+ (inherited-start-indent) ($admon-graphic-width$)) + font-family-name: %admon-font-family% + font-size: (- %bf-size% 1pt) + font-weight: 'medium + font-posture: 'upright + line-spacing: (* (- %bf-size% 1pt) %line-spacing-factor%) + (if title? + (make display-group + (make paragraph + first-line-start-indent: (- ($admon-graphic-width$)) + keep-with-next?: #t + (make line-field + field-width: ($admon-graphic-width$) + graphic) + (make sequence + font-family-name: %title-font-family% + font-weight: 'bold + adm-title)) + (process-children)) + (make display-group + (make paragraph + first-line-start-indent: (- ($admon-graphic-width$)) + (make line-field + field-width: ($admon-graphic-width$) + graphic) + (process-node-list (children f-child))) + (process-node-list r-child)))))) + +(define ($admonition$) + (if %admon-graphics% + ($graphical-admonition$) + (make display-group + space-before: %block-sep% + space-after: %block-sep% + start-indent: (if %admon-graphics% + (inherited-start-indent) + (+ (inherited-start-indent) (* (ILSTEP) 2))) + font-size: (- %bf-size% 1pt) + font-weight: 'medium + font-posture: 'upright + font-family-name: %admon-font-family% + line-spacing: (* (- %bf-size% 1pt) %line-spacing-factor%) + (process-children)))) + +(define ($admonpara$) + (let* ((title (select-elements + (children (parent (current-node))) (normalize "title"))) + (has-title (not (node-list-empty? title))) + (adm-title (if has-title + (make sequence + (with-mode title-sosofo-mode + (process-node-list (node-list-first title))) + (literal (gentext-label-title-sep + (gi (parent (current-node)))))) + (literal + (gentext-element-name + (parent (current-node))) + (gentext-label-title-sep + (gi (parent (current-node)))))))) + (make paragraph + space-before: %para-sep% + space-after: %para-sep% + (if (and (not %admon-graphics%) (= (child-number) 1)) + (make sequence + font-family-name: %title-font-family% + font-weight: 'bold + adm-title) + (empty-sosofo)) + (process-children-trim)))) + +(element important ($admonition$)) +(element (important title) (empty-sosofo)) +(element (important para) ($admonpara$)) +(element (important simpara) ($admonpara$)) + +(element note ($admonition$)) +(element (note title) (empty-sosofo)) +(element (note para) ($admonpara$)) +(element (note simpara) ($admonpara$)) + +(element tip ($admonition$)) +(element (tip title) (empty-sosofo)) +(element (tip para) ($admonpara$)) +(element (tip simpara) ($admonpara$)) + +;; perils are given special treatment by generating a centered title +;; and throwing a box around them +;; note that the paragraph indents are set by the box characteristics +;; +(define ($peril$) + (let* ((title (select-elements + (children (current-node)) (normalize "title"))) + (has-title (not (node-list-empty? title))) + (adm-title (if has-title + (make sequence + (with-mode title-sosofo-mode + (process-node-list (node-list-first title)))) + (literal + (gentext-element-name + (current-node))))) + (hs (HSIZE 2))) + (if %admon-graphics% + ($graphical-admonition$) + (make display-group + space-before: %block-sep% + space-after: %block-sep% + font-family-name: %admon-font-family% + font-size: (- %bf-size% 1pt) + font-weight: 'medium + font-posture: 'upright + line-spacing: (* (- %bf-size% 1pt) %line-spacing-factor%) + (make box + display?: #t + box-type: 'border + line-thickness: 2pt + start-indent: (+ (inherited-start-indent) (* 2 (ILSTEP)) 2pt) + end-indent: (inherited-end-indent) + (make paragraph + space-before: %para-sep% + space-after: %para-sep% + start-indent: 1em + end-indent: 1em + font-family-name: %title-font-family% + font-weight: 'bold + font-size: hs + line-spacing: (* hs %line-spacing-factor%) + quadding: 'center + keep-with-next?: #t + adm-title) + (process-children)))))) + +(element caution ($peril$)) +(element (caution title) (empty-sosofo)) + +(element warning ($peril$)) +(element (warning title) (empty-sosofo)) diff --git a/print/dbautoc.dsl b/print/dbautoc.dsl new file mode 100644 index 0000000..2197c4a --- /dev/null +++ b/print/dbautoc.dsl @@ -0,0 +1,179 @@ +;; $Id: dbautoc.dsl,v 1.4 2003/01/15 08:24:23 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ========================== TABLE OF CONTENTS ========================= + +(define %toc-indent% 2pi) +(define %toc-spacing-factor% 0.4) + +;; Returns the depth of auto TOC that should be made at the nd-level +(define (toc-depth nd) + (if (string=? (gi nd) (normalize "book")) + 7 + 1)) + +(define (format-page-number) + (current-node-page-number-sosofo)) + +;; Prints the TOC title if first? is true, otherwise does nothing +(define (toc-title first?) + (let ((hsize (if (or (equal? (gi (current-node)) (normalize "article")) + (equal? (gi (current-node)) (normalize "part"))) + (HSIZE 3) + (HSIZE 4)))) + (if first? + (make paragraph + font-family-name: %title-font-family% + font-weight: 'bold + font-size: hsize + line-spacing: (* hsize %line-spacing-factor%) + space-before: (* hsize %head-before-factor%) + space-after: (* hsize %head-after-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 + (literal (gentext-element-name (normalize "toc")))) + (empty-sosofo)))) + +;; Prints the TOC title if first? is true, otherwise does nothing +(define (lot-title first? lotgi) + (if first? + (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%) + space-after: (* (HSIZE 4) %head-after-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 + (literal ($lot-title$ lotgi))) + (empty-sosofo))) + +;; Print the TOC entry for tocentry +(define ($toc-entry$ tocentry level) + (make paragraph + start-indent: (+ %body-start-indent% + (* %toc-indent% level)) + first-line-start-indent: (* -1 %toc-indent%) + font-weight: (if (= level 1) 'bold 'medium) + space-before: (if (= level 1) (* %toc-spacing-factor% 6pt) 0pt) + space-after: (if (= level 1) (* %toc-spacing-factor% 6pt) 0pt) + keep-with-next?: (if (= level 1) #t #f) + quadding: 'start + (make link + destination: (node-list-address tocentry) + (make sequence + (if (equal? (element-label tocentry) "") + (empty-sosofo) + (make sequence + (element-label-sosofo tocentry) + (literal (gentext-label-title-sep (gi tocentry))))) + (element-title-sosofo tocentry))) + (if (and (= level 1) + ;; ??? %chapter-title-page-separate% + %page-number-restart%) + (empty-sosofo) ;; Don't need the leader etc then + (make sequence + (make leader (literal ".")) + (make link + destination: (node-list-address tocentry) + (make sequence + (if %page-number-restart% + (literal + (string-append + (if (= level 1) + (element-label tocentry #t) + (substring (element-label tocentry #t) + 0 (string-index (element-label tocentry #t) "."))) + (gentext-intra-label-sep "_pagenumber"))) + (empty-sosofo)) + (with-mode toc-page-number-mode + (process-node-list tocentry)))))))) + +;; Build a TOC starting at nd reaching down depth levels. +;; The optional arguments are used on recursive calls to build-toc +;; and shouldn't be set by the initial caller... +;; +(define (build-toc nd depth #!optional (first? #t) (level 1)) + (let* ((toclist (toc-list-filter + (node-list-filter-by-gi (children nd) + (append (division-element-list) + (component-element-list) + (section-element-list)))))) + (if (or (<= depth 0) + (node-list-empty? toclist)) + (empty-sosofo) + (make sequence + (toc-title first?) + (let loop ((nl toclist)) + (if (node-list-empty? nl) + (empty-sosofo) + (sosofo-append + ($toc-entry$ (node-list-first nl) level) + (build-toc (node-list-first nl) (- depth 1) #f (+ level 1)) + (loop (node-list-rest nl))))))))) + +;; Print the LOT entry +(define ($lot-entry$ tocentry) + (make paragraph + start-indent: (+ %body-start-indent% %toc-indent%) + first-line-start-indent: (* -1 %toc-indent%) + font-weight: 'medium + space-before: 0pt + space-after: 0pt + quadding: 'start + (make link + destination: (node-list-address tocentry) + (make sequence + (if (equal? (element-label tocentry) "") + (empty-sosofo) + (make sequence + (element-label-sosofo tocentry #t) + (literal (gentext-label-title-sep (gi tocentry))))) + (element-title-sosofo tocentry))) + (make leader (literal ".")) + (make link + destination: (node-list-address tocentry) + (make sequence + (if %page-number-restart% + (make sequence + (literal (substring (element-label tocentry #t) + 0 (string-index (element-label tocentry #t) "-"))) + (literal (gentext-intra-label-sep "_pagenumber"))) + (empty-sosofo)) + (with-mode toc-page-number-mode + (process-node-list tocentry)))))) + +;; Build a LOT starting at nd for all the lotgi's it contains. +;; The optional arguments are used on recursive calls to build-toc +;; and shouldn't be set by the initial caller... +;; +(define (build-lot nd lotgi #!optional (first? #t)) + (let* ((lotlist (select-elements (descendants nd) + (normalize lotgi)))) + (if (node-list-empty? lotlist) + (empty-sosofo) + (make sequence + (lot-title first? lotgi) + (let loop ((nl lotlist)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (if (string=? (gi (node-list-first nl)) lotgi) + ($lot-entry$ (node-list-first nl)) + (empty-sosofo)) + (build-lot (node-list-first nl) lotgi #f) + (loop (node-list-rest nl))))))))) + +(mode toc-page-number-mode + (default + (format-page-number))) diff --git a/print/dbbibl.dsl b/print/dbbibl.dsl new file mode 100644 index 0000000..38340a9 --- /dev/null +++ b/print/dbbibl.dsl @@ -0,0 +1,868 @@ +;; $Id: dbbibl.dsl,v 1.2 2002/06/09 12:04:09 nwalsh Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ......................... BIBLIOGRAPHY PARAMS ......................... + +;; these should be in dbparam... +(define %biblsep% ", ") +(define %biblend% ".") + +(define %biblioentry-in-entry-order% #t) + +;; .................... BIBLIOGRAPHY and BIBLIODIV ...................... + +(define (bibliography-content) + ;; Note that the code below works for both the case where the bibliography + ;; has BIBLIODIVs and the case where it doesn't, by the slightly subtle + ;; fact that if it does, then allentries will be (empty-node-list). + (let* ((allbibcontent (children (current-node))) + (prebibcontent (node-list-filter-by-not-gi + allbibcontent + (list (normalize "biblioentry") + (normalize "bibliomixed")))) + (allentries (node-list-filter-by-gi + allbibcontent + (list (normalize "biblioentry") + (normalize "bibliomixed")))) + (entries (if biblio-filter-used + (biblio-filter allentries) + allentries))) + (make sequence + (process-node-list prebibcontent) + (process-node-list entries)))) + +(element (book bibliography) + (make simple-page-sequence + page-n-columns: %page-n-columns% + page-number-restart?: (or %page-number-restart% + (book-start?) + (first-chapter?)) + page-number-format: ($page-number-format$) + use: default-text-style + left-header: ($left-header$) + center-header: ($center-header$) + right-header: ($right-header$) + left-footer: ($left-footer$) + center-footer: ($center-footer$) + right-footer: ($right-footer$) + start-indent: %body-start-indent% + input-whitespace-treatment: 'collapse + quadding: %default-quadding% + (make sequence + ($component-title$) + (bibliography-content)) + (make-endnotes))) + +(element bibliography + ;; A bibliography that's inside something else... + (let* ((sect (ancestor-member (current-node) + (append (section-element-list) + (component-element-list)))) + (hlevel (+ (SECTLEVEL sect) 1)) + (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: (* hs %head-after-factor%) + start-indent: (if (or (>= hlevel 3) + (member (gi) (list (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) + (element-title-sosofo (current-node))) + (bibliography-content)))) + +(element (bibliography title) (empty-sosofo)) + +(element bibliodiv + (let* ((allentries (node-list-filter-by-gi (children (current-node)) + (list (normalize "biblioentry") + (normalize "bibliomixed")))) + (entries (if biblio-filter-used + (biblio-filter allentries) + allentries))) + (if (and biblio-filter-used (node-list-empty? entries)) + (empty-sosofo) + (make display-group + space-before: %block-sep% + space-after: %block-sep% + start-indent: %body-start-indent% + (make sequence + ($section-title$) + (process-node-list entries)))))) + +(element (bibliodiv title) (empty-sosofo)) + +;; ..................... BIBLIOGRAPHY ENTRIES ......................... + +(define (biblioentry-inline-sep node rest) + ;; Output the character that should separate inline node from rest + (cond + ((and (equal? (gi node) (normalize "title")) + (equal? (gi (node-list-first rest)) (normalize "subtitle"))) + (make sequence + font-posture: 'italic + (literal ": "))) + (else + (literal %biblsep%)))) + +(define (biblioentry-inline-end blocks) + ;; Output the character that should occur at the end of inline + (literal %biblend%)) + +(define (biblioentry-block-sep node rest) + ;; Output the character that should separate block node from rest + (empty-sosofo)) + +(define (biblioentry-block-end) + ;; Output the character that should occur at the end of block + (empty-sosofo)) + +(element biblioentry + (let* ((expanded-children (expand-children + (children (current-node)) + (biblioentry-flatten-elements))) + (all-inline-children (if %biblioentry-in-entry-order% + (titlepage-gi-list-by-nodelist + (biblioentry-inline-elements) + expanded-children) + (titlepage-gi-list-by-elements + (biblioentry-inline-elements) + expanded-children))) + (block-children (if %biblioentry-in-entry-order% + (titlepage-gi-list-by-nodelist + (biblioentry-block-elements) + expanded-children) + (titlepage-gi-list-by-elements + (biblioentry-block-elements) + expanded-children))) + (leading-abbrev (if (equal? (normalize "abbrev") + (gi (node-list-first + all-inline-children))) + (node-list-first all-inline-children) + (empty-node-list))) + (inline-children (if (node-list-empty? leading-abbrev) + all-inline-children + (node-list-rest all-inline-children))) + (has-leading-abbrev? (not (node-list-empty? leading-abbrev))) + (xreflabel (if (or has-leading-abbrev? biblio-number) + #f + (attribute-string (normalize "xreflabel"))))) + (make display-group + (make paragraph + space-before: %para-sep% + space-after: %para-sep% + start-indent: (+ (inherited-start-indent) 2pi) + first-line-start-indent: -2pi + + (if (or biblio-number xreflabel has-leading-abbrev?) + (make sequence + (literal "[") + + (if biblio-number + (literal (number->string (bibentry-number (current-node)))) + (empty-sosofo)) + + (if xreflabel + (literal xreflabel) + (empty-sosofo)) + + (if has-leading-abbrev? + (with-mode biblioentry-inline-mode + (process-node-list leading-abbrev)) + (empty-sosofo)) + + (literal "]\no-break-space;")) + (empty-sosofo)) + + (let loop ((nl inline-children)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (with-mode biblioentry-inline-mode + (process-node-list (node-list-first nl))) + (if (node-list-empty? (node-list-rest nl)) + (biblioentry-inline-end block-children) + (biblioentry-inline-sep (node-list-first nl) + (node-list-rest nl))) + (loop (node-list-rest nl)))))) + + (make display-group + start-indent: (+ (inherited-start-indent) 2pi) + (let loop ((nl block-children)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (with-mode biblioentry-block-mode + (process-node-list (node-list-first nl))) + (if (node-list-empty? (node-list-rest nl)) + (biblioentry-block-end) + (biblioentry-block-sep (node-list-first nl) + (node-list-rest nl))) + (loop (node-list-rest nl))))))))) + +(mode biblioentry-inline-mode + (element abbrev + (make sequence + (process-children))) + + (element affiliation + (let ((inline-children (node-list-filter-by-not-gi + (children (current-node)) + (list (normalize "address"))))) + (let loop ((nl inline-children)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (process-node-list (node-list-first nl)) + (if (node-list-empty? (node-list-rest nl)) + (empty-sosofo) + (literal ", ")) + (loop (node-list-rest nl))))))) + + (element artpagenums + (make sequence + (process-children))) + + (element author + (literal (author-list-string))) + + (element authorgroup + (process-children)) + + (element authorinitials + (make sequence + (process-children))) + + (element collab + (let* ((nl (children (current-node))) + (collabname (node-list-first nl)) + (affil (node-list-rest nl))) + (make sequence + (process-node-list collabname) + (if (node-list-empty? affil) + (empty-sosofo) + (let loop ((nl affil)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (literal ", ") + (process-node-list (node-list-first nl)) + (loop (node-list-rest nl))))))))) + + (element (collab collabname) + (process-children)) + + (element confgroup + (let ((inline-children (node-list-filter-by-not-gi + (children (current-node)) + (list (normalize "address"))))) + (let loop ((nl inline-children)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (process-node-list (node-list-first nl)) + (if (node-list-empty? (node-list-rest nl)) + (empty-sosofo) + (literal ", ")) + (loop (node-list-rest nl))))))) + + (element contractnum + (process-children)) + + (element contractsponsor + (process-children)) + + (element contrib + (process-children)) + + (element copyright + ;; Just print the year(s) + (let ((years (select-elements (children (current-node)) + (normalize "year")))) + (process-node-list years))) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element corpauthor + (make sequence + (process-children))) + + (element corpname + (make sequence + (process-children))) + + (element date + (make sequence + (process-children))) + + (element edition + (make sequence + (process-children))) + + (element editor + (make sequence + (literal (gentext-edited-by)) + (literal " ") + (literal (author-list-string)))) + + (element firstname + (make sequence + (process-children))) + + (element honorific + (make sequence + (process-children))) + + (element invpartnumber + (make sequence + (process-children))) + + (element isbn + (make sequence + (process-children))) + + (element issn + (make sequence + (process-children))) + + (element issuenum + (make sequence + (process-children))) + + (element lineage + (make sequence + (process-children))) + + (element orgname + (make sequence + (process-children))) + + (element othercredit + (literal (author-list-string))) + + (element othername + (make sequence + (process-children))) + + (element pagenums + (make sequence + (process-children))) + + (element productname + (make sequence + ($charseq$) +; this is actually a problem since "trade" is the default value for +; the class attribute. we can put this back in in DocBook 5.0, when +; class becomes #IMPLIED +; (if (equal? (attribute-string "class") (normalize "trade")) +; (literal "\trade-mark-sign;") +; (empty-sosofo)) + )) + + (element productnumber + (make sequence + (process-children))) + + (element pubdate + (make sequence + (process-children))) + + (element publisher + (let ((pubname (select-elements (children (current-node)) + (normalize "publishername"))) + (cities (select-elements (descendants (current-node)) + (normalize "city")))) + (make sequence + (process-node-list pubname) + (if (node-list-empty? cities) + (empty-sosofo) + (literal ", ")) + (process-node-list cities)))) + + (element publishername + (make sequence + (process-children))) + + (element (publisher address city) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (empty-sosofo)))) + + (element pubsnumber + (make sequence + (process-children))) + + (element releaseinfo + (make sequence + (process-children))) + + (element seriesvolnums + (make sequence + (process-children))) + + (element subtitle + (make sequence + font-posture: 'italic + (process-children))) + + (element surname + (make sequence + (process-children))) + + (element title + (make sequence + font-posture: 'italic + (process-children))) + + (element titleabbrev + (make sequence + (process-children))) + + (element volumenum + (make sequence + (process-children))) + + (element (bibliomixed title) + (make sequence + font-posture: 'italic + (process-children))) + + + (element (bibliomixed subtitle) + (make sequence + font-posture: 'italic + (process-children))) + + (element (biblioset title) + (let ((rel (case-fold-up + (inherited-attribute-string (normalize "relation"))))) + (cond + ((equal? rel "ARTICLE") (make sequence + (literal (gentext-start-quote)) + (process-children) + (literal (gentext-end-quote)))) + (else (make sequence + font-posture: 'italic + (process-children)))))) + + (element (bibliomset title) + (let ((rel (case-fold-up + (inherited-attribute-string (normalize "relation"))))) + (cond + ((equal? rel "ARTICLE") (make sequence + (literal (gentext-start-quote)) + (process-children) + (literal (gentext-end-quote)))) + (else (make sequence + font-posture: 'italic + (process-children)))))) +) + +(mode biblioentry-block-mode + (element abstract + (make display-group + (process-children))) + + (element (abstract title) + (make paragraph + font-weight: 'bold + (process-children))) + + (element address + ($linespecific-display$ %indent-address-lines% %number-address-lines%)) + + (element authorblurb + (make display-group + (process-children))) + + (element printhistory + (make display-group + (process-children))) + + (element revhistory + (make sequence + (make paragraph + font-weight: 'bold + (literal (gentext-element-name (current-node)))) + (make table + before-row-border: #f + (make table-column + column-number: 1 + width: (/ (- %body-width% (inherited-start-indent)) 3)) + (make table-column + column-number: 2 + width: (/ (- %body-width% (inherited-start-indent)) 3)) + (make table-column + column-number: 3 + width: (/ (- %body-width% (inherited-start-indent)) 3)) + (process-children)))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (node-list-filter-by-gi + (descendants (current-node)) + (list (normalize "revremark") + (normalize "revdescription"))))) + (make sequence + (make table-row + (make table-cell + column-number: 1 + n-columns-spanned: 1 + n-rows-spanned: 1 + (if (not (node-list-empty? revnumber)) + (make paragraph + (make sequence + (literal (gentext-element-name-space (current-node))) + (process-node-list revnumber))) + (empty-sosofo))) + (make table-cell + column-number: 2 + n-columns-spanned: 1 + n-rows-spanned: 1 + (if (not (node-list-empty? revdate)) + (make paragraph + (process-node-list revdate)) + (empty-sosofo))) + (make table-cell + column-number: 3 + n-columns-spanned: 1 + n-rows-spanned: 1 + (if (not (node-list-empty? revauthor)) + (make paragraph + (make sequence + (literal (gentext-revised-by)) + (process-node-list revauthor))) + (empty-sosofo)))) + (make table-row + cell-after-row-border: #f + (make table-cell + column-number: 1 + n-columns-spanned: 3 + n-rows-spanned: 1 + (if (not (node-list-empty? revremark)) + (make paragraph + space-after: %block-sep% + (process-node-list revremark)) + (empty-sosofo))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + (element (revision revdescription) (process-children)) + + (element seriesinfo + ;; This is a nearly biblioentry recursively... + (let* ((expanded-children (expand-children + (children (current-node)) + (biblioentry-flatten-elements))) + (all-inline-children (if %biblioentry-in-entry-order% + (titlepage-gi-list-by-nodelist + (biblioentry-inline-elements) + expanded-children) + (titlepage-gi-list-by-elements + (biblioentry-inline-elements) + expanded-children))) + (block-children (if %biblioentry-in-entry-order% + (titlepage-gi-list-by-nodelist + (biblioentry-block-elements) + expanded-children) + (titlepage-gi-list-by-elements + (biblioentry-block-elements) + expanded-children))) + (inline-children all-inline-children)) + (make display-group + (make paragraph + space-before: %para-sep% + space-after: %para-sep% + start-indent: (+ (inherited-start-indent) 2pi) + first-line-start-indent: -2pi + + (let loop ((nl inline-children)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (with-mode biblioentry-inline-mode + (process-node-list (node-list-first nl))) + (if (node-list-empty? (node-list-rest nl)) + (biblioentry-inline-end block-children) + (biblioentry-inline-sep (node-list-first nl) + (node-list-rest nl))) + (loop (node-list-rest nl)))))) + + (make display-group + start-indent: (+ (inherited-start-indent) 2pi) + (let loop ((nl block-children)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (with-mode biblioentry-block-mode + (process-node-list (node-list-first nl))) + (if (node-list-empty? (node-list-rest nl)) + (biblioentry-block-end) + (biblioentry-block-sep (node-list-first nl) + (node-list-rest nl))) + (loop (node-list-rest nl))))))))) +) + +(element bibliomixed + (let* ((all-inline-children (children (current-node))) + (leading-abbrev (if (equal? (normalize "abbrev") + (gi (node-list-first + all-inline-children))) + (node-list-first all-inline-children) + (empty-node-list))) + (inline-children (if (node-list-empty? leading-abbrev) + all-inline-children + (node-list-rest all-inline-children))) + (has-leading-abbrev? (not (node-list-empty? leading-abbrev))) + (xreflabel (if (or has-leading-abbrev? biblio-number) + #f + (attribute-string (normalize "xreflabel"))))) + (make paragraph + space-before: %para-sep% + space-after: %para-sep% + start-indent: (+ (inherited-start-indent) 2pi) + first-line-start-indent: -2pi + + (if (or biblio-number xreflabel has-leading-abbrev?) + (make sequence + (literal "[") + + (if biblio-number + (literal (number->string (bibentry-number (current-node)))) + (empty-sosofo)) + + (if xreflabel + (literal xreflabel) + (empty-sosofo)) + + (if has-leading-abbrev? + (with-mode biblioentry-inline-mode + (process-node-list leading-abbrev)) + (empty-sosofo)) + + (literal "]\no-break-space;")) + (empty-sosofo)) + + (with-mode biblioentry-inline-mode + (process-children))))) + +;; ....................... BIBLIOGRAPHY ELEMENTS ....................... + +;; These are element construction rules for bibliography elements that +;; may occur outside of a BIBLIOENTRY or BIBLIOMIXED. + +(element bibliomisc (process-children)) +(element bibliomset (process-children)) +(element biblioset (process-children)) +(element bookbiblio (process-children)) + +(element street ($charseq$)) +(element pob ($charseq$)) +(element postcode ($charseq$)) +(element city ($charseq$)) +(element state ($charseq$)) +(element country ($charseq$)) +(element phone ($charseq$)) +(element fax ($charseq$)) +(element otheraddr ($charseq$)) +(element affiliation ($charseq$)) +(element shortaffil ($charseq$)) +(element jobtitle ($charseq$)) +(element orgdiv ($charseq$)) +(element artpagenums ($charseq$)) + +(element author + (make sequence + (literal (author-list-string)))) + +(element authorgroup (process-children)) + +(element collab (process-children)) +(element collabname ($charseq$)) +(element authorinitials ($charseq$)) +(element confgroup (process-children)) +(element confdates ($charseq$)) +(element conftitle ($charseq$)) +(element confnum ($charseq$)) +(element confsponsor ($charseq$)) +(element contractnum ($charseq$)) +(element contractsponsor ($charseq$)) + +(element copyright + (make paragraph + (make sequence + (literal (gentext-element-name (current-node))) + (literal "\no-break-space;") + (literal (dingbat "copyright")) + (literal "\no-break-space;") + (process-children-trim)))) + +(element year + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (literal " ")))) + +(element holder ($charseq$)) + +(element corpauthor + (make sequence + (literal (author-list-string)))) + +(element corpname ($charseq$)) +(element date ($charseq$)) +(element edition ($charseq$)) +(element editor ($charseq$)) +(element isbn ($charseq$)) +(element issn ($charseq$)) +(element invpartnumber ($charseq$)) +(element issuenum ($charseq$)) + +(element legalnotice ($semiformal-object$)) +(element (legalnotice title) (empty-sosofo)) + +(element modespec (empty-sosofo)) + +(element orgname ($charseq$)) + +(element othercredit + (make sequence + (literal (author-list-string)))) + +(element pagenums ($charseq$)) +(element contrib ($charseq$)) + +(element firstname ($charseq$)) +(element honorific ($charseq$)) +(element lineage ($charseq$)) +(element othername ($charseq$)) +(element surname ($charseq$)) + +(element printhistory (empty-sosofo)) + +(element productname + (make sequence + ($charseq$) +; this is actually a problem since "trade" is the default value for +; the class attribute. we can put this back in in DocBook 5.0, when +; class becomes #IMPLIED +; (if (equal? (attribute-string "class") (normalize "trade")) +; (literal "\trade-mark-sign;") +; (empty-sosofo)) +)) + +(element productnumber ($charseq$)) +(element pubdate ($charseq$)) +(element publisher (process-children)) +(element publishername ($charseq$)) +(element pubsnumber ($charseq$)) +(element releaseinfo (empty-sosofo)) +(element revision ($charseq$)) +(element revnumber ($charseq$)) +(element revremark ($charseq$)) +(element revdescription ($block-container$)) +(element seriesvolnums ($charseq$)) +(element volumenum ($charseq$)) + +;; The (element (bookinfo revhistory)) construction rule is in dbinfo.dsl +;; It calls $book-revhistory$... +(define ($book-revhistory$) + (make sequence + (make paragraph + use: title-style + font-family-name: %title-font-family% + font-weight: 'bold + space-before: (* (HSIZE 3) %head-before-factor%) + space-after: (* (HSIZE 1) %head-before-factor%) + (literal (gentext-element-name (current-node)))) + (make table + before-row-border: #f + (process-children)))) + +(element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (node-list-filter-by-gi + (descendants (current-node)) + (list (normalize "revremark") + (normalize "revdescription"))))) + (make sequence + (make table-row + (make table-cell + column-number: 1 + n-columns-spanned: 1 + n-rows-spanned: 1 + (if (not (node-list-empty? revnumber)) + (make paragraph + (make sequence + (literal (gentext-element-name-space (current-node))) + (process-node-list revnumber))) + (empty-sosofo))) + (make table-cell + column-number: 2 + n-columns-spanned: 1 + n-rows-spanned: 1 + (if (not (node-list-empty? revdate)) + (make paragraph + (process-node-list revdate)) + (empty-sosofo))) + (make table-cell + column-number: 3 + n-columns-spanned: 1 + n-rows-spanned: 1 + (if (not (node-list-empty? revauthor)) + (make paragraph + (make sequence + (literal (gentext-revised-by)) + (process-node-list revauthor))) + (empty-sosofo)))) + (make table-row + cell-after-row-border: #f + (make table-cell + column-number: 1 + n-columns-spanned: 3 + n-rows-spanned: 1 + (if (not (node-list-empty? revremark)) + (make paragraph + space-after: %block-sep% + (process-node-list revremark)) + (empty-sosofo))))))) + +(element (revision revnumber) (process-children-trim)) +(element (revision date) (process-children-trim)) +(element (revision authorinitials) (process-children-trim)) +(element (revision revremark) (process-children-trim)) +(element (revision revdescription) (process-children)) diff --git a/print/dbblock.dsl b/print/dbblock.dsl new file mode 100644 index 0000000..4ee4912 --- /dev/null +++ b/print/dbblock.dsl @@ -0,0 +1,689 @@ +;; $Id: dbblock.dsl,v 1.13 2004/09/14 09:49:58 petere78 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +(element revhistory ($book-revhistory$)) + +(element highlights ($block-container$)) + +(element (para blockquote) + (let* ((attrib (select-elements (children (current-node)) + (normalize "attribution"))) + (paras (node-list-filter-by-not-gi + (children (current-node)) + (list (normalize "attribution"))))) + (make sequence + (make paragraph + first-line-start-indent: 0pt ;; workaround a bug/feature? + ;; W/o the preceding line, the first-line-start-indent of the enclosing + ;; paragraph will apply to the paragraphs in this blockquote which is + ;; probably not wanted.. + font-size: (* %bf-size% %smaller-size-factor%) + line-spacing: (* %bf-size% %line-spacing-factor% + %smaller-size-factor%) + space-before: %para-sep% + start-indent: (+ (inherited-start-indent) %blockquote-start-indent%) + end-indent: %blockquote-end-indent% + (process-node-list paras)) + (if (node-list-empty? attrib) + (empty-sosofo) + (make paragraph + font-size: (* %bf-size% %smaller-size-factor%) + line-spacing: (* %bf-size% %line-spacing-factor% + %smaller-size-factor%) + space-before: 0pt + end-indent: 1em + quadding: 'end + (make sequence + (literal "\em-dash;") + (process-node-list attrib))))))) + +(element blockquote + (let* ((attrib (select-elements (children (current-node)) + (normalize "attribution"))) + (paras (node-list-filter-by-not-gi + (children (current-node)) + (list (normalize "attribution"))))) + (make sequence + (make paragraph + font-size: (* %bf-size% %smaller-size-factor%) + line-spacing: (* %bf-size% %line-spacing-factor% + %smaller-size-factor%) + space-before: %para-sep% + start-indent: (+ (inherited-start-indent) %blockquote-start-indent%) + end-indent: %blockquote-end-indent% + (process-node-list paras)) + (if (node-list-empty? attrib) + (empty-sosofo) + (make paragraph + font-size: (* %bf-size% %smaller-size-factor%) + line-spacing: (* %bf-size% %line-spacing-factor% + %smaller-size-factor%) + space-before: 0pt + end-indent: 1em + quadding: 'end + (make sequence + (literal "\em-dash;") + (process-node-list attrib))))))) + +(element (blockquote para) + (if (absolute-last-sibling? (current-node)) + (make paragraph + space-before: %para-sep% + space-after: 0pt + quadding: %default-quadding% + (process-children-trim)) + ($paragraph$))) + +(element epigraph + (let* ((addln-indent %epigraph-start-indent%) + (attrib (select-elements (children (current-node)) + (normalize "attribution"))) + (paras (node-list-filter-by-not-gi + (children (current-node)) + (list (normalize "attribution"))))) + (make display-group + start-indent: (+ %body-start-indent% addln-indent) + end-indent: %epigraph-end-indent% + font-posture: 'italic + (process-node-list paras) + (if (node-list-empty? attrib) + (empty-sosofo) + (make paragraph + space-before: 0pt + quadding: 'end + (process-node-list attrib)))))) + +(element attribution + ($charseq$)) + +(element (epigraph para) + (if (absolute-last-sibling? (current-node)) + (make paragraph + space-before: %para-sep% + space-after: 0pt + quadding: %default-quadding% + (process-children-trim)) + ($paragraph$))) + +(element para ($paragraph$)) +(element simpara ($paragraph$)) + +(element formalpara ($para-container$)) + +(element (formalpara title) ($runinhead$)) +(element (formalpara para) (make sequence (process-children-trim))) + +(element sidebar + (make box + display?: #t + box-type: 'border + line-thickness: 1pt + start-indent: (inherited-start-indent) + end-indent: (inherited-end-indent) + (if (node-list-empty? (select-elements (children (current-node)) + (normalize "title"))) + (make display-group + start-indent: 2pt + end-indent: 2pt + space-before: %block-sep% + space-after: %block-sep% + (process-children)) + (make display-group + start-indent: 2pt + end-indent: 2pt + space-before: 0pt + space-after: %block-sep% + (make sequence + (let* ((object (current-node)) + (title (select-elements (children object) + (normalize "title"))) + (nsep (gentext-label-title-sep (gi object)))) + (make paragraph + font-weight: 'bold + space-before: %block-sep% + space-after: %para-sep% + keep-with-next?: #t + (literal (gentext-element-name object)) + (if (string=? (element-label object) "") + (literal nsep) + (literal " " (element-label object) nsep)) + (process-node-list (children title)))) + (process-children)))))) + +(element (sidebar title) (empty-sosofo)) + +(element abstract + (make display-group + space-before: %block-sep% + space-after: %block-sep% + start-indent: %body-start-indent% + (process-children))) + +(element authorblurb ($block-container$)) + +(element ackno ($paragraph$)) + +(define ($inline-object$) + (process-children)) + +(define ($informal-object$ #!optional (rule-before? #f) (rule-after? #f)) + (make display-group + start-indent: (+ %block-start-indent% (inherited-start-indent)) + space-before: %block-sep% + space-after: %block-sep% + (if rule-before? + (make rule + orientation: 'horizontal + line-thickness: %object-rule-thickness% + display-alignment: 'center + space-after: (/ %block-sep% 2) + keep-with-next?: #t) + (empty-sosofo)) + (process-children) + (if rule-after? + (make rule + orientation: 'horizontal + line-thickness: %object-rule-thickness% + display-alignment: 'center + space-before: (/ %block-sep% 2) + keep-with-previous?: #t) + (empty-sosofo)))) + +(define (object-title-after #!optional (node (current-node))) + (if (member (gi node) ($object-titles-after$)) + #t + #f)) + +(define (float-object node) + ;; you could redefine this to make only figures float, or only tables, + ;; or whatever... + #t) + +(define (named-formal-objects) + (list (normalize "figure") + (normalize "table") + (normalize "example") + (normalize "equation"))) + +(define ($formal-object$ #!optional (rule-before? #f) (rule-after? #f)) + (let* ((object-sosofo (make paragraph + space-before: 0pt + space-after: 0pt + start-indent: (+ %block-start-indent% + (inherited-start-indent)) + keep-with-next?: (object-title-after) + (process-children))) + (title-sosofo (with-mode formal-object-title-mode + (process-node-list + (select-elements (children (current-node)) + (normalize "title"))))) + (sosofo (make display-group + space-before: %block-sep% + space-after: %block-sep% + (if rule-before? + (make rule + orientation: 'horizontal + line-thickness: %object-rule-thickness% + display-alignment: 'center + space-after: (/ %block-sep% 2) + keep-with-next?: #t) + (empty-sosofo)) + (if (object-title-after) + (make sequence + object-sosofo + title-sosofo) + (make sequence + title-sosofo + object-sosofo)) + (if rule-after? + (make rule + orientation: 'horizontal + line-thickness: %object-rule-thickness% + display-alignment: 'center + space-before: (/ %block-sep% 2) + keep-with-previous?: #t) + (empty-sosofo))))) + (if (and (equal? (print-backend) 'tex) + formal-object-float + (float-object (current-node))) + (make page-float + sosofo) + sosofo))) + +(define ($semiformal-object$) + (if (node-list-empty? (select-elements (children (current-node)) + (normalize "title"))) + ($informal-object$) + ($formal-object$))) + +(mode formal-object-title-mode + (element title + (let* ((object (parent (current-node))) + (nsep (gentext-label-title-sep (gi object)))) + (make paragraph + font-weight: %formal-object-title-font-weight% + space-before: (if (object-title-after (parent (current-node))) + %para-sep% + 0pt) + space-after: (if (object-title-after (parent (current-node))) + 0pt + %para-sep%) + start-indent: (+ %block-start-indent% (inherited-start-indent)) + keep-with-next?: (not (object-title-after (parent (current-node)))) + (if (member (gi object) (named-formal-objects)) + (make sequence + (literal (gentext-element-name object)) + (if (string=? (element-label object) "") + (literal nsep) + (literal " " (element-label object) nsep))) + (empty-sosofo)) + (process-children)))) +) + +(element example + ($formal-object$ %example-rules% %example-rules%)) + +(element (example title) (empty-sosofo)) ; don't show caption below example + +(element informalexample + ($informal-object$ %informalexample-rules% %informalexample-rules%)) + +(element informalfigure + ($informal-object$ %informalfigure-rules% %informalfigure-rules%)) + +(element (figure title) (empty-sosofo)) ; don't show caption below figure + +(element figure + ;; FIXME: this is a bit crude... + (let* ((mediaobj (select-elements (children (current-node)) + (normalize "mediaobject"))) + (imageobj (select-elements (children mediaobj) + (normalize "imageobject"))) + (image (select-elements (children imageobj) + (normalize "imagedata"))) + (graphic (select-elements (children (current-node)) + (normalize "graphic"))) + (align (if (node-list-empty? image) + (if (node-list-empty? graphic) + #f + (attribute-string (normalize "align") + (node-list-first graphic))) + (attribute-string (normalize "align") (node-list-first image)))) + (dalign (cond ((equal? align (normalize "center")) + 'center) + ((equal? align (normalize "right")) + 'end) + (else + 'start)))) + (if align + (make display-group + quadding: dalign + ($formal-object$ %figure-rules% %figure-rules%)) + ($formal-object$ %figure-rules% %figure-rules%)))) + +(element informaltable + ($informal-object$ %informaltable-rules% %informaltable-rules%)) + +(element table + ;; can't be a "formal-object" because it requires special handling for + ;; the PGWIDE attribute + (let* ((nsep (gentext-label-title-sep (gi))) + (pgwide (attribute-string (normalize "pgwide"))) + (indent (lambda () (if (not (equal? pgwide "1")) + (+ %block-start-indent% + (inherited-start-indent)) + %cals-pgwide-start-indent%))) + (rule-before? %table-rules%) + (rule-after? %table-rules%) + (title-sosofo (make paragraph + font-weight: %table-title-font-weight% + space-before: (if (object-title-after) + %para-sep% + 0pt) + space-after: (if (object-title-after) + 0pt + %para-sep%) + start-indent: (indent) + keep-with-next?: (not (object-title-after)) + (literal (gentext-element-name (current-node))) + (if (string=? (element-label) "") + (literal nsep) + (literal " " (element-label) nsep)) + (element-title-sosofo))) + (table-sosofo (make display-group + font-weight: 'bold + space-before: 0pt + space-after: 0pt + start-indent: (indent) + keep-with-next?: (object-title-after) + (process-children))) + (table (make display-group + start-indent: (+ %block-start-indent% + (inherited-start-indent)) + space-before: %block-sep% + space-after: %block-sep% + (if rule-before? + (make rule + orientation: 'horizontal + line-thickness: %object-rule-thickness% + display-alignment: 'center + space-after: (/ %block-sep% 2) + keep-with-next?: #t) + (empty-sosofo)) + (if (object-title-after) + (make sequence + table-sosofo + title-sosofo) + (make sequence + title-sosofo + table-sosofo)) + (if rule-after? + (make rule + orientation: 'horizontal + line-thickness: %object-rule-thickness% + display-alignment: 'center + space-before: (/ %block-sep% 2) + keep-with-previous?: #t) + (empty-sosofo))))) + (if (and (equal? (print-backend) 'tex) + formal-object-float + (float-object (current-node))) + (make page-float + table) + table))) + +(element (table title) (empty-sosofo)) + +(element comment + (if %show-comments% + (make paragraph + start-indent: 0pt + first-line-start-indent: -10pt + font-posture: 'italic + font-size: (* (inherited-font-size) 0.9) + (make sequence + (make line-field + field-width: 10pt + quadding: 'end + (literal "*")) + (process-children))) + (empty-sosofo))) + +;; In DocBook V4.0 comment became remark +(element remark + (if %show-comments% + (make paragraph + start-indent: 0pt + first-line-start-indent: -10pt + font-posture: 'italic + font-size: (* (inherited-font-size) 0.9) + (make sequence + (make line-field + field-width: 10pt + quadding: 'end + (literal "*")) + (process-children))) + (empty-sosofo))) + +;; ====================================================================== +;; Handle footnotes in the body... + +(define %footnote-field-width% 1.6em) +(define %footnote-number-restarts% #t) +(define %footnote-endnote-break% #f) + +(define (count-footnote? footnote) + ;; don't count footnotes in comments (unless you're showing comments) + ;; or footnotes in tables which are handled locally in the table + ;; or footnotes for empty ulinks which don't need a footnote + (if (or (and (has-ancestor-member? footnote (list (normalize "comment"))) + (not %show-comments%)) + (has-ancestor-member? footnote (list (normalize "tgroup"))) + (and (has-ancestor-member? footnote (list (normalize "ulink"))) + (node-list-empty? (children footnote)) + %footnote-ulinks%)) + #f + #t)) + +(define (footnote-number footnote) + ;; This is more complex than it at first appears because footnotes + ;; can be in Comments which may be suppressed. + (let* ((root-list (if %footnote-number-restarts% + (component-element-list) + (list (normalize "book")))) + (footnotes (if %footnote-ulinks% + (component-list-descendant-node-list + footnote + (list (normalize "ulink") (normalize "footnote")) + root-list) + (component-descendant-node-list + footnote + root-list))) + (fn-number (let loop ((nl footnotes) (num 1)) + (if (node-list-empty? nl) + 0 + (if (node-list=? (node-list-first nl) footnote) + num + (if (count-footnote? (node-list-first nl)) + (loop (node-list-rest nl) (+ num 1)) + (loop (node-list-rest nl) num))))))) + (format-number fn-number "1"))) + +(element footnote + (if (and (equal? (print-backend) 'tex) bop-footnotes) + (make sequence + ($ss-seq$ + (literal (footnote-number (current-node)))) + (make page-footnote (process-children))) + ($ss-seq$ + (literal (footnote-number (current-node)))))) + +(element (footnote para) + ;; Note: this can only get called if the backend is 'tex + ;; If the backend is anything else, footnote never calls process + ;; children except in endnote-mode, so this doesn't get called. + (let ((fnnum (footnote-number (parent (current-node))))) + (if (= (child-number) 1) + (make paragraph + use: default-text-style + font-size: (* %footnote-size-factor% %bf-size%) + quadding: %default-quadding% + line-spacing: (* (* %footnote-size-factor% %bf-size%) + %line-spacing-factor%) + space-before: %para-sep% + space-after: %para-sep% + start-indent: %footnote-field-width% + first-line-start-indent: (- %footnote-field-width%) + lines: 'wrap ; doesn't seem to work + (make line-field + field-width: %footnote-field-width% + (literal fnnum + (gentext-label-title-sep (normalize "footnote")))) + (process-children-trim)) + (make paragraph + use: default-text-style + font-size: (* %footnote-size-factor% %bf-size%) + quadding: %default-quadding% + line-spacing: (* (* %footnote-size-factor% %bf-size%) + %line-spacing-factor%) + space-before: %para-sep% + space-after: %para-sep% + start-indent: %footnote-field-width% + lines: 'wrap ; doesn't seem to work + (process-children-trim))))) + +(define (non-table-footnotes footnotenl) + (let loop ((nl footnotenl) (result (empty-node-list))) + (if (node-list-empty? nl) + result + (if (has-ancestor-member? (node-list-first nl) + (list (normalize "tgroup"))) + (loop (node-list-rest nl) + result) + (loop (node-list-rest nl) + (node-list result (node-list-first nl))))))) + +(define (make-endnote-header) + (let ((headsize (if (equal? (gi) (normalize "refentry")) + (HSIZE 2) + (HSIZE 3))) + (indent (lambda () (if (equal? (gi) (normalize "refentry")) + %body-start-indent% + 0pt)))) + (make paragraph + break-before: %footnote-endnote-break% + font-family-name: %title-font-family% + font-weight: 'bold + font-size: headsize + line-spacing: (* headsize %line-spacing-factor%) + space-before: (* headsize %head-before-factor%) + space-after: (* headsize %head-after-factor%) + start-indent: (indent) + quadding: 'start + keep-with-next?: #t + (literal (gentext-endnotes))))) + +(define (make-endnotes #!optional (node (current-node))) + (let* ((allfootnotes (if %footnote-ulinks% + (node-list-filter-by-gi + (descendants node) + (list (normalize "footnote") (normalize "ulink"))) + (select-elements (descendants node) + (normalize "footnote")))) + (footnotes (let loop ((nl (non-table-footnotes allfootnotes)) + (fnlist (empty-node-list))) + (if (node-list-empty? nl) + fnlist + (if (count-footnote? (node-list-first nl)) + (loop (node-list-rest nl) + (node-list fnlist (node-list-first nl))) + (loop (node-list-rest nl) + fnlist)))))) + (if (or (node-list-empty? footnotes) + (and (equal? (print-backend) 'tex) + bop-footnotes)) + (empty-sosofo) + (if (or (equal? (gi node) (normalize "reference")) + (equal? (gi node) (normalize "part"))) + (empty-sosofo) ;; Each RefEntry/Component does its own... + (make sequence + (make-endnote-header) + (with-mode endnote-mode + (process-node-list footnotes))))))) + +(mode endnote-mode + (element footnote + (make sequence + start-indent: %body-start-indent% + (process-children))) + + (element (footnote para) + (let ((fnnum (footnote-number (parent (current-node))))) + (if (= (child-number) 1) + (make paragraph +; I'm not sure this really makes sense in the endnote case... +; font-size: (* %footnote-size-factor% %bf-size%) +; line-spacing: (* (* %footnote-size-factor% %bf-size%) +; %line-spacing-factor%) + space-before: %para-sep% + start-indent: (+ (inherited-start-indent) %footnote-field-width%) + first-line-start-indent: (- %footnote-field-width%) + (make line-field + field-width: %footnote-field-width% + (literal fnnum + (gentext-label-title-sep (normalize "footnote")))) + (process-children-trim)) + (make paragraph + font-size: (* %footnote-size-factor% %bf-size%) + line-spacing: (* (* %footnote-size-factor% %bf-size%) + %line-spacing-factor%) + start-indent: (+ (inherited-start-indent) %footnote-field-width%) + space-before: %para-sep% + (process-children-trim))))) + + (element ulink + (if %footnote-ulinks% + (let ((fnnum (footnote-number (current-node)))) + (make paragraph +; font-size: (* %footnote-size-factor% %bf-size%) +; line-spacing: (* (* %footnote-size-factor% %bf-size%) +; %line-spacing-factor%) + space-before: %para-sep% + start-indent: (+ (inherited-start-indent) %footnote-field-width%) + first-line-start-indent: (- %footnote-field-width%) + (make line-field + field-width: %footnote-field-width% + (literal fnnum + (gentext-label-title-sep (normalize "footnote")))) + (literal (attribute-string "url")))) + (next-match)))) + +;; ====================================================================== +;; Handle table footnotes + +(define (table-footnote-number footnote) + (format-number (component-child-number footnote + ($table-element-list$)) "a")) + +(element (entry footnote) + ($ss-seq$ + (literal (table-footnote-number (current-node))))) + +(element (entry para footnote) + ($ss-seq$ + (literal (table-footnote-number (current-node))))) + +(define (make-table-endnote-header) + (make paragraph + font-family-name: %body-font-family% + font-weight: 'medium + font-size: %bf-size% + start-indent: 0pt + quadding: 'start + (literal (gentext-table-endnotes)))) + +(define (make-table-endnotes) + (let* ((footnotes (select-elements (descendants (current-node)) + (normalize "footnote"))) + (headsize (HSIZE 3)) + (tgroup (ancestor-member (current-node) (list (normalize "tgroup")))) + (cols (string->number (attribute-string (normalize "cols") tgroup)))) + (if (node-list-empty? footnotes) + (empty-sosofo) + (make table-row + (make table-cell + n-columns-spanned: cols + cell-before-row-margin: %cals-cell-before-row-margin% + cell-after-row-margin: %cals-cell-after-row-margin% + cell-before-column-margin: %cals-cell-before-column-margin% + cell-after-column-margin: %cals-cell-after-column-margin% + start-indent: %cals-cell-content-start-indent% + end-indent: %cals-cell-content-end-indent% + (make-table-endnote-header) + (with-mode table-footnote-mode + (process-node-list footnotes))))))) + +(mode table-footnote-mode + (element footnote + (make display-group + font-family-name: %body-font-family% + font-weight: 'medium + font-size: %bf-size% + start-indent: 0pt + quadding: 'start + (process-children))) + + (element (footnote para) + (let ((fnnum (table-footnote-number (parent (current-node))))) + (if (= (child-number) 1) + (make paragraph + start-indent: %footnote-field-width% + first-line-start-indent: (- %footnote-field-width%) + (make line-field + field-width: %footnote-field-width% + (literal fnnum + (gentext-label-title-sep (normalize "footnote")))) + (process-children-trim)) + (make paragraph + start-indent: %footnote-field-width% + (process-children-trim)))))) + diff --git a/print/dbcallou.dsl b/print/dbcallou.dsl new file mode 100644 index 0000000..e16f1c0 --- /dev/null +++ b/print/dbcallou.dsl @@ -0,0 +1,221 @@ +;; $Id: dbcallou.dsl,v 1.4 2004/10/10 14:04:48 petere78 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; The support provided below is a little primitive because there's no way +;; to do line-addressing in Jade. +;; +;; CO's are supported with the CO element or, in SCREENCO and +;; PROGRAMLISTINGCO only, AREAs. +;; +;; Notes on the use of AREAs: +;; +;; - Processing is very slow. Jade loops through each AREA for +;; every column on every line. +;; - Only the LINECOLUMN units are supported, and they are #IMPLIED +;; - If a COORDS only specifies a line, the %callout-default-col% will +;; be used for the column. +;; - If the column is beyond the end of the line, that will work OK, but +;; if more than one callout has to get placed beyond the end of the same +;; line, that doesn't work so well. +;; - Embedded tabs foul up the column counting. +;; - Embedded markup fouls up the column counting. +;; - Embedded markup with embedded line breaks fouls up the line counting. +;; - The callout bugs occur immediately before the LINE COLUMN specified. +;; - You can't point to an AREASET, that doesn't make any sense +;; since it would imply a one-to-many link +;; +;; There's still no support for a stylesheet drawing the callouts on a +;; GRAPHIC, and I don't think there ever will be. +;; + +(element areaspec (empty-sosofo)) +(element area (empty-sosofo)) +(element areaset (empty-sosofo)) + +(element co + ($callout-mark$ (current-node))) + +(element programlistingco ($informal-object$)) +(element screenco ($informal-object$)) +(element graphicco ($informal-object$)) + +(element (screenco screen) + ($callout-verbatim-display$ %indent-screen-lines% %number-screen-lines%)) + +(element (programlistingco programlisting) + ($callout-verbatim-display$ %indent-programlisting-lines% + %number-programlisting-lines%)) + +;; ---------------------------------------------------------------------- + +(define ($callout-bug$ conumber) + (if (and conumber %callout-fancy-bug%) + (case conumber + ((1) (literal "\dingbat-negative-circled-sans-serif-digit-one;")) + ((2) (literal "\dingbat-negative-circled-sans-serif-digit-two;")) + ((3) (literal "\dingbat-negative-circled-sans-serif-digit-three;")) + ((4) (literal "\dingbat-negative-circled-sans-serif-digit-four;")) + ((5) (literal "\dingbat-negative-circled-sans-serif-digit-five;")) + ((6) (literal "\dingbat-negative-circled-sans-serif-digit-six;")) + ((7) (literal "\dingbat-negative-circled-sans-serif-digit-seven;")) + ((8) (literal "\dingbat-negative-circled-sans-serif-digit-eight;")) + ((9) (literal "\dingbat-negative-circled-sans-serif-digit-nine;")) + (else (make sequence + font-weight: 'bold + (literal "(" (format-number conumber "1") ")")))) + (make sequence + font-weight: 'bold + (if conumber + (literal "(" (format-number conumber "1") ")") + (literal "(??)"))))) + +(define ($callout-mark$ co) + ;; Print the callout mark for co + (if (equal? (gi co) (normalize "co")) + ($callout-bug$ (if (node-list-empty? co) + #f + (child-number co))) + (let ((areanum (if (node-list-empty? co) + #f + (if (equal? (gi (parent co)) (normalize "areaset")) + (absolute-child-number (parent co)) + (absolute-child-number co))))) + ($callout-bug$ (if (node-list-empty? co) + #f + areanum))))) + +(define ($look-for-callout$ line col #!optional (eol? #f)) + ;; Look to see if a callout should be printed at line col, and print + ;; it if it should + (let* ((areaspec (select-elements (children (parent (current-node))) + (normalize "areaspec"))) + (areas (expand-children (children areaspec) + (list (normalize "areaset"))))) + (let loop ((areanl areas)) + (if (node-list-empty? areanl) + (empty-sosofo) + (make sequence + (if ($callout-area-match$ (node-list-first areanl) line col eol?) + ($callout-area-format$ (node-list-first areanl) line col eol?) + (empty-sosofo)) + (loop (node-list-rest areanl))))))) + +(define ($callout-area-match$ area line col eol?) + ;; Does AREA area match line col? + (let* ((coordlist (split (attribute-string (normalize "coords") area))) + (aline (string->number (car coordlist))) + (acol (if (null? (cdr coordlist)) + #f + (string->number (car (cdr coordlist))))) + (units (if (inherited-attribute-string (normalize "units") area) + (inherited-attribute-string (normalize "units") area) + (normalize "linecolumn")))) + (and (equal? units (normalize "linecolumn")) + (or + (and (equal? line aline) + (equal? col acol)) + (and (equal? line aline) + eol? + (or (not acol) (> acol col))))))) + +(define ($callout-area-format$ area line col eol?) + ;; Format AREA area at the appropriate place + (let* ((coordlist (split (attribute-string (normalize "coords") area))) + (aline (string->number (car coordlist))) + (acol (if (null? (cdr coordlist)) + #f + (string->number (car (cdr coordlist)))))) + (if (and (equal? line aline) + eol? + (or (not acol) (> acol col))) + (make sequence + (let loop ((atcol col)) + (if (>= atcol (if acol acol %callout-default-col%)) + (empty-sosofo) + (make sequence + (literal "\no-break-space;") + (loop (+ atcol 1))))) + ($callout-mark$ area)) + ($callout-mark$ area)))) + +(define ($callout-linespecific-content$ indent line-numbers?) + ;; Print linespecific content in a callout with line numbers + (make sequence + ($line-start$ indent line-numbers? 1) + (let loop ((kl (children (current-node))) + (linecount 1) + (colcount 1) + (res (empty-sosofo))) + (if (node-list-empty? kl) + (sosofo-append res + ($look-for-callout$ linecount colcount #t) + (empty-sosofo)) + (loop + (node-list-rest kl) + (if (char=? (node-property 'char (node-list-first kl) + default: #\U-0000) #\U-000D) + (+ linecount 1) + linecount) + (if (char=? (node-property 'char (node-list-first kl) + default: #\U-0000) #\U-000D) + 1 + (if (char=? (node-property 'char (node-list-first kl) + default: #\U-0000) #\U-0000) + colcount + (+ colcount 1))) + (let ((c (node-list-first kl))) + (if (char=? (node-property 'char c default: #\U-0000) + #\U-000D) + (sosofo-append res + ($look-for-callout$ linecount colcount #t) + (process-node-list c) + ($line-start$ indent + line-numbers? + (+ linecount 1))) + (sosofo-append res + ($look-for-callout$ linecount colcount) + (process-node-list c))))))))) + +(define ($callout-verbatim-display$ indent line-numbers?) + (let* ((width-in-chars (if (attribute-string "width") + (string->number (attribute-string "width")) + %verbatim-default-width%)) + (fsize (lambda () (if (or (attribute-string (normalize "width")) + (not %verbatim-size-factor%)) + (/ (/ (- %text-width% (inherited-start-indent)) + width-in-chars) + 0.7) + (* (inherited-font-size) + %verbatim-size-factor%)))) + (vspace-before (if (INBLOCK?) + 0pt + (if (INLIST?) + %para-sep% + %block-sep%))) + (vspace-after (if (INBLOCK?) + 0pt + (if (INLIST?) + 0pt + %block-sep%)))) + (make paragraph + use: verbatim-style + space-before: (if (and (string=? (gi (parent)) (normalize "entry")) + (absolute-first-sibling?)) + 0pt + vspace-before) + space-after: (if (and (string=? (gi (parent)) (normalize "entry")) + (absolute-last-sibling?)) + 0pt + vspace-after) + font-size: (fsize) + line-spacing: (* (fsize) %line-spacing-factor%) + start-indent: (if (INBLOCK?) + (inherited-start-indent) + (+ %block-start-indent% (inherited-start-indent))) + quadding: 'start + ($callout-linespecific-content$ indent line-numbers?)))) + +;; EOF dbcallout.dsl diff --git a/print/dbcompon.dsl b/print/dbcompon.dsl new file mode 100644 index 0000000..17b1378 --- /dev/null +++ b/print/dbcompon.dsl @@ -0,0 +1,520 @@ +;; $Id: dbcompon.dsl,v 1.5 2003/04/29 06:33:10 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; ============================= COMPONENTS ============================= +;; +;; in docbook, components are containers at the chapter/appendix level + +(define ($title-header-footer-element$) + (let* ((firstchild (node-list-first (children (current-node)))) + (metainfo (if (node-list-empty? firstchild) + (empty-node-list) + (if (member (gi firstchild) (info-element-list)) + firstchild + (empty-node-list)))) + (metatitle (select-elements (children metainfo) (normalize "title"))) + (metatabb (select-elements (children metainfo) (normalize "titleabbrev"))) + (title (select-elements (children (current-node)) + (normalize "title"))) + (titleabb (select-elements (children (current-node)) + (normalize "titleabbrev")))) + (if (node-list-empty? metatabb) + (if (node-list-empty? titleabb) + (if (node-list-empty? metatitle) + title + metatitle) + titleabb) + metatabb))) + +(define ($refentry-header-footer-element$) + (let* ((refdescriptor (node-list-first + (select-elements + (descendants (current-node)) (normalize "refdescriptor")))) + (refname (node-list-first + (select-elements + (descendants (current-node)) (normalize "refname")))) + (refentrytitle (node-list-first + (select-elements + (descendants (current-node)) (normalize "refentrytitle"))))) + (if (node-list-empty? refentrytitle) + (if (node-list-empty? refdescriptor) + refname + refdescriptor) + refentrytitle))) + +(define ($title-header-footer$) + (let* ((title (if (equal? (gi) (normalize "refentry")) + ($refentry-header-footer-element$) + ($title-header-footer-element$)))) + (make sequence + font-posture: 'italic + (with-mode hf-mode + (process-node-list title))))) + +(define ($page-number-header-footer$) + (let ((component (ancestor-member (current-node) + (append (division-element-list) + (component-element-list))))) + (make sequence + font-posture: 'italic + (literal + (gentext-page) + (if %page-number-restart% + (if (or (equal? (gi component) (normalize "chapter")) + (equal? (gi component) (normalize "appendix"))) + (string-append + (element-label component #t) + (gentext-intra-label-sep "_pagenumber")) + "") + "")) + (page-number-sosofo)))) + +(define (first-page-inner-header gi) + (empty-sosofo)) + +(define (first-page-center-header gi) + (empty-sosofo)) + +(define (first-page-outer-header gi) + (empty-sosofo)) + +(define (page-inner-header gi) + (empty-sosofo)) + +(define (page-center-header gi) + (empty-sosofo)) + +(define (page-outer-header gi) + (cond + ((equal? (normalize gi) (normalize "dedication")) (empty-sosofo)) + ((equal? (normalize gi) (normalize "lot")) (empty-sosofo)) + ((equal? (normalize gi) (normalize "part")) (empty-sosofo)) + ((equal? (normalize gi) (normalize "toc")) (empty-sosofo)) + (else ($title-header-footer$)))) + +(define (first-page-inner-footer gi) + (empty-sosofo)) + +(define (first-page-center-footer gi) + (empty-sosofo)) + +(define (first-page-outer-footer gi) + (cond + ((equal? (normalize gi) (normalize "dedication")) (empty-sosofo)) + ((equal? (normalize gi) (normalize "part")) (empty-sosofo)) + (else ($page-number-header-footer$)))) + +(define (page-inner-footer gi) + (empty-sosofo)) + +(define (page-center-footer gi) + (empty-sosofo)) + +(define (page-outer-footer gi) + ($page-number-header-footer$)) + +(define ($page-number-format$ #!optional (gi (gi))) + (cond + ((equal? (normalize gi) (normalize "toc")) "i") + ((equal? (normalize gi) (normalize "lot")) "i") + ((equal? (normalize gi) (normalize "preface")) "i") + (else "1"))) + +(define ($left-header$ #!optional (gi (gi))) + (if-first-page + (if (equal? %writing-mode% 'left-to-right) + (first-page-inner-header gi) + (first-page-outer-header gi)) + (if %two-side% + (if-front-page + (if (equal? %writing-mode% 'left-to-right) + (page-inner-header gi) + (page-outer-header gi)) + (if (equal? %writing-mode% 'left-to-right) + (page-outer-header gi) + (page-inner-header gi))) + (if (equal? %writing-mode% 'left-to-right) + (page-inner-header gi) + (page-outer-header gi))))) + +(define ($center-header$ #!optional (gi (gi))) + (if-first-page + (first-page-center-header gi) + (page-center-header gi))) + +(define ($right-header$ #!optional (gi (gi))) + (if-first-page + (if (equal? %writing-mode% 'left-to-right) + (first-page-outer-header gi) + (first-page-inner-header gi)) + (if %two-side% + (if-front-page + (if (equal? %writing-mode% 'left-to-right) + (page-outer-header gi) + (page-inner-header gi)) + (if (equal? %writing-mode% 'left-to-right) + (page-inner-header gi) + (page-outer-header gi))) + (if (equal? %writing-mode% 'left-to-right) + (page-outer-header gi) + (page-inner-header gi))))) + +(define ($left-footer$ #!optional (gi (gi))) + (if-first-page + (if (equal? %writing-mode% 'left-to-right) + (first-page-inner-footer gi) + (first-page-outer-footer gi)) + (if %two-side% + (if-front-page + (if (equal? %writing-mode% 'left-to-right) + (page-inner-footer gi) + (page-outer-footer gi)) + (if (equal? %writing-mode% 'left-to-right) + (page-outer-footer gi) + (page-inner-footer gi))) + (if (equal? %writing-mode% 'left-to-right) + (page-inner-footer gi) + (page-outer-footer gi))))) + +(define ($center-footer$ #!optional (gi (gi))) + (if-first-page + (first-page-center-footer gi) + (page-center-footer gi))) + +(define ($right-footer$ #!optional (gi (gi))) + (if-first-page + (if (equal? %writing-mode% 'left-to-right) + (first-page-outer-footer gi) + (first-page-inner-footer gi)) + (if %two-side% + (if-front-page + (if (equal? %writing-mode% 'left-to-right) + (page-outer-footer gi) + (page-inner-footer gi)) + (if (equal? %writing-mode% 'left-to-right) + (page-inner-footer gi) + (page-outer-footer gi))) + (if (equal? %writing-mode% 'left-to-right) + (page-outer-footer gi) + (page-inner-footer gi))))) + +(define ($component$) + (make simple-page-sequence + page-n-columns: %page-n-columns% + page-number-restart?: (or %page-number-restart% + (first-chapter?)) + page-number-format: ($page-number-format$) + use: default-text-style + left-header: ($left-header$) + center-header: ($center-header$) + right-header: ($right-header$) + left-footer: ($left-footer$) + center-footer: ($center-footer$) + right-footer: ($right-footer$) + start-indent: %body-start-indent% + input-whitespace-treatment: 'collapse + quadding: %default-quadding% + (make sequence + ($component-title$) + (process-children)) + (make-endnotes))) + +(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"))) + (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 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)))) + + (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))))))) + +(mode component-title-mode + (element title + (process-children)) + + (element subtitle + (process-children)) +) + +;; this is how we prevent the title in the header from acquiring the +;; display treatment that it receives in the body of the document +;; +(mode hf-mode + (element title + (let* ((component (ancestor-member (current-node) + (component-element-list))) + (chaporapp (or (equal? (gi component) (normalize "chapter")) + (equal? (gi component) (normalize "appendix"))))) + (if %chap-app-running-heads% + (make sequence + (if (and chaporapp + %chapter-autolabel% + (or %chap-app-running-head-autolabel% + (attribute-string (normalize "label") component))) + (literal (gentext-element-name-space component) + (element-label component) + (gentext-label-title-sep (gi component))) + (empty-sosofo)) + (process-children-trim)) + (empty-sosofo)))) + + (element titleabbrev + (if %chap-app-running-heads% + (make sequence + (if (or (have-ancestor? (normalize "chapter")) + (have-ancestor? (normalize "appendix"))) + (literal (gentext-element-name-space (parent)) + (element-label (parent)) + (gentext-label-title-sep (gi (parent)))) + (empty-sosofo)) + (process-children-trim)) + (empty-sosofo))) + + (element refentrytitle + (if %chap-app-running-heads% + (process-children-trim) + (empty-sosofo))) + + (element refdescriptor + (if %chap-app-running-heads% + (process-children-trim) + (empty-sosofo))) + + (element refname + (if %chap-app-running-heads% + (process-children-trim) + (empty-sosofo))) + + ;; Graphics aren't allowed in headers and footers... + (element graphic + (empty-sosofo)) + + (element inlinegraphic + (empty-sosofo)) +) + +(element appendix ($component$)) +(element (article appendix) ($section$)) ;; this is a special case +(element (appendix title) (empty-sosofo)) + +(element chapter ($component$)) +(element (chapter title) (empty-sosofo)) + +(element preface ($component$)) +(element (preface title) (empty-sosofo)) + +(element colophon ($component$)) + +;; Dedication is empty except in a special mode so that it can be +;; reordered (made to come before the TOCs) +(element dedication (empty-sosofo)) +(mode dedication-page-mode + (element dedication ($component$)) + (element (dedication title) (empty-sosofo)) +) + +;; Articles are like components, except that if they may have much +;; more formal title pages (created with article-titlepage). +;; +(element article + (let* ((info (node-list-filter-by-gi (children (current-node)) + (list (normalize "artheader") + (normalize "articleinfo")))) + (nl (titlepage-info-elements (current-node) info)) + (article-titlepage (if %generate-article-titlepage-on-separate-page% + (make sequence + (if (article-titlepage-content? nl 'recto) + (make simple-page-sequence + page-n-columns: %page-n-columns% + use: default-text-style + quadding: %default-quadding% + (article-titlepage nl 'recto)) + (empty-sosofo)) + (if (article-titlepage-content? nl 'verso) + (make simple-page-sequence + page-n-columns: %page-n-columns% + use: default-text-style + quadding: %default-quadding% + (article-titlepage nl 'verso)) + (empty-sosofo))) + (make sequence + (article-titlepage nl 'recto) + (article-titlepage nl 'verso))))) + (make sequence + + ;; make the titlepage first if its on a separate page + (if (and %generate-article-titlepage% + %generate-article-titlepage-on-separate-page%) + article-titlepage + (empty-sosofo)) + + ;; make the TOC on a separate page if requested and it's not + ;; already on the title page and it's supposed to be in front + (if (and %generate-article-toc% + (not %generate-article-toc-on-titlepage%) + %generate-article-titlepage-on-separate-page% + (generate-toc-in-front)) + (make simple-page-sequence + page-n-columns: %page-n-columns% + ;; FIXME: page restarting here and below is ill-considered + page-number-restart?: %article-page-number-restart% + page-number-format: ($page-number-format$ (normalize "toc")) + left-header: ($left-header$ (normalize "toc")) + center-header: ($center-header$ (normalize "toc")) + right-header: ($right-header$ (normalize "toc")) + left-footer: ($left-footer$ (normalize "toc")) + center-footer: ($center-footer$ (normalize "toc")) + right-footer: ($right-footer$ (normalize "toc")) + input-whitespace-treatment: 'collapse + use: default-text-style + quadding: %default-quadding% + (build-toc (current-node) + (toc-depth (current-node)))) + (empty-sosofo)) + + ;; start a new page for the article itself + (make simple-page-sequence + page-n-columns: %page-n-columns% + page-number-restart?: (or %article-page-number-restart% + (book-start?)) + page-number-format: ($page-number-format$) + use: default-text-style + left-header: ($left-header$) + center-header: ($center-header$) + right-header: ($right-header$) + left-footer: ($left-footer$) + center-footer: ($center-footer$) + right-footer: ($right-footer$) + start-indent: %body-start-indent% + input-whitespace-treatment: 'collapse + quadding: %default-quadding% + + ;; ... and include the titlepage if there is one and it's not + ;; already generated on a separate page + (if (and %generate-article-titlepage% + (not %generate-article-titlepage-on-separate-page%)) + article-titlepage + (empty-sosofo)) + + ;; ... and include the TOC if it is in front and not already + ;; generated + (if (and %generate-article-toc% + (generate-toc-in-front) + (not %generate-article-toc-on-titlepage%) + (not %generate-article-titlepage-on-separate-page%)) + (make display-group + space-after: (* (HSIZE 3) %head-after-factor%) + (build-toc (current-node) + (toc-depth (current-node)))) + (empty-sosofo)) + + ;; .. and the contents of the article + (process-children) + + ;; ... and the endnotes + (make-endnotes) + + ;; ... and the TOC if it is supposed to be on the back and not + ;; on the titlepage nor on a separate pagee + (if (and %generate-article-toc% + (not (generate-toc-in-front)) + (not %generate-article-toc-on-titlepage%) + (not %generate-article-titlepage-on-separate-page%)) + (make display-group + space-after: (* (HSIZE 3) %head-after-factor%) + (build-toc (current-node) + (toc-depth (current-node)))) + (empty-sosofo))) + + ;; finally, produce the TOC if it is supposed to be at the end + ;; and on its own page + (if (and %generate-article-toc% + (not %generate-article-toc-on-titlepage%) + %generate-article-titlepage-on-separate-page% + (not (generate-toc-in-front))) + (make simple-page-sequence + page-n-columns: %page-n-columns% + use: default-text-style + quadding: %default-quadding% + (build-toc (current-node) + (toc-depth (current-node)))) + (empty-sosofo))))) + +(element (article title) (empty-sosofo)) + diff --git a/print/dbdivis.dsl b/print/dbdivis.dsl new file mode 100644 index 0000000..faf7e6c --- /dev/null +++ b/print/dbdivis.dsl @@ -0,0 +1,224 @@ +;; $Id: dbdivis.dsl,v 1.5 2003/12/05 05:00:05 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ============================= DIVISIONS ============================== + +(element set + (let* ((setinfo (select-elements (children (current-node)) + (normalize "setinfo"))) + (nl (titlepage-info-elements (current-node) setinfo))) + (make sequence + (if %generate-set-titlepage% + (make simple-page-sequence + page-n-columns: %titlepage-n-columns% + input-whitespace-treatment: 'collapse + use: default-text-style + (set-titlepage nl 'recto) + (make display-group + break-before: 'page + (set-titlepage nl 'verso))) + (empty-sosofo)) + + (if (not (generate-toc-in-front)) + (process-children) + (empty-sosofo)) + + (if %generate-set-toc% + (make simple-page-sequence + page-n-columns: %page-n-columns% + page-number-format: ($page-number-format$ (normalize "toc")) + use: default-text-style + left-header: ($left-header$ (normalize "toc")) + center-header: ($center-header$ (normalize "toc")) + right-header: ($right-header$ (normalize "toc")) + left-footer: ($left-footer$ (normalize "toc")) + center-footer: ($center-footer$ (normalize "toc")) + right-footer: ($right-footer$ (normalize "toc")) + input-whitespace-treatment: 'collapse + (build-toc (current-node) + (toc-depth (current-node)))) + (empty-sosofo)) + + (if (generate-toc-in-front) + (process-children) + (empty-sosofo))))) + +(element (set title) (empty-sosofo)) + +(element book + (let* ((bookinfo (select-elements (children (current-node)) + (normalize "bookinfo"))) + (dedication (select-elements (children (current-node)) + (normalize "dedication"))) + (nl (titlepage-info-elements (current-node) bookinfo))) + (make sequence + (if %generate-book-titlepage% + (make simple-page-sequence + page-n-columns: %titlepage-n-columns% + input-whitespace-treatment: 'collapse + use: default-text-style + (book-titlepage nl 'recto) + (make display-group + break-before: 'page + (book-titlepage nl 'verso))) + (empty-sosofo)) + + (if (node-list-empty? dedication) + (empty-sosofo) + (with-mode dedication-page-mode + (process-node-list dedication))) + + (if (not (generate-toc-in-front)) + (process-children) + (empty-sosofo)) + + (if %generate-book-toc% + (make simple-page-sequence + page-n-columns: %page-n-columns% + page-number-format: ($page-number-format$ (normalize "toc")) + use: default-text-style + left-header: ($left-header$ (normalize "toc")) + center-header: ($center-header$ (normalize "toc")) + right-header: ($right-header$ (normalize "toc")) + left-footer: ($left-footer$ (normalize "toc")) + center-footer: ($center-footer$ (normalize "toc")) + right-footer: ($right-footer$ (normalize "toc")) + input-whitespace-treatment: 'collapse + (build-toc (current-node) + (toc-depth (current-node)))) + (empty-sosofo)) + + (let loop ((gilist ($generate-book-lot-list$))) + (if (null? gilist) + (empty-sosofo) + (if (not (node-list-empty? + (select-elements (descendants (current-node)) + (car gilist)))) + (make simple-page-sequence + page-n-columns: %page-n-columns% + page-number-format: ($page-number-format$ (normalize "lot")) + use: default-text-style + left-header: ($left-header$ (normalize "lot")) + center-header: ($center-header$ (normalize "lot")) + right-header: ($right-header$ (normalize "lot")) + left-footer: ($left-footer$ (normalize "lot")) + center-footer: ($center-footer$ (normalize "lot")) + right-footer: ($right-footer$ (normalize "lot")) + input-whitespace-treatment: 'collapse + (build-lot (current-node) (car gilist))) + (loop (cdr gilist))))) + + (if (generate-toc-in-front) + (process-children) + (empty-sosofo))))) + +(element (book title) (empty-sosofo)) + +(element part + (let* ((partinfo (select-elements (children (current-node)) + (normalize "docinfo"))) + (partintro (select-elements (children (current-node)) + (normalize "partintro"))) + + (nl (titlepage-info-elements + (current-node) + partinfo + (if %generate-partintro-on-titlepage% + partintro + (empty-node-list))))) + (make sequence + (if %generate-part-titlepage% + (make simple-page-sequence + page-n-columns: %titlepage-n-columns% + input-whitespace-treatment: 'collapse + use: default-text-style + (part-titlepage nl 'recto) + (make display-group + break-before: 'page + (part-titlepage nl 'verso))) + (empty-sosofo)) + + (if (not (generate-toc-in-front)) + (process-children) + (empty-sosofo)) + + ;; generate a part TOC on a separate page + (if (and %generate-part-toc% + (not %generate-part-toc-on-titlepage%)) + (make simple-page-sequence + page-n-columns: %page-n-columns% + page-number-format: ($page-number-format$ (normalize "toc")) + use: default-text-style + left-header: ($left-header$ (normalize "toc")) + center-header: ($center-header$ (normalize "toc")) + right-header: ($right-header$ (normalize "toc")) + left-footer: ($left-footer$ (normalize "toc")) + center-footer: ($center-footer$ (normalize "toc")) + right-footer: ($right-footer$ (normalize "toc")) + input-whitespace-treatment: 'collapse + (build-toc (current-node) + (toc-depth (current-node)))) + (empty-sosofo)) + + ;; this seems wrong relative to generate-toc-in-front, + ;; goes *after* the content ??! + (if (and (not (node-list-empty? partintro)) + (not %generate-partintro-on-titlepage%)) + ($process-partintro$ partintro #t) + (empty-sosofo)) + + (if (generate-toc-in-front) + (process-children) + (empty-sosofo))))) + +(element (part title) (empty-sosofo)) + +(element partintro (empty-sosofo)) + +(element (partintro title) + (let* ((hlevel 1) + (hs (HSIZE (- 4 hlevel)))) + (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: (* hs %head-after-factor%) + 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) + (element-title-sosofo (parent (current-node)))))) + +(define ($process-partintro$ partintro make-page-seq?) + (if make-page-seq? + (make simple-page-sequence + page-n-columns: %page-n-columns% + page-number-restart?: (or %page-number-restart% + (book-start?) + (first-chapter?)) + page-number-format: ($page-number-format$) + use: default-text-style + left-header: ($left-header$) + center-header: ($center-header$) + right-header: ($right-header$) + left-footer: ($left-footer$) + center-footer: ($center-footer$) + right-footer: ($right-footer$) + start-indent: %body-start-indent% + input-whitespace-treatment: 'collapse + quadding: %default-quadding% + (make sequence + (process-node-list (children partintro)) + (make-endnotes partintro))) + (make sequence + start-indent: %body-start-indent% + (process-node-list (children partintro)) + (make-endnotes partintro)))) + diff --git a/print/dbefsyn.dsl b/print/dbefsyn.dsl new file mode 100644 index 0000000..2eed205 --- /dev/null +++ b/print/dbefsyn.dsl @@ -0,0 +1,588 @@ +;; $Id: dbefsyn.dsl,v 1.4 2003/01/15 08:24:23 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ============================ CLASS SYNOPSIS ============================= + +(define %indent-classsynopsisinfo-lines% #f) +(define %number-classsynopsisinfo-lines% #f) + +(define %default-classsynopsis-language% "java") + +(element classsynopsis + (let ((language (if (attribute-string (normalize "language")) + (attribute-string (normalize "language")) + %default-classsynopsis-language%))) + (case language + (("java") (with-mode cs-java-mode + (process-node-list (current-node)))) + (("perl") (with-mode cs-perl-mode + (process-node-list (current-node)))) + (("idl") (with-mode cs-idl-mode + (process-node-list (current-node)))) + (("python") (with-mode cs-python-mode + (process-node-list (current-node)))) + (else (with-mode cs-java-mode + (process-node-list (current-node))))))) + +(element methodsynopsis + (let ((language (if (attribute-string (normalize "language")) + (attribute-string (normalize "language")) + %default-classsynopsis-language%))) + (case language + (("java") (with-mode cs-java-mode + (process-node-list (current-node)))) + (("perl") (with-mode cs-perl-mode + (process-node-list (current-node)))) + (("idl") (with-mode cs-idl-mode + (process-node-list (current-node)))) + (("python") (with-mode cs-python-mode + (process-node-list (current-node)))) + (else (with-mode cs-java-mode + (process-node-list (current-node))))))) + +(element fieldsynopsis + (let ((language (if (attribute-string (normalize "language")) + (attribute-string (normalize "language")) + %default-classsynopsis-language%))) + (case language + (("java") (with-mode cs-java-mode + (process-node-list (current-node)))) + (("perl") (with-mode cs-perl-mode + (process-node-list (current-node)))) + (("idl") (with-mode cs-idl-mode + (process-node-list (current-node)))) + (("python") (with-mode cs-python-mode + (process-node-list (current-node)))) + (else (with-mode cs-java-mode + (process-node-list (current-node))))))) + +(element constructorynopsis + (let ((language (if (attribute-string (normalize "language")) + (attribute-string (normalize "language")) + %default-classsynopsis-language%))) + (case language + (("java") (with-mode cs-java-mode + (process-node-list (current-node)))) + (("perl") (with-mode cs-perl-mode + (process-node-list (current-node)))) + (("idl") (with-mode cs-idl-mode + (process-node-list (current-node)))) + (("python") (with-mode cs-python-mode + (process-node-list (current-node)))) + (else (with-mode cs-java-mode + (process-node-list (current-node))))))) + +(element destructorsynopsis + (let ((language (if (attribute-string (normalize "language")) + (attribute-string (normalize "language")) + %default-classsynopsis-language%))) + (case language + (("java") (with-mode cs-java-mode + (process-node-list (current-node)))) + (("perl") (with-mode cs-perl-mode + (process-node-list (current-node)))) + (("idl") (with-mode cs-idl-mode + (process-node-list (current-node)))) + (("python") (with-mode cs-python-mode + (process-node-list (current-node)))) + (else (with-mode cs-java-mode + (process-node-list (current-node))))))) + +;; ===== Java ======================================================== + +(mode cs-java-mode + +(element classsynopsis + (let* ((classes (select-elements (children (current-node)) + (normalize "ooclass"))) + (classname (node-list-first classes)) + (superclasses (node-list-rest classes))) + (make display-group + use: verbatim-style + (make paragraph + (process-node-list classname) + (process-node-list superclasses) + (literal "{")) + (process-node-list + (node-list-filter-by-gi + (children (current-node)) + (list (normalize "constructorsynopsis") + (normalize "destructorsynopsis") + (normalize "fieldsynopsis") + (normalize "methodsynopsis") + (normalize "classsynopsisinfo")))) + (make paragraph + (literal "}"))))) + +(element classsynopsisinfo + ($verbatim-display$ %indent-classsynopsisinfo-lines% + %number-classsynopsisinfo-lines%)) + +(element ooclass + (make sequence + (if (first-sibling?) + (literal " ") + (literal ", ")) + (process-children))) + +(element oointerface + (make sequence + (if (first-sibling?) + (literal " ") + (literal ", ")) + (process-children))) + +(element ooexception + (make sequence + (if (first-sibling?) + (literal " ") + (literal ", ")) + (process-children))) + +(element modifier + (make sequence + (process-children) + (literal " "))) + +(element classname + (if (first-sibling?) + (make sequence + (literal "class ") + (process-children) + (literal " ") + (if (last-sibling?) + (empty-sosofo) + (literal "extends "))) + (make sequence + (process-children) + (if (last-sibling?) + (literal " ") + (literal ", "))))) + +(element fieldsynopsis + (make paragraph + use: inline-verbatim-style + (literal " ") + (process-children) + (literal ";"))) + +(element type + (make sequence + (process-children) + (literal " "))) + +(element varname + (make sequence + (process-children))) + +(element initializer + (make sequence + (literal " = ") + (process-children))) + +(element constructorsynopsis + (java-method-synopsis)) + +(element destructorsynopsis + (java-method-synopsis)) + +(element methodsynopsis + (java-method-synopsis)) + +(element void + (literal "void ")) + +(element methodname + (process-children)) + +(element methodparam + (make sequence + (if (first-sibling?) + (empty-sosofo) + (literal ", ")) + (process-children))) + +(element parameter + (process-children)) + +(element exceptionname + (make sequence + (if (first-sibling?) + (literal " throws ") + (literal ", ")) + (process-children))) +) + +(define (java-method-synopsis #!optional (nd (current-node))) + (let* ((modifiers (select-elements (children nd) + (normalize "modifier"))) + (notmod (node-list-filter-by-not-gi + (children nd) + (list (normalize "modifier")))) + (type (if (equal? (gi (node-list-first notmod)) + (normalize "methodname")) + (empty-node-list) + (node-list-first notmod))) + (methodname (select-elements (children nd) + (normalize "methodname"))) + (param (node-list-filter-by-gi (node-list-rest notmod) + (list (normalize "methodparam")))) + (excep (select-elements (children nd) + (normalize "exceptionname")))) + (make paragraph + use: inline-verbatim-style + (literal " ") + (process-node-list modifiers) + (process-node-list type) + (process-node-list methodname) + (literal "(") + (process-node-list param) + (literal ")") + (process-node-list excep) + (literal ";")))) + +;; ===== Perl ======================================================== + +(mode cs-perl-mode + +(element classsynopsis + (let* ((modifiers (select-elements (children (current-node)) + (normalize "modifier"))) + (classes (select-elements (children (current-node)) + (normalize "classname"))) + (classname (node-list-first classes)) + (superclasses (node-list-rest classes))) + (make display-group + use: verbatim-style; + (make paragraph + (literal "package ") + (process-node-list classname) + (literal ";")) + (if (node-list-empty? superclasses) + (empty-sosofo) + (make sequence + (literal "@ISA = ("); + (process-node-list superclasses) + (literal ";"))) + (process-node-list + (node-list-filter-by-gi + (children (current-node)) + (list (normalize "constructorsynopsis") + (normalize "destructorsynopsis") + (normalize "fieldsynopsis") + (normalize "methodsynopsis") + (normalize "classsynopsisinfo"))))))) + +(element classsynopsisinfo + ($verbatim-display$ %indent-classsynopsisinfo-lines% + %number-classsynopsisinfo-lines%)) + +(element modifier + (literal "Perl ClassSynopses don't use Modifiers")) + +(element classname + (if (first-sibling?) + (process-children) + (make sequence + (process-children) + (if (last-sibling?) + (empty-sosofo) + (literal ", "))))) + +(element fieldsynopsis + (make paragraph + use: inline-verbatim-style + (literal " "); + (process-children) + (literal ";"))) + +(element type + (make sequence + (process-children) + (literal " "))) + +(element varname + (make sequence + (process-children))) + +(element initializer + (make sequence + (literal " = ") + (process-children))) + +(element constructorsynopsis + (perl-method-synopsis)) + +(element destructorsynopsis + (perl-method-synopsis)) + +(element methodsynopsis + (perl-method-synopsis)) + +(element void + (empty-sosofo)) + +(element methodname + (process-children)) + +(element methodparam + (make sequence + (if (first-sibling?) + (empty-sosofo) + (literal ", ")) + (process-children))) + +(element parameter + (process-children)) + +(element exceptionname + (literal "Perl ClassSynopses don't use Exceptions")) + +) + +(define (perl-method-synopsis #!optional (nd (current-node))) + (let* ((modifiers (select-elements (children nd) + (normalize "modifier"))) + (notmod (node-list-filter-by-not-gi + (children nd) + (list (normalize "modifier")))) + (type (if (equal? (gi (node-list-first notmod)) + (normalize "methodname")) + (empty-node-list) + (node-list-first notmod))) + (methodname (select-elements (children nd) + (normalize "methodname"))) + (param (node-list-filter-by-gi (node-list-rest notmod) + (list (normalize "type") + (normalize "void")))) + (excep (select-elements (children nd) + (normalize "exceptionname")))) + (make paragraph + use: inline-verbatim-style + (literal "sub ") + (process-node-list modifiers) + (process-node-list type) + (process-node-list methodname) + (literal " { ... }")))) + +;; ===== IDL ========================================================= + +(mode cs-idl-mode + +(element classsynopsis + (let* ((modifiers (select-elements (children (current-node)) + (normalize "modifier"))) + (classes (select-elements (children (current-node)) + (normalize "classname"))) + (classname (node-list-first classes)) + (superclasses (node-list-rest classes))) + (make display-group + use: verbatim-style; + (make paragraph + (literal "interface ") + (process-node-list modifiers) + (process-node-list classname) + (if (node-list-empty? superclasses) + (literal " ") + (make sequence + (literal " : ") + (process-node-list superclasses))) + (literal "{")) + (process-node-list + (node-list-filter-by-gi + (children (current-node)) + (list (normalize "constructorsynopsis") + (normalize "destructorsynopsis") + (normalize "fieldsynopsis") + (normalize "methodsynopsis") + (normalize "classsynopsisinfo")))) + (make paragraph + (literal "}"))))) + +(element classsynopsisinfo + ($verbatim-display$ %indent-classsynopsisinfo-lines% + %number-classsynopsisinfo-lines%)) + +(element modifier + (make sequence + (process-children) + (literal " "))) + +(element classname + (if (first-sibling?) + (process-children) + (make sequence + (process-children) + (if (last-sibling?) + (empty-sosofo) + (literal ", "))))) + +(element fieldsynopsis + (make paragraph + use: inline-verbatim-style + (literal " "); + (process-children) + (literal ";"))) + +(element type + (make sequence + (process-children) + (literal " "))) + +(element varname + (make sequence + (process-children))) + +(element initializer + (make sequence + (literal " = ") + (process-children))) + +(element constructorsynopsis + (idl-method-synopsis)) + +(element destructorsynopsis + (idl-method-synopsis)) + +(element methodsynopsis + (idl-method-synopsis)) + +(element void + (literal "void ")) + +(element methodname + (process-children)) + +(element methodparam + (make sequence + (if (first-sibling?) + (empty-sosofo) + (literal ", ")) + (process-children))) + +(element parameter + (process-children)) + +(element exceptionname + (make sequence + (if (first-sibling?) + (literal " raises(") + (literal ", ")) + (process-children) + (if (last-sibling?) + (literal ")") + (empty-sosofo)))) +) + +(define (idl-method-synopsis #!optional (nd (current-node))) + (let* ((modifiers (select-elements (children nd) + (normalize "modifier"))) + (notmod (node-list-filter-by-not-gi + (children nd) + (list (normalize "modifier")))) + (type (if (equal? (gi (node-list-first notmod)) + (normalize "methodname")) + (empty-node-list) + (node-list-first notmod))) + (methodname (select-elements (children nd) + (normalize "methodname"))) + (param (node-list-filter-by-gi (node-list-rest notmod) + (list (normalize "methodparam")))) + (excep (select-elements (children nd) + (normalize "exceptionname")))) + (make paragraph + use: inline-verbatim-style + (process-node-list modifiers) + (process-node-list type) + (process-node-list methodname) + (literal "(") + (process-node-list param) + (literal ")") + (process-node-list excep) + (literal ";")))) + +;; ===== Python ====================================================== +;; Contributed by Lane Stevens, lane@cycletime.com + +(mode cs-python-mode + (element classsynopsis + (let* ((classes (select-elements (children (current-node)) + (normalize "ooclass"))) + (classname (node-list-first classes)) + (superclasses (node-list-rest classes))) + (make display-group + use: verbatim-style + (make paragraph + (literal "class ") + (process-node-list classname) + (literal "(") + (process-node-list superclasses) + (literal ") :")) + (process-node-list + (node-list-filter-by-gi + (children (current-node)) + (list (normalize "constructorsynopsis") + (normalize "destructorsynopsis") + (normalize "fieldsynopsis") + (normalize "methodsynopsis") + (normalize "classsynopsisinfo")))) + ) + ) + ) + + (element ooclass + (make sequence + (process-children) + (cond + ((first-sibling?) (literal " ")) + ((last-sibling?) (empty-sosofo)) + (#t (literal ", ")) + ) + ) + ) + + (element methodsynopsis + (python-method-synopsis)) + + (element classname + (process-children)) + + (element initializer + (make sequence + (literal " = ") + (process-children))) + + (element methodname + (process-children)) + + (element methodparam + (make sequence + (process-children) + (if (last-sibling?) + (empty-sosofo) + (literal ", ")) + ) + ) + + (element parameter + (process-children)) + ) + +(define (python-method-synopsis #!optional (nd (current-node))) + (let* ((the-method-name (select-elements (children nd) (normalize "methodname"))) + (the-method-params (select-elements (children nd) (normalize "methodparam"))) + ) + (make paragraph + use: inline-verbatim-style + (literal " def ") + (process-node-list the-method-name) + (literal "(") + (process-node-list the-method-params) + (literal ") :")) + ) + ) + +;; EOF diff --git a/print/dbgloss.dsl b/print/dbgloss.dsl new file mode 100644 index 0000000..2fcc5d9 --- /dev/null +++ b/print/dbgloss.dsl @@ -0,0 +1,117 @@ +;; $Id: dbgloss.dsl,v 1.4 2003/01/15 08:24:23 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ========================= GLOSSARY ELEMENTS ========================== + +(element glossary ($component$)) +(element (article glossary) ($section$)) ;; this is a special case +(element (glossary title) (empty-sosofo)) + +(element glossdiv ($section$)) +(element (glossdiv title) (empty-sosofo)) + +(element glosslist ($block-container$)) +(element glossentry (process-children)) + +;; a glossentry glossterm +(element (glossentry glossterm) ($lowtitle$ 3 2)) +(element (glossdiv glossentry glossterm) ($lowtitle$ 3 3)) +(element (glossentry acronym) (empty-sosofo)) +(element (glossentry abbrev) (empty-sosofo)) +(element glossdef ($indent-para-container$)) + +(element glosssee ($italic-seq$)) + +(element (glossentry glosssee) + (let ((otherterm (attribute-string (normalize "otherterm")))) + (make paragraph + space-before: %para-sep% + space-after: %para-sep% + start-indent: (+ (inherited-start-indent) (* (ILSTEP) 2)) + quadding: %default-quadding% + ($italic-seq$ (literal (gentext-element-name (current-node)) + (gentext-label-title-sep (gi)))) + (if otherterm + (make link + destination: (node-list-address (element-with-id otherterm)) + (with-mode otherterm + (process-element-with-id otherterm))) + (process-children))))) + +;; When we hit the first GLOSSSEEALSO, process all of them as a node-list +(element glossseealso + (if (first-sibling?) + (make paragraph + ($italic-seq$ (literal (gentext-element-name (current-node)) + (gentext-label-title-sep (gi)))) + (with-mode glossseealso + (process-node-list + (select-elements (children (parent)) '(glossseealso)))) + (literal ".")) + (empty-sosofo))) + +(mode glossseealso + + (element glossseealso + (let ((otherterm (attribute-string (normalize "otherterm")))) + (make sequence + (if (first-sibling?) + (empty-sosofo) + ($italic-seq$ (literal ", "))) + + (if otherterm ;; but this should be required... + (make link + destination: (node-list-address (element-with-id otherterm)) + (with-mode otherterm + (process-element-with-id otherterm))) + (process-children))))) + +) + +;; This is referenced within the GLOSSSEE and GLOSSSEEALSO element +;; construction expressions. The OTHERTERM attributes on GLOSSSEE and +;; GLOSSSEEALSO (should) refer to GLOSSENTRY elements but we're only +;; interested in the text within the GLOSSTERM. Discard the revision +;; history and the definition from the referenced term. +(mode otherterm + (element glossentry + (process-children)) + (element glossterm + (process-children)) + (element glossdef + (empty-sosofo)) + (element revhistory + (empty-sosofo)) + (element glosssee + (empty-sosofo)) + (element (glossentry acronym) + (empty-sosofo)) + (element (glossentry abbrev) + (empty-sosofo))) + +;; an inline gloss term +(element glossterm + (let* ((linkend (attribute-string (normalize "linkend")))) + (if linkend + (make link + destination: (node-list-address (element-with-id linkend)) + ($italic-seq$)) + ($italic-seq$)))) + +;; a first glossterm +(element firstterm + (let* ((linkend (attribute-string (normalize "linkend"))) + (sosofo (if linkend + (make link + destination: (node-list-address + (element-with-id linkend)) + ($italic-seq$)) + ($italic-seq$)))) + (if firstterm-bold + (make sequence + font-weight: 'bold + sosofo) + sosofo))) diff --git a/print/dbgraph.dsl b/print/dbgraph.dsl new file mode 100644 index 0000000..218698a --- /dev/null +++ b/print/dbgraph.dsl @@ -0,0 +1,134 @@ +;; $Id: dbgraph.dsl,v 1.3 2003/03/25 19:53:55 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ==================== GRAPHICS ==================== + +;; NOTE: display #f doesn't seem to work right in the RTF back end... + +(define (graphic-file filename) + (let ((ext (file-extension filename))) + (if (or (not filename) + (not %graphic-default-extension%) + (member ext %graphic-extensions%)) + filename + (string-append filename "." %graphic-default-extension%)))) + +(define ($graphic$ fileref + #!optional (display #f) (format #f) (scale #f) (align #f)) + (let ((graphic-format (if format format "")) + (graphic-scale (if scale (/ (string->number scale) 100) 1)) + (graphic-align (cond ((equal? align (normalize "center")) + 'center) + ((equal? align (normalize "right")) + 'end) + (else + 'start)))) + (make external-graphic + entity-system-id: (graphic-file fileref) + notation-system-id: graphic-format + scale: graphic-scale + display?: display + display-alignment: graphic-align))) + +(define ($img$ #!optional (nd (current-node)) (display #f)) + ;; This function now supports an extension to DocBook. It's + ;; either a clever trick or an ugly hack, depending on your + ;; point of view, but it'll hold us until XLink is finalized + ;; and we can extend DocBook the "right" way. + ;; + ;; If the entity passed to GRAPHIC has the FORMAT + ;; "LINESPECIFIC", either because that's what's specified or + ;; because it's the notation of the supplied ENTITYREF, then + ;; the text of the entity is inserted literally (via Jade's + ;; read-entity external procedure). + ;; + (let* ((fileref (attribute-string (normalize "fileref") nd)) + (entityref (attribute-string (normalize "entityref") nd)) + (format (if (attribute-string (normalize "format") nd) + (attribute-string (normalize "format") nd) + (if entityref + (entity-notation entityref) + #f))) + (align (attribute-string (normalize "align") nd)) + (scale (attribute-string (normalize "scale") nd))) + (if (or fileref entityref) + (if (equal? format (normalize "linespecific")) + (if fileref + (include-file fileref) + (include-file (entity-generated-system-id entityref))) + (if fileref + ($graphic$ fileref display format scale align) + ($graphic$ (entity-generated-system-id entityref) + display format scale align))) + (empty-sosofo)))) + +(element graphic + (make paragraph + space-before: %block-sep% + space-after: %block-sep% + ($img$ (current-node) #t))) + +(element inlinegraphic ($img$)) + + +;; ====================================================================== +;; MediaObject and friends... + +(define preferred-mediaobject-notations + (list "EPS" "PS" "JPG" "JPEG" "PNG" "linespecific")) + +(define preferred-mediaobject-extensions + (list "eps" "ps" "jpg" "jpeg" "png")) + +(define acceptable-mediaobject-notations + (list "GIF" "GIF87a" "GIF89a" "BMP" "WMF")) + +(define acceptable-mediaobject-extensions + (list "gif" "bmp" "wmf")) + +(element mediaobject + (make paragraph + ($mediaobject$))) + +(element inlinemediaobject + (make sequence + ($mediaobject$))) + +(element mediaobjectco + (error "MediaObjectCO is not supported yet.")) + +(element imageobjectco + (error "ImageObjectCO is not supported yet.")) + +(element objectinfo + (empty-sosofo)) + +(element videoobject + (process-children)) + +(element videodata + (empty-sosofo)) + +(element audioobject + (process-children)) + +(element audiodata + (empty-sosofo)) + +(element imageobject + (process-children)) + +(element imagedata + (if (have-ancestor? (normalize "mediaobject")) + ($img$ (current-node) #t) + ($img$ (current-node) #f))) + +(element textobject + (make display-group + (process-children))) + +(element caption + (process-children)) diff --git a/print/dbindex.dsl b/print/dbindex.dsl new file mode 100644 index 0000000..c97d49b --- /dev/null +++ b/print/dbindex.dsl @@ -0,0 +1,156 @@ +;; $Id: dbindex.dsl,v 1.4 2003/01/15 08:24:23 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ................... INDEX TERMS (EMBEDDED MARKERS) ................... + +(element indexterm + ;; This is different than (empty-sosofo) alone because the backend + ;; will hang an anchor off the empty sequence. This allows the index + ;; to point to the indexterm (but only if the indexterm has an ID). + (make sequence (empty-sosofo))) + +(element primary (empty-sosofo)) +(element secondary (empty-sosofo)) +(element tertiary (empty-sosofo)) +(element see (empty-sosofo)) +(element seealso (empty-sosofo)) + +;; =========================== INDEX ELEMENTS =========================== + +(element setindex ($component$)) +(element (setindex title) (empty-sosofo)) + +(element index + (make simple-page-sequence + page-number-restart?: (or %page-number-restart% + (book-start?) + (first-chapter?)) + page-number-format: ($page-number-format$) + use: default-text-style + left-header: ($left-header$) + center-header: ($center-header$) + right-header: ($right-header$) + left-footer: ($left-footer$) + center-footer: ($center-footer$) + right-footer: ($right-footer$) + start-indent: %body-start-indent% + input-whitespace-treatment: 'collapse + quadding: %default-quadding% + page-n-columns: 2 + (make sequence + ($component-title$) + (process-children)) + (make-endnotes))) + +;; this is a special case. this prevents the index from causing an error but +;; will make the index a single column. c'est la vie. +(element (article index) ($section$)) + +(element (index title) (empty-sosofo)) + +(element indexdiv ($section$)) +(element (indexdiv title) (empty-sosofo)) + +(element indexentry (process-children)) + +(element primaryie + (make paragraph + font-size: (* (inherited-font-size) %smaller-size-factor%) + (process-children))) + +(element secondaryie + (make paragraph + font-size: (* (inherited-font-size) %smaller-size-factor%) + start-indent: (+ (inherited-start-indent) 1em) + (process-children))) + +(element tertiaryie + (make paragraph + font-size: (* (inherited-font-size) %smaller-size-factor%) + start-indent: (+ (inherited-start-indent) 2em) + (process-children))) + +(define (find-indexterm id) + ;; If you have a lot of indexterms that don't have IDs, this could + ;; be incredibly slow. So don't do that. + (let* ((idtarget (element-with-id id))) + (if (node-list-empty? idtarget) + (let loop ((idnodes (select-elements (descendants (sgml-root-element)) + (normalize "indexterm")))) + (if (node-list-empty? idnodes) + (empty-node-list) + (if (equal? id (string-append "AEN" + (number->string + (all-element-number + (node-list-first idnodes))))) + (node-list-first idnodes) + (loop (node-list-rest idnodes))))) + idtarget))) + +(define (indexentry-link nd) + (let* ((id (attribute-string (normalize "role") nd)) + (target (find-indexterm id)) + (preferred (not (node-list-empty? + (select-elements (children (current-node)) + (normalize "emphasis"))))) + (sosofo (if (node-list-empty? target) + (literal "?") + (make link + destination: (node-list-address target) + (with-mode toc-page-number-mode + (process-node-list target)))))) + (if preferred + (make sequence + font-weight: 'bold + sosofo) + sosofo))) + +(element (primaryie ulink) + (indexentry-link (current-node))) + +(element (secondaryie ulink) + (indexentry-link (current-node))) + +(element (tertiaryie ulink) + (indexentry-link (current-node))) + +(element seeie + (let ((indent (cond ((node-list-empty? + (select-elements + (children (parent (current-node))) + (normalize "secondaryie"))) + 1em) + ((node-list-empty? + (select-elements + (children (parent (current-node))) + (normalize "tertiaryie"))) + 2em) + (else 3em)))) + (make paragraph + font-size: (* (inherited-font-size) %smaller-size-factor%) + start-indent: (+ (inherited-start-indent) indent) + (literal "(" (gentext-index-see) " ") + (process-children) + (literal ")")))) + +(element seealsoie + (let ((indent (cond ((node-list-empty? + (select-elements + (children (parent (current-node))) + (normalize "secondaryie"))) + 1em) + ((node-list-empty? + (select-elements + (children (parent (current-node))) + (normalize "tertiaryie"))) + 2em) + (else 3em)))) + (make paragraph + font-size: (* (inherited-font-size) %smaller-size-factor%) + start-indent: (+ (inherited-start-indent) indent) + (literal "(" (gentext-index-seealso) " ") + (process-children) + (literal ")")))) diff --git a/print/dbinfo.dsl b/print/dbinfo.dsl new file mode 100644 index 0000000..e89af5c --- /dev/null +++ b/print/dbinfo.dsl @@ -0,0 +1,1012 @@ +;; $Id: dbinfo.dsl,v 1.3 2003/01/15 08:24:23 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ................................ INFO ................................ + +;; Rather than make the *INFO containers empty-sosofos, we make them +;; process-children and then make all of the elements they may contain +;; empty in this context. The advantage here is that we can then +;; more easily override some of them in stylesheets that use this one. + +(element setinfo (empty-sosofo)) + +(element (setinfo abbrev) (empty-sosofo)) +(element (setinfo abstract) (empty-sosofo)) +(element (setinfo address) (empty-sosofo)) +(element (setinfo affiliation) (empty-sosofo)) +(element (setinfo artpagenums) (empty-sosofo)) +(element (setinfo author) (empty-sosofo)) +(element (setinfo authorblurb) (empty-sosofo)) +(element (setinfo authorgroup) (empty-sosofo)) +(element (setinfo authorinitials) (empty-sosofo)) +(element (setinfo bibliomisc) (empty-sosofo)) +(element (setinfo biblioset) (empty-sosofo)) +(element (setinfo collab) (empty-sosofo)) +(element (setinfo confgroup) (empty-sosofo)) +(element (setinfo contractnum) (empty-sosofo)) +(element (setinfo contractsponsor) (empty-sosofo)) +(element (setinfo contrib) (empty-sosofo)) +(element (setinfo copyright) (empty-sosofo)) +(element (setinfo corpauthor) (empty-sosofo)) +(element (setinfo corpname) (empty-sosofo)) +(element (setinfo date) (empty-sosofo)) +(element (setinfo edition) (empty-sosofo)) +(element (setinfo editor) (empty-sosofo)) +(element (setinfo firstname) (empty-sosofo)) +(element (setinfo graphic) (empty-sosofo)) +(element (setinfo honorific) (empty-sosofo)) +(element (setinfo invpartnumber) (empty-sosofo)) +(element (setinfo isbn) (empty-sosofo)) +(element (setinfo issn) (empty-sosofo)) +(element (setinfo issuenum) (empty-sosofo)) +(element (setinfo itermset) (empty-sosofo)) +(element (setinfo keywordset) (empty-sosofo)) +(element (setinfo legalnotice) (empty-sosofo)) +(element (setinfo lineage) (empty-sosofo)) +(element (setinfo modespec) (empty-sosofo)) +(element (setinfo orgname) (empty-sosofo)) +(element (setinfo othercredit) (empty-sosofo)) +(element (setinfo othername) (empty-sosofo)) +(element (setinfo pagenums) (empty-sosofo)) +(element (setinfo printhistory) (empty-sosofo)) +(element (setinfo productname) (empty-sosofo)) +(element (setinfo productnumber) (empty-sosofo)) +(element (setinfo pubdate) (empty-sosofo)) +(element (setinfo publisher) (empty-sosofo)) +(element (setinfo publishername) (empty-sosofo)) +(element (setinfo pubsnumber) (empty-sosofo)) +(element (setinfo releaseinfo) (empty-sosofo)) +(element (setinfo revhistory) (empty-sosofo)) +(element (setinfo seriesvolnums) (empty-sosofo)) +(element (setinfo subjectset) (empty-sosofo)) +(element (setinfo subtitle) (empty-sosofo)) +(element (setinfo surname) (empty-sosofo)) +(element (setinfo title) (empty-sosofo)) +(element (setinfo titleabbrev) (empty-sosofo)) +(element (setinfo volumenum) (empty-sosofo)) + +;; BookInfo is handled differently in dbdivis.dsl by using a +;; special mode... + +(element bookinfo (empty-sosofo)) + +(element (bookinfo abbrev) (process-children)) +(element (bookinfo abstract) (process-children)) +(element (bookinfo address) (process-children)) +(element (bookinfo affiliation) (process-children)) +(element (bookinfo artpagenums) (process-children)) +(element (bookinfo author) (process-children)) +(element (bookinfo authorblurb) (process-children)) +(element (bookinfo authorgroup) (process-children)) +(element (bookinfo authorinitials) (process-children)) +(element (bookinfo bibliomisc) (process-children)) +(element (bookinfo biblioset) (process-children)) +(element (bookinfo bookbiblio) (process-children)) +(element (bookinfo collab) (process-children)) +(element (bookinfo confgroup) (process-children)) +(element (bookinfo contractnum) (process-children)) +(element (bookinfo contractsponsor) (process-children)) +(element (bookinfo contrib) (process-children)) +;; (element (bookinfo copyright) (process-children)) ;; the default is good +(element (bookinfo corpauthor) (process-children)) +(element (bookinfo corpname) (process-children)) +(element (bookinfo date) (process-children)) +(element (bookinfo edition) (process-children)) +(element (bookinfo editor) (process-children)) +(element (bookinfo firstname) (process-children)) +(element (bookinfo graphic) (process-children)) +(element (bookinfo honorific) (process-children)) +(element (bookinfo invpartnumber) (process-children)) +(element (bookinfo isbn) (process-children)) +(element (bookinfo issn) (process-children)) +(element (bookinfo issuenum) (process-children)) +(element (bookinfo itermset) (process-children)) +(element (bookinfo keywordset) (process-children)) +(element (bookinfo legalnotice) ($semiformal-object$)) +(element (bookinfo lineage) (process-children)) +(element (bookinfo modespec) (process-children)) +(element (bookinfo orgname) (process-children)) +(element (bookinfo othercredit) (process-children)) +(element (bookinfo othername) (process-children)) +(element (bookinfo pagenums) (process-children)) +(element (bookinfo printhistory) (process-children)) +(element (bookinfo productname) (process-children)) +(element (bookinfo productnumber) (process-children)) +(element (bookinfo pubdate) (process-children)) +(element (bookinfo publisher) (process-children)) +(element (bookinfo publishername) (process-children)) +(element (bookinfo pubsnumber) (process-children)) +(element (bookinfo releaseinfo) (process-children)) +(element (bookinfo revhistory) ($book-revhistory$)) +(element (bookinfo seriesvolnums) (process-children)) +(element (bookinfo subjectset) (process-children)) +(element (bookinfo subtitle) (process-children)) +(element (bookinfo surname) (process-children)) +(element (bookinfo title) (process-children)) +(element (bookinfo titleabbrev) (process-children)) +(element (bookinfo volumenum) (process-children)) + +(element docinfo (empty-sosofo)) + +(element (docinfo abbrev) (empty-sosofo)) +(element (docinfo abstract) (empty-sosofo)) +(element (docinfo address) (empty-sosofo)) +(element (docinfo affiliation) (empty-sosofo)) +(element (docinfo artpagenums) (empty-sosofo)) +(element (docinfo author) (empty-sosofo)) +(element (docinfo authorblurb) (empty-sosofo)) +(element (docinfo authorgroup) (empty-sosofo)) +(element (docinfo authorinitials) (empty-sosofo)) +(element (docinfo bibliomisc) (empty-sosofo)) +(element (docinfo biblioset) (empty-sosofo)) +(element (docinfo collab) (empty-sosofo)) +(element (docinfo confgroup) (empty-sosofo)) +(element (docinfo contractnum) (empty-sosofo)) +(element (docinfo contractsponsor) (empty-sosofo)) +(element (docinfo contrib) (empty-sosofo)) +(element (docinfo copyright) (empty-sosofo)) +(element (docinfo corpauthor) (empty-sosofo)) +(element (docinfo corpname) (empty-sosofo)) +(element (docinfo date) (empty-sosofo)) +(element (docinfo edition) (empty-sosofo)) +(element (docinfo editor) (empty-sosofo)) +(element (docinfo firstname) (empty-sosofo)) +(element (docinfo graphic) (empty-sosofo)) +(element (docinfo honorific) (empty-sosofo)) +(element (docinfo invpartnumber) (empty-sosofo)) +(element (docinfo isbn) (empty-sosofo)) +(element (docinfo issn) (empty-sosofo)) +(element (docinfo issuenum) (empty-sosofo)) +(element (docinfo itermset) (empty-sosofo)) +(element (docinfo keywordset) (empty-sosofo)) +(element (docinfo legalnotice) (empty-sosofo)) +(element (docinfo lineage) (empty-sosofo)) +(element (docinfo modespec) (empty-sosofo)) +(element (docinfo orgname) (empty-sosofo)) +(element (docinfo othercredit) (empty-sosofo)) +(element (docinfo othername) (empty-sosofo)) +(element (docinfo pagenums) (empty-sosofo)) +(element (docinfo printhistory) (empty-sosofo)) +(element (docinfo productname) (empty-sosofo)) +(element (docinfo productnumber) (empty-sosofo)) +(element (docinfo pubdate) (empty-sosofo)) +(element (docinfo publisher) (empty-sosofo)) +(element (docinfo publishername) (empty-sosofo)) +(element (docinfo pubsnumber) (empty-sosofo)) +(element (docinfo releaseinfo) (empty-sosofo)) +(element (docinfo revhistory) (empty-sosofo)) +(element (docinfo seriesvolnums) (empty-sosofo)) +(element (docinfo subjectset) (empty-sosofo)) +(element (docinfo subtitle) (empty-sosofo)) +(element (docinfo surname) (empty-sosofo)) +(element (docinfo title) (empty-sosofo)) +(element (docinfo titleabbrev) (empty-sosofo)) +(element (docinfo volumenum) (empty-sosofo)) + +(element sect1info (process-children)) + +(element (sect1info abbrev) (empty-sosofo)) +(element (sect1info abstract) (empty-sosofo)) +(element (sect1info address) (empty-sosofo)) +(element (sect1info affiliation) (empty-sosofo)) +(element (sect1info artpagenums) (empty-sosofo)) +(element (sect1info author) (empty-sosofo)) +(element (sect1info authorblurb) (empty-sosofo)) +(element (sect1info authorgroup) (empty-sosofo)) +(element (sect1info authorinitials) (empty-sosofo)) +(element (sect1info bibliomisc) (empty-sosofo)) +(element (sect1info biblioset) (empty-sosofo)) +(element (sect1info collab) (empty-sosofo)) +(element (sect1info confgroup) (empty-sosofo)) +(element (sect1info contractnum) (empty-sosofo)) +(element (sect1info contractsponsor) (empty-sosofo)) +(element (sect1info contrib) (empty-sosofo)) +(element (sect1info copyright) (empty-sosofo)) +(element (sect1info corpauthor) (empty-sosofo)) +(element (sect1info corpname) (empty-sosofo)) +(element (sect1info date) (empty-sosofo)) +(element (sect1info edition) (empty-sosofo)) +(element (sect1info editor) (empty-sosofo)) +(element (sect1info firstname) (empty-sosofo)) +(element (sect1info graphic) (empty-sosofo)) +(element (sect1info honorific) (empty-sosofo)) +(element (sect1info invpartnumber) (empty-sosofo)) +(element (sect1info isbn) (empty-sosofo)) +(element (sect1info issn) (empty-sosofo)) +(element (sect1info issuenum) (empty-sosofo)) +(element (sect1info itermset) (empty-sosofo)) +(element (sect1info keywordset) (empty-sosofo)) +(element (sect1info legalnotice) (empty-sosofo)) +(element (sect1info lineage) (empty-sosofo)) +(element (sect1info modespec) (empty-sosofo)) +(element (sect1info orgname) (empty-sosofo)) +(element (sect1info othercredit) (empty-sosofo)) +(element (sect1info othername) (empty-sosofo)) +(element (sect1info pagenums) (empty-sosofo)) +(element (sect1info printhistory) (empty-sosofo)) +(element (sect1info productname) (empty-sosofo)) +(element (sect1info productnumber) (empty-sosofo)) +(element (sect1info pubdate) (empty-sosofo)) +(element (sect1info publisher) (empty-sosofo)) +(element (sect1info publishername) (empty-sosofo)) +(element (sect1info pubsnumber) (empty-sosofo)) +(element (sect1info releaseinfo) (empty-sosofo)) +(element (sect1info revhistory) (empty-sosofo)) +(element (sect1info seriesvolnums) (empty-sosofo)) +(element (sect1info subjectset) (empty-sosofo)) +(element (sect1info subtitle) (empty-sosofo)) +(element (sect1info surname) (empty-sosofo)) +(element (sect1info title) (empty-sosofo)) +(element (sect1info titleabbrev) (empty-sosofo)) +(element (sect1info volumenum) (empty-sosofo)) + +(element sect2info (process-children)) + +(element (sect2info abbrev) (empty-sosofo)) +(element (sect2info abstract) (empty-sosofo)) +(element (sect2info address) (empty-sosofo)) +(element (sect2info affiliation) (empty-sosofo)) +(element (sect2info artpagenums) (empty-sosofo)) +(element (sect2info author) (empty-sosofo)) +(element (sect2info authorblurb) (empty-sosofo)) +(element (sect2info authorgroup) (empty-sosofo)) +(element (sect2info authorinitials) (empty-sosofo)) +(element (sect2info bibliomisc) (empty-sosofo)) +(element (sect2info biblioset) (empty-sosofo)) +(element (sect2info collab) (empty-sosofo)) +(element (sect2info confgroup) (empty-sosofo)) +(element (sect2info contractnum) (empty-sosofo)) +(element (sect2info contractsponsor) (empty-sosofo)) +(element (sect2info contrib) (empty-sosofo)) +(element (sect2info copyright) (empty-sosofo)) +(element (sect2info corpauthor) (empty-sosofo)) +(element (sect2info corpname) (empty-sosofo)) +(element (sect2info date) (empty-sosofo)) +(element (sect2info edition) (empty-sosofo)) +(element (sect2info editor) (empty-sosofo)) +(element (sect2info firstname) (empty-sosofo)) +(element (sect2info graphic) (empty-sosofo)) +(element (sect2info honorific) (empty-sosofo)) +(element (sect2info invpartnumber) (empty-sosofo)) +(element (sect2info isbn) (empty-sosofo)) +(element (sect2info issn) (empty-sosofo)) +(element (sect2info issuenum) (empty-sosofo)) +(element (sect2info itermset) (empty-sosofo)) +(element (sect2info keywordset) (empty-sosofo)) +(element (sect2info legalnotice) (empty-sosofo)) +(element (sect2info lineage) (empty-sosofo)) +(element (sect2info modespec) (empty-sosofo)) +(element (sect2info orgname) (empty-sosofo)) +(element (sect2info othercredit) (empty-sosofo)) +(element (sect2info othername) (empty-sosofo)) +(element (sect2info pagenums) (empty-sosofo)) +(element (sect2info printhistory) (empty-sosofo)) +(element (sect2info productname) (empty-sosofo)) +(element (sect2info productnumber) (empty-sosofo)) +(element (sect2info pubdate) (empty-sosofo)) +(element (sect2info publisher) (empty-sosofo)) +(element (sect2info publishername) (empty-sosofo)) +(element (sect2info pubsnumber) (empty-sosofo)) +(element (sect2info releaseinfo) (empty-sosofo)) +(element (sect2info revhistory) (empty-sosofo)) +(element (sect2info seriesvolnums) (empty-sosofo)) +(element (sect2info subjectset) (empty-sosofo)) +(element (sect2info subtitle) (empty-sosofo)) +(element (sect2info surname) (empty-sosofo)) +(element (sect2info title) (empty-sosofo)) +(element (sect2info titleabbrev) (empty-sosofo)) +(element (sect2info volumenum) (empty-sosofo)) + +(element sect3info (process-children)) + +(element (sect3info abbrev) (empty-sosofo)) +(element (sect3info abstract) (empty-sosofo)) +(element (sect3info address) (empty-sosofo)) +(element (sect3info affiliation) (empty-sosofo)) +(element (sect3info artpagenums) (empty-sosofo)) +(element (sect3info author) (empty-sosofo)) +(element (sect3info authorblurb) (empty-sosofo)) +(element (sect3info authorgroup) (empty-sosofo)) +(element (sect3info authorinitials) (empty-sosofo)) +(element (sect3info bibliomisc) (empty-sosofo)) +(element (sect3info biblioset) (empty-sosofo)) +(element (sect3info collab) (empty-sosofo)) +(element (sect3info confgroup) (empty-sosofo)) +(element (sect3info contractnum) (empty-sosofo)) +(element (sect3info contractsponsor) (empty-sosofo)) +(element (sect3info contrib) (empty-sosofo)) +(element (sect3info copyright) (empty-sosofo)) +(element (sect3info corpauthor) (empty-sosofo)) +(element (sect3info corpname) (empty-sosofo)) +(element (sect3info date) (empty-sosofo)) +(element (sect3info edition) (empty-sosofo)) +(element (sect3info editor) (empty-sosofo)) +(element (sect3info firstname) (empty-sosofo)) +(element (sect3info graphic) (empty-sosofo)) +(element (sect3info honorific) (empty-sosofo)) +(element (sect3info invpartnumber) (empty-sosofo)) +(element (sect3info isbn) (empty-sosofo)) +(element (sect3info issn) (empty-sosofo)) +(element (sect3info issuenum) (empty-sosofo)) +(element (sect3info itermset) (empty-sosofo)) +(element (sect3info keywordset) (empty-sosofo)) +(element (sect3info legalnotice) (empty-sosofo)) +(element (sect3info lineage) (empty-sosofo)) +(element (sect3info modespec) (empty-sosofo)) +(element (sect3info orgname) (empty-sosofo)) +(element (sect3info othercredit) (empty-sosofo)) +(element (sect3info othername) (empty-sosofo)) +(element (sect3info pagenums) (empty-sosofo)) +(element (sect3info printhistory) (empty-sosofo)) +(element (sect3info productname) (empty-sosofo)) +(element (sect3info productnumber) (empty-sosofo)) +(element (sect3info pubdate) (empty-sosofo)) +(element (sect3info publisher) (empty-sosofo)) +(element (sect3info publishername) (empty-sosofo)) +(element (sect3info pubsnumber) (empty-sosofo)) +(element (sect3info releaseinfo) (empty-sosofo)) +(element (sect3info revhistory) (empty-sosofo)) +(element (sect3info seriesvolnums) (empty-sosofo)) +(element (sect3info subjectset) (empty-sosofo)) +(element (sect3info subtitle) (empty-sosofo)) +(element (sect3info surname) (empty-sosofo)) +(element (sect3info title) (empty-sosofo)) +(element (sect3info titleabbrev) (empty-sosofo)) +(element (sect3info volumenum) (empty-sosofo)) + +(element sect4info (process-children)) + +(element (sect4info abbrev) (empty-sosofo)) +(element (sect4info abstract) (empty-sosofo)) +(element (sect4info address) (empty-sosofo)) +(element (sect4info affiliation) (empty-sosofo)) +(element (sect4info artpagenums) (empty-sosofo)) +(element (sect4info author) (empty-sosofo)) +(element (sect4info authorblurb) (empty-sosofo)) +(element (sect4info authorgroup) (empty-sosofo)) +(element (sect4info authorinitials) (empty-sosofo)) +(element (sect4info bibliomisc) (empty-sosofo)) +(element (sect4info biblioset) (empty-sosofo)) +(element (sect4info collab) (empty-sosofo)) +(element (sect4info confgroup) (empty-sosofo)) +(element (sect4info contractnum) (empty-sosofo)) +(element (sect4info contractsponsor) (empty-sosofo)) +(element (sect4info contrib) (empty-sosofo)) +(element (sect4info copyright) (empty-sosofo)) +(element (sect4info corpauthor) (empty-sosofo)) +(element (sect4info corpname) (empty-sosofo)) +(element (sect4info date) (empty-sosofo)) +(element (sect4info edition) (empty-sosofo)) +(element (sect4info editor) (empty-sosofo)) +(element (sect4info firstname) (empty-sosofo)) +(element (sect4info graphic) (empty-sosofo)) +(element (sect4info honorific) (empty-sosofo)) +(element (sect4info invpartnumber) (empty-sosofo)) +(element (sect4info isbn) (empty-sosofo)) +(element (sect4info issn) (empty-sosofo)) +(element (sect4info issuenum) (empty-sosofo)) +(element (sect4info itermset) (empty-sosofo)) +(element (sect4info keywordset) (empty-sosofo)) +(element (sect4info legalnotice) (empty-sosofo)) +(element (sect4info lineage) (empty-sosofo)) +(element (sect4info modespec) (empty-sosofo)) +(element (sect4info orgname) (empty-sosofo)) +(element (sect4info othercredit) (empty-sosofo)) +(element (sect4info othername) (empty-sosofo)) +(element (sect4info pagenums) (empty-sosofo)) +(element (sect4info printhistory) (empty-sosofo)) +(element (sect4info productname) (empty-sosofo)) +(element (sect4info productnumber) (empty-sosofo)) +(element (sect4info pubdate) (empty-sosofo)) +(element (sect4info publisher) (empty-sosofo)) +(element (sect4info publishername) (empty-sosofo)) +(element (sect4info pubsnumber) (empty-sosofo)) +(element (sect4info releaseinfo) (empty-sosofo)) +(element (sect4info revhistory) (empty-sosofo)) +(element (sect4info seriesvolnums) (empty-sosofo)) +(element (sect4info subjectset) (empty-sosofo)) +(element (sect4info subtitle) (empty-sosofo)) +(element (sect4info surname) (empty-sosofo)) +(element (sect4info title) (empty-sosofo)) +(element (sect4info titleabbrev) (empty-sosofo)) +(element (sect4info volumenum) (empty-sosofo)) + +(element sect5info (process-children)) + +(element (sect5info abbrev) (empty-sosofo)) +(element (sect5info abstract) (empty-sosofo)) +(element (sect5info address) (empty-sosofo)) +(element (sect5info affiliation) (empty-sosofo)) +(element (sect5info artpagenums) (empty-sosofo)) +(element (sect5info author) (empty-sosofo)) +(element (sect5info authorblurb) (empty-sosofo)) +(element (sect5info authorgroup) (empty-sosofo)) +(element (sect5info authorinitials) (empty-sosofo)) +(element (sect5info bibliomisc) (empty-sosofo)) +(element (sect5info biblioset) (empty-sosofo)) +(element (sect5info collab) (empty-sosofo)) +(element (sect5info confgroup) (empty-sosofo)) +(element (sect5info contractnum) (empty-sosofo)) +(element (sect5info contractsponsor) (empty-sosofo)) +(element (sect5info contrib) (empty-sosofo)) +(element (sect5info copyright) (empty-sosofo)) +(element (sect5info corpauthor) (empty-sosofo)) +(element (sect5info corpname) (empty-sosofo)) +(element (sect5info date) (empty-sosofo)) +(element (sect5info edition) (empty-sosofo)) +(element (sect5info editor) (empty-sosofo)) +(element (sect5info firstname) (empty-sosofo)) +(element (sect5info graphic) (empty-sosofo)) +(element (sect5info honorific) (empty-sosofo)) +(element (sect5info invpartnumber) (empty-sosofo)) +(element (sect5info isbn) (empty-sosofo)) +(element (sect5info issn) (empty-sosofo)) +(element (sect5info issuenum) (empty-sosofo)) +(element (sect5info itermset) (empty-sosofo)) +(element (sect5info keywordset) (empty-sosofo)) +(element (sect5info legalnotice) (empty-sosofo)) +(element (sect5info lineage) (empty-sosofo)) +(element (sect5info modespec) (empty-sosofo)) +(element (sect5info orgname) (empty-sosofo)) +(element (sect5info othercredit) (empty-sosofo)) +(element (sect5info othername) (empty-sosofo)) +(element (sect5info pagenums) (empty-sosofo)) +(element (sect5info printhistory) (empty-sosofo)) +(element (sect5info productname) (empty-sosofo)) +(element (sect5info productnumber) (empty-sosofo)) +(element (sect5info pubdate) (empty-sosofo)) +(element (sect5info publisher) (empty-sosofo)) +(element (sect5info publishername) (empty-sosofo)) +(element (sect5info pubsnumber) (empty-sosofo)) +(element (sect5info releaseinfo) (empty-sosofo)) +(element (sect5info revhistory) (empty-sosofo)) +(element (sect5info seriesvolnums) (empty-sosofo)) +(element (sect5info subjectset) (empty-sosofo)) +(element (sect5info subtitle) (empty-sosofo)) +(element (sect5info surname) (empty-sosofo)) +(element (sect5info title) (empty-sosofo)) +(element (sect5info titleabbrev) (empty-sosofo)) +(element (sect5info volumenum) (empty-sosofo)) + +(element refsect1info (process-children)) + +(element (refsect1info abbrev) (empty-sosofo)) +(element (refsect1info abstract) (empty-sosofo)) +(element (refsect1info address) (empty-sosofo)) +(element (refsect1info affiliation) (empty-sosofo)) +(element (refsect1info artpagenums) (empty-sosofo)) +(element (refsect1info author) (empty-sosofo)) +(element (refsect1info authorblurb) (empty-sosofo)) +(element (refsect1info authorgroup) (empty-sosofo)) +(element (refsect1info authorinitials) (empty-sosofo)) +(element (refsect1info bibliomisc) (empty-sosofo)) +(element (refsect1info biblioset) (empty-sosofo)) +(element (refsect1info collab) (empty-sosofo)) +(element (refsect1info confgroup) (empty-sosofo)) +(element (refsect1info contractnum) (empty-sosofo)) +(element (refsect1info contractsponsor) (empty-sosofo)) +(element (refsect1info contrib) (empty-sosofo)) +(element (refsect1info copyright) (empty-sosofo)) +(element (refsect1info corpauthor) (empty-sosofo)) +(element (refsect1info corpname) (empty-sosofo)) +(element (refsect1info date) (empty-sosofo)) +(element (refsect1info edition) (empty-sosofo)) +(element (refsect1info editor) (empty-sosofo)) +(element (refsect1info firstname) (empty-sosofo)) +(element (refsect1info graphic) (empty-sosofo)) +(element (refsect1info honorific) (empty-sosofo)) +(element (refsect1info invpartnumber) (empty-sosofo)) +(element (refsect1info isbn) (empty-sosofo)) +(element (refsect1info issn) (empty-sosofo)) +(element (refsect1info issuenum) (empty-sosofo)) +(element (refsect1info itermset) (empty-sosofo)) +(element (refsect1info keywordset) (empty-sosofo)) +(element (refsect1info legalnotice) (empty-sosofo)) +(element (refsect1info lineage) (empty-sosofo)) +(element (refsect1info modespec) (empty-sosofo)) +(element (refsect1info orgname) (empty-sosofo)) +(element (refsect1info othercredit) (empty-sosofo)) +(element (refsect1info othername) (empty-sosofo)) +(element (refsect1info pagenums) (empty-sosofo)) +(element (refsect1info printhistory) (empty-sosofo)) +(element (refsect1info productname) (empty-sosofo)) +(element (refsect1info productnumber) (empty-sosofo)) +(element (refsect1info pubdate) (empty-sosofo)) +(element (refsect1info publisher) (empty-sosofo)) +(element (refsect1info publishername) (empty-sosofo)) +(element (refsect1info pubsnumber) (empty-sosofo)) +(element (refsect1info releaseinfo) (empty-sosofo)) +(element (refsect1info revhistory) (empty-sosofo)) +(element (refsect1info seriesvolnums) (empty-sosofo)) +(element (refsect1info subjectset) (empty-sosofo)) +(element (refsect1info subtitle) (empty-sosofo)) +(element (refsect1info surname) (empty-sosofo)) +(element (refsect1info title) (empty-sosofo)) +(element (refsect1info titleabbrev) (empty-sosofo)) +(element (refsect1info volumenum) (empty-sosofo)) + +(element refsect2info (process-children)) + +(element (refsect2info abbrev) (empty-sosofo)) +(element (refsect2info abstract) (empty-sosofo)) +(element (refsect2info address) (empty-sosofo)) +(element (refsect2info affiliation) (empty-sosofo)) +(element (refsect2info artpagenums) (empty-sosofo)) +(element (refsect2info author) (empty-sosofo)) +(element (refsect2info authorblurb) (empty-sosofo)) +(element (refsect2info authorgroup) (empty-sosofo)) +(element (refsect2info authorinitials) (empty-sosofo)) +(element (refsect2info bibliomisc) (empty-sosofo)) +(element (refsect2info biblioset) (empty-sosofo)) +(element (refsect2info collab) (empty-sosofo)) +(element (refsect2info confgroup) (empty-sosofo)) +(element (refsect2info contractnum) (empty-sosofo)) +(element (refsect2info contractsponsor) (empty-sosofo)) +(element (refsect2info contrib) (empty-sosofo)) +(element (refsect2info copyright) (empty-sosofo)) +(element (refsect2info corpauthor) (empty-sosofo)) +(element (refsect2info corpname) (empty-sosofo)) +(element (refsect2info date) (empty-sosofo)) +(element (refsect2info edition) (empty-sosofo)) +(element (refsect2info editor) (empty-sosofo)) +(element (refsect2info firstname) (empty-sosofo)) +(element (refsect2info graphic) (empty-sosofo)) +(element (refsect2info honorific) (empty-sosofo)) +(element (refsect2info invpartnumber) (empty-sosofo)) +(element (refsect2info isbn) (empty-sosofo)) +(element (refsect2info issn) (empty-sosofo)) +(element (refsect2info issuenum) (empty-sosofo)) +(element (refsect2info itermset) (empty-sosofo)) +(element (refsect2info keywordset) (empty-sosofo)) +(element (refsect2info legalnotice) (empty-sosofo)) +(element (refsect2info lineage) (empty-sosofo)) +(element (refsect2info modespec) (empty-sosofo)) +(element (refsect2info orgname) (empty-sosofo)) +(element (refsect2info othercredit) (empty-sosofo)) +(element (refsect2info othername) (empty-sosofo)) +(element (refsect2info pagenums) (empty-sosofo)) +(element (refsect2info printhistory) (empty-sosofo)) +(element (refsect2info productname) (empty-sosofo)) +(element (refsect2info productnumber) (empty-sosofo)) +(element (refsect2info pubdate) (empty-sosofo)) +(element (refsect2info publisher) (empty-sosofo)) +(element (refsect2info publishername) (empty-sosofo)) +(element (refsect2info pubsnumber) (empty-sosofo)) +(element (refsect2info releaseinfo) (empty-sosofo)) +(element (refsect2info revhistory) (empty-sosofo)) +(element (refsect2info seriesvolnums) (empty-sosofo)) +(element (refsect2info subjectset) (empty-sosofo)) +(element (refsect2info subtitle) (empty-sosofo)) +(element (refsect2info surname) (empty-sosofo)) +(element (refsect2info title) (empty-sosofo)) +(element (refsect2info titleabbrev) (empty-sosofo)) +(element (refsect2info volumenum) (empty-sosofo)) + +(element refsect3info (process-children)) + +(element (refsect3info abbrev) (empty-sosofo)) +(element (refsect3info abstract) (empty-sosofo)) +(element (refsect3info address) (empty-sosofo)) +(element (refsect3info affiliation) (empty-sosofo)) +(element (refsect3info artpagenums) (empty-sosofo)) +(element (refsect3info author) (empty-sosofo)) +(element (refsect3info authorblurb) (empty-sosofo)) +(element (refsect3info authorgroup) (empty-sosofo)) +(element (refsect3info authorinitials) (empty-sosofo)) +(element (refsect3info bibliomisc) (empty-sosofo)) +(element (refsect3info biblioset) (empty-sosofo)) +(element (refsect3info collab) (empty-sosofo)) +(element (refsect3info confgroup) (empty-sosofo)) +(element (refsect3info contractnum) (empty-sosofo)) +(element (refsect3info contractsponsor) (empty-sosofo)) +(element (refsect3info contrib) (empty-sosofo)) +(element (refsect3info copyright) (empty-sosofo)) +(element (refsect3info corpauthor) (empty-sosofo)) +(element (refsect3info corpname) (empty-sosofo)) +(element (refsect3info date) (empty-sosofo)) +(element (refsect3info edition) (empty-sosofo)) +(element (refsect3info editor) (empty-sosofo)) +(element (refsect3info firstname) (empty-sosofo)) +(element (refsect3info graphic) (empty-sosofo)) +(element (refsect3info honorific) (empty-sosofo)) +(element (refsect3info invpartnumber) (empty-sosofo)) +(element (refsect3info isbn) (empty-sosofo)) +(element (refsect3info issn) (empty-sosofo)) +(element (refsect3info issuenum) (empty-sosofo)) +(element (refsect3info itermset) (empty-sosofo)) +(element (refsect3info keywordset) (empty-sosofo)) +(element (refsect3info legalnotice) (empty-sosofo)) +(element (refsect3info lineage) (empty-sosofo)) +(element (refsect3info modespec) (empty-sosofo)) +(element (refsect3info orgname) (empty-sosofo)) +(element (refsect3info othercredit) (empty-sosofo)) +(element (refsect3info othername) (empty-sosofo)) +(element (refsect3info pagenums) (empty-sosofo)) +(element (refsect3info printhistory) (empty-sosofo)) +(element (refsect3info productname) (empty-sosofo)) +(element (refsect3info productnumber) (empty-sosofo)) +(element (refsect3info pubdate) (empty-sosofo)) +(element (refsect3info publisher) (empty-sosofo)) +(element (refsect3info publishername) (empty-sosofo)) +(element (refsect3info pubsnumber) (empty-sosofo)) +(element (refsect3info releaseinfo) (empty-sosofo)) +(element (refsect3info revhistory) (empty-sosofo)) +(element (refsect3info seriesvolnums) (empty-sosofo)) +(element (refsect3info subjectset) (empty-sosofo)) +(element (refsect3info subtitle) (empty-sosofo)) +(element (refsect3info surname) (empty-sosofo)) +(element (refsect3info title) (empty-sosofo)) +(element (refsect3info titleabbrev) (empty-sosofo)) +(element (refsect3info volumenum) (empty-sosofo)) + +(element seriesinfo (process-children)) + +(element (seriesinfo abbrev) (empty-sosofo)) +(element (seriesinfo abstract) (empty-sosofo)) +(element (seriesinfo address) (empty-sosofo)) +(element (seriesinfo affiliation) (empty-sosofo)) +(element (seriesinfo artpagenums) (empty-sosofo)) +(element (seriesinfo author) (empty-sosofo)) +(element (seriesinfo authorblurb) (empty-sosofo)) +(element (seriesinfo authorgroup) (empty-sosofo)) +(element (seriesinfo authorinitials) (empty-sosofo)) +(element (seriesinfo bibliomisc) (empty-sosofo)) +(element (seriesinfo biblioset) (empty-sosofo)) +(element (seriesinfo collab) (empty-sosofo)) +(element (seriesinfo confgroup) (empty-sosofo)) +(element (seriesinfo contractnum) (empty-sosofo)) +(element (seriesinfo contractsponsor) (empty-sosofo)) +(element (seriesinfo contrib) (empty-sosofo)) +(element (seriesinfo copyright) (empty-sosofo)) +(element (seriesinfo corpauthor) (empty-sosofo)) +(element (seriesinfo corpname) (empty-sosofo)) +(element (seriesinfo date) (empty-sosofo)) +(element (seriesinfo edition) (empty-sosofo)) +(element (seriesinfo editor) (empty-sosofo)) +(element (seriesinfo firstname) (empty-sosofo)) +(element (seriesinfo honorific) (empty-sosofo)) +(element (seriesinfo invpartnumber) (empty-sosofo)) +(element (seriesinfo isbn) (empty-sosofo)) +(element (seriesinfo issn) (empty-sosofo)) +(element (seriesinfo issuenum) (empty-sosofo)) +(element (seriesinfo lineage) (empty-sosofo)) +(element (seriesinfo orgname) (empty-sosofo)) +(element (seriesinfo othercredit) (empty-sosofo)) +(element (seriesinfo othername) (empty-sosofo)) +(element (seriesinfo pagenums) (empty-sosofo)) +(element (seriesinfo printhistory) (empty-sosofo)) +(element (seriesinfo productname) (empty-sosofo)) +(element (seriesinfo productnumber) (empty-sosofo)) +(element (seriesinfo pubdate) (empty-sosofo)) +(element (seriesinfo publisher) (empty-sosofo)) +(element (seriesinfo publishername) (empty-sosofo)) +(element (seriesinfo pubsnumber) (empty-sosofo)) +(element (seriesinfo releaseinfo) (empty-sosofo)) +(element (seriesinfo revhistory) (empty-sosofo)) +(element (seriesinfo seriesvolnums) (empty-sosofo)) +(element (seriesinfo subtitle) (empty-sosofo)) +(element (seriesinfo surname) (empty-sosofo)) +(element (seriesinfo title) (empty-sosofo)) +(element (seriesinfo titleabbrev) (empty-sosofo)) +(element (seriesinfo volumenum) (empty-sosofo)) + +(element artheader (empty-sosofo)) + +(element (artheader abbrev) (empty-sosofo)) +(element (artheader abstract) (empty-sosofo)) +(element (artheader address) (empty-sosofo)) +(element (artheader affiliation) (empty-sosofo)) +(element (artheader artpagenums) (empty-sosofo)) +(element (artheader author) (empty-sosofo)) +(element (artheader authorblurb) (empty-sosofo)) +(element (artheader authorgroup) (empty-sosofo)) +(element (artheader authorinitials) (empty-sosofo)) +(element (artheader bibliomisc) (empty-sosofo)) +(element (artheader biblioset) (empty-sosofo)) +(element (artheader bookbiblio) (empty-sosofo)) +(element (artheader collab) (empty-sosofo)) +(element (artheader confgroup) (empty-sosofo)) +(element (artheader contractnum) (empty-sosofo)) +(element (artheader contractsponsor) (empty-sosofo)) +(element (artheader contrib) (empty-sosofo)) +(element (artheader copyright) (empty-sosofo)) +(element (artheader corpauthor) (empty-sosofo)) +(element (artheader corpname) (empty-sosofo)) +(element (artheader date) (empty-sosofo)) +(element (artheader edition) (empty-sosofo)) +(element (artheader editor) (empty-sosofo)) +(element (artheader firstname) (empty-sosofo)) +(element (artheader honorific) (empty-sosofo)) +(element (artheader invpartnumber) (empty-sosofo)) +(element (artheader isbn) (empty-sosofo)) +(element (artheader issn) (empty-sosofo)) +(element (artheader issuenum) (empty-sosofo)) +(element (artheader keywordset) (empty-sosofo)) +(element (artheader lineage) (empty-sosofo)) +(element (artheader orgname) (empty-sosofo)) +(element (artheader othercredit) (empty-sosofo)) +(element (artheader othername) (empty-sosofo)) +(element (artheader pagenums) (empty-sosofo)) +(element (artheader printhistory) (empty-sosofo)) +(element (artheader productname) (empty-sosofo)) +(element (artheader productnumber) (empty-sosofo)) +(element (artheader pubdate) (empty-sosofo)) +(element (artheader publisher) (empty-sosofo)) +(element (artheader publishername) (empty-sosofo)) +(element (artheader pubsnumber) (empty-sosofo)) +(element (artheader releaseinfo) (empty-sosofo)) +(element (artheader revhistory) (empty-sosofo)) +(element (artheader seriesvolnums) (empty-sosofo)) +(element (artheader subtitle) (empty-sosofo)) +(element (artheader surname) (empty-sosofo)) +(element (artheader title) (empty-sosofo)) +(element (artheader titleabbrev) (empty-sosofo)) +(element (artheader volumenum) (empty-sosofo)) + +(element articleinfo (empty-sosofo)) + +(element (articleinfo abbrev) (empty-sosofo)) +(element (articleinfo abstract) (empty-sosofo)) +(element (articleinfo address) (empty-sosofo)) +(element (articleinfo affiliation) (empty-sosofo)) +(element (articleinfo artpagenums) (empty-sosofo)) +(element (articleinfo author) (empty-sosofo)) +(element (articleinfo authorblurb) (empty-sosofo)) +(element (articleinfo authorgroup) (empty-sosofo)) +(element (articleinfo authorinitials) (empty-sosofo)) +(element (articleinfo bibliomisc) (empty-sosofo)) +(element (articleinfo biblioset) (empty-sosofo)) +(element (articleinfo bookbiblio) (empty-sosofo)) +(element (articleinfo collab) (empty-sosofo)) +(element (articleinfo confgroup) (empty-sosofo)) +(element (articleinfo contractnum) (empty-sosofo)) +(element (articleinfo contractsponsor) (empty-sosofo)) +(element (articleinfo contrib) (empty-sosofo)) +(element (articleinfo copyright) (empty-sosofo)) +(element (articleinfo corpauthor) (empty-sosofo)) +(element (articleinfo corpname) (empty-sosofo)) +(element (articleinfo date) (empty-sosofo)) +(element (articleinfo edition) (empty-sosofo)) +(element (articleinfo editor) (empty-sosofo)) +(element (articleinfo firstname) (empty-sosofo)) +(element (articleinfo honorific) (empty-sosofo)) +(element (articleinfo invpartnumber) (empty-sosofo)) +(element (articleinfo isbn) (empty-sosofo)) +(element (articleinfo issn) (empty-sosofo)) +(element (articleinfo issuenum) (empty-sosofo)) +(element (articleinfo lineage) (empty-sosofo)) +(element (articleinfo orgname) (empty-sosofo)) +(element (articleinfo othercredit) (empty-sosofo)) +(element (articleinfo othername) (empty-sosofo)) +(element (articleinfo pagenums) (empty-sosofo)) +(element (articleinfo printhistory) (empty-sosofo)) +(element (articleinfo productname) (empty-sosofo)) +(element (articleinfo productnumber) (empty-sosofo)) +(element (articleinfo pubdate) (empty-sosofo)) +(element (articleinfo publisher) (empty-sosofo)) +(element (articleinfo publishername) (empty-sosofo)) +(element (articleinfo pubsnumber) (empty-sosofo)) +(element (articleinfo releaseinfo) (empty-sosofo)) +(element (articleinfo revhistory) (empty-sosofo)) +(element (articleinfo seriesvolnums) (empty-sosofo)) +(element (articleinfo subtitle) (empty-sosofo)) +(element (articleinfo surname) (empty-sosofo)) +(element (articleinfo title) (empty-sosofo)) +(element (articleinfo titleabbrev) (empty-sosofo)) +(element (articleinfo volumenum) (empty-sosofo)) + +(element refsynopsisdivinfo (process-children)) + +(element (refsynopsisdivinfo graphic) (empty-sosofo)) +(element (refsynopsisdivinfo legalnotice) (empty-sosofo)) +(element (refsynopsisdivinfo modespec) (empty-sosofo)) +(element (refsynopsisdivinfo subjectset) (empty-sosofo)) +(element (refsynopsisdivinfo keywordset) (empty-sosofo)) +(element (refsynopsisdivinfo itermset) (empty-sosofo)) +(element (refsynopsisdivinfo abbrev) (empty-sosofo)) +(element (refsynopsisdivinfo abstract) (empty-sosofo)) +(element (refsynopsisdivinfo address) (empty-sosofo)) +(element (refsynopsisdivinfo artpagenums) (empty-sosofo)) +(element (refsynopsisdivinfo author) (empty-sosofo)) +(element (refsynopsisdivinfo authorgroup) (empty-sosofo)) +(element (refsynopsisdivinfo authorinitials) (empty-sosofo)) +(element (refsynopsisdivinfo bibliomisc) (empty-sosofo)) +(element (refsynopsisdivinfo biblioset) (empty-sosofo)) +(element (refsynopsisdivinfo collab) (empty-sosofo)) +(element (refsynopsisdivinfo confgroup) (empty-sosofo)) +(element (refsynopsisdivinfo contractnum) (empty-sosofo)) +(element (refsynopsisdivinfo contractsponsor) (empty-sosofo)) +(element (refsynopsisdivinfo copyright) (empty-sosofo)) +(element (refsynopsisdivinfo corpauthor) (empty-sosofo)) +(element (refsynopsisdivinfo corpname) (empty-sosofo)) +(element (refsynopsisdivinfo date) (empty-sosofo)) +(element (refsynopsisdivinfo edition) (empty-sosofo)) +(element (refsynopsisdivinfo editor) (empty-sosofo)) +(element (refsynopsisdivinfo invpartnumber) (empty-sosofo)) +(element (refsynopsisdivinfo isbn) (empty-sosofo)) +(element (refsynopsisdivinfo issn) (empty-sosofo)) +(element (refsynopsisdivinfo issuenum) (empty-sosofo)) +(element (refsynopsisdivinfo orgname) (empty-sosofo)) +(element (refsynopsisdivinfo othercredit) (empty-sosofo)) +(element (refsynopsisdivinfo pagenums) (empty-sosofo)) +(element (refsynopsisdivinfo printhistory) (empty-sosofo)) +(element (refsynopsisdivinfo productname) (empty-sosofo)) +(element (refsynopsisdivinfo productnumber) (empty-sosofo)) +(element (refsynopsisdivinfo pubdate) (empty-sosofo)) +(element (refsynopsisdivinfo publisher) (empty-sosofo)) +(element (refsynopsisdivinfo publishername) (empty-sosofo)) +(element (refsynopsisdivinfo pubsnumber) (empty-sosofo)) +(element (refsynopsisdivinfo releaseinfo) (empty-sosofo)) +(element (refsynopsisdivinfo revhistory) (empty-sosofo)) +(element (refsynopsisdivinfo seriesvolnums) (empty-sosofo)) +(element (refsynopsisdivinfo subtitle) (empty-sosofo)) +(element (refsynopsisdivinfo title) (empty-sosofo)) +(element (refsynopsisdivinfo titleabbrev) (empty-sosofo)) +(element (refsynopsisdivinfo volumenum) (empty-sosofo)) +(element (refsynopsisdivinfo honorific) (empty-sosofo)) +(element (refsynopsisdivinfo firstname) (empty-sosofo)) +(element (refsynopsisdivinfo surname) (empty-sosofo)) +(element (refsynopsisdivinfo lineage) (empty-sosofo)) +(element (refsynopsisdivinfo othername) (empty-sosofo)) +(element (refsynopsisdivinfo affiliation) (empty-sosofo)) +(element (refsynopsisdivinfo authorblurb) (empty-sosofo)) +(element (refsynopsisdivinfo contrib) (empty-sosofo)) + +(element prefaceinfo (empty-sosofo)) + +(element (prefaceinfo abbrev) (empty-sosofo)) +(element (prefaceinfo abstract) (empty-sosofo)) +(element (prefaceinfo address) (empty-sosofo)) +(element (prefaceinfo affiliation) (empty-sosofo)) +(element (prefaceinfo artpagenums) (empty-sosofo)) +(element (prefaceinfo author) (empty-sosofo)) +(element (prefaceinfo authorblurb) (empty-sosofo)) +(element (prefaceinfo authorgroup) (empty-sosofo)) +(element (prefaceinfo authorinitials) (empty-sosofo)) +(element (prefaceinfo bibliomisc) (empty-sosofo)) +(element (prefaceinfo biblioset) (empty-sosofo)) +(element (prefaceinfo bookbiblio) (empty-sosofo)) +(element (prefaceinfo collab) (empty-sosofo)) +(element (prefaceinfo confgroup) (empty-sosofo)) +(element (prefaceinfo contractnum) (empty-sosofo)) +(element (prefaceinfo contractsponsor) (empty-sosofo)) +(element (prefaceinfo contrib) (empty-sosofo)) +(element (prefaceinfo copyright) (empty-sosofo)) +(element (prefaceinfo corpauthor) (empty-sosofo)) +(element (prefaceinfo corpname) (empty-sosofo)) +(element (prefaceinfo date) (empty-sosofo)) +(element (prefaceinfo edition) (empty-sosofo)) +(element (prefaceinfo editor) (empty-sosofo)) +(element (prefaceinfo firstname) (empty-sosofo)) +(element (prefaceinfo honorific) (empty-sosofo)) +(element (prefaceinfo invpartnumber) (empty-sosofo)) +(element (prefaceinfo isbn) (empty-sosofo)) +(element (prefaceinfo issn) (empty-sosofo)) +(element (prefaceinfo issuenum) (empty-sosofo)) +(element (prefaceinfo lineage) (empty-sosofo)) +(element (prefaceinfo orgname) (empty-sosofo)) +(element (prefaceinfo othercredit) (empty-sosofo)) +(element (prefaceinfo othername) (empty-sosofo)) +(element (prefaceinfo pagenums) (empty-sosofo)) +(element (prefaceinfo printhistory) (empty-sosofo)) +(element (prefaceinfo productname) (empty-sosofo)) +(element (prefaceinfo productnumber) (empty-sosofo)) +(element (prefaceinfo pubdate) (empty-sosofo)) +(element (prefaceinfo publisher) (empty-sosofo)) +(element (prefaceinfo publishername) (empty-sosofo)) +(element (prefaceinfo pubsnumber) (empty-sosofo)) +(element (prefaceinfo releaseinfo) (empty-sosofo)) +(element (prefaceinfo revhistory) (empty-sosofo)) +(element (prefaceinfo seriesvolnums) (empty-sosofo)) +(element (prefaceinfo subtitle) (empty-sosofo)) +(element (prefaceinfo surname) (empty-sosofo)) +(element (prefaceinfo title) (empty-sosofo)) +(element (prefaceinfo titleabbrev) (empty-sosofo)) +(element (prefaceinfo volumenum) (empty-sosofo)) + +(element chapterinfo (empty-sosofo)) + +(element (chapterinfo abbrev) (empty-sosofo)) +(element (chapterinfo abstract) (empty-sosofo)) +(element (chapterinfo address) (empty-sosofo)) +(element (chapterinfo affiliation) (empty-sosofo)) +(element (chapterinfo artpagenums) (empty-sosofo)) +(element (chapterinfo author) (empty-sosofo)) +(element (chapterinfo authorblurb) (empty-sosofo)) +(element (chapterinfo authorgroup) (empty-sosofo)) +(element (chapterinfo authorinitials) (empty-sosofo)) +(element (chapterinfo bibliomisc) (empty-sosofo)) +(element (chapterinfo biblioset) (empty-sosofo)) +(element (chapterinfo bookbiblio) (empty-sosofo)) +(element (chapterinfo collab) (empty-sosofo)) +(element (chapterinfo confgroup) (empty-sosofo)) +(element (chapterinfo contractnum) (empty-sosofo)) +(element (chapterinfo contractsponsor) (empty-sosofo)) +(element (chapterinfo contrib) (empty-sosofo)) +(element (chapterinfo copyright) (empty-sosofo)) +(element (chapterinfo corpauthor) (empty-sosofo)) +(element (chapterinfo corpname) (empty-sosofo)) +(element (chapterinfo date) (empty-sosofo)) +(element (chapterinfo edition) (empty-sosofo)) +(element (chapterinfo editor) (empty-sosofo)) +(element (chapterinfo firstname) (empty-sosofo)) +(element (chapterinfo honorific) (empty-sosofo)) +(element (chapterinfo invpartnumber) (empty-sosofo)) +(element (chapterinfo isbn) (empty-sosofo)) +(element (chapterinfo issn) (empty-sosofo)) +(element (chapterinfo issuenum) (empty-sosofo)) +(element (chapterinfo lineage) (empty-sosofo)) +(element (chapterinfo orgname) (empty-sosofo)) +(element (chapterinfo othercredit) (empty-sosofo)) +(element (chapterinfo othername) (empty-sosofo)) +(element (chapterinfo pagenums) (empty-sosofo)) +(element (chapterinfo printhistory) (empty-sosofo)) +(element (chapterinfo productname) (empty-sosofo)) +(element (chapterinfo productnumber) (empty-sosofo)) +(element (chapterinfo pubdate) (empty-sosofo)) +(element (chapterinfo publisher) (empty-sosofo)) +(element (chapterinfo publishername) (empty-sosofo)) +(element (chapterinfo pubsnumber) (empty-sosofo)) +(element (chapterinfo releaseinfo) (empty-sosofo)) +(element (chapterinfo revhistory) (empty-sosofo)) +(element (chapterinfo seriesvolnums) (empty-sosofo)) +(element (chapterinfo subtitle) (empty-sosofo)) +(element (chapterinfo surname) (empty-sosofo)) +(element (chapterinfo title) (empty-sosofo)) +(element (chapterinfo titleabbrev) (empty-sosofo)) +(element (chapterinfo volumenum) (empty-sosofo)) + +(element appendixinfo (empty-sosofo)) + +(element (appendixinfo abbrev) (empty-sosofo)) +(element (appendixinfo abstract) (empty-sosofo)) +(element (appendixinfo address) (empty-sosofo)) +(element (appendixinfo affiliation) (empty-sosofo)) +(element (appendixinfo artpagenums) (empty-sosofo)) +(element (appendixinfo author) (empty-sosofo)) +(element (appendixinfo authorblurb) (empty-sosofo)) +(element (appendixinfo authorgroup) (empty-sosofo)) +(element (appendixinfo authorinitials) (empty-sosofo)) +(element (appendixinfo bibliomisc) (empty-sosofo)) +(element (appendixinfo biblioset) (empty-sosofo)) +(element (appendixinfo bookbiblio) (empty-sosofo)) +(element (appendixinfo collab) (empty-sosofo)) +(element (appendixinfo confgroup) (empty-sosofo)) +(element (appendixinfo contractnum) (empty-sosofo)) +(element (appendixinfo contractsponsor) (empty-sosofo)) +(element (appendixinfo contrib) (empty-sosofo)) +(element (appendixinfo copyright) (empty-sosofo)) +(element (appendixinfo corpauthor) (empty-sosofo)) +(element (appendixinfo corpname) (empty-sosofo)) +(element (appendixinfo date) (empty-sosofo)) +(element (appendixinfo edition) (empty-sosofo)) +(element (appendixinfo editor) (empty-sosofo)) +(element (appendixinfo firstname) (empty-sosofo)) +(element (appendixinfo honorific) (empty-sosofo)) +(element (appendixinfo invpartnumber) (empty-sosofo)) +(element (appendixinfo isbn) (empty-sosofo)) +(element (appendixinfo issn) (empty-sosofo)) +(element (appendixinfo issuenum) (empty-sosofo)) +(element (appendixinfo lineage) (empty-sosofo)) +(element (appendixinfo orgname) (empty-sosofo)) +(element (appendixinfo othercredit) (empty-sosofo)) +(element (appendixinfo othername) (empty-sosofo)) +(element (appendixinfo pagenums) (empty-sosofo)) +(element (appendixinfo printhistory) (empty-sosofo)) +(element (appendixinfo productname) (empty-sosofo)) +(element (appendixinfo productnumber) (empty-sosofo)) +(element (appendixinfo pubdate) (empty-sosofo)) +(element (appendixinfo publisher) (empty-sosofo)) +(element (appendixinfo publishername) (empty-sosofo)) +(element (appendixinfo pubsnumber) (empty-sosofo)) +(element (appendixinfo releaseinfo) (empty-sosofo)) +(element (appendixinfo revhistory) (empty-sosofo)) +(element (appendixinfo seriesvolnums) (empty-sosofo)) +(element (appendixinfo subtitle) (empty-sosofo)) +(element (appendixinfo surname) (empty-sosofo)) +(element (appendixinfo title) (empty-sosofo)) +(element (appendixinfo titleabbrev) (empty-sosofo)) +(element (appendixinfo volumenum) (empty-sosofo)) diff --git a/print/dbinline.dsl b/print/dbinline.dsl new file mode 100644 index 0000000..43fb26a --- /dev/null +++ b/print/dbinline.dsl @@ -0,0 +1,263 @@ +;; $Id: dbinline.dsl,v 1.7 2003/03/25 19:53:56 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ============================== INLINES =============================== + +(element abbrev ($charseq$)) +(element accel ($score-seq$ 'after)) +(element acronym ($charseq$)) +(element action ($charseq$)) +(element application ($charseq$)) +(element classname ($mono-seq$)) +(element constant ($mono-seq$)) +(element command ($bold-seq$)) +(element computeroutput ($mono-seq$)) +(element database ($charseq$)) +(element email + (make sequence (literal "<") ($mono-seq$) (literal ">"))) +(element envar ($charseq$)) +(element errorcode ($charseq$)) +(element errorname ($charseq$)) +(element errortype ($charseq$)) +(element filename ($mono-seq$)) +(element function ($mono-seq$)) +(element guibutton ($guilabel-seq$)) +(element guiicon ($guilabel-seq$)) +(element guilabel ($guilabel-seq$)) +(element guimenu ($guilabel-seq$)) +(element guimenuitem ($guilabel-seq$)) +(element guisubmenu ($guilabel-seq$)) +(element hardware ($charseq$)) +(element interface ($charseq$)) +(element interfacedefinition ($charseq$)) +(element keycap ($bold-seq$)) +(element keycode ($charseq$)) + +(element keycombo + (let* ((action (attribute-string (normalize "action"))) + (joinchar + (cond + ((equal? action (normalize "seq")) " ") ;; space + ((equal? action (normalize "simul")) "+") ;; + + ((equal? action (normalize "press")) "-") ;; ? I don't know + ((equal? action (normalize "click")) "-") ;; ? what to do + ((equal? action (normalize "double-click")) "-") ;; ? about the rest + ((equal? action (normalize "other")) "-") ;; ? of these + (else "-")))) + (let loop ((nl (children (current-node))) (count 1)) + (if (node-list-empty? nl) + (empty-sosofo) + (if (equal? count 1) + (make sequence + (process-node-list (node-list-first nl)) + (loop (node-list-rest nl) (+ count 1))) + (make sequence + (literal joinchar) + (process-node-list (node-list-first nl)) + (loop (node-list-rest nl) (+ count 1)))))))) + +(element keysym ($charseq$)) +(element literal ($mono-seq$)) +(element medialabel ($italic-seq$)) + +(element menuchoice + (let* ((shortcut (select-elements (children (current-node)) + (normalize "shortcut"))) + (items (node-list-filter-by-not-gi + (children (current-node)) + (list (normalize "shortcut"))))) + (make sequence + (let loop ((nl items) (first? #t)) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (if first? + (process-node-list (node-list-first nl)) + (make sequence + (if (or (equal? (gi (node-list-first nl)) + (normalize "guimenuitem")) + (equal? (gi (node-list-first nl)) + (normalize "guisubmenu"))) + (literal "\rightwards-arrow;") + (literal "+")) + (process-node-list (node-list-first nl)))) + (loop (node-list-rest nl) #f)))) + (if (node-list-empty? shortcut) + (empty-sosofo) + (make sequence + (literal " (") + (process-node-list shortcut) + (literal ")")))))) + +(element methodname ($mono-seq$)) +(element shortcut ($bold-seq$)) +(element mousebutton ($charseq$)) +(element option ($mono-seq$)) + +(element optional + (make sequence + (literal %arg-choice-opt-open-str%) + ($charseq$) + (literal %arg-choice-opt-close-str%))) + +(element parameter ($italic-mono-seq$)) +(element property ($charseq$)) +(element prompt ($mono-seq$)) +(element replaceable ($italic-mono-seq$)) +(element returnvalue ($charseq$)) +(element structfield ($italic-mono-seq$)) +(element structname ($charseq$)) +(element symbol ($charseq$)) +(element systemitem ($charseq$)) +(element token ($charseq$)) +(element type ($charseq$)) +(element userinput ($bold-mono-seq$)) +(element varname ($mono-seq$)) + +(element citation + (if biblio-citation-check + (let* ((bgraphies (select-elements (descendants (sgml-root-element)) + (normalize "bibliography"))) + (bchildren1 (expand-children bgraphies + (list (normalize "bibliography")))) + (bchildren2 (expand-children bchildren1 + (list (normalize "bibliodiv")))) + (bibentries (node-list-filter-by-gi + bchildren2 + (list (normalize "biblioentry") + (normalize "bibliomixed"))))) + (let loop ((bibs bibentries)) + (if (node-list-empty? bibs) + (make sequence + (error (string-append "Cannot find citation: " + (data (current-node)))) + (literal "[") ($charseq$) (literal "]")) + (if (citation-matches-target? (current-node) + (node-list-first bibs)) + (make link + destination: (node-list-address (node-list-first bibs)) + (literal "[") ($charseq$) (literal "]")) + (loop (node-list-rest bibs)))))) + (make sequence + (literal "[") ($charseq$) (literal "]")))) + +(element citerefentry + (if %refentry-xref-italic% + ($italic-seq$) + ($charseq$))) + +(element citetitle + (if (equal? (attribute-string (normalize "pubwork")) "article") + (make sequence + (literal (gentext-start-quote)) + (process-children) + (literal (gentext-end-quote))) + ($italic-seq$))) + +(element emphasis + (if (and (attribute-string (normalize "role")) + (or (equal? (attribute-string (normalize "role")) "strong") + (equal? (attribute-string (normalize "role")) "bold"))) + ($bold-seq$) + ($italic-seq$))) + +(element foreignphrase ($italic-seq$)) +(element markup ($charseq$)) +(element phrase ($charseq$)) + +(element quote + (let* ((hnr (hierarchical-number-recursive (normalize "quote") + (current-node))) + (depth (length hnr))) + (if (equal? (modulo depth 2) 1) + (make sequence + (literal (gentext-start-nested-quote)) + (process-children) + (literal (gentext-end-nested-quote))) + (make sequence + (literal (gentext-start-quote)) + (process-children) + (literal (gentext-end-quote)))))) + +(element sgmltag + (let ((class (if (attribute-string (normalize "class")) + (attribute-string (normalize "class")) + (normalize "element")))) + (cond +")))) + ((equal? class (normalize "endtag")) ($mono-seq$ (make sequence + (literal "")))) + ((equal? class (normalize "genentity")) ($mono-seq$ (make sequence + (literal "&") + (process-children) + (literal ";")))) + ((equal? class (normalize "numcharref")) ($mono-seq$ (make sequence + (literal "&#") + (process-children) + (literal ";")))) + ((equal? class (normalize "paramentity")) ($mono-seq$ (make sequence + (literal "%") + (process-children) + (literal ";")))) + ((equal? class (normalize "pi")) ($mono-seq$ (make sequence + (literal "")))) + ((equal? class (normalize "starttag")) ($mono-seq$ (make sequence + (literal "<") + (process-children) + (literal ">")))) + ((equal? class (normalize "sgmlcomment")) ($mono-seq$ (make sequence + (literal "")))) + ((equal? class (normalize "xmlpi")) ($mono-seq$ (make sequence + (literal "")))) +]]> + (else ($charseq$))))) + +(element trademark + (make sequence + ($charseq$) + (cond + ((equal? (attribute-string "class") (normalize "copyright")) + (literal "\copyright-sign;")) + ((equal? (attribute-string "class") (normalize "registered")) + (literal "\registered-sign;")) + ((equal? (attribute-string "class") (normalize "service")) + ($ss-seq$ + (literal "SM"))) + (else + (literal "\trade-mark-sign;"))))) + +(element wordasword ($italic-seq$)) + +(element lineannotation + (make sequence + font-family-name: %body-font-family% + font-posture: 'italic + (process-children))) + +(define ($ss-seq$ plus-or-minus #!optional (sosofo (process-children))) + (make sequence + font-size: + (* (inherited-font-size) %ss-size-factor%) + position-point-shift: + (plus-or-minus (* (inherited-font-size) %ss-shift-factor%)) + sosofo)) + +(element superscript ($ss-seq$ +)) +(element subscript ($ss-seq$ -)) diff --git a/print/dblink.dsl b/print/dblink.dsl new file mode 100644 index 0000000..6517a26 --- /dev/null +++ b/print/dblink.dsl @@ -0,0 +1,457 @@ +;; $Id: dblink.dsl,v 1.6 2003/01/15 08:24:23 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ========================= LINKS AND ANCHORS ========================== + +(element link + ;; No warnings about missing targets. Jade will do that for us, and + ;; this way we can use -wno-idref if we really don't care. + (let* ((endterm (attribute-string (normalize "endterm"))) + (linkend (attribute-string (normalize "linkend"))) + (target (element-with-id linkend)) + (etarget (if endterm + (element-with-id endterm) + (empty-node-list))) + (link-cont (if endterm + (if (node-list-empty? etarget) + (literal + (string-append "LINK CONTENT ENDTERM '" + endterm + "' MISSING")) + (with-mode xref-endterm-mode + (process-node-list etarget))) + (process-children)))) + (if (node-list-empty? target) + link-cont + (make link + destination: (node-list-address target) + link-cont)))) + +(element ulink + (make sequence + (if (node-list-empty? (children (current-node))) + (literal (attribute-string (normalize "url"))) + (make sequence + ($charseq$) + (if (not (equal? (attribute-string (normalize "url")) + (data-of (current-node)))) + (if %footnote-ulinks% + (if (and (equal? (print-backend) 'tex) bop-footnotes) + (make sequence + ($ss-seq$ + (literal (footnote-number (current-node)))) + (make page-footnote + (make paragraph + font-family-name: %body-font-family% + font-size: (* %footnote-size-factor% %bf-size%) + font-posture: 'upright + quadding: %default-quadding% + line-spacing: (* (* %footnote-size-factor% %bf-size%) + %line-spacing-factor%) + space-before: %para-sep% + space-after: %para-sep% + start-indent: %footnote-field-width% + first-line-start-indent: (- %footnote-field-width%) + (make line-field + field-width: %footnote-field-width% + (literal (footnote-number (current-node)) + (gentext-label-title-sep (normalize "footnote")))) + (literal (attribute-string (normalize "url")))))) + ($ss-seq$ + (literal (footnote-number (current-node))))) + (if %show-ulinks% + (make sequence + (literal " (") + (literal (attribute-string (normalize "url"))) + (literal ")")) + (empty-sosofo))) + (empty-sosofo)))))) + +(element footnoteref + (process-element-with-id (attribute-string (normalize "linkend")))) + +(element anchor + ;; This is different than (empty-sosofo) alone because the backend + ;; will hang an anchor off the empty sequence. + (make sequence (empty-sosofo))) + +(element beginpage (empty-sosofo)) + +;; ====================================================================== + +(define (olink-link) + ;; This is an olink without a TARGETDOCENT, treat it as a link within + ;; the same document. + (let* ((localinfo (attribute-string (normalize "localinfo"))) + (target (element-with-id localinfo)) + (linkmode (attribute-string (normalize "linkmode"))) + (modespec (if linkmode (element-with-id linkmode) (empty-node-list))) + (xreflabel (if (node-list-empty? modespec) + #f + (attribute-string (normalize "xreflabel") modespec))) + (linktext (strip (data-of (current-node))))) + (if (node-list-empty? target) + (make sequence + (error (string-append "OLink to missing ID '" localinfo "'")) + (if (and (equal? linktext "") xreflabel) + (literal xreflabel) + (process-children))) + (if (equal? linktext "") + (if xreflabel + (xref-general target xreflabel) + (xref-general target)) + (process-children))))) + +(define (olink-simple) + ;; Assumptions: + ;; - The TARGETDOCENT is identified by a public ID + ;; - If the element has no content, the title extracted by + ;; (olink-resource-title) should be used + ;; - The (olink-resource-title) function can deduce the title from + ;; the pubid and the sysid + (let* ((target (attribute-string (normalize "targetdocent"))) + (pubid (entity-public-id target)) + (sysid (system-id-filename target)) + (title (olink-resource-title pubid sysid)) + (linktext (strip (data-of (current-node))))) + (if (equal? linktext "") + (make sequence + font-posture: 'italic + (literal title)) + (process-children)))) + +(define (olink-outline-xref olroot target linktext) + (let* ((name (attribute-string (normalize "name") target)) + (label (attribute-string (normalize "label") target)) + (title (select-elements (children target) (normalize "ttl"))) + (substitute (list + (list "%g" (if name (literal name) (literal ""))) + (list "%n" (if label (literal label) (literal ""))) + (list "%t" (with-mode olink-title-mode + (process-node-list title))))) + (tlist (match-split-list linktext (assoc-objs substitute)))) + (string-list-sosofo tlist substitute))) + +(define (olink-outline) + (let* ((target (attribute-string (normalize "targetdocent"))) + (linkmode (attribute-string (normalize "linkmode"))) + (localinfo (attribute-string (normalize "localinfo"))) + (modespec (if linkmode (element-with-id linkmode) (empty-node-list))) + (xreflabel (if (node-list-empty? modespec) + "" + (attribute-string (normalize "xreflabel") modespec))) + (pubid (entity-public-id target)) + (sysid (system-id-filename target)) + (basename (trim-string sysid '(".sgm" ".xml" ".sgml"))) + (olinkfile (string-append basename %olink-outline-ext%)) + (olinkdoc (sgml-parse olinkfile)) + (olinkroot (node-property 'document-element olinkdoc)) + (olnode (if localinfo + (element-with-id localinfo olinkroot) + olinkroot)) + (linktext (strip (data-of (current-node))))) + (if (equal? linktext "") + (olink-outline-xref olinkroot olnode xreflabel) + (process-children)))) + +(element olink + (if (not (attribute-string (normalize "targetdocent"))) + (olink-link) + (if (attribute-string (normalize "linkmode")) + (olink-outline) + (olink-simple)))) + +(mode olink-title-mode + (default (process-children)) + + (element ttl + (make sequence + font-posture: 'italic + (process-children))) + + (element it + (make sequence + font-posture: 'upright + (process-children))) + + (element tt + (make sequence + font-family-name: %mono-font-family% + (process-children))) + + (element sub + ($ss-seq$ -)) + + (element sup + ($ss-seq$ +)) +) + +;; ====================================================================== + +(element xref + (let* ((endterm (attribute-string (normalize "endterm"))) + (linkend (attribute-string (normalize "linkend"))) + (target (element-with-id linkend)) + (xreflabel (if (node-list-empty? target) + #f + (attribute-string (normalize "xreflabel") target)))) + (if (node-list-empty? target) + (error (string-append "XRef LinkEnd to missing ID '" linkend "'")) + (if xreflabel + (make link + destination: (node-list-address target) + (literal xreflabel)) + (if endterm + (if (node-list-empty? (element-with-id endterm)) + (error (string-append "XRef EndTerm to missing ID '" + endterm "'")) + (make link + destination: (node-list-address (element-with-id endterm)) + (with-mode xref-endterm-mode + (process-element-with-id endterm)))) + (cond + ((or (equal? (gi target) (normalize "biblioentry")) + (equal? (gi target) (normalize "bibliomixed"))) + ;; xref to the bibliography is a special case + (xref-biblioentry target)) + ((equal? (gi target) (normalize "co")) + ;; callouts are a special case + (xref-callout target)) + ((equal? (gi target) (normalize "listitem")) + (xref-listitem target)) + ((equal? (gi target) (normalize "varlistentry")) + (xref-varlistentry target)) + ((equal? (gi target) (normalize "question")) + (xref-question target)) + ((equal? (gi target) (normalize "answer")) + (xref-answer target)) + ((equal? (gi target) (normalize "refentry")) + (xref-refentry target)) + ((equal? (gi target) (normalize "refnamediv")) + ;; and refnamedivs + (xref-refnamediv target)) + ((equal? (gi target) (normalize "glossentry")) + ;; as are glossentrys + (xref-glossentry target)) + ((equal? (gi target) (normalize "author")) + ;; and authors + (xref-author target)) + ((equal? (gi target) (normalize "authorgroup")) + ;; and authorgroups + (xref-authorgroup target)) + (else + (xref-general target)))))))) + +(define (xref-general target #!optional (xref-string #f)) + ;; This function is used by both XREF and OLINK (when no TARGETDOCENT + ;; is specified). The only case where xref-string is supplied is + ;; on OLINK. + (let ((label (attribute-string (normalize "xreflabel") target))) + (make link + destination: (node-list-address target) + (if xref-string + (auto-xref target xref-string) + (if label + (xreflabel-sosofo label) + (auto-xref target)))))) + +(define (xref-refentry target) +;; refmeta/refentrytitle, refmeta/manvolnum, refnamediv/refdescriptor, +;; refnamediv/refname + (let* ((refmeta (select-elements (children target) + (normalize "refmeta"))) + (refnamediv (select-elements (children target) + (normalize "refnamediv"))) + (rfetitle (select-elements (children refmeta) + (normalize "refentrytitle"))) + (manvolnum (select-elements (children refmeta) + (normalize "manvolnum"))) + (refdescrip (select-elements (children refnamediv) + (normalize "refdescriptor"))) + (refname (select-elements (children refnamediv) + (normalize "refname"))) + + (title (if (node-list-empty? rfetitle) + (if (node-list-empty? refdescrip) + (node-list-first refname) + (node-list-first refdescrip)) + (node-list-first rfetitle)))) + (make link + destination: (node-list-address target) + + (make sequence + font-posture: (if %refentry-xref-italic% + 'italic + (inherited-font-posture)) + + (process-node-list (children title)) + (if (and %refentry-xref-manvolnum% + (not (node-list-empty? manvolnum))) + (process-node-list manvolnum) + (empty-sosofo)))))) + +(define (xref-refnamediv target) + (let* ((refname (select-elements (children target) + (normalize "refname"))) + + (title (node-list-first refname))) + (make link + destination: (node-list-address target) + + (make sequence + font-posture: (if %refentry-xref-italic% + 'italic + (inherited-font-posture)) + + (process-node-list (children title)))))) + +(define (xref-varlistentry target) + (let ((terms (select-elements (children target) + (normalize "term")))) + (make link + destination: (node-list-address target) + (with-mode xref-varlistentry-mode + (process-node-list (node-list-first terms)))))) + +(define (xref-glossentry target) + (let ((glossterms (select-elements (children target) + (normalize "glossterm")))) + (make link + destination: (node-list-address target) + (with-mode xref-glossentry-mode + (process-node-list (node-list-first glossterms)))))) + +(define (xref-author target) + (make link + destination: (node-list-address target) + (literal (author-string target)))) + +(define (xref-authorgroup target) + ;; it's a quirk of author-list-string that it needs to point to + ;; one of the authors in the authorgroup, not the authorgroup. + ;; go figure. + (make link + destination: (node-list-address target) + (let loop ((author (select-elements (children target) + (normalize "author")))) + (if (node-list-empty? author) + (empty-sosofo) + (make sequence + (literal (author-list-string (node-list-first author))) + (loop (node-list-rest author))))))) + +(define (xref-biblioentry target) + (let* ((abbrev (node-list-first + (node-list-filter-out-pis (children target)))) + (label (attribute-string (normalize "xreflabel") target))) + (make link + destination: (node-list-address target) + + (if biblio-xref-title + (let* ((citetitles (select-elements (descendants target) + (normalize "citetitle"))) + (titles (select-elements (descendants target) + (normalize "title"))) + (title (if (node-list-empty? citetitles) + (node-list-first titles) + (node-list-first citetitles)))) + (with-mode xref-title-mode + (process-node-list title))) + (if biblio-number + (make sequence + (literal "[" (number->string (bibentry-number target)) "]")) + (if label + (make sequence + (literal "[" label "]")) + (if (equal? (gi abbrev) (normalize "abbrev")) + (make sequence + (process-node-list abbrev)) + (make sequence + (literal "[" + (attribute-string (normalize "id") target) + "]"))))))))) + +(define (xref-callout target) + (make link + destination: (node-list-address target) + ($callout-mark$ target))) + +(define (xref-listitem target) + (if (equal? (gi (parent target)) (normalize "orderedlist")) + (make link + destination: (node-list-address target) + (literal (orderedlist-listitem-label-recursive target))) + (error + (string-append "XRef to LISTITEM only supported in ORDEREDLISTs")))) + + +(define (xref-question target) + (make link + destination: (node-list-address target) + (make sequence + (literal (gentext-element-name target)) + (literal (gentext-label-title-sep target)) + (literal (question-answer-label target))))) + +(define (xref-answer target) + (xref-question target)) + +(mode xref-endterm-mode + (default + (make sequence + font-posture: 'italic + (process-children-trim)))) + +(define (xreflabel-sosofo xreflabel) + (make sequence + font-posture: 'italic + (literal xreflabel))) + +;; ====================================================================== + +;; Returns the title of the element as a sosofo, italicized for xref. +;; +(define (element-title-xref-sosofo nd) + (make sequence + font-posture: 'italic + (element-title-sosofo nd))) + +(mode xref-title-mode + (element title + (make sequence + font-posture: 'italic + (process-children-trim))) + + (element citetitle + (make sequence + font-posture: 'italic + (process-children-trim))) + + (element refname + (process-children-trim)) + + (element refentrytitle + (process-children-trim)) +) + +(mode xref-varlistentry-mode + (element term + ($italic-seq$))) + +(mode xref-glossentry-mode + (element glossterm + ($italic-seq$))) + +;; ====================================================================== + +(define (element-page-number-sosofo target) + (with-mode pageno-mode + (process-node-list target))) + +(mode pageno-mode + (default + (current-node-page-number-sosofo))) + +;; ====================================================================== + diff --git a/print/dblists.dsl b/print/dblists.dsl new file mode 100644 index 0000000..d109e77 --- /dev/null +++ b/print/dblists.dsl @@ -0,0 +1,515 @@ +;; $Id: dblists.dsl,v 1.7 2003/02/17 02:42:44 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; =============================== LISTS ================================ + +(define (BULLTREAT bullfcn ilevel override mark) + (cond + (override (bullfcn override ilevel)) + (mark (bullfcn mark ilevel)) + (else (bullfcn "bullet" ilevel)))) + +(define (BULLSTR m lvl) + (dingbat m)) + +(define (BULLSHIFT m lvl) + (let ((md (case-fold-down m))) + (case md + (("bullet") 0.0em) + (("box") (if (= lvl 1) 0.0em 0.1em)) + (("checkbox") (if (= lvl 1) 0.0em 0.1em)) + (("check") 0.0em) + (("checkedbox") 0.0em) + (("dash") 0.0em) + (("none") 0.0em) + (else 0.0em)))) + +(define (MSIZE m lvl f1 f2) + (if (= lvl 1) + (* %bf-size% f1) + (* %bf-size% f2))) + +(define (BULLSIZE m lvl) + (let ((md (case-fold-down m))) + (case md + (("bullet") (MSIZE m lvl 0.8 0.72)) + (("box") (MSIZE m lvl 0.9 0.72)) + (("checkbox") (MSIZE m lvl 0.9 0.72)) + (("check") (MSIZE m lvl 1.0 1.0)) + (("checkedbox") (MSIZE m lvl 1.0 1.0)) + (("dash") (MSIZE m lvl 1.0 1.0)) + (("none") (MSIZE m lvl 1.0 1.0)) + (else (MSIZE m lvl 1.0 1.0))))) + +(define (OLSTEP) 0.9em) +;; (case +;; (modulo (length (hierarchical-number-recursive (normalize "orderedlist"))) 4) +;; ((1) 1.4em) +;; ((2) 1.4em) +;; ((3) 1.4em) +;; ((0) 1.4em))) + +(define (ILSTEP) 1.0em) + +(define (COSTEP) 1.5pi) + +;; Improve spacing on lists, remove extra space before.. +;; Suggested by Adam Di Carlo, adam@onshore.com +(define ($list$) + (make display-group + start-indent: (if (INBLOCK?) + (inherited-start-indent) + (+ %block-start-indent% (inherited-start-indent))) + space-after: (if (INLIST?) %para-sep% %block-sep%))) + +(element itemizedlist ($list$)) + +(element (itemizedlist title) + (make paragraph + use: title-style + (process-children))) + +(define (generic-list-item indent-step line-field) + (let* ((itemcontent (children (current-node))) + (first-child (node-list-first itemcontent)) + (spacing (inherited-attribute-string (normalize "spacing")))) + (make display-group + start-indent: (+ (inherited-start-indent) indent-step) + (make paragraph + use: (cond + ((equal? (gi first-child) (normalize "programlisting")) + verbatim-style) + ((equal? (gi first-child) (normalize "screen")) + verbatim-style) + ((equal? (gi first-child) (normalize "synopsis")) + verbatim-style) + ((equal? (gi first-child) (normalize "literallayout")) + linespecific-style) + ((equal? (gi first-child) (normalize "address")) + linespecific-style) + (else + nop-style)) + space-before: (if (equal? (normalize "compact") spacing) + 0pt + %para-sep%) + first-line-start-indent: (- indent-step) + (make sequence + line-field) + (with-mode listitem-content-mode + (process-node-list first-child))) + (process-node-list (node-list-rest itemcontent))))) + +(define (process-listitem-content) + (if (absolute-first-sibling?) + (make sequence + (process-children-trim)) + (next-match))) + +(mode listitem-content-mode + (element (listitem programlisting) (process-listitem-content)) + (element (listitem screen) (process-listitem-content)) + (element (listitem synopsis) (process-listitem-content)) + (element (listitem funcsynopsis) (process-listitem-content)) + (element (listitem literallayout) (process-listitem-content)) + (element (listitem address) (process-listitem-content)) + (element (listitem para) (process-listitem-content)) + (element (listitem formalpara) (process-listitem-content)) + (element (listitem simpara) (process-listitem-content)) +) + +(element (itemizedlist listitem) + (let ((ilevel (length (hierarchical-number-recursive (normalize "itemizedlist")))) + (override (inherited-attribute-string (normalize "override"))) + (mark (inherited-attribute-string (normalize "mark")))) + (generic-list-item + (ILSTEP) + (if (or (and override + (equal? (normalize override) (normalize "none"))) + (and (not override) + (equal? (normalize mark) (normalize "none")))) + (make line-field + font-size: (BULLTREAT BULLSIZE ilevel override mark) + position-point-shift: (BULLTREAT BULLSHIFT ilevel override mark) + field-width: (ILSTEP) + (literal "\no-break-space;")) + (make line-field + font-size: (BULLTREAT BULLSIZE ilevel override mark) + position-point-shift: (BULLTREAT BULLSHIFT ilevel override mark) + field-width: (ILSTEP) + (literal (BULLTREAT BULLSTR ilevel override mark))))))) + +(element orderedlist ($list$)) + +(element (orderedlist title) + (make paragraph + use: title-style + (process-children))) + +(element (orderedlist listitem) + (let* ((listitems (select-elements (children (parent (current-node))) + (normalize "listitem"))) + (itemnumber (orderedlist-listitem-number (current-node))) + (displaynum (if (string=? (inherited-attribute-string + (normalize "inheritnum")) + (normalize "inherit")) + (let loop ((nd (current-node)) (inum "")) + (if (node-list-empty? nd) + inum + (if (and (equal? (gi nd) + (normalize "listitem")) + (equal? (gi (parent nd)) + (normalize "orderedlist"))) + (loop (parent nd) + (string-append + (number-with-numeration + nd + (inherited-attribute-string + (normalize "numeration") nd) + (orderedlist-listitem-number nd)) + (if (string=? inum "") + "" + ".") + inum)) + (loop (parent nd) inum)))) + (number-with-numeration + (current-node) + (inherited-attribute-string (normalize "numeration")) + (orderedlist-listitem-number (current-node))))) + (listcount (+ (node-list-length listitems) itemnumber)) + (factor (cond + ((> listcount 999) 4) + ((> listcount 99) 3) + ((> listcount 9) 2) + (else 2)))) + (generic-list-item + (* (OLSTEP) factor) + (make line-field + field-width: (* (OLSTEP) factor) + field-align: 'end + (literal displaynum + (gentext-label-title-sep (normalize "orderedlist"))))))) + +(define (number-with-numeration node numeration number) + (let* ((depth (length (hierarchical-number-recursive (normalize "orderedlist") node))) + (rawnum (cond + ((equal? numeration (normalize "arabic")) 1) + ((equal? numeration (normalize "loweralpha")) 2) + ((equal? numeration (normalize "lowerroman")) 3) + ((equal? numeration (normalize "upperalpha")) 4) + ((equal? numeration (normalize "upperroman")) 0) + (else (modulo depth 5)))) + (num (case rawnum + ((1) (format-number number "1")) + ((2) (format-number number "a")) + ((3) (format-number number "i")) + ((4) (format-number number "A")) + ((0) (format-number number "I"))))) + (if (> depth 5) + (string-append "(" num ")") + num))) + +(element variablelist + (let* ((termlength (if (attribute-string (normalize "termlength")) + (string->number + (attribute-string (normalize "termlength"))) + %default-variablelist-termlength%)) + (maxlen (if (> termlength %default-variablelist-termlength%) + termlength + %default-variablelist-termlength%)) + (too-long? (variablelist-term-too-long? termlength))) + (make display-group + start-indent: (if (INBLOCK?) + (inherited-start-indent) + (+ %block-start-indent% (inherited-start-indent))) + space-before: (if (INLIST?) %para-sep% %block-sep%) + space-after: (if (INLIST?) %para-sep% %block-sep%) + + (if (and (or (and termlength (not too-long?)) + %always-format-variablelist-as-table%) + (or %may-format-variablelist-as-table% + %always-format-variablelist-as-table%)) + (make table + space-before: (if (INLIST?) %para-sep% %block-sep%) + space-after: (if (INLIST?) %para-sep% %block-sep%) + start-indent: (if (INBLOCK?) + (inherited-start-indent) + (+ %block-start-indent% + (inherited-start-indent))) + +;; Calculate the width of the column containing the terms... +;; +;; maxlen in (inherited-font-size) 72pt +;; x ---------- x ----------------------- x ------ = width +;; 12 chars 10pt in +;; + (make table-column + column-number: 1 + width: (* (* (/ maxlen 12) (/ (inherited-font-size) 10pt)) 72pt)) + (with-mode variablelist-table + (process-children))) + (process-children))))) + +(element varlistentry (process-children)) + +(element (varlistentry term) + (make paragraph + space-before: (if (first-sibling?) + %block-sep% + 0pt) + keep-with-next?: #t + first-line-start-indent: 0pt + start-indent: (inherited-start-indent) + (process-children))) + +(element (varlistentry listitem) + (let ((vle-indent 2em)) ; this ought to be in dbparam! + (generic-list-item + vle-indent + (make line-field + field-width: vle-indent + (literal "\no-break-space;"))))) + +(mode variablelist-table + (element varlistentry + (let* ((terms (select-elements (children (current-node)) + (normalize "term"))) + (listitem (select-elements (children (current-node)) + (normalize "listitem"))) + (termlen (if (attribute-string (normalize "termlength") + (parent (current-node))) + (string->number (attribute-string + (normalize "termlength") + (parent (current-node)))) + %default-variablelist-termlength%)) + (too-long? (varlistentry-term-too-long? (current-node) termlen))) + (if too-long? + (make sequence + (make table-row + cell-before-row-margin: %para-sep% + + (make table-cell + column-number: 1 + n-columns-spanned: 2 + n-rows-spanned: 1 + (process-node-list terms))) + (make table-row + (make table-cell + column-number: 1 + n-columns-spanned: 1 + n-rows-spanned: 1 + ;; where terms would have gone + (empty-sosofo)) + (make table-cell + column-number: 2 + n-columns-spanned: 1 + n-rows-spanned: 1 + (process-node-list listitem)))) + (make table-row + cell-before-row-margin: %para-sep% + + (make table-cell + column-number: 1 + n-columns-spanned: 1 + n-rows-spanned: 1 + (process-node-list terms)) + (make table-cell + column-number: 2 + n-columns-spanned: 1 + n-rows-spanned: 1 + (process-node-list listitem)))))) + + (element (varlistentry term) + (make sequence + (process-children-trim) + (if (not (last-sibling?)) + (literal ", ") + (empty-sosofo)))) + + (element (varlistentry listitem) + (make display-group + start-indent: 0pt + (process-children))) + + ;; Suggested by Nick NICHOLAS, nicholas@uci.edu + (element (variablelist title) + (make table-row + cell-before-row-margin: %para-sep% + (make table-cell + column-number: 1 + n-columns-spanned: 2 + n-rows-spanned: 1 + (make paragraph + use: title-style + start-indent: 0pt + (process-children))))) + +) + +(define (simplelist-table majororder cols members) + (let* ((termcount (node-list-length members)) + (rows (quotient (+ termcount (- cols 1)) cols))) + (make table + space-before: (if (INLIST?) %para-sep% %block-sep%) + space-after: (if (INLIST?) %para-sep% %block-sep%) + start-indent: (if (INBLOCK?) + (inherited-start-indent) + (+ %block-start-indent% (inherited-start-indent))) + (if %simplelist-column-width% + (let colloop ((colnum 1)) + (if (> colnum cols) + (empty-sosofo) + (make sequence + (make table-column + width: %simplelist-column-width%) + (colloop (+ colnum 1))))) + (empty-sosofo)) + (let rowloop ((rownum 1)) + (if (> rownum rows) + (empty-sosofo) + (make sequence + (simplelist-row rownum majororder rows cols members) + (rowloop (+ rownum 1)))))))) + +(define (simplelist-row rownum majororder rows cols members) + (make table-row + (let colloop ((colnum 1)) + (if (> colnum cols) + (empty-sosofo) + (make sequence + (simplelist-entry rownum colnum majororder rows cols members) + (colloop (+ colnum 1))))))) + +(define (simplelist-entry rownum colnum majororder rows cols members) + (let ((membernum (if (equal? majororder 'row) + (+ (* (- rownum 1) cols) colnum) + (+ (* (- colnum 1) rows) rownum)))) + (let loop ((nl members) (count membernum)) + (if (<= count 1) + (make table-cell + column-number: colnum + n-columns-spanned: 1 + n-rows-spanned: 1 +;; removed to avoid dependency between dblists and dbtable +;; cell-before-row-margin: %cals-cell-before-row-margin% +;; cell-after-row-margin: %cals-cell-after-row-margin% +;; cell-before-column-margin: %cals-cell-before-column-margin% +;; cell-after-column-margin: %cals-cell-after-column-margin% +;; start-indent: %cals-cell-content-start-indent% +;; end-indent: %cals-cell-content-end-indent% +;; is another variable needed to parameterize these settings, or are +;; constants good enough? + cell-before-row-margin: 0pt + cell-after-row-margin: 0pt + cell-before-column-margin: 3pt + cell-after-column-margin: 3pt + start-indent: 0pt + end-indent: 0pt + quadding: 'start + (if (node-list-empty? nl) + (literal "\no-break-space;") + (process-node-list (node-list-first nl)))) + (loop (node-list-rest nl) (- count 1)))))) + +(element (entry simplelist) + ;; This is to avoid possibly putting tables inside tables, which don't + ;; work in some backends (e.g. RTF) + (make paragraph + (process-children))) + +(element (entry simplelist member) + ;; This is to avoid possibly putting tables inside tables, which don't + ;; work in some backends (e.g. RTF) + (let ((type (inherited-attribute-string (normalize "type")))) + (if (equal? type (normalize "inline")) + (next-match) + (make sequence + (if (equal? (child-number) 1) + (empty-sosofo) + (make paragraph-break)) + (process-children))))) + +(element simplelist + (let ((type (attribute-string (normalize "type"))) + (cols (if (attribute-string (normalize "columns")) + (if (> (string->number (attribute-string (normalize "columns"))) 0) + (string->number (attribute-string (normalize "columns"))) + 1) + 1)) + (members (select-elements (children (current-node)) (normalize "member")))) + (cond + ((equal? type (normalize "inline")) + (process-children)) + ((equal? type (normalize "vert")) + (simplelist-table 'column cols members)) + ((equal? type (normalize "horiz")) + (simplelist-table 'row cols members))))) + +(element member + (let ((type (inherited-attribute-string (normalize "type")))) + (if (equal? type (normalize "inline")) + (make sequence + (process-children) + (if (not (last-sibling?)) + (literal ", ") + (literal ""))) + (make paragraph + quadding: 'start + (process-children))))) + +(element segmentedlist (process-children)) +(element (segmentedlist title) ($lowtitle$ 2 4)) + +(element segtitle (empty-sosofo)) +(mode seglist-in-seg + (element segtitle + (make sequence + font-family-name: %title-font-family% + font-weight: 'bold + (process-children)))) + +(element seglistitem ($paragraph$)) +(element seg + (let* ((seg-num (child-number (current-node))) + (seglist (parent (parent (current-node)))) + (segtitle (nth-node (select-elements + (descendants seglist) (normalize "segtitle")) seg-num))) + + ;; Note: segtitle is only going to be the right thing in a well formed + ;; SegmentedList. If there are too many Segs or too few SegTitles, + ;; you'll get something odd...maybe an error + + (with-mode seglist-in-seg + (make paragraph + (make sequence + font-family-name: %title-font-family% + font-weight: 'bold + (sosofo-append (process-node-list segtitle)) + (literal ": ")) + (process-children))))) + +(element calloutlist ($list$)) +(element (calloutlist title) ($lowtitle$ 2 4)) + +(element callout + (let* ((calloutcontent (children (current-node))) + (arearefs (inherited-attribute-string (normalize "arearefs"))) + (idlist (split arearefs))) + (make sequence + start-indent: (+ (inherited-start-indent) (COSTEP)) + (make paragraph + space-before: %para-sep% + first-line-start-indent: (- (COSTEP)) + (make line-field + field-width: (COSTEP) + (let loop ((ids idlist)) + (if (null? ids) + (empty-sosofo) + (make sequence + ($callout-mark$ (element-with-id (car ids))) + (loop (cdr ids)))))) + (process-node-list (children (node-list-first calloutcontent)))) + + (process-node-list (node-list-rest calloutcontent))))) diff --git a/print/dblot.dsl b/print/dblot.dsl new file mode 100644 index 0000000..6964ad4 --- /dev/null +++ b/print/dblot.dsl @@ -0,0 +1,24 @@ +;; $Id: dblot.dsl,v 1.2 2003/01/15 08:24:23 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; need test cases to do toc/lot; do these later + +(element toc (empty-sosofo)) +(element (toc title) (empty-sosofo)) +(element tocfront ($paragraph$)) +(element tocentry ($paragraph$)) +(element tocpart (process-children)) +(element tocchap (process-children)) +(element toclevel1 (process-children)) +(element toclevel2 (process-children)) +(element toclevel3 (process-children)) +(element toclevel4 (process-children)) +(element toclevel5 (process-children)) +(element tocback ($paragraph$)) +(element lot (empty-sosofo)) +(element (lot title) (empty-sosofo)) +(element lotentry ($paragraph$)) + diff --git a/print/dbmath.dsl b/print/dbmath.dsl new file mode 100644 index 0000000..7284176 --- /dev/null +++ b/print/dbmath.dsl @@ -0,0 +1,92 @@ +;; $Id: dbmath.dsl,v 1.2 2003/01/15 08:24:23 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +(define %equation-autolabel% #f) + +(element equation + ;; derived from $semiformal-object$ + (if (node-list-empty? (select-elements (children (current-node)) + (normalize "title"))) + ($informal-object$ %informalequation-rules% %informalequation-rules%) + ($formal-object$ %informalequation-rules% %informalequation-rules%))) + +(element (equation title) (empty-sosofo)) +(element (equation alt) (empty-sosofo)) +(element (equation graphic) + (make paragraph + space-before: 0pt + space-after: 0pt + ($img$ (current-node) #t))) + +(element informalequation + ;; Derived from informal-object + (let ((rule-before? %informalequation-rules%) + (rule-after? %informalequation-rules%)) + (if %equation-autolabel% + (make display-group + space-before: %block-sep% + space-after: %block-sep% + start-indent: (+ %block-start-indent% + (inherited-start-indent)) + keep-with-next?: (object-title-after) + + (if rule-before? + (make rule + orientation: 'horizontal + line-thickness: %object-rule-thickness% + display-alignment: 'center + space-after: (/ %block-sep% 2) + keep-with-next?: #t) + (empty-sosofo)) + + (make table + (make table-column + column-number: 1 + width: (- %text-width% + (+ (inherited-start-indent) + (inherited-end-indent) + 1in))) + (make table-column + column-number: 2 + width: 1in) + (make table-row + (make table-cell + cell-row-alignment: 'center + start-indent: 0pt + end-indent: 0pt + (process-children)) + (make table-cell + cell-row-alignment: 'center + quadding: 'end + start-indent: 0pt + end-indent: 0pt + (make paragraph + (literal "(" (element-label (current-node)) ")"))))) + + (if rule-after? + (make rule + orientation: 'horizontal + line-thickness: %object-rule-thickness% + display-alignment: 'center + space-before: (/ %block-sep% 2) + keep-with-previous?: #t) + (empty-sosofo))) + ($informal-object$ rule-before? rule-after?)))) + +(element (informalequation alt) (empty-sosofo)) +(element (informalequation graphic) + (make paragraph + space-before: 0pt + space-after: 0pt + quadding: 'end + ($img$ (current-node) #t))) + +(element inlineequation ($inline-object$)) +(element (inlineequation alt) (empty-sosofo)) +(element (inlineequation graphic) + (make sequence + ($img$ (current-node) #f))) + diff --git a/print/dbmsgset.dsl b/print/dbmsgset.dsl new file mode 100644 index 0000000..ba0648e --- /dev/null +++ b/print/dbmsgset.dsl @@ -0,0 +1,51 @@ +;; $Id: dbmsgset.dsl,v 1.2 2003/01/15 08:24:23 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ======================== ERROR MESSAGES (ETC.) ======================= + +(element msgset (process-children)) + +(element msgentry ($informal-object$)) + +(element simplemsgentry ($informal-object$)) + +(element msg + (make display-group + font-weight: 'bold + font-family-name: %mono-font-family% + (process-children))) + +(element msgmain (process-children)) + +(element msgsub + (make display-group + start-indent: (+ (inherited-start-indent) (ILSTEP)) + (process-children))) + +(element msgrel (empty-sosofo)) + +(element msgtext (process-children)) + +(element msginfo ($indent-para-container$)) + +(define ($genhead-para$ headtext) + (make paragraph + space-before: %para-sep% + space-after: %para-sep% + (make sequence + font-weight: 'bold + (literal + (string-append headtext ": "))) + (process-children))) + +(element msglevel ($genhead-para$ (gentext-element-name (current-node)))) +(element msgorig ($genhead-para$ (gentext-element-name (current-node)))) +(element msgaud ($genhead-para$ (gentext-element-name (current-node)))) + +(element msgexplan ($indent-para-container$)) +(element (msgexplan title) ($runinhead$)) +(element (msgexplan para) (make sequence (process-children))) + diff --git a/print/dbparam.dsl b/print/dbparam.dsl new file mode 100644 index 0000000..2170512 --- /dev/null +++ b/print/dbparam.dsl @@ -0,0 +1,2085 @@ + + + + + + +;; $Id: dbparam.dsl,v 1.9 2003/04/29 05:33:30 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +;; === Book intro, for dsl2man ========================================== + +DocBook Print Parameters +;; Part of the Modular DocBook Stylesheet distribution +;; NormanWalsh +;; +;; $Revision: 1.9 $ +;; 199719981999 +;; Norman Walsh +;; +;; +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +;; OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +;; NONINFRINGEMENT. IN NO EVENT SHALL NORMAN WALSH OR ANY OTHER +;; CONTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +;; OTHER DEALINGS IN THE SOFTWARE. +;; +;; +;; +;; +;; Please direct all questions, bug reports, or suggestions for changes +;; to Norman Walsh, <ndw@nwalsh.com>. +;; +;; +;; See http://nwalsh.com/docbook/dsssl/ for more information. +;; +;; /DOCINFO +]]> + +;; REFERENCE TOC/LOT Apparatus + +(define %generate-set-toc% + ;; REFENTRY generate-set-toc + ;; PURP Should a Table of Contents be produced for Sets? + ;; DESC + ;; If true, a Table of Contents will be generated for each 'Set'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %generate-book-toc% + ;; REFENTRY generate-book-toc + ;; PURP Should a Table of Contents be produced for Books? + ;; DESC + ;; If true, a Table of Contents will be generated for each 'Book'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define ($generate-book-lot-list$) + ;; REFENTRY generate-book-lot-list + ;; PURP Which Lists of Titles should be produced for Books? + ;; DESC + ;; This parameter should be a list (possibly empty) of the elements + ;; for which Lists of Titles should be produced for each 'Book'. + ;; + ;; It is meaningless to put elements that do not have titles in this + ;; list. If elements with optional titles are placed in this list, only + ;; the instances of those elements that do have titles will appear in + ;; the LOT. + ;; + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (list (normalize "table") +(normalize "figure") +(normalize "example") +(normalize "equation"))) + +(define %generate-part-toc% + ;; REFENTRY generate-part-toc + ;; PURP Should a Table of Contents be produced for Parts? + ;; DESC + ;; If true, a Table of Contents will be generated for each 'Part'. + ;; Note: '%generate-part-toc-on-titlepage%' controls whether the Part TOC + ;; is placed on the bottom of the part titlepage or on page(s) of its own. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %generate-part-toc-on-titlepage% + ;; REFENTRY generate-part-toc-on-titlepage + ;; PURP Should the Part TOC appear on the Part title page? + ;; DESC + ;; If true, the Part TOC will be placed on the Part title page. If false, + ;; the TOC will be placed on separate page(s) after the Part title page. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %generate-reference-toc% + ;; REFENTRY generate-reference-toc + ;; PURP Should a Table of Contents be produced for References? + ;; DESC + ;; If true, a Table of Contents will be generated for each 'Reference'. + ;; Note: '%generate-reference-toc-on-titlepage%' controls whether the + ;; Reference TOC + ;; is placed on the bottom of the title page or on page(s) of its own. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %generate-reference-toc-on-titlepage% + ;; REFENTRY generate-reference-toc-on-titlepage + ;; PURP Should the Reference TOC appear on the Reference title page? + ;; DESC + ;; If true, the Reference TOC will be placed on the Reference title page. + ;; If false, + ;; the TOC will be placed on separate page(s) after the title page. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %generate-article-toc% + ;; REFENTRY generate-article-toc + ;; PURP Should a Table of Contents be produced for Articles? + ;; DESC + ;; If true, a Table of Contents will be generated for each 'Article'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %generate-article-toc-on-titlepage% + ;; REFENTRY generate-article-toc-on-titlepage + ;; PURP Should the Article TOC appear on the Article title page? + ;; DESC + ;; If true, the Article TOC will be placed on the Article title page. + ;; If false, + ;; the TOC will be placed on separate page(s) after the title page. + ;; If false, %generate-article-titlepage-on-separate-page% should be + ;; true. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +;; REFERENCE Titlepages + +(define %generate-set-titlepage% + ;; REFENTRY generate-set-titlepage + ;; PURP Should a set title page be produced? + ;; DESC + ;; If true, a title page will be generated for each 'Set'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %generate-book-titlepage% + ;; REFENTRY generate-book-titlepage + ;; PURP Should a book title page be produced? + ;; DESC + ;; If true, a title page will be generated for each 'Book'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %generate-part-titlepage% + ;; REFENTRY generate-part-titlepage + ;; PURP Should a part title page be produced? + ;; DESC + ;; If true, a title page will be generated for each 'Part'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %generate-partintro-on-titlepage% + ;; REFENTRY generate-partintro-on-titlepage + ;; PURP Should the PartIntro appear on the Part/Reference title page? + ;; DESC + ;; If true, the PartIntro content will appear on the title page of + ;; Parts and References. If false, + ;; it will be placed on separate page(s) after the title page. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %generate-reference-titlepage% + ;; REFENTRY generate-reference-titlepage + ;; PURP Should a reference title page be produced? + ;; DESC + ;; If true, a title page will be generated for each 'Reference'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %generate-article-titlepage% + ;; REFENTRY generate-article-titlepage + ;; PURP Should an article title page be produced? + ;; DESC + ;; If true, a title page will be generated for each 'Article'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %generate-article-titlepage-on-separate-page% + ;; REFENTRY generate-article-ttlpg-on-sep-page + ;; PURP Should the article title page be on a separate page? + ;; DESC + ;; If true, the title page for each 'Article' will occur on its own page. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %titlepage-in-info-order% + ;; REFENTRY titlepage-in-info-order + ;; PURP Place elements on title page in document order? + ;; DESC + ;; If true, the elements on the title page will be set in the order that + ;; they appear in the *info element. Otherwise, they will be set in + ;; the order specified in the *-titlepage-*-elements list. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %author-othername-in-middle% + ;; REFENTRY othername-in-middle + ;; PURP Author OTHERNAME appears between FIRSTNAME and SURNAME? + ;; DESC + ;; If true, the OTHERNAME of an AUTHOR appears between the + ;; FIRSTNAME and SURNAME. Otherwise, OTHERNAME is suppressed. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +;; REFERENCE RefEntries and FuncSynopses + +(define %refentry-new-page% + ;; REFENTRY refentry-new-page + ;; PURP 'RefEntry' starts on new page? + ;; DESC + ;; If true, each 'RefEntry' begins on a new page. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %refentry-keep% + ;; REFENTRY refentry-keep + ;; PURP Keep RefEntrys together? + ;; DESC + ;; Refentry keep indicates how the stylesheet should + ;; attempt to keep each RefEntry. Common values are '#t', for the + ;; smallest possible area, 'page' for the same page, and '#f' to ignore + ;; this characteristic. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %refentry-generate-name% + ;; REFENTRY refentry-generate-name + ;; PURP Output NAME header before 'RefName'(s)? + ;; DESC + ;; If true, a "NAME" section title is output before the list + ;; of 'RefName's. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %refentry-xref-italic% + ;; REFENTRY refentry-xref-italic + ;; PURP Use italic text when cross-referencing RefEntrys? + ;; DESC + ;; If true, italics are used when cross-referencing RefEntrys, either + ;; with XRef or CiteRefEntry. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %refentry-xref-manvolnum% + ;; REFENTRY refentry-xref-manvolnum + ;; PURP Output manvolnum as part of RefEntry cross-reference? + ;; DESC + ;; If true, the manvolnum is used when cross-referencing RefEntrys, either + ;; with XRef or CiteRefEntry. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %funcsynopsis-style% + ;; REFENTRY funcsynopsis-style + ;; PURP What style of 'FuncSynopsis' should be generated? + ;; DESC + ;; If '%funcsynopsis-style%' is 'ansi', + ;; ANSI-style function synopses are generated for a 'FuncSynopsis', + ;; otherwise KR-style function synopses are generated. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 'ansi) + +(define %kr-funcsynopsis-indent% + ;; REFENTRY kr-funcsynopsis-indent + ;; PURP Indent-depth in KR-style function synopses + ;; DESC + ;; If the '%funcsynopsis-style%' is 'kr', + ;; '%kr-funcsynopsis-indent%' specifies the amount by which parameter + ;; definitions should be indented under the function prototype. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 1pi) + +(define %funcsynopsis-decoration% + ;; REFENTRY funcsynopsis-decoration + ;; PURP Decorate elements of a FuncSynopsis? + ;; DESC + ;; If true, elements of the FuncSynopsis will be decorated (e.g. bold or + ;; italic). The decoration is controlled by functions that can be redefined + ;; in a customization layer. See 'edbsynop.dsl'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +;; REFERENCE Fonts + +(define %refentry-name-font-family% + ;; REFENTRY refentry-name-font-family + ;; PURP The font family used in RefName + ;; DESC + ;; The name of the font family used in 'RefEntry' + ;; 'RefName's. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + %mono-font-family%) + +(define %title-font-family% + ;; REFENTRY title-font-family + ;; PURP The font family used in titles + ;; DESC + ;; The name of the font family used in titles (Arial by default). + ;; + ;; The values used here are system dependent (you have + ;; to have the fonts you select) and backend dependent (the backend has + ;; to know how to use them). + ;; + ;; The values here work for the RTF backend under MS Windows. YMMV. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "Arial") + +(define %body-font-family% + ;; REFENTRY body-font-family + ;; PURP The font family used in body text + ;; DESC + ;; The name of the font family used in body text + ;; (Times New Roman by default). + ;; + ;; The values used here are system dependent (you have + ;; to have the fonts you select) and backend dependent (the backend has + ;; to know how to use them). + ;; + ;; The values here work for the RTF backend under MS Windows. YMMV. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "Times New Roman") + +(define %mono-font-family% + ;; REFENTRY mono-font-family + ;; PURP The font family used in verbatim environments + ;; DESC + ;; The name of the font family used in verbatim environments (Courier New + ;; by default). + ;; + ;; The values used here are system dependent (you have + ;; to have the fonts you select) and backend dependent (the backend has + ;; to know how to use them). + ;; + ;; The values here work for the RTF backend under MS Windows. YMMV. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "Courier New") + +(define %admon-font-family% + ;; REFENTRY admon-font-family + ;; PURP The font family used in admonitions + ;; DESC + ;; The name of the font family used for body text in admonitions (Arial + ;; by default). + ;; + ;; The values used here are system dependent (you have + ;; to have the fonts you select) and backend dependent (the backend has + ;; to know how to use them). + ;; + ;; The values here work for the RTF backend under MS Windows. YMMV. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "Arial") + +(define %guilabel-font-family% + ;; REFENTRY guilabel-font-family + ;; PURP The font family used in GUI labels + ;; DESC + ;; The name of the font family used for text that represents text on a + ;; GUI (e.g., text in 'GUILabel', 'GUIMenu', + ;; etc.). (Arial by default). + ;; + ;; The values used here are system dependent (you have + ;; to have the fonts you select) and backend dependent (the backend has + ;; to know how to use them). + ;; + ;; The values here work for the RTF backend under MS Windows. YMMV. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "Arial") + +(define %visual-acuity% + ;; REFENTRY visual-acuity + ;; PURP General measure of document text size + ;; DESC + ;; This parameter controls the general size of the text in the document. + ;; Several other values (body font size and margins) have default values that + ;; vary depending on the setting of '%visual-acuity%'. There + ;; are three legal values: 'normal', + ;; the normal, standard document size (10pt body text); + ;; 'tiny', + ;; a small text size (8pt body text); + ;; 'presbyopic', + ;; a slightly more generous size (12pt body text); and + ;; 'large-type', + ;; quite large (24pt body text). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + ;; "tiny" + ;; "presbyopic" + ;; "large-type" + "normal") + +(define %hsize-bump-factor% + ;; REFENTRY hsize-bump-factor + ;; PURP Font scaling factor + ;; DESC + ;; Internally, the stylesheet refers to font sizes in purely relative + ;; terms. This is done by defining a scaled set of fonts + ;; (sizes 1, 2, 3, etc.) + ;; based at the default text font size (e.g. 10pt). The '%hsize-bump-factor%' + ;; describes the ratio between scaled sizes. The default is 1.2. + ;; + ;; Each hsize is '%hsize-bump-factor%' times larger than + ;; the previous hsize. For example, if the base size is 10pt, and + ;; '%hsize-bump-factor%' + ;; 1.2, hsize 1 is 12pt, hsize 2 is 14.4pt, hsize 3 is 17.28pt, etc. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 1.2) + +(define %smaller-size-factor% + ;; REFENTRY smaller-size-factor + ;; PURP Smaller font scaling factor + ;; DESC + ;; In environments that are usually set with a slightly smaller font size, + ;; for example block quotations, the stylesheet calculates the smaller font + ;; size by muliplying the current font size by '%smaller-size-factor%'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 0.9) + +(define %ss-size-factor% + ;; REFENTRY ss-size-factor + ;; PURP Super/subscript scaling factor + ;; DESC + ;; When text is set as a subscript or superscript, the font size of the + ;; text is multiplied by '%ss-size-factor%'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 0.6) + +(define %ss-shift-factor% + ;; REFENTRY ss-shift-factor + ;; PURP Super/subscript shift factor + ;; DESC + ;; When text is set as a subscript or superscript, it is set above or below + ;; the baseline by a factor of the current font size and '%ss-shift-factor%'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 0.4) + +(define %verbatim-size-factor% + ;; REFENTRY verbatim-size-factor + ;; PURP Verbatim font scaling factor + ;; DESC + ;; When a monospace font is selected, the current font size is multiplied + ;; by the '%verbatim-size-factor%'. If '%verbatim-size-factor%' + ;; is '#f', no scaling is performed (Well, that's not precisely true. + ;; In '$verbatim-display$' + ;; environments, the font size is calculated with respect to the longest line + ;; in the display, if '%verbatim-size-factor%' is '#f'). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 0.9) + +(define %bf-size% + ;; REFENTRY bf-size + ;; PURP Defines the body font size + ;; DESC + ;; Sets the body font size. This parameter is usually controlled by the + ;; '%visual-acuity%' parameter. + ;; /DESC + ;; /REFENTRY + (case %visual-acuity% + (("tiny") 8pt) + (("normal") 10pt) + (("presbyopic") 12pt) + (("large-type") 24pt))) + +(define-unit em %bf-size%) + +(define %footnote-size-factor% + ;; REFENTRY footnote-size-factor + ;; PURP Footnote font scaling factor + ;; DESC + ;; When printing footnotes, the current font size is multiplied by the + ;; '%footnote-size-factor%'. + ;; /DESC + ;; /REFENTRY + 0.9) + +(define %formal-object-title-font-weight% + ;; REFENTRY formal-object-title-font-weight + ;; PURP Formal object title font weight + ;; DESC + ;; Specifies the title font weight (i.e., 'bold or 'medium) of + ;; formal objects (e.g., figures). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 'bold) + +(define %table-title-font-weight% + ;; REFENTRY table-title-font-weight + ;; PURP Table title font weight + ;; DESC + ;; Specifies the title font weight (i.e., 'bold or 'medium) of the + ;; formal tables. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 'bold) + +;; REFERENCE Backends + +(define tex-backend + ;; REFENTRY tex-backend + ;; PURP Are we using the TeX backend? + ;; DESC + ;; This parameter exists so that '-V tex-backend' can be used on the + ;; command line to explicitly select the TeX backend. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define mif-backend + ;; REFENTRY mif-backend + ;; PURP Are we using the MIF backend? + ;; DESC + ;; This parameter exists so that '-V mif-backend' can be used on the + ;; command line to explicitly select the MIF backend. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define rtf-backend + ;; REFENTRY rtf-backend + ;; PURP Are we using the RTF backend? + ;; DESC + ;; This parameter exists so that '-V rtf-backend' can be used on the + ;; command line to explicitly select the RTF backend. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define default-backend + ;; REFENTRY default-backend + ;; PURP What is the default backend? + ;; DESC + ;; This parameter sets the default backend. Selecting an explicit + ;; backend enables features specific to that backend (if there are any). + ;; The legal values are 'rtf', 'tex', 'mif', and '#f'. Using + ;; '#f' implies that no special features are used. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define (print-backend) + ;; REFENTRY print-backend + ;; PURP Returns the backend that is being used to format the document + ;; DESC + ;; This parameter controls features in the stylesheet that are backend + ;; specific. The legal values are 'rtf', 'tex', 'mif', and '#f'. Using + ;; '#f' implies that no special features are used. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (cond + (tex-backend 'tex) + (mif-backend 'mif) + (rtf-backend 'rtf) + (else default-backend))) + +;; REFERENCE Verbatim Environments + +(define %verbatim-default-width% + ;; REFENTRY verbatim-default-width + ;; PURP Default width of verbatim environments + ;; DESC + ;; If no WIDTH attribute is specified on verbatim environments, + ;; '%verbatim-default-width%' is the default. Note: this width only + ;; comes into play if '%verbatim-size-factor%' is '#f'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 80) + +(define %number-synopsis-lines% + ;; REFENTRY number-synopsis-lines + ;; PURP Enumerate lines in a 'Synopsis'? + ;; DESC + ;; If true, lines in each 'Synopsis' will be enumerated. + ;; See also '%linenumber-mod%', '%linenumber-length%', + ;; '%linenumber-padchar%', and '($linenumber-space$)'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %number-funcsynopsisinfo-lines% + ;; REFENTRY number-funcsynopsisinfo-lines + ;; PURP Enumerate lines in a 'FuncSynopsisInfo'? + ;; DESC + ;; If true, lines in each 'FuncSynopsisInfo' will be enumerated. + ;; See also '%linenumber-mod%', '%linenumber-length%', + ;; '%linenumber-padchar%', and '($linenumber-space$)'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %number-literallayout-lines% + ;; REFENTRY number-literallayout-lines + ;; PURP Enumerate lines in a 'LiteralLayout'? + ;; DESC + ;; If true, lines in each 'LiteralLayout' will be enumerated. + ;; See also '%linenumber-mod%', '%linenumber-length%', + ;; '%linenumber-padchar%', and '($linenumber-space$)'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %number-address-lines% + ;; REFENTRY number-address-lines + ;; PURP Enumerate lines in a 'Address'? + ;; DESC + ;; If true, lines in each 'Address' will be enumerated. + ;; See also '%linenumber-mod%', '%linenumber-length%', + ;; '%linenumber-padchar%', and '($linenumber-space$)'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %number-programlisting-lines% + ;; REFENTRY number-programlisting-lines + ;; PURP Enumerate lines in a 'ProgramListing'? + ;; DESC + ;; If true, lines in each 'ProgramListing' will be enumerated. + ;; See also '%linenumber-mod%', '%linenumber-length%', + ;; '%linenumber-padchar%', and '($linenumber-space$)'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %number-screen-lines% + ;; REFENTRY number-screen-lines + ;; PURP Enumerate lines in a 'Screen'? + ;; DESC + ;; If true, lines in each 'Screen' will be enumerated. + ;; See also '%linenumber-mod%', '%linenumber-length%', + ;; '%linenumber-padchar%', and '($linenumber-space$)'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %linenumber-mod% + ;; REFENTRY linenumber-mod + ;; PURP Controls line-number frequency in enumerated environments. + ;; DESC + ;; Every '%linenumber-mod%' line will be enumerated. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 5) + +(define %linenumber-length% + ;; REFENTRY linenumber-length + ;; PURP Width of line numbers in enumerated environments + ;; DESC + ;; Line numbers will be padded to '%linenumber-length%' + ;; characters. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 3) + +(define %linenumber-padchar% + ;; REFENTRY linenumber-padchar + ;; PURP Pad character in line numbers + ;; DESC + ;; Line numbers will be padded (on the left) with '%linenumber-padchar%'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "\no-break-space;") + +(define ($linenumber-space$) + ;; REFENTRY linenumber-space + ;; PURP Returns the sosofo which separates line numbers from the text + ;; DESC + ;; The sosofo returned by '($linenumber-space$)' is placed + ;; between the line number and the corresponding line in + ;; enumerated environments. + ;; + ;; Note: '%linenumber-padchar%'s are separated from lines + ;; that are not enumerated (because they don't match '%linenumber-mod%'). + ;; In other words, '($linenumber-space$)' occurs + ;; on every line. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (literal "\no-break-space;")) + +(define %indent-synopsis-lines% + ;; REFENTRY indent-synopsis-lines + ;; PURP Indent lines in a 'Synopsis'? + ;; DESC + ;; If not '#f', each line in the display will be indented + ;; with the content of this variable. Usually it is set to some number + ;; of spaces, but you can indent with any string you wish. + ;; /DESC + ;; /REFENTRY + #f) + +(define %indent-funcsynopsisinfo-lines% + ;; REFENTRY indent-funcsynopsisinfo-lines + ;; PURP Indent lines in a 'FuncSynopsisInfo'? + ;; DESC + ;; If not '#f', each line in the display will be indented + ;; with the content of this variable. Usually it is set to some number + ;; of spaces, but you can indent with any string you wish. + ;; /DESC + ;; /REFENTRY + #f) + +(define %indent-literallayout-lines% + ;; REFENTRY indent-literallayout-lines + ;; PURP Indent lines in a 'LiteralLayout'? + ;; DESC + ;; If not '#f', each line in the display will be indented + ;; with the content of this variable. Usually it is set to some number + ;; of spaces, but you can indent with any string you wish. + ;; /DESC + ;; /REFENTRY + #f) + +(define %indent-address-lines% + ;; REFENTRY indent-address-lines + ;; PURP Indent lines in a 'Address'? + ;; DESC + ;; If not '#f', each line in the display will be indented + ;; with the content of this variable. Usually it is set to some number + ;; of spaces, but you can indent with any string you wish. + ;; /DESC + ;; /REFENTRY + #f) + +(define %indent-programlisting-lines% + ;; REFENTRY indent-programlisting-lines + ;; PURP Indent lines in a 'ProgramListing'? + ;; DESC + ;; If not '#f', each line in the display will be indented + ;; with the content of this variable. Usually it is set to some number + ;; of spaces, but you can indent with any string you wish. + ;; /DESC + ;; /REFENTRY + #f) + +(define %indent-screen-lines% + ;; REFENTRY indent-screen-lines + ;; PURP Indent lines in a 'Screen'? + ;; DESC + ;; If not '#f', each line in the display will be indented + ;; with the content of this variable. Usually it is set to some number + ;; of spaces, but you can indent with any string you wish. + ;; /DESC + ;; /REFENTRY + #f) + +(define %callout-fancy-bug% + ;; REFENTRY callout-fancy-bug + ;; PURP Use fancy callout bugs? + ;; DESC + ;; If true, fancy callout bugs will be used. Otherwise, simple ones are + ;; used. Fancy callout bugs may require the RTF backend. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %callout-default-col% + ;; REFENTRY callout-default-col + ;; PURP Default column for callouts + ;; DESC + ;; If the coordinates of a callout include only a line number, the callout + ;; bug will appear in column '%callout-default-col%'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 60) + +;; REFERENCE Labelling + +(define %section-autolabel% + ;; REFENTRY section-autolabel + ;; PURP Are sections enumerated? + ;; DESC + ;; If true, unlabeled sections will be enumerated. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %chapter-autolabel% + ;; REFENTRY chapter-autolabel + ;; PURP Are chapters enumerated? + ;; DESC + ;; If true, chapters will be enumerated. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %label-preface-sections% + ;; REFENTRY label-preface-sections + ;; PURP Are sections in the Preface enumerated? + ;; DESC + ;; If true, unlabeled sections in the Preface will be enumerated + ;; if '%section-autolabel%' is true. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %qanda-inherit-numeration% + ;; REFENTRY qanda-inherit-numeration + ;; PURP Should numbered questions inherit the surrounding numeration? + ;; DESC + ;; If true, question numbers are prefixed with the surrounding + ;; component or section number. Has no effect unless + ;; '%section-autolabel%' is also true. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +;; REFERENCE Running Heads + +(define %chap-app-running-heads% + ;; REFENTRY chap-app-running-heads + ;; PURP Generate running headers and footers on chapter-level elements? + ;; DESC + ;; If true, running headers and footers are produced on chapter-level + ;; elements. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %chap-app-running-head-autolabel% + ;; REFENTRY chap-app-running-head-autolabel + ;; PURP Put chapter labels in running heads? + ;; DESC + ;; If true, running heads on 'Chapter's and + ;; 'Appendix'es will include an automatic label. + ;; + ;; In other words, if a 'Chapter' has no 'Label' attribute, + ;; and '%chap-app-running-head-autolabel%' + ;; is true, running heads will include the automatic label for the + ;; 'Chapter'. If '%chap-app-running-head-autolabel%' + ;; is false, only the 'Title' (or 'TitleAbbrev') + ;; will appear in the running head. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +;; REFERENCE Paper/Page Characteristics + +(define %paper-type% + ;; REFENTRY paper-type + ;; PURP Name of paper type + ;; DESC + ;; The paper type value identifies the sort of paper in use, for example, + ;; 'A4' or 'USletter'. Setting the paper type is an + ;; easy shortcut for setting the correct paper height and width. + ;; + ;; See %page-width% and %page-height concerning what other page size + ;; are available. Some common examples are 'A4', 'USletter', + ;; 'A4landscape', 'USlandscape'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + ;; "A4" + "USletter") + +(define %two-side% + ;; REFENTRY two-side + ;; PURP Is two-sided output being produced? + ;; DESC + ;; If '%two-side%' is true, headers and footers are alternated + ;; so that the "outer" and "inner" headers will be correctly + ;; placed in the bound document. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %writing-mode% + ;; REFENTRY writing-mode + ;; PURP The writing mode + ;; DESC + ;; The writing mode is either 'left-to-right', or + ;; 'right-to-left'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 'left-to-right) + +(define %page-n-columns% + ;; REFENTRY page-n-columns + ;; PURP Sets the number of columns on each page + ;; DESC + ;; Sets the number of columns on each page + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 1) + +(define %titlepage-n-columns% + ;; REFENTRY titlepage-n-columns + ;; PURP Sets the number of columns on the title page + ;; DESC + ;; Sets the number of columns on the title page + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 1) + +(define %page-column-sep% + ;; REFENTRY page-column-sep + ;; PURP Sets the width of the gutter between columns + ;; DESC + ;; Sets the width of the gutter between columns + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 0.5in) + +(define %page-balance-columns?% + ;; REFENTRY page-balance-columns + ;; PURP Balance columns on pages? + ;; DESC + ;; If true, the columns on the final page of a multiple column layout + ;; will be balanced. Otherwise, the columns will be completely filled in the + ;; writing direction and the last column may be a different length + ;; than the preceding columns. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %left-margin% + ;; REFENTRY left-margin + ;; PURP Width of left margin + ;; DESC + ;; The '%left-margin%' parameter specifies the width of the left margin + ;; of the page. Note that this setting is relative to the physical page, + ;; not the writing direction. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 6pi) + +(define %right-margin% + ;; REFENTRY right-margin + ;; PURP Width of the right margin + ;; DESC + ;; The '%right-margin%' parameter specifies the width of the right margin + ;; of the page. Note that this setting is relative to the physical page, + ;; not the writing direction. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 6pi) + +(define %page-width% + ;; REFENTRY page-width + ;; PURP Specifies the page width + ;; DESC + ;; Identifies the width of the page (length in the writing direction). + ;; It is usually controlled by the '%paper-type%' parameter. + ;; /DESC + ;; /REFENTRY + (case %paper-type% + (("A4landscape") 297mm) + (("USletter") 8.5in) + (("USlandscape") 11in) + (("4A0") 1682mm) + (("2A0") 1189mm) + (("A0") 841mm) + (("A1") 594mm) + (("A2") 420mm) + (("A3") 297mm) + (("A4") 210mm) + (("A5") 148mm) + (("A6") 105mm) + (("A7") 74mm) + (("A8") 52mm) + (("A9") 37mm) + (("A10") 26mm) + (("B0") 1000mm) + (("B1") 707mm) + (("B2") 500mm) + (("B3") 353mm) + (("B4") 250mm) + (("B5") 176mm) + (("B6") 125mm) + (("B7") 88mm) + (("B8") 62mm) + (("B9") 44mm) + (("B10") 31mm) + (("C0") 917mm) + (("C1") 648mm) + (("C2") 458mm) + (("C3") 324mm) + (("C4") 229mm) + (("C5") 162mm) + (("C6") 114mm) + (("C7") 81mm) + (("C8") 57mm) + (("C9") 40mm) + (("C10") 28mm))) + +(define %page-height% + ;; REFENTRY page-height + ;; PURP Specifies the page height + ;; DESC + ;; Identifies the height of the page (length perpendicular to the + ;; writing direction). + ;; It is usually controlled by the '%paper-type%' parameter. + ;; /DESC + ;; /REFENTRY + (case %paper-type% + (("A4landscape") 210mm) + (("USletter") 11in) + (("USlandscape") 8.5in) + (("4A0") 2378mm) + (("2A0") 1682mm) + (("A0") 1189mm) + (("A1") 841mm) + (("A2") 594mm) + (("A3") 420mm) + (("A4") 297mm) + (("A5") 210mm) + (("A6") 148mm) + (("A7") 105mm) + (("A8") 74mm) + (("A9") 52mm) + (("A10") 37mm) + (("B0") 1414mm) + (("B1") 1000mm) + (("B2") 707mm) + (("B3") 500mm) + (("B4") 353mm) + (("B5") 250mm) + (("B6") 176mm) + (("B7") 125mm) + (("B8") 88mm) + (("B9") 62mm) + (("B10") 44mm) + (("C0") 1297mm) + (("C1") 917mm) + (("C2") 648mm) + (("C3") 458mm) + (("C4") 324mm) + (("C5") 229mm) + (("C6") 162mm) + (("C7") 114mm) + (("C8") 81mm) + (("C9") 57mm) + (("C10") 40mm))) + +(define %text-width% + ;; REFENTRY text-width + ;; PURP Specifies the width of the body column + ;; DESC + ;; Identifies the width of the page on which text may occur. + ;; /DESC + ;; /REFENTRY + (- %page-width% (+ %left-margin% %right-margin%))) + +(define %epigraph-start-indent% + ;; REFENTRY epigraph-start-indent + ;; PURP Specifies the left indent of epigraphs. + ;; DESC + ;; The indent of a epigraph. Default 55% of the text width. + ;; /DESC + ;; /REFENTRY + (* %text-width% 0.55)) + +(define %epigraph-end-indent% + ;; REFENTRY epigraph-end-indent + ;; PURP Specified the right indent of epigraphs. + ;; DESC + ;; The right indent of a epigraph. Default none. + ;; /DESC + ;; /REFENTRY + 0pt) + +(define %body-width% + ;; REFENTRY body-width + ;; PURP Specifies the width of the text in the body column + ;; DESC + ;; Identifies the width of the page on which text will occur, after + ;; the '%body-start-indent%' is removed. + ;; /DESC + ;; /REFENTRY + (- %text-width% %body-start-indent%)) + +(define %top-margin% + ;; REFENTRY top-margin + ;; PURP Height of top margin + ;; DESC + ;; The '%top-margin%' parameter specifies the height of the + ;; top margin + ;; of the page. Note that this setting is relative to the physical page, + ;; not the writing direction. + ;; /DESC + ;; /REFENTRY + (if (equal? %visual-acuity% "large-type") + 7.5pi + 6pi)) + +(define %bottom-margin% + ;; REFENTRY bottom-margin + ;; PURP Height of bottom margin + ;; DESC + ;; The '%bottom-margin%' parameter specifies the + ;; height of the bottom margin + ;; of the page. Note that this setting is relative to the physical page, + ;; not the writing direction. + ;; /DESC + ;; /REFENTRY + (if (equal? %visual-acuity% "large-type") + 9.5pi + 8pi)) + +(define %header-margin% + ;; REFENTRY header-margin + ;; PURP Height of header margin + ;; DESC + ;; The '%header-margin%' parameter specifies the heigth + ;; of the header margin + ;; of the page. Note that this setting is relative to the physical page, + ;; not the writing direction. + ;; /DESC + ;; /REFENTRY + (if (equal? %visual-acuity% "large-type") + 5.5pi + 4pi)) + +(define %footer-margin% + ;; REFENTRY footer-margin + ;; PURP Height of footer margin + ;; DESC + ;; The '%footer-margin%' parameter specifies the height + ;; of the footer margin + ;; of the page. Note that this setting is relative to the physical page, + ;; not the writing direction. + ;; /DESC + ;; /REFENTRY + 4pi) + +(define %page-number-restart% + ;; REFENTRY page-number-restart + ;; PURP Restart page numbers in each component? + ;; DESC + ;; If true, page numbers are restarted at the beginning of each + ;; component-level + ;; element ('Chapter', 'Appendix', + ;; 'Bibliography', etc.). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %article-page-number-restart% + ;; REFENTRY article-page-number-restart + ;; PURP Restart page numbers in each article? + ;; DESC + ;; If true, page numbers are restarted at the beginning of each + ;; article. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %generate-heading-level% + ;; REFENTRY generate-heading-level + ;; PURP Output RTF heading level characteristics? + ;; DESC + ;; If true, component and section titles will have the heading-level + ;; characteristic in the RTF. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +;; REFERENCE Admonitions + +(define %admon-graphics% + ;; REFENTRY admon-graphics + ;; PURP Use graphics in admonitions? + ;; DESC + ;; If true, admonitions are presented in an alternate style that uses + ;; a graphic. Default graphics are provided in the distribution. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %admon-graphics-path% + ;; REFENTRY admon-graphics-path + ;; PURP Path to admonition graphics + ;; DESC + ;; Sets the path, probably relative to the directory where the HTML + ;; files are created, to the admonition graphics. Must include + ;; trailing directory separator. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "../images/") + + +;; just for back compat, set it false to say its not set +(define admon-graphic-default-extension #f) + +(define %admon-graphics-extension% + ;; REFENTRY admon-graphic-extension + ;; PURP Admonition graphic file extension + ;; DESC + ;; Identifies the extension for admonition graphics. This allows + ;; backends to select different images (e.g., EPS for print, PNG for + ;; PDF, etc.) + ;; + ;; The older parameter, admon-graphic-default-extension, will be + ;; used if it is set, for backwards compatability. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (if admon-graphic-default-extension + admon-graphic-default-extension + ".eps")) + +(define ($admon-graphic$ #!optional (nd (current-node))) + ;; REFENTRY admon-graphic + ;; PURP Admonition graphic file + ;; DESC + ;; Given an admonition node, returns the name of the graphic that should + ;; be used for that admonition. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (cond ((equal? (gi nd) (normalize "tip")) + (string-append %admon-graphics-path% + (string-append "tip" + %admon-graphics-extension%))) + ((equal? (gi nd) (normalize "note")) + (string-append %admon-graphics-path% + (string-append "note" + %admon-graphics-extension%))) + + ((equal? (gi nd) (normalize "important")) + (string-append %admon-graphics-path% + (string-append "important" + %admon-graphics-extension%))) + + ((equal? (gi nd) (normalize "caution")) + (string-append %admon-graphics-path% + (string-append "caution" + %admon-graphics-extension%))) + ((equal? (gi nd) (normalize "warning")) + (string-append %admon-graphics-path% + (string-append "warning" + %admon-graphics-extension%))) + (else (error (string-append (gi nd) " is not an admonition."))))) + +(define ($admon-graphic-width$ #!optional (nd (current-node))) + ;; REFENTRY admon-graphic-width + ;; PURP Admonition graphic file width + ;; DESC + ;; Given an admonition node, returns the width of the graphic that will + ;; be used for that admonition. + ;; + ;; All of the default graphics in the distribution are 0.3in wide. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 0.3in) + +;; REFERENCE Quadding + +(define %default-quadding% + ;; REFENTRY default-quadding + ;; PURP The default quadding + ;; DESC + ;; The default quadding ('start', 'center', 'justify', + ;; or 'end'). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 'start) + +(define %division-title-quadding% + ;; REFENTRY division-title-quadding + ;; PURP Division title quadding + ;; DESC + ;; The quadding of division-level titles ('Set', 'Book', and 'Part'). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 'center) + +(define %division-subtitle-quadding% + ;; REFENTRY division-subtitle-quadding + ;; PURP Division subtitle quadding + ;; DESC + ;; The quadding of division-level subtitles ('Set', 'Book', and 'Part'). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 'center) + +(define %component-title-quadding% + ;; REFENTRY component-title-quadding + ;; PURP Component title quadding + ;; DESC + ;; The quadding of component-level titles ('Chapter', + ;; 'Appendix', 'Glossary', etc.). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 'start) + +(define %component-subtitle-quadding% + ;; REFENTRY component-subtitle-quadding + ;; PURP Component subtitle quadding + ;; DESC + ;; The quadding of component-level subtitles ('Chapter', + ;; 'Appendix', 'Glossary', etc.). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 'start) + +(define %article-title-quadding% + ;; REFENTRY article-title-quadding + ;; PURP Article title quadding + ;; DESC + ;; The quadding of article titles. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 'center) + +(define %article-subtitle-quadding% + ;; REFENTRY article-subtitle-quadding + ;; PURP Article subtitle quadding + ;; DESC + ;; The quadding of article subtitles. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 'center) + +(define %section-title-quadding% + ;; REFENTRY section-title-quadding + ;; PURP Section title quadding + ;; DESC + ;; The quadding of section-level titles. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 'start) + +(define %section-subtitle-quadding% + ;; REFENTRY section-subtitle-quadding + ;; PURP Section subtitle quadding + ;; DESC + ;; The quadding of section-level subtitles. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 'start) + +;; REFERENCE Bibliographies + +(define biblio-citation-check + ;; REFENTRY biblio-citation-check + ;; PURP Check citations + ;; DESC + ;; If true, the content of CITATIONs will be checked against possible + ;; biblioentries. If the citation cannot be found, an error is issued + ;; and the citation is generated. If the citation is found, it is generated + ;; with a cross reference to the appropriate biblioentry. + ;; + ;; A citation matches if the content of the citation element matches the + ;; ID, XREFLABEL, or leading ABBREV of a biblioentry. + ;; + ;; This setting may have significant performance implications on large + ;; documents, hence it is false by default. + ;; + ;; (This option can conveniently be set with '-V biblio-citation-check' + ;; on the Jade command line). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define biblio-filter-used + ;; REFENTRY filter-used + ;; PURP Suppress unreferenced bibliography entries + ;; DESC + ;; If true, bibliography entries which are not cited are suppressed. + ;; A biblioentry is cited if an XREF or LINK matches its ID, or if + ;; a CITE element matches its + ;; ID, XREFLABEL, or leading ABBREV. + ;; + ;; A BIBLIOGRAPHY with no entries will still be output (making a whole + ;; component conditional would be _A LOT_ of work and seems unnecessary), + ;; but BIBLIDIVs with no entries will be suppressed. + ;; + ;; This setting may have significant performance implications, + ;; hence it is false by default. + ;; + ;; (This option can conveniently be set with '-V biblio-filter-used' on the + ;; Jade command line). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define biblio-number + ;; REFENTRY biblio-number + ;; PURP Enumerate bibliography entries + ;; DESC + ;; If true, bibliography entries will be numbered. If you cross-reference + ;; bibliography entries, you should probably use biblio-number or + ;; consistently use XREFLABEL or ABBREV. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define biblio-xref-title + ;; REFENTRY biblio-xref-title + ;; PURP Use the titles of bibliography entries in XREFs + ;; DESC + ;; If true, cross references to bibliography entries will use the + ;; title of the entry as the cross reference text. Otherwise, either + ;; the number (see 'biblio-number') or XREFLABEL/ABBREV will be used. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +;; REFERENCE OLinks + +(define %olink-outline-ext% + ;; REFENTRY olink-outline-ext + ;; PURP Extension for olink outline file + ;; DESC + ;; The extension used to find the outline information file. When searching + ;; for outline information about a document, the extension is discarded + ;; from the system ID of the file and '%olinke-outline-ext%' is appended. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + ".olink") + +;; REFERENCE Footnotes + +(define %footnote-ulinks% + ;; REFENTRY footnote-ulinks + ;; PURP Generate footnotes for ULinks? + ;; DESC + ;; If true, the URL of each ULink will appear as a footnote. + ;; Processing ULinks this way may be very, very slow. It requires + ;; walking over every descendant of every component in order to count + ;; both ulinks and footnotes. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define bop-footnotes + ;; REFENTRY bop-footnotes + ;; PURP Make "bottom-of-page" footnotes? + ;; DESC + ;; If true, footnotes will be done at the bottom of the page instead + ;; of collected together as notes at the end of the section. + ;; This variable is ignored if the print backend does not support + ;; bottom-of-the-page footnotes. At present, only the TeX backend + ;; supports them. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +;; REFERENCE Graphics + +(define %graphic-default-extension% + ;; REFENTRY graphic-default-extension + ;; PURP Default extension for graphic FILEREFs + ;; DESC + ;; The '%graphic-default-extension%' will be + ;; added to the end of all 'fileref' filenames on + ;; 'Graphic's if they do not end in one of the + ;; '%graphic-extensions%'. Set this to '#f' + ;; to turn off this feature. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %graphic-extensions% + ;; REFENTRY graphic-extensions + ;; PURP List of graphic filename extensions + ;; DESC + ;; The list of extensions which may appear on a 'fileref' + ;; on a 'Graphic' which are indicative of graphic formats. + ;; + ;; Filenames that end in one of these extensions will not have + ;; the '%graphic-default-extension%' added to them. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + '("eps" "epsf" "gif" "tif" "tiff" "jpg" "jpeg" "png" "pdf")) + +(define image-library + ;; REFENTRY image-library + ;; PURP Load image library database for additional info about images? + ;; DESC + ;; If true, an image library database is loaded and extra information + ;; about web graphics is retrieved from it. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define image-library-filename + ;; REFENTRY image-library-filename + ;; PURP Name of the image library database + ;; DESC + ;; If 'image-library' is true, then the database is loaded from + ;; 'image-library-filename'. It's a current limitation that only a + ;; single database can be loaded. + ;; + ;; The image library database is stored in a separate directory + ;; because it must be parsed with the XML declaration. The only + ;; practical way to accomplish this with Jade, if you are processing a + ;; document that uses another declaration, is by having a catalog + ;; file in the directory that contains the image library that + ;; specifies the SGMLDECL. (So if it was in the same directory + ;; as your document, your document would also be parsed with the + ;; XML declaration, which may not be correct.) + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + "imagelib/imagelib.xml") + +;; REFERENCE Tables + +(define ($table-element-list$) + ;; REFENTRY table-element-list + ;; PURP List of table element names + ;; DESC + ;; The list of table elements in the DTD. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (list (normalize "table") (normalize "informaltable"))) + +(define %simplelist-column-width% + ;; REFENTRY simplelist-column-width + ;; PURP Width of columns in tabular simple lists + ;; DESC + ;; If set to '#f', the table will span the entire + ;; page width. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +;; REFERENCE VariableLists + +(define %default-variablelist-termlength% + ;; REFENTRY default-variablelist-termlength + ;; PURP Default term length on variablelists + ;; DESC + ;; When formatting a 'VariableList', this value is used as the + ;; default term length, if no 'TermLength' is specified. + ;; + ;; If all of the terms in a list shorter than the term length, + ;; the stylesheet may format them "side-by-side" in a table if + ;; 'may-format-variablelist-as-table' is '#t'. + ;; /DESC + ;; /REFENTRY + 20) + +(define %may-format-variablelist-as-table% + ;; REFENTRY may-format-variablelist-as-table + ;; PURP Format VariableLists as tables? + ;; DESC + ;; If '%may-format-variablelist-as-table%' is '#t', a + ;; 'VariableList' will be formatted as a table, if *all of* + ;; the terms are shorter than the specified 'TermLength'. + ;; /DESC + ;; /REFENTRY + #f) + +(define %always-format-variablelist-as-table% + ;; REFENTRY always-format-variablelist-as-table + ;; PURP Always format VariableLists as tables? + ;; DESC + ;; When a 'VariableList' is formatted, if any of the + ;; terms in the list are too long, the whole list is formatted as a + ;; list. + ;; + ;; If '%always-format-variablelist-as-table%' is + ;; '#t', the 'VariableList' will be + ;; formatted as a table, even if some terms are too long. The terms that + ;; are too long will format span above their associated description. + ;; /DESC + ;; /REFENTRY + #f) + +;; REFERENCE Vertical Spacing + +(define %line-spacing-factor% + ;; REFENTRY line-spacing-factor + ;; PURP Factor used to calculate leading + ;; DESC + ;; The leading is calculated by multiplying the current font size by the + ;; '%line-spacing-factor%'. For example, if the font size is 10pt and + ;; the '%line-spacing-factor%' is 1.1, then the text will be + ;; printed "10-on-11". + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 1.3) + +(define %head-before-factor% + ;; REFENTRY head-before-factor + ;; PURP Factor used to calculate space above a title + ;; DESC + ;; The space before a title is calculated by multiplying the font size + ;; used in the title by the '%head-before-factor%'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 0.75) + +(define %head-after-factor% + ;; REFENTRY head-after-factor + ;; PURP Factor used to calculate space below a title + ;; DESC + ;; The space after a title is calculated by multiplying the font size used + ;; in the title by the '%head-after-factor%'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 0.5) + +(define %body-start-indent% + ;; REFENTRY body-start-indent + ;; PURP Default indent of body text + ;; DESC + ;; The default indent of body text. Some elements may have more or less + ;; indentation. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 4pi) + +(define %blockquote-start-indent% + ;; PURP Default indent of blockquoted text + ;; DESC + ;; The default start (usually left) indent of blockquoted text. + ;; /DESC + ;; AUTHOR Ola Lundqvist + ;; /REFENTRY + 1em) + +(define %blockquote-end-indent% + ;; PURP Default indent of blockquoted text + ;; DESC + ;; The default end (usually right) indent of blockquoted text. + ;; /DESC + ;; AUTHOR Ola Lundqvist + ;; /REFENTRY + 1em) + +(define %para-sep% + ;; REFENTRY para-sep + ;; PURP Distance between paragraphs + ;; DESC + ;; The '%para-sep%' is the distance between the last line + ;; of one paragraph and the first line of the next. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (/ %bf-size% 2.0)) + +(define %block-sep% + ;; REFENTRY block-sep + ;; PURP Distance between block-elements + ;; DESC + ;; The '%block-sep%' is the vertical distance between + ;; block elements (figures, tables, etc.) + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + (* %para-sep% 2.0)) + +;; REFERENCE Indents + +(define %para-indent% + ;; REFENTRY para-indent + ;; PURP First line start-indent for paragraphs (other than the first) + ;; DESC + ;; The '%para-indent%' is the amount of extra indentation that the + ;; first line of a paragraph should receive. This parameter applies + ;; only to the second and subsequent paragraphs in a section. See + ;; '%para-indent-firstpara%'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 0pt) + +(define %para-indent-firstpara% + ;; REFENTRY para-indent-firstpara + ;; PURP First line start-indent for the first paragraph + ;; DESC + ;; The '%para-indent-firstpara%' is the amount of extra indentation + ;; that the first line of the first paragraph of a section should receive. + ;; This parameter is frequently '0pt' even when '%para-indent%' is + ;; not. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 0pt) + +(define %block-start-indent% + ;; REFENTRY block-start-indent + ;; PURP Extra start-indent for block-elements + ;; DESC + ;; Block elements (tables, figures, verbatim environments, etc.) will + ;; be indented by the specified amount. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 0pt) + +;; REFERENCE Object Rules + +(define %example-rules% + ;; REFENTRY example-rules + ;; PURP Specify rules before and after an Example + ;; DESC + ;; If '#t', rules will be drawn before and after each + ;; 'Example'. + ;; /DESC + ;; /REFENTRY + #f) + +(define %figure-rules% + ;; REFENTRY figure-rules + ;; PURP Specify rules before and after an Figure + ;; DESC + ;; If '#t', rules will be drawn before and after each + ;; 'Figure'. + ;; /DESC + ;; /REFENTRY + #f) + +(define %table-rules% + ;; REFENTRY table-rules + ;; PURP Specify rules before and after an Table + ;; DESC + ;; If '#t', rules will be drawn before and after each + ;; 'Table'. + ;; /DESC + ;; /REFENTRY + #f) + +(define %equation-rules% + ;; REFENTRY equation-rules + ;; PURP Specify rules before and after an Equation + ;; DESC + ;; If '#t', rules will be drawn before and after each + ;; 'Equation'. + ;; /DESC + ;; /REFENTRY + #f) + +(define %informalexample-rules% + ;; REFENTRY informalexample-rules + ;; PURP Specify rules before and after an InformalExample + ;; DESC + ;; If '#t', rules will be drawn before and after each + ;; 'InformalExample'. + ;; /DESC + ;; /REFENTRY + #f) + +(define %informalfigure-rules% + ;; REFENTRY informalfigure-rules + ;; PURP Specify rules before and after an InformalFigure + ;; DESC + ;; If '#t', rules will be drawn before and after each + ;; 'InformalFigure'. + ;; /DESC + ;; /REFENTRY + #f) + +(define %informaltable-rules% + ;; REFENTRY informaltable-rules + ;; PURP Specify rules before and after an InformalTable + ;; DESC + ;; If '#t', rules will be drawn before and after each + ;; 'InformalTable'. + ;; /DESC + ;; /REFENTRY + #f) + +(define %informalequation-rules% + ;; REFENTRY informalequation-rules + ;; PURP Specify rules before and after an InformalEquation + ;; DESC + ;; If '#t', rules will be drawn before and after each + ;; 'InformalEquation'. + ;; /DESC + ;; /REFENTRY + #f) + +(define %object-rule-thickness% + ;; REFENTRY object-rule-thickness + ;; PURP Width of rules around formal and informal objects + ;; DESC + ;; Specifies the width of the rules drawn before and after an object. + ;; This only applies if the appropriate + ;; '%*-rules%' variable + ;; is '#t'. + ;; /DESC + ;; /REFENTRY + 2pt) + +;; REFERENCE Miscellaneous + +(define ($object-titles-after$) + ;; REFENTRY object-titles-after + ;; PURP List of objects who's titles go after the object + ;; DESC + ;; Titles of formal objects (Figures, Equations, Tables, etc.) + ;; in this list will be placed below the object instead of above it. + ;; + ;; This is a list of element names, for example: + ;; '(list (normalize "figure") (normalize "table"))'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + '()) + +(define formal-object-float + ;; REFENTRY formal-object-float + ;; PURP Do formal objects float? + ;; DESC + ;; If '#t', formal objects will float if floating is supported by the + ;; backend. At present, only the TeX backend supports floats. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %default-title-end-punct% + ;; REFENTRY default-title-end-punct + ;; PURP Default punctuation at the end of a run-in head. + ;; DESC + ;; The punctuation used at the end of a run-in head (e.g. on FORMALPARA). + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + ".") + +(define %content-title-end-punct% + ;; REFENTRY content-title-end-punct + ;; PURP List of punctuation chars at the end of a run-in head + ;; DESC + ;; If a run-in head ends in any of these characters, the + ;; '%default-title-end-punct%' is not used. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + '(#\. #\! #\? #\:)) + +(define %honorific-punctuation% + ;; REFENTRY honorific-punctuation + ;; PURP Punctuation to follow honorifics in names + ;; DESC + ;; The honorific punctuation is placed after the honorific in + ;; a name. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + ".") + +(define %default-simplesect-level% + ;; REFENTRY default-simplesect-level + ;; PURP Default section level for 'SimpleSect's. + ;; DESC + ;; If 'SimpleSect's appear inside other section-level + ;; elements, they are rendered at the appropriate section level, but if they + ;; appear in a component-level element, they are rendered at + ;; '%default-simplesect-level%'. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 4) + +(define %show-ulinks% + ;; REFENTRY show-ulinks + ;; PURP Display URLs after ULinks? + ;; DESC + ;; If true, the URL of each ULink will appear in parenthesis after + ;; the text of the link. If the text of the link and the URL are + ;; identical, the parenthetical URL is suppressed. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define %show-comments% + ;; REFENTRY show-comments + ;; PURP Display Comment elements? + ;; DESC + ;; If true, comments will be displayed, otherwise they are suppressed. + ;; Comments here refers to the 'Comment' element, which will be renamed + ;; 'Remark' in DocBook V4.0, not SGML/XML comments which are unavailable. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #t) + +(define firstterm-bold + ;; REFENTRY firstterm-bold + ;; PURP Make FIRSTTERM elements bold? + ;; DESC + ;; If '#t', FIRSTTERMs will be bold, to distinguish them from + ;; simple GLOSSTERMs. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + #f) + +(define %min-leading% + ;; REFENTRY min-leading + ;; PURP Minumum leading between lines + ;; DESC + ;; The '%min-leading%' parameter specifies the smallest amount of leading + ;; to allow between lines. The default value, '#f', has the side-effect + ;; that leading cannot change. This means that graphics that appear in + ;; a paragraph are truncated if they are taller than the current leading. + ;; By setting this parameter to some small value, we get stretchable + ;; space between lines. + ;; /DESC + ;; AUTHOR N/A + ;; /REFENTRY + 2pt) + +(define %hyphenation% + ;; REFENTRY hyphenation + ;; PURP Allow automatic hyphenation? + ;; DESC + ;; The '%hyphenation%' parameter indicates whether or + ;; not the backend should allow automatic hyphention of text, for example + ;; in paragraphs. The default value, '#f', indicates that + ;; it should not. + ;; /DESC + ;; /REFENTRY + #f) + +(declare-initial-value writing-mode %writing-mode%) + +(declare-initial-value input-whitespace-treatment 'collapse) + +(declare-initial-value left-margin %left-margin%) +(declare-initial-value right-margin %right-margin%) + +(declare-initial-value page-width %page-width%) +(declare-initial-value page-height %page-height%) + +(declare-initial-value min-leading %min-leading%) +(declare-initial-value top-margin %top-margin%) +(declare-initial-value bottom-margin %bottom-margin%) +(declare-initial-value header-margin %header-margin%) +(declare-initial-value footer-margin %footer-margin%) + + + + diff --git a/print/dbprint.dsl b/print/dbprint.dsl new file mode 100644 index 0000000..01005d4 --- /dev/null +++ b/print/dbprint.dsl @@ -0,0 +1,205 @@ +;; $Id: dbprint.dsl,v 1.6 2004/10/09 19:46:33 petere78 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +(define (HSIZE n) + (let ((m (if (< n 0) 0 n))) + (* %bf-size% + (expt %hsize-bump-factor% m)))) + +(define (print-backend) + (cond + (tex-backend 'tex) + (mif-backend 'mif) + (rtf-backend 'rtf) + (else default-backend))) + +;; ====================== COMMON STYLE TEMPLATES ======================= + +(define ($block-container$) + (make display-group + space-before: %block-sep% + space-after: %block-sep% + start-indent: %body-start-indent% + (process-children))) + +(define (is-first-para #!optional (para (current-node))) + ;; A paragraph is the first paragraph if it is preceded by a title + ;; (or bridgehead) and the only elements that intervene between the + ;; title and the paragraph are *info elements, indexterms, and beginpage. + ;; + (let loop ((nd (ipreced para))) + (if (node-list-empty? nd) + ;; We've run out of nodes. We still might be the first paragraph + ;; preceded by a title if the parent element has an implied + ;; title. + (if (equal? (element-title-string (parent para)) "") + #f ;; nope + #t) ;; yep + (if (or (equal? (gi nd) (normalize "title")) + (equal? (gi nd) (normalize "titleabbrev")) + (equal? (gi nd) (normalize "bridgehead"))) + #t + (if (or (not (equal? (node-property 'class-name nd) 'element)) + (member (gi nd) (info-element-list))) + (loop (ipreced nd)) + #f))))) + +(define (dsssl-language-code #!optional (node (current-node))) + (let* ((lang ($lang$)) + (langcode (if (> (string-index lang "_") 0) + (substring lang 0 (string-index lang "_")) + lang))) + (string->symbol (case-fold-up langcode)))) + +(define (dsssl-country-code #!optional (node (current-node))) + (let* ((lang ($lang$)) + (ctrycode (if (> (string-index lang "_") 0) + (substring lang + (+ (string-index lang "_") 1) + (string-length lang)) + #f))) + (if ctrycode + (string->symbol (case-fold-up ctrycode)) + #f))) + +(define ($paragraph$) + (if (or (equal? (print-backend) 'tex) + (equal? (print-backend) #f)) + ;; avoid using country: characteristic because of a JadeTeX bug... + (make paragraph + first-line-start-indent: (if (is-first-para) + %para-indent-firstpara% + %para-indent%) + space-before: %para-sep% + space-after: (if (INLIST?) + 0pt + %para-sep%) + quadding: %default-quadding% + hyphenate?: %hyphenation% + language: (dsssl-language-code) + (process-children-trim)) + (make paragraph + first-line-start-indent: (if (is-first-para) + %para-indent-firstpara% + %para-indent%) + space-before: %para-sep% + space-after: (if (INLIST?) + 0pt + %para-sep%) + quadding: %default-quadding% + hyphenate?: %hyphenation% + language: (dsssl-language-code) + country: (dsssl-country-code) + (process-children-trim)))) + +(define ($para-container$) + (make paragraph + space-before: %para-sep% + space-after: %para-sep% + start-indent: (if (member (current-node) (outer-parent-list)) + %body-start-indent% + (inherited-start-indent)) + (process-children-trim))) + +(define ($indent-para-container$) + (make paragraph + space-before: %para-sep% + space-after: %para-sep% + start-indent: (+ (inherited-start-indent) (* (ILSTEP) 2)) + quadding: %default-quadding% + (process-children-trim))) + +(define nop-style + ;; a nop for use: + (style + font-family-name: (inherited-font-family-name) + font-weight: (inherited-font-weight) + font-size: (inherited-font-size))) + +(define default-text-style + (style + font-size: %bf-size% + font-weight: 'medium + font-posture: 'upright + font-family-name: %body-font-family% + line-spacing: (* %bf-size% %line-spacing-factor%))) + +(define ($bold-seq$ #!optional (sosofo (process-children))) + (make sequence + font-weight: 'bold + sosofo)) + +(define ($italic-seq$ #!optional (sosofo (process-children))) + (make sequence + font-posture: 'italic + sosofo)) + +(define ($bold-italic-seq$ #!optional (sosofo (process-children))) + (make sequence + font-weight: 'bold + font-posture: 'italic + sosofo)) + +(define ($mono-seq$ #!optional (sosofo (process-children))) + (let ((%factor% (if %verbatim-size-factor% + %verbatim-size-factor% + 1.0))) + (make sequence + font-family-name: %mono-font-family% + font-size: (* (inherited-font-size) %factor%) + sosofo))) + +(define ($italic-mono-seq$ #!optional (sosofo (process-children))) + (let ((%factor% (if %verbatim-size-factor% + %verbatim-size-factor% + 1.0))) + (make sequence + font-family-name: %mono-font-family% + font-size: (* (inherited-font-size) %factor%) + font-posture: 'italic + sosofo))) + +(define ($bold-mono-seq$ #!optional (sosofo (process-children))) + (let ((%factor% (if %verbatim-size-factor% + %verbatim-size-factor% + 1.0))) + (make sequence + font-family-name: %mono-font-family% + font-size: (* (inherited-font-size) %factor%) + font-weight: 'bold + sosofo))) + +(define ($score-seq$ stype #!optional (sosofo (process-children))) + (make score + type: stype + sosofo)) + +(define ($charseq$ #!optional (sosofo (process-children))) + (make sequence + sosofo)) + +(define ($guilabel-seq$ #!optional (sosofo (process-children))) + (make sequence + font-family-name: %guilabel-font-family% + sosofo)) + +;; Stolen from a posting by James on dssslist +(define *small-caps* + (letrec ((signature (* #o375 256)) + (make-afii + (lambda (n) + (glyph-id (string-append "ISO/IEC 10036/RA//Glyphs::" + (number->string n))))) + (gen + (lambda (from count) + (if (= count 0) + '() + (cons (cons (make-afii from) + (make-afii (+ from signature))) + (gen (+ 1 from) + (- count 1))))))) + (glyph-subst-table (gen #o141 26)))) + diff --git a/print/dbprocdr.dsl b/print/dbprocdr.dsl new file mode 100644 index 0000000..2627699 --- /dev/null +++ b/print/dbprocdr.dsl @@ -0,0 +1,38 @@ +;; $Id: dbprocdr.dsl,v 1.2 2003/01/15 08:24:23 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ============================= PROCEDURES ============================= + +(define (PROCSTEP ilvl) + (if (> ilvl 1) 2.0em 1.8em)) + +(element procedure + (if (node-list-empty? (select-elements (children (current-node)) (normalize "title"))) + ($informal-object$) + ($formal-object$))) + +(element (procedure title) (empty-sosofo)) + +(element substeps + (make display-group + space-before: %para-sep% + space-after: %para-sep% + start-indent: (+ (inherited-start-indent) (PROCSTEP 2)))) + +(element step + (let ((stepcontent (children (current-node))) + (ilevel (length (hierarchical-number-recursive (normalize "step"))))) + (make sequence + start-indent: (+ (inherited-start-indent) (PROCSTEP ilevel)) + + (make paragraph + space-before: %para-sep% + first-line-start-indent: (- (PROCSTEP ilevel)) + (make line-field + field-width: (PROCSTEP ilevel) + (literal ($proc-step-number$ (current-node)))) + (process-node-list (children (node-list-first stepcontent)))) + (process-node-list (node-list-rest stepcontent))))) diff --git a/print/dbqanda.dsl b/print/dbqanda.dsl new file mode 100644 index 0000000..4ea9aef --- /dev/null +++ b/print/dbqanda.dsl @@ -0,0 +1,126 @@ +;; $Id: dbqanda.dsl,v 1.1 2003/03/25 19:53:56 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ============================== QANDASET ============================== + +(define (qanda-defaultlabel) + (normalize "number")) + +(element qandaset + (let ((title (select-elements (children (current-node)) + (normalize "title")))) + (make display-group + (process-node-list title) + (process-qanda)))) + +(element (qandaset title) + (let* ((enclsect (ancestor-member (current-node) + (list (normalize "section") + (normalize "simplesect") + (normalize "sect5") + (normalize "sect4") + (normalize "sect3") + (normalize "sect2") + (normalize "sect1") + (normalize "refsect3") + (normalize "refsect2") + (normalize "refsect1")))) + (sectlvl (SECTLEVEL enclsect)) + (hs (HSIZE (- 4 (+ sectlvl 1))))) + (make paragraph + font-family-name: %title-font-family% + font-weight: (if (< sectlvl 5) 'bold 'medium) + font-posture: (if (< sectlvl 5) 'upright 'italic) + font-size: hs + line-spacing: (* hs %line-spacing-factor%) + space-before: (* hs %head-before-factor%) + space-after: (* hs %head-after-factor%) + start-indent: %body-start-indent% + first-line-start-indent: 0pt + quadding: %section-title-quadding% + keep-with-next?: #t + (process-children)))) + +(element qandadiv + (let ((title (select-elements (children (current-node)) + (normalize "title")))) + (make sequence + (process-node-list title) + (make display-group + start-indent: (+ (inherited-start-indent) 2pi) + (process-qanda))))) + +(element (qandadiv title) + (let* ((hnr (hierarchical-number-recursive (normalize "qandadiv") + (current-node))) + (number (let loop ((numlist hnr) (number "") (sep "")) + (if (null? numlist) + number + (loop (cdr numlist) + (string-append number + sep + (number->string (car numlist))) + "."))))) + (make paragraph + font-weight: 'bold + space-after: %block-sep% + (literal number ". ") + (process-children)))) + +(define (process-qanda #!optional (node (current-node))) + (let* ((preamble (node-list-filter-by-not-gi + (children node) + (list (normalize "title") + (normalize "qandadiv") + (normalize "qandaentry")))) + (divs (node-list-filter-by-gi (children node) + (list (normalize "qandadiv")))) + (entries (node-list-filter-by-gi (children node) + (list (normalize "qandaentry")))) + (inhlabel (inherited-attribute-string (normalize "defaultlabel"))) + (deflabel (if inhlabel inhlabel (qanda-defaultlabel)))) + (make sequence + (process-node-list preamble) + (process-node-list divs) + (process-node-list entries)))) + +(element qandaentry + (process-children)) + +(element question + (let* ((chlist (children (current-node))) + (firstch (node-list-first chlist)) + (restch (node-list-rest chlist)) + (label (question-answer-label (current-node)))) + (make sequence + (make paragraph + space-after: (/ %para-sep% 2) + keep-with-next?: #t + (make sequence + (make sequence + font-weight: 'bold + (if (string=? label "") + (empty-sosofo) + (literal label " "))) + (process-node-list (children firstch))) + (process-node-list restch))))) + +(element answer + (let* ((chlist (children (current-node))) + (firstch (node-list-first chlist)) + (restch (node-list-rest chlist)) + (label (question-answer-label (current-node)))) + (make display-group + space-after: %block-sep% + (make paragraph + (make sequence + (make sequence + font-weight: 'bold + (if (string=? label "") + (empty-sosofo) + (literal label " "))) + (process-node-list (children firstch)))) + (process-node-list restch)))) diff --git a/print/dbrfntry.dsl b/print/dbrfntry.dsl new file mode 100644 index 0000000..39833ab --- /dev/null +++ b/print/dbrfntry.dsl @@ -0,0 +1,215 @@ +;; $Id: dbrfntry.dsl,v 1.3 2003/01/15 08:24:23 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; =========================== REFERENCE PAGES ========================== + +;;(element reference ($component$)) + +(element reference + (let* ((refinfo (select-elements (children (current-node)) + (normalize "docinfo"))) + (refintro (select-elements (children (current-node)) + (normalize "partintro"))) + (nl (titlepage-info-elements + (current-node) + refinfo + (if %generate-partintro-on-titlepage% + refintro + (empty-node-list))))) + (make sequence + (if %generate-reference-titlepage% + (make sequence + (reference-titlepage nl 'recto) + (reference-titlepage nl 'verso)) + (empty-sosofo)) + + (if (not (generate-toc-in-front)) + (process-children) + (empty-sosofo)) + + (if (and %generate-reference-toc% + (not %generate-reference-toc-on-titlepage%)) + (make simple-page-sequence + page-n-columns: %page-n-columns% + page-number-restart?: #t + page-number-format: ($page-number-format$ (normalize "toc")) + use: default-text-style + left-header: ($left-header$ (normalize "toc")) + center-header: ($center-header$ (normalize "toc")) + right-header: ($right-header$ (normalize "toc")) + left-footer: ($left-footer$ (normalize "toc")) + center-footer: ($center-footer$ (normalize "toc")) + right-footer: ($right-footer$ (normalize "toc")) + input-whitespace-treatment: 'collapse + (build-toc (current-node) + (toc-depth (current-node)))) + (empty-sosofo)) + + (if (and (not (node-list-empty? refintro)) + (not %generate-partintro-on-titlepage%)) + ($process-partintro$ refintro #t) + (empty-sosofo)) + + (if (generate-toc-in-front) + (if %refentry-new-page% + (process-children) + (make simple-page-sequence + page-n-columns: %page-n-columns% + page-number-format: ($page-number-format$) + use: default-text-style + left-header: ($left-header$) + center-header: ($center-header$) + right-header: ($right-header$) + left-footer: ($left-footer$) + center-footer: ($center-footer$) + right-footer: ($right-footer$) + input-whitespace-treatment: 'collapse + quadding: %default-quadding% + (process-children))) + (empty-sosofo))))) + +;; If each RefEntry begins on a new page, this title is going to wind +;; up on its own page, too, so make it a divtitlepage instead. Otherwise, +;; just let it be a component title. +(element (reference title) (empty-sosofo)) +;; (if %refentry-new-page% +;; ($divtitlepage$) +;; (empty-sosofo))) + +(element refentry + (make display-group + keep: %refentry-keep% + (if (or %refentry-new-page% + (node-list=? (current-node) (sgml-root-element))) + (make simple-page-sequence + page-n-columns: %page-n-columns% + page-number-format: ($page-number-format$) + use: default-text-style + left-header: ($left-header$) + center-header: ($center-header$) + right-header: ($right-header$) + left-footer: ($left-footer$) + center-footer: ($center-footer$) + right-footer: ($right-footer$) + input-whitespace-treatment: 'collapse + quadding: %default-quadding% + ($refentry-title$) + (process-children)) + (make sequence + ($refentry-title$) + ($block-container$))) + (make-endnotes))) + +(define ($refentry-title$) + (let* ((refmeta (select-elements (children (current-node)) + (normalize "refmeta"))) + (refentrytitle (select-elements (children refmeta) + (normalize "refentrytitle"))) + (refnamediv (select-elements (children (current-node)) + (normalize "refnamediv"))) + (refdescriptor (select-elements (children refnamediv) + (normalize "refdescriptor"))) + (refname (select-elements (children refnamediv) + (normalize "refname"))) + (title (if (node-list-empty? refentrytitle) + (if (node-list-empty? refdescriptor) + (node-list-first refname) + refdescriptor) + refentrytitle)) + (slevel (SECTLEVEL)) ;; the true level in the section hierarchy + (hlevel (if (> slevel 2) 2 slevel)) ;; limit to sect2 equiv. + (hs (HSIZE (- 4 hlevel)))) + (make paragraph + font-family-name: %title-font-family% + font-weight: 'bold + font-size: hs + line-spacing: (* hs %line-spacing-factor%) + space-before: (* hs %head-before-factor%) + space-after: (* hs %head-after-factor%) + start-indent: %body-start-indent% + first-line-start-indent: (- %body-start-indent%) + quadding: 'start + heading-level: (if %generate-heading-level% 2 0) + keep-with-next?: #t + (process-node-list (children title))))) +;; nwalsh, this is wrong, 29 July 1999 +; (if %refentry-function% +; (sosofo-append +; (literal "\no-break-space;") +; (process-first-descendant (normalize "manvolnum"))) +; (empty-sosofo))))) + +(element refmeta (empty-sosofo)) ;; handled by $refentry-title$ + +(element manvolnum + (if %refentry-xref-manvolnum% + (sosofo-append + (literal "(") + (process-children) + (literal ")")) + (empty-sosofo))) + +(element refmiscinfo (empty-sosofo)) + +(element refentrytitle ($charseq$)) + +(element refnamediv + (make paragraph + space-before: %para-sep% + start-indent: %body-start-indent% + quadding: 'start + (process-children))) + +(element refname + (make sequence + (if (and %refentry-generate-name% (first-sibling? (current-node))) + ($lowtitlewithsosofo$ 1 3 (literal (gentext-element-name + (current-node)))) + (empty-sosofo)) + (make sequence + font-weight: 'medium + font-family-name: %refentry-name-font-family% + (process-children) + (if (last-sibling? (current-node)) + (empty-sosofo) + (literal (gentext-intra-label-sep (gi (current-node)))))))) + +(element refpurpose + (make sequence + font-family-name: %body-font-family% + (make sequence + (literal " \em-dash ") + (process-children)) + (make paragraph-break))) + +(element refdescriptor (empty-sosofo)) + +(element refclass + (let ((role (attribute-string "role"))) + (make paragraph + space-before: %para-sep% + start-indent: %body-start-indent% + quadding: 'start + (make sequence + font-weight: 'bold + (literal + (if role + (string-append role ": ") + ""))) + (process-children-trim)))) + +(element refsynopsisdiv ($section$)) + +(element (refsynopsisdiv title) (empty-sosofo)) + +(element refsect1 ($section$)) +(element (refsect1 title) (empty-sosofo)) +(element refsect2 ($section$)) +(element (refsect2 title) (empty-sosofo)) +(element refsect3 ($section$)) +(element (refsect3 title) (empty-sosofo)) + + diff --git a/print/dbsect.dsl b/print/dbsect.dsl new file mode 100644 index 0000000..39b1f6a --- /dev/null +++ b/print/dbsect.dsl @@ -0,0 +1,208 @@ +;; $Id: dbsect.dsl,v 1.6 2003/03/25 19:53:57 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ============================== SECTIONS ============================== + +(define (SECTLEVEL #!optional (sect (current-node))) + (section-level-by-node #f sect)) + +;; BRIDGEHEAD isn't a proper section, but appears to be a section title +(element bridgehead + (let* ((renderas (attribute-string "renderas")) + ;; the apparent section level + (hlevel + ;; if not real section level, then get the apparent level + ;; from "renderas" + (if renderas + (section-level-by-gi #f (normalize renderas)) + ;; else use the real level + (SECTLEVEL))) + (hs (HSIZE (- 5 hlevel)))) + (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: (* hs %head-after-factor%) + start-indent: (if (< hlevel 3) + 0pt + %body-start-indent%) + first-line-start-indent: 0pt + quadding: %section-title-quadding% + keep-with-next?: #t + (process-children)))) + +(define ($section$) + (if (node-list=? (current-node) (sgml-root-element)) + (make simple-page-sequence + page-n-columns: %page-n-columns% + page-number-restart?: (or %page-number-restart% + (book-start?) + (first-chapter?)) + page-number-format: ($page-number-format$) + use: default-text-style + left-header: ($left-header$) + center-header: ($center-header$) + right-header: ($right-header$) + left-footer: ($left-footer$) + center-footer: ($center-footer$) + right-footer: ($right-footer$) + start-indent: %body-start-indent% + input-whitespace-treatment: 'collapse + quadding: %default-quadding% + (make sequence + ($section-title$) + (process-children))) + (make display-group + space-before: %block-sep% + space-after: %block-sep% + start-indent: %body-start-indent% + (make sequence + ($section-title$) + (process-children))))) + +(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)) + ;; the apparent section level + (hlevel + ;; if not real section level, then get the apparent level + ;; from "renderas" + (if renderas + (section-level-by-gi #f (normalize renderas)) + ;; else use the real level + (SECTLEVEL))) + (hs (HSIZE (- 5 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 0) + ;; SimpleSects are never AUTO numbered...they aren't hierarchical + (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)) + ($proc-section-info$ info)))) + +(mode section-title-mode + (element subtitle + (let* ((sect (parent (parent (current-node)))) ;; parent=>sect*info + (renderas (inherited-attribute-string "renderas" sect)) + ;; the apparent section level + (hlevel + ;; if not real section level, then get the apparent level + ;; from "renderas" + (if renderas + (section-level-by-gi #f (normalize renderas)) + ;; else use the real level + (SECTLEVEL))) + (hs (HSIZE (- 4 hlevel)))) ;; one smaller than the title... + (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: 0pt + space-after: (* hs %head-after-factor%) + start-indent: + (if (< hlevel 3) + 0pt + %body-start-indent%) + first-line-start-indent: 0pt + quadding: %section-subtitle-quadding% + keep-with-next?: #t + (process-children)))) +) + +(define ($proc-section-info$ info) + (cond ((equal? (gi) (normalize "sect1")) + ($sect1-info$ info)) + ((equal? (gi) (normalize "sect2")) + ($sect2-info$ info)) + ((equal? (gi) (normalize "sect3")) + ($sect3-info$ info)) + ((equal? (gi) (normalize "sect4")) + ($sect4-info$ info)) + ((equal? (gi) (normalize "sect5")) + ($sect5-info$ info)) + ((equal? (gi) (normalize "section")) + ($section-info$ info)) + ((equal? (gi) (normalize "refsect1")) + ($refsect1-info$ info)) + ((equal? (gi) (normalize "refsect2")) + ($refsect2-info$ info)) + ((equal? (gi) (normalize "refsect3")) + ($refsect3-info$ info)) + (else (empty-sosofo)))) + +(define ($sect1-info$ info) (empty-sosofo)) +(define ($sect2-info$ info) (empty-sosofo)) +(define ($sect3-info$ info) (empty-sosofo)) +(define ($sect4-info$ info) (empty-sosofo)) +(define ($sect5-info$ info) (empty-sosofo)) +(define ($section-info$ info) (empty-sosofo)) +(define ($refsect1-info$ info) (empty-sosofo)) +(define ($refsect2-info$ info) (empty-sosofo)) +(define ($refsect3-info$ info) (empty-sosofo)) + +(element section ($section$)) +(element (section title) (empty-sosofo)) + +(element sect1 ($section$)) +(element (sect1 title) (empty-sosofo)) + +(element sect2 ($section$)) +(element (sect2 title) (empty-sosofo)) + +(element sect3 ($section$)) +(element (sect3 title) (empty-sosofo)) + +(element sect4 ($section$)) +(element (sect4 title) (empty-sosofo)) + +(element sect5 ($section$)) +(element (sect5 title) (empty-sosofo)) + +(element simplesect ($section$)) +(element (simplesect title) (empty-sosofo)) + diff --git a/print/dbsynop.dsl b/print/dbsynop.dsl new file mode 100644 index 0000000..2e04e5c --- /dev/null +++ b/print/dbsynop.dsl @@ -0,0 +1,224 @@ +;; $Id: dbsynop.dsl,v 1.3 2003/01/15 08:24:23 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +;; ========================= SYNTAX DEFINITIONS ========================= + +(element synopsis ($verbatim-display$ %indent-synopsis-lines% + %number-synopsis-lines%)) + +(element cmdsynopsis + ;; Can't be an $informal-object$ because it needs the paragraph + ;; wrapper around process-children + (make display-group + start-indent: (+ %block-start-indent% (inherited-start-indent)) + space-before: %block-sep% + space-after: %block-sep% + (make paragraph + (process-children)))) + +;; Support for ARG provided by James Bostock, augmented by norm +;; + +(element (cmdsynopsis command) + (make sequence + (if (first-sibling? (current-node)) + (empty-sosofo) + (make paragraph-break)) + (next-match) + (literal " "))) + +(element group + (let ((choice (attribute-string (normalize "choice"))) + (rep (attribute-string (normalize "rep"))) + (sepchar (if (inherited-attribute-string (normalize "sepchar")) + (inherited-attribute-string (normalize "sepchar")) + " "))) + (make sequence + (if (equal? (absolute-child-number (current-node)) 1) + (empty-sosofo) + (literal sepchar)) + (cond + ((equal? choice (normalize "plain")) (literal %arg-choice-plain-open-str%)) + ((equal? choice (normalize "req")) (literal %arg-choice-req-open-str%)) + ((equal? choice (normalize "opt")) (literal %arg-choice-opt-open-str%)) + (else (literal %arg-choice-def-open-str%))) + (process-children) + (cond + ((equal? choice (normalize "plain")) (literal %arg-choice-plain-close-str%)) + ((equal? choice (normalize "req")) (literal %arg-choice-req-close-str%)) + ((equal? choice (normalize "opt")) (literal %arg-choice-opt-close-str%)) + (else (literal %arg-choice-def-close-str%))) + (cond + ((equal? rep (normalize "repeat")) (literal %arg-rep-repeat-str%)) + ((equal? rep (normalize "norepeat")) (literal %arg-rep-norepeat-str%)) + (else (literal %arg-rep-def-str%)))))) + +(element arg + (let ((choice (attribute-string (normalize "choice"))) + (rep (attribute-string (normalize "rep"))) + (sepchar (if (inherited-attribute-string (normalize "sepchar")) + (inherited-attribute-string (normalize "sepchar")) + " "))) + (make sequence + (if (equal? (absolute-child-number (current-node)) 1) + (empty-sosofo) + (literal sepchar)) + (cond + ((equal? choice (normalize "plain")) (literal %arg-choice-plain-open-str%)) + ((equal? choice (normalize "req")) (literal %arg-choice-req-open-str%)) + ((equal? choice (normalize "opt")) (literal %arg-choice-opt-open-str%)) + (else (literal %arg-choice-def-open-str%))) + (process-children) + (cond + ((equal? rep (normalize "repeat")) (literal %arg-rep-repeat-str%)) + ((equal? rep (normalize "norepeat")) (literal %arg-rep-norepeat-str%)) + (else (literal %arg-rep-def-str%))) + (cond + ((equal? choice (normalize "plain")) (literal %arg-choice-plain-close-str%)) + ((equal? choice (normalize "req")) (literal %arg-choice-req-close-str%)) + ((equal? choice (normalize "opt")) (literal %arg-choice-opt-close-str%)) + (else (literal %arg-choice-def-close-str%)))))) + +(element (group arg) + (let ((choice (attribute-string (normalize "choice"))) + (rep (attribute-string (normalize "rep")))) + (make sequence + (if (not (first-sibling? (current-node))) + (literal %arg-or-sep%) + (empty-sosofo)) + (process-children)))) + +(element sbr + (make paragraph-break)) + +;; ---------------------------------------------------------------------- +;; Syntax highlighting... + +(define (funcsynopsis-function #!optional (sosofo (process-children))) + (make sequence + font-weight: 'bold + sosofo)) + +(define (paramdef-parameter #!optional (sosofo (process-children))) + (make sequence + font-posture: 'italic + sosofo)) + +;; ---------------------------------------------------------------------- + +(element synopfragmentref + (let* ((target (element-with-id (attribute-string (normalize "linkend")))) + (snum (child-number target))) + (make sequence + font-posture: 'italic + (make link + destination: (node-list-address target) + (make sequence + font-posture: 'upright + ($callout-bug$ snum))) + (process-children)))) + +(element synopfragment + (let ((snum (child-number (current-node)))) + (make paragraph + ($callout-bug$ snum) + (literal " ") + (process-children)))) + +(element funcsynopsis + (let* ((width-in-chars (if (attribute-string "width") + (string->number (attribute-string "width")) + %verbatim-default-width%)) + (fsize (lambda () (if (or (attribute-string (normalize "width")) + (not %verbatim-size-factor%)) + (/ (/ (- %text-width% (inherited-start-indent)) + width-in-chars) + 0.7) + (* (inherited-font-size) + %verbatim-size-factor%))))) + ;; This used to be a sequence, but that caused the start-indent to be + ;; wrong when it was the first element of a RefSect. Making it a + ;; paragraph makes the bug go away and doesn't seem to have any ill + ;; effects. Need to investigate further... + (make paragraph + font-family-name: %mono-font-family% + font-size: (fsize) + font-weight: 'medium + font-posture: 'upright + line-spacing: (* (fsize) %line-spacing-factor%) + ($informal-object$)))) + +(element funcsynopsisinfo + ;; Fake out the font-size so that when verbatim-display calculates the + ;; verbatim-size-factor it doesn't get squared. This will fail if the + ;; "correct" size isn't bfsize, but what can I do? + (make sequence + font-size: %bf-size% + ($verbatim-display$ %indent-funcsynopsisinfo-lines% + %number-funcsynopsisinfo-lines%))) + +(element funcprototype + (let ((paramdefs (select-elements (children (current-node)) + (normalize "paramdef")))) + (make sequence + (make paragraph + font-family-name: %mono-font-family% + (process-children)) + (if (equal? %funcsynopsis-style% 'kr) + (with-mode kr-funcsynopsis-mode + (process-node-list paramdefs)) + (empty-sosofo))))) + +(element funcdef (process-children)) +(element (funcdef function) + (if %funcsynopsis-decoration% + (funcsynopsis-function) + (process-children))) + +(element void + (if (equal? %funcsynopsis-style% 'ansi) + (literal "(void);") + (literal "();"))) + +(element varargs (literal "(...);")) + +(element paramdef + (let ((param (select-elements (children (current-node)) (normalize "parameter")))) + (make sequence + (if (equal? (child-number (current-node)) 1) + (literal "(") + (empty-sosofo)) + (if (equal? %funcsynopsis-style% 'ansi) + (process-children) + (process-node-list param)) + (if (equal? (gi (ifollow (current-node))) (normalize "paramdef")) + (literal ", ") + (literal ");"))))) + +(element (paramdef parameter) + (make sequence + (if %funcsynopsis-decoration% + (paramdef-parameter) + (process-children)) + (if (equal? (gi (ifollow (current-node))) (normalize "parameter")) + (literal ", ") + (empty-sosofo)))) + +(element funcparams + (make sequence + (literal "(") + (process-children) + (literal ")"))) + +(mode kr-funcsynopsis-mode + (element paramdef + (make sequence + (make paragraph + font-family-name: %mono-font-family% + start-indent: (+ (inherited-start-indent) %kr-funcsynopsis-indent%) + (make sequence + (process-children) + (literal ";")))))) diff --git a/print/dbtable.dsl b/print/dbtable.dsl new file mode 100644 index 0000000..364ced8 --- /dev/null +++ b/print/dbtable.dsl @@ -0,0 +1,587 @@ +;; $Id: dbtable.dsl,v 1.3 2003/02/17 08:56:46 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; +;; Table support completely reimplemented by norm 15/16 Nov 1997 +;; +;; ====================================================================== +;; +;; This code is intended to implement the SGML Open Exchange Table Model +;; (http://www.sgmlopen.org/sgml/docs/techpubs.htm) as far as is possible +;; in RTF. There are a few areas where this code probably fails to +;; perfectly implement the model: +;; +;; - Mixed column width units (4*+2pi) are not supported. +;; - The behavior that results from mixing relative units with +;; absolute units has not been carefully considered. +;; - TFOOT appears at the bottom of the table, but is not repeated +;; across the bottom of pages (RTF limitation). +;; - ENTRYTBL is not supported. +;; - Rotated tables (e.g. landscape tables in a portrait document) +;; cannot be supported in a simple-page-sequence +;; +;; ====================================================================== +;; +;; My goal in reimplementing the table model was to provide correct +;; formatting in tables that use MOREROWS. The difficulty is that +;; correct formatting depends on calculating the column into which +;; an ENTRY will fall. +;; +;; This is a non-trivial problem because MOREROWS can hang down from +;; preceding rows and ENTRYs may specify starting columns (skipping +;; preceding ones). +;; +;; A simple, elegant recursive algorithm exists. Unfortunately it +;; requires calculating the column number of every preceding cell +;; in the entire table. Without memoization, performance is unacceptable +;; even in relatively small tables (5x5, for example). +;; +;; In order to avoid recursion, the algorithm used below is one that +;; works forward from the beginning of the table and "passes along" +;; the relevant information (column number of the preceding cell and +;; overhang from the MOREROWS in preceding rows). +;; +;; Unfortunately, this means that element construction rules +;; can't always be used to fire the appropriate rule. Instead, +;; each TGROUP has to process each THEAD/BODY/FOOT explicitly. +;; And each of those must process each ROW explicitly, then each +;; ENTRY/ENTRYTBL explicitly. +;; +;; ---------------------------------------------------------------------- +;; +;; I attempted to simplify this code by relying on inheritence from +;; table-column flow objects, but that wasn't entirely successful. +;; Horizontally spanning cells didn't seem to inherit from table-column +;; flow objects that didn't specify equal spanning. There seemed to +;; be other problems as well, but they could have been caused by coding +;; errors on my part. +;; +;; Anyway, by the time I understood how I could use table-column +;; flow objects for inheritence, I'd already implemented all the +;; machinery below to "work it out by hand". +;; +;; ====================================================================== +;; NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE +;; ---------------------------------------------------------------------- +;; A fairly large chunk of this code is in dbcommon.dsl! +;; ====================================================================== +;; + +;; Default value for FRAME= on tables +(define ($cals-frame-default$) (normalize "all")) + +;; Default for COLSEP/ROWSEP if unspecified. +(define ($cals-rowsep-default$ #!optional (node (current-node))) + ;; Return "0" for #f, "1" for #t + ;; Default is to have rules if FRAME=ALL, otherwise not. Except + ;; that a separator between HEAD and BODY is controlled by + ;; %table-head-body-border%. + ;; + (let* ((table (ancestor-member node ($table-element-list$))) + (frame (if (attribute-string (normalize "frame") table) + (attribute-string (normalize "frame") table) + ($cals-frame-default$))) + (row (ancestor-member node (list (normalize "row"))))) + (if (equal? frame (normalize "all")) + #t + (if (and (equal? (gi (parent row)) (normalize "thead")) + (last-sibling? row)) + %table-head-body-border% + #f)))) + +(define ($cals-colsep-default$ #!optional (node (current-node))) + ;; Default is to have rules if FRAME=ALL, otherwise not. + ;; + (let* ((table (ancestor-member node ($table-element-list$))) + (frame (if (attribute-string (normalize "frame") table) + (attribute-string (normalize "frame") table) + ($cals-frame-default$)))) + (equal? frame (normalize "all")))) + +;; Default for VALIGN if unspecified +(define ($cals-valign-default$) (normalize "top")) + +;; Margins around cell contents +(define %cals-cell-before-row-margin% 3pt) +(define %cals-cell-after-row-margin% 3pt) + +(define %cals-cell-before-column-margin% 3pt) + +(define %cals-cell-after-column-margin% 3pt) + +;; Inheritable start and end indent for cell contents +(define %cals-cell-content-start-indent% 2pt) +(define %cals-cell-content-end-indent% 2pt) + +;; How to indent pgwide tables? (Non-pgwide tables get inherited-start-indent +(define %cals-pgwide-start-indent% %body-start-indent%) + +;; What alignment should tables have on the page +(define %cals-display-align% 'start) + +;; ---------------------------------------------------------------------- +;; Table rule widths + +(define %table-before-row-border% #t) +(define %table-after-row-border% #t) +(define %table-before-column-border% #t) +(define %table-after-column-border% #t) +(define %table-head-body-border% #t) +(define %table-cell-after-column-border% #t) +(define %table-cell-after-row-border% #t) + +;;(define tbl-color-space +;; (color-space "ISO/IEC 10179:1996//Color-Space Family::Device RGB")) +;; +;;(define tbl-red (color tbl-color-space 1 0 0)) +;;(define tbl-green (color tbl-color-space 0 1 0)) +;;(define tbl-blue (color tbl-color-space 0 0 1)) + +(define calc-table-before-row-border + (if (boolean? %table-before-row-border%) + %table-before-row-border% + ;; Avoid problems with the DSSSL compiler when + ;; %table-before-row-border% is boolean. + (let ((border-width %table-before-row-border%)) + (make table-border + line-thickness: border-width)))) + +(define calc-table-after-row-border + (if (boolean? %table-after-row-border%) + %table-after-row-border% + (let ((border-width %table-after-row-border%)) + (make table-border + line-thickness: border-width)))) + +(define calc-table-before-column-border + (if (boolean? %table-before-column-border%) + %table-before-column-border% + (let ((border-width %table-before-column-border%)) + (make table-border + line-thickness: border-width)))) + +(define calc-table-after-column-border + (if (boolean? %table-after-column-border%) + %table-after-column-border% + (let ((border-width %table-after-column-border%)) + (make table-border + line-thickness: border-width)))) + +(define calc-table-head-body-border + (if (boolean? %table-head-body-border%) + %table-head-body-border% + (let ((border-width %table-head-body-border%)) + (make table-border + line-thickness: border-width)))) + +(define calc-table-cell-after-column-border + (if (boolean? %table-cell-after-column-border%) + %table-cell-after-column-border% + (let ((border-width %table-cell-after-column-border%)) + (make table-border + line-thickness: border-width)))) + +(define calc-table-cell-after-row-border + (if (boolean? %table-cell-after-row-border%) + %table-cell-after-row-border% + (let ((border-width %table-cell-after-row-border%)) + (make table-border + line-thickness: border-width)))) + +;; ---------------------------------------------------------------------- +;; Convert colwidth units into table-unit measurements + +(define (colwidth-unit lenstr) + (if (string? lenstr) + (let ((number (length-string-number-part lenstr)) + (units (length-string-unit-part lenstr))) + (if (string=? units "*") + (if (string=? number "") + (table-unit 1) + (table-unit (string->number number))) + (if (string=? units "") + ;; no units, default to points + (* (string->number number) 1pt) + (let* ((unum (string->number number)) + (uname (case-fold-down units))) + (case uname + (("mm") (* unum 1mm)) + (("cm") (* unum 1cm)) + (("in") (* unum 1in)) + (("pi") (* unum 1pi)) + (("pt") (* unum 1pt)) + (("px") (* unum 1px)) + ;; unrecognized units; use points + (else (* unum 1pt))))))) + ;; lenstr is not a string...probably #f + (table-unit 1))) + + +(define (cell-align cell colnum) + (let* ((entry (ancestor-member cell (list (normalize "entry") + (normalize "entrytbl")))) + (tgroup (find-tgroup entry)) + (spanname (attribute-string (normalize "spanname") entry)) + (calsalign (if (attribute-string (normalize "align") entry) + (attribute-string (normalize "align") entry) + (if (and spanname + (spanspec-align (find-spanspec spanname))) + (spanspec-align (find-spanspec spanname)) + (if (colspec-align (find-colspec-by-number colnum)) + (colspec-align (find-colspec-by-number colnum)) + (if (tgroup-align tgroup) + (tgroup-align tgroup) + (normalize "left"))))))) + (cond + ((equal? calsalign (normalize "left")) 'start) + ((equal? calsalign (normalize "center")) 'center) + ((equal? calsalign (normalize "right")) 'end) + (else 'start)))) + +(define (cell-valign cell colnum) + (let* ((entry (ancestor-member cell (list (normalize "entry") + (normalize "entrytbl")))) + (row (ancestor (normalize "row") entry)) + (tbody (ancestor-member cell (list (normalize "tbody") + (normalize "thead") + (normalize "tfoot")))) + (tgroup (ancestor (normalize "tgroup") entry)) + (calsvalign (if (attribute-string (normalize "valign") entry) + (attribute-string (normalize "valign") entry) + (if (attribute-string (normalize "valign") row) + (attribute-string (normalize "valign") row) + (if (attribute-string (normalize "valign") tbody) + (attribute-string (normalize "valign") tbody) + ($cals-valign-default$)))))) + (cond + ((equal? calsvalign (normalize "top")) 'start) + ((equal? calsvalign (normalize "middle")) 'center) + ((equal? calsvalign (normalize "bottom")) 'end) + (else 'start)))) + +;; ====================================================================== +;; Element rules + +(element tgroup + (let ((frame-attribute (if (inherited-attribute-string (normalize "frame")) + (inherited-attribute-string (normalize "frame")) + ($cals-frame-default$)))) + (make table + ;; These values are used for the outer edges (well, the top, bottom + ;; and left edges for sure; I think the right edge actually comes + ;; from the cells in the last column + before-row-border: (if (cond + ((equal? frame-attribute (normalize "all")) #t) + ((equal? frame-attribute (normalize "sides")) #f) + ((equal? frame-attribute (normalize "top")) #t) + ((equal? frame-attribute (normalize "bottom")) #f) + ((equal? frame-attribute (normalize "topbot")) #t) + ((equal? frame-attribute (normalize "none")) #f) + (else #f)) + calc-table-before-row-border + #f) + after-row-border: (if (cond + ((equal? frame-attribute (normalize "all")) #t) + ((equal? frame-attribute (normalize "sides")) #f) + ((equal? frame-attribute (normalize "top")) #f) + ((equal? frame-attribute (normalize "bottom")) #t) + ((equal? frame-attribute (normalize "topbot")) #t) + ((equal? frame-attribute (normalize "none")) #f) + (else #f)) + calc-table-after-row-border + #f) + before-column-border: (if (cond + ((equal? frame-attribute (normalize "all")) #t) + ((equal? frame-attribute (normalize "sides")) #t) + ((equal? frame-attribute (normalize "top")) #f) + ((equal? frame-attribute (normalize "bottom")) #f) + ((equal? frame-attribute (normalize "topbot")) #f) + ((equal? frame-attribute (normalize "none")) #f) + (else #f)) + calc-table-before-column-border + #f) + after-column-border: (if (cond + ((equal? frame-attribute (normalize "all")) #t) + ((equal? frame-attribute (normalize "sides")) #t) + ((equal? frame-attribute (normalize "top")) #f) + ((equal? frame-attribute (normalize "bottom")) #f) + ((equal? frame-attribute (normalize "topbot")) #f) + ((equal? frame-attribute (normalize "none")) #f) + (else #f)) + calc-table-after-column-border + #f) + display-alignment: %cals-display-align% + (make table-part + content-map: '((thead header) + (tbody #f) + (tfoot footer)) + ($process-colspecs$ (current-node)) + (process-children) + (make-table-endnotes))))) + +(element colspec + ;; now handled by $process-colspecs$ at the top of each tgroup... + (empty-sosofo)) + +(element spanspec + (empty-sosofo)) + +(element thead + ($process-table-body$ (current-node))) + +(element tfoot + ($process-table-body$ (current-node))) + +(element tbody + ($process-table-body$ (current-node))) + +(element row + (empty-sosofo)) ;; this should never happen, they're processed explicitly + +(element entry + (empty-sosofo)) ;; this should never happen, they're processed explicitly + +;; ====================================================================== +;; Functions that handle processing of table bodies, rows, and cells + +(define ($process-colspecs$ tgroup) + (let* ((cols (string->number (attribute-string (normalize "cols"))))) + (let loop ((colnum 1)) + (if (> colnum cols) + (empty-sosofo) + (make sequence + (let ((colspec (find-colspec-by-number colnum))) + (if (node-list-empty? colspec) + (make table-column + column-number: colnum + width: (colwidth-unit "1*")) + ($process-colspec$ colspec colnum))) + (loop (+ colnum 1))))))) + +(define ($process-colspec$ colspec colnum) + (let* ((colwidth (if (attribute-string (normalize "colwidth") colspec) + (attribute-string (normalize "colwidth") colspec) + "1*"))) + (make table-column + column-number: colnum + width: (colwidth-unit colwidth)))) + +(define ($process-table-body$ body) + (let* ((tgroup (ancestor (normalize "tgroup") body)) + (cols (string->number (attribute-string (normalize "cols") tgroup))) + (blabel (cond + ((equal? (gi body) (normalize "thead")) 'thead) + ((equal? (gi body) (normalize "tbody")) 'tbody) + ((equal? (gi body) (normalize "tfoot")) 'tfoot)))) + (make sequence + label: blabel + (let loop ((rows (select-elements (children body) (normalize "row"))) + (overhang (constant-list 0 cols))) + (if (node-list-empty? rows) + (empty-sosofo) + (make sequence + ($process-row$ (node-list-first rows) overhang) + (loop (node-list-rest rows) + (update-overhang (node-list-first rows) overhang)))))))) + +(define ($process-row$ row overhang) + (let* ((tgroup (ancestor (normalize "tgroup") row)) + (maxcol (string->number (attribute-string + (normalize "cols") tgroup))) + (lastentry (node-list-last (node-list-filter-out-pis + (children row)))) + (table (parent tgroup))) + ;; there's no point calculating the row or colsep here, each cell + ;; specifies it which overrides anything we might say here... + (make table-row + (let loop ((cells (node-list-filter-out-pis (children row))) + (prevcell (empty-node-list))) + (if (node-list-empty? cells) + (empty-sosofo) + (make sequence + ($process-cell$ (node-list-first cells) prevcell row overhang) + (loop (node-list-rest cells) (node-list-first cells))))) + + ;; add any necessary empty cells to the end of the row + (let loop ((colnum (+ (cell-column-number lastentry overhang) + (hspan lastentry)))) + (if (> colnum maxcol) + (empty-sosofo) + (make sequence + ($process-empty-cell$ colnum row) + (loop (+ colnum 1)))))))) + +(define ($process-cell$ entry preventry row overhang) + (let* ((colnum (cell-column-number entry overhang)) + (lastcellcolumn (if (node-list-empty? preventry) + 0 + (- (+ (cell-column-number preventry overhang) + (hspan preventry)) + 1))) + (lastcolnum (if (> lastcellcolumn 0) + (overhang-skip overhang lastcellcolumn) + 0)) + (font-name (if (have-ancestor? (normalize "thead") entry) + %title-font-family% + %body-font-family%)) + (weight (if (have-ancestor? (normalize "thead") entry) + 'bold + 'medium)) + (align (cell-align entry colnum))) + + (make sequence + ;; This is a little bit complicated. We want to output empty cells + ;; to skip over missing data. We start count at the column number + ;; arrived at by adding 1 to the column number of the previous entry + ;; and skipping over any MOREROWS overhanging entrys. Then for each + ;; iteration, we add 1 and skip over any overhanging entrys. + (let loop ((count (overhang-skip overhang (+ lastcolnum 1)))) + (if (>= count colnum) + (empty-sosofo) + (make sequence + ($process-empty-cell$ count row) + (loop (overhang-skip overhang (+ count 1)))))) + + ;; Now we've output empty cells for any missing entries, so we + ;; are ready to output the cell for this entry... + (make table-cell + column-number: colnum + n-columns-spanned: (hspan entry) + n-rows-spanned: (vspan entry) + + cell-row-alignment: (cell-valign entry colnum) + + cell-after-column-border: (if (cell-colsep entry colnum) + calc-table-cell-after-column-border + #f) + + cell-after-row-border: (if (cell-rowsep entry colnum) + (if (last-sibling? (parent entry)) + calc-table-head-body-border + calc-table-cell-after-row-border) + #f) + + cell-before-row-margin: %cals-cell-before-row-margin% + cell-after-row-margin: %cals-cell-after-row-margin% + cell-before-column-margin: %cals-cell-before-column-margin% + cell-after-column-margin: %cals-cell-after-column-margin% + + ;; If there is some additional indentation (because we're in a list, + ;; for example) make sure that gets passed along, but don't add + ;; the normal body-start-indent. + start-indent: (+ (- (inherited-start-indent) %body-start-indent%) + %cals-cell-content-start-indent%) + end-indent: %cals-cell-content-end-indent% + (if (equal? (gi entry) (normalize "entrytbl")) + (make paragraph + (literal "ENTRYTBL not supported.")) + (make paragraph + font-family-name: font-name + font-weight: weight + quadding: align + (process-node-list (children entry)))))))) + +(define (empty-cell-colsep colnum row) + (let* ((tgroup (ancestor (normalize "tgroup") row)) + (table (parent tgroup)) + (calscolsep + (if (tgroup-colsep tgroup) + (tgroup-colsep tgroup) + (if (attribute-string (normalize "colsep") table) + (attribute-string (normalize "colsep") table) + (if ($cals-colsep-default$ row) + "1" + "0"))))) + (> (string->number calscolsep) 0))) + +;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +(define (cell-colsep cell colnum) + (let* ((entry (ancestor-member cell (list (normalize "entry") (normalize "entrytbl")))) + (spanname (attribute-string (normalize "spanname") entry)) + (tgroup (find-tgroup entry)) + (table (parent tgroup)) + (calscolsep + (if (attribute-string (normalize "colsep") entry) + (attribute-string (normalize "colsep") entry) + (if (and spanname + (spanspec-colsep (find-spanspec spanname))) + (spanspec-colsep (find-spanspec spanname)) + (if (colspec-colsep (find-colspec-by-number colnum)) + (colspec-colsep (find-colspec-by-number colnum)) + (if (tgroup-colsep tgroup) + (tgroup-colsep tgroup) + (if (attribute-string (normalize "colsep") table) + (attribute-string (normalize "colsep") table) + (if ($cals-colsep-default$ cell) + "1" + "0")))))))) + (> (string->number calscolsep) 0))) + +(define (cell-rowsep cell colnum) + (let* ((entry (ancestor-member cell (list (normalize "entry") + (normalize "entrytbl")))) + (spanname (attribute-string (normalize "spanname") entry)) + (row (ancestor (normalize "row") entry)) + (tgroup (find-tgroup entry)) + (table (parent tgroup)) + (calsrowsep + (if (attribute-string (normalize "rowsep") entry) + (attribute-string (normalize "rowsep") entry) + (if (and spanname (spanspec-rowsep (find-spanspec spanname))) + (spanspec-rowsep (find-spanspec spanname)) + (if (colspec-rowsep (find-colspec-by-number colnum)) + (colspec-rowsep (find-colspec-by-number colnum)) + (if (attribute-string (normalize "rowsep") row) + (attribute-string (normalize "rowsep") row) + (if (tgroup-rowsep tgroup) + (tgroup-rowsep tgroup) + (if (attribute-string (normalize "rowsep") table) + (attribute-string (normalize "rowsep") table) + (if ($cals-rowsep-default$ cell) + "1" + "0"))))))))) + (> (string->number calsrowsep) 0))) + +(define (empty-cell-rowsep colnum row) + (let* ((tgroup (ancestor (normalize "tgroup") row)) + (table (parent tgroup)) + (calsrowsep + (if (attribute-string (normalize "rowsep") row) + (attribute-string (normalize "rowsep") row) + (if (tgroup-rowsep tgroup) + (tgroup-rowsep tgroup) + (if (attribute-string (normalize "rowsep") table) + (attribute-string (normalize "rowsep") table) + (if ($cals-rowsep-default$ row) + "1" + "0")))))) + (> (string->number calsrowsep) 0))) + +;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +(define ($process-empty-cell$ colnum row) + (make table-cell + column-number: colnum + n-columns-spanned: 1 + n-rows-spanned: 1 + cell-after-column-border: (if (empty-cell-colsep colnum row) + calc-table-cell-after-column-border + #f) + + cell-after-row-border: (if (empty-cell-rowsep colnum row) + (if (last-sibling? row) + calc-table-head-body-border + calc-table-cell-after-row-border) + #f) + + cell-before-row-margin: %cals-cell-before-row-margin% + cell-after-row-margin: %cals-cell-after-row-margin% + cell-before-column-margin: %cals-cell-before-column-margin% + cell-after-column-margin: %cals-cell-after-column-margin% + start-indent: %cals-cell-content-start-indent% + end-indent: %cals-cell-content-end-indent% + (empty-sosofo))) + +;; EOF diff --git a/print/dbtitle.dsl b/print/dbtitle.dsl new file mode 100644 index 0000000..8c4635b --- /dev/null +++ b/print/dbtitle.dsl @@ -0,0 +1,52 @@ +;; $Id: dbtitle.dsl,v 1.4 2003/02/17 19:42:45 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +(define title-style + (style + font-family-name: %title-font-family% + font-weight: 'bold + quadding: 'start)) + +;; So we can pass different sosofo's to this routine and get identical +;; treatment (see REFNAME in dbrfntry.dsl) +;; +(define ($lowtitlewithsosofo$ tlevel hlevel sosofo) + (let ((hs (HSIZE (- 3 tlevel)))) + (make paragraph + font-family-name: %title-font-family% + font-weight: 'bold + font-size: hs + line-spacing: (* hs %line-spacing-factor%) + space-before: (* hs %head-before-factor%) + space-after: (* hs %head-after-factor%) + start-indent: %body-start-indent% + quadding: 'start + keep-with-next?: #t + heading-level: (if %generate-heading-level% hlevel 0) + sosofo))) + +(define ($lowtitle$ tlevel hlevel) + ($lowtitlewithsosofo$ tlevel hlevel (process-children))) + +(define ($runinhead$) + (let* ((title (data (current-node))) + (titlelen (string-length title)) + (lastchar (string-ref title (- titlelen 1))) + (punct (if (member lastchar %content-title-end-punct%) + "" + %default-title-end-punct%))) + (make sequence + font-weight: 'bold + (process-children-trim) + (literal punct " ")))) + +(element title ($lowtitle$ 2 4)) ;; the default TITLE format +(element titleabbrev (empty-sosofo)) +(element subtitle (empty-sosofo)) + +(mode title-mode + (element title + (process-children))) diff --git a/print/dbttlpg.dsl b/print/dbttlpg.dsl new file mode 100644 index 0000000..733f0f5 --- /dev/null +++ b/print/dbttlpg.dsl @@ -0,0 +1,6772 @@ +;; $Id: dbttlpg.dsl,v 1.13 2004/10/10 21:15:06 petere78 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://nwalsh.com/docbook/dsssl/ +;; + +(define (have-sibling? sibling-gi #!optional (node (current-node))) + (let loop ((nl (children (parent node)))) + (if (node-list-empty? nl) + #f + (if (equal? (gi (node-list-first nl)) sibling-gi) + #t + (loop (node-list-rest nl)))))) + +(define (titlepage-content? elements gis) + (let giloop ((gilist gis)) + (if (null? gilist) + #f + (if (not (node-list-empty? (node-list-filter-by-gi + elements + (list (car gilist))))) + #t + (giloop (cdr gilist)))))) + +(define (titlepage-gi-list-by-elements elements nodelist) + ;; Elements is a list of GIs. Nodelist is a list of nodes. + ;; This function returns all of the nodes in nodelist that + ;; are in elements in the order they occur in elements. + (let loop ((gilist elements) (rlist (empty-node-list))) + (if (null? gilist) + rlist + (loop (cdr gilist) + (node-list rlist (node-list-filter-by-gi + nodelist (list (car gilist)))))))) + +(define (titlepage-gi-list-by-nodelist elements nodelist) + ;; Elements is a list of GIs. Nodelist is a list of nodes. + ;; This function returns all of the nodes in nodelist that + ;; are in elements in the order they occur in nodelist. + (let loop ((nl nodelist) (rlist (empty-node-list))) + (if (node-list-empty? nl) + rlist + (if (member (gi (node-list-first nl)) elements) + (loop (node-list-rest nl) + (node-list rlist (node-list-first nl))) + (loop (node-list-rest nl) rlist))))) + +(define (titlepage-nodelist elements nodelist) + ;; We expand BOOKBIBLIO, BIBLIOMISC, and BIBLIOSET in the element + ;; list because that level of wrapper usually isn't significant. + (let ((exp-nodelist (expand-children nodelist (list (normalize "bookbiblio") + (normalize "bibliomisc") + (normalize "biblioset"))))) + (if %titlepage-in-info-order% + (titlepage-gi-list-by-nodelist elements exp-nodelist) + (titlepage-gi-list-by-elements elements exp-nodelist)))) + +(mode titlepage-address-mode + (default (process-children))) + +;; == Title pages for SETs ============================================== + +(define (set-titlepage-recto-elements) + (list (normalize "title") + (normalize "subtitle") + (normalize "graphic") + (normalize "mediaobject") + (normalize "corpauthor") + (normalize "authorgroup") + (normalize "author") + (normalize "editor"))) + +(define (set-titlepage-verso-elements) + (list (normalize "title") + (normalize "subtitle") + (normalize "corpauthor") + (normalize "authorgroup") + (normalize "author") + (normalize "editor") + (normalize "edition") + (normalize "pubdate") + (normalize "copyright") + (normalize "legalnotice") + (normalize "revhistory"))) + +(define (set-titlepage-content? elements side) + (titlepage-content? elements (if (equal? side 'recto) + (set-titlepage-recto-elements) + (set-titlepage-verso-elements)))) + +(define (set-titlepage elements #!optional (side 'recto)) + (let ((nodelist (titlepage-nodelist + (if (equal? side 'recto) + (set-titlepage-recto-elements) + (set-titlepage-verso-elements)) + elements))) +;; (make simple-page-sequence +;; page-n-columns: %titlepage-n-columns% +;; input-whitespace-treatment: 'collapse +;; use: default-text-style + (make sequence + + ;; This hack is required for the RTF backend. If an external-graphic + ;; is the first thing on the page, RTF doesn't seem to do the right + ;; thing (the graphic winds up on the baseline of the first line + ;; of the page, left justified). This "one point rule" fixes + ;; that problem. + (make paragraph + line-spacing: 1pt + (literal "")) + + (let loop ((nl nodelist) (lastnode (empty-node-list))) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (if (or (node-list-empty? lastnode) + (not (equal? (gi (node-list-first nl)) + (gi lastnode)))) + (set-titlepage-before (node-list-first nl) side) + (empty-sosofo)) + (cond + ((equal? (gi (node-list-first nl)) (normalize "abbrev")) + (set-titlepage-abbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "abstract")) + (set-titlepage-abstract (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "address")) + (set-titlepage-address (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "affiliation")) + (set-titlepage-affiliation (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "artpagenums")) + (set-titlepage-artpagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "author")) + (set-titlepage-author (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorblurb")) + (set-titlepage-authorblurb (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorgroup")) + (set-titlepage-authorgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorinitials")) + (set-titlepage-authorinitials (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bibliomisc")) + (set-titlepage-bibliomisc (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "biblioset")) + (set-titlepage-biblioset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bookbiblio")) + (set-titlepage-bookbiblio (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "citetitle")) + (set-titlepage-citetitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "collab")) + (set-titlepage-collab (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "confgroup")) + (set-titlepage-confgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractnum")) + (set-titlepage-contractnum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractsponsor")) + (set-titlepage-contractsponsor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contrib")) + (set-titlepage-contrib (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "copyright")) + (set-titlepage-copyright (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpauthor")) + (set-titlepage-corpauthor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpname")) + (set-titlepage-corpname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "date")) + (set-titlepage-date (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "edition")) + (set-titlepage-edition (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "editor")) + (set-titlepage-editor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "firstname")) + (set-titlepage-firstname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "graphic")) + (set-titlepage-graphic (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "honorific")) + (set-titlepage-honorific (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "indexterm")) + (set-titlepage-indexterm (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "invpartnumber")) + (set-titlepage-invpartnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "isbn")) + (set-titlepage-isbn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issn")) + (set-titlepage-issn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issuenum")) + (set-titlepage-issuenum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "itermset")) + (set-titlepage-itermset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "keywordset")) + (set-titlepage-keywordset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "legalnotice")) + (set-titlepage-legalnotice (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "lineage")) + (set-titlepage-lineage (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "mediaobject")) + (set-titlepage-mediaobject (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "modespec")) + (set-titlepage-modespec (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "orgname")) + (set-titlepage-orgname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othercredit")) + (set-titlepage-othercredit (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othername")) + (set-titlepage-othername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pagenums")) + (set-titlepage-pagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "printhistory")) + (set-titlepage-printhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productname")) + (set-titlepage-productname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productnumber")) + (set-titlepage-productnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubdate")) + (set-titlepage-pubdate (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publisher")) + (set-titlepage-publisher (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publishername")) + (set-titlepage-publishername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubsnumber")) + (set-titlepage-pubsnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "releaseinfo")) + (set-titlepage-releaseinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "revhistory")) + (set-titlepage-revhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesinfo")) + (set-titlepage-seriesinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesvolnums")) + (set-titlepage-seriesvolnums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subjectset")) + (set-titlepage-subjectset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subtitle")) + (set-titlepage-subtitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "surname")) + (set-titlepage-surname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "title")) + (set-titlepage-title (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "titleabbrev")) + (set-titlepage-titleabbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "volumenum")) + (set-titlepage-volumenum (node-list-first nl) side)) + (else + (set-titlepage-default (node-list-first nl) side))) + (loop (node-list-rest nl) (node-list-first nl)))))))) + +(define (set-titlepage-before node side) + (if (equal? side 'recto) + (cond + ((equal? (gi node) (normalize "corpauthor")) + (make paragraph + space-after: (* (HSIZE 5) %head-after-factor% 8) + (literal "\no-break-space;"))) + ((equal? (gi node) (normalize "authorgroup")) + (if (have-sibling? (normalize "corpauthor") node) + (empty-sosofo) + (make paragraph + space-after: (* (HSIZE 5) %head-after-factor% 8) + (literal "\no-break-space;")))) + ((equal? (gi node) (normalize "author")) + (if (or (have-sibling? (normalize "corpauthor") node) + (have-sibling? (normalize "authorgroup") node)) + (empty-sosofo) + (make paragraph + space-after: (* (HSIZE 5) %head-after-factor% 8) + (literal "\no-break-space;")))) + (else (empty-sosofo))) + (empty-sosofo))) + +(define (set-titlepage-default node side) + (let ((foo (debug (string-append "No set-titlepage-* for " (gi node) "!")))) + (empty-sosofo))) + +(define (set-titlepage-element node side) + (if (equal? side 'recto) + (with-mode set-titlepage-recto-mode + (process-node-list node)) + (with-mode set-titlepage-verso-mode + (process-node-list node)))) + +(define (set-titlepage-abbrev node side) + (set-titlepage-element node side)) +(define (set-titlepage-abstract node side) + (set-titlepage-element node side)) +(define (set-titlepage-address node side) + (set-titlepage-element node side)) +(define (set-titlepage-affiliation node side) + (set-titlepage-element node side)) +(define (set-titlepage-artpagenums node side) + (set-titlepage-element node side)) +(define (set-titlepage-author node side) + (set-titlepage-element node side)) +(define (set-titlepage-authorblurb node side) + (set-titlepage-element node side)) +(define (set-titlepage-authorgroup node side) + (set-titlepage-element node side)) +(define (set-titlepage-authorinitials node side) + (set-titlepage-element node side)) +(define (set-titlepage-bibliomisc node side) + (set-titlepage-element node side)) +(define (set-titlepage-biblioset node side) + (set-titlepage node side)) +(define (set-titlepage-bookbiblio node side) + (set-titlepage node side)) +(define (set-titlepage-citetitle node side) + (set-titlepage-element node side)) +(define (set-titlepage-collab node side) + (set-titlepage-element node side)) +(define (set-titlepage-confgroup node side) + (set-titlepage-element node side)) +(define (set-titlepage-contractnum node side) + (set-titlepage-element node side)) +(define (set-titlepage-contractsponsor node side) + (set-titlepage-element node side)) +(define (set-titlepage-contrib node side) + (set-titlepage-element node side)) +(define (set-titlepage-copyright node side) + (set-titlepage-element node side)) + +(define (set-titlepage-corpauthor node side) + (if (equal? side 'recto) + (set-titlepage-element node side) + (if (first-sibling? node) + (make paragraph + (with-mode set-titlepage-verso-mode + (process-node-list + (select-elements (children (parent node)) + (normalize "corpauthor"))))) + (empty-sosofo)))) + +(define (set-titlepage-corpname node side) + (set-titlepage-element node side)) +(define (set-titlepage-date node side) + (set-titlepage-element node side)) +(define (set-titlepage-edition node side) + (set-titlepage-element node side)) +(define (set-titlepage-editor node side) + (set-titlepage-element node side)) +(define (set-titlepage-firstname node side) + (set-titlepage-element node side)) +(define (set-titlepage-graphic node side) + (set-titlepage-element node side)) +(define (set-titlepage-honorific node side) + (set-titlepage-element node side)) +(define (set-titlepage-indexterm node side) + (set-titlepage-element node side)) +(define (set-titlepage-invpartnumber node side) + (set-titlepage-element node side)) +(define (set-titlepage-isbn node side) + (set-titlepage-element node side)) +(define (set-titlepage-issn node side) + (set-titlepage-element node side)) +(define (set-titlepage-issuenum node side) + (set-titlepage-element node side)) +(define (set-titlepage-itermset node side) + (set-titlepage-element node side)) +(define (set-titlepage-keywordset node side) + (set-titlepage-element node side)) +(define (set-titlepage-legalnotice node side) + (set-titlepage-element node side)) +(define (set-titlepage-lineage node side) + (set-titlepage-element node side)) +(define (set-titlepage-mediaobject node side) + (set-titlepage-element node side)) +(define (set-titlepage-modespec node side) + (set-titlepage-element node side)) +(define (set-titlepage-orgname node side) + (set-titlepage-element node side)) +(define (set-titlepage-othercredit node side) + (set-titlepage-element node side)) +(define (set-titlepage-othername node side) + (set-titlepage-element node side)) +(define (set-titlepage-pagenums node side) + (set-titlepage-element node side)) +(define (set-titlepage-printhistory node side) + (set-titlepage-element node side)) +(define (set-titlepage-productname node side) + (set-titlepage-element node side)) +(define (set-titlepage-productnumber node side) + (set-titlepage-element node side)) +(define (set-titlepage-pubdate node side) + (set-titlepage-element node side)) +(define (set-titlepage-publisher node side) + (set-titlepage-element node side)) +(define (set-titlepage-publishername node side) + (set-titlepage-element node side)) +(define (set-titlepage-pubsnumber node side) + (set-titlepage-element node side)) +(define (set-titlepage-releaseinfo node side) + (set-titlepage-element node side)) +(define (set-titlepage-revhistory node side) + (set-titlepage-element node side)) +(define (set-titlepage-seriesinfo node side) + (set-titlepage-element node side)) +(define (set-titlepage-seriesvolnums node side) + (set-titlepage-element node side)) +(define (set-titlepage-subjectset node side) + (set-titlepage-element node side)) +(define (set-titlepage-subtitle node side) + (set-titlepage-element node side)) +(define (set-titlepage-surname node side) + (set-titlepage-element node side)) +(define (set-titlepage-title node side) + (set-titlepage-element node side)) +(define (set-titlepage-titleabbrev node side) + (set-titlepage-element node side)) +(define (set-titlepage-volumenum node side) + (set-titlepage-element node side)) + +(define set-titlepage-recto-style + (style + font-family-name: %title-font-family% + font-weight: 'bold + font-size: (HSIZE 1))) + +(define set-titlepage-verso-style + (style + font-family-name: %body-font-family%)) + +(mode set-titlepage-recto-mode + (element abbrev + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element abstract + (make display-group + use: set-titlepage-recto-style + quadding: 'start + ($semiformal-object$))) + + (element (abstract title) (empty-sosofo)) + + (element (abstract para) + (make paragraph + use: set-titlepage-recto-style + quadding: 'start + (process-children))) + + (element address + (make display-group + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element affiliation + (make display-group + use: set-titlepage-recto-style + (process-children))) + + (element artpagenums + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element author + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make paragraph + use: set-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor%) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal author-name)) + (process-node-list author-affil)))) + + (element authorblurb + (make display-group + use: set-titlepage-recto-style + quadding: 'start + (process-children))) + + (element (authorblurb para) + (make paragraph + use: set-titlepage-recto-style + quadding: 'start + (process-children))) + + (element authorgroup + (make display-group + (process-children))) + + (element authorinitials + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element bibliomisc (process-children)) + + (element bibliomset (process-children)) + + (element collab + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element confgroup + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element contractnum + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element contractsponsor + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element contrib + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element copyright + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + space-before: (* (HSIZE 2) %head-before-factor%) + (literal (gentext-element-name (current-node))) + (literal "\no-break-space;") + (literal (dingbat "copyright")) + (literal "\no-break-space;") + (process-children))) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (literal " ")))) + + (element (copyright holder) ($charseq$)) + + (element corpauthor + (make sequence + (make paragraph + use: set-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor%) + quadding: %division-title-quadding% + keep-with-next?: #t + (process-children)) + ;; This paragraph is a hack to get the spacing right. + ;; Authors always have an affiliation paragraph below them, even if + ;; it's empty, so corpauthors need one too. + (make paragraph + use: set-titlepage-recto-style + font-size: (HSIZE 1) + line-spacing: (* (HSIZE 1) %line-spacing-factor%) + space-after: (* (HSIZE 2) %head-after-factor% 4) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal "\no-break-space;")))) + + (element corpname + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element date + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element edition + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children) + (literal "\no-break-space;") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + (let ((editor-name (author-string))) + (make sequence + (if (first-sibling?) + (make paragraph + use: set-titlepage-recto-style + font-size: (HSIZE 1) + line-spacing: (* (HSIZE 1) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor% 6) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal (gentext-edited-by))) + (empty-sosofo)) + (make paragraph + use: set-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-after: (* (HSIZE 2) %head-after-factor% 4) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal editor-name))))) + + (element firstname + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element graphic + (let* ((nd (current-node)) + (fileref (attribute-string "fileref" nd)) + (entityref (attribute-string "entityref" nd)) + (format (attribute-string "format" nd)) + (align (attribute-string "align" nd))) + (if (or fileref entityref) + (make external-graphic + notation-system-id: (if format format "") + entity-system-id: (if fileref + (graphic-file fileref) + (if entityref + (entity-generated-system-id entityref) + "")) + display?: #t + display-alignment: 'center) + (empty-sosofo)))) + + (element honorific + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element isbn + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element issn + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element itermset (empty-sosofo)) + + (element invpartnumber + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element issuenum + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element jobtitle + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element keywordset + (make paragraph + quadding: 'start + (make sequence + font-weight: 'bold + (literal "Keywords: ")) + (process-children))) + + (element (keyword) + (make sequence + (process-children) + (if (not (last-sibling?)) + (literal ", ") + (literal "")))) + + (element legalnotice + (make display-group + use: set-titlepage-recto-style + ($semiformal-object$))) + + (element (legalnotice title) (empty-sosofo)) + + (element (legalnotice para) + (make paragraph + use: set-titlepage-recto-style + quadding: 'start + line-spacing: (* 0.8 (inherited-line-spacing)) + font-size: (* 0.8 (inherited-font-size)) + (process-children))) + + (element lineage + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element modespec (empty-sosofo)) + + (element orgdiv + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element orgname + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element othercredit + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make paragraph + use: set-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor%) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal author-name)) + (process-node-list author-affil)))) + + (element othername + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element pagenums + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element printhistory + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element productname + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element productnumber + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element pubdate + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element publisher + (make display-group + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element publishername + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element pubsnumber + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element releaseinfo + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element revhistory + (make sequence + (make paragraph + use: set-titlepage-recto-style + space-before: (* (HSIZE 3) %head-before-factor%) + space-after: (/ (* (HSIZE 1) %head-before-factor%) 2) + (literal (gentext-element-name (current-node)))) + (make table + before-row-border: #f + (process-children)))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark"))) + (revdescription (select-elements (descendants (current-node)) + (normalize "revdescription")))) + (make sequence + (make table-row + (make table-cell + column-number: 1 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + (if (not (node-list-empty? revnumber)) + (make paragraph + use: set-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-element-name-space (current-node))) + (process-node-list revnumber)) + (empty-sosofo))) + (make table-cell + column-number: 2 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (not (node-list-empty? revdate)) + (make paragraph + use: set-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revdate)) + (empty-sosofo))) + (make table-cell + column-number: 3 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (not (node-list-empty? revauthor)) + (make paragraph + use: set-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make table-row + cell-after-row-border: #f + (make table-cell + column-number: 1 + n-columns-spanned: 3 + n-rows-spanned: 1 + start-indent: 0pt + (cond ((not (node-list-empty? revremark)) + (make paragraph + use: set-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + space-after: (if (last-sibling?) + 0pt + (/ %block-sep% 2)) + (process-node-list revremark))) + ((not (node-list-empty? revdescription)) + (make sequence + use: set-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revdescription))) + (else (empty-sosofo)))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + (element (revision revdescription) (process-children)) + + (element seriesvolnums + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element shortaffil + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element subjectset (empty-sosofo)) + + (element subtitle + (make paragraph + use: set-titlepage-recto-style + font-size: (HSIZE 4) + line-spacing: (* (HSIZE 4) %line-spacing-factor%) + space-before: (* (HSIZE 4) %head-before-factor%) + quadding: %division-subtitle-quadding% + keep-with-next?: #t + (process-children-trim))) + + (element surname + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element title + (make paragraph + use: set-titlepage-recto-style + font-size: (HSIZE 5) + line-spacing: (* (HSIZE 5) %line-spacing-factor%) + space-before: (* (HSIZE 5) %head-before-factor%) + quadding: %division-title-quadding% + keep-with-next?: #t + heading-level: (if %generate-heading-level% 1 0) + (with-mode title-mode + (process-children-trim)))) + + (element formalpara ($para-container$)) + (element (formalpara title) ($runinhead$)) + (element (formalpara para) (make sequence (process-children))) + + (element titleabbrev (empty-sosofo)) + + (element volumenum + (make paragraph + use: set-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) +) + +(mode set-titlepage-verso-mode + (element abbrev + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element abstract ($semiformal-object$)) + + (element (abstract title) (empty-sosofo)) + + (element address + (make display-group + use: set-titlepage-verso-style + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element affiliation + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element artpagenums + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element author + ;; Print the author name. Handle the case where there's no AUTHORGROUP + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (not in-group) + (make paragraph + ;; Hack to get the spacing right below the author name line... + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-by)) + (literal "\no-break-space;") + (literal (author-list-string)))) + (make sequence + (literal (author-list-string)))))) + + (element authorblurb + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element authorgroup + (make paragraph + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-by)) + (literal "\no-break-space;") + (process-children-trim)))) + + (element authorinitials + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element bibliomisc (process-children)) + + (element bibliomset (process-children)) + + (element collab + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element confgroup + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element contractnum + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element contractsponsor + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element contrib + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element copyright + (make paragraph + use: set-titlepage-verso-style + (literal (gentext-element-name (current-node))) + (literal "\no-break-space;") + (literal (dingbat "copyright")) + (literal "\no-break-space;") + (process-children))) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (literal " ")))) + + (element (copyright holder) ($charseq$)) + + (element corpauthor + ;; note: set-titlepage-corpauthor takes care of wrapping multiple + ;; corpauthors + (make sequence + (if (first-sibling?) + (if (equal? (gi (parent (current-node))) (normalize "authorgroup")) + (empty-sosofo) + (literal (gentext-by) " ")) + (literal ", ")) + (process-children))) + + (element corpname + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element date + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element edition + (make paragraph + (process-children) + (literal "\no-break-space;") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + ;; Print the editor name. + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (or #t (not in-group)) ; nevermind, always put out the Edited by + (make paragraph + ;; Hack to get the spacing right below the author name line... + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-edited-by)) + (literal "\no-break-space;") + (literal (author-string)))) + (make sequence + (literal (author-string)))))) + + (element firstname + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element graphic + (let* ((nd (current-node)) + (fileref (attribute-string "fileref" nd)) + (entityref (attribute-string "entityref" nd)) + (format (attribute-string "format" nd)) + (align (attribute-string "align" nd))) + (if (or fileref entityref) + (make external-graphic + notation-system-id: (if format format "") + entity-system-id: (if fileref + (graphic-file fileref) + (if entityref + (entity-generated-system-id entityref) + "")) + display?: #t + display-alignment: 'start) + (empty-sosofo)))) + + (element honorific + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element isbn + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element issn + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element itermset (empty-sosofo)) + + (element invpartnumber + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element issuenum + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element jobtitle + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element keywordset + (make paragraph + quadding: 'start + (make sequence + font-weight: 'bold + (literal "Keywords: ")) + (process-children))) + + (element (keyword) + (make sequence + (process-children) + (if (not (last-sibling?)) + (literal ", ") + (literal "")))) + + (element legalnotice + (make display-group + use: set-titlepage-verso-style + ($semiformal-object$))) + + (element (legalnotice title) (empty-sosofo)) + + (element (legalnotice para) + (make paragraph + use: set-titlepage-verso-style + font-size: (* (inherited-font-size) 0.8) + (process-children-trim))) + + (element lineage + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element modespec (empty-sosofo)) + + (element orgdiv + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element orgname + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element othercredit + ;; Print the author name. Handle the case where there's no AUTHORGROUP + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (not in-group) + (make paragraph + ;; Hack to get the spacing right below the author name line... + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-by)) + (literal "\no-break-space;") + (literal (author-list-string)))) + (make sequence + (literal (author-list-string)))))) + + (element othername + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element pagenums + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element printhistory + (make display-group + use: set-titlepage-verso-style + (process-children))) + + (element productname + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element productnumber + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element pubdate + (make paragraph + (literal (gentext-element-name-space (gi (current-node)))) + (process-children))) + + (element publisher + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element publishername + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element pubsnumber + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element releaseinfo + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element revhistory + (make sequence + (make paragraph + use: set-titlepage-verso-style + space-before: (* (HSIZE 3) %head-before-factor%) + space-after: (/ (* (HSIZE 1) %head-before-factor%) 2) + (literal (gentext-element-name (current-node)))) + (make table + before-row-border: #f + (process-children)))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark"))) + (revdescription (select-elements (descendants (current-node)) + (normalize "revdescription")))) + (make sequence + (make table-row + (make table-cell + column-number: 1 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + (if (not (node-list-empty? revnumber)) + (make paragraph + use: set-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-element-name-space (current-node))) + (process-node-list revnumber)) + (empty-sosofo))) + (make table-cell + column-number: 2 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (not (node-list-empty? revdate)) + (make paragraph + use: set-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revdate)) + (empty-sosofo))) + (make table-cell + column-number: 3 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (not (node-list-empty? revauthor)) + (make paragraph + use: set-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make table-row + cell-after-row-border: #f + (make table-cell + column-number: 1 + n-columns-spanned: 3 + n-rows-spanned: 1 + start-indent: 0pt + (cond ((not (node-list-empty? revremark)) + (make paragraph + use: set-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + space-after: (if (last-sibling?) + 0pt + (/ %block-sep% 2)) + ;(process-node-list revremark))) + (empty-sosofo))) + ((not (node-list-empty? revdescription)) + (make sequence + use: set-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revdescription))) + (else (empty-sosofo)))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + (element (revision revdescription) (process-children)) + + (element seriesvolnums + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element shortaffil + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element subjectset (empty-sosofo)) + + (element subtitle + (make sequence + font-family-name: %title-font-family% + font-weight: 'bold + (literal (if (first-sibling?) ": " "; ")) + (process-children))) + + (element surname + (make paragraph + use: set-titlepage-verso-style + (process-children))) + + (element title + (make sequence + font-family-name: %title-font-family% + font-weight: 'bold + (with-mode title-mode + (process-children)))) + + (element formalpara ($para-container$)) + (element (formalpara title) ($runinhead$)) + (element (formalpara para) (make sequence (process-children))) + + (element titleabbrev (empty-sosofo)) + + (element volumenum + (make paragraph + use: set-titlepage-verso-style + (process-children))) + +) + +;; == Title pages for BOOKs ============================================= + +(define (book-titlepage-recto-elements) + (list (normalize "title") + (normalize "subtitle") + (normalize "graphic") + (normalize "mediaobject") + (normalize "corpauthor") + (normalize "authorgroup") + (normalize "author") + (normalize "editor"))) + +(define (book-titlepage-verso-elements) + (list (normalize "title") + (normalize "subtitle") + (normalize "corpauthor") + (normalize "authorgroup") + (normalize "author") + (normalize "editor") + (normalize "edition") + (normalize "pubdate") + (normalize "copyright") + (normalize "abstract") + (normalize "legalnotice") + (normalize "revhistory"))) + +(define (book-titlepage-content? elements side) + (titlepage-content? elements (if (equal? side 'recto) + (book-titlepage-recto-elements) + (book-titlepage-verso-elements)))) + +(define (book-titlepage elements #!optional (side 'recto)) + (let ((nodelist (titlepage-nodelist + (if (equal? side 'recto) + (book-titlepage-recto-elements) + (book-titlepage-verso-elements)) + elements))) +;; (make simple-page-sequence +;; page-n-columns: %titlepage-n-columns% +;; input-whitespace-treatment: 'collapse +;; use: default-text-style + (make sequence + + ;; This hack is required for the RTF backend. If an external-graphic + ;; is the first thing on the page, RTF doesn't seem to do the right + ;; thing (the graphic winds up on the baseline of the first line + ;; of the page, left justified). This "one point rule" fixes + ;; that problem. + (make paragraph + line-spacing: 1pt + (literal "")) + + (let loop ((nl nodelist) (lastnode (empty-node-list))) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (if (or (node-list-empty? lastnode) + (not (equal? (gi (node-list-first nl)) + (gi lastnode)))) + (book-titlepage-before (node-list-first nl) side) + (empty-sosofo)) + (cond + ((equal? (gi (node-list-first nl)) (normalize "abbrev")) + (book-titlepage-abbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "abstract")) + (book-titlepage-abstract (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "address")) + (book-titlepage-address (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "affiliation")) + (book-titlepage-affiliation (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "artpagenums")) + (book-titlepage-artpagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "author")) + (book-titlepage-author (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorblurb")) + (book-titlepage-authorblurb (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorgroup")) + (book-titlepage-authorgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorinitials")) + (book-titlepage-authorinitials (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bibliomisc")) + (book-titlepage-bibliomisc (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "biblioset")) + (book-titlepage-biblioset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bookbiblio")) + (book-titlepage-bookbiblio (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "citetitle")) + (book-titlepage-citetitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "collab")) + (book-titlepage-collab (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "confgroup")) + (book-titlepage-confgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractnum")) + (book-titlepage-contractnum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractsponsor")) + (book-titlepage-contractsponsor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contrib")) + (book-titlepage-contrib (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "copyright")) + (book-titlepage-copyright (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpauthor")) + (book-titlepage-corpauthor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpname")) + (book-titlepage-corpname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "date")) + (book-titlepage-date (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "edition")) + (book-titlepage-edition (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "editor")) + (book-titlepage-editor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "firstname")) + (book-titlepage-firstname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "graphic")) + (book-titlepage-graphic (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "honorific")) + (book-titlepage-honorific (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "indexterm")) + (book-titlepage-indexterm (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "invpartnumber")) + (book-titlepage-invpartnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "isbn")) + (book-titlepage-isbn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issn")) + (book-titlepage-issn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issuenum")) + (book-titlepage-issuenum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "itermset")) + (book-titlepage-itermset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "keywordset")) + (book-titlepage-keywordset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "legalnotice")) + (book-titlepage-legalnotice (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "lineage")) + (book-titlepage-lineage (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "mediaobject")) + (book-titlepage-mediaobject (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "modespec")) + (book-titlepage-modespec (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "orgname")) + (book-titlepage-orgname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othercredit")) + (book-titlepage-othercredit (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othername")) + (book-titlepage-othername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pagenums")) + (book-titlepage-pagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "printhistory")) + (book-titlepage-printhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productname")) + (book-titlepage-productname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productnumber")) + (book-titlepage-productnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubdate")) + (book-titlepage-pubdate (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publisher")) + (book-titlepage-publisher (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publishername")) + (book-titlepage-publishername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubsnumber")) + (book-titlepage-pubsnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "releaseinfo")) + (book-titlepage-releaseinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "revhistory")) + (book-titlepage-revhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesinfo")) + (book-titlepage-seriesinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesvolnums")) + (book-titlepage-seriesvolnums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subjectset")) + (book-titlepage-subjectset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subtitle")) + (book-titlepage-subtitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "surname")) + (book-titlepage-surname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "title")) + (book-titlepage-title (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "titleabbrev")) + (book-titlepage-titleabbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "volumenum")) + (book-titlepage-volumenum (node-list-first nl) side)) + (else + (book-titlepage-default (node-list-first nl) side))) + (loop (node-list-rest nl) (node-list-first nl)))))))) + +(define (book-titlepage-before node side) + (if (equal? side 'recto) + (cond + ((equal? (gi node) (normalize "corpauthor")) + (make paragraph + space-after: (* (HSIZE 5) %head-after-factor% 8) + (literal "\no-break-space;"))) + ((equal? (gi node) (normalize "authorgroup")) + (if (have-sibling? (normalize "corpauthor") node) + (empty-sosofo) + (make paragraph + space-after: (* (HSIZE 5) %head-after-factor% 8) + (literal "\no-break-space;")))) + ((equal? (gi node) (normalize "author")) + (if (or (have-sibling? (normalize "corpauthor") node) + (have-sibling? (normalize "authorgroup") node)) + (empty-sosofo) + (make paragraph + space-after: (* (HSIZE 5) %head-after-factor% 8) + (literal "\no-break-space;")))) + (else (empty-sosofo))) + (empty-sosofo))) + +(define (book-titlepage-default node side) + (let ((foo (debug (string-append "No book-titlepage-* for " (gi node) "!")))) + (empty-sosofo))) + +(define (book-titlepage-element node side) + (if (equal? side 'recto) + (with-mode book-titlepage-recto-mode + (process-node-list node)) + (with-mode book-titlepage-verso-mode + (process-node-list node)))) + +(define (book-titlepage-abbrev node side) + (book-titlepage-element node side)) +(define (book-titlepage-abstract node side) + (book-titlepage-element node side)) +(define (book-titlepage-address node side) + (book-titlepage-element node side)) +(define (book-titlepage-affiliation node side) + (book-titlepage-element node side)) +(define (book-titlepage-artpagenums node side) + (book-titlepage-element node side)) +(define (book-titlepage-author node side) + (book-titlepage-element node side)) +(define (book-titlepage-authorblurb node side) + (book-titlepage-element node side)) +(define (book-titlepage-authorgroup node side) + (book-titlepage-element node side)) +(define (book-titlepage-authorinitials node side) + (book-titlepage-element node side)) +(define (book-titlepage-bibliomisc node side) + (book-titlepage-element node side)) +(define (book-titlepage-biblioset node side) + (book-titlepage node side)) +(define (book-titlepage-bookbiblio node side) + (book-titlepage node side)) +(define (book-titlepage-citetitle node side) + (book-titlepage-element node side)) +(define (book-titlepage-collab node side) + (book-titlepage-element node side)) +(define (book-titlepage-confgroup node side) + (book-titlepage-element node side)) +(define (book-titlepage-contractnum node side) + (book-titlepage-element node side)) +(define (book-titlepage-contractsponsor node side) + (book-titlepage-element node side)) +(define (book-titlepage-contrib node side) + (book-titlepage-element node side)) +(define (book-titlepage-copyright node side) + (book-titlepage-element node side)) + +(define (book-titlepage-corpauthor node side) + (if (equal? side 'recto) + (book-titlepage-element node side) + (if (first-sibling? node) + (make paragraph + (with-mode book-titlepage-verso-mode + (process-node-list + (select-elements (children (parent node)) + (normalize "corpauthor"))))) + (empty-sosofo)))) + +(define (book-titlepage-corpname node side) + (book-titlepage-element node side)) +(define (book-titlepage-date node side) + (book-titlepage-element node side)) +(define (book-titlepage-edition node side) + (book-titlepage-element node side)) +(define (book-titlepage-editor node side) + (book-titlepage-element node side)) +(define (book-titlepage-firstname node side) + (book-titlepage-element node side)) +(define (book-titlepage-graphic node side) + (book-titlepage-element node side)) +(define (book-titlepage-honorific node side) + (book-titlepage-element node side)) +(define (book-titlepage-indexterm node side) + (book-titlepage-element node side)) +(define (book-titlepage-invpartnumber node side) + (book-titlepage-element node side)) +(define (book-titlepage-isbn node side) + (book-titlepage-element node side)) +(define (book-titlepage-issn node side) + (book-titlepage-element node side)) +(define (book-titlepage-issuenum node side) + (book-titlepage-element node side)) +(define (book-titlepage-itermset node side) + (book-titlepage-element node side)) +(define (book-titlepage-keywordset node side) + (book-titlepage-element node side)) +(define (book-titlepage-legalnotice node side) + (book-titlepage-element node side)) +(define (book-titlepage-lineage node side) + (book-titlepage-element node side)) +(define (book-titlepage-mediaobject node side) + (book-titlepage-element node side)) +(define (book-titlepage-modespec node side) + (book-titlepage-element node side)) +(define (book-titlepage-orgname node side) + (book-titlepage-element node side)) +(define (book-titlepage-othercredit node side) + (book-titlepage-element node side)) +(define (book-titlepage-othername node side) + (book-titlepage-element node side)) +(define (book-titlepage-pagenums node side) + (book-titlepage-element node side)) +(define (book-titlepage-printhistory node side) + (book-titlepage-element node side)) +(define (book-titlepage-productname node side) + (book-titlepage-element node side)) +(define (book-titlepage-productnumber node side) + (book-titlepage-element node side)) +(define (book-titlepage-pubdate node side) + (book-titlepage-element node side)) +(define (book-titlepage-publisher node side) + (book-titlepage-element node side)) +(define (book-titlepage-publishername node side) + (book-titlepage-element node side)) +(define (book-titlepage-pubsnumber node side) + (book-titlepage-element node side)) +(define (book-titlepage-releaseinfo node side) + (book-titlepage-element node side)) +(define (book-titlepage-revhistory node side) + (book-titlepage-element node side)) +(define (book-titlepage-seriesinfo node side) + (book-titlepage-element node side)) +(define (book-titlepage-seriesvolnums node side) + (book-titlepage-element node side)) +(define (book-titlepage-subjectset node side) + (book-titlepage-element node side)) +(define (book-titlepage-subtitle node side) + (book-titlepage-element node side)) +(define (book-titlepage-surname node side) + (book-titlepage-element node side)) +(define (book-titlepage-title node side) + (book-titlepage-element node side)) +(define (book-titlepage-titleabbrev node side) + (book-titlepage-element node side)) +(define (book-titlepage-volumenum node side) + (book-titlepage-element node side)) + +(define book-titlepage-recto-style + (style + font-family-name: %title-font-family% + font-weight: 'bold + font-size: (HSIZE 1))) + +(define book-titlepage-verso-style + (style + font-family-name: %body-font-family%)) + +(mode book-titlepage-recto-mode + (element abbrev + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element abstract + (make display-group + use: book-titlepage-recto-style + quadding: 'start + ($semiformal-object$))) + + (element (abstract title) (empty-sosofo)) + + (element (abstract para) + (make paragraph + use: book-titlepage-recto-style + quadding: 'start + (process-children))) + + (element address + (make display-group + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element affiliation + (make display-group + use: book-titlepage-recto-style + (process-children))) + + (element artpagenums + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element author + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make paragraph + use: book-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor%) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal author-name)) + (process-node-list author-affil)))) + + (element authorblurb + (make display-group + use: book-titlepage-recto-style + quadding: 'start + (process-children))) + + (element (authorblurb para) + (make paragraph + use: book-titlepage-recto-style + quadding: 'start + (process-children))) + + (element authorgroup + (make display-group + (process-children))) + + (element authorinitials + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element bibliomisc (process-children)) + + (element bibliomset (process-children)) + + (element collab + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element confgroup + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element contractnum + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element contractsponsor + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element contrib + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element copyright + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + space-before: (* (HSIZE 2) %head-before-factor%) + (literal (gentext-element-name (current-node))) + (literal "\no-break-space;") + (literal (dingbat "copyright")) + (literal "\no-break-space;") + (process-children))) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (literal " ")))) + + (element (copyright holder) ($charseq$)) + + (element corpauthor + (make sequence + (make paragraph + use: book-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor%) + quadding: %division-title-quadding% + keep-with-next?: #t + (process-children)) + ;; This paragraph is a hack to get the spacing right. + ;; Authors always have an affiliation paragraph below them, even if + ;; it's empty, so corpauthors need one too. + (make paragraph + use: book-titlepage-recto-style + font-size: (HSIZE 1) + line-spacing: (* (HSIZE 1) %line-spacing-factor%) + space-after: (* (HSIZE 2) %head-after-factor% 4) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal "\no-break-space;")))) + + (element corpname + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element date + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element edition + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children) + (literal "\no-break-space;") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + (let ((editor-name (author-string))) + (make sequence + (if (first-sibling?) + (make paragraph + use: book-titlepage-recto-style + font-size: (HSIZE 1) + line-spacing: (* (HSIZE 1) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor% 6) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal (gentext-edited-by))) + (empty-sosofo)) + (make paragraph + use: book-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-after: (* (HSIZE 2) %head-after-factor% 4) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal editor-name))))) + + (element firstname + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element graphic + (let* ((nd (current-node)) + (fileref (attribute-string "fileref" nd)) + (entityref (attribute-string "entityref" nd)) + (format (attribute-string "format" nd)) + (align (attribute-string "align" nd))) + (if (or fileref entityref) + (make external-graphic + notation-system-id: (if format format "") + entity-system-id: (if fileref + (graphic-file fileref) + (if entityref + (entity-generated-system-id entityref) + "")) + display?: #t + display-alignment: 'center) + (empty-sosofo)))) + + (element honorific + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element isbn + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element issn + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element itermset (empty-sosofo)) + + (element invpartnumber + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element issuenum + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element jobtitle + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element keywordset + (make paragraph + quadding: 'start + (make sequence + font-weight: 'bold + (literal "Keywords: ")) + (process-children))) + + (element (keyword) + (make sequence + (process-children) + (if (not (last-sibling?)) + (literal ", ") + (literal "")))) + + (element legalnotice + (make display-group + use: book-titlepage-recto-style + ($semiformal-object$))) + + (element (legalnotice title) (empty-sosofo)) + + (element (legalnotice para) + (make paragraph + use: book-titlepage-recto-style + quadding: 'start + line-spacing: (* 0.8 (inherited-line-spacing)) + font-size: (* 0.8 (inherited-font-size)) + (process-children))) + + (element lineage + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element modespec (empty-sosofo)) + + (element orgdiv + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element orgname + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element othercredit + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make paragraph + use: book-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor%) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal author-name)) + (process-node-list author-affil)))) + + (element othername + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element pagenums + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element printhistory + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element productname + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element productnumber + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element pubdate + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element publisher + (make display-group + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element publishername + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element pubsnumber + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element releaseinfo + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element revhistory + (make sequence + (make paragraph + use: book-titlepage-recto-style + space-before: (* (HSIZE 3) %head-before-factor%) + space-after: (/ (* (HSIZE 1) %head-before-factor%) 2) + (literal (gentext-element-name (current-node)))) + (make table + before-row-border: #f + (process-children)))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark"))) + (revdescription (select-elements (descendants (current-node)) + (normalize "revdescription")))) + (make sequence + (make table-row + (make table-cell + column-number: 1 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + (if (not (node-list-empty? revnumber)) + (make paragraph + use: book-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-element-name-space (current-node))) + (process-node-list revnumber)) + (empty-sosofo))) + (make table-cell + column-number: 2 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (not (node-list-empty? revdate)) + (make paragraph + use: book-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revdate)) + (empty-sosofo))) + (make table-cell + column-number: 3 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (not (node-list-empty? revauthor)) + (make paragraph + use: book-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make table-row + cell-after-row-border: #f + (make table-cell + column-number: 1 + n-columns-spanned: 3 + n-rows-spanned: 1 + start-indent: 0pt + (cond ((not (node-list-empty? revremark)) + (make paragraph + use: book-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + space-after: (if (last-sibling?) + 0pt + (/ %block-sep% 2)) + (process-node-list revremark))) + ((not (node-list-empty? revdescription)) + (make sequence + use: book-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revremark))) + (else (empty-sosofo)))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + (element (revision revdescription) (process-children)) + + (element seriesvolnums + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element shortaffil + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element subjectset (empty-sosofo)) + + (element subtitle + (make paragraph + use: book-titlepage-recto-style + font-size: (HSIZE 4) + line-spacing: (* (HSIZE 4) %line-spacing-factor%) + space-before: (* (HSIZE 4) %head-before-factor%) + quadding: %division-subtitle-quadding% + keep-with-next?: #t + (process-children-trim))) + + (element surname + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element title + (make paragraph + use: book-titlepage-recto-style + font-size: (HSIZE 5) + line-spacing: (* (HSIZE 5) %line-spacing-factor%) + space-before: (* (HSIZE 5) %head-before-factor%) + quadding: %division-title-quadding% + keep-with-next?: #t + heading-level: (if %generate-heading-level% 1 0) + (with-mode title-mode + (process-children-trim)))) + + (element formalpara ($para-container$)) + (element (formalpara title) ($runinhead$)) + (element (formalpara para) (make sequence (process-children))) + + (element titleabbrev (empty-sosofo)) + + (element volumenum + (make paragraph + use: book-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) +) + +(mode book-titlepage-verso-mode + (element abbrev + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element abstract ($semiformal-object$)) + + (element (abstract title) (empty-sosofo)) + + (element address + (make display-group + use: book-titlepage-verso-style + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element affiliation + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element artpagenums + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element author + ;; Print the author name. Handle the case where there's no AUTHORGROUP + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (not in-group) + (make paragraph + ;; Hack to get the spacing right below the author name line... + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-by)) + (literal "\no-break-space;") + (literal (author-list-string)))) + (make sequence + (literal (author-list-string)))))) + + (element authorblurb + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element authorgroup + (let* ((editors (select-elements (children (current-node)) (normalize "editor")))) + (make paragraph + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (if (node-list-empty? editors) + (literal (gentext-by)) + (literal (gentext-edited-by))) + (literal "\no-break-space;") + (process-children-trim))))) + + (element authorinitials + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element bibliomisc (process-children)) + + (element bibliomset (process-children)) + + (element collab + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element confgroup + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element contractnum + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element contractsponsor + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element contrib + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element copyright + (make paragraph + use: book-titlepage-verso-style + (literal (gentext-element-name (current-node))) + (literal "\no-break-space;") + (literal (dingbat "copyright")) + (literal "\no-break-space;") + (process-children))) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (literal " ")))) + + (element (copyright holder) ($charseq$)) + + (element corpauthor + ;; note: book-titlepage-corpauthor takes care of wrapping multiple + ;; corpauthors + (make sequence + (if (first-sibling?) + (if (equal? (gi (parent (current-node))) (normalize "authorgroup")) + (empty-sosofo) + (literal (gentext-by) " ")) + (literal ", ")) + (process-children))) + + (element corpname + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element date + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element edition + (make paragraph + (process-children) + (literal "\no-break-space;") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + ;; Print the editor name. + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (or #f (not in-group)) ; nevermind, always put out the Edited by + (make paragraph + ;; Hack to get the spacing right below the author name line... + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-edited-by)) + (literal "\no-break-space;") + (literal (author-string)))) + (make sequence + (literal (author-list-string)))))) + + (element firstname + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element graphic + (let* ((nd (current-node)) + (fileref (attribute-string "fileref" nd)) + (entityref (attribute-string "entityref" nd)) + (format (attribute-string "format" nd)) + (align (attribute-string "align" nd))) + (if (or fileref entityref) + (make external-graphic + notation-system-id: (if format format "") + entity-system-id: (if fileref + (graphic-file fileref) + (if entityref + (entity-generated-system-id entityref) + "")) + display?: #t + display-alignment: 'start) + (empty-sosofo)))) + + (element honorific + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element isbn + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element issn + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element itermset (empty-sosofo)) + + (element invpartnumber + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element issuenum + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element jobtitle + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element keywordset + (make paragraph + quadding: 'start + (make sequence + font-weight: 'bold + (literal "Keywords: ")) + (process-children))) + + (element (keyword) + (make sequence + (process-children) + (if (not (last-sibling?)) + (literal ", ") + (literal "")))) + + (element legalnotice + (make display-group + use: book-titlepage-verso-style + ($semiformal-object$))) + + (element (legalnotice title) (empty-sosofo)) + + (element (legalnotice para) + (make paragraph + use: book-titlepage-verso-style + font-size: (* (inherited-font-size) 0.8) + (process-children-trim))) + + (element lineage + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element modespec (empty-sosofo)) + + (element orgdiv + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element orgname + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element othercredit + ;; Print the author name. Handle the case where there's no AUTHORGROUP + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (not in-group) + (make paragraph + ;; Hack to get the spacing right below the author name line... + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-by)) + (literal "\no-break-space;") + (literal (author-list-string)))) + (make sequence + (literal (author-list-string)))))) + + (element othername + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element pagenums + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element printhistory + (make display-group + use: book-titlepage-verso-style + (process-children))) + + (element productname + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element productnumber + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element pubdate + (make paragraph + (literal (gentext-element-name-space (gi (current-node)))) + (process-children))) + + (element publisher + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element publishername + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element pubsnumber + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element releaseinfo + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element revhistory + (make sequence + (make paragraph + use: book-titlepage-verso-style + space-before: (* (HSIZE 3) %head-before-factor%) + space-after: (/ (* (HSIZE 1) %head-before-factor%) 2) + (literal (gentext-element-name (current-node)))) + (make table + before-row-border: #f + (process-children)))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark"))) + (revdescription (select-elements (descendants (current-node)) + (normalize "revdescription")))) + (make sequence + (make table-row + (make table-cell + column-number: 1 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + (if (not (node-list-empty? revnumber)) + (make paragraph + use: book-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-element-name-space (current-node))) + (process-node-list revnumber)) + (empty-sosofo))) + (make table-cell + column-number: 2 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (not (node-list-empty? revdate)) + (make paragraph + use: book-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revdate)) + (empty-sosofo))) + (make table-cell + column-number: 3 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (not (node-list-empty? revauthor)) + (make paragraph + use: book-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make table-row + cell-after-row-border: #f + (make table-cell + column-number: 1 + n-columns-spanned: 3 + n-rows-spanned: 1 + start-indent: 0pt + (cond ((not (node-list-empty? revremark)) + (make paragraph + use: book-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + space-after: (if (last-sibling?) + 0pt + (/ %block-sep% 2)) + (process-node-list revremark))) + ((not (node-list-empty? revdescription)) + (make sequence + use: book-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revdescription))) + (else (empty-sosofo)))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + (element (revision revdescription) (process-children)) + + (element seriesvolnums + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element shortaffil + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element subjectset (empty-sosofo)) + + (element subtitle + (make sequence + font-family-name: %title-font-family% + font-weight: 'bold + (literal (if (first-sibling?) ": " "; ")) + (process-children))) + + (element surname + (make paragraph + use: book-titlepage-verso-style + (process-children))) + + (element title + (make sequence + font-family-name: %title-font-family% + font-weight: 'bold + (with-mode title-mode + (process-children)))) + + (element formalpara ($para-container$)) + (element (formalpara title) ($runinhead$)) + (element (formalpara para) (make sequence (process-children))) + + (element titleabbrev (empty-sosofo)) + + (element volumenum + (make paragraph + use: book-titlepage-verso-style + (process-children))) +) + +;; == Title pages for PARTs ============================================= + +(define (part-titlepage-recto-elements) + (list (normalize "title") + (normalize "subtitle"))) + +(define (part-titlepage-verso-elements) + '()) + +(define (part-titlepage-content? elements side) + (titlepage-content? elements (if (equal? side 'recto) + (part-titlepage-recto-elements) + (part-titlepage-verso-elements)))) + +(define (part-titlepage elements #!optional (side 'recto)) + (let ((nodelist (titlepage-nodelist + (if (equal? side 'recto) + (part-titlepage-recto-elements) + (part-titlepage-verso-elements)) + elements)) + ;; partintro is a special case... + (partintro (node-list-first + (node-list-filter-by-gi elements (list (normalize "partintro")))))) + (if (part-titlepage-content? elements side) +;; (make simple-page-sequence +;; page-n-columns: %titlepage-n-columns% +;; input-whitespace-treatment: 'collapse +;; use: default-text-style + (make sequence + + ;; This hack is required for the RTF backend. If an external-graphic + ;; is the first thing on the page, RTF doesn't seem to do the right + ;; thing (the graphic winds up on the baseline of the first line + ;; of the page, left justified). This "one point rule" fixes + ;; that problem. + (make paragraph + line-spacing: 1pt + (literal "")) + + (let loop ((nl nodelist) (lastnode (empty-node-list))) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (if (or (node-list-empty? lastnode) + (not (equal? (gi (node-list-first nl)) + (gi lastnode)))) + (part-titlepage-before (node-list-first nl) side) + (empty-sosofo)) + (cond + ((equal? (gi (node-list-first nl)) (normalize "abbrev")) + (part-titlepage-abbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "abstract")) + (part-titlepage-abstract (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "address")) + (part-titlepage-address (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "affiliation")) + (part-titlepage-affiliation (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "artpagenums")) + (part-titlepage-artpagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "author")) + (part-titlepage-author (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorblurb")) + (part-titlepage-authorblurb (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorgroup")) + (part-titlepage-authorgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorinitials")) + (part-titlepage-authorinitials (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bibliomisc")) + (part-titlepage-bibliomisc (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "biblioset")) + (part-titlepage-biblioset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bookbiblio")) + (part-titlepage-bookbiblio (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "citetitle")) + (part-titlepage-citetitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "collab")) + (part-titlepage-collab (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "confgroup")) + (part-titlepage-confgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractnum")) + (part-titlepage-contractnum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractsponsor")) + (part-titlepage-contractsponsor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contrib")) + (part-titlepage-contrib (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "copyright")) + (part-titlepage-copyright (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpauthor")) + (part-titlepage-corpauthor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpname")) + (part-titlepage-corpname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "date")) + (part-titlepage-date (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "edition")) + (part-titlepage-edition (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "editor")) + (part-titlepage-editor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "firstname")) + (part-titlepage-firstname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "graphic")) + (part-titlepage-graphic (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "honorific")) + (part-titlepage-honorific (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "indexterm")) + (part-titlepage-indexterm (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "invpartnumber")) + (part-titlepage-invpartnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "isbn")) + (part-titlepage-isbn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issn")) + (part-titlepage-issn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issuenum")) + (part-titlepage-issuenum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "itermset")) + (part-titlepage-itermset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "keywordset")) + (part-titlepage-keywordset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "legalnotice")) + (part-titlepage-legalnotice (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "lineage")) + (part-titlepage-lineage (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "mediaobject")) + (part-titlepage-mediaobject (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "modespec")) + (part-titlepage-modespec (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "orgname")) + (part-titlepage-orgname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othercredit")) + (part-titlepage-othercredit (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othername")) + (part-titlepage-othername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pagenums")) + (part-titlepage-pagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "printhistory")) + (part-titlepage-printhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productname")) + (part-titlepage-productname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productnumber")) + (part-titlepage-productnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubdate")) + (part-titlepage-pubdate (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publisher")) + (part-titlepage-publisher (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publishername")) + (part-titlepage-publishername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubsnumber")) + (part-titlepage-pubsnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "releaseinfo")) + (part-titlepage-releaseinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "revhistory")) + (part-titlepage-revhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesinfo")) + (part-titlepage-seriesinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesvolnums")) + (part-titlepage-seriesvolnums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subjectset")) + (part-titlepage-subjectset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subtitle")) + (part-titlepage-subtitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "surname")) + (part-titlepage-surname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "title")) + (part-titlepage-title (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "titleabbrev")) + (part-titlepage-titleabbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "volumenum")) + (part-titlepage-volumenum (node-list-first nl) side)) + (else + (part-titlepage-default (node-list-first nl) side))) + (loop (node-list-rest nl) (node-list-first nl))))) + + (if (and %generate-part-toc% + %generate-part-toc-on-titlepage% + (equal? side 'recto)) + (make display-group + (build-toc (current-node) + (toc-depth (current-node)))) + (empty-sosofo)) + + ;; PartIntro is a special case + (if (and (equal? side 'recto) + (not (node-list-empty? partintro)) + %generate-partintro-on-titlepage%) + ($process-partintro$ partintro #f) + (empty-sosofo))) + (empty-sosofo)))) + +(define (part-titlepage-before node side) + (if (equal? side 'recto) + (cond + ((equal? (gi node) (normalize "corpauthor")) + (make paragraph + space-after: (* (HSIZE 5) %head-after-factor% 8) + (literal "\no-break-space;"))) + ((equal? (gi node) (normalize "authorgroup")) + (if (have-sibling? (normalize "corpauthor") node) + (empty-sosofo) + (make paragraph + space-after: (* (HSIZE 5) %head-after-factor% 8) + (literal "\no-break-space;")))) + ((equal? (gi node) (normalize "author")) + (if (or (have-sibling? (normalize "corpauthor") node) + (have-sibling? (normalize "authorgroup") node)) + (empty-sosofo) + (make paragraph + space-after: (* (HSIZE 5) %head-after-factor% 8) + (literal "\no-break-space;")))) + (else (empty-sosofo))) + (empty-sosofo))) + +(define (part-titlepage-default node side) + (let ((foo (debug (string-append "No part-titlepage-* for " (gi node) "!")))) + (empty-sosofo))) + +(define (part-titlepage-element node side) + (if (equal? side 'recto) + (with-mode part-titlepage-recto-mode + (process-node-list node)) + (with-mode part-titlepage-verso-mode + (process-node-list node)))) + +(define (part-titlepage-abbrev node side) + (part-titlepage-element node side)) +(define (part-titlepage-abstract node side) + (part-titlepage-element node side)) +(define (part-titlepage-address node side) + (part-titlepage-element node side)) +(define (part-titlepage-affiliation node side) + (part-titlepage-element node side)) +(define (part-titlepage-artpagenums node side) + (part-titlepage-element node side)) +(define (part-titlepage-author node side) + (part-titlepage-element node side)) +(define (part-titlepage-authorblurb node side) + (part-titlepage-element node side)) +(define (part-titlepage-authorgroup node side) + (part-titlepage-element node side)) +(define (part-titlepage-authorinitials node side) + (part-titlepage-element node side)) +(define (part-titlepage-bibliomisc node side) + (part-titlepage-element node side)) +(define (part-titlepage-biblioset node side) + (part-titlepage node side)) +(define (part-titlepage-bookbiblio node side) + (part-titlepage node side)) +(define (part-titlepage-citetitle node side) + (part-titlepage-element node side)) +(define (part-titlepage-collab node side) + (part-titlepage-element node side)) +(define (part-titlepage-confgroup node side) + (part-titlepage-element node side)) +(define (part-titlepage-contractnum node side) + (part-titlepage-element node side)) +(define (part-titlepage-contractsponsor node side) + (part-titlepage-element node side)) +(define (part-titlepage-contrib node side) + (part-titlepage-element node side)) +(define (part-titlepage-copyright node side) + (part-titlepage-element node side)) + +(define (part-titlepage-corpauthor node side) + (if (equal? side 'recto) + (book-titlepage-element node side) + (if (first-sibling? node) + (make paragraph + (with-mode book-titlepage-verso-mode + (process-node-list + (select-elements (children (parent node)) + (normalize "corpauthor"))))) + (empty-sosofo)))) + +(define (part-titlepage-corpname node side) + (part-titlepage-element node side)) +(define (part-titlepage-date node side) + (part-titlepage-element node side)) +(define (part-titlepage-edition node side) + (part-titlepage-element node side)) +(define (part-titlepage-editor node side) + (part-titlepage-element node side)) +(define (part-titlepage-firstname node side) + (part-titlepage-element node side)) +(define (part-titlepage-graphic node side) + (part-titlepage-element node side)) +(define (part-titlepage-honorific node side) + (part-titlepage-element node side)) +(define (part-titlepage-indexterm node side) + (part-titlepage-element node side)) +(define (part-titlepage-invpartnumber node side) + (part-titlepage-element node side)) +(define (part-titlepage-isbn node side) + (part-titlepage-element node side)) +(define (part-titlepage-issn node side) + (part-titlepage-element node side)) +(define (part-titlepage-issuenum node side) + (part-titlepage-element node side)) +(define (part-titlepage-itermset node side) + (part-titlepage-element node side)) +(define (part-titlepage-keywordset node side) + (part-titlepage-element node side)) +(define (part-titlepage-legalnotice node side) + (part-titlepage-element node side)) +(define (part-titlepage-lineage node side) + (part-titlepage-element node side)) +(define (part-titlepage-mediaobject node side) + (part-titlepage-element node side)) +(define (part-titlepage-modespec node side) + (part-titlepage-element node side)) +(define (part-titlepage-orgname node side) + (part-titlepage-element node side)) +(define (part-titlepage-othercredit node side) + (part-titlepage-element node side)) +(define (part-titlepage-othername node side) + (part-titlepage-element node side)) +(define (part-titlepage-pagenums node side) + (part-titlepage-element node side)) +(define (part-titlepage-printhistory node side) + (part-titlepage-element node side)) +(define (part-titlepage-productname node side) + (part-titlepage-element node side)) +(define (part-titlepage-productnumber node side) + (part-titlepage-element node side)) +(define (part-titlepage-pubdate node side) + (part-titlepage-element node side)) +(define (part-titlepage-publisher node side) + (part-titlepage-element node side)) +(define (part-titlepage-publishername node side) + (part-titlepage-element node side)) +(define (part-titlepage-pubsnumber node side) + (part-titlepage-element node side)) +(define (part-titlepage-releaseinfo node side) + (part-titlepage-element node side)) +(define (part-titlepage-revhistory node side) + (part-titlepage-element node side)) +(define (part-titlepage-seriesinfo node side) + (part-titlepage-element node side)) +(define (part-titlepage-seriesvolnums node side) + (part-titlepage-element node side)) +(define (part-titlepage-subjectset node side) + (part-titlepage-element node side)) +(define (part-titlepage-subtitle node side) + (part-titlepage-element node side)) +(define (part-titlepage-surname node side) + (part-titlepage-element node side)) +(define (part-titlepage-title node side) + (part-titlepage-element node side)) +(define (part-titlepage-titleabbrev node side) + (part-titlepage-element node side)) +(define (part-titlepage-volumenum node side) + (part-titlepage-element node side)) + +(define part-titlepage-recto-style + (style + font-family-name: %title-font-family% + font-weight: 'bold + font-size: (HSIZE 1))) + +(define part-titlepage-verso-style + (style + font-family-name: %body-font-family%)) + +(mode part-titlepage-recto-mode + (element abbrev + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element abstract + (make display-group + use: part-titlepage-recto-style + quadding: 'start + ($semiformal-object$))) + + (element (abstract title) (empty-sosofo)) + + (element (abstract para) + (make paragraph + use: part-titlepage-recto-style + quadding: 'start + (process-children))) + + (element address + (make display-group + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element affiliation + (make display-group + use: part-titlepage-recto-style + (process-children))) + + (element artpagenums + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element author + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make paragraph + use: part-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor%) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal author-name)) + (process-node-list author-affil)))) + + (element authorblurb + (make display-group + use: part-titlepage-recto-style + quadding: 'start + (process-children))) + + (element (authorblurb para) + (make paragraph + use: part-titlepage-recto-style + quadding: 'start + (process-children))) + + (element authorgroup + (make display-group + (process-children))) + + (element authorinitials + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element bibliomisc (process-children)) + + (element bibliomset (process-children)) + + (element collab + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element confgroup + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element contractnum + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element contractsponsor + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element contrib + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element copyright + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + space-before: (* (HSIZE 2) %head-before-factor%) + (literal (gentext-element-name (current-node))) + (literal "\no-break-space;") + (literal (dingbat "copyright")) + (literal "\no-break-space;") + (process-children))) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (literal " ")))) + + (element (copyright holder) ($charseq$)) + + (element corpauthor + (make sequence + (make paragraph + use: part-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor%) + quadding: %division-title-quadding% + keep-with-next?: #t + (process-children)) + ;; This paragraph is a hack to get the spacing right. + ;; Authors always have an affiliation paragraph below them, even if + ;; it's empty, so corpauthors need one too. + (make paragraph + use: part-titlepage-recto-style + font-size: (HSIZE 1) + line-spacing: (* (HSIZE 1) %line-spacing-factor%) + space-after: (* (HSIZE 2) %head-after-factor% 4) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal "\no-break-space;")))) + + (element corpname + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element date + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element edition + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children) + (literal "\no-break-space;") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + (let ((editor-name (author-string))) + (make sequence + (if (first-sibling?) + (make paragraph + use: part-titlepage-recto-style + font-size: (HSIZE 1) + line-spacing: (* (HSIZE 1) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor% 6) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal (gentext-edited-by))) + (empty-sosofo)) + (make paragraph + use: part-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-after: (* (HSIZE 2) %head-after-factor% 4) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal editor-name))))) + + (element firstname + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element graphic + (let* ((nd (current-node)) + (fileref (attribute-string "fileref" nd)) + (entityref (attribute-string "entityref" nd)) + (format (attribute-string "format" nd)) + (align (attribute-string "align" nd))) + (if (or fileref entityref) + (make external-graphic + notation-system-id: (if format format "") + entity-system-id: (if fileref + (graphic-file fileref) + (if entityref + (entity-generated-system-id entityref) + "")) + display?: #t + display-alignment: 'center) + (empty-sosofo)))) + + (element honorific + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element isbn + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element issn + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element itermset (empty-sosofo)) + + (element invpartnumber + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element issuenum + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element jobtitle + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element keywordset + (make paragraph + quadding: 'start + (make sequence + font-weight: 'bold + (literal "Keywords: ")) + (process-children))) + + (element (keyword) + (make sequence + (process-children) + (if (not (last-sibling?)) + (literal ", ") + (literal "")))) + + (element legalnotice + (make display-group + use: part-titlepage-recto-style + ($semiformal-object$))) + + (element (legalnotice title) (empty-sosofo)) + + (element (legalnotice para) + (make paragraph + use: part-titlepage-recto-style + quadding: 'start + line-spacing: (* 0.8 (inherited-line-spacing)) + font-size: (* 0.8 (inherited-font-size)) + (process-children))) + + (element lineage + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element modespec (empty-sosofo)) + + (element orgdiv + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element orgname + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element othercredit + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make paragraph + use: part-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor%) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal author-name)) + (process-node-list author-affil)))) + + (element othername + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element pagenums + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element printhistory + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element productname + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element productnumber + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element pubdate + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element publisher + (make display-group + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element publishername + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element pubsnumber + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element releaseinfo + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element revhistory + (make sequence + (make paragraph + use: part-titlepage-recto-style + space-before: (* (HSIZE 3) %head-before-factor%) + space-after: (/ (* (HSIZE 1) %head-before-factor%) 2) + (literal (gentext-element-name (current-node)))) + (make table + before-row-border: #f + (process-children)))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark"))) + (revdescription (select-elements (descendants (current-node)) + (normalize "revdescription")))) + (make sequence + (make table-row + (make table-cell + column-number: 1 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + (if (not (node-list-empty? revnumber)) + (make paragraph + use: part-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-element-name-space (current-node))) + (process-node-list revnumber)) + (empty-sosofo))) + (make table-cell + column-number: 2 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (not (node-list-empty? revdate)) + (make paragraph + use: part-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revdate)) + (empty-sosofo))) + (make table-cell + column-number: 3 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (not (node-list-empty? revauthor)) + (make paragraph + use: part-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make table-row + cell-after-row-border: #f + (make table-cell + column-number: 1 + n-columns-spanned: 3 + n-rows-spanned: 1 + start-indent: 0pt + (cond ((not (node-list-empty? revremark)) + (make paragraph + use: part-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + space-after: (if (last-sibling?) + 0pt + (/ %block-sep% 2)) + (process-node-list revremark))) + ((not (node-list-empty? revdescription)) + (make sequence + use: part-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revdescription))) + (else (empty-sosofo)))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + (element (revision revdescription) (process-children)) + + (element seriesvolnums + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element shortaffil + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element subjectset (empty-sosofo)) + + (element subtitle + (make paragraph + use: part-titlepage-recto-style + font-size: (HSIZE 4) + line-spacing: (* (HSIZE 4) %line-spacing-factor%) + space-before: (* (HSIZE 4) %head-before-factor%) + quadding: %division-subtitle-quadding% + keep-with-next?: #t + (process-children-trim))) + + (element surname + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element title + (let ((division (ancestor-member (current-node) (division-element-list)))) + (make paragraph + use: part-titlepage-recto-style + font-size: (HSIZE 5) + line-spacing: (* (HSIZE 5) %line-spacing-factor%) + space-before: (* (HSIZE 5) %head-before-factor%) + quadding: %division-title-quadding% + keep-with-next?: #t + heading-level: (if %generate-heading-level% 1 0) + (if (string=? (element-label division) "") + (empty-sosofo) + (literal (element-label division) + (gentext-label-title-sep (gi division)))) + (with-mode title-mode + (process-children))))) + + (element formalpara ($para-container$)) + (element (formalpara title) ($runinhead$)) + (element (formalpara para) (make sequence (process-children))) + + (element titleabbrev (empty-sosofo)) + + (element volumenum + (make paragraph + use: part-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) +) + +(mode part-titlepage-verso-mode + (element abbrev + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element abstract ($semiformal-object$)) + + (element (abstract title) (empty-sosofo)) + + (element address + (make display-group + use: part-titlepage-verso-style + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element affiliation + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element artpagenums + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element author + ;; Print the author name. Handle the case where there's no AUTHORGROUP + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (not in-group) + (make paragraph + ;; Hack to get the spacing right below the author name line... + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-by)) + (literal "\no-break-space;") + (literal (author-list-string)))) + (make sequence + (literal (author-list-string)))))) + + (element authorblurb + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element authorgroup + (make paragraph + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-by)) + (literal "\no-break-space;") + (process-children-trim)))) + + (element authorinitials + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element bibliomisc (process-children)) + + (element bibliomset (process-children)) + + (element collab + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element confgroup + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element contractnum + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element contractsponsor + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element contrib + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element copyright + (make paragraph + use: part-titlepage-verso-style + (literal (gentext-element-name (current-node))) + (literal "\no-break-space;") + (literal (dingbat "copyright")) + (literal "\no-break-space;") + (process-children))) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (literal " ")))) + + (element (copyright holder) ($charseq$)) + + (element corpauthor + ;; note: part-titlepage-corpauthor takes care of wrapping multiple + ;; corpauthors + (make sequence + (if (first-sibling?) + (if (equal? (gi (parent (current-node))) (normalize "authorgroup")) + (empty-sosofo) + (literal (gentext-by) " ")) + (literal ", ")) + (process-children))) + + (element corpname + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element date + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element edition + (make paragraph + (process-children) + (literal "\no-break-space;") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + ;; Print the editor name. + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (or #t (not in-group)) ; nevermind, always put out the Edited by + (make paragraph + ;; Hack to get the spacing right below the author name line... + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-edited-by)) + (literal "\no-break-space;") + (literal (author-string)))) + (make sequence + (literal (author-string)))))) + + (element firstname + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element graphic + (let* ((nd (current-node)) + (fileref (attribute-string "fileref" nd)) + (entityref (attribute-string "entityref" nd)) + (format (attribute-string "format" nd)) + (align (attribute-string "align" nd))) + (if (or fileref entityref) + (make external-graphic + notation-system-id: (if format format "") + entity-system-id: (if fileref + (graphic-file fileref) + (if entityref + (entity-generated-system-id entityref) + "")) + display?: #t + display-alignment: 'start) + (empty-sosofo)))) + + (element honorific + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element isbn + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element issn + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element itermset (empty-sosofo)) + + (element invpartnumber + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element issuenum + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element jobtitle + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element keywordset + (make paragraph + quadding: 'start + (make sequence + font-weight: 'bold + (literal "Keywords: ")) + (process-children))) + + (element (keyword) + (make sequence + (process-children) + (if (not (last-sibling?)) + (literal ", ") + (literal "")))) + + (element legalnotice + (make display-group + use: part-titlepage-verso-style + ($semiformal-object$))) + + (element (legalnotice title) (empty-sosofo)) + + (element (legalnotice para) + (make paragraph + use: part-titlepage-verso-style + font-size: (* (inherited-font-size) 0.8) + (process-children-trim))) + + (element lineage + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element modespec (empty-sosofo)) + + (element orgdiv + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element orgname + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element othercredit + ;; Print the author name. Handle the case where there's no AUTHORGROUP + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (not in-group) + (make paragraph + ;; Hack to get the spacing right below the author name line... + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-by)) + (literal "\no-break-space;") + (literal (author-list-string)))) + (make sequence + (literal (author-list-string)))))) + + (element othername + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element pagenums + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element printhistory + (make display-group + use: part-titlepage-verso-style + (process-children))) + + (element productname + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element productnumber + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element pubdate + (make paragraph + (literal (gentext-element-name-space (gi (current-node)))) + (process-children))) + + (element publisher + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element publishername + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element pubsnumber + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element releaseinfo + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element revhistory + (make sequence + (make paragraph + use: part-titlepage-verso-style + space-before: (* (HSIZE 3) %head-before-factor%) + space-after: (/ (* (HSIZE 1) %head-before-factor%) 2) + (literal (gentext-element-name (current-node)))) + (make table + before-row-border: #f + (process-children)))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark"))) + (revdescription (select-elements (descendants (current-node)) + (normalize "revdescription")))) + (make sequence + (make table-row + (make table-cell + column-number: 1 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + (if (not (node-list-empty? revnumber)) + (make paragraph + use: part-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-element-name-space (current-node))) + (process-node-list revnumber)) + (empty-sosofo))) + (make table-cell + column-number: 2 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (not (node-list-empty? revdate)) + (make paragraph + use: part-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revdate)) + (empty-sosofo))) + (make table-cell + column-number: 3 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (not (node-list-empty? revauthor)) + (make paragraph + use: part-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make table-row + cell-after-row-border: #f + (make table-cell + column-number: 1 + n-columns-spanned: 3 + n-rows-spanned: 1 + start-indent: 0pt + (cond ((not (node-list-empty? revremark)) + (make paragraph + use: part-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + space-after: (if (last-sibling?) + 0pt + (/ %block-sep% 2)) + (process-node-list revremark))) + ((not (node-list-empty? revdescription)) + (make sequence + use: part-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revremark))) + (else (empty-sosofo)))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + (element (revision revdescription) (process-children)) + + (element seriesvolnums + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element shortaffil + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element subjectset (empty-sosofo)) + + (element subtitle + (make sequence + font-family-name: %title-font-family% + font-weight: 'bold + (literal (if (first-sibling?) ": " "; ")) + (process-children))) + + (element surname + (make paragraph + use: part-titlepage-verso-style + (process-children))) + + (element title + (let ((division (ancestor-member (current-node) (division-element-list)))) + (make sequence + font-family-name: %title-font-family% + font-weight: 'bold + (if (string=? (element-label division) "") + (empty-sosofo) + (literal (element-label division) + (gentext-label-title-sep (gi division)))) + (with-mode title-mode + (process-children))))) + + (element formalpara ($para-container$)) + (element (formalpara title) ($runinhead$)) + (element (formalpara para) (make sequence (process-children))) + + (element titleabbrev (empty-sosofo)) + + (element volumenum + (make paragraph + use: part-titlepage-verso-style + (process-children))) +) + +;; == Title pages for ARTICLEs ========================================== +;; +;; Note: Article title pages are a little different in that they do not +;; create their own simple-page-sequence. +;; + +(define (article-titlepage-recto-elements) + (list (normalize "title") + (normalize "subtitle") + (normalize "corpauthor") + (normalize "authorgroup") + (normalize "author") + (normalize "releaseinfo") + (normalize "copyright") + (normalize "pubdate") + (normalize "revhistory") + (normalize "abstract"))) + +(define (article-titlepage-verso-elements) + '()) + +(define (article-titlepage-content? elements side) + (titlepage-content? elements (if (equal? side 'recto) + (article-titlepage-recto-elements) + (article-titlepage-verso-elements)))) + +(define (article-titlepage elements #!optional (side 'recto)) + (let* ((nodelist (titlepage-nodelist + (if (equal? side 'recto) + (article-titlepage-recto-elements) + (article-titlepage-verso-elements)) + elements))) + (if (article-titlepage-content? elements side) + (make sequence + (let loop ((nl nodelist) (lastnode (empty-node-list))) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (if (or (node-list-empty? lastnode) + (not (equal? (gi (node-list-first nl)) + (gi lastnode)))) + (article-titlepage-before (node-list-first nl) side) + (empty-sosofo)) + (cond + ((equal? (gi (node-list-first nl)) (normalize "abbrev")) + (article-titlepage-abbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "abstract")) + (article-titlepage-abstract (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "address")) + (article-titlepage-address (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "affiliation")) + (article-titlepage-affiliation (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "artpagenums")) + (article-titlepage-artpagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "author")) + (article-titlepage-author (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorblurb")) + (article-titlepage-authorblurb (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorgroup")) + (article-titlepage-authorgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorinitials")) + (article-titlepage-authorinitials (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bibliomisc")) + (article-titlepage-bibliomisc (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "biblioset")) + (article-titlepage-biblioset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bookbiblio")) + (article-titlepage-bookbiblio (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "citetitle")) + (article-titlepage-citetitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "collab")) + (article-titlepage-collab (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "confgroup")) + (article-titlepage-confgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractnum")) + (article-titlepage-contractnum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractsponsor")) + (article-titlepage-contractsponsor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contrib")) + (article-titlepage-contrib (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "copyright")) + (article-titlepage-copyright (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpauthor")) + (article-titlepage-corpauthor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpname")) + (article-titlepage-corpname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "date")) + (article-titlepage-date (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "edition")) + (article-titlepage-edition (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "editor")) + (article-titlepage-editor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "firstname")) + (article-titlepage-firstname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "graphic")) + (article-titlepage-graphic (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "honorific")) + (article-titlepage-honorific (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "indexterm")) + (article-titlepage-indexterm (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "invpartnumber")) + (article-titlepage-invpartnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "isbn")) + (article-titlepage-isbn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issn")) + (article-titlepage-issn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issuenum")) + (article-titlepage-issuenum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "itermset")) + (article-titlepage-itermset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "keywordset")) + (article-titlepage-keywordset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "legalnotice")) + (article-titlepage-legalnotice (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "lineage")) + (article-titlepage-lineage (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "mediaobject")) + (article-titlepage-mediaobject (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "modespec")) + (article-titlepage-modespec (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "orgname")) + (article-titlepage-orgname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othercredit")) + (article-titlepage-othercredit (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othername")) + (article-titlepage-othername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pagenums")) + (article-titlepage-pagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "printhistory")) + (article-titlepage-printhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productname")) + (article-titlepage-productname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productnumber")) + (article-titlepage-productnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubdate")) + (article-titlepage-pubdate (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publisher")) + (article-titlepage-publisher (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publishername")) + (article-titlepage-publishername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubsnumber")) + (article-titlepage-pubsnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "releaseinfo")) + (article-titlepage-releaseinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "revhistory")) + (article-titlepage-revhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesinfo")) + (article-titlepage-seriesinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesvolnums")) + (article-titlepage-seriesvolnums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subjectset")) + (article-titlepage-subjectset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subtitle")) + (article-titlepage-subtitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "surname")) + (article-titlepage-surname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "title")) + (article-titlepage-title (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "titleabbrev")) + (article-titlepage-titleabbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "volumenum")) + (article-titlepage-volumenum (node-list-first nl) side)) + (else + (article-titlepage-default (node-list-first nl) side))) + (loop (node-list-rest nl) (node-list-first nl))))) + + (if (and %generate-article-toc% + %generate-article-toc-on-titlepage% + (equal? side 'recto)) + (make display-group + (build-toc (current-node) + (toc-depth (current-node)))) + (empty-sosofo))) + (empty-sosofo)))) + +(define (article-titlepage-before node side) + (empty-sosofo)) + +(define (article-titlepage-default node side) + (let ((foo (debug (string-append "No article-titlepage-* for " (gi node) "!")))) + (empty-sosofo))) + +(define (article-titlepage-element node side) + (if (equal? side 'recto) + (with-mode article-titlepage-recto-mode + (process-node-list node)) + (with-mode article-titlepage-verso-mode + (process-node-list node)))) + +(define (article-titlepage-abbrev node side) + (article-titlepage-element node side)) +(define (article-titlepage-abstract node side) + (article-titlepage-element node side)) +(define (article-titlepage-address node side) + (article-titlepage-element node side)) +(define (article-titlepage-affiliation node side) + (article-titlepage-element node side)) +(define (article-titlepage-artpagenums node side) + (article-titlepage-element node side)) +(define (article-titlepage-author node side) + (article-titlepage-element node side)) +(define (article-titlepage-authorblurb node side) + (article-titlepage-element node side)) +(define (article-titlepage-authorgroup node side) + (article-titlepage-element node side)) +(define (article-titlepage-authorinitials node side) + (article-titlepage-element node side)) +(define (article-titlepage-bibliomisc node side) + (article-titlepage-element node side)) +(define (article-titlepage-biblioset node side) + (article-titlepage node side)) +(define (article-titlepage-bookbiblio node side) + (article-titlepage node side)) +(define (article-titlepage-citetitle node side) + (article-titlepage-element node side)) +(define (article-titlepage-collab node side) + (article-titlepage-element node side)) +(define (article-titlepage-confgroup node side) + (article-titlepage-element node side)) +(define (article-titlepage-contractnum node side) + (article-titlepage-element node side)) +(define (article-titlepage-contractsponsor node side) + (article-titlepage-element node side)) +(define (article-titlepage-contrib node side) + (article-titlepage-element node side)) +(define (article-titlepage-copyright node side) + (article-titlepage-element node side)) + +(define (article-titlepage-corpauthor node side) + (if (equal? side 'recto) + (book-titlepage-element node side) + (if (first-sibling? node) + (make paragraph + (with-mode book-titlepage-verso-mode + (process-node-list + (select-elements (children (parent node)) + (normalize "corpauthor"))))) + (empty-sosofo)))) + +(define (article-titlepage-corpname node side) + (article-titlepage-element node side)) +(define (article-titlepage-date node side) + (article-titlepage-element node side)) +(define (article-titlepage-edition node side) + (article-titlepage-element node side)) +(define (article-titlepage-editor node side) + (article-titlepage-element node side)) +(define (article-titlepage-firstname node side) + (article-titlepage-element node side)) +(define (article-titlepage-graphic node side) + (article-titlepage-element node side)) +(define (article-titlepage-honorific node side) + (article-titlepage-element node side)) +(define (article-titlepage-indexterm node side) + (article-titlepage-element node side)) +(define (article-titlepage-invpartnumber node side) + (article-titlepage-element node side)) +(define (article-titlepage-isbn node side) + (article-titlepage-element node side)) +(define (article-titlepage-issn node side) + (article-titlepage-element node side)) +(define (article-titlepage-issuenum node side) + (article-titlepage-element node side)) +(define (article-titlepage-itermset node side) + (article-titlepage-element node side)) +(define (article-titlepage-keywordset node side) + (article-titlepage-element node side)) +(define (article-titlepage-legalnotice node side) + (article-titlepage-element node side)) +(define (article-titlepage-lineage node side) + (article-titlepage-element node side)) +(define (article-titlepage-mediaobject node side) + (article-titlepage-element node side)) +(define (article-titlepage-modespec node side) + (article-titlepage-element node side)) +(define (article-titlepage-orgname node side) + (article-titlepage-element node side)) +(define (article-titlepage-othercredit node side) + (article-titlepage-element node side)) +(define (article-titlepage-othername node side) + (article-titlepage-element node side)) +(define (article-titlepage-pagenums node side) + (article-titlepage-element node side)) +(define (article-titlepage-printhistory node side) + (article-titlepage-element node side)) +(define (article-titlepage-productname node side) + (article-titlepage-element node side)) +(define (article-titlepage-productnumber node side) + (article-titlepage-element node side)) +(define (article-titlepage-pubdate node side) + (article-titlepage-element node side)) +(define (article-titlepage-publisher node side) + (article-titlepage-element node side)) +(define (article-titlepage-publishername node side) + (article-titlepage-element node side)) +(define (article-titlepage-pubsnumber node side) + (article-titlepage-element node side)) +(define (article-titlepage-releaseinfo node side) + (article-titlepage-element node side)) +(define (article-titlepage-revhistory node side) + (article-titlepage-element node side)) +(define (article-titlepage-seriesinfo node side) + (article-titlepage-element node side)) +(define (article-titlepage-seriesvolnums node side) + (article-titlepage-element node side)) +(define (article-titlepage-subjectset node side) + (article-titlepage-element node side)) +(define (article-titlepage-subtitle node side) + (article-titlepage-element node side)) +(define (article-titlepage-surname node side) + (article-titlepage-element node side)) +(define (article-titlepage-title node side) + (article-titlepage-element node side)) +(define (article-titlepage-titleabbrev node side) + (article-titlepage-element node side)) +(define (article-titlepage-volumenum node side) + (article-titlepage-element node side)) + +(define article-titlepage-recto-style + (style + font-family-name: %title-font-family% + font-weight: 'bold + font-size: (HSIZE 1))) + +(define article-titlepage-verso-style + (style + font-family-name: %body-font-family%)) + +(mode article-titlepage-recto-mode + (element abbrev + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element abstract + (make display-group + use: article-titlepage-verso-style ;; EVEN THOUGH IT'S RECTO! + quadding: 'start + start-indent: (+ (inherited-start-indent) (/ %body-width% 24)) + end-indent: (+ (inherited-end-indent) (/ %body-width% 24)) + ($semiformal-object$))) + + (element (abstract title) (empty-sosofo)) + + (element address + (make display-group + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element affiliation + (make display-group + use: article-titlepage-recto-style + (process-children))) + + (element artpagenums + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element author + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make paragraph + use: article-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor%) + quadding: %article-title-quadding% + keep-with-next?: #t + (literal author-name)) + (process-node-list author-affil)))) + + (element authorblurb + (make display-group + use: article-titlepage-recto-style + quadding: 'start + (process-children))) + + (element (authorblurb para) + (make paragraph + use: article-titlepage-recto-style + quadding: 'start + (process-children))) + + (element authorgroup + (make display-group + (process-children))) + + (element authorinitials + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element bibliomisc (process-children)) + + (element bibliomset (process-children)) + + (element collab + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element confgroup + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element contractnum + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element contractsponsor + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element contrib + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element copyright + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + space-before: (* (HSIZE 2) %head-before-factor%) + (literal (gentext-element-name (current-node))) + (literal "\no-break-space;") + (literal (dingbat "copyright")) + (literal "\no-break-space;") + (process-children))) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (literal " ")))) + + (element (copyright holder) ($charseq$)) + + (element corpauthor + (make sequence + (make paragraph + use: article-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor%) + quadding: %article-title-quadding% + keep-with-next?: #t + (process-children)) + ;; This paragraph is a hack to get the spacing right. + ;; Authors always have an affiliation paragraph below them, even if + ;; it's empty, so corpauthors need one too. + (make paragraph + use: article-titlepage-recto-style + font-size: (HSIZE 1) + line-spacing: (* (HSIZE 1) %line-spacing-factor%) + space-after: (* (HSIZE 2) %head-after-factor% 4) + quadding: %article-title-quadding% + keep-with-next?: #t + (literal "\no-break-space;")))) + + (element corpname + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element date + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element edition + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children) + (literal "\no-break-space;") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + (let ((editor-name (author-string))) + (make sequence + (if (first-sibling?) + (make paragraph + use: article-titlepage-recto-style + font-size: (HSIZE 1) + line-spacing: (* (HSIZE 1) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor% 6) + quadding: %article-title-quadding% + keep-with-next?: #t + (literal (gentext-edited-by))) + (empty-sosofo)) + (make paragraph + use: article-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-after: (* (HSIZE 2) %head-after-factor% 4) + quadding: %article-title-quadding% + keep-with-next?: #t + (literal editor-name))))) + + (element firstname + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element graphic + (let* ((nd (current-node)) + (fileref (attribute-string "fileref" nd)) + (entityref (attribute-string "entityref" nd)) + (format (attribute-string "format" nd)) + (align (attribute-string "align" nd))) + (if (or fileref entityref) + (make external-graphic + notation-system-id: (if format format "") + entity-system-id: (if fileref + (graphic-file fileref) + (if entityref + (entity-generated-system-id entityref) + "")) + display?: #t + display-alignment: 'center) + (empty-sosofo)))) + + (element honorific + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element isbn + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element issn + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element itermset (empty-sosofo)) + + (element invpartnumber + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element issuenum + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element jobtitle + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element keywordset + (make paragraph + quadding: 'start + (make sequence + font-weight: 'bold + (literal "Keywords: ")) + (process-children))) + + (element keyword + (make sequence + (process-children) + (if (not (last-sibling?)) + (literal ", ") + (literal "")))) + + (element legalnotice + (make display-group + use: article-titlepage-recto-style + ($semiformal-object$))) + + (element (legalnotice title) (empty-sosofo)) + + (element (legalnotice para) + (make paragraph + use: article-titlepage-recto-style + quadding: 'start + line-spacing: (* 0.8 (inherited-line-spacing)) + font-size: (* 0.8 (inherited-font-size)) + (process-children))) + + (element lineage + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element modespec (empty-sosofo)) + + (element orgdiv + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element orgname + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element othercredit + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make paragraph + use: article-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor%) + quadding: %article-title-quadding% + keep-with-next?: #t + (literal author-name)) + (process-node-list author-affil)))) + + (element othername + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element pagenums + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element printhistory + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element productname + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element productnumber + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element pubdate + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element publisher + (make display-group + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element publishername + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element pubsnumber + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element releaseinfo + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element revhistory + (make sequence + (make paragraph + use: article-titlepage-recto-style + space-before: (* (HSIZE 3) %head-before-factor%) + space-after: (/ (* (HSIZE 1) %head-before-factor%) 2) + (literal (gentext-element-name (current-node)))) + (make table + before-row-border: #f + (process-children)))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark"))) + (revdescription (select-elements (descendants (current-node)) + (normalize "revdescription")))) + (make sequence + (make table-row + (make table-cell + column-number: 1 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + (if (not (node-list-empty? revnumber)) + (make paragraph + use: article-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-element-name-space (current-node))) + (process-node-list revnumber)) + (empty-sosofo))) + (make table-cell + column-number: 2 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (not (node-list-empty? revdate)) + (make paragraph + use: article-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revdate)) + (empty-sosofo))) + (make table-cell + column-number: 3 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (not (node-list-empty? revauthor)) + (make paragraph + use: article-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make table-row + cell-after-row-border: #f + (make table-cell + column-number: 1 + n-columns-spanned: 3 + n-rows-spanned: 1 + start-indent: 0pt + (cond ((not (node-list-empty? revremark)) + (make paragraph + use: article-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + space-after: (if (last-sibling?) + 0pt + (/ %block-sep% 2)) + (process-node-list revremark))) + ((not (node-list-empty? revdescription)) + (make sequence + use: article-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revdescription))) + (else (empty-sosofo)))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + (element (revision revdescription) (process-children)) + + (element seriesvolnums + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element shortaffil + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element subjectset (empty-sosofo)) + + (element subtitle + (make paragraph + use: article-titlepage-recto-style + font-size: (HSIZE 4) + line-spacing: (* (HSIZE 4) %line-spacing-factor%) + space-before: (* (HSIZE 4) %head-before-factor%) + quadding: %article-subtitle-quadding% + keep-with-next?: #t + (process-children-trim))) + + (element surname + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) + + (element title + (make paragraph + use: article-titlepage-recto-style + font-size: (HSIZE 5) + line-spacing: (* (HSIZE 5) %line-spacing-factor%) + space-before: (* (HSIZE 5) %head-before-factor%) + quadding: %article-title-quadding% + keep-with-next?: #t + (with-mode title-mode + (process-children-trim)))) + + (element formalpara ($para-container$)) + (element (formalpara title) ($runinhead$)) + (element (formalpara para) (make sequence (process-children))) + + (element titleabbrev (empty-sosofo)) + + (element volumenum + (make paragraph + use: article-titlepage-recto-style + quadding: %article-title-quadding% + (process-children))) +) + +(mode article-titlepage-verso-mode + (element abbrev + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element abstract ($semiformal-object$)) + + (element (abstract title) (empty-sosofo)) + + (element address + (make display-group + use: article-titlepage-verso-style + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element affiliation + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element artpagenums + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element author + ;; Print the author name. Handle the case where there's no AUTHORGROUP + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (not in-group) + (make paragraph + ;; Hack to get the spacing right below the author name line... + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-by)) + (literal "\no-break-space;") + (literal (author-list-string)))) + (make sequence + (literal (author-list-string)))))) + + (element authorblurb + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element authorgroup + (make paragraph + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-by)) + (literal "\no-break-space;") + (process-children-trim)))) + + (element authorinitials + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element bibliomisc (process-children)) + + (element bibliomset (process-children)) + + (element collab + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element confgroup + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element contractnum + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element contractsponsor + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element contrib + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element copyright + (make paragraph + use: article-titlepage-verso-style + (literal (gentext-element-name (current-node))) + (literal "\no-break-space;") + (literal (dingbat "copyright")) + (literal "\no-break-space;") + (process-children))) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (literal " ")))) + + (element (copyright holder) ($charseq$)) + + (element corpauthor + ;; note: article-titlepage-corpauthor takes care of wrapping multiple + ;; corpauthors + (make sequence + (if (first-sibling?) + (if (equal? (gi (parent (current-node))) (normalize "authorgroup")) + (empty-sosofo) + (literal (gentext-by) " ")) + (literal ", ")) + (process-children))) + + (element corpname + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element date + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element edition + (make paragraph + (process-children) + (literal "\no-break-space;") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + ;; Print the editor name. + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (or #t (not in-group)) ; nevermind, always put out the Edited by + (make paragraph + ;; Hack to get the spacing right below the author name line... + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-edited-by)) + (literal "\no-break-space;") + (literal (author-string)))) + (make sequence + (literal (author-string)))))) + + (element firstname + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element graphic + (let* ((nd (current-node)) + (fileref (attribute-string "fileref" nd)) + (entityref (attribute-string "entityref" nd)) + (format (attribute-string "format" nd)) + (align (attribute-string "align" nd))) + (if (or fileref entityref) + (make external-graphic + notation-system-id: (if format format "") + entity-system-id: (if fileref + (graphic-file fileref) + (if entityref + (entity-generated-system-id entityref) + "")) + display?: #t + display-alignment: 'start) + (empty-sosofo)))) + + (element honorific + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element isbn + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element issn + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element itermset (empty-sosofo)) + + (element invpartnumber + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element issuenum + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element jobtitle + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element keywordset + (make paragraph + quadding: 'start + (make sequence + font-weight: 'bold + (literal "Keywords: ")) + (process-children))) + + (element (keyword) + (make sequence + (process-children) + (if (not (last-sibling?)) + (literal ", ") + (literal "")))) + + (element legalnotice + (make display-group + use: article-titlepage-verso-style + ($semiformal-object$))) + + (element (legalnotice title) (empty-sosofo)) + + (element (legalnotice para) + (make paragraph + use: article-titlepage-verso-style + font-size: (* (inherited-font-size) 0.8) + (process-children-trim))) + + (element lineage + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element modespec (empty-sosofo)) + + (element orgdiv + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element orgname + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element othercredit + ;; Print the author name. Handle the case where there's no AUTHORGROUP + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (not in-group) + (make paragraph + ;; Hack to get the spacing right below the author name line... + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-by)) + (literal "\no-break-space;") + (literal (author-list-string)))) + (make sequence + (literal (author-list-string)))))) + + (element othername + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element pagenums + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element printhistory + (make display-group + use: article-titlepage-verso-style + (process-children))) + + (element productname + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element productnumber + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element pubdate + (make paragraph + (literal (gentext-element-name-space (gi (current-node)))) + (process-children))) + + (element publisher + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element publishername + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element pubsnumber + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element releaseinfo + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element revhistory + (make sequence + (make paragraph + use: article-titlepage-verso-style + font-family-name: %title-font-family% + font-weight: 'bold + space-before: (* (HSIZE 3) %head-before-factor%) + space-after: (/ (* (HSIZE 1) %head-before-factor%) 2) + (literal (gentext-element-name (current-node)))) + (make table + before-row-border: #f + (process-children)))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark"))) + (revdescription (select-elements (descendants (current-node)) + (normalize "revdescription")))) + (make sequence + (make table-row + cell-after-row-border: #f + (make table-cell + column-number: 1 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + (if (node-list-empty? revnumber) + (empty-sosofo) + (make paragraph + use: article-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-element-name-space (current-node))) + (process-node-list revnumber)))) + (make table-cell + column-number: 2 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (node-list-empty? revdate) + (empty-sosofo) + (make paragraph + use: article-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revdate)))) + (make table-cell + column-number: 3 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (node-list-empty? revauthor) + (empty-sosofo) + (make paragraph + use: article-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-revised-by)) + (process-node-list revauthor))))) + (make table-row + cell-after-row-border: #f + (make table-cell + column-number: 1 + n-columns-spanned: 3 + n-rows-spanned: 1 + start-indent: 0pt + (cond ((not (node-list-empty? revremark)) + (make paragraph + use: article-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + space-after: (if (last-sibling?) + 0pt + (/ %block-sep% 2)) + (process-node-list revremark))) + ((not (node-list-empty? revdescription)) + (make sequence + use: article-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revdescription))) + (else (empty-sosofo)))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + (element (revision revdescription) (process-children)) + + (element seriesvolnums + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element shortaffil + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element subjectset (empty-sosofo)) + + (element subtitle + (make sequence + font-family-name: %title-font-family% + font-weight: 'bold + (literal (if (first-sibling?) ": " "; ")) + (process-children))) + + (element surname + (make paragraph + use: article-titlepage-verso-style + (process-children))) + + (element title + (make sequence + font-family-name: %title-font-family% + font-weight: 'bold + (with-mode title-mode + (process-children)))) + + (element formalpara ($para-container$)) + (element (formalpara title) ($runinhead$)) + (element (formalpara para) (make sequence (process-children))) + + (element titleabbrev (empty-sosofo)) + + (element volumenum + (make paragraph + use: article-titlepage-verso-style + (process-children))) + +) + +;; == Title pages for REFERENCEs ======================================== + +(define (reference-titlepage-recto-elements) + (list (normalize "title") + (normalize "subtitle") + (normalize "corpauthor") + (normalize "authorgroup") + (normalize "author") + (normalize "editor"))) + +(define (reference-titlepage-verso-elements) + '()) + +(define (reference-titlepage-content? elements side) + (titlepage-content? elements (if (equal? side 'recto) + (reference-titlepage-recto-elements) + (reference-titlepage-verso-elements)))) + +(define (reference-titlepage elements #!optional (side 'recto)) + (let ((nodelist (titlepage-nodelist + (if (equal? side 'recto) + (reference-titlepage-recto-elements) + (reference-titlepage-verso-elements)) + elements)) + ;; partintro is a special case... + (partintro (node-list-first + (node-list-filter-by-gi elements (list (normalize "partintro")))))) + (if (reference-titlepage-content? elements side) + (make simple-page-sequence + page-n-columns: %titlepage-n-columns% + input-whitespace-treatment: 'collapse + use: default-text-style + + ;; This hack is required for the RTF backend. If an external-graphic + ;; is the first thing on the page, RTF doesn't seem to do the right + ;; thing (the graphic winds up on the baseline of the first line + ;; of the page, left justified). This "one point rule" fixes + ;; that problem. + (make paragraph + line-spacing: 1pt + (literal "")) + + (let loop ((nl nodelist) (lastnode (empty-node-list))) + (if (node-list-empty? nl) + (empty-sosofo) + (make sequence + (if (or (node-list-empty? lastnode) + (not (equal? (gi (node-list-first nl)) + (gi lastnode)))) + (reference-titlepage-before (node-list-first nl) side) + (empty-sosofo)) + (cond + ((equal? (gi (node-list-first nl)) (normalize "abbrev")) + (reference-titlepage-abbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "abstract")) + (reference-titlepage-abstract (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "address")) + (reference-titlepage-address (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "affiliation")) + (reference-titlepage-affiliation (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "artpagenums")) + (reference-titlepage-artpagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "author")) + (reference-titlepage-author (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorblurb")) + (reference-titlepage-authorblurb (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorgroup")) + (reference-titlepage-authorgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "authorinitials")) + (reference-titlepage-authorinitials (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bibliomisc")) + (reference-titlepage-bibliomisc (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "biblioset")) + (reference-titlepage-biblioset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "bookbiblio")) + (reference-titlepage-bookbiblio (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "citetitle")) + (reference-titlepage-citetitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "collab")) + (reference-titlepage-collab (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "confgroup")) + (reference-titlepage-confgroup (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractnum")) + (reference-titlepage-contractnum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contractsponsor")) + (reference-titlepage-contractsponsor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "contrib")) + (reference-titlepage-contrib (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "copyright")) + (reference-titlepage-copyright (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpauthor")) + (reference-titlepage-corpauthor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "corpname")) + (reference-titlepage-corpname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "date")) + (reference-titlepage-date (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "edition")) + (reference-titlepage-edition (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "editor")) + (reference-titlepage-editor (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "firstname")) + (reference-titlepage-firstname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "graphic")) + (reference-titlepage-graphic (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "honorific")) + (reference-titlepage-honorific (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "indexterm")) + (reference-titlepage-indexterm (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "invpartnumber")) + (reference-titlepage-invpartnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "isbn")) + (reference-titlepage-isbn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issn")) + (reference-titlepage-issn (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "issuenum")) + (reference-titlepage-issuenum (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "itermset")) + (reference-titlepage-itermset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "keywordset")) + (reference-titlepage-keywordset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "legalnotice")) + (reference-titlepage-legalnotice (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "lineage")) + (reference-titlepage-lineage (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "mediaobject")) + (reference-titlepage-mediaobject (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "modespec")) + (reference-titlepage-modespec (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "orgname")) + (reference-titlepage-orgname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othercredit")) + (reference-titlepage-othercredit (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "othername")) + (reference-titlepage-othername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pagenums")) + (reference-titlepage-pagenums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "printhistory")) + (reference-titlepage-printhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productname")) + (reference-titlepage-productname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "productnumber")) + (reference-titlepage-productnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubdate")) + (reference-titlepage-pubdate (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publisher")) + (reference-titlepage-publisher (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "publishername")) + (reference-titlepage-publishername (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "pubsnumber")) + (reference-titlepage-pubsnumber (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "releaseinfo")) + (reference-titlepage-releaseinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "revhistory")) + (reference-titlepage-revhistory (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesinfo")) + (reference-titlepage-seriesinfo (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "seriesvolnums")) + (reference-titlepage-seriesvolnums (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subjectset")) + (reference-titlepage-subjectset (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "subtitle")) + (reference-titlepage-subtitle (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "surname")) + (reference-titlepage-surname (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "title")) + (reference-titlepage-title (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "titleabbrev")) + (reference-titlepage-titleabbrev (node-list-first nl) side)) + ((equal? (gi (node-list-first nl)) (normalize "volumenum")) + (reference-titlepage-volumenum (node-list-first nl) side)) + (else + (reference-titlepage-default (node-list-first nl) side))) + (loop (node-list-rest nl) (node-list-first nl))))) + + (if (and %generate-reference-toc% + %generate-reference-toc-on-titlepage% + (equal? side 'recto)) + (make display-group + (build-toc (current-node) + (toc-depth (current-node)))) + (empty-sosofo)) + + ;; PartIntro is a special case + (if (and (equal? side 'recto) + (not (node-list-empty? partintro)) + %generate-partintro-on-titlepage%) + ($process-partintro$ partintro #f) + (empty-sosofo))) + + (empty-sosofo)))) + +(define (reference-titlepage-before node side) + (if (equal? side 'recto) + (cond + ((equal? (gi node) (normalize "corpauthor")) + (make paragraph + space-after: (* (HSIZE 5) %head-after-factor% 8) + (literal "\no-break-space;"))) + ((equal? (gi node) (normalize "authorgroup")) + (if (have-sibling? (normalize "corpauthor") node) + (empty-sosofo) + (make paragraph + space-after: (* (HSIZE 5) %head-after-factor% 8) + (literal "\no-break-space;")))) + ((equal? (gi node) (normalize "author")) + (if (or (have-sibling? (normalize "corpauthor") node) + (have-sibling? (normalize "authorgroup") node)) + (empty-sosofo) + (make paragraph + space-after: (* (HSIZE 5) %head-after-factor% 8) + (literal "\no-break-space;")))) + (else (empty-sosofo))) + (empty-sosofo))) + +(define (reference-titlepage-default node side) + (let ((foo (debug (string-append "No reference-titlepage-* for " (gi node) "!")))) + (empty-sosofo))) + +(define (reference-titlepage-element node side) + (if (equal? side 'recto) + (with-mode reference-titlepage-recto-mode + (process-node-list node)) + (with-mode reference-titlepage-verso-mode + (process-node-list node)))) + +(define (reference-titlepage-abbrev node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-abstract node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-address node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-affiliation node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-artpagenums node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-author node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-authorblurb node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-authorgroup node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-authorinitials node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-bibliomisc node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-biblioset node side) + (reference-titlepage node side)) +(define (reference-titlepage-bookbiblio node side) + (reference-titlepage node side)) +(define (reference-titlepage-citetitle node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-collab node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-confgroup node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-contractnum node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-contractsponsor node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-contrib node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-copyright node side) + (reference-titlepage-element node side)) + +(define (reference-titlepage-corpauthor node side) + (if (equal? side 'recto) + (book-titlepage-element node side) + (if (first-sibling? node) + (make paragraph + (with-mode book-titlepage-verso-mode + (process-node-list + (select-elements (children (parent node)) + (normalize "corpauthor"))))) + (empty-sosofo)))) + +(define (reference-titlepage-corpname node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-date node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-edition node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-editor node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-firstname node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-graphic node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-honorific node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-indexterm node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-invpartnumber node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-isbn node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-issn node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-issuenum node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-itermset node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-keywordset node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-legalnotice node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-lineage node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-mediaobject node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-modespec node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-orgname node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-othercredit node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-othername node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-pagenums node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-printhistory node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-productname node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-productnumber node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-pubdate node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-publisher node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-publishername node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-pubsnumber node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-releaseinfo node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-revhistory node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-seriesinfo node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-seriesvolnums node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-subjectset node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-subtitle node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-surname node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-title node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-titleabbrev node side) + (reference-titlepage-element node side)) +(define (reference-titlepage-volumenum node side) + (reference-titlepage-element node side)) + +(define reference-titlepage-recto-style + (style + font-family-name: %title-font-family% + font-weight: 'bold + font-size: (HSIZE 1))) + +(define reference-titlepage-verso-style + (style + font-family-name: %body-font-family%)) + +(mode reference-titlepage-recto-mode + (element abbrev + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element abstract + (make display-group + use: reference-titlepage-recto-style + quadding: 'start + ($semiformal-object$))) + + (element (abstract title) (empty-sosofo)) + + (element (abstract para) + (make paragraph + use: reference-titlepage-recto-style + quadding: 'start + (process-children))) + + (element address + (make display-group + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element affiliation + (make display-group + use: reference-titlepage-recto-style + (process-children))) + + (element artpagenums + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element author + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make paragraph + use: reference-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor%) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal author-name)) + (process-node-list author-affil)))) + + (element authorblurb + (make display-group + use: reference-titlepage-recto-style + quadding: 'start + (process-children))) + + (element (authorblurb para) + (make paragraph + use: reference-titlepage-recto-style + quadding: 'start + (process-children))) + + (element authorgroup + (make display-group + (process-children))) + + (element authorinitials + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element bibliomisc (process-children)) + + (element bibliomset (process-children)) + + (element collab + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element confgroup + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element contractnum + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element contractsponsor + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element contrib + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element copyright + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + space-before: (* (HSIZE 2) %head-before-factor%) + (literal (gentext-element-name (current-node))) + (literal "\no-break-space;") + (literal (dingbat "copyright")) + (literal "\no-break-space;") + (process-children))) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (literal " ")))) + + (element (copyright holder) ($charseq$)) + + (element corpauthor + (make sequence + (make paragraph + use: reference-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor%) + quadding: %division-title-quadding% + keep-with-next?: #t + (process-children)) + ;; This paragraph is a hack to get the spacing right. + ;; Authors always have an affiliation paragraph below them, even if + ;; it's empty, so corpauthors need one too. + (make paragraph + use: reference-titlepage-recto-style + font-size: (HSIZE 1) + line-spacing: (* (HSIZE 1) %line-spacing-factor%) + space-after: (* (HSIZE 2) %head-after-factor% 4) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal "\no-break-space;")))) + + (element corpname + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element date + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element edition + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children) + (literal "\no-break-space;") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + (let ((editor-name (author-string))) + (make sequence + (if (first-sibling?) + (make paragraph + use: reference-titlepage-recto-style + font-size: (HSIZE 1) + line-spacing: (* (HSIZE 1) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor% 6) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal (gentext-edited-by))) + (empty-sosofo)) + (make paragraph + use: reference-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-after: (* (HSIZE 2) %head-after-factor% 4) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal editor-name))))) + + (element firstname + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element graphic + (let* ((nd (current-node)) + (fileref (attribute-string "fileref" nd)) + (entityref (attribute-string "entityref" nd)) + (format (attribute-string "format" nd)) + (align (attribute-string "align" nd))) + (if (or fileref entityref) + (make external-graphic + notation-system-id: (if format format "") + entity-system-id: (if fileref + (graphic-file fileref) + (if entityref + (entity-generated-system-id entityref) + "")) + display?: #t + display-alignment: 'center) + (empty-sosofo)))) + + (element honorific + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element isbn + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element issn + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element itermset (empty-sosofo)) + + (element invpartnumber + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element issuenum + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element jobtitle + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element keywordset + (make paragraph + quadding: 'start + (make sequence + font-weight: 'bold + (literal "Keywords: ")) + (process-children))) + + (element (keyword) + (make sequence + (process-children) + (if (not (last-sibling?)) + (literal ", ") + (literal "")))) + + (element legalnotice + (make display-group + use: reference-titlepage-recto-style + ($semiformal-object$))) + + (element (legalnotice title) (empty-sosofo)) + + (element (legalnotice para) + (make paragraph + use: reference-titlepage-recto-style + quadding: 'start + line-spacing: (* 0.8 (inherited-line-spacing)) + font-size: (* 0.8 (inherited-font-size)) + (process-children))) + + (element lineage + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element modespec (empty-sosofo)) + + (element orgdiv + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element orgname + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element othercredit + (let ((author-name (author-string)) + (author-affil (select-elements (children (current-node)) + (normalize "affiliation")))) + (make sequence + (make paragraph + use: reference-titlepage-recto-style + font-size: (HSIZE 3) + line-spacing: (* (HSIZE 3) %line-spacing-factor%) + space-before: (* (HSIZE 2) %head-before-factor%) + quadding: %division-title-quadding% + keep-with-next?: #t + (literal author-name)) + (process-node-list author-affil)))) + + (element othername + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element pagenums + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element printhistory + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element productname + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element productnumber + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element pubdate + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element publisher + (make display-group + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element publishername + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element pubsnumber + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element releaseinfo + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element revhistory + (make sequence + (make paragraph + use: reference-titlepage-recto-style + space-before: (* (HSIZE 3) %head-before-factor%) + space-after: (/ (* (HSIZE 1) %head-before-factor%) 2) + (literal (gentext-element-name (current-node)))) + (make table + before-row-border: #f + (process-children)))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark"))) + (revdescription (select-elements (descendants (current-node)) + (normalize "revdescription")))) + (make sequence + (make table-row + (make table-cell + column-number: 1 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + (if (not (node-list-empty? revnumber)) + (make paragraph + use: reference-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-element-name-space (current-node))) + (process-node-list revnumber)) + (empty-sosofo))) + (make table-cell + column-number: 2 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (not (node-list-empty? revdate)) + (make paragraph + use: reference-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revdate)) + (empty-sosofo))) + (make table-cell + column-number: 3 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (not (node-list-empty? revauthor)) + (make paragraph + use: reference-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make table-row + cell-after-row-border: #f + (make table-cell + column-number: 1 + n-columns-spanned: 3 + n-rows-spanned: 1 + start-indent: 0pt + (cond ((not (node-list-empty? revremark)) + (make paragraph + use: reference-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + space-after: (if (last-sibling?) + 0pt + (/ %block-sep% 2)) + (process-node-list revremark))) + ((not (node-list-empty? revdescription)) + (make sequence + use: reference-titlepage-recto-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revdescription))) + (else (empty-sosofo)))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + (element (revision revdescription) (process-children)) + + (element seriesvolnums + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element shortaffil + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element subjectset (empty-sosofo)) + + (element subtitle + (make paragraph + use: reference-titlepage-recto-style + font-size: (HSIZE 4) + line-spacing: (* (HSIZE 4) %line-spacing-factor%) + space-before: (* (HSIZE 4) %head-before-factor%) + quadding: %division-subtitle-quadding% + keep-with-next?: #t + (process-children-trim))) + + (element surname + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) + + (element title + (let ((ref (ancestor-member (current-node) + (list (normalize "reference"))))) + (make paragraph + use: reference-titlepage-recto-style + font-size: (HSIZE 5) + line-spacing: (* (HSIZE 5) %line-spacing-factor%) + space-before: (* (HSIZE 5) %head-before-factor%) + quadding: %division-title-quadding% + keep-with-next?: #t + heading-level: (if %generate-heading-level% 1 0) + (literal (element-label ref) + (gentext-label-title-sep (gi ref))) + (with-mode title-mode + (process-children))))) + + (element formalpara ($para-container$)) + (element (formalpara title) ($runinhead$)) + (element (formalpara para) (make sequence (process-children))) + + (element titleabbrev (empty-sosofo)) + + (element volumenum + (make paragraph + use: reference-titlepage-recto-style + quadding: %division-title-quadding% + (process-children))) +) + +(mode reference-titlepage-verso-mode + (element abbrev + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element abstract ($semiformal-object$)) + + (element (abstract title) (empty-sosofo)) + + (element address + (make display-group + use: reference-titlepage-verso-style + (with-mode titlepage-address-mode + ($linespecific-display$ %indent-address-lines% %number-address-lines%)))) + + (element affiliation + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element artpagenums + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element author + ;; Print the author name. Handle the case where there's no AUTHORGROUP + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (not in-group) + (make paragraph + ;; Hack to get the spacing right below the author name line... + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-by)) + (literal "\no-break-space;") + (literal (author-list-string)))) + (make sequence + (literal (author-list-string)))))) + + (element authorblurb + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element authorgroup + (make paragraph + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-by)) + (literal "\no-break-space;") + (process-children-trim)))) + + (element authorinitials + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element bibliomisc (process-children)) + + (element bibliomset (process-children)) + + (element collab + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element confgroup + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element contractnum + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element contractsponsor + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element contrib + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element copyright + (make paragraph + use: reference-titlepage-verso-style + (literal (gentext-element-name (current-node))) + (literal "\no-break-space;") + (literal (dingbat "copyright")) + (literal "\no-break-space;") + (process-children))) + + (element (copyright year) + (make sequence + (process-children) + (if (not (last-sibling? (current-node))) + (literal ", ") + (literal " ")))) + + (element (copyright holder) ($charseq$)) + + (element corpauthor + ;; note: reference-titlepage-corpauthor takes care of wrapping multiple + ;; corpauthors + (make sequence + (if (first-sibling?) + (if (equal? (gi (parent (current-node))) (normalize "authorgroup")) + (empty-sosofo) + (literal (gentext-by) " ")) + (literal ", ")) + (process-children))) + + (element corpname + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element date + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element edition + (make paragraph + (process-children) + (literal "\no-break-space;") + (literal (gentext-element-name-space (gi (current-node)))))) + + (element editor + ;; Print the editor name. + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (or #t (not in-group)) ; nevermind, always put out the Edited by + (make paragraph + ;; Hack to get the spacing right below the author name line... + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-edited-by)) + (literal "\no-break-space;") + (literal (author-string)))) + (make sequence + (literal (author-string)))))) + + (element firstname + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element graphic + (let* ((nd (current-node)) + (fileref (attribute-string "fileref" nd)) + (entityref (attribute-string "entityref" nd)) + (format (attribute-string "format" nd)) + (align (attribute-string "align" nd))) + (if (or fileref entityref) + (make external-graphic + notation-system-id: (if format format "") + entity-system-id: (if fileref + (graphic-file fileref) + (if entityref + (entity-generated-system-id entityref) + "")) + display?: #t + display-alignment: 'start) + (empty-sosofo)))) + + (element honorific + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element isbn + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element issn + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element itermset (empty-sosofo)) + + (element invpartnumber + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element issuenum + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element jobtitle + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element keywordset + (make paragraph + quadding: 'start + (make sequence + font-weight: 'bold + (literal "Keywords: ")) + (process-children))) + + (element (keyword) + (make sequence + (process-children) + (if (not (last-sibling?)) + (literal ", ") + (literal "")))) + + (element legalnotice + (make display-group + use: reference-titlepage-verso-style + ($semiformal-object$))) + + (element (legalnotice title) (empty-sosofo)) + + (element (legalnotice para) + (make paragraph + use: reference-titlepage-verso-style + font-size: (* (inherited-font-size) 0.8) + (process-children-trim))) + + (element lineage + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element modespec (empty-sosofo)) + + (element orgdiv + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element orgname + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element othercredit + ;; Print the author name. Handle the case where there's no AUTHORGROUP + (let ((in-group (have-ancestor? (normalize "authorgroup") (current-node)))) + (if (not in-group) + (make paragraph + ;; Hack to get the spacing right below the author name line... + space-after: (* %bf-size% %line-spacing-factor%) + (make sequence + (literal (gentext-by)) + (literal "\no-break-space;") + (literal (author-list-string)))) + (make sequence + (literal (author-list-string)))))) + + (element othername + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element pagenums + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element printhistory + (make display-group + use: reference-titlepage-verso-style + (process-children))) + + (element productname + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element productnumber + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element pubdate + (make paragraph + (literal (gentext-element-name-space (gi (current-node)))) + (process-children))) + + (element publisher + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element publishername + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element pubsnumber + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element releaseinfo + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element revhistory + (make sequence + (make paragraph + use: reference-titlepage-verso-style + space-before: (* (HSIZE 3) %head-before-factor%) + space-after: (/ (* (HSIZE 1) %head-before-factor%) 2) + (literal (gentext-element-name (current-node)))) + (make table + before-row-border: #f + (process-children)))) + + (element (revhistory revision) + (let ((revnumber (select-elements (descendants (current-node)) + (normalize "revnumber"))) + (revdate (select-elements (descendants (current-node)) + (normalize "date"))) + (revauthor (select-elements (descendants (current-node)) + (normalize "authorinitials"))) + (revremark (select-elements (descendants (current-node)) + (normalize "revremark"))) + (revdescription (select-elements (descendants (current-node)) + (normalize "revdescription")))) + (make sequence + (make table-row + (make table-cell + column-number: 1 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + (if (not (node-list-empty? revnumber)) + (make paragraph + use: reference-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-element-name-space (current-node))) + (process-node-list revnumber)) + (empty-sosofo))) + (make table-cell + column-number: 2 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (not (node-list-empty? revdate)) + (make paragraph + use: reference-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revdate)) + (empty-sosofo))) + (make table-cell + column-number: 3 + n-columns-spanned: 1 + n-rows-spanned: 1 + start-indent: 0pt + cell-before-column-margin: (if (equal? (print-backend) 'tex) + 6pt + 0pt) + (if (not (node-list-empty? revauthor)) + (make paragraph + use: reference-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (literal (gentext-revised-by)) + (process-node-list revauthor)) + (empty-sosofo)))) + (make table-row + cell-after-row-border: #f + (make table-cell + column-number: 1 + n-columns-spanned: 3 + n-rows-spanned: 1 + start-indent: 0pt + (cond ((not (node-list-empty? revremark)) + (make paragraph + use: reference-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + space-after: (if (last-sibling?) + 0pt + (/ %block-sep% 2)) + (process-node-list revremark))) + ((not (node-list-empty? revdescription)) + (make sequence + use: reference-titlepage-verso-style + font-size: %bf-size% + font-weight: 'medium + (process-node-list revdescription))) + (else (empty-sosofo)))))))) + + (element (revision revnumber) (process-children-trim)) + (element (revision date) (process-children-trim)) + (element (revision authorinitials) (process-children-trim)) + (element (revision revremark) (process-children-trim)) + (element (revision revdescription) (process-children)) + + (element seriesvolnums + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element shortaffil + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element subjectset (empty-sosofo)) + + (element subtitle + (make sequence + font-family-name: %title-font-family% + font-weight: 'bold + (literal (if (first-sibling?) ": " "; ")) + (process-children))) + + (element surname + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + + (element title + (let ((ref (ancestor-member (current-node) + (list (normalize "reference"))))) + (make sequence + font-family-name: %title-font-family% + font-weight: 'bold + (literal (element-label ref) + (gentext-label-title-sep (gi ref))) + (with-mode title-mode + (process-children))))) + + (element formalpara ($para-container$)) + (element (formalpara title) ($runinhead$)) + (element (formalpara para) (make sequence (process-children))) + + (element titleabbrev (empty-sosofo)) + + (element volumenum + (make paragraph + use: reference-titlepage-verso-style + (process-children))) + +) diff --git a/print/dbverb.dsl b/print/dbverb.dsl new file mode 100644 index 0000000..cb22cb1 --- /dev/null +++ b/print/dbverb.dsl @@ -0,0 +1,222 @@ +;; $Id: dbverb.dsl,v 1.6 2004/10/09 19:46:33 petere78 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +(define verbatim-style + (style + font-family-name: %mono-font-family% + font-size: (* (inherited-font-size) + (if %verbatim-size-factor% + %verbatim-size-factor% + 1.0)) + font-weight: 'medium + font-posture: 'upright + line-spacing: (* (* (inherited-font-size) + (if %verbatim-size-factor% + %verbatim-size-factor% + 1.0)) + %line-spacing-factor%) + first-line-start-indent: 0pt + lines: 'asis + input-whitespace-treatment: 'preserve)) + +(define inline-verbatim-style + (style + font-family-name: %mono-font-family% + font-size: (* (inherited-font-size) + (if %verbatim-size-factor% + %verbatim-size-factor% + 1.0)) + font-weight: 'medium + font-posture: 'upright + lines: 'asis + input-whitespace-treatment: 'preserve)) + +(define linespecific-style + (style + first-line-start-indent: 0pt + lines: 'asis + input-whitespace-treatment: 'preserve)) + +(define ($format-indent$ indent) + (literal indent)) + +(define ($format-linenumber$ linenumber) + ;; A line-field would make more sense here, and allow proportional + ;; fonts, but you can't put line-fields in the middle of a paragraph + ;; in the current RTF backend of Jade + (let ((%factor% (if %verbatim-size-factor% + %verbatim-size-factor% + 1.0))) + (if (equal? (remainder linenumber %linenumber-mod%) 0) + (make sequence + use: verbatim-style + (literal (pad-string (format-number linenumber "1") + %linenumber-length% %linenumber-padchar%)) + ($linenumber-space$)) + (make sequence + use: verbatim-style + (literal (pad-string "" %linenumber-length% " ")) + ($linenumber-space$))))) + +(define ($line-start$ indent line-numbers? #!optional (line-number 1)) + (make sequence + (if indent + ($format-indent$ indent) + (empty-sosofo)) + (if line-numbers? + ($format-linenumber$ line-number) + (empty-sosofo)))) + +(define ($linespecific-display$ indent line-numbers?) + (let ((vspace (if (INBLOCK?) + 0pt + (if (INLIST?) + %para-sep% + %block-sep%)))) + (make paragraph + use: linespecific-style + space-before: (if (and (string=? (gi (parent)) (normalize "entry")) + (absolute-first-sibling?)) + 0pt + vspace) + space-after: (if (and (string=? (gi (parent)) (normalize "entry")) + (absolute-last-sibling?)) + 0pt + vspace) + start-indent: (if (INBLOCK?) + (inherited-start-indent) + (+ %block-start-indent% (inherited-start-indent))) + (if (or indent line-numbers?) + ($linespecific-line-by-line$ indent line-numbers?) + (process-children))))) + +(define ($linespecific-line-by-line$ indent line-numbers?) + (let ((expanded-content + ;; this is the content with + ;; inlinemediaobject/imageobject[@format='linespecific'] + ;; expanded + (let loop ((kl (children (current-node))) (rl (empty-node-list))) + (if (node-list-empty? kl) + rl + (if (equal? (gi (node-list-first kl)) + (normalize "inlinemediaobject")) + (let* ((imgobj (node-list-filter-by-gi + (children (node-list-first kl)) + (list (normalize "imageobject")))) + (datobj (node-list-filter-by-gi + (children imgobj) + (list (normalize "imagedata"))))) + (if (and (not (node-list-empty? imgobj)) + (not (node-list-empty? datobj)) + (equal? (attribute-string (normalize "format") datobj) + (normalize "linespecific"))) + (loop (node-list-rest kl) + (node-list rl (string->nodes (include-characters + (if (attribute-string (normalize "fileref") datobj) + (attribute-string (normalize "fileref") datobj) + (entity-generated-system-id (attribute-string (normalize "entityref") datobj))))))) + (loop (node-list-rest kl) + (node-list rl (node-list-first kl))))) + (loop (node-list-rest kl) (node-list rl (node-list-first kl)))))))) + (make sequence + ($line-start$ indent line-numbers? 1) + (let loop ((kl expanded-content) + (linecount 1) + (res (empty-sosofo))) + (if (node-list-empty? kl) + res + (loop + (node-list-rest kl) + (if (char=? (node-property 'char (node-list-first kl) + default: #\U-0000) #\U-000D) + (+ linecount 1) + linecount) + (let ((c (node-list-first kl))) + (if (char=? (node-property 'char c default: #\U-0000) + #\U-000D) + (sosofo-append res + (process-node-list c) + ($line-start$ indent line-numbers? + (+ linecount 1))) + (sosofo-append res (process-node-list c)))))))))) + +(define ($verbatim-display$ indent line-numbers?) + (let* ((width-in-chars (if (attribute-string (normalize "width")) + (string->number (attribute-string (normalize "width"))) + %verbatim-default-width%)) + (fsize (lambda () (if (or (attribute-string (normalize "width")) + (not %verbatim-size-factor%)) + (/ (/ (- %text-width% (inherited-start-indent)) + width-in-chars) + 0.7) + (* (inherited-font-size) + %verbatim-size-factor%)))) + (vspace-before (if (INBLOCK?) + 0pt + (if (INLIST?) + %para-sep% + %block-sep%))) + (vspace-after (if (INBLOCK?) + 0pt + (if (INLIST?) + 0pt + %block-sep%)))) + (make paragraph + use: verbatim-style + space-before: (if (and (string=? (gi (parent)) (normalize "entry")) + (absolute-first-sibling?)) + 0pt + vspace-before) + space-after: (if (and (string=? (gi (parent)) (normalize "entry")) + (absolute-last-sibling?)) + 0pt + vspace-after) + font-size: (fsize) + line-spacing: (* (fsize) %line-spacing-factor%) + start-indent: (if (INBLOCK?) + (inherited-start-indent) + (+ %block-start-indent% (inherited-start-indent))) + (if (or indent line-numbers?) + ($linespecific-line-by-line$ indent line-numbers?) + (process-children))))) + +(element literallayout + (if (equal? (attribute-string "class") (normalize "monospaced")) + ($verbatim-display$ + %indent-literallayout-lines% + (or %number-literallayout-lines% + (equal? (attribute-string (normalize "linenumbering")) + (normalize "numbered")))) + ($linespecific-display$ + %indent-literallayout-lines% + (or %number-literallayout-lines% + (equal? (attribute-string (normalize "linenumbering")) + (normalize "numbered")))))) + +(element address + ($linespecific-display$ + %indent-address-lines% + (or %number-address-lines% + (equal? (attribute-string (normalize "linenumbering")) + (normalize "numbered"))))) + +(element programlisting + ($verbatim-display$ + %indent-programlisting-lines% + (or %number-programlisting-lines% + (equal? (attribute-string (normalize "linenumbering")) + (normalize "numbered"))))) + +(element screen + ($verbatim-display$ + %indent-screen-lines% + (or %number-screen-lines% + (equal? (attribute-string (normalize "linenumbering")) + (normalize "numbered"))))) + +(element screenshot (process-children)) +(element screeninfo (empty-sosofo)) + diff --git a/print/docbook.dsl b/print/docbook.dsl new file mode 100644 index 0000000..512eba1 --- /dev/null +++ b/print/docbook.dsl @@ -0,0 +1,197 @@ + +%dbl10n.ent; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]> + + + + + + +;; $Id: docbook.dsl,v 1.10 2004/10/09 21:36:35 petere78 Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; + +(define if-front-page + (external-procedure "UNREGISTERED::James Clark//Procedure::if-front-page")) + +(define if-first-page + (external-procedure "UNREGISTERED::James Clark//Procedure::if-first-page")) + +(declare-characteristic heading-level + "UNREGISTERED::James Clark//Characteristic::heading-level" 0) + +(declare-characteristic page-number-format + "UNREGISTERED::James Clark//Characteristic::page-number-format" "1") + +(declare-characteristic page-number-restart? + "UNREGISTERED::James Clark//Characteristic::page-number-restart?" #f) + +(declare-characteristic page-two-side? + "UNREGISTERED::OpenJade//Characteristic::page-two-side?" %two-side%) + +(declare-characteristic two-side-start-on-right? + "UNREGISTERED::OpenJade//Characteristic::two-side-start-on-right?" %two-side%) + +(declare-characteristic page-n-columns + "UNREGISTERED::James Clark//Characteristic::page-n-columns" 1) + +(declare-characteristic page-column-sep + "UNREGISTERED::James Clark//Characteristic::page-column-sep" %page-column-sep%) + +(declare-characteristic page-balance-columns? + "UNREGISTERED::James Clark//Characteristic::page-balance-columns?" %page-balance-columns?%) + +;; This allows bottom-of-page footnotes +(declare-flow-object-class page-footnote + "UNREGISTERED::Sebastian Rahtz//Flow Object Class::page-footnote") + +;; This allows formal objects to float +(declare-flow-object-class page-float + "UNREGISTERED::Sebastian Rahtz//Flow Object Class::page-float") + +(define read-entity + (external-procedure "UNREGISTERED::James Clark//Procedure::read-entity")) + +(define all-element-number + (external-procedure "UNREGISTERED::James Clark//Procedure::all-element-number")) + +(define debug + (external-procedure "UNREGISTERED::James Clark//Procedure::debug")) + +;; Make text that comes from unimplemented tags easy to spot +(default + (let* ((colr-space (color-space + "ISO/IEC 10179:1996//Color-Space Family::Device RGB")) + (red (color colr-space 1 0 0))) + (make sequence + color: red + (process-children)))) + +&dbcommon.dsl; +&dbctable.dsl; + +&dbl10n.dsl; + +&dbadmon.dsl; +&dbautoc.dsl; +&dbbibl.dsl; +&dbblock.dsl; +&dbcallou.dsl; +&dbcompon.dsl; +&dbdivis.dsl; +&dbgloss.dsl; +&dbgraph.dsl; +&dbindex.dsl; +&dbinfo.dsl; +&dbinline.dsl; +&dblink.dsl; +&dblists.dsl; +&dblot.dsl; +&dbmath.dsl; +&dbmsgset.dsl; +&dbprint.dsl; +&dbprocdr.dsl; +&dbqanda.dsl; +&dbrfntry.dsl; +&dbsect.dsl; +&dbsynop.dsl; +&dbefsyn.dsl; +&dbtable.dsl; +&dbtitle.dsl; +&dbttlpg.dsl; +&dbverb.dsl; +&version.dsl; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/print/notoc.dsl b/print/notoc.dsl new file mode 100644 index 0000000..ffa8c56 --- /dev/null +++ b/print/notoc.dsl @@ -0,0 +1,29 @@ + +]> + + + + + +;; $Id: notoc.dsl,v 1.3 2003/01/15 08:24:23 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; +;; Example of a customization layer on top of the modular docbook style +;; sheet. Definitions inserted in this file take precedence over +;; definitions in the 'use'd stylesheet(s). + +(define %generate-set-toc% #f) +(define %generate-book-toc% #f) +(define %generate-part-toc% #f) +(define %generate-reference-toc% #f) +(define %generate-article-toc% #f) + + + + + + + diff --git a/print/plain.dsl b/print/plain.dsl new file mode 100644 index 0000000..d049df4 --- /dev/null +++ b/print/plain.dsl @@ -0,0 +1,37 @@ + +]> + + + + + +;; $Id: plain.dsl,v 1.2 2003/01/15 08:24:23 adicarlo Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://docbook.sourceforge.net/projects/dsssl/ +;; +;; Example of a customization layer on top of the modular docbook style +;; sheet. Definitions inserted in this file take precedence over +;; definitions in the 'use'd stylesheet(s). + +(define %generate-set-titlepage% #f) +(define %generate-book-titlepage% #f) +(define %generate-part-titlepage% #f) +(define %generate-reference-titlepage% #f) +(define %generate-article-titlepage% #f) + +(define %generate-set-toc% #f) +(define %generate-book-toc% #f) +(define %generate-part-toc% #f) +(define %generate-reference-toc% #f) +(define %generate-article-toc% #f) + +(define %generate-book-lot-list% '()) + + + + + + + diff --git a/print/version.dsl b/print/version.dsl new file mode 100644 index 0000000..cee6faf --- /dev/null +++ b/print/version.dsl @@ -0,0 +1,14 @@ +;; $Id: version.dsl,v 1.2 2004/07/11 06:21:00 nyraghu Exp $ +;; +;; This file is part of the Modular DocBook Stylesheet distribution. +;; See ../README or http://www.nwalsh.com/docbook/dsssl/ +;; + +;; If **ANY** change is made to this file, you _MUST_ alter the +;; following definition: + +(define (stylesheet-version) + (string-append + "Modular DocBook Print Stylesheet Version " + ;; Trim off bounding white space. + (strip "&VERSION;"))) -- 2.7.4