Skip to content

Commit 7e4ca8d

Browse files
authored
Update tooling and instructions for ER and RDD (#315)
* Update tooling and instructions for ER and RDD * simplified the proponents to a `dl` in the foreward section * check RDD has foreword * min RDD for tests * update min rdd * update min rdd * Update validation for dl in Foreword * revert HEAD changes * roll back gitignore * update proponents example * address comments and expand proponent example
1 parent 75fdae9 commit 7e4ca8d

File tree

6 files changed

+209
-34
lines changed

6 files changed

+209
-34
lines changed

doc/main.html

Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,13 @@ <h4><code>pubType</code></h4>
163163

164164
<p>The element shall have a <code>content</code> attribute equal to one of the following values:</p>
165165
<ul>
166-
<li><code>AG</code>, if the document is an Administrative Guideline;</li>
167-
<li><code>OM</code>, if the document is an Operations Manual;</li>
168166
<li><code>ST</code>, if the document is a Standard;</li>
169-
<li><code>RP</code>, if the document is a Recommended Practice; or</li>
170-
<li><code>EG</code>, if the document is an Engineering Guideline.</li>
167+
<li><code>RP</code>, if the document is a Recommended Practice;</li>
168+
<li><code>EG</code>, if the document is an Engineering Guideline;</li>
169+
<li><code>ER</code>, if the document is an Engineering Report;</li>
170+
<li><code>RDD</code>, if the document is an Registered Disclosure Document;</li>
171+
<li><code>AG</code>, if the document is an Administrative Guideline; or</li>
172+
<li><code>OM</code>, if the document is an Operations Manual.</li>
171173
</ul>
172174

173175
</section>
@@ -422,22 +424,60 @@ <h4>Overall structure</h4>
422424
<section id="sec-foreword-section">
423425
<h4>Foreword section</h4>
424426

425-
<p>The <dfn>Foreword</dfn> section contains author-supplied prose, e.g. list of substantive changes since the last edition,
426-
that is added to the SMPTE boilerplate text.</p>
427+
<section id="sec-foreword-general">
428+
<h5>General</h5>
427429

428-
<p>The absence of this section indicates that no author-supplied prose was provided.</p>
429430

430-
<p>The <code>id</code> attribute shall be present on the <code>section</code> element and equal to
431-
<code>sec-foreword</code>.</p>
431+
<p>The <dfn>Foreword</dfn> section contains author-supplied prose, e.g. list of substantive changes since the last edition,
432+
that is added to the SMPTE boilerplate text.</p>
432433

433-
<p>The heading shall not be present.</p>
434+
<p>The absence of this section indicates that no author-supplied prose was provided.</p>
434435

435-
<div class="example">
436+
<p>The <code>id</code> attribute shall be present on the <code>section</code> element and equal to
437+
<code>sec-foreword</code>.</p>
438+
439+
<p>The heading shall not be present.</p>
440+
441+
<div class="example">
436442
<pre>&lt;section id=&quot;sec-foreword&quot;&gt;
437443
&lt;p&gt;This is the additional information relevant to the document.&lt;/p&gt;
438444
&lt;/section&gt;
439445
</pre>
440-
</div>
446+
</div>
447+
448+
</section>
449+
<section id="sec-foreword-rdd">
450+
<h5>RDD</h5>
451+
452+
<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>
453+
454+
<p>The <code>id</code> attribute shall be present on the <code>dl</code> element and equal to
455+
<code>rdd-proponent</code>. </p>
456+
457+
<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>
458+
459+
<div class="example">
460+
<pre>
461+
&lt;section id=&quot;element-proponent&quot;&gt;
462+
&lt;p&gt;This is the additional information relevant to the document.&lt;/p&gt;
463+
&lt;dl id=&quot;rdd-proponent&quot;&gt;
464+
&lt;dt&gt;Company 1 Name Here&lt;/dt&gt;
465+
&lt;dd&gt;Contact Name&lt;/dd&gt;
466+
&lt;dd&gt;Company Address&lt;/dd&gt;
467+
&lt;dd&gt;&lt;a&gt;Contact Email&lt;/a&gt;&lt;/dd&gt;
468+
&lt;dd&gt;&lt;a&gt;Company Website&lt;/a&gt;&lt;/dd&gt;
469+
&lt;dt&gt;Company 2 Name Here&lt;/dt&gt;
470+
&lt;dd&gt;Contact Name&lt;/dd&gt;
471+
&lt;dd&gt;Company Address&lt;/dd&gt;
472+
&lt;dd&gt;&lt;a&gt;Contact Email&lt;/a&gt;&lt;/dd&gt;
473+
&lt;dd&gt;&lt;a&gt;Company Website&lt;/a&gt;&lt;/dd&gt;
474+
&lt;dl&gt;
475+
&lt;/section&gt;
476+
</pre>
477+
</div>
478+
479+
</section>
480+
441481
</section>
442482

443483
<section id="sec-introduction-section">
@@ -483,7 +523,7 @@ <h4>Scope section</h4>
483523
<h4>Conformance section</h4>
484524

485525
<p>The <dfn>Conformance</dfn> section contains author-supplied, conformance-related prose that is added to the SMPTE
486-
boilerplate text.</p>
526+
boilerplate text that is generated depending on <code>pubType</code>.</p>
487527

488528
<p>The absence of this section indicates that no author-supplied, conformance-related prose is provided.</p>
489529

js/common.mjs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,21 @@ export const AG_PUBTYPE = "AG";
3030
export const ST_PUBTYPE = "ST";
3131
export const RP_PUBTYPE = "RP";
3232
export const EG_PUBTYPE = "EG";
33+
export const ER_PUBTYPE = "ER";
34+
export const RDD_PUBTYPE = "RDD";
3335

34-
export const PUB_TYPES = new Set([AG_PUBTYPE, OM_PUBTYPE, ST_PUBTYPE, RP_PUBTYPE, EG_PUBTYPE]);
36+
export const PUB_TYPES = new Set([AG_PUBTYPE, OM_PUBTYPE, ST_PUBTYPE, RP_PUBTYPE, EG_PUBTYPE, ER_PUBTYPE, RDD_PUBTYPE]);
3537
export const LONG_PUB_TYPE = new Map([
3638
[AG_PUBTYPE, "Administrative Guideline"],
3739
[OM_PUBTYPE, "Operations Manual"],
3840
[ST_PUBTYPE, "SMPTE Standard"],
3941
[RP_PUBTYPE, "SMPTE Recommended Practice"],
40-
[EG_PUBTYPE, "SMPTE Engineering Guideline"]
42+
[EG_PUBTYPE, "SMPTE Engineering Guideline"],
43+
[ER_PUBTYPE, "SMPTE Engineering Report"],
44+
[RDD_PUBTYPE, "SMPTE Registered Disclosure Document"]
4145
])
4246

43-
export const ENGDOC_PUBTYPES = new Set([ST_PUBTYPE, RP_PUBTYPE, EG_PUBTYPE]);
47+
export const ENGDOC_PUBTYPES = new Set([ST_PUBTYPE, RP_PUBTYPE, EG_PUBTYPE, ER_PUBTYPE, RDD_PUBTYPE]);
4448

4549
export const PUB_STAGE_PUB = "PUB";
4650
export const PUB_STAGE_DP = "DP";

js/validate.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,10 +495,22 @@ class BlockMatcher {
495495
}
496496
}
497497

