Skip to content

Commit fd38ed8

Browse files
authored
remove runkit (#302)
* remove runkit refs from _headers * remove Try in REPL buttons * remove embed.runkit.com from _config.yml * remove repl related css styles and selectors
1 parent 15c2c74 commit fd38ed8

File tree

5 files changed

+1
-74
lines changed

5 files changed

+1
-74
lines changed

_config.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ vendor:
7676
integrity: sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN
7777

7878
js:
79-
- href: https://embed.runkit.com/
80-
async: true
81-
8279
- href: https://cdn.jsdelivr.net/g/fuse@2.6.1,react@15.4.0(react.min.js+react-dom.min.js
8380
integrity: sha384-txLSiuN1HJSO1or/mE1Y6bvgD0cV3WA6Ss7rs9WqvPQ3zthR8w/DzHpB+DVTDAMz
8481

_headers

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ csp:
88
'data:',
99
'ms-appx-web:',
1010
'ghbtns.com',
11-
'runkit.com',
12-
'*.runkit-embed.com',
13-
'runkit-embed.com',
1411
'platform.twitter.com'
1512
]
1613
connect-src: [
@@ -46,9 +43,6 @@ csp:
4643
'data:',
4744
'ms-appx-web:',
4845
'ghbtns.com',
49-
'runkit.com',
50-
'*.runkit-embed.com',
51-
'runkit-embed.com',
5246
'platform.twitter.com'
5347
]
5448
manifest-src: [
@@ -62,7 +56,6 @@ csp:
6256
'www.google-analytics.com',
6357
'www.googletagmanager.com',
6458
'cdn.jsdelivr.net',
65-
'embed.runkit.com'
6659
]
6760
style-src: [
6861
"'self'",
@@ -72,7 +65,6 @@ hints:
7265
all: [
7366
'</sw.js>; rel=serviceworker',
7467
'<https://cdn.jsdelivr.net/>; rel=preconnect; pr=1.0; crossorigin',
75-
'<//runkit.com/>; rel=dns-prefetch; pr=0.25; crossorigin',
7668
'<//cdn.carbonads.com/>; rel=dns-prefetch; pr=0.25',
7769
'<//srv.carbonads.net/>; rel=dns-prefetch; pr=0.25'
7870
]

assets/css/_docs.scss

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ html.docs {
22
@import 'carbon';
33

44
&.offline {
5-
#carbonads,
6-
.btn-repl {
5+
#carbonads {
76
display: none;
87
}
98

@@ -38,14 +37,6 @@ html.docs {
3837
}
3938
}
4039

41-
.btn-repl {
42-
bottom: 2.4rem;
43-
color: $foreground;
44-
font-size: 1.3rem;
45-
position: absolute;
46-
right: 0;
47-
}
48-
4940
.container {
5041
max-width: 100%;
5142
}
@@ -162,13 +153,6 @@ html.docs {
162153
}
163154
}
164155

165-
.repl {
166-
background-color: transparent;
167-
margin: 0 0 0 -75px;
168-
padding: 0;
169-
width: calc(100% + 175px);
170-
}
171-
172156
.search {
173157
position: relative;
174158
width: 100%;

assets/css/_media-queries.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@
4545
display: inline;
4646
}
4747

48-
html.docs {
49-
.btn-repl {
50-
display: none;
51-
}
52-
}
5348
}
5449

5550
@media (max-width: $screen-md-max) {
@@ -130,7 +125,6 @@
130125

131126
header,
132127
h3 a,
133-
.btn-repl,
134128
.doc-container h3 + p a,
135129
.toc-container {
136130
display: none !important;

assets/js/docs.js

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -421,46 +421,6 @@
421421
if (!document.hidden) {
422422
carbonate()
423423
}
424-
// Add REPL buttons.
425-
if ('innerText' in docs) {
426-
_.each(docs.querySelectorAll('.highlight.js'), function(div) {
427-
var button = document.createElement('a'),
428-
parent = div.parentNode
429-
430-
button.classList.add('btn-repl')
431-
button.textContent = 'Try in REPL'
432-
button.style.display = navigator.onLine ? '' : 'none'
433-
button.addEventListener('click', function() {
434-
if (typeof RunKit == 'undefined') {
435-
return
436-
}
437-
438-
var source = div.innerText
439-
parent.removeChild(div)
440-
parent.removeChild(button)
441-
RunKit.createNotebook({
442-
'element': parent,
443-
'nodeVersion': '*',
444-
'preamble': [
445-
'var _ = require("lodash@' + versionSelect.value + '")',
446-
'_.assign(global, require("lodash-doc-globals"))',
447-
'Object.observe = _.noop'
448-
].join('\n'),
449-
'source': source,
450-
'theme': 'atom-light-syntax',
451-
'onLoad': function(notebook) {
452-
if (!RunKit.version) {
453-
var iframe = parent.lastElementChild
454-
iframe.style.cssText = 'height:' + iframe.style.height
455-
iframe.classList.add('repl')
456-
}
457-
notebook.evaluate()
458-
}
459-
})
460-
})
461-
parent.appendChild(button)
462-
})
463-
}
464424
}
465425

466426
if (document.readyState == 'loading') {

0 commit comments

Comments
 (0)