diff --git a/boilerplate/draft-copyright.html b/boilerplate/draft-copyright.html deleted file mode 100644 index a3bbf4a0..00000000 --- a/boilerplate/draft-copyright.html +++ /dev/null @@ -1,9 +0,0 @@ -

© !YEAR! Ecma International

- -

This draft document may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published, and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this section are included on all such copies and derivative works. However, this document itself may not be modified in any way, including by removing the copyright notice or references to Ecma International, except as needed for the purpose of developing any document or deliverable produced by Ecma International.

- -

This disclaimer is valid only prior to final version of this document. After approval all rights on the standard are reserved by Ecma International.

- -

The limited permissions are granted through the standardization phase and will not be revoked by Ecma International or its successors or assigns during this time.

- -

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.

diff --git a/css/print.css b/css/print.css index befc721a..f67a6e23 100644 --- a/css/print.css +++ b/css/print.css @@ -427,7 +427,7 @@ emu-table th { caption, table > figcaption { caption-side: top; - color: #555555; + color: #000; font-weight: bold; margin-bottom: 1rem; text-align: center; @@ -442,6 +442,7 @@ table:not(:has(tr:nth-of-type(5))) { break-inside: avoid-page; } +/* This inheritance looks weird—it's due to how Prince manages continuity in tables across pages */ table > figcaption { display: table-caption; -prince-caption-page: following; @@ -658,3 +659,23 @@ h1.version { p.ECMAaddress { margin: 0; } + +#sec-terms-and-definitions dfn { + font-style: normal; +} + +#sec-terms-and-definitions h1 .secnum { + display: block; +} + +#sec-terms-and-definitions > h1 > .secnum { + display: inline; +} + +#sec-terms-and-definitions h1 + p { + margin-top: 0; +} + +p.adoption-info { + float: bottom; +} diff --git a/img/print-inside-cover.svg b/img/print-inside-cover.svg index c0f6f02d..696ea1f2 100644 --- a/img/print-inside-cover.svg +++ b/img/print-inside-cover.svg @@ -2,32 +2,23 @@ - + + + C + + + OPYRIGHT PROTECTED DOCUMENT + - COPYRIGHT PROTECTED DOCUMENT - - Ecma International - Rue du Rhone 114 CH-1204 Geneva - Tel: +41 22 849 6000 - Fax: +41 22 849 6001 - Web: - - - https://www.ecma-international.org - - - - - © Ecma International + + © Ecma International - - - - is the registered trademark of Ecma International + + is the registered trademark of Ecma International diff --git a/js/print.js b/js/print.js index 3629a2f6..45ca7376 100644 --- a/js/print.js +++ b/js/print.js @@ -27,6 +27,15 @@ PDF.title = document.title; PDF.author = 'Ecma International'; PDF.subject = shortname.innerHTML + (version ? ', ' + version.innerHTML : ''); +/** + * Terms and definitions section should not have every term listed in the table of contents. + * */ +const terms = document.querySelector('#toc a[href="#sec-terms-and-definitions"]'); + +if (terms) { + (terms.parentElement.querySelector('ol.toc') || document.createElement('i')).remove(); +} + function restoreSuperScripts(string) { if (!string) return false; diff --git a/spec/index.html b/spec/index.html index 97199c9d..36df617a 100644 --- a/spec/index.html +++ b/spec/index.html @@ -69,12 +69,13 @@

Options

`status`Document status. Can be "proposal", "draft", or "standard". Defaults to "proposal". `stage`TC39 proposal stage. If present and `status` is "proposal", `version` defaults to "Stage stage Draft". `version`Document version, for example "6<sup>th</sup> Edition" (which renders like "6th Edition") or "Draft 1". - `date`Timestamp of document rendering, used for various pieces of boilerplate. Defaults to the value of the `SOURCE_DATE_EPOCH` environment variable (as a number of second since the POSIX epoch) if it exists, otherwise to the current date and time. + `date`Timestamp of document rendering, used for various pieces of boilerplate. Defaults to the value of the `SOURCE_DATE_EPOCH` environment variable (as a number of second since the POSIX epoch) if it exists, otherwise to the current date and time. Required for documents with "standard" status, should reflect adoption date. `shortname`Document shortname, for example "ECMA-262". If present and `status` is "draft", `version` defaults to "Draft shortname". `description`Brief description to be used for link previews in social media and the like. `location`URL of this document. Used in conjunction with the biblio file to support inbound references from other documents. `copyright`Emit copyright and software license information. Boolean, default true. `contributors`Contributors to this specification, i.e. those who own the copyright. If your proposal includes text from any Ecma specification, this should include "Ecma International". + `committee`Ecma Technical Committee number. Required for documents with "standard" status, expects e.g. "39". Appends adoption information to <emu-intro> element. `--no-toc``toc`Emit table of contents. Boolean, default true. `--printable``printable`Make the output suitable for printing. Boolean, default false. `--load-biblio``extraBiblios`Extra biblio.json file(s) to load. This should contain either an object as exported by `--write-biblio` or an array of such objects. diff --git a/src/Spec.ts b/src/Spec.ts index 8009b105..52de1f36 100644 --- a/src/Spec.ts +++ b/src/Spec.ts @@ -594,9 +594,26 @@ export default class Spec { if (this.opts.printable) { this.log('Building covers and applying other print tweaks...'); + + const intro = this.doc.querySelector('emu-intro'); + + if (this.opts.status === 'standard') { + if (this.opts.committee) { + const adoptionInfo = this.doc.createElement('p'); + + adoptionInfo.classList.add('adoption-info'); + adoptionInfo.innerHTML = `This Ecma Standard was developed by Technical Committee ${this.opts.committee} and was adopted by the General Assembly of ${Intl.DateTimeFormat('en-GB-oxendict', { month: 'long', year: 'numeric' }).format(this.opts.date)}.`; + intro!.appendChild(adoptionInfo); + } else { + throw new Error( + '"standard" status requires a technical committee be defined in the "committee" field of the metadata.', + ); + } + } + const metadataEle = this.doc.querySelector('#metadata-block'); if (metadataEle) { - this.doc.querySelector('emu-intro')!.appendChild(metadataEle); + intro!.appendChild(metadataEle); } // front cover @@ -629,7 +646,8 @@ export default class Spec { this.log('Building table of contents...'); if (this.opts.printable) { - new Toc(this).build(2); + // Ecma guidance directs three levels of clause in ToC + new Toc(this).build(3); } else { ({ js: tocJs, eles: commonEles } = makeMenu(this)); } @@ -1194,11 +1212,7 @@ ${await utils.readFile(path.join(__dirname, '../js/multipage.js'))} script.setAttribute('defer', ''); this.doc.head.appendChild(script); - this.addStyle( - this.doc.head, - path.relative(outDir, printStyleLocationOnDisk), - this.opts.printable ? undefined : 'print', - ); + this.addStyle(this.doc.head, path.relative(outDir, printStyleLocationOnDisk), 'print'); this.addStyle(this.doc.head, path.relative(outDir, styleLocationOnDisk)); } else { // i.e. assets.type === 'inline' @@ -1494,15 +1508,14 @@ ${this.opts.multipage ? `
  • Navigate to/from multipagemNavigate to/from multipagem void; warn?: (err: EcmarkupError) => void; + committee?: number; } export async function build( diff --git a/src/lint/collect-spelling-diagnostics.ts b/src/lint/collect-spelling-diagnostics.ts index da2050b0..23a66672 100644 --- a/src/lint/collect-spelling-diagnostics.ts +++ b/src/lint/collect-spelling-diagnostics.ts @@ -73,7 +73,7 @@ const matchers = [ // https://en.wikipedia.org/wiki/American_and_British_English_spelling_differences#-our%2C_-or pattern: /\b(?:[Bb]ehaviors?|[Ff]lavors?|[Hh]arbors?|[Hh]onors?|[Hh]umors?|[Ll]abors?|[Nn]eighbors?|[Rr]umors?|[Ss]plendors?)\b/gu, - message: 'ECMA-262 uses Oxford spelling ("behaviour", etc.)', + message: 'Ecma uses Oxford spelling ("behaviour", etc.)', }, { pattern: /\b[Ii]ndexes\b/gu, diff --git a/test/baselines/generated-reference/assets-inline.html b/test/baselines/generated-reference/assets-inline.html index dd36e04e..38847291 100644 --- a/test/baselines/generated-reference/assets-inline.html +++ b/test/baselines/generated-reference/assets-inline.html @@ -3679,7 +3679,7 @@ caption, table > figcaption { caption-side: top; - color: #555555; + color: #000; font-weight: bold; margin-bottom: 1rem; text-align: center; @@ -3694,6 +3694,7 @@ break-inside: avoid-page; } +/* This inheritance looks weird—it's due to how Prince manages continuity in tables across pages */ table > figcaption { display: table-caption; -prince-caption-page: following; @@ -3911,6 +3912,26 @@ margin: 0; } +#sec-terms-and-definitions dfn { + font-style: normal; +} + +#sec-terms-and-definitions h1 .secnum { + display: block; +} + +#sec-terms-and-definitions > h1 > .secnum { + display: inline; +} + +#sec-terms-and-definitions h1 + p { + margin-top: 0; +} + +p.adoption-info { + float: bottom; +} + }