498+
function validateProponents(sectionElement, logger) {
499+
500+
if (sectionElement.childElementCount > 0) {
501+
for (const forewordElement of sectionElement.children) {
502+
if (forewordElement.localName === "dl" && forewordElement.id !== "element-proponent") {
503+
logger.error(`Foreword cannot contain dl element that doesn't have id of element-proponent`, forewordElement);
504+
}
505+
}
506+
return;
507+
}
508+
}
498509

499510
class ForewordMatcher {
500511

501512
static match(e, logger) {
513+
validateProponents(e, logger);
502514
return e.localName === "section" && e.id === "sec-foreword";
503515
}
504516
}
@@ -829,6 +841,7 @@ function validateBody(body, logger) {
829841
if (elements.length > 0 && ForewordMatcher.match(elements[0], logger))
830842
elements.shift();
831843

844+
832845
/* validate optional introduction */
833846

834847
if (elements.length > 0 && IntroductionMatcher.match(elements[0], logger))

smpte.js

Lines changed: 68 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ function insertFrontMatter(docMetadata) {
195195
case smpte.ST_PUBTYPE:
196196
case smpte.RP_PUBTYPE:
197197
case smpte.EG_PUBTYPE:
198+
case smpte.ER_PUBTYPE:
199+
case smpte.RDD_PUBTYPE:
198200
if (docMetadata.pubPart !== null)
199201
actualPubNumber += `-<span itemprop="doc-part" id="doc-part">${docMetadata.pubPart}</span>`;
200202
if (docMetadata.pubStage === smpte.PUB_STAGE_PUB) {
@@ -623,7 +625,7 @@ function insertConformance(docMetadata) {
623625
if (!(docMetadata.pubType == smpte.RP_PUBTYPE || docMetadata.pubType == smpte.ST_PUBTYPE || docMetadata.pubType == smpte.AG_PUBTYPE)) {
624626
if (sec !== null)
625627
logger_.error(`An ${docMetadata.pubType} document must not contain a conformance section`);
626-
if (docMetadata.pubType != smpte.EG_PUBTYPE)
628+
if (!(docMetadata.pubType == smpte.EG_PUBTYPE || docMetadata.pubType == smpte.ER_PUBTYPE))
627629
return;
628630
}
629631

@@ -700,6 +702,14 @@ function insertConformance(docMetadata) {
700702
interoperability information.</p>
701703
`;
702704

705+
} else if (docMetadata.pubType === smpte.ER_PUBTYPE) {
706+
707+
sec.innerHTML = `
708+
<h2>Conformance</h2>
709+
<p>This Engineering Report is meant to provide information to the
710+
industry. It does not impose requirements.</p>
711+
`;
712+
703713
} else {
704714
sec.innerHTML = `
705715
<h2>Conformance</h2>
@@ -720,7 +730,7 @@ function insertConformance(docMetadata) {
720730

721731
const SMPTE_FOREWORD_ID = "sec-foreword";
722732

723-
const SMPTE_AG_FOREWORD_BOILERPLATE = `<h2>Foreword</h2>
733+
const SMPTE_GEN_FOREWORD_BOILERPLATE = `<h2>Foreword</h2>
724734
<p>The Society of Motion Picture and Television Engineers (SMPTE) is an
725735
internationally-recognized standards developing organization. Headquartered
726736
and incorporated in the United States of America, SMPTE has members in over
@@ -730,26 +740,43 @@ by SMPTE’s Technology Committees. Participation in these Committees is open
730740
to all with a bona fide interest in their work. SMPTE cooperates closely
731741
with other standards-developing organizations, including ISO, IEC and ITU.
732742
SMPTE Engineering Documents are drafted in accordance with the rules given
733-
in its Standards Operations Manual. For more information, please visit
743+
in its Standards Operations Manual.</p>
744+
745+
<p>For more information, please visit
734746
<a href="https://www.smpte.org">www.smpte.org</a>.</p>
747+
`
748+
749+
const SMPTE_AG_FOREWORD_BOILERPLATE = `${SMPTE_GEN_FOREWORD_BOILERPLATE}
735750
736751
<p>This Standards Administrative Guideline forms an adjunct to the use and
737752
interpretation of the SMPTE Standards Operations Manual. In the event of a
738753
conflict, the Operations Manual shall prevail.</p>
739754
`
755+
const SMPTE_RDD_FOREWORD_BOILERPLATE = `<h2>Foreword</h2>
756+
<p>This document is a Registered Disclosure Document prepared by the sponsor(s) identified
757+
below. It has been examined by the appropriate SMPTE Technology Committee and is believed to
758+
contain adequate information to satisfy the objectives defined in the Scope, and to be
759+
technically consistent.</p>
760+
<p>This document is NOT a Standard, Recommended Practice or Engineering Guideline and does NOT
761+
imply a finding or representation of the Society.</p>
762+
<p>Every attempt has been made to ensure that the information contained in this document is
763+
accurate. Errors in this document should be reported to the SMPTE Registered Disclosure
764+
Document proponent(s) identified below with a copy to
765+
<a href="mailto:[email protected]">[email protected]</a>.</p>
766+
767+
<p>All other inquiries in respect of this document, including inquiries as to intellectual
768+
property requirements, should be addressed to the SMPTE Registered Disclosure Document
769+
proponent(s) identified below.</p>
740770
741-
const SMPTE_DOC_FOREWORD_BOILERPLATE = `<h2>Foreword</h2>
742-
<p>The Society of Motion Picture and Television Engineers (SMPTE) is an
743-
internationally-recognized standards developing organization. Headquartered
744-
and incorporated in the United States of America, SMPTE has members in over
745-
80 countries on six continents. SMPTE’s Engineering Documents, including
746-
Standards, Recommended Practices, and Engineering Guidelines, are prepared
747-
by SMPTE’s Technology Committees. Participation in these Committees is open
748-
to all with a bona fide interest in their work. SMPTE cooperates closely
749-
with other standards-developing organizations, including ISO, IEC and ITU.
750-
SMPTE Engineering Documents are drafted in accordance with the rules given
751-
in its Standards Operations Manual.</p> For more information, please visit
752-
<a href="https://www.smpte.org">www.smpte.org</a>.</p>
771+
{{authorProse}}
772+
773+
`
774+
const SMPTE_ER_FOREWORD_BOILERPLATE = `${SMPTE_GEN_FOREWORD_BOILERPLATE}
775+
776+
{{authorProse}}
777+
`
778+
779+
const SMPTE_DOC_FOREWORD_BOILERPLATE = `${SMPTE_GEN_FOREWORD_BOILERPLATE}
753780
754781
<p>At the time of publication no notice had been received by SMPTE claiming patent
755782
rights essential to the implementation of this Engineering Document.
@@ -778,6 +805,22 @@ function insertForeword(docMetadata) {
778805
return;
779806
}
780807

808+
if (docMetadata.pubType == smpte.RDD_PUBTYPE) {
809+
if (sec === null)
810+
logger_.error("RDD must contain a Foreword section.");
811+
812+
}
813+
814+
const SMPTE_PROPONENT_ID = document.getElementById("element-proponent");
815+
816+
if (SMPTE_PROPONENT_ID === null && docMetadata.pubType === smpte.RDD_PUBTYPE) {
817+
logger_.error("Missing required proponents.");
818+
return;
819+
} if (SMPTE_PROPONENT_ID !== null && docMetadata.pubType !== smpte.RDD_PUBTYPE) {
820+
logger_.error("Proponents only allowed for RDD documents.");
821+
return;
822+
}
823+
781824
if (sec === null && docMetadata.pubType != smpte.OM_PUBTYPE) {
782825
sec = document.createElement("section");
783826
sec.id = SMPTE_FOREWORD_ID;
@@ -788,20 +831,27 @@ function insertForeword(docMetadata) {
788831

789832
let authorProse = sec.innerHTML;
790833

791-
if (smpte.ENGDOC_PUBTYPES.has(docMetadata.pubType)) {
834+
if (smpte.ENGDOC_PUBTYPES.has(docMetadata.pubType) && docMetadata.pubType != smpte.RDD_PUBTYPE) {
792835
authorProse = `<p>This document was prepared by Technology Committee ${docMetadata.pubTC}.</p>` + authorProse;
793836
}
794837

795838
if (docMetadata.pubType == smpte.AG_PUBTYPE) {
796839
if (authorProse.trim().length > 0)
797840
logger_.error("AGs cannot contain author-specified Foreword prose.")
798841
sec.innerHTML = fillTemplate(SMPTE_AG_FOREWORD_BOILERPLATE, {copyrightYear: (new Date()).getFullYear()});
842+
} else if (docMetadata.pubType == smpte.RDD_PUBTYPE) {
843+
sec.innerHTML = fillTemplate(SMPTE_RDD_FOREWORD_BOILERPLATE, {authorProse: authorProse, copyrightYear: (new Date()).getFullYear()});
844+
} else if (docMetadata.pubType == smpte.ER_PUBTYPE) {
845+
sec.innerHTML = fillTemplate(SMPTE_ER_FOREWORD_BOILERPLATE, {authorProse: authorProse, copyrightYear: (new Date()).getFullYear()});
799846
} else {
800847
sec.innerHTML = fillTemplate(SMPTE_DOC_FOREWORD_BOILERPLATE, {authorProse: authorProse, copyrightYear: (new Date()).getFullYear()});
801848
}
802849

803850
}
804851

852+
853+
854+
805855
function addHeadingLinks(docMetadata) {
806856
const headings = document.querySelectorAll("h2, h3, h4, h5, h6");
807857

@@ -1286,7 +1336,7 @@ function resolveLinks(docMetadata) {
12861336
const CONFORMANCE_RE = /\s*(shall)|(should)|(may)\s/i;
12871337

12881338
function checkConformanceNotation(docMetadata) {
1289-
if (docMetadata.pubType !== smpte.EG_PUBTYPE)
1339+
if (!(docMetadata.pubType == smpte.EG_PUBTYPE || docMetadata.pubType == smpte.ER_PUBTYPE))
12901340
return;
12911341

12921342
for (let section of document.querySelectorAll("section:not(:has(section))")) {
@@ -1299,7 +1349,7 @@ function checkConformanceNotation(docMetadata) {
12991349
const r = CONFORMANCE_RE.exec(section.innerText);
13001350

13011351
if (r !== null)
1302-
logger_.error(`An EG must not contain the conformance notation ${r[1]}`, section);
1352+
logger_.error(`An ${docMetadata.pubType} must not contain the conformance notation ${r[1]}`, section);
13031353

13041354
};
13051355
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!doctype html>
2+
<html>
3+
<head itemscope="itemscope" itemtype="http://smpte.org/standards/documents">
4+
<meta charset="utf-8" />
5+
<meta http-equiv="x-ua-compatible" content="ie=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<script type="module" src="../../../smpte.js"></script>
8+
<meta itemprop="test" content="invalid" />
9+
<meta itemprop="pubType" content="RDD" />
10+
<meta itemprop="pubNumber" content="26" />
11+
<meta itemprop="pubState" content="draft" />
12+
<meta itemprop="pubStage" content="WD" />
13+
<meta itemprop="pubTC" content="XX" />
14+
<meta itemprop="pubConfidential" content="yes" />
15+
<meta itemprop="pubDateTime" content="2025-02-26" />
16+
<title>Title of the document</title>
17+
</head>
18+
<body>
19+
20+
<section id="sec-foreword">
21+
<dl id="element-proponents">
22+
<dt>Company name</dt>
23+
<dd>Contact name</dd>
24+
<dd>Contact email</dd>
25+
<dd>Company Address</dd>
26+
<dd>Company website</dd>
27+
</dl>
28+
</section>
29+
30+
<section id="sec-scope">
31+
<p>This is the scope of the document.</p>
32+
</section>
33+
</body>
34+
</html>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!doctype html>
2+
<html>
3+
<head itemscope="itemscope" itemtype="http://smpte.org/standards/documents">
4+
<meta charset="utf-8" />
5+
<meta http-equiv="x-ua-compatible" content="ie=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<script type="module" src="../../../smpte.js"></script>
8+
<meta itemprop="test" content="valid" />
9+
<meta itemprop="pubType" content="RDD" />
10+
<meta itemprop="pubNumber" content="26" />
11+
<meta itemprop="pubState" content="draft" />
12+
<meta itemprop="pubStage" content="WD" />
13+
<meta itemprop="pubTC" content="XX" />
14+
<meta itemprop="pubConfidential" content="yes" />
15+
<meta itemprop="pubDateTime" content="2025-02-26" />
16+
<title>Title of the document</title>
17+
</head>
18+
<body>
19+
20+
<section id="sec-foreword">
21+
<dl id="element-proponent">
22+
<dt>Company name</dt>
23+
<dd>Contact name</dd>
24+
<dd>Contact email</dd>
25+
<dd>Company Address</dd>
26+
<dd>Company website</dd>
27+
</dl>
28+
</section>
29+
30+
<section id="sec-scope">
31+
<p>This is the scope of the document.</p>
32+
</section>
33+
</body>
34+
</html>

0 commit comments

Comments
 (0)