Skip to content

Commit 2ee6374

Browse files
committed
Markup: fixes discovered producing PDF standard
1 parent 81abdc8 commit 2ee6374

12 files changed

+123
-230
lines changed

PUBLISHING.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Generating a PDF from ecmarkup
2+
3+
In order to produce a PDF, the front matter `title`, `shortname`, `version`, and `date` are **mandatory**. If generating a final annual edition, date should reflect the date of the Ecma GA which will ratify the Standard. For example:
4+
5+
```
6+
title: ECMAScript® 2024 Internationalization API Specification
7+
shortname: ECMA-402
8+
version: 11th Edition
9+
date: 2024-06-25
10+
```
11+
12+
To generate markup for use in PDF conversion, make sure to include the options `--assets`, `--assets-dir`, and `--old-toc`. If you have images and styles to include, make sure to move them into your assets directory before running `ecmarkup`. For example:
13+
14+
```shell
15+
mkdir -p out &&
16+
mv images out &&
17+
mv print.css out &&
18+
ecmarkup --assets external --assets-dir out --old-toc spec.html out/index.html
19+
```
20+
21+
Then, from your spec's working directory, run [`prince`](https://www.princexml.com/) to generate your PDF.
22+
23+
```shell
24+
cd path/to/spec
25+
prince --script ./node_modules/ecmarkup/js/print.js out/index.html -o path/to/output.pdf
26+
```
27+
28+
This has been extensively tested with Prince 15. Earlier and later editions not guaranteed.

img/calendar.png

-19.9 KB
Loading

img/ecma-header.svg

+1
Loading

img/ecma-logo.svg

+1-120
Loading

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"build-only": "npm run build-to -- out/index.html --assets-dir=out",
1111
"build": "npm run build-only -- --lint-spec --strict",
1212
"build-for-pdf": "npm run build -- --old-toc",
13+
"pdf": "npm run build-for-pdf && prince --script ./node_modules/ecmarkup/js/print.js out/index.html -o out/ECMA-402.pdf",
1314
"test": "npm run build-to -- --lint-spec /dev/null",
1415
"watch": "npm run build -- --watch"
1516
},

spec/annexes.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ <h1>Additions and Changes That Introduce Incompatibilities with Prior Editions</
183183
<emu-xref href="#sec-intl.datetimeformat.prototype.format"></emu-xref> In ECMA-402, 1<sup>st</sup> Edition, the *"length"* property of the function object _F_ was set to *+0*<sub>𝔽</sub>. In 2nd Edition, *"length"* is set to *1*<sub>𝔽</sub>.
184184
</li>
185185
<li>
186-
<emu-xref href="#sec-intl.collator.prototype-@@tostringtag"></emu-xref> In ECMA-402, 7<sup></sup>th</sup> Edition, the @@toStringTag property of `Intl.Collator.prototype` was set to *"Object"*. In 8<sup>th</sup> Edition, @@toStringTag is set to *"Intl.Collator"*.
186+
<emu-xref href="#sec-intl.collator.prototype-@@tostringtag"></emu-xref> In ECMA-402, 7<sup>th</sup> Edition, the @@toStringTag property of `Intl.Collator.prototype` was set to *"Object"*. In 8<sup>th</sup> Edition, @@toStringTag is set to *"Intl.Collator"*.
187187
</li>
188188
<li>
189189
<emu-xref href="#sec-intl.datetimeformat.prototype-@@tostringtag"></emu-xref> In ECMA-402, 7<sup>th</sup> Edition, the @@toStringTag property of `Intl.DateTimeFormat.prototype` was set to *"Object"*. In 8<sup>th</sup> Edition, @@toStringTag is set to *"Intl.DateTimeFormat"*.

spec/colophon.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<emu-annex id="sec-colophon">
22
<h1>Colophon</h1>
3-
<p>This specification is authored on <a href="https://github.com/tc39/ecma402">GitHub</a> in a plaintext source format called <a href="https://github.com/bterlson/ecmarkup">Ecmarkup</a>. Ecmarkup is an HTML and Markdown dialect that provides a framework and toolset for authoring ECMAScript specifications in plaintext and processing the specification into a full-featured HTML rendering that follows the editorial conventions for this document. Ecmarkup builds on and integrates a number of other formats and technologies including <a href="https://github.com/rbuckton/grammarkdown">Grammarkdown</a> for defining syntax and <a href="https://github.com/domenic/ecmarkdown">Ecmarkdown</a> for authoring algorithm steps. PDF renderings of this specification are produced by printing the HTML rendering to a PDF.</p>
3+
<p>This specification is authored on <a href="https://github.com/tc39/ecma402">GitHub</a> in a plaintext source format called <a href="https://github.com/bterlson/ecmarkup">Ecmarkup</a>. Ecmarkup is an HTML and Markdown dialect that provides a framework and toolset for authoring ECMAScript specifications in plaintext and processing the specification into a full-featured HTML rendering that follows the editorial conventions for this document. Ecmarkup builds on and integrates a number of other formats and technologies including <a href="https://github.com/rbuckton/grammarkdown">Grammarkdown</a> for defining syntax and <a href="https://github.com/domenic/ecmarkdown">Ecmarkdown</a> for authoring algorithm steps. PDF renderings of this specification are produced using <a href="https://www.princexml.com/">PrinceXML</a>.</p>
44
<p>Prior editions of this specification were authored using Word&mdash;the Ecmarkup source text that formed the basis of this edition was produced by converting the ECMAScript 2015 Word document to Ecmarkup using an automated conversion tool.</p>
55
</emu-annex>

