Skip to content

Commit

Permalink
Fix additional element section
Browse files Browse the repository at this point in the history
* Add informative/normative label to additional elements
* Make the additional element section unnumbered
* Make elements link cold in print media

#213
#212
#220
  • Loading branch information
palemieux authored Feb 20, 2024
1 parent b3e07eb commit 438ac8c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
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

0 comments on commit 438ac8c

Please sign in to comment.