Skip to content

Commit

Permalink
Update conformance for EGs
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLLamb committed Oct 10, 2024
1 parent 4d35e65 commit 75f052e
Showing 1 changed file with 65 additions and 24 deletions.
89 changes: 65 additions & 24 deletions smpte.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,11 @@ function insertConformance(docMetadata) {
return;
}

if (docMetadata.pubType == smpte.EG_PUBTYPE) {
if (sec !== null)
logger_.error("EG must not contain a Conformance section.");
}

if (sec === null) {
sec = document.createElement("section");
sec.id = SMPTE_CONFORMANCE_ID;
Expand All @@ -632,44 +637,80 @@ function insertConformance(docMetadata) {

} else {

implConformance = sec.innerText.innerHTML;
implConformance = sec.innerText;

}

} else if (sec.innerText.trim().length !== 0) {
logger_.error("Conformance section not used in AGs.");
}

sec.innerHTML = `
<h2>Conformance</h2>
<p>Normative text is text that describes elements of the design that are indispensable or contains the
conformance language keywords: "shall", "should", or "may". Informative text is text that is potentially
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. </p>
if (docMetadata.pubType !== smpte.EG_PUBTYPE) {

sec.innerHTML = `
<h2>Conformance</h2>
<p>Normative text is text that describes elements of the design that are indispensable or contains the
conformance language keywords: "shall", "should", or "may". Informative text is text that is potentially
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. </p>
<p>All text in this document is, by default, normative, except: the Introduction, any clause explicitly
labeled as "Informative" or individual paragraphs that start with "Note:" </p>
<p>The keywords "shall" and "shall not" indicate requirements strictly to be followed in order to conform to the
document and from which no deviation is permitted.</p>
<p>The keywords, "should" and "should not" indicate that, among several possibilities, one is recommended
as particularly suitable, without mentioning or excluding others; or that a certain course of action
is preferred but not necessarily required; or that (in the negative form) a certain possibility
or course of action is deprecated but not prohibited.</p>
<p>The keywords "may" and "need not" indicate courses of action permissible within the limits of the document. </p>
<p>The keyword "reserved" indicates a provision that is not defined at this time, shall not be used,
and may be defined in the future. The keyword "forbidden" indicates "reserved" and in addition
indicates that the provision will never be defined in the future.</p>
<p>All text in this document is, by default, normative, except: the Introduction, any clause explicitly
labeled as "Informative" or individual paragraphs that start with "Note:" </p>
${implConformance}
<p>The keywords "shall" and "shall not" indicate requirements strictly to be followed in order to conform to the
document and from which no deviation is permitted.</p>
<p>Unless otherwise specified, the order of precedence of the types of normative information in
this document shall be as follows: Normative prose shall be the authoritative definition;
tables shall be next; then formal languages; then figures; and then any other language forms.</p>
`;

<p>The keywords, "should" and "should not" indicate that, among several possibilities, one is recommended
as particularly suitable, without mentioning or excluding others; or that a certain course of action
is preferred but not necessarily required; or that (in the negative form) a certain possibility
or course of action is deprecated but not prohibited.</p>
} else {

sec.innerHTML = `
<h2>Conformance</h2>
<p>This Engineering Guideline is purely informative and meant to provide tutorial information to the
industry. It does not impose Conformance Requirements and avoids the use of Conformance Notation.</p>
<p>The keywords "may" and "need not" indicate courses of action permissible within the limits of the document. </p>
<p>Engineering Guidelines frequently provide tutorial information about a Standard or Recommended Practice
and when this is the case, the user should rely on the Standards and Recommended Practices referenced for
interoperability information.</p>
`;

<p>The keyword "reserved" indicates a provision that is not defined at this time, shall not be used,
and may be defined in the future. The keyword "forbidden" indicates "reserved" and in addition
indicates that the provision will never be defined in the future.</p>
}

${implConformance}
if (docMetadata.pubType === smpte.EG_PUBTYPE) {

const sections = document.querySelectorAll('section');
sections.forEach((element) => {
let id = element.id;
if ((id !== "sec-front-matter") && (id !== "sec-foreword") && (id !== "sec-conformance")) {
if (element.innerText.includes("shall")) {
logger_.error(`EG must not contain Conformance Notation - "shall" found`, element);
}
if (element.innerText.includes("should")) {
logger_.error(`EG must not contain Conformance Notation - "should" found`, element);
}
if (element.innerText.includes("may")) {
logger_.error(`EG must not contain Conformance Notation - "may" found`, element);
}
}
});
}

<p>Unless otherwise specified, the order of precedence of the types of normative information in
this document shall be as follows: Normative prose shall be the authoritative definition;
tables shall be next; then formal languages; then figures; and then any other language forms.</p>
`;
}

const SMPTE_FOREWORD_ID = "sec-foreword";
Expand Down

0 comments on commit 75f052e

Please sign in to comment.