diff --git a/css/elements.css b/css/elements.css index cda2b290..191911c2 100644 --- a/css/elements.css +++ b/css/elements.css @@ -256,12 +256,12 @@ html { background-color: var(--background-color); + font-size: 18px; } body { display: flex; word-wrap: break-word; - font-size: 18px; line-height: 1.5; font-family: 'IBM Plex Serif', @@ -920,6 +920,18 @@ emu-annex emu-annex emu-annex emu-annex emu-annex emu-annex { margin-top: 0; } +[id*='terms-and-definitions'] emu-clause h1 { + font-size: 1rem; +} + +[id*='terms-and-definitions'] emu-clause h1 + p { + margin-top: 0; +} + +[id*='terms-and-definitions'] emu-clause .secnum { + display: block; +} + /* Figures and tables */ figure { display: block; diff --git a/css/print.css b/css/print.css index f67a6e23..57cf3b4e 100644 --- a/css/print.css +++ b/css/print.css @@ -188,11 +188,11 @@ html, body { background-color: initial; + font-size: 10pt; } body { font-family: 'Arial Plus', Arial, Helvetica, sans-serif, "DejaVu Math TeX Gyre", Symbola, monospace; - font-size: 10pt; color: #000; line-height: 1.15; } @@ -660,20 +660,12 @@ p.ECMAaddress { margin: 0; } -#sec-terms-and-definitions dfn { +[id*='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; +[id*='terms-and-definitions'] emu-clause h1 { + -prince-bookmark-level: none; } p.adoption-info { diff --git a/js/print.js b/js/print.js index 45ca7376..c6e62aa7 100644 --- a/js/print.js +++ b/js/print.js @@ -30,7 +30,7 @@ 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"]'); +const terms = document.querySelector('#toc a[href*="#terms-and-definitions"]'); if (terms) { (terms.parentElement.querySelector('ol.toc') || document.createElement('i')).remove(); diff --git a/spec/index.html b/spec/index.html index 5402b7bb..be8382cf 100644 --- a/spec/index.html +++ b/spec/index.html @@ -164,7 +164,9 @@

Example

Clauses

-

Clauses are referenced using their id and are numbered automatically based on document position. Ecmarkdown syntax can be used in descendent text nodes as well. Text nodes are parsed as Ecmarkdown Fragments.

+

Clauses are referenced using their id and are numbered automatically based on document position. Ecmarkdown syntax can be used in descendent text nodes as well. Text nodes are parsed as Ecmarkdown Fragments. Clauses always begin with an `<h1>` element.

+ +

emu-intro

@@ -254,6 +256,42 @@

This clause is normative optional.

+ + +

Terms and definitions

+

Ecmarkup produces special formatting behaviour for an `<emu-clause>` with an ID ending in `terms-and-definitions`. No action is required on an editor's part to properly format that clause as long as it uses similar markup to any other clause, i.e. an `<h1>` element followed by one or more `<p>` or `<emu-clause>` elements.

+

Using a `<dfn>` element in the clause title is optional, and will allow ecmarkup to link back to the term anywhere it is used in the rest of the document. See definitions.

+ +

Example

+

+      <emu-clause id="sec-terms-and-definitions">
+        <h1>Terms and definitions</h1>
+        <emu-clause id="term-technical-definition">
+          <h1>technical definition</h1>
+          <p>descriptive text aligning with Ecma house style, providing text that could be swapped in for the term without impacting readability</p>
+        </emu-clause>
+        <emu-clause id="term-ecma">
+          <h1><dfn>Ecma International</dfn></h1>
+          <p>international standards organization responsible for technology-related standards since 1959</p>
+        </emu-clause>
+      </emu-clause>
+ +

Result

+ +
@@ -270,7 +308,7 @@

Attributes

Definitions

-

Terms can be defined using the `<dfn>` element. Any uses of that term will be automatically linked to the clause containing the definition, or, if the `<dfn>` element has an `id`, to the `<dfn>` itself. This can be suppressed with the `emu-not-ref` element.

+

Terms can be defined inline using the `<dfn>` element. Any uses of that term will be automatically linked to the clause containing the definition, or, if the `<dfn>` element has an `id`, to the `<dfn>` itself. This can be suppressed with the `emu-not-ref` element.

When the term starts with a lowercase English letter, usages of the term with the first letter capitalized will also link.

Attributes

@@ -1103,3 +1141,47 @@

Code Listings

Create a code listing using `<pre><code>`. The `code` element takes a class of `javascript`, `html`, or any other language provided by highlightjs. Ecmarkup will trim any leading blank lines and also normalize the indentation based on the indentation of the first line.

+ + +

Required structure for Ecma documents

+ +

Ecmarkup supports producing a document aligned with Ecma house style. If the ecmarkup document is intended to be formally released by Ecma International, there are some structural requirements it shall follow.

+

Each `<emu-intro>`, `<emu-clause>`, and `<emu-annex>` element shall have a unique ID, optionally beginning with the prefix `sec-`.

+ + +

Technical Reports

+ + +

This section is a work in progress.

+
+ +

Ecma technical reports begin with an unnumbered introduction (using a single `<emu-intro>` element), then the following numbered clauses:

+ +
    +
  1. Scope
  2. +
  3. References
  4. +
  5. Terms and definitions
  6. +
+ +

(Refer to the Ecma house style guide for more detailed information.)

+
+ + +

Standards

+ + +

This section is a work in progress.

+
+ +

Ecma standards conforming to Ecma house style begin with an unnumbered introduction clause (using a single `<emu-intro>` element), followed by the following numbered clauses:

+ +
    +
  1. Scope
  2. +
  3. Normative references
  4. +
  5. Informative references
  6. +
  7. Terms and definitions
  8. +
+ +

(Refer to the Ecma house style guide for more detailed information.)

+
+
diff --git a/test/baselines/generated-reference/assets-inline.html b/test/baselines/generated-reference/assets-inline.html index f12126b6..506c96d4 100644 --- a/test/baselines/generated-reference/assets-inline.html +++ b/test/baselines/generated-reference/assets-inline.html @@ -1872,12 +1872,12 @@ html { background-color: var(--background-color); + font-size: 18px; } body { display: flex; word-wrap: break-word; - font-size: 18px; line-height: 1.5; font-family: 'IBM Plex Serif', @@ -2536,6 +2536,18 @@ margin-top: 0; } +[id*='terms-and-definitions'] emu-clause h1 { + font-size: 1rem; +} + +[id*='terms-and-definitions'] emu-clause h1 + p { + margin-top: 0; +} + +[id*='terms-and-definitions'] emu-clause .secnum { + display: block; +} + /* Figures and tables */ figure { display: block; @@ -3445,11 +3457,11 @@ html, body { background-color: initial; + font-size: 10pt; } body { font-family: 'Arial Plus', Arial, Helvetica, sans-serif, "DejaVu Math TeX Gyre", Symbola, monospace; - font-size: 10pt; color: #000; line-height: 1.15; } @@ -3917,20 +3929,12 @@ margin: 0; } -#sec-terms-and-definitions dfn { +[id*='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; +[id*='terms-and-definitions'] emu-clause h1 { + -prince-bookmark-level: none; } p.adoption-info {