spec/datetimeformat.html

+63-56
Original file line numberDiff line numberDiff line change
@@ -780,78 +780,85 @@ <h1>DateTime Style Range Records</h1>
780780
<li>[[minute]]: *"numeric"*</li>
781781
<li>[[pattern]]: *"{hour}:{minute}"*</li>
782782
<li>[[pattern12]]: *"{hour}:{minute} {ampm}"*</li>
783-
<li>[[rangePatterns]]:</li>
784-
<ul>
785-
<li>[[Hour]]:<ul>
786-
<li>[[hour]]: *"numeric"*</li>
787-
<li>[[minute]]: *"numeric"*</li>
788-
<li>[[PatternParts]]:</li>
789-
<ul>
790-
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
791-
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
792-
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
793-
</ul>
794-
</ul></li>
795-
<li>[[Minute]]:<ul>
796-
<li>[[hour]]: *"numeric"*</li>
797-
<li>[[minute]]: *"numeric"*</li>
798-
<li>[[PatternParts]]:</li>
799-
<ul>
800-
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
801-
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
802-
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
803-
</ul>
804-
</ul></li>
805-
<li>[[Default]]:<ul>
806-
<li>[[year]]: *"2-digit"*</li>
807-
<li>[[month]]: *"numeric"*</li>
808-
<li>[[day]]: *"numeric"*</li>
809-
<li>[[hour]]: *"numeric"*</li>
810-
<li>[[minute]]: *"numeric"*</li>
811-
<li>[[PatternParts]]:</li>
812-
<ul>
813-
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{day}/{month}/{year}, {hour}:{minute}"*}</li>
814-
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
815-
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{day}/{month}/{year}, {hour}:{minute}"*}</li>
816-
</ul>
817-
</ul></li>
818-
</ul>
783+
<li>[[rangePatterns]]:
784+
<ul>
785+
<li>[[Hour]]:<ul>
786+
<li>[[hour]]: *"numeric"*</li>
787+
<li>[[minute]]: *"numeric"*</li>
788+
<li>[[PatternParts]]:
789+
<ul>
790+
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
791+
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
792+
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
793+
</ul>
794+
</li>
795+
</ul></li>
796+
<li>[[Minute]]:<ul>
797+
<li>[[hour]]: *"numeric"*</li>
798+
<li>[[minute]]: *"numeric"*</li>
799+
<li>[[PatternParts]]:
800+
<ul>
801+
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
802+
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
803+
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
804+
</ul>
805+
</li>
806+
</ul></li>
807+
<li>[[Default]]:<ul>
808+
<li>[[year]]: *"2-digit"*</li>
809+
<li>[[month]]: *"numeric"*</li>
810+
<li>[[day]]: *"numeric"*</li>
811+
<li>[[hour]]: *"numeric"*</li>
812+
<li>[[minute]]: *"numeric"*</li>
813+
<li>[[PatternParts]]:
814+
<ul>
815+
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{day}/{month}/{year}, {hour}:{minute}"*}</li>
816+
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
817+
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{day}/{month}/{year}, {hour}:{minute}"*}</li>
818+
</ul>
819+
</li>
820+
</ul></li>
821+
</ul>
822+
</li>
819823
<li>[[rangePatterns12]]:
820824
<ul>
821825
<li>[[Hour]]:<ul>
822826
<li>[[hour]]: *"numeric"*</li>
823827
<li>[[minute]]: *"numeric"*</li>
824-
<li>[[PatternParts]]:</li>
825-
<ul>
826-
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
827-
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
828-
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
829-
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" {ampm}"*}</li>
830-
</ul>
828+
<li>[[PatternParts]]:
829+
<ul>
830+
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
831+
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
832+
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
833+
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" {ampm}"*}</li>
834+
</ul>
835+
</li>
831836
</ul></li>
832837
<li>[[Minute]]:<ul>
833838
<li>[[hour]]: *"numeric"*</li>
834839
<li>[[minute]]: *"numeric"*</li>
835-
<li>[[PatternParts]]:</li>
836-
<ul>
837-
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
838-
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
839-
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
840-
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" {ampm}"*}</li>
841-
</ul>
840+
<li>[[PatternParts]]:
841+
<ul>
842+
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
843+
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
844+
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
845+
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" {ampm}"*}</li>
846+
</ul>
847+
</li>
842848
</ul></li>
843849
<li>[[Default]]:<ul>
844850
<li>[[year]]: *"2-digit"*</li>
845851
<li>[[month]]: *"numeric"*</li>
846852
<li>[[day]]: *"numeric"*</li>
847853
<li>[[hour]]: *"numeric"*</li>
848854
<li>[[minute]]: *"numeric"*</li>
849-
<li>[[PatternParts]]:</li>
850-
<ul>
851-
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{day}/{month}/{year}, {hour}:{minute} {ampm}"*}</li>
852-
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
853-
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{day}/{month}/{year}, {hour}:{minute} {ampm}"*}</li>
854-
</ul>
855+
<li>[[PatternParts]]:
856+
<ul>
857+
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{day}/{month}/{year}, {hour}:{minute} {ampm}"*}</li>
858+
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
859+
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{day}/{month}/{year}, {hour}:{minute} {ampm}"*}</li>
860+
</ul>
861+
</li>
855862
</ul></li>
856863
</ul></li>
857864
</ul>

0 commit comments

Comments
 (0)