@pretextbook/pretext-html 0.7.0 → 0.9.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.
- package/README.md +31 -2
- package/assets/preview-html.xsl +16 -0
- package/assets/upstream.json +1 -1
- package/assets/xsl/README.md +25 -24
- package/assets/xsl/entities.ent +11 -0
- package/assets/xsl/extract-dynamic.xsl +54 -3
- package/assets/xsl/extract-gdscript.xsl +61 -0
- package/assets/xsl/extract-sageplot.xsl +3 -0
- package/assets/xsl/localizations/README.md +24 -24
- package/assets/xsl/localizations/it-IT.xml +37 -41
- package/assets/xsl/pretext-assembly.xsl +190 -30
- package/assets/xsl/pretext-beamer.xsl +57 -12
- package/assets/xsl/pretext-common.xsl +175 -30
- package/assets/xsl/pretext-epub.xsl +4 -6
- package/assets/xsl/pretext-fo.xsl +127 -67
- package/assets/xsl/pretext-html.xsl +350 -94
- package/assets/xsl/pretext-jupyter.xsl +1 -0
- package/assets/xsl/pretext-latex-classic.xsl +2 -2
- package/assets/xsl/pretext-latex-common.xsl +296 -151
- package/assets/xsl/pretext-latex.xsl +16 -6
- package/assets/xsl/pretext-numbers.xsl +10 -0
- package/assets/xsl/pretext-revealjs.xsl +69 -4
- package/assets/xsl/pretext-runestone-fitb.xsl +179 -84
- package/assets/xsl/pretext-runestone-static.xsl +72 -20
- package/assets/xsl/pretext-runestone.xsl +32 -25
- package/assets/xsl/pretext-text-utilities.xsl +7 -0
- package/assets/xsl/pretext-text.xsl +17 -0
- package/assets/xsl/publisher-variables.xsl +109 -111
- package/assets/xsl/support/play-button/README.md +1 -3
- package/assets/xsl/tests/README.md +1 -1
- package/assets/xsl/utilities/README.md +6 -8
- package/assets/xsl-bundle.json +1 -1
- package/dist/cli-BUrNZxov.js +1098 -0
- package/dist/cli.js +1 -1
- package/dist/html-static.d.ts +20 -0
- package/dist/index.browser.js +598 -374
- package/dist/index.d.ts +4 -0
- package/dist/index.js +35 -30
- package/dist/renderer.d.ts +40 -1
- package/dist/skeleton.d.ts +41 -0
- package/dist/xrefs.d.ts +54 -0
- package/package.json +2 -1
- package/dist/cli-D0m0Ha1j.js +0 -856
package/README.md
CHANGED
|
@@ -273,8 +273,9 @@ Two further notes:
|
|
|
273
273
|
option. Feature-detect with `"Suspending" in WebAssembly` (exported as
|
|
274
274
|
`isJspiAvailable()`) before adding the flag rather than assuming it is
|
|
275
275
|
needed.
|
|
276
|
-
- Network access _for the rendered page_ (theme css/js
|
|
277
|
-
`cdn.jsdelivr.net`). The transform itself runs fully
|
|
276
|
+
- Network access _for the rendered page_ (theme css/js, MathJax and Runestone
|
|
277
|
+
Services come from `cdn.jsdelivr.net`). The transform itself runs fully
|
|
278
|
+
offline.
|
|
278
279
|
|
|
279
280
|
## How it works
|
|
280
281
|
|
|
@@ -312,6 +313,34 @@ Two further notes:
|
|
|
312
313
|
computes ever reaches a real filesystem — with `FILESYSTEM=0` they are all
|
|
313
314
|
virtual, ending up as mount keys or `.ptx.invalid` URL segments. The result
|
|
314
315
|
has no `node:` imports at all; rollup fails the build if one survives.
|
|
316
|
+
6. **Pinned CDN assets + Runestone Services** — `src/html-static.ts` is
|
|
317
|
+
generated by `scripts/refresh-runestone.mjs` and names one
|
|
318
|
+
[`html-static`](https://github.com/PreTeXtBook/html-static) release, which
|
|
319
|
+
every render passes as `cli.version`. That release is where PreTeXt's css/js
|
|
320
|
+
come from, and also where the Runestone Services bundle lives, whose
|
|
321
|
+
filenames are captured from the same release's
|
|
322
|
+
`dist/_static/webpack_static_imports.xml` and passed as `rs-js` / `rs-css` /
|
|
323
|
+
`rs-version`. Refresh with `npm run refresh-runestone` (a full
|
|
324
|
+
`npm run refresh:xsl` does it too).
|
|
325
|
+
|
|
326
|
+
### Runestone interactive exercises
|
|
327
|
+
|
|
328
|
+
Multiple choice, Parsons problems, fill-in-the-blank, ActiveCode and the rest
|
|
329
|
+
are rendered by the stylesheets as inert markup — `<div
|
|
330
|
+
data-component="parsons">` and friends — that only becomes an exercise once
|
|
331
|
+
Runestone's JavaScript runs. Upstream links that JavaScript from the `rs-js` /
|
|
332
|
+
`rs-css` string parameters, which the Python CLI supplies and this renderer now
|
|
333
|
+
supplies too, so the exercises work in a preview.
|
|
334
|
+
|
|
335
|
+
This is unrelated to `<platform runestone="yes">`, which selects hosting on a
|
|
336
|
+
Runestone _server_ (accounts, stored grades, `$b-host-runestone`). Previews are
|
|
337
|
+
always ordinary web builds — `eBookConfig.useRunestoneServices = false` — and
|
|
338
|
+
the components run client-side, exactly as in a `platform="web"` build.
|
|
339
|
+
|
|
340
|
+
Because the bundle filenames are content-hashed, they are only valid for the
|
|
341
|
+
`html-static` release they were captured from; that is why `cli.version` is
|
|
342
|
+
pinned rather than left at upstream's `latest`. Pass an empty `rs-js`/`rs-css`
|
|
343
|
+
through `stringParams` to link no Runestone code at all.
|
|
315
344
|
|
|
316
345
|
## Limitations (current WASM build)
|
|
317
346
|
|
package/assets/preview-html.xsl
CHANGED
|
@@ -210,6 +210,22 @@
|
|
|
210
210
|
|
|
211
211
|
</xsl:template>
|
|
212
212
|
|
|
213
|
+
<!-- Chunk at the subtree root's own level, so a fragment preview can name a -->
|
|
214
|
+
<!-- division of any depth as $subtree. Without this, portable's chunk level -->
|
|
215
|
+
<!-- of 0 makes upstream abort on every division below the document root. -->
|
|
216
|
+
<!-- See SUBTREE_CHUNK_LEVEL_OVERRIDE in refresh-xsl.mjs. -->
|
|
217
|
+
<xsl:param name="subtree-level" select="''"/>
|
|
218
|
+
<xsl:variable name="chunk-level">
|
|
219
|
+
<xsl:choose>
|
|
220
|
+
<xsl:when test="$subtree != '' and $subtree-level != ''">
|
|
221
|
+
<xsl:value-of select="number($subtree-level)"/>
|
|
222
|
+
</xsl:when>
|
|
223
|
+
<xsl:otherwise>
|
|
224
|
+
<xsl:value-of select="$html-chunk-level"/>
|
|
225
|
+
</xsl:otherwise>
|
|
226
|
+
</xsl:choose>
|
|
227
|
+
</xsl:variable>
|
|
228
|
+
|
|
213
229
|
<!-- Show the print-preview button on printouts, but inert: the page it would -->
|
|
214
230
|
<!-- reload with "?printpreview=<id>" does not exist for an in-memory render, -->
|
|
215
231
|
<!-- and a host that resolves that query against its own URL sends the reader -->
|
package/assets/upstream.json
CHANGED
package/assets/xsl/README.md
CHANGED
|
@@ -17,34 +17,35 @@ You should have received a copy of the GNU General Public License
|
|
|
17
17
|
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
18
18
|
*****************************************************************-->
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
eXtensible Stylesheet Language (XSL) Stylesheets
|
|
21
|
+
================================================
|
|
21
22
|
|
|
22
23
|
XSL stylesheets are the primary vehicle for converting PreTeXt XML
|
|
23
|
-
source into various output formats.
|
|
24
|
-
simply called "conversions."
|
|
25
|
-
conversions, the list is not exhaustive.
|
|
24
|
+
source into various output formats. As such, they are sometimes
|
|
25
|
+
simply called "conversions." Here we list **some** of the available
|
|
26
|
+
conversions, the list is not exhaustive. See _The PreTeXt Guide_
|
|
26
27
|
for detailed documentation of use, in chapters of the part
|
|
27
28
|
titled _Publisher's Guide_.
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
30
|
+
* `pretext-latex.xsl` - conversion to LaTeX, which can then
|
|
31
|
+
be converted to PDF, in print or electronic flavors.
|
|
32
|
+
* `pretext-html.xsl` - conversion to HTML for online use.
|
|
33
|
+
* `pretext-epub.xsl` - conversion to EPUB, which
|
|
34
|
+
requires significant additional processing. So this stylesheet
|
|
35
|
+
is not meant to be applied in isolation. See the `pretext/pretext`
|
|
36
|
+
Python script for an option to initiate the processing pipeline.
|
|
37
|
+
* `pretext-jupyter.xsl` - conversion to Jupyter notebooks.
|
|
38
|
+
* `pretext-revealjs.xsl` - conversion of slideshows to HTML.
|
|
39
|
+
* `pretext-beamer.xsl` - conversion of slideshows to PDF.
|
|
40
|
+
* `pretext-braille.xsl` - conversion to a precursor for braille output, which
|
|
41
|
+
requires significant further processing. So this stylesheet
|
|
42
|
+
is not meant to be applied in isolation. See the `pretext/pretext`
|
|
43
|
+
Python script for an option to initiate the processing pipeline.
|
|
44
|
+
* `pretext-common.xsl` - base templates, and not useful in isolation.
|
|
45
|
+
* `pretext-assembly.xsl` - pre-processing stylesheet, which creates an
|
|
46
|
+
enhanced version of source. Applied in a controlled way by other stylesheets.
|
|
47
|
+
See the `utilities\pretext-enhanced-source.xsl` stylesheet for a demonstration.
|
|
48
|
+
* `extract-*.xsl` - used to isolate particular parts of a PreTeXt
|
|
49
|
+
document, typically for subsequent processing by a script.
|
|
49
50
|
|
|
50
51
|
(Updated: 2020-06-12)
|
package/assets/xsl/entities.ent
CHANGED
|
@@ -174,6 +174,17 @@
|
|
|
174
174
|
<!ENTITY DISCUSSION-LIKE "context|discussion|opinion|status|suggestion">
|
|
175
175
|
<!ENTITY DISCUSSION-FILTER "self::context or self::discussion or self::opinion or self::status or self::suggestion">
|
|
176
176
|
|
|
177
|
+
<!-- Elements the schema gives text-only content: no PreTeXt markup is -->
|
|
178
|
+
<!-- permitted inside them, whether because they are verbatim (code, a -->
|
|
179
|
+
<!-- graphics language, a LaTeX fragment) or because the element is a -->
|
|
180
|
+
<!-- plain string (a "shortdescription", a bibliography field). Advice -->
|
|
181
|
+
<!-- to replace a stray character with an element cannot be followed in -->
|
|
182
|
+
<!-- these, so the validation-plus stylesheet withholds it there. -->
|
|
183
|
+
<!-- Every name below is text-only in EVERY declaration in the schema. -->
|
|
184
|
+
<!-- Deliberately absent: "author", "editor", "page" and "year", each of -->
|
|
185
|
+
<!-- which is text in one context and markup in another. -->
|
|
186
|
+
<!ENTITY TEXT-ONLY-FILTER "self::DOI or self::ISBN or self::ISSN or self::URL or self::asymptote or self::asymptote-preamble or self::attr or self::blurb or self::c or self::cd or self::cline or self::code or self::document-id or self::dropping-particle or self::edition or self::email or self::family or self::genre or self::genus or self::given or self::holder or self::initialism or self::input or self::issue or self::kbd or self::latex-image or self::latex-image-preamble or self::literal or self::macro-file or self::macros or self::mag or self::mermaid or self::non-dropping-particle or self::number or self::number-of-pages or self::output or self::page-first or self::pages or self::pf or self::pg-code or self::plaintitle or self::postamble or self::pre or self::preamble or self::publisher or self::rename or self::sageplot or self::series or self::shortdescription or self::species or self::static-ordering or self::stdin or self::suffix or self::tag or self::tage or self::volume">
|
|
187
|
+
|
|
177
188
|
<!-- When context is an inline "exercise", then this condition is -->
|
|
178
189
|
<!-- true. We are positive, so as new locations of "exercise" -->
|
|
179
190
|
<!-- are added, then this need not change -->
|
|
@@ -79,9 +79,24 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
79
79
|
<!-- static seed. Results are HTML files -->
|
|
80
80
|
<!-- (despite this stylesheet having text output). -->
|
|
81
81
|
<xsl:template match="*" mode="extraction-wrapper">
|
|
82
|
-
<xsl:text>
|
|
82
|
+
<xsl:text>{
</xsl:text>
|
|
83
|
+
<!-- Remote libraries the publisher has approved for execution -->
|
|
84
|
+
<!-- during a static build. See "remote-library-allowlist" in -->
|
|
85
|
+
<!-- publisher-variables.xsl for why this gate exists. An empty -->
|
|
86
|
+
<!-- list means no exercise may import a library by @url. -->
|
|
87
|
+
<xsl:text>"allowed_remote": [</xsl:text>
|
|
88
|
+
<xsl:for-each select="$remote-library-allowlist">
|
|
89
|
+
<xsl:if test="position() > 1">
|
|
90
|
+
<xsl:text>, </xsl:text>
|
|
91
|
+
</xsl:if>
|
|
92
|
+
<xsl:call-template name="escape-quote-string">
|
|
93
|
+
<xsl:with-param name="text" select="@url"/>
|
|
94
|
+
</xsl:call-template>
|
|
95
|
+
</xsl:for-each>
|
|
96
|
+
<xsl:text>],
</xsl:text>
|
|
97
|
+
<xsl:text>"exercises": [ { "exercise_id": null }</xsl:text>
|
|
83
98
|
<xsl:apply-templates select="." mode="extraction"/>
|
|
84
|
-
<xsl:text>]</xsl:text>
|
|
99
|
+
<xsl:text>]
}</xsl:text>
|
|
85
100
|
</xsl:template>
|
|
86
101
|
|
|
87
102
|
<xsl:template match="exercise[@pi:exercise-interactive='fillin' and setup]
|
|
@@ -103,6 +118,34 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
103
118
|
<!-- exercises, so it would miss unlabeled exercises and tasks. -->
|
|
104
119
|
<xsl:apply-templates select="." mode="assembly-id" />
|
|
105
120
|
<xsl:text>",
</xsl:text>
|
|
121
|
+
<!-- The @assembly-id above is what the substitution pass reads -->
|
|
122
|
+
<!-- back, but it means nothing to an author. Carry the -->
|
|
123
|
+
<!-- @unique-id alongside it purely so that a failure during -->
|
|
124
|
+
<!-- evaluation can name the exercise the way the author sees it. -->
|
|
125
|
+
<xsl:text> "exercise_unique_id": "</xsl:text>
|
|
126
|
+
<xsl:apply-templates select="." mode="unique-id" />
|
|
127
|
+
<xsl:text>",
</xsl:text>
|
|
128
|
+
<!-- Packages and libraries this exercise's setup depends on. -->
|
|
129
|
+
<!-- This mirrors the "dyn_imports" array of the HTML version, -->
|
|
130
|
+
<!-- including its leading "BTM", which the substitution script -->
|
|
131
|
+
<!-- matches as a literal and resolves to the npm package, just -->
|
|
132
|
+
<!-- as the Runestone component does. Keeping the two arrays -->
|
|
133
|
+
<!-- identical means an exercise that loads in a browser loads -->
|
|
134
|
+
<!-- the same way under Node. -->
|
|
135
|
+
<xsl:text> "exercise_imports": [</xsl:text>
|
|
136
|
+
<xsl:text>"BTM"</xsl:text>
|
|
137
|
+
<xsl:for-each select="setup/jsimports/jslibrary">
|
|
138
|
+
<xsl:variable name="import-path">
|
|
139
|
+
<xsl:apply-templates select="." mode="js-import-path"/>
|
|
140
|
+
</xsl:variable>
|
|
141
|
+
<xsl:if test="string-length($import-path) > 0">
|
|
142
|
+
<xsl:text>, </xsl:text>
|
|
143
|
+
<xsl:call-template name="escape-quote-string">
|
|
144
|
+
<xsl:with-param name="text" select="$import-path"/>
|
|
145
|
+
</xsl:call-template>
|
|
146
|
+
</xsl:if>
|
|
147
|
+
</xsl:for-each>
|
|
148
|
+
<xsl:text>],
</xsl:text>
|
|
106
149
|
<xsl:text> "exercise_setup": </xsl:text>
|
|
107
150
|
<xsl:call-template name="dynamic-setup" />
|
|
108
151
|
<xsl:text>,
</xsl:text>
|
|
@@ -116,8 +159,16 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
116
159
|
</xsl:otherwise>
|
|
117
160
|
</xsl:choose>
|
|
118
161
|
<xsl:text>",
</xsl:text>
|
|
162
|
+
<!-- Everything the static version needs a value for. Each entry -->
|
|
163
|
+
<!-- is the @obj (or @ansobj) verbatim, which is a Javascript -->
|
|
164
|
+
<!-- *expression*, not merely a variable name: the HTML version -->
|
|
165
|
+
<!-- drops the same string into a template as [%= ... %] , so -->
|
|
166
|
+
<!-- "_config.date" and the like have to evaluate, not be looked -->
|
|
167
|
+
<!-- up. The substitution script evaluates each one in the scope -->
|
|
168
|
+
<!-- left behind by the setup. Duplicates are harmless; they -->
|
|
169
|
+
<!-- collapse to one entry there. -->
|
|
119
170
|
<xsl:text> "exercise_evals": [</xsl:text>
|
|
120
|
-
<xsl:for-each select="(statement|solution)//eval[@obj]|evaluation//feedback//eval[@obj]|statement//fillin[@ansobj]">
|
|
171
|
+
<xsl:for-each select="(statement|solution)//eval[@obj]|evaluation//test[@correct='yes']/feedback//eval[@obj]|statement//fillin[@ansobj]">
|
|
121
172
|
<xsl:if test="position() > 1">
|
|
122
173
|
<xsl:text>, </xsl:text>
|
|
123
174
|
</xsl:if>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<?xml version='1.0'?>
|
|
2
|
+
|
|
3
|
+
<!--********************************************************************
|
|
4
|
+
Copyright 2026 Robert A. Beezer
|
|
5
|
+
|
|
6
|
+
This file is part of PreTeXt.
|
|
7
|
+
|
|
8
|
+
PreTeXt 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
|
+
PreTeXt 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 PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
*********************************************************************-->
|
|
21
|
+
|
|
22
|
+
<!-- This stylesheet locates "program[@pck]" elements and prepares -->
|
|
23
|
+
<!-- a file necessary to zip a "pck" for each activecode with -->
|
|
24
|
+
<!-- GDScript. -->
|
|
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
|
+
xmlns:str="http://exslt.org/strings"
|
|
30
|
+
extension-element-prefixes="exsl"
|
|
31
|
+
>
|
|
32
|
+
|
|
33
|
+
<!-- Get internal ID's for filenames, etc -->
|
|
34
|
+
<!-- Standard conversion groundwork -->
|
|
35
|
+
<xsl:import href="./publisher-variables.xsl"/>
|
|
36
|
+
<xsl:import href="./pretext-assembly.xsl"/>
|
|
37
|
+
<xsl:import href="./pretext-common.xsl"/>
|
|
38
|
+
|
|
39
|
+
<!-- Get a "subtree" xml:id value -->
|
|
40
|
+
<!-- Then walk the XML source tree -->
|
|
41
|
+
<!-- applying specializations below -->
|
|
42
|
+
<xsl:import href="./extract-identity.xsl" />
|
|
43
|
+
<xsl:output method="text" encoding="UTF-8"/>
|
|
44
|
+
|
|
45
|
+
<!-- PreTeXt override: force dynamic exercise processing so that the -->
|
|
46
|
+
<!-- "unique-id" template computes identifiers matching the interactive -->
|
|
47
|
+
<!-- web target rather than a static print target. -->
|
|
48
|
+
<xsl:variable name="exercise-style" select="'dynamic'"/>
|
|
49
|
+
|
|
50
|
+
<!-- Unique id, pck, scene name, and version as a comma-separated quadruple per line -->
|
|
51
|
+
<xsl:template match="program[@pck and @interactive='activecode']" mode="extraction">
|
|
52
|
+
<xsl:apply-templates select="." mode="unique-id" />
|
|
53
|
+
<xsl:text>,</xsl:text>
|
|
54
|
+
<xsl:value-of select="@pck" />
|
|
55
|
+
<xsl:text>,</xsl:text>
|
|
56
|
+
<xsl:value-of select="@scene" />
|
|
57
|
+
<xsl:text>,</xsl:text>
|
|
58
|
+
<xsl:value-of select="$godot.version" />
|
|
59
|
+
<xsl:text>
</xsl:text> <!-- newline -->
|
|
60
|
+
</xsl:template>
|
|
61
|
+
</xsl:stylesheet>
|
|
@@ -122,9 +122,12 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
122
122
|
</xsl:call-template>
|
|
123
123
|
</xsl:variable>
|
|
124
124
|
<!-- NB: 2D PNG is not preferable, but needed for EPUB sent to Kindle -->
|
|
125
|
+
<!-- NB: 2D EPS serves journals requiring it; Sage's matplotlib -->
|
|
126
|
+
<!-- machinery saves any 2D plot by the requested file extension -->
|
|
125
127
|
<xsl:variable name="b-legal-combination" select="($variant = '2d' and $sageplot.fileformat = 'pdf')
|
|
126
128
|
or ($variant = '2d' and $sageplot.fileformat = 'svg')
|
|
127
129
|
or ($variant = '2d' and $sageplot.fileformat = 'png')
|
|
130
|
+
or ($variant = '2d' and $sageplot.fileformat = 'eps')
|
|
128
131
|
or ($variant = '3d' and $sageplot.fileformat = 'png')
|
|
129
132
|
or ($variant = '3d' and $sageplot.fileformat = 'html')"/>
|
|
130
133
|
<!-- Only certain combinations are supported and only certain -->
|
|
@@ -17,9 +17,10 @@ You should have received a copy of the GNU General Public License
|
|
|
17
17
|
along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
18
18
|
*********************************************************************-->
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
PreTeXt Localizations
|
|
21
|
+
=====================
|
|
21
22
|
|
|
22
|
-
Each file in this directory provides translations of various strings used in titles and headings (and other places) to a specific language.
|
|
23
|
+
Each file in this directory provides translations of various strings used in titles and headings (and other places) to a specific language. Filenames reflect the code for language (lowercase) and then the code for the region (uppercase). This is a requirement.
|
|
23
24
|
|
|
24
25
|
For each file of translations, the "language" attribute of the "locale" element used to reference the language code and the "string-id" of each "localization" element is the lookup key. Element content is the language-specific string. The English version ("en-US") is carefully documented, so additions of new languages do not necessarily require new documentation, though it could help other implementers. See `xsl/pretext-common.xsl` for the two routines which make use of this information, one is a named template and the other (largely) uses the name of an element as the string-id.
|
|
25
26
|
|
|
@@ -27,30 +28,29 @@ Some items peculiar to LaTeX are explained [here](http://www.tex.ac.uk/cgi-bin/t
|
|
|
27
28
|
|
|
28
29
|
There is a [general overview of language tags](http://www.w3.org/International/articles/language-tags/) and the [Subtag Registry](http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry).
|
|
29
30
|
|
|
30
|
-
Contibutions of new languages are always welcome and especially encouraged! Search on "Translation needed" to see where you can help. Use the
|
|
31
|
+
Contibutions of new languages are always welcome and especially encouraged! Search on "Translation needed" to see where you can help. Use the en-US file as a template for a new language file, since it is always most complete. It is understood that certain English words and phrases have subtleties that can be very hard to capture in another language. Do your best to concoct a close approximation -- something should be better than nothing. And it might improve with additions from others later. We try to address some of this in the en-US file, so do be certain to look there for explanations of how these strings are employed. Comments about your own decisions, within the relevant language file, can be very helpful later.
|
|
31
32
|
|
|
32
|
-
NEW LANGUAGES: for a new file to be effective, a single line needs to be added to the `xsl/localizations/localizations.xml` file.
|
|
33
|
+
NEW LANGUAGES: for a new file to be effective, a single line needs to be added to the `xsl/localizations/localizations.xml` file. It should be obvious what to do by looking at the other lines of that file. If you create a new file, please include a "commented-out" line for any words you do not translate, and please use the **exact** style of commenting as elsewhere (one line per comment, indented). Including these, and using teh same style, greatly aids in maintenance and reliability.
|
|
33
34
|
|
|
34
|
-
Additions to incomplete files, or new files for additional languages, are very welcome and are a huge help in making PreTeXt useable for more authors.
|
|
35
|
+
Additions to incomplete files, or new files for additional languages, are very welcome and are a huge help in making PreTeXt useable for more authors. A GitHub pull request is preferable. If you do not know GitHub well, then emailing the entire language file (as an attachment) is very welcome and just as easy to deal with on our end. Please respect the order in the en-US file, it saves us time when we add new terms to each and every file. Thanks.
|
|
35
36
|
|
|
36
|
-
To test, or use: place
|
|
37
|
+
To test, or use: place `xml:lang="es-ES"`, or similar, as an attribute on your `<pretext>` element. `en-US` is the default if no `@xml:lang` attribute is given on the `pretext` element.
|
|
37
38
|
|
|
38
39
|
Current (partially) implemented language codes and contributors
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
- zh-HANS, Chinese Simplified (China), Hongqi Wang
|
|
40
|
+
* af-ZA, Afrikaans (South Africa), Dirk Basson
|
|
41
|
+
* bg-BG, Bulgarian (Bulgaria), Boyko Bantchev
|
|
42
|
+
* ca-ES, Catalan (Spain), Jordi Saludes
|
|
43
|
+
* cs-CZ, Czech (Czechia), Jiří Lebl
|
|
44
|
+
* de-DE, German (Germany), Karl-Dieter Crisman
|
|
45
|
+
* es-ES, Spanish (Spain), Juan José Torrens
|
|
46
|
+
* en-US, English (United States), Robert A. Beezer
|
|
47
|
+
* fi-FI, Finnish (Finland), Lasse M. Manninen
|
|
48
|
+
* fr-CA, French (Canada), Jean-Sébastien Turcotte
|
|
49
|
+
* fr-FR, French (France), Thomas W. Judson, Julien Giol, Jean-Sébastien Turcotte
|
|
50
|
+
* hu-HU, Hungarian (Hungary), Sándor Czirbusz
|
|
51
|
+
* it-IT, Italian (Italy), Valerio Monti
|
|
52
|
+
* ku-CKB, Rebin Muhammad, Kurdish (Central Kurdish)
|
|
53
|
+
* nl-NL, Dutch (Netherlands), Gosia Wrzesinska
|
|
54
|
+
* pt-BR, Portugese (Brazil), Igor Morgado, Vinicius Monego, Leon Silva
|
|
55
|
+
* pt-PT, Portugese (Portugal), António Pereira
|
|
56
|
+
* zh-HANS, Chinese Simplified (China), Hongqi Wang
|
|
@@ -59,10 +59,10 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
59
59
|
<localization string-id='displaymath'>Matematica in display</localization>
|
|
60
60
|
<!-- Types of documents, mostly for informational messages -->
|
|
61
61
|
<localization string-id='volume'>Volume</localization>
|
|
62
|
-
<localization string-id='book'>
|
|
62
|
+
<localization string-id='book'>Libro</localization>
|
|
63
63
|
<localization string-id='article'>Articolo</localization>
|
|
64
64
|
<localization string-id='letter'>Lettera</localization>
|
|
65
|
-
|
|
65
|
+
<localization string-id='slideshow'>Sequenza di diapositive</localization>
|
|
66
66
|
<localization string-id='memo'>Memo</localization>
|
|
67
67
|
<localization string-id='presentation'>Presentazione</localization>
|
|
68
68
|
<!-- Parts of a document -->
|
|
@@ -79,7 +79,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
79
79
|
<localization string-id='conclusion'>Conclusione</localization>
|
|
80
80
|
<localization string-id='exercises'>Esercizi</localization>
|
|
81
81
|
<localization string-id='worksheet'>Scheda didattica</localization>
|
|
82
|
-
|
|
82
|
+
<localization string-id='handout'>Dispensa</localization>
|
|
83
83
|
<localization string-id='reading-questions'>Domande di comprensione del testo</localization>
|
|
84
84
|
<localization string-id='solutions'>Soluzioni</localization>
|
|
85
85
|
<localization string-id='glossary'>Glossario</localization>
|
|
@@ -88,7 +88,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
88
88
|
<localization string-id='paragraphs'>Capoversi</localization>
|
|
89
89
|
<localization string-id='subparagraph'>Sottocapoverso</localization>
|
|
90
90
|
<!-- Adjustments to titles of divisions -->
|
|
91
|
-
|
|
91
|
+
<localization string-id='group'>Gruppo</localization>
|
|
92
92
|
<!-- Components of the narrative -->
|
|
93
93
|
<!-- REMARK-LIKE blocks -->
|
|
94
94
|
<localization string-id='remark'>Osservazione</localization>
|
|
@@ -170,11 +170,11 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
170
170
|
<localization string-id='video'>Video</localization>
|
|
171
171
|
<localization string-id='program'>Programma</localization>
|
|
172
172
|
<!-- Runestone Exercises -->
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
173
|
+
<localization string-id='true'>Vero</localization>
|
|
174
|
+
<localization string-id='false'>Falso</localization>
|
|
175
|
+
<localization string-id='or'>O</localization>
|
|
176
|
+
<localization string-id='either'>O</localization>
|
|
177
|
+
<localization string-id='uncategorized'>Senza categoria</localization>
|
|
178
178
|
<!-- <localization string-id='query'>Query</localization> -->
|
|
179
179
|
<localization string-id='program-activecode'>ActiveCode</localization>
|
|
180
180
|
<!-- <localization string-id='scratch-activecode'>Scratch ActiveCode</localization> -->
|
|
@@ -204,7 +204,7 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
204
204
|
<localization string-id='feedback'>Feedback</localization>
|
|
205
205
|
<localization string-id='authored'>Redatto in PreTeXt</localization>
|
|
206
206
|
<!-- Search Results display/dialog -->
|
|
207
|
-
|
|
207
|
+
<localization string-id='search-book'>Cerca nel libro</localization>
|
|
208
208
|
<localization string-id='search-results-heading'>Risultati</localization>
|
|
209
209
|
<localization string-id='no-search-results'>Nessun risultato</localization>
|
|
210
210
|
<!-- Parts of memos and letters -->
|
|
@@ -225,18 +225,14 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
225
225
|
<localization string-id='permalink'>permalink</localization>
|
|
226
226
|
<localization string-id='incontext'>Nel Contesto</localization>
|
|
227
227
|
<!-- <localization string-id='standalone'>Standalone</localization> -->
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
<!-- "en-US" file for a more complete explanation of its use. -->
|
|
235
|
-
<!-- Please remove this entire comment when translated. Thanks. -->
|
|
236
|
-
<localization string-id='permalink-tooltip'>Copy heading and permalink for</localization>
|
|
237
|
-
<!-- <localization string-id='calculator'>Calculator</localization> -->
|
|
228
|
+
<localization string-id='embed'>Immergi</localization>
|
|
229
|
+
<localization string-id='embed-this-page'>Immergi questa pagina</localization>
|
|
230
|
+
<localization string-id='copy'>Copia</localization>
|
|
231
|
+
<localization string-id='profile'>Profilo</localization>
|
|
232
|
+
<localization string-id='permalink-tooltip'>Copia descrizione e permalink per</localization>
|
|
233
|
+
<localization string-id='calculator'>Calcolatore</localization>
|
|
238
234
|
<localization string-id='evaluate'>Calcola</localization>
|
|
239
|
-
|
|
235
|
+
<localization string-id='code'>Codice</localization>
|
|
240
236
|
<localization string-id='instructions'>Istruzioni</localization>
|
|
241
237
|
<localization string-id='correct'>Giusto</localization>
|
|
242
238
|
<localization string-id='incorrect'>Sbagliato</localization>
|
|
@@ -249,28 +245,28 @@ along with PreTeXt. If not, see <http://www.gnu.org/licenses/>.
|
|
|
249
245
|
<localization string-id='reset'>Azzera</localization>
|
|
250
246
|
<localization string-id='array'>tabella</localization>
|
|
251
247
|
<localization string-id="papersize">Formato carta</localization>
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
248
|
+
<localization string-id="printing-options">Opzioni di stampa addizionali</localization>
|
|
249
|
+
<localization string-id="hide-hints">Nascondi suggerimenti</localization>
|
|
250
|
+
<localization string-id="hide-answers">Nascondi risposte</localization>
|
|
251
|
+
<localization string-id="hide-solutions">Nascondi soluzioni</localization>
|
|
252
|
+
<localization string-id="print-header">Stampa intestazioni</localization>
|
|
253
|
+
<localization string-id="print-footer">Stampa piè di pagina</localization>
|
|
254
|
+
<localization string-id="first-page">Prima pagina</localization>
|
|
255
|
+
<localization string-id="running">Successive</localization>
|
|
256
|
+
<localization string-id="highlight-workspace">Evidenzia spazio di lavoro</localization>
|
|
261
257
|
<localization string-id='print'>Stampa</localization>
|
|
262
258
|
<localization string-id='print-preview'>Anteprima di stampa</localization>
|
|
263
259
|
<localization string-id='close'>Chiudi</localization>
|
|
264
|
-
|
|
260
|
+
<localization string-id='open-new-tab'>Apri in nuova scheda</localization>
|
|
265
261
|
<!-- Readability menu items, HTML only, utilized by Javascript -->
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
262
|
+
<localization string-id='readability-settings'>Impostazioni di leggibilità</localization>
|
|
263
|
+
<localization string-id='readability-line-height'>Interlinea</localization>
|
|
264
|
+
<localization string-id='readability-content-font-size'>Dimensione dei caratteri del contenuto</localization>
|
|
265
|
+
<localization string-id='readability-theme'>Tema</localization>
|
|
266
|
+
<localization string-id='readability-theme-system'>Sistema</localization>
|
|
267
|
+
<localization string-id='readability-theme-light'>Chiaro</localization>
|
|
268
|
+
<localization string-id='readability-theme-dark'>Scuro</localization>
|
|
269
|
+
<localization string-id='readability-assistive-technologies'>Tecnologie assistive</localization>
|
|
270
|
+
<localization string-id='readability-expose-permalinks'>Mostra i permalink</localization>
|
|
271
|
+
<localization string-id='reset-all'>Ripristina tutte</localization>
|
|
276
272
|
</locale>
|