Skip to content

Commit b1fee0c

Browse files
committed
Remove conversions from github.io to w3.org, which was broken anyway.
Remove unused exportReferences.
1 parent 7cb027a commit b1fee0c

File tree

2 files changed

+1
-78
lines changed

2 files changed

+1
-78
lines changed

common/common.js

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,6 @@ function restrictReferences(utils, content) {
3737
return (base.innerHTML);
3838
}
3939

40-
// Mark definitions to be exported
41-
function exportReferences(utils, content) {
42-
const base = document.createElement("div");
43-
base.innerHTML = content;
44-
45-
const defns = base.querySelectorAll("dfn:not([data-cite])");
46-
for (const item of defns) {
47-
const de = document.createAttribute("data-export");
48-
item.setAttributeNode(de);
49-
}
50-
51-
return (base.innerHTML);
52-
}
53-
5440
// add a handler to come in after all the definitions are resolved
5541
//
5642
// New logic: If the reference is within a 'dl' element of
@@ -128,63 +114,6 @@ require(["core/pubsubhub"], (respecEvents) => {
128114
});
129115
});
130116

131-
/*
132-
*
133-
* Replace github.io references to /TR references.
134-
* The issue is as follows: when several specs are developed in parallel, it is a good idea
135-
* to use, for mutual references, the github.io URI-s. That ensures that the editors' drafts are always
136-
* correct in terms of mutual references.
137-
*
138-
* However, when publishing the documents, all those references must be exchanged against the final, /TR
139-
* URI-s. That process, when done manually, is boring and error prone. This script solves the issue:
140-
*
141-
* * Create a separate file with the 'conversions' array. See, e.g., https://github.com/w3c/csvw/blob/gh-pages/local-biblio.js
142-
* for an example.
143-
* * Include a reference to that file and this to the respec code, after the inclusion of respec. E.g.:
144-
* ```
145-
* <script class="remove" src="../local-biblio.js"></script>
146-
* <script class="remove" src="https://www.w3.org/Tools/respec/respec-w3c-common"></script>
147-
* <script class="remove" src="../replace-ed-uris.js"></script>
148-
* ```
149-
*
150-
* This function will be automatically executed when the respec source is saved in an (X)HTML file.
151-
* Note that
152-
*
153-
* * Links in the header part will *not* be changed. That part is usually generated automatically, and the reference to the
154-
* editor's draft must stay unchanged
155-
* * The text content of an <a> element will also be converted (if needed). This means that the reference list may also
156-
* use include the github.io address (as it should...)
157-
*
158-
*/
159-
require(["core/pubsubhub"], (respecEvents) => {
160-
"use strict";
161-
respecEvents.sub('beforesave', (documentElement) => {
162-
for (const anchor of document.querySelectorAll("a[href]")) {
163-
const dd = anchor.closest('dd');
164-
165-
// Don't replace specific anchors
166-
if (dd) {
167-
const dt = dd.previousElementSibling;
168-
if (dt.textContent.match(/Latest editor|Test suite|Implementation report/)) return;
169-
}
170-
if (anchor.closest('section.preserve')) return;
171-
172-
if (anchor.href === undefined) return;
173-
174-
for (const toReplace in jsonld.conversions) {
175-
if (anchor.href.indexOf(toReplace) !== -1) {
176-
const replacement = jsonld.conversions[toReplace];
177-
const newHref = anchor.href.replace(toReplace, replacement);
178-
anchor.setAttribute('href', newHref);
179-
if (anchor.textContent.indexOf(toReplace) !== -1) {
180-
anchor.textContent = anchor.textContent.replace(toReplace, replacement);
181-
}
182-
}
183-
}
184-
}
185-
});
186-
});
187-
188117
/*
189118
* Implement tabbed examples.
190119
*/

common/jsonld.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,4 @@ const jsonld = {
3030
status: 'Internet-Draft',
3131
date: 'February 16, 2019'
3232
}
33-
},
34-
conversions: {
35-
"https://w3c.github.io/json-ld-syntax/": "http://www.w3.org/TR/json-ld11/",
36-
"https://w3c.github.io/json-ld-api/": "http://www.w3.org/TR/json-ld11-api/",
37-
"https://w3c.github.io/json-ld-framing/": "http://www.w3.org/TR/json-ld11-framing/"
38-
}
39-
};
33+
};

0 commit comments

Comments
 (0)