Skip to content

Commit

Permalink
Switch RFC URLs to rfc-editor.org (#349)
Browse files Browse the repository at this point in the history
close #342
  • Loading branch information
dontcallmedom authored Jul 12, 2021
1 parent 94a378e commit 95794a4
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 36 deletions.
60 changes: 30 additions & 30 deletions specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,6 @@
}
},
"https://console.spec.whatwg.org/",
{
"url": "https://datatracker.ietf.org/doc/html/rfc2397",
"groups": [
{
"name": "Network Working Group",
"url": "https://datatracker.ietf.org/group/app/"
}
]
},
"https://datatracker.ietf.org/doc/html/rfc6265",
"https://datatracker.ietf.org/doc/html/rfc6266",
"https://datatracker.ietf.org/doc/html/rfc6454",
"https://datatracker.ietf.org/doc/html/rfc6797",
"https://datatracker.ietf.org/doc/html/rfc7034",
"https://datatracker.ietf.org/doc/html/rfc7230",
"https://datatracker.ietf.org/doc/html/rfc7231",
"https://datatracker.ietf.org/doc/html/rfc7232",
"https://datatracker.ietf.org/doc/html/rfc7233",
"https://datatracker.ietf.org/doc/html/rfc7234",
"https://datatracker.ietf.org/doc/html/rfc7235",
"https://datatracker.ietf.org/doc/html/rfc7239",
"https://datatracker.ietf.org/doc/html/rfc7469",
"https://datatracker.ietf.org/doc/html/rfc7538",
"https://datatracker.ietf.org/doc/html/rfc7540",
"https://datatracker.ietf.org/doc/html/rfc7578",
"https://datatracker.ietf.org/doc/html/rfc7725",
"https://datatracker.ietf.org/doc/html/rfc7838",
"https://datatracker.ietf.org/doc/html/rfc8246",
"https://datatracker.ietf.org/doc/html/rfc8470",
"https://datatracker.ietf.org/doc/html/rfc8942",
"https://dom.spec.whatwg.org/",
"https://drafts.css-houdini.org/css-typed-om-2/ delta",
"https://drafts.css-houdini.org/font-metrics-api-1/",
Expand Down Expand Up @@ -297,6 +267,36 @@
]
}
},
{
"url": "https://www.rfc-editor.org/rfc/rfc2397",
"groups": [
{
"name": "Network Working Group",
"url": "https://datatracker.ietf.org/group/app/"
}
]
},
"https://www.rfc-editor.org/rfc/rfc6265",
"https://www.rfc-editor.org/rfc/rfc6266",
"https://www.rfc-editor.org/rfc/rfc6454",
"https://www.rfc-editor.org/rfc/rfc6797",
"https://www.rfc-editor.org/rfc/rfc7034",
"https://www.rfc-editor.org/rfc/rfc7230",
"https://www.rfc-editor.org/rfc/rfc7231",
"https://www.rfc-editor.org/rfc/rfc7232",
"https://www.rfc-editor.org/rfc/rfc7233",
"https://www.rfc-editor.org/rfc/rfc7234",
"https://www.rfc-editor.org/rfc/rfc7235",
"https://www.rfc-editor.org/rfc/rfc7239",
"https://www.rfc-editor.org/rfc/rfc7469",
"https://www.rfc-editor.org/rfc/rfc7538",
"https://www.rfc-editor.org/rfc/rfc7540",
"https://www.rfc-editor.org/rfc/rfc7578",
"https://www.rfc-editor.org/rfc/rfc7725",
"https://www.rfc-editor.org/rfc/rfc7838",
"https://www.rfc-editor.org/rfc/rfc8246",
"https://www.rfc-editor.org/rfc/rfc8470",
"https://www.rfc-editor.org/rfc/rfc8942",
"https://www.w3.org/TR/accelerometer/",
"https://www.w3.org/TR/accname-1.2/",
"https://www.w3.org/TR/ambient-light/",
Expand Down
2 changes: 1 addition & 1 deletion src/compute-shortname.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function computeShortname(url) {
}

// Handle IETF RFCs
const rfcs = url.match(/\/datatracker\.ietf\.org\/doc\/html\/(rfc[0-9]+)/);
const rfcs = url.match(/\/www.rfc-editor\.org\/rfc\/(rfc[0-9]+)/);
if (rfcs) {
return rfcs[1];
}
Expand Down
4 changes: 2 additions & 2 deletions src/determine-filename.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ module.exports = async function (url) {
return match[1];
}

// datatracker IETF RFC HTML rendering
const rfcMatch = url.match(/\/html\/(rfc[0-9]+)$/);
// RFC-editor HTML rendering
const rfcMatch = url.match(/\/rfc\/(rfc[0-9]+)$/);
if (rfcMatch) {
return rfcMatch[1] + '.html';
}
Expand Down
2 changes: 1 addition & 1 deletion src/fetch-groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module.exports = async function (specs, options) {
if (!info) {
// No general rule to identify repos and groups for IETF specs
// instead, fetching info on groups from https://www.rfc-editor.org/in-notes/rfcXXX.json
if (spec.url.match(/ietf\.org/)) {
if (spec.url.match(/rfc-editor\.org/)) {
spec.organization = spec.organization ?? "IETF";
if (spec.groups) continue;
const rfcNumber = spec.url.slice(spec.url.lastIndexOf('/') + 1);
Expand Down
4 changes: 2 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ describe("List of specs", () => {
});

it("contains repository URLs for all non IETF specs", () => {
const wrong = specs.filter(s => !s.nightly.repository && !s.nightly.url.match(/ietf\.org/));
const wrong = specs.filter(s => !s.nightly.repository && !s.nightly.url.match(/rfc-editor\.org/));
assert.deepStrictEqual(wrong, []);
});

it("contains relative paths to source of nightly spec for all non IETF specs", () => {
const wrong = specs.filter(s => !s.nightly.sourcePath && !s.nightly.url.match(/ietf\.org/));
const wrong = specs.filter(s => !s.nightly.sourcePath && !s.nightly.url.match(/rfc-editor\.org/));
assert.deepStrictEqual(wrong, []);
});

Expand Down

0 comments on commit 95794a4

Please sign in to comment.