add first few pages of PyBullet quickstart guide in Markdeep
This commit is contained in:
1 parent
5906923324
commit
277b6bb8a1
26 files changed
+14875
No files matched your search
@@ -0,0 +1,10 @@
|
||||
<meta charset="utf-8" lang="en">
|
||||
Hello Markdeep!
|
||||
|
||||
- Hello
|
||||
- lists!
|
||||
|
||||
Hello MathJax:
|
||||
\[f(0)=\frac{1}{2\cdot\pi\cdot i}\cdot \oint_{|z|=1} \frac{f(z)}{z} \textrm{d}z\]
|
||||
|
||||
<script src="MarkdeepUtility.js"></script>
|
||||
@@ -0,0 +1,43 @@
|
||||
import re
|
||||
|
||||
if(__name__=="__main__"):
|
||||
# Assemble the script which embeds the Markdeep page into the preview blog
|
||||
PreviewBlogPage=open("PreviewBlogPage.htm","rb").read().decode("utf-8");
|
||||
HeadMatch=re.search("<head(.*?)>(.*?)</head>",PreviewBlogPage,re.DOTALL);
|
||||
HeadAttributes=HeadMatch.group(1);
|
||||
FullDocumentHead=HeadMatch.group(2);
|
||||
BodyMatch=re.search("<body(.*?)>(.*?)</body>",PreviewBlogPage,re.DOTALL);
|
||||
BodyAttributes=BodyMatch.group(1);
|
||||
FullPreviewBody=BodyMatch.group(2);
|
||||
ArticleHTMLCodeMacro="$(ARTICLE_HTML_CODE)";
|
||||
iArticleHTMLCodeMacro=FullPreviewBody.find(ArticleHTMLCodeMacro);
|
||||
DocumentBodyPrefix=FullPreviewBody[0:iArticleHTMLCodeMacro];
|
||||
DocumentBodySuffix=FullPreviewBody[iArticleHTMLCodeMacro+len(ArticleHTMLCodeMacro):];
|
||||
FullPrepareHTMLCode=open("PrepareHTML.js","rb").read().decode("utf-8");
|
||||
ReplacementList=[
|
||||
("$(FULL_DOCUMENT_HEAD)",FullDocumentHead),
|
||||
("$(DOCUMENT_BODY_PREFIX)",DocumentBodyPrefix),
|
||||
("$(DOCUMENT_BODY_SUFFIX)",DocumentBodySuffix)
|
||||
];
|
||||
for Macro,Replacement in ReplacementList:
|
||||
FullPrepareHTMLCode=FullPrepareHTMLCode.replace(Macro,Replacement.replace("\r\n","\\r\\n\\\r\n").replace("'","\\'"));
|
||||
# Generate code which sets body and head attributes appropriately
|
||||
for Element,AttributeCode in [("head",HeadAttributes),("body",BodyAttributes)]:
|
||||
FullPrepareHTMLCode+="\r\n// Setting "+Element+" attributes\r\n";
|
||||
for Match in re.finditer("(\\w+)=\\\"(.*?)\\\"",AttributeCode):
|
||||
FullPrepareHTMLCode+="document."+Element+".setAttribute(\""+Match.group(1)+"\",\""+Match.group(2)+"\");\r\n";
|
||||
open("PrepareHTML.full.js","wb").write(FullPrepareHTMLCode.encode("utf-8"));
|
||||
|
||||
# Concatenate all the scripts together
|
||||
SourceFileList=[
|
||||
"PrepareHTML.full.js",
|
||||
"SetMarkdeepMode.js",
|
||||
"markdeep.min.js",
|
||||
"DisplayMarkdeepOutput.js",
|
||||
"InvokeMathJax.js"
|
||||
];
|
||||
OutputCode="\r\n\r\n".join(["// "+SourceFile+"\r\n\r\n"+open(SourceFile,"rb").read().decode("utf-8") for SourceFile in SourceFileList]);
|
||||
OutputFile=open("MarkdeepUtility.js","wb");
|
||||
OutputFile.write(OutputCode.encode("utf-8"));
|
||||
OutputFile.close();
|
||||
print("Done.");
|
||||
@@ -0,0 +1,6 @@
|
||||
BodyHTML=document.body.innerHTML;
|
||||
BeginTag="<!-- MARKDEEP_BEGIN -->";
|
||||
EndTag="<!-- MARKDEEP_END -->";
|
||||
BodyHTML=BodyHTML.slice(BodyHTML.indexOf(BeginTag)+BeginTag.length,BodyHTML.lastIndexOf(EndTag));
|
||||
document.getElementById("BodyDisplayBox").textContent=BodyHTML;
|
||||
document.head.innerHTML=FullDocumentHead;
|
||||
@@ -0,0 +1,4 @@
|
||||
var MathjaxScript=document.createElement("script");
|
||||
MathjaxScript.type="text/javascript";
|
||||
MathjaxScript.src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
|
||||
document.head.appendChild(MathjaxScript);
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,102 @@
|
||||
/** Converts <>&" to their HTML escape sequences */
|
||||
function escapeHTMLEntities(str) {
|
||||
return String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
}
|
||||
|
||||
|
||||
/** Restores the original source string's '<' and '>' as entered in
|
||||
the document, before the browser processed it as HTML. There is no
|
||||
way in an HTML document to distinguish an entity that was entered
|
||||
as an entity.*/
|
||||
function unescapeHTMLEntities(str) {
|
||||
// Process & last so that we don't recursively unescape
|
||||
// escaped escape sequences.
|
||||
return str.
|
||||
replace(/</g, '<').
|
||||
replace(/>/g, '>').
|
||||
replace(/"/g, '"').
|
||||
replace(/'/g, "'").
|
||||
replace(/–/g, '--').
|
||||
replace(/—/g, '---').
|
||||
replace(/&/g, '&');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
\param node A node from an HTML DOM
|
||||
|
||||
\return A String that is a very good reconstruction of what the
|
||||
original source looked like before the browser tried to correct
|
||||
it to legal HTML.
|
||||
*/
|
||||
function nodeToMarkdeepSource(node, leaveEscapes) {
|
||||
var source = node.innerHTML;
|
||||
|
||||
// Markdown uses <john@bar.com> e-mail syntax, which HTML parsing
|
||||
// will try to close by inserting the matching close tags at the end of the
|
||||
// document. Remove anything that looks like that and comes *after*
|
||||
// the first fallback style.
|
||||
source = source.replace(/(?:<style class="fallback">[\s\S]*?<\/style>[\s\S]*)<\/\S+@\S+\.\S+?>/gim, '');
|
||||
|
||||
// Remove artificially inserted close tags
|
||||
source = source.replace(/<\/h?ttps?:.*>/gi, '');
|
||||
|
||||
// Now try to fix the URLs themselves, which will be
|
||||
// transformed like this: <http: casual-effects.com="" markdeep="">
|
||||
source = source.replace(/<(https?): (.*?)>/gi, function (match, protocol, list) {
|
||||
|
||||
// Remove any quotes--they wouldn't have been legal in the URL anyway
|
||||
var s = '<' + protocol + '://' + list.replace(/=""\s/g, '/');
|
||||
|
||||
if (s.substring(s.length - 3) === '=""') {
|
||||
s = s.substring(0, s.length - 3);
|
||||
}
|
||||
|
||||
// Remove any lingering quotes (since they
|
||||
// wouldn't have been legal in the URL)
|
||||
s = s.replace(/"/g, '');
|
||||
|
||||
return s + '>';
|
||||
});
|
||||
|
||||
// Remove the "fallback" style tags
|
||||
source = source.replace(/<style class=["']fallback["']>.*?<\/style>/gmi, '');
|
||||
|
||||
source = unescapeHTMLEntities(source);
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
// $ (FULL_DOCUMENT_HEAD) is replaced by the contents of the <head> found in
|
||||
// PreviewBlogPage.htm. This document head will overwrite whatever Markdeep does to
|
||||
// the head at the very end.
|
||||
FullDocumentHead='\
|
||||
$(FULL_DOCUMENT_HEAD)\
|
||||
';
|
||||
|
||||
// This code is placed at the beginning of the body before the Markdeep code.
|
||||
// $ (DOCUMENT_BODY_PREFIX) is everything in the body of PreviewBlogPage.htm up to
|
||||
// $ (ARTICLE_HTML_CODE).
|
||||
DocumentBodyPrefix='\
|
||||
$(DOCUMENT_BODY_PREFIX)\
|
||||
<!-- MARKDEEP_BEGIN -->\
|
||||
<pre class="markdeep">\
|
||||
';
|
||||
// This code is placed at the end of the body after the Markdeep code.
|
||||
// $ (DOCUMENT_BODY_SUFFIX) is everything in the body of PreviewBlogPage.htm after
|
||||
// $ (ARTICLE_HTML_CODE).
|
||||
DocumentBodySuffix='\
|
||||
</pre>\
|
||||
<!-- MARKDEEP_END -->\
|
||||
<div>Document <body> code:<br/>\
|
||||
<textarea cols="40" rows="10" id="BodyDisplayBox"></textarea></div>\
|
||||
$(DOCUMENT_BODY_SUFFIX)\
|
||||
';
|
||||
|
||||
// Get the full Markdeep code from the .md.html file without the script invocation
|
||||
MarkdeepCode=nodeToMarkdeepSource(document.body);
|
||||
MarkdeepCode=MarkdeepCode.slice(0,MarkdeepCode.lastIndexOf("<script"));
|
||||
// Bring it into a form where it can be pasted into an HTML document
|
||||
SanitizedMarkdeepCode=escapeHTMLEntities(MarkdeepCode);
|
||||
// Surround it by the prefix and suffix code and set that as body code
|
||||
document.body.innerHTML=DocumentBodyPrefix+SanitizedMarkdeepCode+DocumentBodySuffix;
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
window.markdeepOptions={mode:"html"};
|
||||
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta charset="UTF-8">
|
||||
<body>
|
||||
<script>window.markdeepOptions={mode:"script"};</script>
|
||||
<script src="./markdeep.min.js"></script>
|
||||
<div>Document <head> additions:<br/>
|
||||
<textarea cols="80" rows="40" id="HeadDisplayBox"></textarea></div>
|
||||
<script>
|
||||
// Get the complete Markdeep and hljs stylesheet
|
||||
FullStylesheet=window.markdeep.stylesheet();
|
||||
// It should consist of three <style> tags which we pick apart
|
||||
StyleTagList=FullStylesheet.split("<style>");
|
||||
// The second one defines section number, which we do not want, so we
|
||||
// just drop it. The other two are Markdeep and hljs styles.
|
||||
MarkdeepStylesheet="<style>"+StyleTagList[1];
|
||||
HLJSStylesheet="<style>"+StyleTagList[3];
|
||||
// Now lets show the user what we found
|
||||
document.getElementById("HeadDisplayBox").textContent=
|
||||
"<!-- Markdeep styles -->\r\n"
|
||||
+MarkdeepStylesheet
|
||||
+"\r\n\r\n<!-- hljs styles -->\r\n"
|
||||
+HLJSStylesheet
|
||||
+"\r\n\r\n<!-- MathJax invocation -->\r\n<script type=\"text/javascript\" async=\"\" src=\"https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML\">\r\n";
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,6 @@
|
||||
/**See http://casual-effects.com/markdeep for @license and documentation.
|
||||
markdeep.min.js 0.17 (C) 2016 Morgan McGuire
|
||||
highlight.min.js 9.5.0 (C) 2016 Ivan Sagalaev https://highlightjs.org/*/
|
||||
!function(){"use strict";function e(e,t,r){return"<"+e+(r?" "+r:"")+">"+t+"</"+e+">"}function t(e){try{var t=document.createElement("canvas"),r=t.getContext("2d");return r.font="10pt "+e,r.measureText("M").width}catch(e){return 10}}function r(e){return window.markdeepOptions&&void 0!==window.markdeepOptions[e]?window.markdeepOptions[e]:void 0!==Z[e]?Z[e]:void console.warn('Illegal option: "'+e+'"')}function n(t,n){if(r("showURLs")){var a=" {\xa0"+t+"\xa0}";return n?e(n,a):a}return""}function a(e){return r("lang").keyword[e]||e}function i(e){return(e+"").rp(/&/g,"&").rp(/</g,"<").rp(/>/g,">").rp(/"/g,""")}function o(e){return e.rp(/</g,"<").rp(/>/g,">").rp(/"/g,'"').rp(/'/g,"'").rp(/–/g,"\u2013").rp(/—/g,"---").rp(/&/g,"&")}function s(e){return e.rp(/<.*?>/g,"")}function c(e){return encodeURI(e.rp(/\s/g,"").toLowerCase())}function l(){for(var t="",r=1;r<=6;++r){t+="h"+r+"::before {\ncontent:";for(var n=1;n<=r;++n)t+="counter(h"+n+') "'+(n<r?".":" ")+'"';t+=";\ncounter-increment: h"+r+";margin-right:10px}"}return e("style",t)}function u(e,t){var r=e.innerHTML;return r=r.rp(/(?:<style class="fallback">[\s\S]*?<\/style>[\s\S]*)<\/\S+@\S+\.\S+?>/gim,""),r=r.rp(/<\/h?ttps?:.*>/gi,""),r=r.rp(/<(https?): (.*?)>/gi,function(e,t,r){var n="<"+t+"://"+r.rp(/=""\s/g,"/");return'=""'===n.ss(n.length-3)&&(n=n.ss(0,n.length-3)),n=n.rp(/"/g,""),n+">"}),r=r.rp(/<style class=["']fallback["']>.*?<\/style>/gim,""),r=o(r)}function d(e){function t(){l=e.indexOf("\n",i)+1,u=u||/\S/.test(e.ss(i,i+o)),d=d||/\S/.test(e.ss(i+s+1,l))}for(var r={p:e,q:"",s:"",u:""},n=e.indexOf($);n>=0;n=e.indexOf($,n+$.length)){var a,i=J(0,e.lastIndexOf("\n",n))+1,o=n-i;for(a=n+$.length;e[a]===I;++a);var s=a-i-1,c={p:e.ss(0,i),q:"",s:"center",u:e.ss(i,n).rp(/[ \t]+$/," ")},l=0,u=!1,d=!1;t();for(var g=!0,p=a;g;){if(i=l,t(),0===i)return r;if(u?c.s="floatright":d&&(c.s="floatleft"),e[i+o]!==I||u&&e[i+s]!==I)g=!1;else{var m;for(m=o;m<s&&e[i+m]===I;++m);var f=i+o,h=i+s;if(!u){var b=e.indexOf("\n",f);b!==-1&&(h=Math.min(h,b))}if(c.u+=e.ss(p,f).rp(/^[ \t]*[ \t]/," ").rp(/[ \t][ \t]*$/," "),m===s)return c.u+=e.ss(i+s+1),c;c.q+=e.ss(f+1,h)+"\n",p=h+1}}}return r}function g(e,t,r,n){var a=t.source,i="[^ \\t\\n"+a+"]",o="("+a+")("+i+".*?(\\n.+?)*?)"+a+"(?![A-Za-z0-9])";return e.rp(RegExp(o,"g"),"<"+r+(n?" "+n:"")+">$2</"+r+">")}function p(t,r){function n(e){return e.trim().rp(/^\||\|$/g,"")}var a=/(?:\n\|?[ \t\S]+?(?:\|[ \t\S]+?)+\|?(?=\n))/.source,i=/\n\|? *\:?-+\:?(?: *\| *\:?-+\:?)+ *\|?(?=\n)/.source,o=/\n[ \t]*\[[^\n\|]+\][ \t]*(?=\n)/.source,s=RegExp(a+i+a+"+("+o+")?","g");return t=t.rp(s,function(t){var a=t.split("\n"),i="",o=""===a[0]?1:0,s=a[a.length-1].trim();s.length>3&&"["===s[0]&&"]"===s[s.length-1]?(a.pop(),s=s.ss(1,s.length-1)):s=void 0;var c=[];n(a[o+1]).rp(/:?-+:?/g,function(e){var t=":"===e[0],n=":"===e[e.length-1];c.push(r(' style="text-align:'+(t&&n?"center":n?"right":"left")+'"'))});for(var l="th",u=o;u<a.length;++u){var d=n(a[u].trim()),g=0;i+=e("tr","<"+l+c[0]+">"+d.rp(/\|/g,function(){return++g,"</"+l+"><"+l+c[g]+">"})+"</"+l+">")+"\n",u==o&&(++u,l="td")}return i=e("table",i,r('class="table"')),s&&(i=e("div",s,r('class="tablecaption"'))+i),i})}function m(e,t){for(var r=/^\s*\n/.source,n=/[:,]\s*\n/.source,a=RegExp("("+n+"|"+r+")"+/((?:[ \t]*(?:\d+\.|-|\+|\*)(?:[ \t]+.+\n(?:[ \t]*\n)?)+)+)/.source,"gm"),i=!0,o={"+":t('class="plus"'),"-":t('class="minus"'),"*":t('class="asterisk"')},s=t('class="number"');i;)i=!1,e=e.rp(a,function(e,t,r){var n=t,a=[],c={F:-1};for(r.split("\n").forEach(function(e){var t=e.rp(/^\s*/,""),r=e.length-t.length,l=o[t[0]],u=!!l;l=l||s;var d=/^\d+\.[ \t]/.test(t);if(c)if(d||u){if(r!==c.F)if(c.F!==-1&&r<c.F)for(;c&&r<c.F;)a.pop(),n+="\n</li></"+c.tag+">",c=a[a.length-1];else c={F:r,tag:d?"ol":"ul",G:e.ss(0,r)},a.push(c),n+="\n<"+c.tag+">";else c.F!==-1&&(n+="\n</li>");c?n+="\n"+c.G+"<li "+l+">"+t.rp(/^(\d+\.|-|\+|\*) /,""):(n+="\n"+e,i=!0)}else n+="\n"+c.G+e;else n+="\n"+e}),c=a.pop();c;c=a.pop())n+="</li></"+c.tag+">\n";return n});return e}function f(t,n){var i=/^(?:[^\|<>\s-\+\*\d].*[12]\d{3}(?!\d).*?|(?:[12]\d{3}(?!\.).*\d.*?)|(?:\d{1,3}(?!\.).*[12]\d{3}(?!\d).*?))/.source,o="("+i+"):"+/[ \t]+([^ \t\n].*)\n/.source,s=/(?:[ \t]*\n)?((?:[ \t]+.+\n(?:[ \t]*\n){0,3})*)/.source,c=o+s,l=RegExp(c,"gm"),u=n('valign="top"'),d=n('style="width:100px;padding-right:15px" rowspan="2"'),g=n('style="padding-bottom:25px"'),p=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"].map(a),m=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"].map(a),f=m.join("|"),h=["January","February","March","April","May","June","July","August","September","October","November","December"].map(a),b=9;try{var x=0;t=t.rp(RegExp("("+c+"){2,}","gm"),function(t){++x;var a=[],i=!1;t.rp(l,function(t,r,o,s){var c="",l="",h="",y=!1;r=r.trim(),"("===r[0]&&")"===r.slice(-1)&&(r=r.slice(1,-1),y=!0);var v=r.match(RegExp("([0123]?\\d)\\D+([01]?\\d|"+f+")\\D+([12]\\d{3})","i"));if(vLine truncated
|
||||
re+=Y.I(ne,ae)?"red;":" "===Y(ne,ae)?"gray;opacity:0.05":"blue;",re+='"/>\n';re+="</g>\n"}if(re+=ee.toSVG(),re+=te.toSVG(),!D){re+='<g transform="translate(0,0)">';for(var ae=0;ae<Y.height;++ae)for(var ne=0;ne<Y.width;++ne){var ie=Y(ne,ae);/[\u2B22\u2B21]/.test(ie)?re+='<text text-anchor="middle" x="'+ne*S+'" y="'+(4+ae*S*I)+'" style="font-size:20.5px">'+i(ie)+"</text>":" "===ie||Y.I(ne,ae)||(re+='<text text-anchor="middle" x="'+ne*S+'" y="'+(4+ae*S*I)+'">'+i(ie)+"</text>")}re+="</g>"}if(B){re+='<g transform="translate(2,2)">\n';for(var ne=0;ne<Y.width;++ne)for(var ae=0;ae<Y.height;++ae){var ie=Y(ne,ae);" "!==ie&&(re+='<text text-anchor="middle" x="'+ne*S+'" y="'+(4+ae*S*I)+'" style="fill:#F00;font-family:Menlo,monospace;font-size:12px;text-align:center">'+i(ie)+"</text>")}re+="</g>"}return re+="</g></svg>",re=re.rp(RegExp(T,"g"),"o")}function N(e){return e.search(/markdeep\S*?\.js$/i)!==-1}function k(e){return Array.prototype.slice.call(e)}function j(){parent.postMessage(ce+"="+re,"*")}function A(e){return e&&e.ss(0,e.lastIndexOf("/")+1)}var T='<div class="markdeepFooter"><i>formatted by <a href="http://casual-effects.com/markdeep" style="color:#999">Markdeep 0.16 </a></i><div style="display:inline-block;font-size:13px;font-family:\'Times New Roman\',serif;vertical-align:middle;transform:translate(-3px,-1px)rotate(135deg);">✒</div></div>',S=String.prototype;S.rp=S.replace,S.ss=S.substring,S.regexIndexOf=function(e,t){var r=this.ss(t||0).search(e);return r>=0?r+(t||0):r};var E=!1,B=E,D=B,L=2,I="*",$=Array(6).join(I);!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(/[&<>]/gm,function(e){return S[e]})}function r(e){return e.nodeName.toLowerCase()}function n(e,t){var r=e&&e.exec(t);return r&&0===r.index}function a(e){return N.test(e)}function i(e){var t,r,n,i,o=e.className+" ";if(o+=e.parentNode?e.parentNode.className:"",r=k.exec(o))return v(r[1])?r[1]:"no-highlight";for(o=o.split(/\s+/),t=0,n=o.length;n>t;t++)if(i=o[t],a(i)||v(i))return i}function o(e,t){var r,n={};for(r in e)n[r]=e[r];if(t)for(r in t)n[r]=t[r];return n}function s(e){var t=[];return function e(n,a){for(var i=n.firstChild;i;i=i.nextSibling)3===i.nodeType?a+=i.nodeValue.length:1===i.nodeType&&(t.push({event:"start",offset:a,node:i}),a=e(i,a),r(i).match(/br|hr|img|input/)||t.push({event:"stop",offset:a,node:i}));return a}(e,0),t}function c(e,n,a){function i(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset<n[0].offset?e:n:"start"===n[0].event?e:n:e.length?e:n}function o(e){function n(e){return" "+e.nodeName+'="'+t(e.value)+'"'}u+="<"+r(e)+_.map.call(e.attributes,n).join("")+">"}function s(e){u+="</"+r(e)+">"}function c(e){("start"===e.event?o:s)(e.node)}for(var l=0,u="",d=[];e.length||n.length;){var g=i();if(u+=t(a.substr(l,g[0].offset-l)),l=g[0].offset,g===e){d.reverse().forEach(s);do c(g.splice(0,1)[0]),g=i();while(g===e&&g.length&&g[0].offset===l);d.reverse().forEach(o)}else"start"===g[0].event?d.push(g[0].node):d.pop(),c(g.splice(0,1)[0])}return u+t(a.substr(l))}function l(e){function t(e){return e&&e.source||e}function r(r,n){return RegExp(t(r),"m"+(e.cI?"i":"")+(n?"g":""))}function n(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK){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]?+r[1]:1]})};"string"==typeof a.k?c("keyword",a.k):w(a.k).forEach(function(e){c(e,a.k[e])}),a.k=s}a.lR=r(a.l||/\w+/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=r(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=r(a.e)),a.tE=t(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=r(a.i)),null==a.r&&(a.r=1),a.c||(a.c=[]);var l=[];a.c.forEach(function(e){e.v?e.v.forEach(function(t){l.push(o(e,t))}):l.push("self"===e?a:e)}),a.c=l,a.c.forEach(function(e){n(e,a)}),a.starts&&n(a.starts,i);var u=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(t).filter(Boolean);a.t=u.length?r(u.join("|"),!0):{exec:function(){return null}}}}n(e)}function u(e,r,a,i){function o(e,t){for(var r=0;r<t.c.length;r++)if(n(t.c[r].bR,e))return t.c[r]}function s(e,t){if(n(e.eR,t)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?s(e.parent,t):void 0}function c(e,t){return!a&&n(t.iR,e)}function g(e,t){var r=y.cI?t[0].toLowerCase():t[0];return e.k.hasOwnProperty(r)&&e.k[r]}function p(e,t,r,n){var a=n?"":T.classPrefix,i='<span class="'+a,o=r?"":A;return i+=e+'">',i+t+o}function m(){var e,r,n,a;if(!w.k)return t(k);for(a="",r=0,w.lR.lastIndex=0,n=w.lR.exec(k);n;)a+=t(k.substr(r,n.index-r)),e=g(w,n),e?(j+=e[1],a+=p(e[0],t(n[0]))):a+=t(n[0]),r=w.lR.lastIndex,n=w.lR.exec(k);return a+t(k.substr(r))}function f(){var e="string"==typeof w.sL;if(e&&!C[w.sL])return t(k);var r=e?u(w.sL,k,!0,M[w.sL]):d(k,w.sL.length?w.sLLine truncated
|
||||
cN:"number",b:n,r:0};return{aliases:["jsp"],k:r,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:"("+t+"\\s+)+"+e.UIR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:r,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"params",b:/\(/,e:/\)/,k:r,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},a,{cN:"meta",b:"@[A-Za-z]+"}]}}),hljs.g("tex",function(e){var t={cN:"tag",b:/\\/,r:0,c:[{cN:"name",v:[{b:/[a-zA-Z\u0430-\u044f\u0410-\u044f]+[*]?/},{b:/[^a-zA-Z\u0430-\u044f\u0410-\u044f0-9]/}],starts:{eW:!0,r:0,c:[{cN:"string",v:[{b:/\[/,e:/\]/},{b:/\{/,e:/\}/}]},{b:/\s*=\s*/,eW:!0,r:0,c:[{cN:"number",b:/-?\d*\.?\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?/}]}]}}]};return{c:[t,{cN:"formula",c:[t],r:0,v:[{b:/\$\$/,e:/\$\$/},{b:/\$/,e:/\$/}]},e.C("%","$",{r:0})]}}),hljs.g("python",function(e){var t={cN:"meta",b:/^(>>>|\.\.\.) /},r={cN:"string",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[t],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[t],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},e.ASM,e.QSM]},n={cN:"number",r:0,v:[{b:e.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:e.CNR+"[lLjJ]?"}]},a={cN:"params",b:/\(/,e:/\)/,c:["self",t,n,r]};return{aliases:["py","gyp"],k:{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"},i:/(<\/|->|\?)/,c:[t,n,r,e.HCM,{v:[{cN:"function",bK:"def",r:10},{cN:"class",bK:"class"}],e:/:/,i:/[${=;\n,]/,c:[e.UTM,a,{b:/->/,eW:!0,k:"None"}]},{cN:"meta",b:/^[\t ]*@/,e:/$/},{b:/\b(print|exec)\(/}]}}),hljs.g("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]}]}]}}),hljs.g("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}}]}}),hljs.g("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"},n={cN:"doctag",b:"@[A-Za-z]+"},a={b:"#<",e:">"},i=[e.C("#","$",{c:[n]}),e.C("^\\=begin","^\\=end",{c:[n],r:10}),e.C("^__END__","\\n$")],o={cN:"subst",b:"#\\{",e:"}",k:r},s={cN:"string",c:[e.BE,o],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/}]},c={cN:"params",b:"\\(",e:"\\)",endsParent:!0,k:r},l=[s,a,{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}),c].concat(i)},{b:e.IR+"::"},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":(?!\\s)",c:[s,{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+")\\s*",c:[a,{cN:"regexp",c:[e.BE,o],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);o.c=l,c.c=l;var u="[>?]>",d="[\\w#]+\\(\\w+\\):\\d+:\\d+>",g="(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>",p=[{b:/^\s*=>/,starts:{e:"$",c:l}},{cN:"meta",b:"^("+u+"|"+d+"|"+g+")",starts:{e:"$",c:l}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,i:/\/\*/,c:i.concat(p).concat(l)}}),hljs.g("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 aLine truncated
|
||||
Reference in new issue
Block a user