Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update conformance for EGs #287

Merged
merged 8 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,9 @@ <h4>Conformance section</h4>
&lt;/section&gt;
</pre>
</div>

<p>This section is prohibited when the document is an administrative guideline, operations manual or engineering guideline.</p>

</section>

<section id="sec-norm-refs-section">
Expand Down
91 changes: 67 additions & 24 deletions smpte.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,10 @@ function insertConformance(docMetadata) {
return;
}

if ((docMetadata.pubType == smpte.EG_PUBTYPE) && (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 +636,83 @@ function insertConformance(docMetadata) {

} else {

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

}

} 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>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, "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 "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 "may" and "need not" indicate courses of action permissible within the limits of the document. </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 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}

<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>
`;

} else {

<p>The keywords "may" and "need not" indicate courses of action permissible within the limits of the document. </p>
sec.innerHTML = `
<h2>Conformance</h2>
<p>This Engineering Guideline is purely informative and meant to provide tutorial information to the
SteveLLamb marked this conversation as resolved.
Show resolved Hide resolved
industry. It does not impose Conformance Requirements and avoids the use of Conformance Notation.</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>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>
`;

${implConformance}
}

if (docMetadata.pubType === smpte.EG_PUBTYPE) {

for (let section of document.querySelectorAll("body > section")) {

let id = section.id;

if (id === "sec-front-matter" || id === "sec-foreword" || id === "sec-conformance")
continue;

if (section.innerText.toLowerCase().includes("shall")) {
logger_.error(`EG must not contain Conformance Notation - "shall" found`, section);
}
if (section.innerText.toLowerCase().includes("should")) {
logger_.error(`EG must not contain Conformance Notation - "should" found`, section);
}
if (section.innerText.toLowerCase().includes("may")) {
logger_.error(`EG must not contain Conformance Notation - "may" found`, section);
}

};
}

<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
Loading