From a678c95233a9f6789e40e83c7a9111641ff7de41 Mon Sep 17 00:00:00 2001 From: Steve LLamb <38917682+SteveLLamb@users.noreply.github.com> Date: Tue, 12 May 2026 13:40:53 -0700 Subject: [PATCH 1/3] Move Conformance to Clause 4 (#405) --- doc/main.html | 62 ++++++++++--------- js/validate.mjs | 10 +-- smpte.js | 9 ++- .../validation/rdd-standalone-invalid.html | 4 ++ .../validation/st-conformance-invalid.html | 24 +++++++ .../html/validation/st-conformance-valid.html | 24 +++++++ 6 files changed, 96 insertions(+), 37 deletions(-) create mode 100644 test/resources/html/validation/st-conformance-invalid.html create mode 100644 test/resources/html/validation/st-conformance-valid.html diff --git a/doc/main.html b/doc/main.html index 9b49c88..619e343 100644 --- a/doc/main.html +++ b/doc/main.html @@ -14,7 +14,7 @@ - + Tooling and documentation for HTML documents @@ -416,10 +416,6 @@

Overall structure

Scope Exactly 1 - - Conformance - 0 or 1 - Normative references 0 or 1 @@ -427,6 +423,10 @@

Overall structure

Terms and definitions 0 or 1 + + Conformance + 0 or 1 + Prose 0 or more @@ -556,30 +556,6 @@

Scope section

-
-

Conformance section

- -

The Conformance section contains author-supplied, conformance-related prose that is added to the SMPTE - boilerplate text that is generated depending on pubType.

- -

The absence of this section indicates that no author-supplied, conformance-related prose is provided.

- -

The id attribute shall be present on the section element and equal to - sec-conformance.

- -

The heading shall not be present.

- -
-
<section id="sec-conformance">
-  <p>These are additional conformance requirements and definitions.</p>
-</section>
-
-
- -

This section is prohibited unless the document is a Standard or Recommended Practice.

- -
-

Normative references section

@@ -712,6 +688,34 @@

Terms and definitions section

+
+

Conformance section

+ +

The Conformance section contains author-supplied, conformance-related prose that is added to the SMPTE + boilerplate text that is generated depending on pubType.

+ +

The Conformance section follows Terms and definitions and is the first SMPTE-defined clause that + may carry substantive conformance requirements. It is positioned consistent with ISO/IEC Directives, Part 2, which reserve + Clauses 1, 2, and 3 for Scope, Normative references, and Terms and definitions respectively.

+ +

The absence of this section indicates that no author-supplied, conformance-related prose is provided.

+ +

The id attribute shall be present on the section element and equal to + sec-conformance.

+ +

The heading shall not be present.

+ +
+
<section id="sec-conformance">
+  <p>These are additional conformance requirements and definitions.</p>
+</section>
+
+
+ +

This section is prohibited unless the document is a Standard or Recommended Practice.

+ +
+

Prose section(s)

diff --git a/js/validate.mjs b/js/validate.mjs index d63eb37..01e0c30 100644 --- a/js/validate.mjs +++ b/js/validate.mjs @@ -1155,11 +1155,6 @@ function validateBody(body, logger) { logger.error("Mandatory Scope clause missing", elements[0]); } - /* validate optional conformance */ - - if (elements.length > 0 && ConformanceMatcher.match(elements[0], logger)) - elements.shift(); - /* validate optional normative references */ if (elements.length > 0 && NormativeReferencesMatcher.match(elements[0], logger)) @@ -1170,6 +1165,11 @@ function validateBody(body, logger) { if (elements.length > 0 && DefinitionsMatcher.match(elements[0], logger)) elements.shift(); + /* validate optional conformance */ + + if (elements.length > 0 && ConformanceMatcher.match(elements[0], logger)) + elements.shift(); + /* validate zero or more clauses */ while (elements.length > 0) { diff --git a/smpte.js b/smpte.js index 4a18595..42572a2 100644 --- a/smpte.js +++ b/smpte.js @@ -422,7 +422,7 @@ function insertNormativeReferences(docMetadata) { if (sec === null) { sec = document.createElement("section"); sec.id = SMPTE_NORM_REFS_ID; - document.body.insertBefore(sec, document.getElementById(SMPTE_CONFORMANCE_ID).nextSibling); + document.body.insertBefore(sec, document.getElementById(SMPTE_SCOPE_ID).nextSibling); } const p = document.createElement("p"); @@ -665,7 +665,10 @@ function insertConformance(docMetadata) { sec = document.createElement("section"); sec.id = SMPTE_CONFORMANCE_ID; - document.body.insertBefore(sec, document.getElementById(SMPTE_SCOPE_ID).nextSibling); + const anchor = document.getElementById(SMPTE_TERMS_ID) + || document.getElementById(SMPTE_NORM_REFS_ID) + || document.getElementById(SMPTE_SCOPE_ID); + document.body.insertBefore(sec, anchor.nextSibling); } let implConformance = ""; @@ -1561,9 +1564,9 @@ async function render() { insertForeword(docMetadata); insertIntroduction(docMetadata); insertScope(docMetadata); - insertConformance(docMetadata); insertNormativeReferences(docMetadata); insertTermsAndDefinitions(docMetadata); + insertConformance(docMetadata); insertElementsAnnex(docMetadata); insertBibliography(docMetadata); diff --git a/test/resources/html/validation/rdd-standalone-invalid.html b/test/resources/html/validation/rdd-standalone-invalid.html index 2b40e42..2ea4010 100644 --- a/test/resources/html/validation/rdd-standalone-invalid.html +++ b/test/resources/html/validation/rdd-standalone-invalid.html @@ -30,5 +30,9 @@

This is the scope of the document.

+ +
+

These are additional conformance requirements and definitions.

+
\ No newline at end of file diff --git a/test/resources/html/validation/st-conformance-invalid.html b/test/resources/html/validation/st-conformance-invalid.html new file mode 100644 index 0000000..81e0675 --- /dev/null +++ b/test/resources/html/validation/st-conformance-invalid.html @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + Title of the document + + +
+

These are additional conformance requirements and definitions.

+
+
+

This is the scope of the document.

+
+ + \ No newline at end of file diff --git a/test/resources/html/validation/st-conformance-valid.html b/test/resources/html/validation/st-conformance-valid.html new file mode 100644 index 0000000..4632580 --- /dev/null +++ b/test/resources/html/validation/st-conformance-valid.html @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + Title of the document + + +
+

This is the scope of the document.

+
+
+

These are additional conformance requirements and definitions.

+
+ + \ No newline at end of file From b236bc1203d89d8001e1db2b65e553d6379a3f8d Mon Sep 17 00:00:00 2001 From: Steve LLamb <38917682+SteveLLamb@users.noreply.github.com> Date: Tue, 12 May 2026 13:48:54 -0700 Subject: [PATCH 2/3] closes #205 --- smpte.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smpte.js b/smpte.js index 42572a2..92a995e 100644 --- a/smpte.js +++ b/smpte.js @@ -701,7 +701,7 @@ function insertConformance(docMetadata) { helpful to the user, but not indispensable, and can be removed, changed, or added editorially without affecting interoperability. Informative text does not contain any conformance keywords.

-

All text in this document is, by default, normative, except: the Introduction, any clause explicitly +

All text in this document is, by default, normative, except: the Introduction, the Bibliography, or any clause explicitly labeled as "Informative" or individual paragraphs that start with "Note:"

The keywords "shall" and "shall not" indicate requirements strictly to be followed in order to conform to the From 76d5c41648143bd9d347e7d3e08cf73a4e2ffb45 Mon Sep 17 00:00:00 2001 From: Steve LLamb <38917682+SteveLLamb@users.noreply.github.com> Date: Thu, 14 May 2026 12:58:51 -0700 Subject: [PATCH 3/3] roll to draft to merge --- doc/main.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/main.html b/doc/main.html index 619e343..0aa66ce 100644 --- a/doc/main.html +++ b/doc/main.html @@ -9,7 +9,7 @@ - +