@pretextbook/pretext-html 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/README.md +104 -4
  2. package/assets/preview-html.xsl +230 -230
  3. package/assets/upstream.json +7 -7
  4. package/assets/xsl/entities.ent +154 -154
  5. package/assets/xsl/extract-asymptote.xsl +68 -68
  6. package/assets/xsl/extract-biblio-csl.xsl +327 -327
  7. package/assets/xsl/extract-datafile.xsl +71 -71
  8. package/assets/xsl/extract-dynamic.xsl +139 -139
  9. package/assets/xsl/extract-identity.xsl +136 -136
  10. package/assets/xsl/extract-interactive.xsl +81 -81
  11. package/assets/xsl/extract-latex-image.xsl +118 -118
  12. package/assets/xsl/extract-mermaid.xsl +58 -58
  13. package/assets/xsl/extract-mom.xsl +63 -63
  14. package/assets/xsl/extract-pg.xsl +2897 -2897
  15. package/assets/xsl/extract-prefigure.xsl +157 -157
  16. package/assets/xsl/extract-qrcode.xsl +100 -100
  17. package/assets/xsl/extract-runestone-page-template.xsl +139 -139
  18. package/assets/xsl/extract-sageplot.xsl +166 -166
  19. package/assets/xsl/extract-stack.xsl +56 -56
  20. package/assets/xsl/extract-trace.xsl +134 -134
  21. package/assets/xsl/extract-youtube.xsl +63 -63
  22. package/assets/xsl/html-symbols.xsl +3344 -3344
  23. package/assets/xsl/latex/pretext-latex-AIM.xsl +56 -56
  24. package/assets/xsl/latex/pretext-latex-CLP.xsl +148 -148
  25. package/assets/xsl/latex/pretext-latex-chaos.xsl +317 -317
  26. package/assets/xsl/latex/pretext-latex-dyslexic-font.xsl +76 -76
  27. package/assets/xsl/latex/pretext-latex-guide.xsl +104 -104
  28. package/assets/xsl/latex/pretext-latex-texstyle.xsl +862 -862
  29. package/assets/xsl/localizations/af-ZA.xml +276 -276
  30. package/assets/xsl/localizations/bg-BG.xml +276 -276
  31. package/assets/xsl/localizations/ca-ES.xml +285 -285
  32. package/assets/xsl/localizations/cs-CZ.xml +280 -280
  33. package/assets/xsl/localizations/de-DE.xml +281 -281
  34. package/assets/xsl/localizations/en-US.xml +427 -427
  35. package/assets/xsl/localizations/es-ES.xml +287 -287
  36. package/assets/xsl/localizations/fi-FI.xml +275 -275
  37. package/assets/xsl/localizations/fr-CA.xml +276 -276
  38. package/assets/xsl/localizations/fr-FR.xml +280 -280
  39. package/assets/xsl/localizations/hu-HU.xml +280 -280
  40. package/assets/xsl/localizations/it-IT.xml +276 -276
  41. package/assets/xsl/localizations/ku-CKB.xml +275 -275
  42. package/assets/xsl/localizations/localizations.xml +48 -48
  43. package/assets/xsl/localizations/nl-NL.xml +275 -275
  44. package/assets/xsl/localizations/pt-BR.xml +288 -288
  45. package/assets/xsl/localizations/pt-PT.xml +292 -292
  46. package/assets/xsl/localizations/zh-HANS.xml +269 -269
  47. package/assets/xsl/pretext-assembly.xsl +4795 -4795
  48. package/assets/xsl/pretext-basic-html.xsl +86 -86
  49. package/assets/xsl/pretext-beamer.xsl +662 -662
  50. package/assets/xsl/pretext-braille-preprint.xsl +2249 -2249
  51. package/assets/xsl/pretext-common.xsl +12018 -12018
  52. package/assets/xsl/pretext-dynamic.xsl +65 -65
  53. package/assets/xsl/pretext-epub.xsl +1483 -1483
  54. package/assets/xsl/pretext-fo.xsl +4593 -4593
  55. package/assets/xsl/pretext-html.xsl +14791 -14791
  56. package/assets/xsl/pretext-json-manifest.xsl +150 -150
  57. package/assets/xsl/pretext-jupyter.xsl +868 -868
  58. package/assets/xsl/pretext-latex-classic.xsl +952 -952
  59. package/assets/xsl/pretext-latex-common.xsl +11563 -11563
  60. package/assets/xsl/pretext-latex.xsl +47 -47
  61. package/assets/xsl/pretext-litprog.xsl +105 -105
  62. package/assets/xsl/pretext-merge.xsl +41 -41
  63. package/assets/xsl/pretext-numbers.xsl +875 -875
  64. package/assets/xsl/pretext-revealjs.xsl +522 -522
  65. package/assets/xsl/pretext-runestone-fitb.xsl +1233 -1233
  66. package/assets/xsl/pretext-runestone-static.xsl +1438 -1438
  67. package/assets/xsl/pretext-runestone.xsl +3083 -3083
  68. package/assets/xsl/pretext-sage-doctest.xsl +289 -289
  69. package/assets/xsl/pretext-smc.xsl +492 -492
  70. package/assets/xsl/pretext-solution-manual-latex.xsl +323 -323
  71. package/assets/xsl/pretext-text-utilities.xsl +1217 -1217
  72. package/assets/xsl/pretext-text.xsl +392 -392
  73. package/assets/xsl/pretext-units.xsl +195 -195
  74. package/assets/xsl/pretext-view-source.xsl +157 -157
  75. package/assets/xsl/pretext-ww-problem-sets.xsl +391 -391
  76. package/assets/xsl/publisher-variables.xsl +4756 -4756
  77. package/assets/xsl/support/extract-math.xsl +256 -256
  78. package/assets/xsl/support/package-math.xsl +141 -141
  79. package/assets/xsl/support/play-button/play-button.svg +3 -3
  80. package/assets/xsl/support/pretext-pg-macros.xsl +110 -110
  81. package/assets/xsl/support/webpack_static_imports.xml +14 -14
  82. package/assets/xsl/tests/null.xml +3 -3
  83. package/assets/xsl/tests/pretext-text-utilities-test.xsl +333 -333
  84. package/assets/xsl/utilities/author-report.xsl +107 -107
  85. package/assets/xsl/utilities/deprecate-autoname.sed +18 -18
  86. package/assets/xsl/utilities/deprecate-index.sed +33 -33
  87. package/assets/xsl/utilities/fix-deprecations.xsl +663 -663
  88. package/assets/xsl/utilities/pretext-enhanced-source.xsl +112 -112
  89. package/assets/xsl/utilities/report-publisher-variables.xsl +162 -162
  90. package/assets/xsl/xml-to-json.xsl +326 -326
  91. package/assets/xsl/xml-to-string.xsl +328 -328
  92. package/assets/xsl-bundle.json +1 -0
  93. package/dist/{cli-C6tfAVvi.js → cli-B2LiKunq.js} +268 -233
  94. package/dist/cli.js +1 -1
  95. package/dist/host.browser.d.ts +29 -0
  96. package/dist/host.d.ts +41 -0
  97. package/dist/index.browser.d.ts +29 -0
  98. package/dist/index.browser.js +650 -0
  99. package/dist/index.d.ts +5 -0
  100. package/dist/index.js +16 -8
  101. package/dist/internal/posix-path.d.ts +59 -0
  102. package/dist/mounts.d.ts +18 -0
  103. package/dist/renderer.d.ts +14 -1
  104. package/dist/theme.d.ts +68 -0
  105. package/dist/theme.js +93 -0
  106. package/package.json +22 -4
