Skip to content

Commit

Permalink
Markup: fixes discovered producing PDF standard
Browse files Browse the repository at this point in the history
  • Loading branch information
gesa committed Jul 3, 2024
1 parent 81abdc8 commit 2ee6374
Show file tree
Hide file tree
Showing 12 changed files with 123 additions and 230 deletions.
28 changes: 28 additions & 0 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generating a PDF from ecmarkup

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:

```
title: ECMAScript® 2024 Internationalization API Specification
shortname: ECMA-402
version: 11th Edition
date: 2024-06-25
```

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:

```shell
mkdir -p out &&
mv images out &&
mv print.css out &&
ecmarkup --assets external --assets-dir out --old-toc spec.html out/index.html
```

Then, from your spec's working directory, run [`prince`](https://www.princexml.com/) to generate your PDF.

```shell
cd path/to/spec
prince --script ./node_modules/ecmarkup/js/print.js out/index.html -o path/to/output.pdf
```

This has been extensively tested with Prince 15. Earlier and later editions not guaranteed.
Binary file modified img/calendar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions img/ecma-header.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
121 changes: 1 addition & 120 deletions img/ecma-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"build-only": "npm run build-to -- out/index.html --assets-dir=out",
"build": "npm run build-only -- --lint-spec --strict",
"build-for-pdf": "npm run build -- --old-toc",
"pdf": "npm run build-for-pdf && prince --script ./node_modules/ecmarkup/js/print.js out/index.html -o out/ECMA-402.pdf",
"test": "npm run build-to -- --lint-spec /dev/null",
"watch": "npm run build -- --watch"
},
Expand Down
2 changes: 1 addition & 1 deletion spec/annexes.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ <h1>Additions and Changes That Introduce Incompatibilities with Prior Editions</
<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>.
</li>
<li>
<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"*.
<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"*.
</li>
<li>
<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"*.
Expand Down
2 changes: 1 addition & 1 deletion spec/colophon.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<emu-annex id="sec-colophon">
<h1>Colophon</h1>
<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>
<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>
<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>
</emu-annex>
119 changes: 63 additions & 56 deletions spec/datetimeformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -780,78 +780,85 @@ <h1>DateTime Style Range Records</h1>
<li>[[minute]]: *"numeric"*</li>
<li>[[pattern]]: *"{hour}:{minute}"*</li>
<li>[[pattern12]]: *"{hour}:{minute} {ampm}"*</li>
<li>[[rangePatterns]]:</li>
<ul>
<li>[[Hour]]:<ul>
<li>[[hour]]: *"numeric"*</li>
<li>[[minute]]: *"numeric"*</li>
<li>[[PatternParts]]:</li>
<ul>
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
</ul>
</ul></li>
<li>[[Minute]]:<ul>
<li>[[hour]]: *"numeric"*</li>
<li>[[minute]]: *"numeric"*</li>
<li>[[PatternParts]]:</li>
<ul>
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
</ul>
</ul></li>
<li>[[Default]]:<ul>
<li>[[year]]: *"2-digit"*</li>
<li>[[month]]: *"numeric"*</li>
<li>[[day]]: *"numeric"*</li>
<li>[[hour]]: *"numeric"*</li>
<li>[[minute]]: *"numeric"*</li>
<li>[[PatternParts]]:</li>
<ul>
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{day}/{month}/{year}, {hour}:{minute}"*}</li>
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{day}/{month}/{year}, {hour}:{minute}"*}</li>
</ul>
</ul></li>
</ul>
<li>[[rangePatterns]]:
<ul>
<li>[[Hour]]:<ul>
<li>[[hour]]: *"numeric"*</li>
<li>[[minute]]: *"numeric"*</li>
<li>[[PatternParts]]:
<ul>
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
</ul>
</li>
</ul></li>
<li>[[Minute]]:<ul>
<li>[[hour]]: *"numeric"*</li>
<li>[[minute]]: *"numeric"*</li>
<li>[[PatternParts]]:
<ul>
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
</ul>
</li>
</ul></li>
<li>[[Default]]:<ul>
<li>[[year]]: *"2-digit"*</li>
<li>[[month]]: *"numeric"*</li>
<li>[[day]]: *"numeric"*</li>
<li>[[hour]]: *"numeric"*</li>
<li>[[minute]]: *"numeric"*</li>
<li>[[PatternParts]]:
<ul>
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{day}/{month}/{year}, {hour}:{minute}"*}</li>
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{day}/{month}/{year}, {hour}:{minute}"*}</li>
</ul>
</li>
</ul></li>
</ul>
</li>
<li>[[rangePatterns12]]:
<ul>
<li>[[Hour]]:<ul>
<li>[[hour]]: *"numeric"*</li>
<li>[[minute]]: *"numeric"*</li>
<li>[[PatternParts]]:</li>
<ul>
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" {ampm}"*}</li>
</ul>
<li>[[PatternParts]]:
<ul>
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" {ampm}"*}</li>
</ul>
</li>
</ul></li>
<li>[[Minute]]:<ul>
<li>[[hour]]: *"numeric"*</li>
<li>[[minute]]: *"numeric"*</li>
<li>[[PatternParts]]:</li>
<ul>
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" {ampm}"*}</li>
</ul>
<li>[[PatternParts]]:
<ul>
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{hour}:{minute}"*}</li>
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" {ampm}"*}</li>
</ul>
</li>
</ul></li>
<li>[[Default]]:<ul>
<li>[[year]]: *"2-digit"*</li>
<li>[[month]]: *"numeric"*</li>
<li>[[day]]: *"numeric"*</li>
<li>[[hour]]: *"numeric"*</li>
<li>[[minute]]: *"numeric"*</li>
<li>[[PatternParts]]:</li>
<ul>
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{day}/{month}/{year}, {hour}:{minute} {ampm}"*}</li>
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{day}/{month}/{year}, {hour}:{minute} {ampm}"*}</li>
</ul>
<li>[[PatternParts]]:
<ul>
<li>{[[Source]]: *"startRange"*, [[Pattern]]: *"{day}/{month}/{year}, {hour}:{minute} {ampm}"*}</li>
<li>{[[Source]]: *"shared"*, [[Pattern]]: *" – "*}</li>
<li>{[[Source]]: *"endRange"*, [[Pattern]]: *"{day}/{month}/{year}, {hour}:{minute} {ampm}"*}</li>
</ul>
</li>
</ul></li>
</ul></li>
</ul>
Expand Down
Loading

0 comments on commit 2ee6374

Please sign in to comment.