Skip to content

Commit

Permalink
Markup: improvements for printing (#3352)
Browse files Browse the repository at this point in the history
  • Loading branch information
gesa authored and ljharb committed Mar 6, 2025
1 parent d06f3a2 commit 8d92bad
Show file tree
Hide file tree
Showing 10 changed files with 157 additions and 376 deletions.
20 changes: 20 additions & 0 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Publishing the annual PDF

First, make sure you've provided appropriate 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 Language Specification
shortname: ECMA-262
version: 15th Edition
date: 2024-06-25
```

Use the package script `build-for-pdf`. Importantly, you want to make sure your image directory files wind up in the same output directory as your markup. Your `ecmarkup` command should include the options `--assets external`, `--assets-dir out`, and `--printable`.

Then, run `prince` to generate your PDF.

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

Spend 5-10 minutes double-checking the PDF for egregious layout issues. That means quickly skimming all 800+ pages looking for whitespace or content split in a confusing manner. Tinker with print-only styles only as needed. Compare cover & table of contents to previous years.
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.
2 changes: 1 addition & 1 deletion img/figure-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion img/figure-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 1 addition & 69 deletions img/module-graph-cycle-async.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 1 addition & 63 deletions img/module-graph-cycle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 1 addition & 48 deletions img/module-graph-missing.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 1 addition & 56 deletions img/module-graph-simple.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"prebuild-only": "npm run clean && mkdir out && cp -R img out",
"build-only": "ecmarkup --verbose spec.html --multipage out",
"build": "npm run build-head",
"build-for-pdf": "ecmarkup --verbose spec.html --old-toc --assets external out/index.html",
"pdf": "npm run build-for-pdf && pagedjs-cli --page-size a4 out/index.html -o out/index.pdf",
"build-for-pdf": "npm run prebuild-only && ecmarkup --verbose spec.html out/index.html --assets external --assets-dir out --old-toc --lint-spec --strict",
"pdf": "npm run build-for-pdf && prince --script ./node_modules/ecmarkup/js/print.js out/index.html -o out/ECMA-262.pdf",
"prebuild-snapshot": "npm run clean",
"build-snapshot": "npm run build-head && node scripts/insert_snapshot_warning.js",
"clean": "rm -rf out",
Expand Down
Loading

0 comments on commit 8d92bad

Please # to comment.