Skip to content

Commit

Permalink
Publishing instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
gesa committed Jul 2, 2024
1 parent 9c67732 commit 31e7d4b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 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 Language Specification
shortname: ECMA-262
version: 15th 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.
12 changes: 12 additions & 0 deletions css/print.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@
margin-outside: 13mm;
-prince-page-fill: prefer-fill;

/* Uncomment when producing WIP versions of final standards */
/*
@prince-overlay {
color: rgba(0,0,0,0.15);
content: "WORK IN PROGRESS";
font-family: Arial;
font-weight: bolder;
font-size: 100pt;
transform: rotate(-60deg);
}
*/

@bottom-left {
font-family: Arial;
}
Expand Down

0 comments on commit 31e7d4b

Please sign in to comment.