Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some fixes to maintain compliance to the styleguide #638

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 33 additions & 8 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,52 @@
# 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:
## Required frontmatter

- In order to produce a PDF, the front matter `title`, `shortname`, and `status` are **mandatory**.

```yaml
title: Temporal proposal
shortname: Temporal
status: proposal
stage: 3
```
title: ECMAScript® 2024 Language Specification

- If using the alternative copyright for a standard publication, `location` is also mandatory. For example:

```yaml
title: ECMAScript® Language Specification
shortname: ECMA-262
status: draft
boilerplate:
copyright: alternative
```

- If generating a version for submission to the GA, `version` and `date` are mandatory. `date` should reflect the date of the Ecma GA which will ratify the Standard.

```yaml
title: ECMAScript® 2025 Language Specification
shortname: ECMA-262
version: 15<sup>th</sup> Edition
date: 2024-06-25
version: 16<sup>th</sup> Edition
date: 2025-06-25
status: standard
boilerplate:
copyright: alternative
location: https://262.ecma-international.org/16.0/
```

To generate markup for use in PDF conversion, make sure to include the options `--assets`, `--assets-dir`, and `--printable`. 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 &&
cp -R images out &&
mkdir -p out && \
cp -R images out && \
ecmarkup --assets external --assets-dir out --printable spec.html out/index.html
```

Then, from your spec's working directory, run [`prince`](https://www.princexml.com/) to generate your PDF.
Then, from your spec's working directory, run [`prince-books`](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
prince-books --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.
57 changes: 57 additions & 0 deletions boilerplate/alternative-copyright.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<div class="alternative-copyright">
<p>ALTERNATIVE COPYRIGHT NOTICE AND COPYRIGHT LICENSE</p>

<p>&copy; !YEAR! Ecma International</p>

<p>
By obtaining and/or copying this work, you (the licensee) agree that you
have read, understood, and will comply with the following terms and
conditions.
</p>

<p>
Permission under Ecma’s copyright to copy, modify, prepare derivative works
of, and distribute this work, with or without modification, for any purpose
and without fee or royalty is hereby granted, provided that you include the
following on ALL copies of the work or portions thereof, including
modifications:
</p>

<p>
(i) The full text of this COPYRIGHT NOTICE AND COPYRIGHT LICENSE in a location
viewable to users of the redistributed or derivative work.
</p>
<p>
(ii) Any pre-existing intellectual property disclaimers, notices, or terms and
conditions. If none exist, the Ecma alternative copyright notice should be
included.
</p>
<p>
(iii) Notice of any changes or modifications, through a copyright statement on
the document such as “This document includes material copied from or
derived from !DOCUMENT!.<br />
Copyright &copy; Ecma International.”
</p>

<p><strong>Disclaimers</strong></p>

<p>
THIS WORK IS PROVIDED “AS IS,” AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS
OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES
OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF
THE DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,
TRADEMARKS OR OTHER RIGHTS.
</p>

<p>
COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT.
</p>

<p>
The name and trademarks of copyright holders may NOT be used in advertising
or publicity pertaining to the work without specific, written prior
permission. Title to copyright in this work will at all times remain with
copyright holders.
</p>
</div>
27 changes: 16 additions & 11 deletions boilerplate/standard-copyright.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
<p>© !YEAR! Ecma International</p>
<p>COPYRIGHT NOTICE</p>

<p>&copy; !YEAR! Ecma International</p>

<p>By obtaining and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.</p>

<p>Permission under Ecma’s copyright to copy, modify, prepare derivative works of, and distribute this work, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the work or portions thereof, including modifications:</p>
<p>This document may be copied, published and distributed to others, and certain derivative works of it may be prepared, copied, published, and distributed, in whole or in part, provided that the above copyright notice and this Copyright License and Disclaimer are included on all such copies and derivative works. The only derivative works that are permissible under this Copyright License and Disclaimer are:</p>

<p>(i) works which incorporate all or portion of this document for the purpose of providing commentary or explanation (such as an annotated version of the document),</p>

<p>(ii) works which incorporate all or portion of this document for the purpose of incorporating features that provide accessibility,</p>

<p>(iii) translations of this document into languages other than English and into different formats and</p>

<ol>
<li>(i) The full text of this COPYRIGHT NOTICE AND COPYRIGHT LICENSE in a location viewable to users of the redistributed or derivative work.</li>
<li>(ii) Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the Ecma alternative copyright notice should be included.</li>
<li>(iii) Notice of any changes or modifications, through a copyright statement on the document such as “This document includes material copied from or derived from [title and URI of the Ecma document]. Copyright © Ecma International.”</li>
</ol>
<p>(iv) works by making use of this specification in standard conformant products by implementing (e.g. by copy and paste wholly or partly) the functionality therein.</p>

<p>Disclaimers</p>
<p>However, the content of this document itself may not be modified in any way, including by removing the copyright notice or references to Ecma International, except as required to translate it into languages other than English or into a different format.</p>

<p>THIS WORK IS PROVIDED “AS IS,” AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE DOCUMENT WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.</p>
<p>The official version of an Ecma International document is the English language version on the Ecma International website. In the event of discrepancies between a translated version and the official version, the official version shall govern.</p>

<p>COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT.</p>
<p>The limited permissions granted above are perpetual and will not be revoked by Ecma International or its successors or assigns.</p>

<p>The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the work without specific, written prior permission. Title to copyright in this work will at all times remain with copyright holders.</p>
<p>This document and the information contained herein is provided on an “AS IS” basis and ECMA INTERNATIONAL DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.</p>
30 changes: 15 additions & 15 deletions css/print.css
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ emu-figure img {
}

#toc a[href]::after {
content: leader(dotted) target-counter(attr(href), page);
content: leader(dotted) target-counter(attr(href), page);
}

#toc > ol.toc {
Expand Down Expand Up @@ -548,10 +548,18 @@ a[data-print-href]::after {
width: auto;
}

.annex-title {
emu-annex > h1 {
text-align: center;
}

emu-annex > h1 span {
display: block;
}

emu-annex > h1 .secnum {
margin: 0 0 1lh;
}

.copyright-notice { /* ecma mandated */
font-style: italic;
border: 1px solid black;
Expand All @@ -561,10 +569,6 @@ a[data-print-href]::after {
page-break-after: always;
}

.full-page-svg {
color: rgba(255, 255, 255, 0);
}

.secnum {
font-family: Arial, Helvetica, sans-serif;
}
Expand Down Expand Up @@ -613,6 +617,7 @@ h1.version {
}

#front-cover h1.title {
display: block;
font-weight: bold;
font-size: 20pt;
line-height: 1.2;
Expand All @@ -626,15 +631,6 @@ h1.version {
page: inside-cover;
}

#inside-cover address {
color: black;
font-size: 12pt;
font-style: normal;
position: relative;
left: 72mm;
top: 82mm;
}

#toc {
page: toc;
counter-reset: page 1;
Expand All @@ -648,3 +644,7 @@ h1.version {
.annex-kind {
font-weight: normal;
}

p.ECMAaddress {
margin: 0;
}
7 changes: 3 additions & 4 deletions js/print.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

// Prince.trackBoxes = true;

const specContainer = document.getElementById('spec-container');
const shortname = specContainer.querySelector('h1.shortname');
const version = specContainer.querySelector('h1.version');
const shortname = document.querySelector('h1.shortname');
const version = document.querySelector('h1.version');

rearrangeTables();

Expand All @@ -21,7 +20,7 @@ PDF.pageMode = 'show-bookmarks';
PDF.duplex = 'duplex-flip-long-edge';
PDF.title = document.title;
PDF.author = 'Ecma International';
PDF.subject = shortname.innerHTML + ', ' + version.innerHTML;
PDF.subject = shortname.innerHTML + (version ? ', ' + version.innerHTML : '');

/**
* Sets up table captions and figcaptions for tables, which provides for
Expand Down
2 changes: 1 addition & 1 deletion spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ <h1>Options</h1>
<tr><td>`--no-toc`</td><td>`toc`</td><td>Emit table of contents. Boolean, default true.</td></tr>
<tr><td>`--printable`</td><td>`printable`</td><td>Make the output suitable for printing. Boolean, default false.</td></tr>
<tr><td>`--load-biblio`</td><td>`extraBiblios`</td><td>Extra biblio.json file(s) to load. This should contain either an object as exported by `--write-biblio` or an array of such objects.</td></tr>
<tr><td></td><td>`boilerplate`</td><td>An object with `address` and/or `copyright` and/or `license` fields containing paths to files containing the corresponding content for populating an element with class "copyright-and-software-license" (or if not found, an appended <emu-xref href="#emu-annex" title></emu-xref> with that id) when `copyright` is true. Absent fields are assumed to reference files in a "boilerplate" directory sibling of the directory containing the ecmarkup executable.</td></tr>
<tr><td></td><td>`boilerplate`</td><td>An object with `address` and/or `copyright` and/or `license` fields containing paths to files containing the corresponding content for populating an element with class "copyright-and-software-license" (or if not found, an appended <emu-xref href="#emu-annex" title></emu-xref> with that id) when `copyright` is true or set to `alternative`. Absent fields are assumed to reference files in a "boilerplate" directory sibling of the directory containing the ecmarkup executable.</td></tr>
<tr><td>`--mark-effects`</td><td>`markEffects`</td><td>Propagate and render <a href="#effects">effects</a> like "user code".</td></tr>
</table>
</emu-table>
Expand Down
Loading