-
Notifications
You must be signed in to change notification settings - Fork 74
Update ecmarkup output to align more closely with ecma guidelines #661
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ version.innerHTML = restoreSuperScripts(version.innerHTML); | |
| title.innerHTML = restoreSuperScripts(title.innerHTML); | ||
|
|
||
| rearrangeTables(); | ||
| formatCaptions(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why change the captions only for print? If Ecma guidelines have us using
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Glad you brought it up 😁 I actually have a change in the actual figures in a follow-up PR. wanted this merged before I opened it. |
||
|
|
||
| PDF.pageLayout = 'two-column-right'; | ||
| PDF.pageMode = 'show-bookmarks'; | ||
|
|
@@ -27,6 +28,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; | ||
|
|
||
|
|
@@ -50,7 +60,7 @@ function rearrangeTables() { | |
|
|
||
| tables.forEach(emuTable => { | ||
| const figcaption = emuTable.getElementsByTagName('figcaption')[0]; | ||
| const tableCaptionText = figcaption.innerHTML; | ||
| const tableCaptionText = figcaption.innerHTML.replace(': ', ' — '); | ||
| const table = emuTable.getElementsByTagName('table')[0]; | ||
| const captionElement = document.createElement('caption'); | ||
|
|
||
|
|
@@ -61,6 +71,12 @@ function rearrangeTables() { | |
| }); | ||
| } | ||
|
|
||
| function formatCaptions() { | ||
| const captions = Array.from(document.getElementsByTagName('figcaption')); | ||
|
|
||
| captions.forEach(caption => (caption.innerHTML = caption.innerHTML.replace(': ', ' — '))); | ||
| } | ||
|
|
||
| /** | ||
| * @typedef {Object} PrinceBox | ||
| * @property {string} type | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who is using this and what's it for? I don't see it in ECMA-262.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the paragraph that says "This Ecma Standard was developed by Technical Committee NN and was adopted by the General Assembly of Month Year."