diff --git a/.github/workflows/enforce-format.yml b/.github/workflows/enforce-format.yml index 1d721faf..037691a0 100644 --- a/.github/workflows/enforce-format.yml +++ b/.github/workflows/enforce-format.yml @@ -8,7 +8,7 @@ on: jobs: check: - name: Enforce spec format + name: Enforce format runs-on: ubuntu-latest steps: - name: Checkout @@ -22,6 +22,14 @@ jobs: - name: Install dependencies run: npm ci + - name: Enforce code format + run: | + npm run format + if ! git diff-index --quiet HEAD; then + echo "You need to run \`npm run format\`" + exit 1 + fi + - name: Build run: npm run build diff --git a/css/elements.css b/css/elements.css index 037ba8ad..8e0c2a52 100644 --- a/css/elements.css +++ b/css/elements.css @@ -267,9 +267,7 @@ body { word-wrap: break-word; font-size: 18px; line-height: 1.5; - font-family: - 'IBM Plex Serif', - serif; + font-family: 'IBM Plex Serif', serif; font-variant-numeric: slashed-zero; padding: 0; margin: 0; @@ -287,7 +285,9 @@ body { padding-bottom: 1em; } -h1.shortname { display: none; } +h1.shortname { + display: none; +} body.oldtoc { margin: 0 auto; @@ -345,9 +345,7 @@ span.e-user-code::before { line-height: normal; vertical-align: middle; text-transform: uppercase; - font-family: - 'IBM Plex Sans', - sans-serif; + font-family: 'IBM Plex Sans', sans-serif; font-weight: 900; font-size: x-small; } @@ -370,10 +368,7 @@ span.e-user-code::before { code { font-weight: bold; - font-family: - 'Comic Code', - 'IBM Plex Mono', - monospace; + font-family: 'Comic Code', 'IBM Plex Mono', monospace; white-space: pre; } @@ -451,9 +446,7 @@ var.referenced6 { } emu-const { - font-family: - 'IBM Plex Sans', - sans-serif; + font-family: 'IBM Plex Sans', sans-serif; font-variant: small-caps; text-transform: uppercase; } @@ -476,11 +469,12 @@ emu-alg li.exit::before { vertical-align: middle; } -html.show-early-exits emu-alg li.exit:not(emu-alg ol.ac-body > li:last-child):not(emu-alg > ol > li:last-child)::before { +html.show-early-exits + emu-alg + li.exit:not(emu-alg ol.ac-body > li:last-child):not(emu-alg > ol > li:last-child)::before { display: inline-block; } - /* depth 1 */ emu-alg ol, /* depth 4 */ @@ -692,9 +686,7 @@ emu-rhs emu-nt { emu-t { display: inline-block; - font-family: - 'IBM Plex Mono', - monospace; + font-family: 'IBM Plex Mono', monospace; font-weight: bold; white-space: nowrap; text-indent: 0; @@ -729,9 +721,7 @@ emu-mods { emu-params, emu-opt { margin-right: 1ex; - font-family: - 'IBM Plex Mono', - monospace; + font-family: 'IBM Plex Mono', monospace; } emu-params, @@ -745,9 +735,7 @@ emu-opt { emu-gprose { font-size: 0.9em; - font-family: - 'IBM Plex Sans', - sans-serif; + font-family: 'IBM Plex Sans', sans-serif; } emu-production emu-gprose { @@ -1018,7 +1006,8 @@ emu-table td { background: var(--background-color); } -td[colspan]:not([colspan="1"]), th[colspan]:not([colspan="1"]) { +td[colspan]:not([colspan='1']), +th[colspan]:not([colspan='1']) { text-align: center; } diff --git a/css/print.css b/css/print.css index f67a6e23..993ce73c 100644 --- a/css/print.css +++ b/css/print.css @@ -1,10 +1,10 @@ @font-face { - font-family: "Arial Plus"; - src: local("Arial"); + font-family: 'Arial Plus'; + src: local('Arial'); } @font-face { - font-family: "Arial Plus"; + font-family: 'Arial Plus'; unicode-range: U+30; font-style: normal; font-weight: 400; @@ -12,15 +12,15 @@ } @font-face { - font-family: "Arial Plus"; + font-family: 'Arial Plus'; unicode-range: U+221e; font-style: normal; font-weight: 400; - src: local("DejaVu Math TeX Gyre"); + src: local('DejaVu Math TeX Gyre'); } @font-face { - font-family: "Arial Plus"; + font-family: 'Arial Plus'; unicode-range: U+30; font-style: normal; font-weight: 700; @@ -28,15 +28,15 @@ } @font-face { - font-family: "Arial Plus"; + font-family: 'Arial Plus'; unicode-range: U+221e; font-style: normal; font-weight: 700; - src: local("DejaVu Math TeX Gyre"); + src: local('DejaVu Math TeX Gyre'); } @font-face { - font-family: "Arial Plus"; + font-family: 'Arial Plus'; unicode-range: U+30; font-style: italic; font-weight: 400; @@ -44,15 +44,15 @@ } @font-face { - font-family: "Arial Plus"; + font-family: 'Arial Plus'; unicode-range: U+221e; font-style: italic; font-weight: 400; - src: local("DejaVu Math TeX Gyre"); + src: local('DejaVu Math TeX Gyre'); } @font-face { - font-family: "Arial Plus"; + font-family: 'Arial Plus'; unicode-range: U+30; font-style: italic; font-weight: 700; @@ -60,11 +60,11 @@ } @font-face { - font-family: "Arial Plus"; + font-family: 'Arial Plus'; unicode-range: U+221e; font-style: italic; font-weight: 700; - src: local("DejaVu Math TeX Gyre"); + src: local('DejaVu Math TeX Gyre'); } :root { @@ -186,18 +186,27 @@ page-break-after: always; } -html, body { +html, +body { background-color: initial; } body { - font-family: 'Arial Plus', Arial, Helvetica, sans-serif, "DejaVu Math TeX Gyre", Symbola, monospace; + font-family: 'Arial Plus', Arial, Helvetica, sans-serif, 'DejaVu Math TeX Gyre', Symbola, + monospace; font-size: 10pt; color: #000; line-height: 1.15; } -h1, h2, h3, h4, h5, h6 { -prince-bookmark-level: none } /* see https://www.princexml.com/doc/prince-output/#pdf-bookmarks */ +h1, +h2, +h3, +h4, +h5, +h6 { + -prince-bookmark-level: none; +} /* see https://www.princexml.com/doc/prince-output/#pdf-bookmarks */ .copyright-notice + h1.title { break-before: recto; @@ -217,8 +226,12 @@ p { text-wrap: pretty; overflow-wrap: break-word; hyphens: auto; - orphans: 2, -prince-prefer 3; /* see https://www.princexml.com/doc/prince-for-books/#pagination-goals */ - widows: 2, -prince-prefer 3; + orphans: + 2, + -prince-prefer 3; /* see https://www.princexml.com/doc/prince-for-books/#pagination-goals */ + widows: + 2, + -prince-prefer 3; } h1 { @@ -294,7 +307,8 @@ emu-table td p { overflow: hidden; } -emu-nt, emu-t { +emu-nt, +emu-t { display: initial; } @@ -310,7 +324,9 @@ emu-intro { page: intro; } -emu-intro, emu-clause, emu-annex { +emu-intro, +emu-clause, +emu-annex { margin-top: 4ex; } @@ -335,7 +351,9 @@ emu-clause > p:first-of-type + emu-alg { break-before: avoid; } -emu-intro emu-intro, emu-clause emu-clause, emu-annex emu-annex { +emu-intro emu-intro, +emu-clause emu-clause, +emu-annex emu-annex { margin-top: 3.5ex; } @@ -351,56 +369,80 @@ emu-annex emu-annex emu-annex emu-annex emu-annex { margin-top: 3.2ex; } -emu-intro h1, emu-clause h1 , emu-annex h1 { +emu-intro h1, +emu-clause h1, +emu-annex h1 { break-after: avoid; font-size: 12pt; -prince-bookmark-level: 1; -prince-bookmark-label: content(); } -emu-clause emu-clause h1, emu-annex emu-annex h1 { +emu-clause emu-clause h1, +emu-annex emu-annex h1 { -prince-bookmark-level: 2; -prince-bookmark-state: closed; } -emu-clause emu-clause h1, emu-annex emu-annex h1, -emu-intro h2, emu-clause h2, emu-annex h2 { +emu-clause emu-clause h1, +emu-annex emu-annex h1, +emu-intro h2, +emu-clause h2, +emu-annex h2 { font-size: 11pt; } -emu-clause emu-clause emu-clause h1, emu-annex emu-annex emu-annex h1 { +emu-clause emu-clause emu-clause h1, +emu-annex emu-annex emu-annex h1 { -prince-bookmark-level: 3; } -emu-clause emu-clause emu-clause emu-clause h1, emu-annex emu-annex emu-annex emu-annex h1 { +emu-clause emu-clause emu-clause emu-clause h1, +emu-annex emu-annex emu-annex emu-annex h1 { -prince-bookmark-level: 4; } -emu-clause emu-clause emu-clause emu-clause emu-clause h1, emu-annex emu-annex emu-annex emu-annex emu-annex h1 { +emu-clause emu-clause emu-clause emu-clause emu-clause h1, +emu-annex emu-annex emu-annex emu-annex emu-annex h1 { -prince-bookmark-level: 5; } -emu-clause emu-clause emu-clause emu-clause emu-clause emu-clause h1, emu-annex emu-annex emu-annex emu-annex emu-annex emu-annex h1 { +emu-clause emu-clause emu-clause emu-clause emu-clause emu-clause h1, +emu-annex emu-annex emu-annex emu-annex emu-annex emu-annex h1 { -prince-bookmark-level: 6; } -emu-clause emu-clause emu-clause h1, emu-annex emu-annex emu-annex h1, -emu-clause emu-clause h2, emu-annex emu-annex h2, -emu-clause emu-clause emu-clause emu-clause h1, emu-annex emu-annex emu-annex emu-annex h1, -emu-clause emu-clause emu-clause h2, emu-annex emu-annex emu-annex h2, -emu-clause emu-clause emu-clause emu-clause emu-clause h1, emu-annex emu-annex emu-annex emu-annex emu-annex h1, -emu-clause emu-clause emu-clause emu-clause h2, emu-annex emu-annex emu-annex emu-annex h2, -emu-clause emu-clause emu-clause emu-clause emu-clause emu-clause h1, emu-annex emu-annex emu-annex emu-annex emu-annex emu-annex h1, -emu-clause emu-clause emu-clause emu-clause emu-clause h2, emu-annex emu-annex emu-annex emu-annex emu-annex h2 { +emu-clause emu-clause emu-clause h1, +emu-annex emu-annex emu-annex h1, +emu-clause emu-clause h2, +emu-annex emu-annex h2, +emu-clause emu-clause emu-clause emu-clause h1, +emu-annex emu-annex emu-annex emu-annex h1, +emu-clause emu-clause emu-clause h2, +emu-annex emu-annex emu-annex h2, +emu-clause emu-clause emu-clause emu-clause emu-clause h1, +emu-annex emu-annex emu-annex emu-annex emu-annex h1, +emu-clause emu-clause emu-clause emu-clause h2, +emu-annex emu-annex emu-annex emu-annex h2, +emu-clause emu-clause emu-clause emu-clause emu-clause emu-clause h1, +emu-annex emu-annex emu-annex emu-annex emu-annex emu-annex h1, +emu-clause emu-clause emu-clause emu-clause emu-clause h2, +emu-annex emu-annex emu-annex emu-annex emu-annex h2 { font-size: 10pt; } -emu-clause ol, emu-clause ul, emu-clause dl, emu-annex ol, emu-annex ul, emu-annex dl { +emu-clause ol, +emu-clause ul, +emu-clause dl, +emu-annex ol, +emu-annex ul, +emu-annex dl { margin-left: 0; padding-left: 1.75em; } -emu-clause ol ol, emu-clause ul ul { +emu-clause ol ol, +emu-clause ul ul { padding-left: 2em; } @@ -425,7 +467,8 @@ emu-table th { overflow-wrap: break-word; } -caption, table > figcaption { +caption, +table > figcaption { caption-side: top; color: #000; font-weight: bold; @@ -571,7 +614,8 @@ emu-annex > h1 .secnum { margin: 0 0 1lh; } -.copyright-notice { /* ecma mandated */ +.copyright-notice { + /* ecma mandated */ font-style: italic; border: 1px solid black; padding: 1em; @@ -607,7 +651,10 @@ h1.shortname { margin-top: 0; } -h1.shortname a:link, h1.shortname a:visited, h1.shortname a:hover, h1.shortname a:active { +h1.shortname a:link, +h1.shortname a:visited, +h1.shortname a:hover, +h1.shortname a:active { color: black; } diff --git a/test/baselines/generated-reference/assets-inline.html b/test/baselines/generated-reference/assets-inline.html index be1547da..15964d9b 100644 --- a/test/baselines/generated-reference/assets-inline.html +++ b/test/baselines/generated-reference/assets-inline.html @@ -1882,9 +1882,7 @@ word-wrap: break-word; font-size: 18px; line-height: 1.5; - font-family: - 'IBM Plex Serif', - serif; + font-family: 'IBM Plex Serif', serif; font-variant-numeric: slashed-zero; padding: 0; margin: 0; @@ -1902,7 +1900,9 @@ padding-bottom: 1em; } -h1.shortname { display: none; } +h1.shortname { + display: none; +} body.oldtoc { margin: 0 auto; @@ -1960,9 +1960,7 @@ line-height: normal; vertical-align: middle; text-transform: uppercase; - font-family: - 'IBM Plex Sans', - sans-serif; + font-family: 'IBM Plex Sans', sans-serif; font-weight: 900; font-size: x-small; } @@ -1985,10 +1983,7 @@ code { font-weight: bold; - font-family: - 'Comic Code', - 'IBM Plex Mono', - monospace; + font-family: 'Comic Code', 'IBM Plex Mono', monospace; white-space: pre; } @@ -2066,9 +2061,7 @@ } emu-const { - font-family: - 'IBM Plex Sans', - sans-serif; + font-family: 'IBM Plex Sans', sans-serif; font-variant: small-caps; text-transform: uppercase; } @@ -2091,11 +2084,12 @@ vertical-align: middle; } -html.show-early-exits emu-alg li.exit:not(emu-alg ol.ac-body > li:last-child):not(emu-alg > ol > li:last-child)::before { +html.show-early-exits + emu-alg + li.exit:not(emu-alg ol.ac-body > li:last-child):not(emu-alg > ol > li:last-child)::before { display: inline-block; } - /* depth 1 */ emu-alg ol, /* depth 4 */ @@ -2307,9 +2301,7 @@ emu-t { display: inline-block; - font-family: - 'IBM Plex Mono', - monospace; + font-family: 'IBM Plex Mono', monospace; font-weight: bold; white-space: nowrap; text-indent: 0; @@ -2344,9 +2336,7 @@ emu-params, emu-opt { margin-right: 1ex; - font-family: - 'IBM Plex Mono', - monospace; + font-family: 'IBM Plex Mono', monospace; } emu-params, @@ -2360,9 +2350,7 @@ emu-gprose { font-size: 0.9em; - font-family: - 'IBM Plex Sans', - sans-serif; + font-family: 'IBM Plex Sans', sans-serif; } emu-production emu-gprose { @@ -2633,7 +2621,8 @@ background: var(--background-color); } -td[colspan]:not([colspan="1"]), th[colspan]:not([colspan="1"]) { +td[colspan]:not([colspan='1']), +th[colspan]:not([colspan='1']) { text-align: center; } @@ -3303,12 +3292,12 @@ }