@@ -1,154 +1,154 @@
1
- <!-- ********************************************************************* -->
2
- <!-- Copyright 2016 -->
3
- <!-- Robert A. Beezer -->
4
- <!-- -->
5
- <!-- This file is part of MathBook XML. -->
6
- <!-- -->
7
- <!-- MathBook XML is free software: you can redistribute it and/or modify -->
8
- <!-- it under the terms of the GNU General Public License as published by -->
9
- <!-- the Free Software Foundation, either version 2 or version 3 of the -->
10
- <!-- License (at your option). -->
11
- <!-- -->
12
- <!-- MathBook XML is distributed in the hope that it will be useful, -->
13
- <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
14
- <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
15
- <!-- GNU General Public License for more details. -->
16
- <!-- -->
17
- <!-- You should have received a copy of the GNU General Public License -->
18
- <!-- along with MathBook XML. If not, see <http://www.gnu.org/licenses/>. -->
19
- <!-- ********************************************************************* -->
20
-
21
- <!-- XSLT Cookbook, 2nd Edition -->
22
- <!-- Copyright 2006, O'Reilly Media, Inc. -->
23
- <!-- Declaration and entity definition format from Recipe 2.8 -->
24
- <!-- Unicode strings from http://stackoverflow.com/questions/586231 -->
25
- <!ENTITY UPPERCASE "'ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞŸŽŠŒ'">
26
- <!ENTITY LOWERCASE "'abcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ'">
27
-
28
- <!-- Some more of our own design -->
29
- <!ENTITY DIGIT "'0123456789'">
30
- <!ENTITY ALPHABET "'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'">
31
- <!ENTITY SIMPLECHAR "concat(&DIGIT;,&ALPHABET;)">
32
-
33
- <!-- for match/select -->
34
- <!ENTITY STRUCTURAL "book|article|slideshow|letter|memo|frontmatter|part|chapter|appendix|index|preface|acknowledgement|biography|foreword|dedication|colophon|section|subsection|subsubsection|slide|exercises|worksheet|handout|reading-questions|solutions|references|glossary|backmatter">
35
-
36
- <!ENTITY TRADITIONAL-DIVISION "book|article|part|chapter|section|subsection|subsubsection|appendix">
37
-
38
- <!ENTITY SPECIALIZED-DIVISION "exercises|worksheet|handout|reading-questions|references|glossary|solutions">
39
-
40
- <!-- for filtering nodes, eg *[&STRUCTURAL-FILTER;], *[not(&STRUCTURAL-FILTER;)] -->
41
- <!ENTITY STRUCTURAL-FILTER "self::book or self::article or self::slideshow or self::letter or self::memo or self::frontmatter or self::part or self::chapter or self::appendix or self::index or self::preface or self::acknowledgement or self::biography or self::foreword or self::dedication or self::colophon or self::section or self::subsection or self::subsubsection or self::slide or self::exercises or self::worksheet or self::handout or self::reading-questions or self::solutions or self::references or self::glossary or self::backmatter">
42
-
43
- <!ENTITY TRADITIONAL-DIVISION-FILTER "self::book or self::article or self::part or self::chapter or self::section or self::subsection or self::subsubsection or self::appendix">
44
-
45
- <!ENTITY SPECIALIZED-DIVISION-FILTER "self::exercises or self::worksheet or self::handout or self::reading-questions or self::references or self::glossary or self::solutions">
46
-
47
- <!-- NB: (2019-06-12) Only the two metadata "filters" seem to -->
48
- <!-- be in use, so only those are being maintained. grep'ing on -->
49
- <!-- METADATA v. METADATA-FILTER, and applying "wc" makes this evident. -->
50
- <!-- (Include this comment in count!) -->
51
-
52
- <!-- typical items in blocks that get special treatment -->
53
- <!ENTITY METADATA "title|subtitle|caption|idx|index">
54
- <!ENTITY METADATA-FILTER "self::title or self::subtitle or self::caption or self::idx or self::index[not(index-list)]">
55
-
56
- <!-- Subdivisions and runs of paragraphs (like in a proof) -->
57
- <!-- contain "invisible" items that get killed and then -->
58
- <!-- used/accessed other ways. To see if something is -->
59
- <!--first, last, preceded, or followed by other significant -->
60
- <!-- items requires filtering out these items in forming a -->
61
- <!-- node-set (so as to not be confused by their presence) -->
62
- <!-- A super-lightweight "article" might have "frontmatter" -->
63
- <!-- and "backmatter" as peers of content elements, and in -->
64
- <!-- other cases it should not be a problem -->
65
- <!-- Typical use: *[not(&SUBDIVISION-METADATA-FILTER;)] -->
66
- <!ENTITY SUBDIVISION-METADATA "title|subtitle|index|notation|todo|frontmatter|backmatter">
67
- <!ENTITY SUBDIVISION-METADATA-FILTER "self::title or self::subtitle or self::idx or self::index[not(index-list)] or self::notation or self::todo or self::frontmatter or self::backmatter">
68
-
69
- <!-- To implement a new category of blocks, search on -->
70
- <!-- "PROJECT-" (case-sensitive) since we will mark -->
71
- <!-- non-obvious locations with the string PROJECT-LIKE -->
72
- <!-- as we immplement this on 2016-07-17, other entities -->
73
- <!-- below will also match this short form -->
74
-
75
- <!-- definition, just a plain statement, but logically distinct -->
76
- <!ENTITY DEFINITION-LIKE "definition">
77
- <!ENTITY DEFINITION-FILTER "self::definition">
78
-
79
- <!-- statement + proof -->
80
- <!ENTITY THEOREM-LIKE "theorem|corollary|lemma|algorithm|proposition|claim|fact|identity">
81
- <!ENTITY THEOREM-FILTER "self::theorem or self::corollary or self::lemma or self::algorithm or self::proposition or self::claim or self::fact or self::identity">
82
-
83
- <!-- varieties of proofs -->
84
- <!ENTITY PROOF-LIKE "proof|argument|justification|reasoning|explanation">
85
- <!ENTITY PROOF-FILTER "self::proof or self::argument or self::justification or self::reasoning or self::explanation">
86
-
87
- <!-- three types of PROOF-LIKE -->
88
- <!-- in THEOREM-LIKE, detached/standalone, in solutions -->
89
- <!-- INNER-PROOF-FILTER only used where heading levels are controlled -->
90
- <!-- SOLUTION-PROOF-FILTER used extensively to control LaTeX environments/macros/styling -->
91
- <!-- standalone/detached is just everything else (in division, or paragraphs, or...) -->
92
- <!ENTITY INNER-PROOF-FILTER "(&PROOF-FILTER;) and (parent::theorem or parent::corollary or parent::lemma or parent::algorithm or parent::proposition or parent::claim or parent::fact or parent::identity)">
93
- <!ENTITY SOLUTION-PROOF-FILTER "(&PROOF-FILTER;) and (ancestor::hint or ancestor::answer or ancestor::solution)">
94
-
95
- <!-- a mathematical statement, but never with a proof -->
96
- <!ENTITY AXIOM-LIKE "axiom|conjecture|principle|heuristic|hypothesis|assumption">
97
- <!ENTITY AXIOM-FILTER "self::axiom or self::conjecture or self::principle or self::heuristic or self::hypothesis or self::assumption">
98
-
99
- <!-- narrative, set off for structure, reference -->
100
- <!ENTITY REMARK-LIKE "remark|convention|note|observation|warning|insight">
101
- <!ENTITY REMARK-FILTER "self::remark or self::convention or self::note or self::observation or self::warning or self::insight">
102
-
103
- <!-- about computations or technology -->
104
- <!ENTITY COMPUTATION-LIKE "computation|technology|data">
105
- <!ENTITY COMPUTATION-FILTER "self::computation or self::technology or self::data">
106
-
107
- <!-- incidental, skippable, lightweight -->
108
- <!ENTITY ASIDE-LIKE "aside|biographical|historical">
109
- <!ENTITY ASIDE-FILTER "self::aside or self::biographical or self::historical">
110
-
111
- <!-- blocks, or statement + solution -->
112
- <!ENTITY EXAMPLE-LIKE "example|question|problem">
113
- <!ENTITY EXAMPLE-FILTER "self::example or self::question or self::problem">
114
-
115
- <!-- blocks, or statement + solution -->
116
- <!-- save off lab, laboratory, experiment for science -->
117
- <!-- NB: update comprehensive list in the Guide with any additions -->
118
- <!ENTITY PROJECT-LIKE "project|activity|exploration|investigation">
119
- <!ENTITY PROJECT-FILTER "self::project or self::activity or self::exploration or self::investigation">
120
-
121
- <!-- blocks with meta-information in lists -->
122
- <!-- TODO: add in "standards", "goals" -->
123
- <!-- NB: update comprehensive list in the Guide with any additions -->
124
- <!ENTITY GOAL-LIKE "objectives|outcomes">
125
- <!ENTITY GOAL-FILTER "self::objectives or self::outcomes">
126
-
127
- <!-- Open = research question/problem/conjecture -->
128
- <!ENTITY OPENPROBLEM-LIKE "openproblem|openquestion|openconjecture">
129
- <!ENTITY OPENPROBLEM-FILTER "self::openproblem or self::openquestion or self::openconjecture">
130
-
131
- <!-- displays with captions -->
132
- <!ENTITY FIGURE-LIKE "figure|table|listing|list">
133
- <!ENTITY FIGURE-FILTER "self::figure or self::table or self::listing or self::list">
134
-
135
- <!-- Composite filters for the numbering "serial-stamp" pass. The -->
136
- <!-- "fundamental" blocks always share the overall blocks counter; a -->
137
- <!-- "top" figure-like is a captioned display that earns a number (a -->
138
- <!-- panel inside a captioned side-by-side earns a letter instead). -->
139
- <!ENTITY FUNDAMENTAL-BLOCK-FILTER "(&DEFINITION-FILTER;) or (&THEOREM-FILTER;) or (&AXIOM-FILTER;) or (&REMARK-FILTER;) or (&COMPUTATION-FILTER;) or (&EXAMPLE-FILTER;)">
140
- <!ENTITY TOP-FIGURE-FILTER "(&FIGURE-FILTER;) and not(parent::sidebyside/parent::figure or parent::sidebyside/parent::sbsgroup/parent::figure)">
141
-
142
- <!-- appendages of examples, exercises, tasks -->
143
- <!ENTITY SOLUTION-LIKE "hint|answer|solution">
144
- <!ENTITY SOLUTION-FILTER "self::hint or self::answer or self::solution">
145
-
146
- <!-- appendages of OPENPROBLEM-LIKE -->
147
- <!ENTITY DISCUSSION-LIKE "context|discussion|opinion|status|suggestion">
148
- <!ENTITY DISCUSSION-FILTER "self::context or self::discussion or self::opinion or self::status or self::suggestion">
149
-
150
- <!-- When context is an inline "exercise", then this condition is -->
151
- <!-- true. We are positive, so as new locations of "exercise" -->
152
- <!-- are added, then this need not change -->
153
- <!-- Typical use: self::exercise and boolean(&INLINE-EXERCISE-FILTER;) -->
154
- <!ENTITY INLINE-EXERCISE-FILTER "parent::article|parent::paragraphs|parent::chapter|parent::appendix|parent::section|parent::subsection|parent::subsubsection|parent::handout">
1
+ <!-- ********************************************************************* -->
2
+ <!-- Copyright 2016 -->
3
+ <!-- Robert A. Beezer -->
4
+ <!-- -->
5
+ <!-- This file is part of MathBook XML. -->
6
+ <!-- -->
7
+ <!-- MathBook XML is free software: you can redistribute it and/or modify -->
8
+ <!-- it under the terms of the GNU General Public License as published by -->
9
+ <!-- the Free Software Foundation, either version 2 or version 3 of the -->
10
+ <!-- License (at your option). -->
11
+ <!-- -->
12
+ <!-- MathBook XML is distributed in the hope that it will be useful, -->
13
+ <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
14
+ <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
15
+ <!-- GNU General Public License for more details. -->
16
+ <!-- -->
17
+ <!-- You should have received a copy of the GNU General Public License -->
18
+ <!-- along with MathBook XML. If not, see <http://www.gnu.org/licenses/>. -->
19
+ <!-- ********************************************************************* -->
20
+
21
+ <!-- XSLT Cookbook, 2nd Edition -->
22
+ <!-- Copyright 2006, O'Reilly Media, Inc. -->
23
+ <!-- Declaration and entity definition format from Recipe 2.8 -->
24
+ <!-- Unicode strings from http://stackoverflow.com/questions/586231 -->
25
+ <!ENTITY UPPERCASE "'ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞŸŽŠŒ'">
26
+ <!ENTITY LOWERCASE "'abcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ'">
27
+
28
+ <!-- Some more of our own design -->
29
+ <!ENTITY DIGIT "'0123456789'">
30
+ <!ENTITY ALPHABET "'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'">
31
+ <!ENTITY SIMPLECHAR "concat(&DIGIT;,&ALPHABET;)">
32
+
33
+ <!-- for match/select -->
34
+ <!ENTITY STRUCTURAL "book|article|slideshow|letter|memo|frontmatter|part|chapter|appendix|index|preface|acknowledgement|biography|foreword|dedication|colophon|section|subsection|subsubsection|slide|exercises|worksheet|handout|reading-questions|solutions|references|glossary|backmatter">
35
+
36
+ <!ENTITY TRADITIONAL-DIVISION "book|article|part|chapter|section|subsection|subsubsection|appendix">
37
+
38
+ <!ENTITY SPECIALIZED-DIVISION "exercises|worksheet|handout|reading-questions|references|glossary|solutions">
39
+
40
+ <!-- for filtering nodes, eg *[&STRUCTURAL-FILTER;], *[not(&STRUCTURAL-FILTER;)] -->
41
+ <!ENTITY STRUCTURAL-FILTER "self::book or self::article or self::slideshow or self::letter or self::memo or self::frontmatter or self::part or self::chapter or self::appendix or self::index or self::preface or self::acknowledgement or self::biography or self::foreword or self::dedication or self::colophon or self::section or self::subsection or self::subsubsection or self::slide or self::exercises or self::worksheet or self::handout or self::reading-questions or self::solutions or self::references or self::glossary or self::backmatter">
42
+
43
+ <!ENTITY TRADITIONAL-DIVISION-FILTER "self::book or self::article or self::part or self::chapter or self::section or self::subsection or self::subsubsection or self::appendix">
44
+
45
+ <!ENTITY SPECIALIZED-DIVISION-FILTER "self::exercises or self::worksheet or self::handout or self::reading-questions or self::references or self::glossary or self::solutions">
46
+
47
+ <!-- NB: (2019-06-12) Only the two metadata "filters" seem to -->
48
+ <!-- be in use, so only those are being maintained. grep'ing on -->
49
+ <!-- METADATA v. METADATA-FILTER, and applying "wc" makes this evident. -->
50
+ <!-- (Include this comment in count!) -->
51
+
52
+ <!-- typical items in blocks that get special treatment -->
53
+ <!ENTITY METADATA "title|subtitle|caption|idx|index">
54
+ <!ENTITY METADATA-FILTER "self::title or self::subtitle or self::caption or self::idx or self::index[not(index-list)]">
55
+
56
+ <!-- Subdivisions and runs of paragraphs (like in a proof) -->
57
+ <!-- contain "invisible" items that get killed and then -->
58
+ <!-- used/accessed other ways. To see if something is -->
59
+ <!--first, last, preceded, or followed by other significant -->
60
+ <!-- items requires filtering out these items in forming a -->
61
+ <!-- node-set (so as to not be confused by their presence) -->
62
+ <!-- A super-lightweight "article" might have "frontmatter" -->
63
+ <!-- and "backmatter" as peers of content elements, and in -->
64
+ <!-- other cases it should not be a problem -->
65
+ <!-- Typical use: *[not(&SUBDIVISION-METADATA-FILTER;)] -->
66
+ <!ENTITY SUBDIVISION-METADATA "title|subtitle|index|notation|todo|frontmatter|backmatter">
67
+ <!ENTITY SUBDIVISION-METADATA-FILTER "self::title or self::subtitle or self::idx or self::index[not(index-list)] or self::notation or self::todo or self::frontmatter or self::backmatter">
68
+
69
+ <!-- To implement a new category of blocks, search on -->
70
+ <!-- "PROJECT-" (case-sensitive) since we will mark -->
71
+ <!-- non-obvious locations with the string PROJECT-LIKE -->
72
+ <!-- as we immplement this on 2016-07-17, other entities -->
73
+ <!-- below will also match this short form -->
74
+
75
+ <!-- definition, just a plain statement, but logically distinct -->
76
+ <!ENTITY DEFINITION-LIKE "definition">
77
+ <!ENTITY DEFINITION-FILTER "self::definition">
78
+
79
+ <!-- statement + proof -->
80
+ <!ENTITY THEOREM-LIKE "theorem|corollary|lemma|algorithm|proposition|claim|fact|identity">
81
+ <!ENTITY THEOREM-FILTER "self::theorem or self::corollary or self::lemma or self::algorithm or self::proposition or self::claim or self::fact or self::identity">
82
+
83
+ <!-- varieties of proofs -->
84
+ <!ENTITY PROOF-LIKE "proof|argument|justification|reasoning|explanation">
85
+ <!ENTITY PROOF-FILTER "self::proof or self::argument or self::justification or self::reasoning or self::explanation">
86
+
87
+ <!-- three types of PROOF-LIKE -->
88
+ <!-- in THEOREM-LIKE, detached/standalone, in solutions -->
89
+ <!-- INNER-PROOF-FILTER only used where heading levels are controlled -->
90
+ <!-- SOLUTION-PROOF-FILTER used extensively to control LaTeX environments/macros/styling -->
91
+ <!-- standalone/detached is just everything else (in division, or paragraphs, or...) -->
92
+ <!ENTITY INNER-PROOF-FILTER "(&PROOF-FILTER;) and (parent::theorem or parent::corollary or parent::lemma or parent::algorithm or parent::proposition or parent::claim or parent::fact or parent::identity)">
93
+ <!ENTITY SOLUTION-PROOF-FILTER "(&PROOF-FILTER;) and (ancestor::hint or ancestor::answer or ancestor::solution)">
94
+
95
+ <!-- a mathematical statement, but never with a proof -->
96
+ <!ENTITY AXIOM-LIKE "axiom|conjecture|principle|heuristic|hypothesis|assumption">
97
+ <!ENTITY AXIOM-FILTER "self::axiom or self::conjecture or self::principle or self::heuristic or self::hypothesis or self::assumption">
98
+
99
+ <!-- narrative, set off for structure, reference -->
100
+ <!ENTITY REMARK-LIKE "remark|convention|note|observation|warning|insight">
101
+ <!ENTITY REMARK-FILTER "self::remark or self::convention or self::note or self::observation or self::warning or self::insight">
102
+
103
+ <!-- about computations or technology -->
104
+ <!ENTITY COMPUTATION-LIKE "computation|technology|data">
105
+ <!ENTITY COMPUTATION-FILTER "self::computation or self::technology or self::data">
106
+
107
+ <!-- incidental, skippable, lightweight -->
108
+ <!ENTITY ASIDE-LIKE "aside|biographical|historical">
109
+ <!ENTITY ASIDE-FILTER "self::aside or self::biographical or self::historical">
110
+
111
+ <!-- blocks, or statement + solution -->
112
+ <!ENTITY EXAMPLE-LIKE "example|question|problem">
113
+ <!ENTITY EXAMPLE-FILTER "self::example or self::question or self::problem">
114
+
115
+ <!-- blocks, or statement + solution -->
116
+ <!-- save off lab, laboratory, experiment for science -->
117
+ <!-- NB: update comprehensive list in the Guide with any additions -->
118
+ <!ENTITY PROJECT-LIKE "project|activity|exploration|investigation">
119
+ <!ENTITY PROJECT-FILTER "self::project or self::activity or self::exploration or self::investigation">
120
+
121
+ <!-- blocks with meta-information in lists -->
122
+ <!-- TODO: add in "standards", "goals" -->
123
+ <!-- NB: update comprehensive list in the Guide with any additions -->
124
+ <!ENTITY GOAL-LIKE "objectives|outcomes">
125
+ <!ENTITY GOAL-FILTER "self::objectives or self::outcomes">
126
+
127
+ <!-- Open = research question/problem/conjecture -->
128
+ <!ENTITY OPENPROBLEM-LIKE "openproblem|openquestion|openconjecture">
129
+ <!ENTITY OPENPROBLEM-FILTER "self::openproblem or self::openquestion or self::openconjecture">
130
+
131
+ <!-- displays with captions -->
132
+ <!ENTITY FIGURE-LIKE "figure|table|listing|list">
133
+ <!ENTITY FIGURE-FILTER "self::figure or self::table or self::listing or self::list">
134
+
135
+ <!-- Composite filters for the numbering "serial-stamp" pass. The -->
136
+ <!-- "fundamental" blocks always share the overall blocks counter; a -->
137
+ <!-- "top" figure-like is a captioned display that earns a number (a -->
138
+ <!-- panel inside a captioned side-by-side earns a letter instead). -->
139
+ <!ENTITY FUNDAMENTAL-BLOCK-FILTER "(&DEFINITION-FILTER;) or (&THEOREM-FILTER;) or (&AXIOM-FILTER;) or (&REMARK-FILTER;) or (&COMPUTATION-FILTER;) or (&EXAMPLE-FILTER;)">
140
+ <!ENTITY TOP-FIGURE-FILTER "(&FIGURE-FILTER;) and not(parent::sidebyside/parent::figure or parent::sidebyside/parent::sbsgroup/parent::figure)">
141
+
142
+ <!-- appendages of examples, exercises, tasks -->
143
+ <!ENTITY SOLUTION-LIKE "hint|answer|solution">
144
+ <!ENTITY SOLUTION-FILTER "self::hint or self::answer or self::solution">
145
+
146
+ <!-- appendages of OPENPROBLEM-LIKE -->
147
+ <!ENTITY DISCUSSION-LIKE "context|discussion|opinion|status|suggestion">
148
+ <!ENTITY DISCUSSION-FILTER "self::context or self::discussion or self::opinion or self::status or self::suggestion">
149
+
150
+ <!-- When context is an inline "exercise", then this condition is -->
151
+ <!-- true. We are positive, so as new locations of "exercise" -->
152
+ <!-- are added, then this need not change -->
153
+ <!-- Typical use: self::exercise and boolean(&INLINE-EXERCISE-FILTER;) -->
154
+ <!ENTITY INLINE-EXERCISE-FILTER "parent::article|parent::paragraphs|parent::chapter|parent::appendix|parent::section|parent::subsection|parent::subsubsection|parent::handout">
@@ -1,68 +1,68 @@
1
- <?xml version='1.0'?>
2
-
3
- <!--********************************************************************
4
- Copyright 2014-2016 Robert A. Beezer
5
-
6
- This file is part of MathBook XML.
7
-
8
- MathBook XML is free software: you can redistribute it and/or modify
9
- it under the terms of the GNU General Public License as published by
10
- the Free Software Foundation, either version 2 or version 3 of the
11
- License (at your option).
12
-
13
- MathBook XML is distributed in the hope that it will be useful,
14
- but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- GNU General Public License for more details.
17
-
18
- You should have received a copy of the GNU General Public License
19
- along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
20
- *********************************************************************-->
21
-
22
- <!-- This stylesheet locates <asymptote> elements -->
23
- <!-- and wraps them for processing by the "asy" exectuable -->
24
- <!-- This includes the LaTeX macros present in docinfo -->
25
-
26
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
27
- xmlns:xml="http://www.w3.org/XML/1998/namespace"
28
- xmlns:exsl="http://exslt.org/common"
29
- extension-element-prefixes="exsl"
30
- >
31
-
32
- <!-- Get internal ID's for filenames, etc -->
33
- <!-- Standard conversion groundwork -->
34
- <xsl:import href="./publisher-variables.xsl"/>
35
- <xsl:import href="./pretext-assembly.xsl"/>
36
- <xsl:import href="./pretext-common.xsl"/>
37
-
38
- <!-- Get a "subtree" xml:id value -->
39
- <!-- Then walk the XML source tree -->
40
- <!-- applying specializations below -->
41
- <xsl:import href="./extract-identity.xsl" />
42
-
43
- <!-- Output Asymptote code as text -->
44
- <xsl:output method="text" encoding="UTF-8"/>
45
-
46
- <!-- Asymptote graphics to standalone file -->
47
- <!-- Prepend document's macros, otherwise no changes -->
48
- <xsl:template match="asymptote" mode="extraction">
49
- <xsl:variable name="filebase">
50
- <xsl:apply-templates select="." mode="image-source-basename"/>
51
- </xsl:variable>
52
- <!-- Do not use directories here, as Windows paths will get mangled -->
53
- <!-- Instead, set working directory before applying stylesheet -->
54
- <exsl:document href="{$filebase}.asy" method="text">
55
- <xsl:text>usepackage("amsmath");&#xa;</xsl:text>
56
- <xsl:call-template name="sanitize-text">
57
- <xsl:with-param name="text">
58
- <xsl:value-of select="$docinfo/asymptote-preamble"/>
59
- </xsl:with-param>
60
- </xsl:call-template>
61
- <xsl:text>texpreamble("&#xa;</xsl:text>
62
- <xsl:value-of select="$latex-macros" />
63
- <xsl:text>");&#xa;&#xa;</xsl:text>
64
- <xsl:value-of select="."/>
65
- </exsl:document>
66
- </xsl:template>
67
-
68
- </xsl:stylesheet>
1
+ <?xml version='1.0'?>
2
+
3
+ <!--********************************************************************
4
+ Copyright 2014-2016 Robert A. Beezer
5
+
6
+ This file is part of MathBook XML.
7
+
8
+ MathBook XML is free software: you can redistribute it and/or modify
9
+ it under the terms of the GNU General Public License as published by
10
+ the Free Software Foundation, either version 2 or version 3 of the
11
+ License (at your option).
12
+
13
+ MathBook XML is distributed in the hope that it will be useful,
14
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ GNU General Public License for more details.
17
+
18
+ You should have received a copy of the GNU General Public License
19
+ along with MathBook XML. If not, see <http://www.gnu.org/licenses/>.
20
+ *********************************************************************-->
21
+
22
+ <!-- This stylesheet locates <asymptote> elements -->
23
+ <!-- and wraps them for processing by the "asy" exectuable -->
24
+ <!-- This includes the LaTeX macros present in docinfo -->
25
+
26
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
27
+ xmlns:xml="http://www.w3.org/XML/1998/namespace"
28
+ xmlns:exsl="http://exslt.org/common"
29
+ extension-element-prefixes="exsl"
30
+ >
31
+
32
+ <!-- Get internal ID's for filenames, etc -->
33
+ <!-- Standard conversion groundwork -->
34
+ <xsl:import href="./publisher-variables.xsl"/>
35
+ <xsl:import href="./pretext-assembly.xsl"/>
36
+ <xsl:import href="./pretext-common.xsl"/>
37
+
38
+ <!-- Get a "subtree" xml:id value -->
39
+ <!-- Then walk the XML source tree -->
40
+ <!-- applying specializations below -->
41
+ <xsl:import href="./extract-identity.xsl" />
42
+
43
+ <!-- Output Asymptote code as text -->
44
+ <xsl:output method="text" encoding="UTF-8"/>
45
+
46
+ <!-- Asymptote graphics to standalone file -->
47
+ <!-- Prepend document's macros, otherwise no changes -->
48
+ <xsl:template match="asymptote" mode="extraction">
49
+ <xsl:variable name="filebase">
50
+ <xsl:apply-templates select="." mode="image-source-basename"/>
51
+ </xsl:variable>
52
+ <!-- Do not use directories here, as Windows paths will get mangled -->
53
+ <!-- Instead, set working directory before applying stylesheet -->
54
+ <exsl:document href="{$filebase}.asy" method="text">
55
+ <xsl:text>usepackage("amsmath");&#xa;</xsl:text>
56
+ <xsl:call-template name="sanitize-text">
57
+ <xsl:with-param name="text">
58
+ <xsl:value-of select="$docinfo/asymptote-preamble"/>
59
+ </xsl:with-param>
60
+ </xsl:call-template>
61
+ <xsl:text>texpreamble("&#xa;</xsl:text>
62
+ <xsl:value-of select="$latex-macros" />
63
+ <xsl:text>");&#xa;&#xa;</xsl:text>
64
+ <xsl:value-of select="."/>
65
+ </exsl:document>
66
+ </xsl:template>
67
+
68
+ </xsl:stylesheet>