This repository has been archived by the owner on Jun 7, 2024. It is now read-only.
forked from speced/respec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile-w3c-common.js
108 lines (105 loc) · 2.47 KB
/
profile-w3c-common.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
"use strict";
// Hide document, because we are about to change it radically.
if (document.body) {
document.body.hidden = true;
} else {
document.addEventListener("DOMContentLoaded", function() {
document.body.hidden = true;
}, {once: true});
}
// In case everything else fails, we always want to show the document
window.addEventListener("error", function(err) {
console.error(err);
document.body.hidden = false;
});
// this is only set in a build, not at all in the dev environment
require.config({
shim: {
shortcut: {
exports: "shortcut"
},
highlight: {
exports: "hljs"
},
beautify: {
exports: "beautify"
}
},
paths: {
"beautify-css": "deps/beautify-css",
"beautify-html": "deps/beautify-html",
"handlebars.runtime": "deps/handlebars",
"deps/highlight": "https://www.w3.org/Tools/respec/respec-highlight",
},
deps: [
"deps/fetch",
],
});
define([
// order is significant
"deps/domReady",
"core/base-runner",
"core/ui",
"core/aria",
"core/style",
"w3c/style",
"w3c/l10n",
"core/data-include",
"core/markdown",
"w3c/headers",
"w3c/abstract",
"w3c/conformance",
"core/data-transform",
"core/inlines",
"core/dfn",
"w3c/rfc2119",
"core/examples",
"core/issues-notes",
"core/requirements",
"core/best-practices",
"core/figures",
"core/webidl-contiguous",
"core/data-cite",
"core/biblio",
"core/webidl-index",
"core/webidl-oldschool",
"core/link-to-dfn",
"core/contrib",
"core/fix-headers",
"core/structure",
"w3c/informative",
"w3c/permalinks",
"core/id-headers",
"core/rdfa",
"w3c/aria",
"core/shiv",
"core/location-hash",
"ui/about-respec",
"ui/dfn-list",
"ui/save-html",
"ui/search-specref",
"w3c/seo",
"core/highlight",
/*Linter must be the last thing to run*/
"w3c/linter",
],
function(domReady, runner, ui) {
var args = Array.from(arguments).filter(function(item) {
return item;
});
ui.show();
domReady(function() {
runner
.runAll(args)
.then(document.respecIsReady)
.then(ui.enable)
.catch(function(err) {
console.error(err);
// In case processing fails, we still want to show the document.
document.body.hidden = false;
// even if things go critically bad, we should still try to show the UI
ui.enable();
});
});
}
);