Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion doc/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ <h4>Introduction <code>section</code></h4>

<p>The heading shall not be present.</p>

<p>When <code>pubType</code> is <code>ST</code>, <code>RP</code>, <code>EG</code>, <code>ER</code> or
<p>When <code>pubType</code> is <code>ST</code>, <code>RP</code>, <code>EG</code> or
<code>RDD</code>, a statement that the clause is entirely informative is generated automatically at the start of
the clause. This statement shall not be supplied by the author.</p>

Expand Down
6 changes: 3 additions & 3 deletions js/common.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ export const RDD_PUBTYPE = "RDD";

export const PUB_TYPES = new Set([AG_PUBTYPE, OM_PUBTYPE, ST_PUBTYPE, RP_PUBTYPE, EG_PUBTYPE, ER_PUBTYPE, RDD_PUBTYPE]);
export const LONG_PUB_TYPE = new Map([
[AG_PUBTYPE, "Administrative Guideline"],
[OM_PUBTYPE, "Operations Manual"],
[AG_PUBTYPE, "SMPTE Administrative Guideline"],
[OM_PUBTYPE, "SMPTE Operations Manual"],
[ST_PUBTYPE, "SMPTE Standard"],
[RP_PUBTYPE, "SMPTE Recommended Practice"],
[EG_PUBTYPE, "SMPTE Engineering Guideline"],
[ER_PUBTYPE, "SMPTE Engineering Report"],
[RDD_PUBTYPE, "SMPTE Registered Disclosure Document"]
])

export const ENGDOC_PUBTYPES = new Set([ST_PUBTYPE, RP_PUBTYPE, EG_PUBTYPE, ER_PUBTYPE, RDD_PUBTYPE]);
export const ENGDOC_PUBTYPES = new Set([ST_PUBTYPE, RP_PUBTYPE, EG_PUBTYPE, RDD_PUBTYPE]);

/* document types whose Foreword carries the patent rights statement, and hence
support pubIPRClaimed */
Expand Down
8 changes: 4 additions & 4 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ function mirrorDirExcludeTooling(srcDir, targetDir, relParentPath) {

if (srcStat.isDirectory()) {

s3SyncDir(srcPath, s3Client, bucket, dstKey + "/");
await s3SyncDir(srcPath, s3Client, bucket, dstKey + "/");

} else if (srcStat.isFile()) {

const contentType = guessContentTypeFromExtension(srcPath);

const cmd = new PutObjectCommand({
Body: fs.createReadStream(srcPath),
Body: fs.readFileSync(srcPath),
Bucket: bucket,
Key: dstKey,
ContentType: contentType
Expand Down Expand Up @@ -315,7 +315,7 @@ async function s3Upload(buildPaths, versionKey, generatedFiles) {
pubLinks.libraryZip = `${deployPrefix}${s3PubKeyPrefix}${encodeURIComponent(generatedFiles.libraryZip)}`;
}

s3SyncDir(buildPaths.pubDirPath, s3Client, s3Bucket, s3PubKeyPrefix);
await s3SyncDir(buildPaths.pubDirPath, s3Client, s3Bucket, s3PubKeyPrefix);

return pubLinks;
}
Expand Down Expand Up @@ -739,7 +739,7 @@ async function main() {
generatedFiles.elements.push({
title: element.title.replace(/\s+/g, " "),
file: {
path: href,
path: decodeURIComponent(href),
mediaType: guessContentTypeFromExtension(href)
}
});
Expand Down
22 changes: 14 additions & 8 deletions smpte.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ function insertFrontMatter(docMetadata) {

switch (docMetadata.pubType) {
case smpte.AG_PUBTYPE:
case smpte.ER_PUBTYPE:
case smpte.OM_PUBTYPE:
break;
case smpte.ST_PUBTYPE:
case smpte.RP_PUBTYPE:
case smpte.EG_PUBTYPE:
case smpte.ER_PUBTYPE:
case smpte.RDD_PUBTYPE:
if (docMetadata.pubPart !== null)
actualPubNumber += `-<span itemprop="doc-part" id="doc-part">${docMetadata.pubPart}</span>`;
Expand Down Expand Up @@ -230,13 +230,13 @@ function insertFrontMatter(docMetadata) {
break;
}

const draftWarning = docMetadata.pubStage === smpte.PUB_STAGE_PUB ? "" : SMPTE_DRAFT_WARNING;
const draftWarning = docMetadata.pubStage === smpte.PUB_STAGE_PUB ? "" : smpteDraftWarning(longDocType);

let boilerplate;

if (docMetadata.pubState === smpte.PUB_STATE_PUB && docMetadata.pubType === smpte.OM_PUBTYPE)
boilerplate = SMPTE_PUB_OM_FRONT_MATTER_BOILERPLATE;
else if (docMetadata.pubState === smpte.PUB_STATE_PUB && docMetadata.pubType === smpte.AG_PUBTYPE)
else if (docMetadata.pubState === smpte.PUB_STATE_PUB && (docMetadata.pubType === smpte.AG_PUBTYPE || docMetadata.pubType === smpte.ER_PUBTYPE))
boilerplate = SMPTE_PUB_AG_FRONT_MATTER_BOILERPLATE;
else
boilerplate = SMPTE_FRONT_MATTER_BOILERPLATE;
Expand Down Expand Up @@ -714,7 +714,12 @@ function insertElementsAnnex(docMetadata) {
if (isAbsoluteLink) {
e.innerText = href;
} else {
e.innerText = href.split('\\').pop().split('/').pop();
const fileName = href.split('\\').pop().split('/').pop();
try {
e.innerText = decodeURIComponent(fileName);
} catch {
e.innerText = fileName;
}
}

e.parentElement.insertBefore(
Expand Down Expand Up @@ -919,15 +924,16 @@ const SMPTE_DOC_FOREWORD_BOILERPLATE = `${SMPTE_GEN_FOREWORD_BOILERPLATE}
{{authorProse}}
`

const SMPTE_DRAFT_WARNING = `
function smpteDraftWarning(longDocType) {
return `
<div id="sec-draft-warning">
<strong>Warning:</strong> This document is an unpublished work under development and shall not be referred
to as a SMPTE Standard,
Recommended Practice, or Engineering Guideline. It is distributed for review and comment; distribution does not constitute
to as a ${longDocType}. It is distributed for review and comment; distribution does not constitute
publication. Recipients of this document are strongly encouraged to submit, with their comments, notification of any relevant
patent rights of which they are aware and to provide supporting documentation.
</div>
`
`;
}

function insertForeword(docMetadata) {
let sec = document.getElementById(SMPTE_FOREWORD_ID);
Expand Down
20 changes: 20 additions & 0 deletions test/resources/html/validation/eg-no-pubStage-invalid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<html>
<head itemscope="itemscope" itemtype="http://smpte.org/standards/documents">
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script type="module" src="../../../../smpte.js"></script>
<meta itemprop="test" content="invalid" />
<meta itemprop="pubType" content="EG" />
<meta itemprop="pubNumber" content="99" />
<meta itemprop="pubState" content="draft" />
<meta itemprop="pubTC" content="27C" />
<title>Title of the document</title>
</head>
<body>
<section id="sec-scope">
<p>This is the scope of the document.</p>
</section>
</body>
</html>
20 changes: 20 additions & 0 deletions test/resources/html/validation/er-no-pubStage-draft-valid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<html>
<head itemscope="itemscope" itemtype="http://smpte.org/standards/documents">
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script type="module" src="../../../../smpte.js"></script>
<meta itemprop="test" content="valid" />
<meta itemprop="pubType" content="ER" />
<meta itemprop="pubNumber" content="99" />
<meta itemprop="pubState" content="draft" />
<meta itemprop="pubTC" content="27C" />
<title>Title of the document</title>
</head>
<body>
<section id="sec-scope">
<p>This is the scope of the document.</p>
</section>
</body>
</html>
21 changes: 21 additions & 0 deletions test/resources/html/validation/er-no-pubStage-pub-valid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!doctype html>
<html>
<head itemscope="itemscope" itemtype="http://smpte.org/standards/documents">
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script type="module" src="../../../../smpte.js"></script>
<meta itemprop="test" content="valid" />
<meta itemprop="pubType" content="ER" />
<meta itemprop="pubNumber" content="99" />
<meta itemprop="pubState" content="pub" />
<meta itemprop="pubDateTime" content="2026-11-26" />
<meta itemprop="pubTC" content="27C" />
<title>Title of the document</title>
</head>
<body>
<section id="sec-scope">
<p>This is the scope of the document.</p>
</section>
</body>
</html>