Skip to content

Commit 9c970c2

Browse files
authored
Add numbering to terms (#367)
* Add numbering to terms * remove dup words, closes #365 * closes #351 * fix codosumentation, closes #359 * closes #342 * closes #341 * reworded, closes #340 * roll to pub
1 parent ac610aa commit 9c970c2

2 files changed

Lines changed: 41 additions & 10 deletions

File tree

doc/main.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
<meta itemprop="pubType" content="AG" />
1010
<meta itemprop="pubNumber" content="26" />
1111
<!-- <meta itemprop="pubPart" content="XX" /> -->
12-
<meta itemprop="pubState" content="draft" />
12+
<meta itemprop="pubState" content="pub" />
1313
<!-- meta itemprop="pubStage" content="WD" / -->
1414
<meta itemprop="pubConfidential" content="no" />
1515
<!--< meta itemprop="pubTC" content="XX" /> -->
1616
<meta itemprop="pubSuiteTitle" content="HTML Pub" />
17-
<meta itemprop="pubDateTime" content="2025-02-26" />
17+
<meta itemprop="pubDateTime" content="2026-01-27" />
1818
<!-- <meta itemprop="pubRevisionOf" content="SMPTE ST XXXX-Y:ZZZZ" /> -->
1919
<title>Tooling and documentation for HTML documents</title>
2020
</head>
@@ -452,15 +452,15 @@ <h5>RDD</h5>
452452
<p>When <code>pubType</code> is set to <code>RDD</code>, the <a>Foreword</a> section shall be present and there there shall be a single <code>dl</code>, after any author-supplied prose if supplied, which contains contact information about the proponent(s) of the RDD document. </p>
453453

454454
<p>The <code>id</code> attribute shall be present on the <code>dl</code> element and equal to
455-
<code>rdd-proponent</code>. </p>
455+
<code>element-proponent</code>. </p>
456456

457457
<p>If present, the <code>dl</code> element shall use a single <code>dt</code> element for each company name designated as a Proponent of the document, and multiple lines of <code>dd</code> as needed for contact information for each company listed. The contact infomation should at least include an address and email, reach out to SMPTE HO for further deatails. </p>
458458

459459
<div class="example">
460460
<pre>
461461
&lt;section id=&quot;sec-foreword&quot;&gt;
462462
&lt;p&gt;This is the additional information relevant to the document.&lt;/p&gt;
463-
&lt;dl id=&quot;rdd-proponent&quot;&gt;
463+
&lt;dl id=&quot;element-proponent&quot;&gt;
464464
&lt;dt&gt;Company 1 Name Here&lt;/dt&gt;
465465
&lt;dd&gt;Contact Name&lt;/dd&gt;
466466
&lt;dd&gt;Company Address&lt;/dd&gt;
@@ -1277,7 +1277,7 @@ <h4>Formulae</h4>
12771277

12781278
<section id="sec-special-characters">
12791279
<h4>Special Characters</h4>
1280-
<p>Characters should should be encoded as UTF-8-encoded Unicode codepoints, e.g. あ, instead of HTML entities, e.g. <code>&amp;#x3042;</code>, except as needed for usage in <code>pre</code> or examples.
1280+
<p>Characters should be encoded as UTF-8-encoded Unicode codepoints, e.g. あ, instead of HTML entities, e.g. <code>&amp;#x3042;</code>, except as needed for usage in <code>pre</code> or examples.
12811281
</p>
12821282

12831283
</section>
@@ -1356,7 +1356,7 @@ <h3>Building</h3>
13561356
<li>Uploading the rendered document and corresponding redlines to S3</li>
13571357
</ol>
13581358

1359-
<p>The build process is carried by the build script <code>scripts/build.mjs</code>, which is usually executed by the
1359+
<p>The build process carried by the build script <code>scripts/build.mjs</code> is usually executed by the
13601360
GitHub workflow (see <a href="#sec-gh-integration"></a>). The script has the following dependencies:</p>
13611361

13621362
<ul>
@@ -1480,7 +1480,7 @@ <h3>Amazon AWS integration</h3>
14801480
<code>AWS_S3_BUCKET</code></figcaption>
14811481
</figure>
14821482

1483-
<p>The contents of the bucket is also made available through a Cloudfront distribution, which allows the publication artifacts
1483+
<p>The contents of the bucket are also made available through a Cloudfront distribution, which allows the publication artifacts
14841484
to be made available through a custom domain name and TLS (currently <code>https://doc.smpte-doc.org/</code>).</p>
14851485
</section>
14861486

@@ -1592,7 +1592,7 @@ <h4>Column Alignment</h4>
15921592
<h4>Cell Alignment</h4>
15931593

15941594
<p>
1595-
To change the alignment of a individual cell, the class <code>center-cell</code> may be added to each <code>td</code> as needed, as the below example shows.
1595+
To change the alignment of an individual cell, the class <code>center-cell</code> may be added to each <code>td</code> as needed, as the below example shows.
15961596
</p>
15971597

15981598
<pre data-include="snippets/tab-sample-tabledata-centercell.txt"></pre>
@@ -2210,14 +2210,14 @@ <h3>Pull Request Guidelines</h3>
22102210
<p>
22112211
Generally, no changes to a document shall ever be made directly on the <code>main</code> branch, which doesn't allow the tooling to create needed redlines. Instead, changes (regardless of the nature of the change) shall always be made on a new branch and managed via a PR (Pull Request). Each PR is then merged to <code>main</code> after approval, as noted below in <a href="#sec-sample-workflow"></a> at the various stages.
22122212
</p>
2213-
<p>PRs should have at least (1) approver that is not the the person requesting the PR. This can be the DG chair, TC chair, commentor, or secondary editor, depending on nature of the PR. For instance, on ballot state change PRs, this should be the DG or TC chair, and for publication state PRs, the TC chairs. See <a href="#sec-sample-workflow"></a> for more details.</p>
2213+
<p>PRs should have at least (1) approver that is not the person requesting the PR. This can be the DG chair, TC chair, commentor, or secondary editor, depending on nature of the PR. For instance, on ballot state change PRs, this should be the DG or TC chair, and for publication state PRs, the TC chairs. See <a href="#sec-sample-workflow"></a> for more details.</p>
22142214

22152215
</section>
22162216

22172217
<section id="sec-sample-workflow">
22182218
<h3>Sample Workflow </h3>
22192219
<p>
2220-
The below list shows a sample workflow which would be the steps for an Engineering Document going through the an initial draft or revision and the balloting process.
2220+
The below list shows a sample workflow which would be the steps for an Engineering Document going through an initial draft or revision and the balloting process.
22212221
</p>
22222222

22232223
<p class="note">Editors and Chairs should be aware of the general guidelines provided in the <a href="#bib-smpte-gh-om"></a>.

smpte.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,36 @@ function numberExamples() {
11941194
}
11951195
}
11961196

1197+
function numberTerms() {
1198+
const termsSection = document.getElementById("sec-terms-and-definitions");
1199+
const terms = document.getElementById("terms-int-defs");
1200+
if (!termsSection || !terms) return;
1201+
1202+
// Clause number for the Terms and definitions section (e.g. "4")
1203+
const sectionNumberEl = termsSection.querySelector(":scope > h2 .heading-number");
1204+
const sectionNumber = sectionNumberEl ? sectionNumberEl.innerText.trim() : "";
1205+
1206+
let counter = 1;
1207+
1208+
for (const child of terms.children) {
1209+
if (child.localName !== "dt") continue;
1210+
1211+
// If multiple <dt> occur in a row, only number the first one
1212+
const prev = child.previousElementSibling;
1213+
if (prev && prev.localName === "dt") continue;
1214+
1215+
const labelValue = sectionNumber ? `${sectionNumber}.${counter++}` : `${counter++}`;
1216+
1217+
const numLine = document.createElement("span");
1218+
numLine.className = "heading-number term-number";
1219+
numLine.innerText = labelValue;
1220+
1221+
// Number on its own line above the term
1222+
child.insertBefore(document.createElement("br"), child.firstChild);
1223+
child.insertBefore(numLine, child.firstChild);
1224+
}
1225+
}
1226+
11971227
function _normalizeTerm(term) {
11981228
return term.trim().toLowerCase().replace(/\s+/g," ");
11991229
}
@@ -1457,6 +1487,7 @@ async function render() {
14571487
numberFormulae();
14581488
numberNotes();
14591489
numberExamples();
1490+
numberTerms();
14601491
resolveLinks(docMetadata);
14611492
insertTOC(docMetadata);
14621493
addHeadingLinks(docMetadata);

0 commit comments

Comments
 (0)