Skip to content

Instantly share code, notes, and snippets.

@tyrasd
Last active October 23, 2017 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyrasd/1895193efb9fa49c776dee73ab5d717c to your computer and use it in GitHub Desktop.
Save tyrasd/1895193efb9fa49c776dee73ab5d717c to your computer and use it in GitHub Desktop.
@font-face {
font-family: 'Rubik';
font-style: normal;
font-weight: 400;
src:
local('Rubik'),
local('Rubik-Regular'),
url('./rubik-v4-latin-regular.woff2') format('woff2'),
url('./rubik-v4-latin-regular.woff') format('woff');
}
html {
height: 100%;
}
body {
font-family: Rubik, -apple-system, BlinkMacSystemFont, 'avenir next', avenir, helvetica, 'helvetica neue', ubuntu, roboto, noto, 'segoe ui', arial, sans-serif;
margin: 0;
padding: 0;
}
h1,
h2,
h3,
p {
margin: 0;
}
a {
color: #fff;
text-decoration-skip: ink;
border-radius: 6px;
}
em {
font-style: normal;
}
.dark {
background: #272c32;
color: #fff;
}
.dark em {
color: #fadb03;
}
.dark a {
color: #7cbfe5;
}
.dark a:hover {
background: #4e5b6f;
}
.light {
background: #f5f5f5;
color: #34383e;
}
.light em {
color: #d13787;
}
.light a {
color: #0889d1;
}
.light a:hover {
color: #0069a4;
}
img {
width: 100%;
}
div.slide-container {
background-size: 100%;
display: flex;
align-items: center;
}
div.slide {
box-sizing: border-box;
cursor: pointer;
cursor: hand;
padding: 4%;
}
div.imageText {
text-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}
/* normally not good, but ok in context of full screen directional navigation */
:focus {
outline: 0;
}
body.talk-mode {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
body.print-mode {
background: #fff;
color: #000;
font-weight: normal;
padding: 30px 20px;
}
body.print-mode div.sub-container {
padding: 10px 20px;
display: flex;
flex-flow: row wrap;
}
ul.notes-list {
display: inline-block;
float: left;
vertical-align: top;
}
body.print-mode div.slide-container {
border: 1px solid #000;
}
body.jump-mode {
padding: 10px;
}
body.jump-mode div.sub-container {
display: inline-block;
vertical-align: top;
padding: 2px;
}
body.jump-mode div.slide-container {
border: 1px solid rgba(255, 255, 255, 0.2);
cursor: pointer;
}
body.jump-mode div.slide-container:hover {
border: 1px solid rgba(255, 255, 255, 0.8);
}
/* @flow weak */
window.addEventListener('load', function() {
// document.body isn't a guaranteed value: Flow will yell at
// us if we use it without checking if it exists, so let's check it here.
if (!document.body) {
throw new Error(
'big could not find a body element on this page, so it is exiting'
);
}
var body = document.body;
var initialBodyClass = body.className;
var slideDivs = nodeListToArray(document.querySelectorAll('body > div'));
if (!slideDivs.length) {
throw new Error(
"big couldn't find any slides in this presentation: " +
'there are no divs directly within the body of this page'
);
}
var ASPECT_RATIO = 1.6;
var timeoutInterval;
// Read the contents of `notes` elements as strings, and then
// get rid of the elements themselves so that they don't interfere with
// rendering.
var notes = slideDivs.map(function(slide) {
return nodeListToArray(slide.getElementsByTagName('notes')).map(function(
noteElement
) {
noteElement.parentNode.removeChild(noteElement);
return noteElement.innerHTML.trim();
});
});
/**
* The big API
* @public
*/
var big = {
/**
* The current slide
* @type {number}
* @public
*/
current: -1,
/**
* The current mode, one of 'talk', 'print', or 'jump'
* @public
*/
mode: 'talk',
/**
* Move one slide forward
* @function
* @public
*/
forward: forward,
/**
* Move one slide backward
* @function
* @public
*/
reverse: reverse,
/**
* Go to a numbered slide
* @function
* @public
*/
go: go,
/**
* The number of slides in this presentation
* @type {number}
* @public
*/
length: slideDivs.length,
audio: findAudioNode(),
playControl: undefined
};
var presentationContainer = body.appendChild(
ce('div', 'presentation-container')
);
slideDivs = slideDivs.map(function(slide) {
slide.setAttribute('tabindex', 0);
slide.classList.add('slide');
var slideContainer = presentationContainer.appendChild(
ce('div', 'slide-container')
);
slideContainer.appendChild(slide);
return slideContainer;
});
body.className = 'talk-mode ' + initialBodyClass;
if (big.audio) {
big.playControl = body.appendChild(ce('div'));
big.playControl.style.cssText = 'padding:5px;color:#aaa;';
big.playControl.addEventListener('click', onClickPlay);
window.setInterval(onAudioUpdate, 200);
}
var printListener = window.matchMedia('print');
//printListener.addListener(onPrint);
document.addEventListener('click', onClick);
document.addEventListener('keydown', onKeyDown);
document.addEventListener('touchstart', onTouchStart);
window.addEventListener('hashchange', onHashChange);
window.addEventListener('resize', onResize);
window.big = big;
console.log(
'This is a big presentation. You can: \n\n' +
'* press j to jump to a slide\n' +
'* press p to see the print view\n' +
'* press t to go back to the talk view'
);
go(parseHash() || big.current);
/**
* Parse the current window's hash, returning a number for a
* slide.
* @returns {number} slide number
*/
function parseHash() {
return parseInt(window.location.hash.substring(1), 10);
}
/**
* Just save some typing when we refer to document.createElement
*
* @param {string} type
* @param {string?} klass
* @returns {HTMLElement}
*/
function ce(type, klass) {
var element = document.createElement(type);
if (klass) {
element.className = klass;
}
return element;
}
/**
* Turn a NodeList, returned by querySelectorAll or another DOM method,
* into an Array with array methods.
* @param {NodeList} nodeList
* @returns {Array<HTMLElement>} array of nodes
*/
function nodeListToArray(nodeList) {
return [].slice.call(nodeList);
}
/**
* Try to find an audio node in the page that contains a usable
* track with a text track for navigation. There might be one, there
* might not.
* @returns {HTMLElement?} an audio node
*/
function findAudioNode() {
return nodeListToArray(
document.getElementsByTagName('audio')
).filter(function(audio) {
return (
audio.textTracks.length === 1 && audio.textTracks[0].cues.length > 0
);
})[0];
}
// Navigation ================================================================
function goToAudio(n) {
if (!big.audio) return;
big.playControl.style.cssText = n === 0
? 'display:none'
: 'padding:5px;color:#aaa;';
if (n === 0) {
big.audio.pause();
} else {
big.audio.currentTime = big.audio.textTracks[0].cues[n - 1].startTime;
if (big.audio.paused) big.audio.play();
}
}
/**
* Given a slide number, if there are notes for that slide,
* print them to the console.
*/
function printNotesToConsole(n) {
if (notes[n].length && 'group' in console) {
console.group(n);
notes[n].forEach(function(note) {
console.log(
'%c%s',
'padding:5px;font-family:serif;font-size:18px;line-height:150%;',
note
);
});
console.groupEnd();
}
}
function useDataImageAsBackground(slideContainer) {
var slideDiv = slideContainer.firstChild;
if (slideDiv.hasAttribute('data-background-image')) {
slideContainer.style.backgroundImage =
'url("' + slideDiv.getAttribute('data-background-image') + '")';
slideDiv.classList.add('imageText');
} else {
slideContainer.style.backgroundImage = '';
slideContainer.style.backgroundColor = slideDiv.style.backgroundColor;
}
}
/**
* The central navigation method: given a slide number, it goes to that slide
* and sets it up.
*
* @param {number} n slide index
* @param {boolean} dontSeek whether to seek audio. Specifically, when the slide
* is changing _because_ of audio tracks, we don't also want to skip audio.
*/
function go(n, dontSeek, force) {
// Ensure that the slide we're going to is in range: it isn't
// less than 0 or higher than the actual number of slides available.
n = Math.max(0, Math.min(big.length - 1, n));
// Avoid doing extra work if we're going from a slide to itself.
if (!force && big.current === n) return;
big.current = n;
var slideContainer = slideDivs[n];
var slideDiv = slideContainer.firstChild;
printNotesToConsole(n);
if (!dontSeek) {
goToAudio(n);
}
slideDivs.forEach(function(slide, i) {
slide.style.display = i === n ? 'flex' : 'none';
});
body.className =
'talk-mode ' + (slideDiv.getAttribute('data-bodyclass') || '') + ' ' + initialBodyClass;
useDataImageAsBackground(slideContainer);
// If a previous slide had set a timer to auto-advance but
// the user navigated before it fired, cancel it.
if (timeoutInterval !== undefined) {
window.clearInterval(timeoutInterval);
}
// If this slide has a time-to-next data attribute, set a
// timer that advances to the next slide within that many
// seconds.
if (slideDiv.hasAttribute('data-time-to-next')) {
if (big.audio) {
throw new Error(
'this presentation uses an audio track, and also uses time-to-next. ' +
'You must only use one or the other.'
);
}
var timeToNextStr = slideDiv.getAttribute('data-time-to-next');
var timeToNext = parseFloat(timeToNextStr);
if (isNaN(timeToNext)) {
throw new Error(
'big encountered a bad value for the time-to-next string: ' +
timeToNextStr
);
}
timeoutInterval = window.setTimeout(forward, timeToNext * 1000);
}
slideDiv.focus();
onResize();
if (window.location.hash !== n) {
window.location.hash = n;
}
document.title = slideDiv.textContent || slideDiv.innerText;
}
function forward() {
go(big.current + 1);
}
function reverse() {
go(big.current - 1);
}
/**
* This is the 'meat': it resizes a slide to a certain size. In
* talk mode, that size is the side of an aspect-fit box inside of
* the display. In jump and print modes, that size is a certain fixed
* pixel size.
*
* @param {HTMLElement} slideContainer
* @param {number} width
* @param {number} height
*/
function resizeTo(slideContainer, width, height) {
var slideDiv = slideContainer.firstChild;
var fontSize = height;
slideContainer.style.width = width + 'px';
slideContainer.style.height = height + 'px';
[100, 50, 10, 2].forEach(function(step) {
for (; fontSize > 0; fontSize -= step) {
slideDiv.style.fontSize = fontSize + 'px';
if (slideDiv.offsetWidth <= width && slideDiv.offsetHeight <= height) {
break;
}
}
fontSize += step;
});
}
function emptyNode(node) {
while (node.hasChildNodes()) {
node.removeChild(node.lastChild);
}
}
// Event listeners ===========================================================
function onPrint() {
body.className = 'print-mode ' + initialBodyClass;
emptyNode(presentationContainer);
slideDivs.forEach(function(slideContainer, i) {
var subContainer = presentationContainer.appendChild(
ce('div', 'sub-container')
);
var slideBodyContainer = subContainer.appendChild(
ce('div', slideContainer.firstChild.getAttribute('data-bodyclass') || '')
);
slideBodyContainer.appendChild(slideContainer);
slideContainer.style.display = 'flex';
useDataImageAsBackground(slideContainer);
resizeTo(slideContainer, 512, 320);
if (notes[i].length) {
var notesUl = subContainer.appendChild(ce('ul', 'notes-list'));
notes[i].forEach(function(note) {
var li = notesUl.appendChild(ce('li'));
li.innerText = note;
});
}
});
big.mode = 'print';
}
function onTalk(i) {
if (big.mode === 'talk') return;
big.mode = 'talk';
body.className = 'talk-mode ' + initialBodyClass;
emptyNode(presentationContainer);
slideDivs.forEach(function(slideContainer) {
presentationContainer.appendChild(slideContainer);
});
var goTo = big.current;
if (typeof i === 'number') {
goTo = i;
}
go(goTo, false, true);
}
function onJump() {
if (big.mode === 'jump') return;
big.mode = 'jump';
body.className = 'jump-mode ' + initialBodyClass;
emptyNode(presentationContainer);
slideDivs.forEach(function(slideContainer, i) {
var subContainer = presentationContainer.appendChild(
ce('div', 'sub-container')
);
var slideBodyContainer = subContainer.appendChild(
ce('div', slideContainer.firstChild.getAttribute('data-bodyclass') || '')
);
slideBodyContainer.appendChild(slideContainer);
slideContainer.style.display = 'flex';
useDataImageAsBackground(slideContainer);
resizeTo(slideContainer, 192, 120);
function onClickSlide(e) {
subContainer.removeEventListener('click', onClickSlide);
e.stopPropagation();
e.preventDefault();
onTalk(i);
}
subContainer.addEventListener('click', onClickSlide);
});
}
function onClick(e) {
if (big.mode !== 'talk') return;
if (e.target.tagName !== 'A') go((big.current + 1) % big.length);
}
function onKeyDown(e) {
if (big.mode == 'talk') {
if (e.which === 39 || e.which === 34 || e.which === 40) forward();
if (e.which === 37 || e.which === 33 || e.which === 38) reverse();
}
if (e.which === 80) onPrint();
if (e.which === 84) onTalk();
if (e.which === 74) onJump();
}
function onTouchStart(e) {
if (big.mode !== 'talk') return;
// When the 'once' option to addEventListener is available, we'll be able to
// simplify this code, but for now we manually remove the End listener
// after it is invoked once
var startingPageX = e.changedTouches[0].pageX;
document.addEventListener('touchend', onTouchEnd);
function onTouchEnd(e2) {
document.removeEventListener('touchend', onTouchEnd);
var distanceTraveled = e2.changedTouches[0].pageX - startingPageX;
// Don't navigate if the person didn't swipe by fewer than 4 pixels
if (Math.abs(distanceTraveled) < 4) return;
if (distanceTraveled < 0) forward();
else reverse();
}
}
function onClickPlay(e) {
if (big.audio.paused) {
big.current === 0 ? forward() : big.audio.play();
} else big.audio.pause();
e.stopPropagation();
}
function onAudioUpdate() {
big.playControl.innerHTML = big.audio.paused ? '&#9654;' : '&#9208;';
if (!big.audio.paused) {
return;
}
for (var ci = 0; ci < big.audio.textTracks[0].cues.length; ci++) {
if (
big.audio.textTracks[0].cues[ci].startTime <= big.audio.currentTime &&
big.audio.textTracks[0].cues[ci].endTime > big.audio.currentTime &&
big.current - 1 !== ci
) {
return go(ci + 1, true);
}
}
}
function onHashChange() {
if (big.mode !== 'talk') return;
go(parseHash());
}
function onResize() {
if (big.mode !== 'talk') return;
var documentElement = document.documentElement;
if (!documentElement) {
throw new Error(
'document.documentElement not found, this environment is weird'
);
}
var width = documentElement.clientWidth;
var height = documentElement.clientHeight;
// Too wide
if (width / height > ASPECT_RATIO) {
width = Math.ceil(height * ASPECT_RATIO);
} else {
height = Math.ceil(width / ASPECT_RATIO);
}
resizeTo(slideDivs[big.current], width, height);
}
});
/*! highlight.js v9.11.0 | BSD3 License | git.io/hljslicense */
!(function(e) {
var t =
('object' == typeof window && window) || ('object' == typeof self && self);
'undefined' != typeof exports
? e(exports)
: t &&
((t.hljs = e({})), 'function' == typeof define &&
define.amd &&
define([], function() {
return t.hljs;
}));
})(function(e) {
function t(e) {
return e.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
}
function r(e) {
return e.nodeName.toLowerCase();
}
function a(e, t) {
var r = e && e.exec(t);
return r && 0 === r.index;
}
function n(e) {
return E.test(e);
}
function i(e) {
var t, r, a, i, s = e.className + ' ';
if (((s += e.parentNode ? e.parentNode.className : ''), (r = M.exec(s))))
return w(r[1]) ? r[1] : 'no-highlight';
for (
(s = s.split(/\s+/)), (t = 0), (a = s.length);
a > t;
t++
) if (((i = s[t]), n(i) || w(i))) return i;
}
function s(e) {
var t, r = {}, a = Array.prototype.slice.call(arguments, 1);
for (t in e) r[t] = e[t];
return a.forEach(function(e) {
for (t in e) r[t] = e[t];
}), r;
}
function c(e) {
var t = [];
return (function a(e, n) {
for (
var i = e.firstChild;
i;
i = i.nextSibling
) 3 === i.nodeType ? (n += i.nodeValue.length) : 1 === i.nodeType && (t.push({ event: 'start', offset: n, node: i }), (n = a(i, n)), r(i).match(/br|hr|img|input/) || t.push({ event: 'stop', offset: n, node: i }));
return n;
})(e, 0), t;
}
function o(e, a, n) {
function i() {
return e.length && a.length
? e[0].offset !== a[0].offset
? e[0].offset < a[0].offset ? e : a
: 'start' === a[0].event ? e : a
: e.length ? e : a;
}
function s(e) {
function a(e) {
return (
' ' + e.nodeName + '="' + t(e.value).replace('"', '&quot;') + '"'
);
}
u += '<' + r(e) + N.map.call(e.attributes, a).join('') + '>';
}
function c(e) {
u += '</' + r(e) + '>';
}
function o(e) {
('start' === e.event ? s : c)(e.node);
}
for (var l = 0, u = '', d = []; e.length || a.length; ) {
var b = i();
if (((u += t(n.substring(l, b[0].offset))), (l = b[0].offset), b === e)) {
d.reverse().forEach(c);
do
o(b.splice(0, 1)[0]), (b = i());
while (b === e && b.length && b[0].offset === l);
d.reverse().forEach(s);
} else 'start' === b[0].event ? d.push(b[0].node) : d.pop(), o(b.splice(0, 1)[0]);
}
return u + t(n.substr(l));
}
function l(e) {
return e.v &&
!e.cached_variants &&
(e.cached_variants = e.v.map(function(t) {
return s(e, { v: null }, t);
})), e.cached_variants || (e.eW && [s(e)]) || [e];
}
function u(e) {
function t(e) {
return (e && e.source) || e;
}
function r(r, a) {
return new RegExp(t(r), 'm' + (e.cI ? 'i' : '') + (a ? 'g' : ''));
}
function a(n, i) {
if (!n.compiled) {
if (((n.compiled = !0), (n.k = n.k || n.bK), n.k)) {
var s = {},
c = function(t, r) {
e.cI && (r = r.toLowerCase()), r.split(' ').forEach(function(e) {
var r = e.split('|');
s[r[0]] = [t, r[1] ? Number(r[1]) : 1];
});
};
'string' == typeof n.k
? c('keyword', n.k)
: k(n.k).forEach(function(e) {
c(e, n.k[e]);
}), (n.k = s);
}
(n.lR = r(n.l || /\w+/, !0)), i &&
(n.bK && (n.b = '\\b(' + n.bK.split(' ').join('|') + ')\\b'), n.b ||
(n.b = /\B|\b/), (n.bR = r(n.b)), n.e ||
n.eW ||
(n.e = /\B|\b/), n.e && (n.eR = r(n.e)), (n.tE =
t(n.e) || ''), n.eW &&
i.tE &&
(n.tE += (n.e ? '|' : '') + i.tE)), n.i && (n.iR = r(n.i)), null ==
n.r && (n.r = 1), n.c ||
(n.c = []), (n.c = Array.prototype.concat.apply(
[],
n.c.map(function(e) {
return l('self' === e ? n : e);
})
)), n.c.forEach(function(e) {
a(e, n);
}), n.starts && a(n.starts, i);
var o = n.c
.map(function(e) {
return e.bK ? '\\.?(' + e.b + ')\\.?' : e.b;
})
.concat([n.tE, n.i])
.map(t)
.filter(Boolean);
n.t = o.length
? r(o.join('|'), !0)
: {
exec: function() {
return null;
}
};
}
}
a(e);
}
function d(e, r, n, i) {
function s(e, t) {
var r, n;
for (
(r = 0), (n = t.c.length);
n > r;
r++
) if (a(t.c[r].bR, e)) return t.c[r];
}
function c(e, t) {
if (a(e.eR, t)) {
for (; e.endsParent && e.parent; )
e = e.parent;
return e;
}
return e.eW ? c(e.parent, t) : void 0;
}
function o(e, t) {
return !n && a(t.iR, e);
}
function l(e, t) {
var r = v.cI ? t[0].toLowerCase() : t[0];
return e.k.hasOwnProperty(r) && e.k[r];
}
function p(e, t, r, a) {
var n = a ? '' : L.classPrefix, i = '<span class="' + n, s = r ? '' : R;
return (i += e + '">'), i + t + s;
}
function m() {
var e, r, a, n;
if (!N.k) return t(E);
for (
(n = ''), (r = 0), (N.lR.lastIndex = 0), (a = N.lR.exec(E));
a;
) (n += t(E.substring(r, a.index))), (e = l(N, a)), e ? ((M += e[1]), (n += p(e[0], t(a[0])))) : (n += t(a[0])), (r = N.lR.lastIndex), (a = N.lR.exec(E));
return n + t(E.substr(r));
}
function f() {
var e = 'string' == typeof N.sL;
if (e && !x[N.sL]) return t(E);
var r = e ? d(N.sL, E, !0, k[N.sL]) : b(E, N.sL.length ? N.sL : void 0);
return N.r > 0 &&
(M += r.r), e && (k[N.sL] = r.top), p(r.language, r.value, !1, !0);
}
function g() {
(C += null != N.sL ? f() : m()), (E = '');
}
function _(e) {
(C += e.cN
? p(e.cN, '', !0)
: ''), (N = Object.create(e, { parent: { value: N } }));
}
function h(e, t) {
if (((E += e), null == t)) return g(), 0;
var r = s(t, N);
if (r)
return r.skip
? (E += t)
: (r.eB && (E += t), g(), r.rB || r.eB || (E = t)), _(r, t), r.rB
? 0
: t.length;
var a = c(N, t);
if (a) {
var n = N;
n.skip ? (E += t) : (n.rE || n.eE || (E += t), g(), n.eE && (E = t));
do
N.cN && (C += R), N.skip || (M += N.r), (N = N.parent);
while (N !== a.parent);
return a.starts && _(a.starts, ''), n.rE ? 0 : t.length;
}
if (o(t, N))
throw new Error(
'Illegal lexeme "' + t + '" for mode "' + (N.cN || '<unnamed>') + '"'
);
return (E += t), t.length || 1;
}
var v = w(e);
if (!v) throw new Error('Unknown language: "' + e + '"');
u(v);
var y, N = i || v, k = {}, C = '';
for (y = N; y !== v; y = y.parent) y.cN && (C = p(y.cN, '', !0) + C);
var E = '', M = 0;
try {
for (var B, S, $ = 0; ; ) {
if (((N.t.lastIndex = $), (B = N.t.exec(r)), !B)) break;
(S = h(r.substring($, B.index), B[0])), ($ = B.index + S);
}
for (h(r.substr($)), (y = N); y.parent; y = y.parent) y.cN && (C += R);
return { r: M, value: C, language: e, top: N };
} catch (A) {
if (A.message && -1 !== A.message.indexOf('Illegal'))
return { r: 0, value: t(r) };
throw A;
}
}
function b(e, r) {
r = r || L.languages || k(x);
var a = { r: 0, value: t(e) }, n = a;
return r.filter(w).forEach(function(t) {
var r = d(t, e, !1);
(r.language = t), r.r > n.r && (n = r), r.r > a.r && ((n = a), (a = r));
}), n.language && (a.second_best = n), a;
}
function p(e) {
return L.tabReplace || L.useBR
? e.replace(B, function(e, t) {
return L.useBR && '\n' === e
? '<br>'
: L.tabReplace ? t.replace(/\t/g, L.tabReplace) : '';
})
: e;
}
function m(e, t, r) {
var a = t ? C[t] : r, n = [e.trim()];
return e.match(/\bhljs\b/) ||
n.push('hljs'), -1 === e.indexOf(a) && n.push(a), n.join(' ').trim();
}
function f(e) {
var t, r, a, s, l, u = i(e);
n(u) ||
(L.useBR
? ((t = document.createElementNS(
'http://www.w3.org/1999/xhtml',
'div'
)), (t.innerHTML = e.innerHTML
.replace(/\n/g, '')
.replace(/<br[ \/]*>/g, '\n')))
: (t = e), (l = t.textContent), (a = u ? d(u, l, !0) : b(l)), (r = c(
t
)), r.length &&
((s = document.createElementNS(
'http://www.w3.org/1999/xhtml',
'div'
)), (s.innerHTML = a.value), (a.value = o(r, c(s), l))), (a.value = p(
a.value
)), (e.innerHTML = a.value), (e.className = m(
e.className,
u,
a.language
)), (e.result = { language: a.language, re: a.r }), a.second_best &&
(e.second_best = {
language: a.second_best.language,
re: a.second_best.r
}));
}
function g(e) {
L = s(L, e);
}
function _() {
if (!_.called) {
_.called = !0;
var e = document.querySelectorAll('pre code');
N.forEach.call(e, f);
}
}
function h() {
addEventListener(
'DOMContentLoaded',
_,
!1
), addEventListener('load', _, !1);
}
function v(t, r) {
var a = (x[t] = r(e));
a.aliases &&
a.aliases.forEach(function(e) {
C[e] = t;
});
}
function y() {
return k(x);
}
function w(e) {
return (e = (e || '').toLowerCase()), x[e] || x[C[e]];
}
var N = [],
k = Object.keys,
x = {},
C = {},
E = /^(no-?highlight|plain|text)$/i,
M = /\blang(?:uage)?-([\w-]+)\b/i,
B = /((^(<[^>]+>|\t|)+|(?:\n)))/gm,
R = '</span>',
L = {
classPrefix: 'hljs-',
tabReplace: null,
useBR: !1,
languages: void 0
};
return (e.highlight = d), (e.highlightAuto = b), (e.fixMarkup = p), (e.highlightBlock = f), (e.configure = g), (e.initHighlighting = _), (e.initHighlightingOnLoad = h), (e.registerLanguage = v), (e.listLanguages = y), (e.getLanguage = w), (e.inherit = s), (e.IR = '[a-zA-Z]\\w*'), (e.UIR = '[a-zA-Z_]\\w*'), (e.NR = '\\b\\d+(\\.\\d+)?'), (e.CNR = '(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)'), (e.BNR = '\\b(0b[01]+)'), (e.RSR = '!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~'), (e.BE = { b: '\\\\[\\s\\S]', r: 0 }), (e.ASM = { cN: 'string', b: "'", e: "'", i: '\\n', c: [e.BE] }), (e.QSM = { cN: 'string', b: '"', e: '"', i: '\\n', c: [e.BE] }), (e.PWM = { b: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ }), (e.C = function(
t,
r,
a
) {
var n = e.inherit({ cN: 'comment', b: t, e: r, c: [] }, a || {});
return n.c.push(e.PWM), n.c.push({
cN: 'doctag',
b: '(?:TODO|FIXME|NOTE|BUG|XXX):',
r: 0
}), n;
}), (e.CLCM = e.C('//', '$')), (e.CBCM = e.C('/\\*', '\\*/')), (e.HCM = e.C('#', '$')), (e.NM = { cN: 'number', b: e.NR, r: 0 }), (e.CNM = { cN: 'number', b: e.CNR, r: 0 }), (e.BNM = { cN: 'number', b: e.BNR, r: 0 }), (e.CSSNM = { cN: 'number', b: e.NR + '(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?', r: 0 }), (e.RM = { cN: 'regexp', b: /\//, e: /\/[gimuy]*/, i: /\n/, c: [e.BE, { b: /\[/, e: /\]/, r: 0, c: [e.BE] }] }), (e.TM = { cN: 'title', b: e.IR, r: 0 }), (e.UTM = { cN: 'title', b: e.UIR, r: 0 }), (e.METHOD_GUARD = { b: '\\.\\s*' + e.UIR, r: 0 }), e.registerLanguage(
'apache',
function(e) {
var t = { cN: 'number', b: '[\\$%]\\d+' };
return {
aliases: ['apacheconf'],
cI: !0,
c: [
e.HCM,
{ cN: 'section', b: '</?', e: '>' },
{
cN: 'attribute',
b: /\w+/,
r: 0,
k: {
nomarkup: 'order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername'
},
starts: {
e: /$/,
r: 0,
k: { literal: 'on off all' },
c: [
{ cN: 'meta', b: '\\s\\[', e: '\\]$' },
{ cN: 'variable', b: '[\\$%]\\{', e: '\\}', c: ['self', t] },
t,
e.QSM
]
}
}
],
i: /\S/
};
}
), e.registerLanguage('bash', function(e) {
var t = {
cN: 'variable',
v: [{ b: /\$[\w\d#@][\w\d_]*/ }, { b: /\$\{(.*?)}/ }]
},
r = {
cN: 'string',
b: /"/,
e: /"/,
c: [e.BE, t, { cN: 'variable', b: /\$\(/, e: /\)/, c: [e.BE] }]
},
a = { cN: 'string', b: /'/, e: /'/ };
return {
aliases: ['sh', 'zsh'],
l: /-?[a-z\._]+/,
k: {
keyword: 'if then else elif fi for while in do done case esac function',
literal: 'true false',
built_in: 'break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp',
_: '-ne -eq -lt -gt -f -d -e -s -l -a'
},
c: [
{ cN: 'meta', b: /^#![^\n]+sh\s*$/, r: 10 },
{
cN: 'function',
b: /\w[\w\d_]*\s*\(\s*\)\s*\{/,
rB: !0,
c: [e.inherit(e.TM, { b: /\w[\w\d_]*/ })],
r: 0
},
e.HCM,
r,
a,
t
]
};
}), e.registerLanguage('coffeescript', function(e) {
var t = {
keyword: 'in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super yield import export from as default await then unless until loop of by when and or is isnt not',
literal: 'true false null undefined yes no on off',
built_in: 'npm require console print module global window document'
},
r = '[A-Za-z$_][0-9A-Za-z$_]*',
a = { cN: 'subst', b: /#\{/, e: /}/, k: t },
n = [
e.BNM,
e.inherit(e.CNM, { starts: { e: '(\\s*/)?', r: 0 } }),
{
cN: 'string',
v: [
{ b: /'''/, e: /'''/, c: [e.BE] },
{ b: /'/, e: /'/, c: [e.BE] },
{ b: /"""/, e: /"""/, c: [e.BE, a] },
{ b: /"/, e: /"/, c: [e.BE, a] }
]
},
{
cN: 'regexp',
v: [
{ b: '///', e: '///', c: [a, e.HCM] },
{ b: '//[gim]*', r: 0 },
{ b: /\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W|$)/ }
]
},
{ b: '@' + r },
{
sL: 'javascript',
eB: !0,
eE: !0,
v: [{ b: '```', e: '```' }, { b: '`', e: '`' }]
}
];
a.c = n;
var i = e.inherit(e.TM, { b: r }),
s = '(\\(.*\\))?\\s*\\B[-=]>',
c = {
cN: 'params',
b: '\\([^\\(]',
rB: !0,
c: [{ b: /\(/, e: /\)/, k: t, c: ['self'].concat(n) }]
};
return {
aliases: ['coffee', 'cson', 'iced'],
k: t,
i: /\/\*/,
c: n.concat([
e.C('###', '###'),
e.HCM,
{
cN: 'function',
b: '^\\s*' + r + '\\s*=\\s*' + s,
e: '[-=]>',
rB: !0,
c: [i, c]
},
{
b: /[:\(,=]\s*/,
r: 0,
c: [{ cN: 'function', b: s, e: '[-=]>', rB: !0, c: [c] }]
},
{
cN: 'class',
bK: 'class',
e: '$',
i: /[:="\[\]]/,
c: [{ bK: 'extends', eW: !0, i: /[:="\[\]]/, c: [i] }, i]
},
{ b: r + ':', e: ':', rB: !0, rE: !0, r: 0 }
])
};
}), e.registerLanguage('cpp', function(e) {
var t = { cN: 'keyword', b: '\\b[a-z\\d_]*_t\\b' },
r = {
cN: 'string',
v: [
{ b: '(u8?|U)?L?"', e: '"', i: '\\n', c: [e.BE] },
{ b: '(u8?|U)?R"', e: '"', c: [e.BE] },
{ b: "'\\\\?.", e: "'", i: '.' }
]
},
a = {
cN: 'number',
v: [
{ b: "\\b(0b[01']+)" },
{
b: "(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"
},
{
b: "(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"
}
],
r: 0
},
n = {
cN: 'meta',
b: /#\s*[a-z]+\b/,
e: /$/,
k: {
'meta-keyword': 'if else elif endif define undef warning error line pragma ifdef ifndef include'
},
c: [
{ b: /\\\n/, r: 0 },
e.inherit(r, { cN: 'meta-string' }),
{ cN: 'meta-string', b: /<[^\n>]*>/, e: /$/, i: '\\n' },
e.CLCM,
e.CBCM
]
},
i = e.IR + '\\s*\\(',
s = {
keyword: 'int float while private char catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignof constexpr decltype noexcept static_assert thread_local restrict _Bool complex _Complex _Imaginary atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and or not',
built_in: 'std string cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr',
literal: 'true false nullptr NULL'
},
c = [t, e.CLCM, e.CBCM, a, r];
return {
aliases: ['c', 'cc', 'h', 'c++', 'h++', 'hpp'],
k: s,
i: '</',
c: c.concat([
n,
{
b: '\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<',
e: '>',
k: s,
c: ['self', t]
},
{ b: e.IR + '::', k: s },
{
v: [
{ b: /=/, e: /;/ },
{ b: /\(/, e: /\)/ },
{ bK: 'new throw return else', e: /;/ }
],
k: s,
c: c.concat([
{ b: /\(/, e: /\)/, k: s, c: c.concat(['self']), r: 0 }
]),
r: 0
},
{
cN: 'function',
b: '(' + e.IR + '[\\*&\\s]+)+' + i,
rB: !0,
e: /[{;=]/,
eE: !0,
k: s,
i: /[^\w\s\*&]/,
c: [
{ b: i, rB: !0, c: [e.TM], r: 0 },
{
cN: 'params',
b: /\(/,
e: /\)/,
k: s,
r: 0,
c: [e.CLCM, e.CBCM, r, a, t]
},
e.CLCM,
e.CBCM,
n
]
},
{
cN: 'class',
bK: 'class struct',
e: /[{;:]/,
c: [{ b: /</, e: />/, c: ['self'] }, e.TM]
}
]),
exports: { preprocessor: n, strings: r, k: s }
};
}), e.registerLanguage('cs', function(e) {
var t = {
keyword: 'abstract as base bool break byte case catch char checked const continue decimal default delegate do double else enum event explicit extern finally fixed float for foreach goto if implicit in int interface internal is lock long object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this try typeof uint ulong unchecked unsafe ushort using virtual void volatile while nameof add alias ascending async await by descending dynamic equals from get global group into join let on orderby partial remove select set value var where yield',
literal: 'null false true'
},
r = { cN: 'string', b: '@"', e: '"', c: [{ b: '""' }] },
a = e.inherit(r, { i: /\n/ }),
n = { cN: 'subst', b: '{', e: '}', k: t },
i = e.inherit(n, { i: /\n/ }),
s = {
cN: 'string',
b: /\$"/,
e: '"',
i: /\n/,
c: [{ b: '{{' }, { b: '}}' }, e.BE, i]
},
c = {
cN: 'string',
b: /\$@"/,
e: '"',
c: [{ b: '{{' }, { b: '}}' }, { b: '""' }, n]
},
o = e.inherit(c, {
i: /\n/,
c: [{ b: '{{' }, { b: '}}' }, { b: '""' }, i]
});
(n.c = [
c,
s,
r,
e.ASM,
e.QSM,
e.CNM,
e.CBCM
]), (i.c = [o, s, a, e.ASM, e.QSM, e.CNM, e.inherit(e.CBCM, { i: /\n/ })]);
var l = { v: [c, s, r, e.ASM, e.QSM] },
u = e.IR + '(<' + e.IR + '(\\s*,\\s*' + e.IR + ')*>)?(\\[\\])?';
return {
aliases: ['csharp'],
k: t,
i: /::/,
c: [
e.C('///', '$', {
rB: !0,
c: [
{
cN: 'doctag',
v: [{ b: '///', r: 0 }, { b: '<!--|-->' }, { b: '</?', e: '>' }]
}
]
}),
e.CLCM,
e.CBCM,
{
cN: 'meta',
b: '#',
e: '$',
k: {
'meta-keyword': 'if else elif endif define undef warning error line region endregion pragma checksum'
}
},
l,
e.CNM,
{
bK: 'class interface',
e: /[{;=]/,
i: /[^\s:]/,
c: [e.TM, e.CLCM, e.CBCM]
},
{
bK: 'namespace',
e: /[{;=]/,
i: /[^\s:]/,
c: [e.inherit(e.TM, { b: '[a-zA-Z](\\.?\\w)*' }), e.CLCM, e.CBCM]
},
{ bK: 'new return throw await', r: 0 },
{
cN: 'function',
b: '(' + u + '\\s+)+' + e.IR + '\\s*\\(',
rB: !0,
e: /[{;=]/,
eE: !0,
k: t,
c: [
{ b: e.IR + '\\s*\\(', rB: !0, c: [e.TM], r: 0 },
{
cN: 'params',
b: /\(/,
e: /\)/,
eB: !0,
eE: !0,
k: t,
r: 0,
c: [l, e.CNM, e.CBCM]
},
e.CLCM,
e.CBCM
]
}
]
};
}), e.registerLanguage('css', function(e) {
var t = '[a-zA-Z-][a-zA-Z0-9_-]*',
r = {
b: /[A-Z\_\.\-]+\s*:/,
rB: !0,
e: ';',
eW: !0,
c: [
{
cN: 'attribute',
b: /\S/,
e: ':',
eE: !0,
starts: {
eW: !0,
eE: !0,
c: [
{
b: /[\w-]+\(/,
rB: !0,
c: [
{ cN: 'built_in', b: /[\w-]+/ },
{ b: /\(/, e: /\)/, c: [e.ASM, e.QSM] }
]
},
e.CSSNM,
e.QSM,
e.ASM,
e.CBCM,
{ cN: 'number', b: '#[0-9A-Fa-f]+' },
{ cN: 'meta', b: '!important' }
]
}
}
]
};
return {
cI: !0,
i: /[=\/|'\$]/,
c: [
e.CBCM,
{ cN: 'selector-id', b: /#[A-Za-z0-9_-]+/ },
{ cN: 'selector-class', b: /\.[A-Za-z0-9_-]+/ },
{ cN: 'selector-attr', b: /\[/, e: /\]/, i: '$' },
{ cN: 'selector-pseudo', b: /:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/ },
{ b: '@(font-face|page)', l: '[a-z-]+', k: 'font-face page' },
{
b: '@',
e: '[{;]',
i: /:/,
c: [
{ cN: 'keyword', b: /\w+/ },
{ b: /\s/, eW: !0, eE: !0, r: 0, c: [e.ASM, e.QSM, e.CSSNM] }
]
},
{ cN: 'selector-tag', b: t, r: 0 },
{ b: '{', e: '}', i: /\S/, c: [e.CBCM, r] }
]
};
}), e.registerLanguage('diff', function(e) {
return {
aliases: ['patch'],
c: [
{
cN: 'meta',
r: 10,
v: [
{ b: /^@@ +\-\d+,\d+ +\+\d+,\d+ +@@$/ },
{ b: /^\*\*\* +\d+,\d+ +\*\*\*\*$/ },
{ b: /^\-\-\- +\d+,\d+ +\-\-\-\-$/ }
]
},
{
cN: 'comment',
v: [
{ b: /Index: /, e: /$/ },
{ b: /={3,}/, e: /$/ },
{ b: /^\-{3}/, e: /$/ },
{ b: /^\*{3} /, e: /$/ },
{ b: /^\+{3}/, e: /$/ },
{ b: /\*{5}/, e: /\*{5}$/ }
]
},
{ cN: 'addition', b: '^\\+', e: '$' },
{ cN: 'deletion', b: '^\\-', e: '$' },
{ cN: 'addition', b: '^\\!', e: '$' }
]
};
}), e.registerLanguage('http', function(e) {
var t = 'HTTP/[0-9\\.]+';
return {
aliases: ['https'],
i: '\\S',
c: [
{ b: '^' + t, e: '$', c: [{ cN: 'number', b: '\\b\\d{3}\\b' }] },
{
b: '^[A-Z]+ (.*?) ' + t + '$',
rB: !0,
e: '$',
c: [
{ cN: 'string', b: ' ', e: ' ', eB: !0, eE: !0 },
{ b: t },
{ cN: 'keyword', b: '[A-Z]+' }
]
},
{
cN: 'attribute',
b: '^\\w',
e: ': ',
eE: !0,
i: '\\n|\\s|=',
starts: { e: '$', r: 0 }
},
{ b: '\\n\\n', starts: { sL: [], eW: !0 } }
]
};
}), e.registerLanguage('ini', function(e) {
var t = {
cN: 'string',
c: [e.BE],
v: [
{ b: "'''", e: "'''", r: 10 },
{ b: '"""', e: '"""', r: 10 },
{ b: '"', e: '"' },
{ b: "'", e: "'" }
]
};
return {
aliases: ['toml'],
cI: !0,
i: /\S/,
c: [
e.C(';', '$'),
e.HCM,
{ cN: 'section', b: /^\s*\[+/, e: /\]+/ },
{
b: /^[a-z0-9\[\]_-]+\s*=\s*/,
e: '$',
rB: !0,
c: [
{ cN: 'attr', b: /[a-z0-9\[\]_-]+/ },
{
b: /=/,
eW: !0,
r: 0,
c: [
{ cN: 'literal', b: /\bon|off|true|false|yes|no\b/ },
{
cN: 'variable',
v: [{ b: /\$[\w\d"][\w\d_]*/ }, { b: /\$\{(.*?)}/ }]
},
t,
{ cN: 'number', b: /([\+\-]+)?[\d]+_[\d_]+/ },
e.NM
]
}
]
}
]
};
}), e.registerLanguage('java', function(e) {
var t = '[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*',
r = t + '(<' + t + '(\\s*,\\s*' + t + ')*>)?',
a =
'false synchronized int abstract float private char boolean static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do',
n =
'\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?|\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))([eE][-+]?\\d+)?)[lLfF]?',
i = { cN: 'number', b: n, r: 0 };
return {
aliases: ['jsp'],
k: a,
i: /<\/|#/,
c: [
e.C('/\\*\\*', '\\*/', {
r: 0,
c: [{ b: /\w+@/, r: 0 }, { cN: 'doctag', b: '@[A-Za-z]+' }]
}),
e.CLCM,
e.CBCM,
e.ASM,
e.QSM,
{
cN: 'class',
bK: 'class interface',
e: /[{;=]/,
eE: !0,
k: 'class interface',
i: /[:"\[\]]/,
c: [{ bK: 'extends implements' }, e.UTM]
},
{ bK: 'new throw return else', r: 0 },
{
cN: 'function',
b: '(' + r + '\\s+)+' + e.UIR + '\\s*\\(',
rB: !0,
e: /[{;=]/,
eE: !0,
k: a,
c: [
{ b: e.UIR + '\\s*\\(', rB: !0, r: 0, c: [e.UTM] },
{
cN: 'params',
b: /\(/,
e: /\)/,
k: a,
r: 0,
c: [e.ASM, e.QSM, e.CNM, e.CBCM]
},
e.CLCM,
e.CBCM
]
},
i,
{ cN: 'meta', b: '@[A-Za-z]+' }
]
};
}), e.registerLanguage('javascript', function(e) {
var t = '[A-Za-z$_][0-9A-Za-z$_]*',
r = {
keyword: 'in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as',
literal: 'true false null undefined NaN Infinity',
built_in: 'eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise'
},
a = {
cN: 'number',
v: [{ b: '\\b(0[bB][01]+)' }, { b: '\\b(0[oO][0-7]+)' }, { b: e.CNR }],
r: 0
},
n = { cN: 'subst', b: '\\$\\{', e: '\\}', k: r, c: [] },
i = { cN: 'string', b: '`', e: '`', c: [e.BE, n] };
n.c = [e.ASM, e.QSM, i, a, e.RM];
var s = n.c.concat([e.CBCM, e.CLCM]);
return {
aliases: ['js', 'jsx'],
k: r,
c: [
{ cN: 'meta', r: 10, b: /^\s*['"]use (strict|asm)['"]/ },
{ cN: 'meta', b: /^#!/, e: /$/ },
e.ASM,
e.QSM,
i,
e.CLCM,
e.CBCM,
a,
{
b: /[{,]\s*/,
r: 0,
c: [{ b: t + '\\s*:', rB: !0, r: 0, c: [{ cN: 'attr', b: t, r: 0 }] }]
},
{
b: '(' + e.RSR + '|\\b(case|return|throw)\\b)\\s*',
k: 'return throw case',
c: [
e.CLCM,
e.CBCM,
e.RM,
{
cN: 'function',
b: '(\\(.*?\\)|' + t + ')\\s*=>',
rB: !0,
e: '\\s*=>',
c: [
{
cN: 'params',
v: [
{ b: t },
{ b: /\(\s*\)/ },
{ b: /\(/, e: /\)/, eB: !0, eE: !0, k: r, c: s }
]
}
]
},
{
b: /</,
e: /(\/\w+|\w+\/)>/,
sL: 'xml',
c: [
{ b: /<\w+\s*\/>/, skip: !0 },
{
b: /<\w+/,
e: /(\/\w+|\w+\/)>/,
skip: !0,
c: [{ b: /<\w+\s*\/>/, skip: !0 }, 'self']
}
]
}
],
r: 0
},
{
cN: 'function',
bK: 'function',
e: /\{/,
eE: !0,
c: [
e.inherit(e.TM, { b: t }),
{ cN: 'params', b: /\(/, e: /\)/, eB: !0, eE: !0, c: s }
],
i: /\[|%/
},
{ b: /\$[(.]/ },
e.METHOD_GUARD,
{
cN: 'class',
bK: 'class',
e: /[{;=]/,
eE: !0,
i: /[:"\[\]]/,
c: [{ bK: 'extends' }, e.UTM]
},
{ bK: 'constructor', e: /\{/, eE: !0 }
],
i: /#(?!!)/
};
}), e.registerLanguage('json', function(e) {
var t = { literal: 'true false null' },
r = [e.QSM, e.CNM],
a = { e: ',', eW: !0, eE: !0, c: r, k: t },
n = {
b: '{',
e: '}',
c: [
{ cN: 'attr', b: /"/, e: /"/, c: [e.BE], i: '\\n' },
e.inherit(a, { b: /:/ })
],
i: '\\S'
},
i = { b: '\\[', e: '\\]', c: [e.inherit(a)], i: '\\S' };
return r.splice(r.length, 0, n, i), { c: r, k: t, i: '\\S' };
}), e.registerLanguage('makefile', function(e) {
var t = {
cN: 'variable',
v: [{ b: '\\$\\(' + e.UIR + '\\)', c: [e.BE] }, { b: /\$[@%<?\^\+\*]/ }]
},
r = { cN: 'string', b: /"/, e: /"/, c: [e.BE, t] },
a = {
cN: 'variable',
b: /\$\([\w-]+\s/,
e: /\)/,
k: {
built_in: 'subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value'
},
c: [t]
},
n = {
b: '^' + e.UIR + '\\s*[:+?]?=',
i: '\\n',
rB: !0,
c: [{ b: '^' + e.UIR, e: '[:+?]?=', eE: !0 }]
},
i = {
cN: 'meta',
b: /^\.PHONY:/,
e: /$/,
k: { 'meta-keyword': '.PHONY' },
l: /[\.\w]+/
},
s = { cN: 'section', b: /^[^\s]+:/, e: /$/, c: [t] };
return {
aliases: ['mk', 'mak'],
k: 'define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath',
l: /[\w-]+/,
c: [e.HCM, t, r, a, n, i, s]
};
}), e.registerLanguage('xml', function(e) {
var t = '[A-Za-z0-9\\._:-]+',
r = {
eW: !0,
i: /</,
r: 0,
c: [
{ cN: 'attr', b: t, r: 0 },
{
b: /=\s*/,
r: 0,
c: [
{
cN: 'string',
endsParent: !0,
v: [
{ b: /"/, e: /"/ },
{ b: /'/, e: /'/ },
{ b: /[^\s"'=<>`]+/ }
]
}
]
}
]
};
return {
aliases: ['html', 'xhtml', 'rss', 'atom', 'xjb', 'xsd', 'xsl', 'plist'],
cI: !0,
c: [
{
cN: 'meta',
b: '<!DOCTYPE',
e: '>',
r: 10,
c: [{ b: '\\[', e: '\\]' }]
},
e.C('<!--', '-->', { r: 10 }),
{ b: '<\\!\\[CDATA\\[', e: '\\]\\]>', r: 10 },
{
b: /<\?(php)?/,
e: /\?>/,
sL: 'php',
c: [{ b: '/\\*', e: '\\*/', skip: !0 }]
},
{
cN: 'tag',
b: '<style(?=\\s|>|$)',
e: '>',
k: { name: 'style' },
c: [r],
starts: { e: '</style>', rE: !0, sL: ['css', 'xml'] }
},
{
cN: 'tag',
b: '<script(?=\\s|>|$)',
e: '>',
k: { name: 'script' },
c: [r],
starts: {
e: '</script>',
rE: !0,
sL: ['actionscript', 'javascript', 'handlebars', 'xml']
}
},
{
cN: 'meta',
v: [{ b: /<\?xml/, e: /\?>/, r: 10 }, { b: /<\?\w+/, e: /\?>/ }]
},
{
cN: 'tag',
b: '</?',
e: '/?>',
c: [{ cN: 'name', b: /[^\/><\s]+/, r: 0 }, r]
}
]
};
}), e.registerLanguage('markdown', function(e) {
return {
aliases: ['md', 'mkdown', 'mkd'],
c: [
{
cN: 'section',
v: [{ b: '^#{1,6}', e: '$' }, { b: '^.+?\\n[=-]{2,}$' }]
},
{ b: '<', e: '>', sL: 'xml', r: 0 },
{ cN: 'bullet', b: '^([*+-]|(\\d+\\.))\\s+' },
{ cN: 'strong', b: '[*_]{2}.+?[*_]{2}' },
{ cN: 'emphasis', v: [{ b: '\\*.+?\\*' }, { b: '_.+?_', r: 0 }] },
{ cN: 'quote', b: '^>\\s+', e: '$' },
{
cN: 'code',
v: [
{ b: '^```w*s*$', e: '^```s*$' },
{ b: '`.+?`' },
{ b: '^( {4}| )', e: '$', r: 0 }
]
},
{ b: '^[-\\*]{3,}', e: '$' },
{
b: '\\[.+?\\][\\(\\[].*?[\\)\\]]',
rB: !0,
c: [
{ cN: 'string', b: '\\[', e: '\\]', eB: !0, rE: !0, r: 0 },
{ cN: 'link', b: '\\]\\(', e: '\\)', eB: !0, eE: !0 },
{ cN: 'symbol', b: '\\]\\[', e: '\\]', eB: !0, eE: !0 }
],
r: 10
},
{
b: /^\[[^\n]+\]:/,
rB: !0,
c: [
{ cN: 'symbol', b: /\[/, e: /\]/, eB: !0, eE: !0 },
{ cN: 'link', b: /:\s*/, e: /$/, eB: !0 }
]
}
]
};
}), e.registerLanguage('nginx', function(e) {
var t = {
cN: 'variable',
v: [{ b: /\$\d+/ }, { b: /\$\{/, e: /}/ }, { b: '[\\$\\@]' + e.UIR }]
},
r = {
eW: !0,
l: '[a-z/_]+',
k: {
literal: 'on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll'
},
r: 0,
i: '=>',
c: [
e.HCM,
{
cN: 'string',
c: [e.BE, t],
v: [{ b: /"/, e: /"/ }, { b: /'/, e: /'/ }]
},
{ b: '([a-z]+):/', e: '\\s', eW: !0, eE: !0, c: [t] },
{
cN: 'regexp',
c: [e.BE, t],
v: [
{ b: '\\s\\^', e: '\\s|{|;', rE: !0 },
{ b: '~\\*?\\s+', e: '\\s|{|;', rE: !0 },
{ b: '\\*(\\.[a-z\\-]+)+' },
{ b: '([a-z\\-]+\\.)+\\*' }
]
},
{
cN: 'number',
b: '\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b'
},
{ cN: 'number', b: '\\b\\d+[kKmMgGdshdwy]*\\b', r: 0 },
t
]
};
return {
aliases: ['nginxconf'],
c: [
e.HCM,
{
b: e.UIR + '\\s+{',
rB: !0,
e: '{',
c: [{ cN: 'section', b: e.UIR }],
r: 0
},
{
b: e.UIR + '\\s',
e: ';|{',
rB: !0,
c: [{ cN: 'attribute', b: e.UIR, starts: r }],
r: 0
}
],
i: '[^\\s\\}]'
};
}), e.registerLanguage('objectivec', function(e) {
var t = {
cN: 'built_in',
b: '\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+'
},
r = {
keyword: 'int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN',
literal: 'false true FALSE TRUE nil YES NO NULL',
built_in: 'BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once'
},
a = /[a-zA-Z@][a-zA-Z0-9_]*/,
n = '@interface @class @protocol @implementation';
return {
aliases: ['mm', 'objc', 'obj-c'],
k: r,
l: a,
i: '</',
c: [
t,
e.CLCM,
e.CBCM,
e.CNM,
e.QSM,
{
cN: 'string',
v: [
{ b: '@"', e: '"', i: '\\n', c: [e.BE] },
{ b: "'", e: "[^\\\\]'", i: "[^\\\\][^']" }
]
},
{
cN: 'meta',
b: '#',
e: '$',
c: [
{ cN: 'meta-string', v: [{ b: '"', e: '"' }, { b: '<', e: '>' }] }
]
},
{
cN: 'class',
b: '(' + n.split(' ').join('|') + ')\\b',
e: '({|$)',
eE: !0,
k: n,
l: a,
c: [e.UTM]
},
{ b: '\\.' + e.UIR, r: 0 }
]
};
}), e.registerLanguage('perl', function(e) {
var t =
'getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when',
r = { cN: 'subst', b: '[$@]\\{', e: '\\}', k: t },
a = { b: '->{', e: '}' },
n = {
v: [
{ b: /\$\d/ },
{ b: /[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/ },
{ b: /[\$%@][^\s\w{]/, r: 0 }
]
},
i = [e.BE, r, n],
s = [
n,
e.HCM,
e.C('^\\=\\w', '\\=cut', { eW: !0 }),
a,
{
cN: 'string',
c: i,
v: [
{ b: 'q[qwxr]?\\s*\\(', e: '\\)', r: 5 },
{ b: 'q[qwxr]?\\s*\\[', e: '\\]', r: 5 },
{ b: 'q[qwxr]?\\s*\\{', e: '\\}', r: 5 },
{ b: 'q[qwxr]?\\s*\\|', e: '\\|', r: 5 },
{ b: 'q[qwxr]?\\s*\\<', e: '\\>', r: 5 },
{ b: 'qw\\s+q', e: 'q', r: 5 },
{ b: "'", e: "'", c: [e.BE] },
{ b: '"', e: '"' },
{ b: '`', e: '`', c: [e.BE] },
{ b: '{\\w+}', c: [], r: 0 },
{ b: '-?\\w+\\s*\\=\\>', c: [], r: 0 }
]
},
{
cN: 'number',
b: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b',
r: 0
},
{
b: '(\\/\\/|' +
e.RSR +
'|\\b(split|return|print|reverse|grep)\\b)\\s*',
k: 'split return print reverse grep',
r: 0,
c: [
e.HCM,
{
cN: 'regexp',
b: '(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*',
r: 10
},
{ cN: 'regexp', b: '(m|qr)?/', e: '/[a-z]*', c: [e.BE], r: 0 }
]
},
{
cN: 'function',
bK: 'sub',
e: '(\\s*\\(.*?\\))?[;{]',
eE: !0,
r: 5,
c: [e.TM]
},
{ b: '-\\w\\b', r: 0 },
{
b: '^__DATA__$',
e: '^__END__$',
sL: 'mojolicious',
c: [{ b: '^@@.*', e: '$', cN: 'comment' }]
}
];
return (r.c = s), (a.c = s), { aliases: ['pl', 'pm'], l: /[\w\.]+/, k: t, c: s };
}), e.registerLanguage('php', function(e) {
var t = { b: '\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*' },
r = { cN: 'meta', b: /<\?(php)?|\?>/ },
a = {
cN: 'string',
c: [e.BE, r],
v: [
{ b: 'b"', e: '"' },
{ b: "b'", e: "'" },
e.inherit(e.ASM, { i: null }),
e.inherit(e.QSM, { i: null })
]
},
n = { v: [e.BNM, e.CNM] };
return {
aliases: ['php3', 'php4', 'php5', 'php6'],
cI: !0,
k: 'and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally',
c: [
e.HCM,
e.C('//', '$', { c: [r] }),
e.C('/\\*', '\\*/', { c: [{ cN: 'doctag', b: '@[A-Za-z]+' }] }),
e.C('__halt_compiler.+?;', !1, {
eW: !0,
k: '__halt_compiler',
l: e.UIR
}),
{
cN: 'string',
b: /<<<['"]?\w+['"]?$/,
e: /^\w+;?$/,
c: [
e.BE,
{ cN: 'subst', v: [{ b: /\$\w+/ }, { b: /\{\$/, e: /\}/ }] }
]
},
r,
{ cN: 'keyword', b: /\$this\b/ },
t,
{ b: /(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/ },
{
cN: 'function',
bK: 'function',
e: /[;{]/,
eE: !0,
i: '\\$|\\[|%',
c: [
e.UTM,
{ cN: 'params', b: '\\(', e: '\\)', c: ['self', t, e.CBCM, a, n] }
]
},
{
cN: 'class',
bK: 'class interface',
e: '{',
eE: !0,
i: /[:\(\$"]/,
c: [{ bK: 'extends implements' }, e.UTM]
},
{ bK: 'namespace', e: ';', i: /[\.']/, c: [e.UTM] },
{ bK: 'use', e: ';', c: [e.UTM] },
{ b: '=>' },
a,
n
]
};
}), e.registerLanguage('python', function(e) {
var t = {
keyword: 'and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda async await nonlocal|10 None True False',
built_in: 'Ellipsis NotImplemented'
},
r = { cN: 'meta', b: /^(>>>|\.\.\.) / },
a = { cN: 'subst', b: /\{/, e: /\}/, k: t, i: /#/ },
n = {
cN: 'string',
c: [e.BE],
v: [
{ b: /(u|b)?r?'''/, e: /'''/, c: [r], r: 10 },
{ b: /(u|b)?r?"""/, e: /"""/, c: [r], r: 10 },
{ b: /(fr|rf|f)'''/, e: /'''/, c: [r, a] },
{ b: /(fr|rf|f)"""/, e: /"""/, c: [r, a] },
{ b: /(u|r|ur)'/, e: /'/, r: 10 },
{ b: /(u|r|ur)"/, e: /"/, r: 10 },
{ b: /(b|br)'/, e: /'/ },
{ b: /(b|br)"/, e: /"/ },
{ b: /(fr|rf|f)'/, e: /'/, c: [a] },
{ b: /(fr|rf|f)"/, e: /"/, c: [a] },
e.ASM,
e.QSM
]
},
i = {
cN: 'number',
r: 0,
v: [
{ b: e.BNR + '[lLjJ]?' },
{ b: '\\b(0o[0-7]+)[lLjJ]?' },
{ b: e.CNR + '[lLjJ]?' }
]
},
s = { cN: 'params', b: /\(/, e: /\)/, c: ['self', r, i, n] };
return (a.c = [
n,
i,
r
]), { aliases: ['py', 'gyp'], k: t, i: /(<\/|->|\?)|=>/, c: [r, i, n, e.HCM, { v: [{ cN: 'function', bK: 'def' }, { cN: 'class', bK: 'class' }], e: /:/, i: /[${=;\n,]/, c: [e.UTM, s, { b: /->/, eW: !0, k: 'None' }] }, { cN: 'meta', b: /^[\t ]*@/, e: /$/ }, { b: /\b(print|exec)\(/ }] };
}), e.registerLanguage('ruby', function(e) {
var t =
'[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?',
r = {
keyword: 'and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor',
literal: 'true false nil'
},
a = { cN: 'doctag', b: '@[A-Za-z]+' },
n = { b: '#<', e: '>' },
i = [
e.C('#', '$', { c: [a] }),
e.C('^\\=begin', '^\\=end', { c: [a], r: 10 }),
e.C('^__END__', '\\n$')
],
s = { cN: 'subst', b: '#\\{', e: '}', k: r },
c = {
cN: 'string',
c: [e.BE, s],
v: [
{ b: /'/, e: /'/ },
{ b: /"/, e: /"/ },
{ b: /`/, e: /`/ },
{ b: '%[qQwWx]?\\(', e: '\\)' },
{ b: '%[qQwWx]?\\[', e: '\\]' },
{ b: '%[qQwWx]?{', e: '}' },
{ b: '%[qQwWx]?<', e: '>' },
{ b: '%[qQwWx]?/', e: '/' },
{ b: '%[qQwWx]?%', e: '%' },
{ b: '%[qQwWx]?-', e: '-' },
{ b: '%[qQwWx]?\\|', e: '\\|' },
{
b: /\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/
},
{ b: /<<(-?)\w+$/, e: /^\s*\w+$/ }
]
},
o = { cN: 'params', b: '\\(', e: '\\)', endsParent: !0, k: r },
l = [
c,
n,
{
cN: 'class',
bK: 'class module',
e: '$|;',
i: /=/,
c: [
e.inherit(e.TM, { b: '[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?' }),
{ b: '<\\s*', c: [{ b: '(' + e.IR + '::)?' + e.IR }] }
].concat(i)
},
{
cN: 'function',
bK: 'def',
e: '$|;',
c: [e.inherit(e.TM, { b: t }), o].concat(i)
},
{ b: e.IR + '::' },
{ cN: 'symbol', b: e.UIR + '(\\!|\\?)?:', r: 0 },
{ cN: 'symbol', b: ':(?!\\s)', c: [c, { b: t }], r: 0 },
{
cN: 'number',
b: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b',
r: 0
},
{ b: '(\\$\\W)|((\\$|\\@\\@?)(\\w+))' },
{ cN: 'params', b: /\|/, e: /\|/, k: r },
{
b: '(' + e.RSR + '|unless)\\s*',
k: 'unless',
c: [
n,
{
cN: 'regexp',
c: [e.BE, s],
i: /\n/,
v: [
{ b: '/', e: '/[a-z]*' },
{ b: '%r{', e: '}[a-z]*' },
{ b: '%r\\(', e: '\\)[a-z]*' },
{ b: '%r!', e: '![a-z]*' },
{ b: '%r\\[', e: '\\][a-z]*' }
]
}
].concat(i),
r: 0
}
].concat(i);
(s.c = l), (o.c = l);
var u = '[>?]>',
d = '[\\w#]+\\(\\w+\\):\\d+:\\d+>',
b = '(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>',
p = [
{ b: /^\s*=>/, starts: { e: '$', c: l } },
{
cN: 'meta',
b: '^(' + u + '|' + d + '|' + b + ')',
starts: { e: '$', c: l }
}
];
return {
aliases: ['rb', 'gemspec', 'podspec', 'thor', 'irb'],
k: r,
i: /\/\*/,
c: i.concat(p).concat(l)
};
}), e.registerLanguage('shell', function(e) {
return {
aliases: ['console'],
c: [
{
cN: 'meta',
b: '^\\s{0,3}[\\w\\d\\[\\]()@-]*[>%$#]',
starts: { e: '$', sL: 'bash' }
}
]
};
}), e.registerLanguage('sql', function(e) {
var t = e.C('--', '$');
return {
cI: !0,
i: /[<>{}*#]/,
c: [
{
bK: 'begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke comment',
e: /;/,
eW: !0,
l: /[\w\.]+/,
k: {
keyword: 'abort abs absolute acc acce accep accept access accessed accessible account acos action activate add addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias allocate allow alter always analyze ancillary and any anydata anydataset anyschema anytype apply archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile before begin beginning benchmark between bfile bfile_base big bigfile bin binary_double binary_float binlog bit_and bit_count bit_length bit_or bit_xor bitmap blob_base block blocksize body both bound buffer_cache buffer_pool build bulk by byte byteordermark bytes cache caching call calling cancel capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char_base char_length character_length characters characterset charindex charset charsetform charsetid check checksum checksum_agg child choose chr chunk class cleanup clear client clob clob_base clone close cluster_id cluster_probability cluster_set clustering coalesce coercibility col collate collation collect colu colum column column_value columns columns_updated comment commit compact compatibility compiled complete composite_limit compound compress compute concat concat_ws concurrent confirm conn connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred defi defin define degrees delayed delegate delete delete_all delimited demand dense_rank depth dequeue des_decrypt des_encrypt des_key_file desc descr descri describ describe descriptor deterministic diagnostics difference dimension direct_load directory disable disable_all disallow disassociate discardfile disconnect diskgroup distinct distinctrow distribute distributed div do document domain dotnet double downgrade drop dumpfile duplicate duration each edition editionable editions element ellipsis else elsif elt empty enable enable_all enclosed encode encoding encrypt end end-exec endian enforced engine engines enqueue enterprise entityescaping eomonth error errors escaped evalname evaluate event eventdata events except exception exceptions exchange exclude excluding execu execut execute exempt exists exit exp expire explain export export_set extended extent external external_1 external_2 externally extract failed failed_login_attempts failover failure far fast feature_set feature_value fetch field fields file file_name_convert filesystem_like_logging final finish first first_value fixed flash_cache flashback floor flush following follows for forall force form forma format found found_rows freelist freelists freepools fresh from from_base64 from_days ftp full function general generated get get_format get_lock getdate getutcdate global global_name globally go goto grant grants greatest group group_concat group_id grouping grouping_id groups gtid_subtract guarantee guard handler hash hashkeys having hea head headi headin heading heap help hex hierarchy high high_priority hosts hour http id ident_current ident_incr ident_seed identified identity idle_time if ifnull ignore iif ilike ilm immediate import in include including increment index indexes indexing indextype indicator indices inet6_aton inet6_ntoa inet_aton inet_ntoa infile initial initialized initially initrans inmemory inner innodb input insert install instance instantiable instr interface interleaved intersect into invalidate invisible is is_free_lock is_ipv4 is_ipv4_compat is_not is_not_null is_used_lock isdate isnull isolation iterate java join json json_exists keep keep_duplicates key keys kill language large last last_day last_insert_id last_value lax lcase lead leading least leaves left len lenght length less level levels library like like2 like4 likec limit lines link list listagg little ln load load_file lob lobs local localtime localtimestamp locate locator lock locked log log10 log2 logfile logfiles logging logical logical_reads_per_call logoff logon logs long loop low low_priority lower lpad lrtrim ltrim main make_set makedate maketime managed management manual map mapping mask master master_pos_wait match matched materialized max maxextents maximize maxinstances maxlen maxlogfiles maxloghistory maxlogmembers maxsize maxtrans md5 measures median medium member memcompress memory merge microsecond mid migration min minextents minimum mining minus minute minvalue missing mod mode model modification modify module monitoring month months mount move movement multiset mutex name name_const names nan national native natural nav nchar nclob nested never new newline next nextval no no_write_to_binlog noarchivelog noaudit nobadfile nocheck nocompress nocopy nocycle nodelay nodiscardfile noentityescaping noguarantee nokeep nologfile nomapping nomaxvalue nominimize nominvalue nomonitoring none noneditionable nonschema noorder nopr nopro noprom nopromp noprompt norely noresetlogs noreverse normal norowdependencies noschemacheck noswitch not nothing notice notrim novalidate now nowait nth_value nullif nulls num numb numbe nvarchar nvarchar2 object ocicoll ocidate ocidatetime ociduration ociinterval ociloblocator ocinumber ociref ocirefcursor ocirowid ocistring ocitype oct octet_length of off offline offset oid oidindex old on online only opaque open operations operator optimal optimize option optionally or oracle oracle_date oradata ord ordaudio orddicom orddoc order ordimage ordinality ordvideo organization orlany orlvary out outer outfile outline output over overflow overriding package pad parallel parallel_enable parameters parent parse partial partition partitions pascal passing password password_grace_time password_lock_time password_reuse_max password_reuse_time password_verify_function patch path patindex pctincrease pctthreshold pctused pctversion percent percent_rank percentile_cont percentile_disc performance period period_add period_diff permanent physical pi pipe pipelined pivot pluggable plugin policy position post_transaction pow power pragma prebuilt precedes preceding precision prediction prediction_cost prediction_details prediction_probability prediction_set prepare present preserve prior priority private private_sga privileges procedural procedure procedure_analyze processlist profiles project prompt protection public publishingservername purge quarter query quick quiesce quota quotename radians raise rand range rank raw read reads readsize rebuild record records recover recovery recursive recycle redo reduced ref reference referenced references referencing refresh regexp_like register regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy reject rekey relational relative relaylog release release_lock relies_on relocate rely rem remainder rename repair repeat replace replicate replication required reset resetlogs resize resource respect restore restricted result result_cache resumable resume retention return returning returns reuse reverse revoke right rlike role roles rollback rolling rollup round row row_count rowdependencies rowid rownum rows rtrim rules safe salt sample save savepoint sb1 sb2 sb4 scan schema schemacheck scn scope scroll sdo_georaster sdo_topo_geometry search sec_to_time second section securefile security seed segment select self sequence sequential serializable server servererror session session_user sessions_per_user set sets settings sha sha1 sha2 share shared shared_pool short show shrink shutdown si_averagecolor si_colorhistogram si_featurelist si_positionalcolor si_stillimage si_texture siblings sid sign sin size size_t sizes skip slave sleep smalldatetimefromparts smallfile snapshot some soname sort soundex source space sparse spfile split sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_small_result sql_variant_property sqlcode sqldata sqlerror sqlname sqlstate sqrt square standalone standby start starting startup statement static statistics stats_binomial_test stats_crosstab stats_ks_test stats_mode stats_mw_test stats_one_way_anova stats_t_test_ stats_t_test_indep stats_t_test_one stats_t_test_paired stats_wsr_test status std stddev stddev_pop stddev_samp stdev stop storage store stored str str_to_date straight_join strcmp strict string struct stuff style subdate subpartition subpartitions substitutable substr substring subtime subtring_index subtype success sum suspend switch switchoffset switchover sync synchronous synonym sys sys_xmlagg sysasm sysaux sysdate sysdatetimeoffset sysdba sysoper system system_user sysutcdatetime table tables tablespace tan tdo template temporary terminated tertiary_weights test than then thread through tier ties time time_format time_zone timediff timefromparts timeout timestamp timestampadd timestampdiff timezone_abbr timezone_minute timezone_region to to_base64 to_date to_days to_seconds todatetimeoffset trace tracking transaction transactional translate translation treat trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse type ub1 ub2 ub4 ucase unarchived unbounded uncompress under undo unhex unicode uniform uninstall union unique unix_timestamp unknown unlimited unlock unpivot unrecoverable unsafe unsigned until untrusted unusable unused update updated upgrade upped upper upsert url urowid usable usage use use_stored_outlines user user_data user_resources users using utc_date utc_timestamp uuid uuid_short validate validate_password_strength validation valist value values var var_samp varcharc vari varia variab variabl variable variables variance varp varraw varrawc varray verify version versions view virtual visible void wait wallet warning warnings week weekday weekofyear wellformed when whene whenev wheneve whenever where while whitespace with within without work wrapped xdb xml xmlagg xmlattributes xmlcast xmlcolattval xmlelement xmlexists xmlforest xmlindex xmlnamespaces xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltype xor year year_to_month years yearweek',
literal: 'true false null',
built_in: 'array bigint binary bit blob boolean char character date dec decimal float int int8 integer interval number numeric real record serial serial8 smallint text varchar varying void'
},
c: [
{ cN: 'string', b: "'", e: "'", c: [e.BE, { b: "''" }] },
{ cN: 'string', b: '"', e: '"', c: [e.BE, { b: '""' }] },
{ cN: 'string', b: '`', e: '`', c: [e.BE] },
e.CNM,
e.CBCM,
t
]
},
e.CBCM,
t
]
};
}), e;
});
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' />
<title>big</title>
<link href='big.css' rel='stylesheet' type='text/css' />
<link href='highlight.css' rel='stylesheet' type='text/css' />
<style>
.hljs { line-height: 1.5em; }
.whiteBg { background-color:white; }
ul { margin:0; padding-left: 0.7em; }
li, p { padding-bottom: 0.3em; }
body.bgimgcontain div.slide-container {
background-size: contain !important;
background-repeat: no-repeat;
background-position: center center;
}
</style>
<script src='big.js'></script>
<script src='highlight.js'></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body class='light'>
<div>
<h1 style="text-align:center;">OSM History Analysis Using Big&nbsp;Data Technology</h1>
<p style="text-align:center;">
<img src="http://www2.geog.uni-heidelberg.de/media/lehrstuehle/gis/HeiGIT_Logo_base_286x60.png" style="height:2em; width:auto; display:inline-block; border:solid 0.2em transparent; border-top-width:1.5em;" />
</p>
</div>
<div data-bodyclass="something">
<h2>Motivation</h2>
<p>evaluation of OSM data quality</p>
<p>by generating statistics about OSM's data over time</p>
<p>efficient data processing → tight feedback loop</p>
</div>
<div>
<h2>Data Quality</h2>
<p>Aspects like <i>completeness</i>, <i>accuracy</i>, <i>consistency</i>, …</p>
<p>Depends on use case → <i>fitness for purpose</i></p>
</div>
<div>
<p>Intrinsic Data Quality Measures</p>
</div>
<!--
<div>
<p>?? Other Use Cases</p>
<notes>
??
?general geo data statistics?
</notes>
</div>
-->
<div>
<h2>Requirements</h2>
<ul>
<li>flexible system</li>
<li>works at global scale</li>
<li>provides full raw OSM data</li>
</ul>
</div>
<div>
<h2>existing methods</h2>
<ul>
<li>using archived planet dumps</li>
<li>osm-history-renderer importer</li>
<li>Overpass API</li>
<li>…</li>
</ul>
</div>
<div>
<h2>oshdb</h2>
</div>
<div>
<p>System&nbsp;Design:<br>Map-Reduce</p>
</div>
<div>
<p>System&nbsp;Design:<br>Data Partitioning &amp; Format</p>
</div>
<div>
<p>System&nbsp;Design:<br>Usage</p>
</div>
<div>
<p>code examples</p>
</div>
<div>
<pre><code class="java">
oshdb = new OSHDB_Ignite();
result = OSMEntitySnapshotMapper.using(oshdb)
.timestamps(…)
.boundingBox(…)
.osmTypes(OSMType.WAY)
.filterByTagKey("highway")
.sumAggregateByTimestamp(entitySnapshot -&gt;
lengthOf(entitySnapshot.getGeometry())
);
</code></pre>
</div>
<div>
<pre><code class="java">
oshdb = new OSHDB_Ignite();
result = OSMContributionMapper.using(oshdb)
.timestamps(…)
.boundingBox(…)
.osmTypes(OSMType.WAY)
.filterByTagKey("highway")
.sumAggregateByTimestamp(contrib -&gt;
contrib.getContributionTypes().contains(<b>DELETION</b>)
? lengthOf(contrib.getGeometryBefore()) : 0.0
);
</code></pre>
</div>
<!--
<div>
<p></p>
<notes>
</notes>
</div>
-->
<div>
<h2>Analyzing of history OSM data</h2>
<ul>
<li>OSM-API changes</li>
<li>OSM Tagging changes</li>
<li>ODbL</li>
</ul>
</div>
<div>
<p>Examples</p>
</div>
<div data-background-image="roads-total.svg" data-bodyclass="bgimgcontain">
</div>
<div data-background-image="roads-bytype1b.svg" data-bodyclass="bgimgcontain">
</div>
<div data-background-image="roads-bytype2.svg" data-bodyclass="bgimgcontain">
</div>
<div data-background-image="roads-countvslength.svg" data-bodyclass="bgimgcontain">
</div>
<div data-background-image="roads-uniqueusers.svg" data-bodyclass="bgimgcontain">
</div>
<div data-background-image="landuse.svg" data-bodyclass="bgimgcontain">
</div>
<!--Fragen/Contact-->
<div data-bodyclass="awhiteBg">
<p>
<em><span style="white-space:nowrap;">martin.raifer@uni-heidelberg.de</span></em>
</p>
<p style="padding-left: 2.5em; text-align:left;">
<img src="http://www2.geog.uni-heidelberg.de/media/lehrstuehle/gis/HeiGIT_Logo_base_286x60.png" style="height:2em; width:auto; display:inline-block; border:solid 0.2em transparent; border-top-width:1.5em;" /><br>
core funded by <img src="http://www.geog.uni-heidelberg.de/md/chemgeo/geog/gis/kts_rgb.jpg" style="height:3em; width:auto; display:inline-block; border:solid 0.2em transparent; vertical-align: middle;" />
</p>
</div>
</body>
</html>
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="201mm" height="156mm" viewBox="0 0 20100 15600" version="1.1" xmlns="http://www.w3.org/2000/svg" stroke-width="28.222" stroke-linejoin="round" xml:space="preserve">
<path fill="none" stroke="rgb(209,55,135)" stroke-width="80" stroke-linejoin="round" stroke-dasharray="158,102" d="M 772,13626 L 936,13580 1096,13524 1266,13455 1431,13369 1602,13285 1767,13208 1937,13121 2108,13029 2273,12904 2443,12747 2608,12661 2779,12593 2949,12486 3103,12405 3274,12329 3439,12237 3609,12126 3774,12017 3945,11903 4115,11756 4280,11594 4451,11476 4616,11372 4786,11265 4957,11147 5111,11042 5281,10938 5446,10859 5616,10638 5781,10475 5952,10330 6122,10100 6287,9901 6458,9732 6623,9581 6793,9447 6964,9271 7118,9144 7288,8972 7453,8759 7624,8600 7789,8460 7959,8322 8130,8169 8295,8002 8465,7860 8630,7716 8801,7556 8971,7402 9131,7295 9301,7147 9466,6999 9637,6865 9802,6726 9972,6564 10142,6380 10306,6205 10477,5999 10642,5822 10812,5662 10983,5479 11137,5356 11307,5197 11472,5086 11643,4914 11808,4767 11978,4638 12149,4511 12314,4394 12484,4280 12649,4165 12820,4070 12990,3983 13144,3884 13315,3748 13480,3622 13650,3531 13815,3431 13986,3335 14156,3233 14321,3134 14492,3059 14657,2968 14827,2885 14997,2802 15151,2735 15322,2666 15487,2608 15657,2542 15822,2486 15993,2424 16163,2369 16328,2311 16499,2243 16664,2166 16834,2072 17005,1982 17164,1925 17335,1866 17500,1798 17670,1739 17835,1674 18006,1622 18176,1560 18341,1468 18512,1401 18677,1340 18847,1278 19018,1208 19172,1150 19342,1099 19507,1041 19512,1040"/>
<path fill="none" stroke="rgb(209,55,135)" stroke-width="80" stroke-linejoin="round" d="M 772,13913 L 936,13819 1096,13671 1266,13495 1431,13267 1602,12983 1767,12776 1937,12582 2108,12325 2273,12013 2443,11728 2608,11592 2779,11484 2949,11309 3103,11190 3274,11066 3439,10911 3609,10660 3774,10387 3945,10205 4115,9982 4280,9781 4451,9634 4616,9508 4786,9399 4957,9268 5111,9154 5281,9034 5446,8913 5616,8646 5781,8460 5952,8263 6122,7939 6287,7634 6458,7435 6623,7263 6793,7006 6964,6800 7118,6638 7288,6307 7453,5982 7624,5785 7789,5629 7959,5503 8130,5357 8295,5169 8465,5046 8630,4911 8801,4760 8971,4606 9131,4511 9301,4380 9466,4254 9637,4145 9802,4030 9972,3913 10142,3777 10306,3658 10477,3525 10642,3380 10812,3264 10983,3134 11137,3062 11307,2947 11472,2880 11643,2785 11808,2705 11978,2634 12149,2575 12314,2528 12484,2476 12649,2405 12820,2349 12990,2306 13144,2257 13315,2201 13480,2155 13650,2115 13815,2083 13986,2037 14156,1995 14321,1948 14492,1924 14657,1884 14827,1843 14997,1805 15151,1778 15322,1749 15487,1722 15657,1694 15822,1671 15993,1643 16163,1625 16328,1604 16499,1577 16664,1541 16834,1478 17005,1418 17164,1385 17335,1356 17500,1323 17670,1304 17835,1276 18006,1259 18176,1232 18341,1212 18512,1190 18677,1167 18847,1141 19018,1125 19172,1110 19342,1100 19507,1075 19678,1060"/>
<text class="TextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="353px" font-weight="400"><tspan class="TextPosition" x="401" y="15242"><tspan fill="rgb(0,0,0)" stroke="none">2008</tspan></tspan></tspan></text>
<text class="TextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="353px" font-weight="400"><tspan class="TextPosition" x="2409" y="15242"><tspan fill="rgb(0,0,0)" stroke="none">2009</tspan></tspan></tspan></text>
<text class="TextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="353px" font-weight="400"><tspan class="TextPosition" x="4418" y="15242"><tspan fill="rgb(0,0,0)" stroke="none">2010</tspan></tspan></tspan></text>
<text class="TextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="353px" font-weight="400"><tspan class="TextPosition" x="6426" y="15242"><tspan fill="rgb(0,0,0)" stroke="none">2011</tspan></tspan></tspan></text>
<text class="TextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="353px" font-weight="400"><tspan class="TextPosition" x="8435" y="15242"><tspan fill="rgb(0,0,0)" stroke="none">2012</tspan></tspan></tspan></text>
<text class="TextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="353px" font-weight="400"><tspan class="TextPosition" x="10444" y="15242"><tspan fill="rgb(0,0,0)" stroke="none">2013</tspan></tspan></tspan></text>
<text class="TextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="353px" font-weight="400"><tspan class="TextPosition" x="12452" y="15242"><tspan fill="rgb(0,0,0)" stroke="none">2014</tspan></tspan></tspan></text>
<text class="TextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="353px" font-weight="400"><tspan class="TextPosition" x="14461" y="15242"><tspan fill="rgb(0,0,0)" stroke="none">2015</tspan></tspan></tspan></text>
<text class="TextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="353px" font-weight="400"><tspan class="TextPosition" x="16470" y="15242"><tspan fill="rgb(0,0,0)" stroke="none">2016</tspan></tspan></tspan></text>
<text class="TextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="353px" font-weight="400"><tspan class="TextPosition" x="18478" y="15242"><tspan fill="rgb(0,0,0)" stroke="none">2017</tspan></tspan></tspan></text>
<path fill="none" stroke="rgb(209,55,135)" stroke-width="80" stroke-linejoin="round" d="M 6436,457 L 8036,457"/>
<path fill="none" stroke="rgb(209,55,135)" stroke-width="80" stroke-linejoin="round" stroke-dasharray="158,102" d="M 10195,457 L 11795,457"/>
<text class="TextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="353px" font-weight="400"><tspan class="TextPosition" x="8136" y="576"><tspan fill="rgb(0,0,0)" stroke="none">Road length</tspan></tspan></tspan></text>
<text class="TextShape"><tspan class="TextParagraph" font-family="Liberation Sans, sans-serif" font-size="353px" font-weight="400"><tspan class="TextPosition" x="11895" y="576"><tspan fill="rgb(0,0,0)" stroke="none">Road count</tspan></tspan></tspan></text>
</svg>
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment