-
Notifications
You must be signed in to change notification settings - Fork 63
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
support for replacement algorithms and for xrefs to steps #217
Conversation
node.innerHTML = html; | ||
|
||
let labeledStepEntries: StepBiblioEntry[] = []; | ||
let replaces = node.getAttribute('replaces-step'); |
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.
Should we remove this attribute from the output?
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.
Ecmarkup doesn't really clean up after itself, as a rule - all the emu-whatever
tags are in the output, etc.
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.
Fine. We should reconsider that.
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.
Opened #218 to track.
This adds the ability to reference steps, both with
emu-xref
s and by marking algorithms as replacing steps (the latter so that they can have the appropriate numbering).You can label steps using the
1. [label="foo"] Step.
syntax introduced in tc39/ecmarkdown#74, and you can refer to them with<emu-xref href="#step-foo"></emu-xref>
or<emu-alg replaces-step="foo">
. The xref will automatically be populated with the appropriate step number (just the number itself, so you still need to write out "step", and possibly the name of the algorithm if it isn't clear). The labeled algorithm will automatically adopt the numbering of the labeled step, including for nested steps.Now that we have support for replacement algorithms there is no longer a need to manually override the starting number for a list. I enforce that you do not, and that you do not write "step 1" or whatever, with the linter.
Fixes #192.
Marked as draft until a version of ecmarkdown with support for the
[label=""]
syntax is published.Corresponding ecmarkdown PR at tc39/ecmarkdown#74. Corresponding ecma262 PR at tc39/ecma262#2052.
Since it's hard to review the CSS in the PR, here's a screenshot of the new
algorithm-replacements
baseline: