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

Add AOM specs #1141

Merged
merged 5 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
36 changes: 35 additions & 1 deletion specs.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,48 @@
[
{
"url": "https://aomediacodec.github.io/afgs1-spec/",
"categories": [
"-browser"
]
},
{
"url": "https://aomediacodec.github.io/av1-avif/",
"organization": "Alliance for Open Media",
"groups": [
{
"name": "Storage and Transport Formats Working Group",
"url": "https://aomedia.org/about/#storage-and-transport-formats-working-group"
}
]
},
"https://aomediacodec.github.io/av1-hdr10plus/",
{
"url": "https://aomediacodec.github.io/av1-isobmff/",
"groups": [
{
"name": "Storage and Transport Formats Working Group",
"url": "https://aomedia.org/about/#storage-and-transport-formats-working-group"
}
]
},
{
"url": "https://aomediacodec.github.io/av1-mpeg2-ts/",
"groups": [
{
"name": "Storage and Transport Formats Working Group",
"url": "https://aomedia.org/about/#storage-and-transport-formats-working-group"
}
]
},
{
"url": "https://aomediacodec.github.io/av1-rtp-spec/",
"groups": [
{
"name": "Storage and Transport Formats Working Group",
"url": "https://aomedia.org/about/#storage-and-transport-formats-working-group"
}
]
},
"https://aomediacodec.github.io/av1-spec/",
{
"url": "https://compat.spec.whatwg.org/",
"nightly": {
Expand Down
1 change: 1 addition & 0 deletions src/compute-repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ module.exports = async function (specs, options) {
"index.src.html",
"index.bs",
"spec.bs",
"index.md",
"index.html"
);

Expand Down
24 changes: 14 additions & 10 deletions src/compute-shorttitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,20 @@ module.exports = function (title) {

const level = title.match(/\s(\d+(\.\d+)?)$/);
const shortTitle = title
.replace(/\s/g, ' ') // Replace non-breaking spaces
.replace(/ \d+(\.\d+)?$/, '') // Drop level number for now
.replace(/( -)? Level$/, '') // Drop "Level"
.replace(/ Module$/, '') // Drop "Module" (now followed by level)
.replace(/ Proposal$/, '') // Drop "Proposal" (TC39 proposals)
.replace(/ Specification$/, '') // Drop "Specification"
.replace(/ Standard$/, '') // Drop "Standard" and "Living Standard"
.replace(/ Living$/, '')
.replace(/ \([^\)]+ Edition\)/, '') // Drop edition indication
.replace(/^.*\(([^\)]+)\).*$/, '$1'); // Use abbr between parentheses
.trim()
.replace(/\s/g, ' ') // Replace non-breaking spaces
.replace(/ \d+(\.\d+)?$/, '') // Drop level number for now
.replace(/( -)? Level$/i, '') // Drop "Level"
.replace(/ \(\v\d+(\.\d+)?\)/i, '') // Drop "(vx.y)"
.replace(/\(Draft\)/i, '') // Drop "(Draft)" indication
.replace(/ Module$/i, '') // Drop "Module" (now followed by level)
.replace(/ Proposal$/i, '') // Drop "Proposal" (TC39 proposals)
.replace(/ Specification$/i, '') // Drop "Specification"
.replace(/ Standard$/i, '') // Drop "Standard" and "Living Standard"
.replace(/ Living$/i, '')
.replace(/ \([^\)]+ Edition\)/i, '') // Drop edition indication
.replace(/^.*\(([^\)]+)\).*$/, '$1') // Use abbr between parentheses
.trim();

if (level) {
return shortTitle + " " + level[1];
Expand Down
11 changes: 11 additions & 0 deletions src/fetch-groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,17 @@ module.exports = async function (specs, options) {
}];
}

// For the Alliance for Open Media (AOM), let's consider that the Codec WG
// is the default group, noting that it is not super clear which AOM group
// develops which spec in practice: https://aomedia.org/about/
if (info && info.owner === "aomediacodec") {
spec.organization = spec.organization ?? "Alliance for Open Media";
spec.groups = spec.groups ?? [{
name: "Codec Working Group",
url: "https://aomedia.org/about/#codec-working-group"
}]
}

// All specs that remain should be developed by some W3C group.
spec.organization = spec.organization ?? "W3C";

Expand Down
12 changes: 12 additions & 0 deletions test/compute-shorttitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ describe("compute-shorttitle module", () => {
"Foo Bar");
});

it("drops '(Draft)' from title", () => {
assertTitle(
"(Draft) Beer",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍻 ☺

"Beer");
});

it("preserves title when needed", () => {
assertTitle(
"Edition Module Standard Foo",
Expand All @@ -96,4 +102,10 @@ describe("compute-shorttitle module", () => {
"Hypertext Transfer Protocol (HTTP/1.1): Foo bar",
"HTTP/1.1 Foo bar")
});

it("applies rules in order", () => {
assertTitle(
" AOMedia Film Grain Synthesis (v1.0) (AFGS1) specification (Draft) ",
"AFGS1")
});
});
9 changes: 9 additions & 0 deletions test/fetch-groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ describe("fetch-groups module (without API keys)", function () {
}]);
});

it("handles AOM specs", async () => {
const res = await fetchGroupsFor("https://aomediacodec.github.io/afgs1-spec/");
assert.equal(res.organization, "Alliance for Open Media");
assert.deepStrictEqual(res.groups, [{
name: "Codec Working Group",
url: "https://aomedia.org/about/#codec-working-group"
}]);
});

it("preserves provided info", async () => {
const spec = {
url: "https://url.spec.whatwg.org/",
Expand Down
Loading