-
Notifications
You must be signed in to change notification settings - Fork 1
/
docs.html
197 lines (183 loc) · 6.48 KB
/
docs.html
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<!doctype html>
<html lang="@locale@" data-framework="typescript">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<style>
#docs {
background: white !important;
}
#content {
margin-bottom: 3rem !important;
margin-top: 0.5rem !important;
}
svg {
max-width: 100%;
}
.blocklyText {
font-family:'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace !important;
}
.blocklyCheckbox,
.blocklyLed {
fill: #ff3030 !important;
text-shadow: 0px 0px 6px #f00;
font-size: 17pt !important;
}
.ui.card .blocklyPreview {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: calc(100% - 1em);
max-height: calc(100% - 1em);
}
div.blocks-svg-list > svg {
margin-right: 1rem;
margin-bottom: 1rem;
page-break-inside: avoid;
vertical-align: top;
}
code {
white-space: pre-wrap;
}
code.lang-ghost, code.lang-config, code.lang-package { display:none; }
code.lang-block::before,
code.lang-blocks::before,
code.lang-blocksxml::before,
code.lang-sig::before,
code.lang-sim::before,
code.lang-cards::before,
code.lang-namespaces::before,
code.lang-codecard::before,
code.lang-shadow::before,
code.lang-diff:before,
code.lang-diffspy:before,
code.lang-diffblocks:before
{
content: "...";
position: absolute;
top: calc(50% - 0.5em);
left: calc(50% - 5em);
}
code.lang-block,
code.lang-blocks,
code.lang-blocksxml,
code.lang-sig,
code.lang-sim,
code.lang-cards,
code.lang-namespaces,
code.lang-codecard,
code.lang-shadow,
code.lang-diff,
code.lang-diffspy
code.lang-diffblocks
{
color: transparent;
}
</style>
<link rel="stylesheet" data-rtl="/rtlsemantic.css" href="/semantic.css" type="text/css">
<link id="blocklycss" rel="stylesheet" data-rtl="/rtlblockly.css" href="/blockly.css" type="text/css">
<link rel="stylesheet" title="light" href="/highlight.js/styles/vs.css" type="text/css">
</head>
<body id="docs">
<div id="sidedocs-back-button" class="ui" style="display: none">
<i class="ui icon left arrow"></i>
<span id="back-label"></span>
</div>
<div id="sidedocs-back-button-divider" class="ui divider"></div>
<div id='loading' class="ui active inverted dimmer">
<div class="ui loader"></div>
</div>
<div id="content" class="ui container mainbody">
</div>
<script>
// This line gets patched up by the cloud
var pxtConfig = {
"relprefix": "/",
"verprefix": "",
"workerjs": "/worker.js",
"monacoworkerjs": "/monacoworker.js",
"gifworkerjs": "/gifjs/gif.worker.js",
"serviceworkerjs": "/serviceworker.js",
"typeScriptWorkerJs": "/tsworker.js",
"pxtVersion": "9.1.11",
"pxtRelId": "localDirRelId",
"pxtCdnUrl": "/",
"commitCdnUrl": "/",
"blobCdnUrl": "/",
"cdnUrl": "/",
"targetVersion": "0.0.0",
"targetRelId": "",
"targetUrl": "",
"targetId": "stm32iotnode",
"simUrl": "/simulator.html",
"simserviceworkerUrl": "/simulatorserviceworker.js",
"simworkerconfigUrl": "/workerConfig.js",
"partsUrl": "/siminstructions.html",
"runUrl": "/run.html",
"docsUrl": "/docs.html",
"multiUrl": "/multi.html",
"asseteditorUrl": "/asseteditor.html",
"skillmapUrl": "/skillmap.html",
"authcodeUrl": "/authcode.html",
"multiplayerUrl": "/multiplayer.html",
"kioskUrl": "/kiosk.html",
"isStatic": true
};
</script>
<!-- @include apptrackingweb.html -->
<!-- @include apptracking.html -->
<script type="text/javascript" src="/jquery.js"></script>
<script type="text/javascript" src="/embed.js"></script>
<script type="text/javascript">
(function () {
var backButton = document.getElementById('sidedocs-back-button');
// don't show 'go back' for printing
if (/print:/.test(window.location.href)) {
$(backButton).remove(); backButton = undefined;
$('#sidedocs-back-button-divider').remove();
}
if (/pxtElectron=true/.test(window.location)) window.pxtElectron = true;
var loading = document.getElementById('loading');
var content = document.getElementById('content');
ksRunnerReady(function() {
pxt.BrowserUtils.initTheme();
pxt.docs.requireMarked = function() { return marked; }
var backLabel = document.getElementById('back-label');
if (backLabel)
backLabel.textContent = pxt.Util.lf("Go back")
var projectid = /projectid=([^&?]+)/i.exec(window.location.href);
var project = /project=([^&?]+)/i.exec(window.location.href);
var code = /code=([^&?]+)/i.exec(window.location.href);
var md = /md=([^&?]+)/i.exec(window.location.href);
var markdown = code ? "```blocks\n" + decodeURIComponent(code[1]) + "```" : md ? decodeURIComponent(md[1]) : undefined;
var embed = /render=1/i.exec(window.location.href);
if (markdown) {
console.log('rendering code:')
console.log(markdown);
pxt.runner.renderMarkdownAsync(content, markdown).then(function() {
$(loading).hide();
$(content).show();
});
} else if (projectid) {
pxt.runner.renderProjectAsync(content, projectid[1]).then(function() {
$(loading).hide();
$(content).show();
});
}
else if (project) {
const files = JSON.parse(project[1]);
pxt.runner.renderProjectFilesAsync(content, files).then(function() {
$(loading).hide();
$(content).show();
});
}
else if (embed)
pxt.runner.startRenderServer();
else
pxt.runner.startDocsServer(loading, content, backButton);
});
})();
</script>
</body>
</html>