Skip to content
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

Fix additional element section #231

Merged
merged 2 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions css/smpte.css
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ code:hover {
#sec-elements a {
color: currentColor;
text-decoration: none;
pointer-events: none;
cursor: default;
}

@page:first {
Expand Down
5 changes: 3 additions & 2 deletions doc/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,8 @@ <h4>Additional elements section</h4>
<ul>
<li>an <code>id</code> attribute whose value is prefixed with <code>element-</code>;</li>
<li>a <code>title</code> attribute that provides a short description of the element;</li>
<li>a <code>href</code> attribute that links to the element, as detailed below.</li>
<li>a <code>href</code> attribute that links to the element, as detailed below; and</li>
<li>a <code>class</code> attribute that contains the token <code>informative</code> if the element is informative.</li>
</ul>

<p>
Expand Down Expand Up @@ -2276,7 +2277,7 @@ <h3>Sample Workflow </h3>

<section id="sec-elements">
<ol>
<li><a id="element-sample-text" title="Sample text element" href="elements/sample.txt"></a></li>
<li><a id="element-sample-text" title="Sample text element" class="informative" href="elements/sample.txt"></a></li>
<li><a id="element-url" title="Sample URL element"
href="https://github.com/SMPTE/html-pub/tree/631ed7a0312fa183c356a7b742129ce46f92736f"></a></li>
</ol>
Expand Down
9 changes: 3 additions & 6 deletions smpte.js
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ function insertElementsAnnex(docMetadata) {
return;
}

sec.classList.add("annex");
sec.classList.add("unnumbered");

const intro = document.createElement("p");
intro.innerText = "This annex lists non-prose elements of this document."
Expand Down Expand Up @@ -578,14 +578,11 @@ function insertElementsAnnex(docMetadata) {
}

e.parentElement.insertBefore(
document.createTextNode(` ${e.title} (${isAbsoluteLink ? "url:" : "file:"} `),
document.createTextNode(` ${e.title} ${e.classList.contains("informative")? "(informative)" : "(normative)"}. ${isAbsoluteLink ? "url:" : "file:"} <`),
e
);

e.parentElement.insertBefore(
document.createTextNode(")"),
null
);
e.parentElement.insertBefore(document.createTextNode(">."), null);

}
}
Expand Down
Loading