Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

minified doc/

  • Loading branch information...
commit f7dfe6b54b933ddbe18d315222d057d56d9ca81b 1 parent ec86fcd
@satyr authored
View
1  .gitignore
@@ -2,3 +2,4 @@ t.*
test/*.js
*#
extras/*.raw.js
+doc/*.raw.js
View
62 Cokefile
@@ -14,6 +14,18 @@ run = (args) ->
proc.stderr.on \data, say
proc .on \exit, -> process.exit it if it
+slobber = (path, code) ->
+ spit path, code
+ say '* ' + path
+
+minify = ->
+ {parser, uglify} = require \uglify-js
+ ast = parser.parse it
+ ast = uglify.ast_mangle ast
+ ast = uglify.ast_squeeze ast
+ uglify.gen_code ast
+
+
option \prefix 'set the installation prefix for `coke install`' \DIR
task \install 'install Coco into /usr/local (or --prefix)' (options) ->
@@ -34,21 +46,14 @@ task \install 'install Coco into /usr/local (or --prefix)' (options) ->
say if err then stderr.trim() else tint \done
-sources = ->
- ext = /\.co$/i
- \src/ + file if ext.test file for file of dir \src
-
-coreSources = ->
- "src/#{src}.co" for src of <[ coco grammar lexer nodes rewriter ]>
-
-docs = <[ src/doc.co src/lang-co.co ]>
-webs = docs.concat \src/mode-coco.co
+docs = <[ doc.co lang-co.co ]>
+webs = docs.concat \mode-coco.co
task \build 'build the Coco language from source' ->
- run [\-bco \lib; ...sources().filter -> it not of webs]
-
-task \build:doc 'build doc tools' ->
- run <[ -co doc ]>.concat docs
+ ext = /\.co$/
+ sources = for file of dir \src
+ \src/ + file if ext.test file and file not of webs
+ run [\-bco \lib]concat sources
task \build:full 'rebuild the source twice, and run the tests' ->
exec 'bin/coke build && bin/coke build && bin/coke test'
@@ -64,15 +69,22 @@ task \build:parser 'rebuild the Jison parser (run "build" first)' ->
.replace /return parser;[^]+/ ''
spit \lib/parser.js src
-task \build:browser 'rebuild extras/*.js' ->
+task \build:doc 'rebuild doc tools' ->
+ <- docs.forEach
+ name = it.slice 0 -3; js = require(\./lib/coco)compile slurp \src/ + it
+ slobber "doc/#{name}.raw.js" js
+ slobber "doc/#{name}.js" minify js
+
+task \build:browser 'rebuild extras' ->
Coco = require \./lib/coco
- xspit \mode-coco.raw.js js = Coco.compile slurp \src/mode-coco.co
- xspit \mode-coco.js ug js
+ js = Coco.compile slurp \src/mode-coco.co
+ slobber \extras/mode-coco.raw.js js
+ slobber \extras/mode-coco.js minify js
co = ''
for name of <[ rewriter lexer nodes coco ]>
code = slurp("src/#{name}.co").replace /^./mg ' $&'
co += "do (exports = require'./#{name}' = {}) ->\n#{code}\n void\n"
- xspit \coco.raw.js js = """
+ slobber \extras/coco.raw.js js = """
this.Coco = function(){
function require(path){ return require[path] }
var exports = require['./parser'] = {}; #{ slurp \lib/parser.js }
@@ -83,27 +95,19 @@ task \build:browser 'rebuild extras/*.js' ->
this.WSH && function(){\n#{ slurp \lib/wsh.js }\n}()
this.Coco
"""
- xspit \coco.js """
+ slobber \extras/coco.js """
// Coco #{Coco.VERSION}
// Copyright 2011, Jeremy Ashkenas + Satoshi Murakami
// Released under the MIT License
http://satyr.github.com/coco
- #{ ug js };
+ #{ minify js };
"""
invoke \test:browser
-function xspit (name, code) ->
- spit path = \extras/ + name, code
- say '* ' + path
-
-function ug ->
- {parser, uglify} = require \uglify-js
- ast = parser.parse it
- ast = uglify.ast_mangle ast
- ast = uglify.ast_squeeze ast
- uglify.gen_code ast
+coreSources = ->
+ "src/#{src}.co" for src of <[ coco grammar lexer nodes rewriter ]>
task \bench 'quick benchmark of compilation time' ->
Lexer = require \./lib/lexer
View
97 doc/doc.js
@@ -1,96 +1 @@
-(function(){
- var title, doc, nav, htms, sdcv, __importAll = function(obj, src){ for (var key in src) obj[key] = src[key]; return obj };
- title = document.title;
- doc = document.getElementById('doc') || lmn('div', {
- id: 'doc'
- });
- nav = document.getElementById('nav') || (function(){
- var h, co, _i, _ref, _len;
- h = '<div class=pointee>&#x2935;</div>';
- if (title) {
- h += "<h1>" + title + "</h1>";
- }
- for (_i = 0, _len = (_ref = sources).length; _i < _len; ++_i) {
- co = _ref[_i];
- h += co ? "<li><a href=#" + co + ">" + co + "</a>" : '<p class=spacer>';
- }
- h += '<li class=index><a href=#>#</a>';
- return lmn('ul', {
- id: 'nav',
- innerHTML: h
- });
- }());
- htms = {
- __proto__: null
- };
- sdcv = new Showdown.converter;
- (this.onhashchange = function(){
- var page, name, that, xhr;
- if (!(page = /^\D+(?=(\d*)$)/.exec(location.hash.slice(1)))) {
- document.title = title;
- nav.className = doc.innerHTML = '';
- return;
- }
- nav.className = 'menu';
- doc.innerHTML = '...';
- name = page[0];
- if (that = htms[name]) {
- return load(page, that);
- }
- xhr = new XMLHttpRequest;
- xhr.open('GET', name !== 'Cokefile' ? name + '.co' : name, true);
- if (typeof xhr.overrideMimeType == 'function') {
- xhr.overrideMimeType('text/plain');
- }
- xhr.onreadystatechange = function(){
- if (xhr.readyState === 4) {
- return load(page, htms[name] = build(name, xhr.responseText));
- }
- };
- return xhr.send(null);
- })();
- function lmn(name, attrs){
- return document.body.appendChild(__importAll(document.createElement(name), attrs));
- }
- function load(_arg, innerHTML){
- var name, sect;
- name = _arg[0], sect = _arg[1];
- doc.innerHTML = innerHTML;
- document.title = name + (title && ' - ' + title);
- if (sect) {
- document.getElementById(sect).scrollIntoView();
- }
- return prettyPrint();
- }
- function build(name, source){
- var i, code, comment, htm, re, line, br, that, _i, _ref, _len;
- htm = comment = code = i = '';
- re = /^[^\n\S]*#(?![!{]) ?(.*)/;
- for (_i = 0, _len = (_ref = source.split('\n')).length; _i < _len; ++_i) {
- line = _ref[_i];
- if (!line) {
- br = true;
- code && (code += '\n');
- continue;
- }
- if (that = re.exec(line)) {
- if (code || comment && br) {
- htm += block(name, comment, code, i++);
- comment = code = '';
- }
- comment += that[1] + '\n';
- } else {
- code += line + '\n';
- }
- br = false;
- }
- if (comment || code) {
- htm += block(name, comment, code, i);
- }
- return "<h1>" + name + "</h1>" + htm + "<br clear=both>";
- }
- function block(name, comment, code, i){
- code && (code = "<pre class=\"code prettyprint lang-co\"\n >" + code.replace(/&/g, '&amp;').replace(/</g, '&lt;') + "</pre>");
- return "<div id=" + i + " class=block><div class=comment\n ><a class=anchor href=#" + name + "" + i + ">#" + i + "</a\n >" + sdcv.makeHtml(comment) + "</div\n >" + code + "</div>";
- }
-}).call(this);
+(function(){function j(a,b,c,d){c&&(c='<pre class="code prettyprint lang-co"\n >'+c.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"</pre>");return"<div id="+d+" class=block><div class=comment\n ><a class=anchor href=#"+a+""+d+">#"+d+"</a\n >"+e.makeHtml(b)+"</div\n >"+c+"</div>"}function i(a,b){var c,d,e,f,g,h,i,k,l,m,n;f=e=d=c="",g=/^[^\n\S]*#(?![!{]) ?(.*)/;for(l=0,n=(m=b.split("\n")).length;l<n;++l){h=m[l];if(!h){i=!0,d&&(d+="\n");continue}if(k=g.exec(h)){if(d||e&&i)f+=j(a,e,d,c++),e=d="";e+=k[1]+"\n"}else d+=h+"\n";i=!1}if(e||d)f+=j(a,e,d,c);return"<h1>"+a+"</h1>"+f+"<br clear=both>"}function h(c,d){var e,f;e=c[0],f=c[1],b.innerHTML=d,document.title=e+(a&&" - "+a),f&&document.getElementById(f).scrollIntoView();return prettyPrint()}function g(a,b){return document.body.appendChild(f(document.createElement(a),b))}var a,b,c,d,e,f=function(a,b){for(var c in b)a[c]=b[c];return a};a=document.title,b=document.getElementById("doc")||g("div",{id:"doc"}),c=document.getElementById("nav")||function(){var b,c,d,e,f;b="<div class=pointee>&#x2935;</div>",a&&(b+="<h1>"+a+"</h1>");for(d=0,f=(e=sources).length;d<f;++d)c=e[d],b+=c?"<li><a href=#"+c+">"+c+"</a>":"<p class=spacer>";b+="<li class=index><a href=#>#</a>";return g("ul",{id:"nav",innerHTML:b})}(),d={"__proto__":null},e=new Showdown.converter,(this.onhashchange=function(){var e,f,g,j;if(!(e=/^\D+(?=(\d*)$)/.exec(location.hash.slice(1))))document.title=a,c.className=b.innerHTML="";else{c.className="menu",b.innerHTML="...",f=e[0];if(g=d[f])return h(e,g);j=new XMLHttpRequest,j.open("GET",f!=="Cokefile"?f+".co":f,!0),typeof j.overrideMimeType=="function"&&j.overrideMimeType("text/plain"),j.onreadystatechange=function(){if(j.readyState===4)return h(e,d[f]=i(f,j.responseText))};return j.send(null)}})()}).call(this)
View
23 doc/lang-co.js
@@ -1,22 +1 @@
-(function(){
- var tint, ident, kwend, hashbraces, regexes;
- tint = function(ext, shortcuts, fallthroughs){
- var rule, _i, _len;
- for (_i = 0, _len = shortcuts.length; _i < _len; ++_i) {
- rule = shortcuts[_i];
- if (rule.length < 4) {
- rule.splice(2, 0, 0);
- }
- }
- return PR.registerLangHandler(PR.createSimpleLexer(shortcuts, fallthroughs), [ext]);
- };
- ident = '(?:[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*)';
- kwend = '(?![$\\w\\x7f-\\uffff])';
- tint('co', [['str', /^'(?:''[\S\s]*?''|[^\\']*(?:\\.[^\\']*)*)'/, '\''], ['lang-co-qq', /(^"(?:""[\S\s]*?""|[^\\"]*(?:\\.[^\\"]*)*)")/, '"'], ['lang-co-qr', /(^\/{3}[\S\s]*?\/{3}(?:\?|[imgy]{0,4}))/, '/'], ['lang-co-at', RegExp('(^@@?' + ident + '?)'), '@'], ['com', /^#.*/, '#'], ['typ', /^(?:0x[\da-f]+|[1-9]\d?r[\da-z]+|(?:\d+(?:\.\d+)?)(?:e[+-]?\d+)?[a-z_]*)/i, '0123456789'], ['lang-js', /^`([^\\`]*(?:\\.[^\\`]*)*)`/, '`']], [['str', /^\\\S[^\s,;)}\]]*/], ['com', /^\/\*[\S\s]*\*\//], ['pln', RegExp('^(?:\\.{3}|(?:[?~]?\\.(?:\\s*(?:[-+*/%&|^:]|>>>?|<<)?=)?\\s*|[)}\\]]|::)' + ident + '?|' + ident + '[^\\n\\S]*:(?!:))')], ['kwd', RegExp('^(?:t(?:ry|h(?:row|en)|ypeof)|f(?:or(?:[^\\n\\S]+(?:own|ever))?|inally|unction)|n(?:ew|ot)|c(?:ontinue|a(?:se|tch)|lass)|i(?:[fs]|n(?:stanceof)?|mport(?:[^\\n\\S]+all)?)|e(?:lse|xtends)|d(?:e(?:fault|lete|bugger)|o)|un(?:less|til)|o[fr]|return|break|while|switch|and)' + kwend)], ['typ', RegExp('^(?:true|false|null|void)' + kwend)], ['ctx', RegExp('^(?:t(?:h(?:is|at)|o|il)|f(?:rom|allthrough)|it|arguments|eval|super|by)' + kwend)], ['glb', RegExp('^(?:Array|Boolean|Date|Error|Function|JSON|Math|Number|Object|RegExp|S(?:tring|yntaxError)|TypeError|is(?:NaN|Finite)|parse(?:Int|Float)|(?:en|de)codeURI(?:Component)?)' + kwend)], ['var', RegExp('^' + ident)], ['str', /^<\[[\S\s]*?]>/], ['lang-co-r', /^[^\/](\/(?![\s\/])[^[\/\n\\]*(?:(?:\\.|\[[^\]\n\\]*(?:\\.[^\]\n\\]*)*\])[^[\/\n\\]*)*\/[imgy]{0,4})(?!\d)/]]);
- hashbraces = ['lang-co', /^#({[\S\s]*?})/, '#'];
- regexes = ['lit', /^[\S\s]+?/];
- tint('co-qq', [hashbraces], [['str', /^[\S\s]+?/]]);
- tint('co-qr', [hashbraces], [['com', /^\s#(?!{).*/], regexes]);
- tint('co-r', [], [regexes]);
- tint('co-at', [['ctx', /^@+/, '@']], []);
-}).call(this);
+(function(){var a,b,c,d,e;a=function(a,b,c){var d,e,f;for(e=0,f=b.length;e<f;++e)d=b[e],d.length<4&&d.splice(2,0,0);return PR.registerLangHandler(PR.createSimpleLexer(b,c),[a])},b="(?:[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*)",c="(?![$\\w\\x7f-\\uffff])",a("co",[["str",/^'(?:''[\S\s]*?''|[^\\']*(?:\\.[^\\']*)*)'/,"'"],["lang-co-qq",/(^"(?:""[\S\s]*?""|[^\\"]*(?:\\.[^\\"]*)*)")/,'"'],["lang-co-qr",/(^\/{3}[\S\s]*?\/{3}(?:\?|[imgy]{0,4}))/,"/"],["lang-co-at",RegExp("(^@@?"+b+"?)"),"@"],["com",/^#.*/,"#"],["typ",/^(?:0x[\da-f]+|[1-9]\d?r[\da-z]+|(?:\d+(?:\.\d+)?)(?:e[+-]?\d+)?[a-z_]*)/i,"0123456789"],["lang-js",/^`([^\\`]*(?:\\.[^\\`]*)*)`/,"`"]],[["str",/^\\\S[^\s,;)}\]]*/],["com",/^\/\*[\S\s]*\*\//],["pln",RegExp("^(?:\\.{3}|(?:[?~]?\\.(?:\\s*(?:[-+*/%&|^:]|>>>?|<<)?=)?\\s*|[)}\\]]|::)"+b+"?|"+b+"[^\\n\\S]*:(?!:))")],["kwd",RegExp("^(?:t(?:ry|h(?:row|en)|ypeof)|f(?:or(?:[^\\n\\S]+(?:own|ever))?|inally|unction)|n(?:ew|ot)|c(?:ontinue|a(?:se|tch)|lass)|i(?:[fs]|n(?:stanceof)?|mport(?:[^\\n\\S]+all)?)|e(?:lse|xtends)|d(?:e(?:fault|lete|bugger)|o)|un(?:less|til)|o[fr]|return|break|while|switch|and)"+c)],["typ",RegExp("^(?:true|false|null|void)"+c)],["ctx",RegExp("^(?:t(?:h(?:is|at)|o|il)|f(?:rom|allthrough)|it|arguments|eval|super|by)"+c)],["glb",RegExp("^(?:Array|Boolean|Date|Error|Function|JSON|Math|Number|Object|RegExp|S(?:tring|yntaxError)|TypeError|is(?:NaN|Finite)|parse(?:Int|Float)|(?:en|de)codeURI(?:Component)?)"+c)],["var",RegExp("^"+b)],["str",/^<\[[\S\s]*?]>/],["lang-co-r",/^[^\/](\/(?![\s\/])[^[\/\n\\]*(?:(?:\\.|\[[^\]\n\\]*(?:\\.[^\]\n\\]*)*\])[^[\/\n\\]*)*\/[imgy]{0,4})(?!\d)/]]),d=["lang-co",/^#({[\S\s]*?})/,"#"],e=["lit",/^[\S\s]+?/],a("co-qq",[d],[["str",/^[\S\s]+?/]]),a("co-qr",[d],[["com",/^\s#(?!{).*/],e]),a("co-r",[],[e]),a("co-at",[["ctx",/^@+/,"@"]],[])}).call(this)
View
425 doc/showdown.js
@@ -1,419 +1,6 @@
-/*
- A A L Source code at:
- T C A <http://www.attacklab.net/>
- T K B
-*/
-
-var Showdown={};
-Showdown.converter=function(){
-var _1;
-var _2;
-var _3;
-var _4=0;
-this.makeHtml=function(_5){
-_1=new Array();
-_2=new Array();
-_3=new Array();
-_5=_5.replace(/~/g,"~T");
-_5=_5.replace(/\$/g,"~D");
-_5=_5.replace(/\r\n/g,"\n");
-_5=_5.replace(/\r/g,"\n");
-_5="\n\n"+_5+"\n\n";
-_5=_6(_5);
-_5=_5.replace(/^[ \t]+$/mg,"");
-_5=_7(_5);
-_5=_8(_5);
-_5=_9(_5);
-_5=_a(_5);
-_5=_5.replace(/~D/g,"$$");
-_5=_5.replace(/~T/g,"~");
-return _5;
-};
-var _8=function(_b){
-var _b=_b.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|\Z)/gm,function(_c,m1,m2,m3,m4){
-m1=m1.toLowerCase();
-_1[m1]=_11(m2);
-if(m3){
-return m3+m4;
-}else{
-if(m4){
-_2[m1]=m4.replace(/"/g,"&quot;");
-}
-}
-return "";
-});
-return _b;
-};
-var _7=function(_12){
-_12=_12.replace(/\n/g,"\n\n");
-var _13="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del";
-var _14="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math";
-_12=_12.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,_15);
-_12=_12.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,_15);
-_12=_12.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,_15);
-_12=_12.replace(/(\n\n[ ]{0,3}<!(--[^\r]*?--\s*)+>[ \t]*(?=\n{2,}))/g,_15);
-_12=_12.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,_15);
-_12=_12.replace(/\n\n/g,"\n");
-return _12;
-};
-var _15=function(_16,m1){
-var _18=m1;
-_18=_18.replace(/\n\n/g,"\n");
-_18=_18.replace(/^\n/,"");
-_18=_18.replace(/\n+$/g,"");
-_18="\n\n~K"+(_3.push(_18)-1)+"K\n\n";
-return _18;
-};
-var _9=function(_19){
-_19=_1a(_19);
-var key=_1c("<hr />");
-_19=_19.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,key);
-_19=_19.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm,key);
-_19=_19.replace(/^[ ]{0,2}([ ]?\_[ ]?){3,}[ \t]*$/gm,key);
-_19=_1d(_19);
-_19=_1e(_19);
-_19=_1f(_19);
-_19=_7(_19);
-_19=_20(_19);
-return _19;
-};
-var _21=function(_22){
-_22=_23(_22);
-_22=_24(_22);
-_22=_25(_22);
-_22=_26(_22);
-_22=_27(_22);
-_22=_28(_22);
-_22=_11(_22);
-_22=_29(_22);
-_22=_22.replace(/ +\n/g," <br />\n");
-return _22;
-};
-var _24=function(_2a){
-var _2b=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|<!(--.*?--\s*)+>)/gi;
-_2a=_2a.replace(_2b,function(_2c){
-var tag=_2c.replace(/(.)<\/?code>(?=.)/g,"$1`");
-tag=_2e(tag,"\\`*_");
-return tag;
-});
-return _2a;
-};
-var _27=function(_2f){
-_2f=_2f.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,_30);
-_2f=_2f.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?(.*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,_30);
-_2f=_2f.replace(/(\[([^\[\]]+)\])()()()()()/g,_30);
-return _2f;
-};
-var _30=function(_31,m1,m2,m3,m4,m5,m6,m7){
-if(m7==undefined){
-m7="";
-}
-var _39=m1;
-var _3a=m2;
-var _3b=m3.toLowerCase();
-var url=m4;
-var _3d=m7;
-if(url==""){
-if(_3b==""){
-_3b=_3a.toLowerCase().replace(/ ?\n/g," ");
-}
-url="#"+_3b;
-if(_1[_3b]!=undefined){
-url=_1[_3b];
-if(_2[_3b]!=undefined){
-_3d=_2[_3b];
-}
-}else{
-if(_39.search(/\(\s*\)$/m)>-1){
-url="";
-}else{
-return _39;
-}
-}
-}
-url=_2e(url,"*_");
-var _3e="<a href=\""+url+"\"";
-if(_3d!=""){
-_3d=_3d.replace(/"/g,"&quot;");
-_3d=_2e(_3d,"*_");
-_3e+=" title=\""+_3d+"\"";
-}
-_3e+=">"+_3a+"</a>";
-return _3e;
-};
-var _26=function(_3f){
-_3f=_3f.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,_40);
-_3f=_3f.replace(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,_40);
-return _3f;
-};
-var _40=function(_41,m1,m2,m3,m4,m5,m6,m7){
-var _49=m1;
-var _4a=m2;
-var _4b=m3.toLowerCase();
-var url=m4;
-var _4d=m7;
-if(!_4d){
-_4d="";
-}
-if(url==""){
-if(_4b==""){
-_4b=_4a.toLowerCase().replace(/ ?\n/g," ");
-}
-url="#"+_4b;
-if(_1[_4b]!=undefined){
-url=_1[_4b];
-if(_2[_4b]!=undefined){
-_4d=_2[_4b];
-}
-}else{
-return _49;
-}
-}
-_4a=_4a.replace(/"/g,"&quot;");
-url=_2e(url,"*_");
-var _4e="<img src=\""+url+"\" alt=\""+_4a+"\"";
-_4d=_4d.replace(/"/g,"&quot;");
-_4d=_2e(_4d,"*_");
-_4e+=" title=\""+_4d+"\"";
-_4e+=" />";
-return _4e;
-};
-var _1a=function(_4f){
-_4f=_4f.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,function(_50,m1){
-return _1c("<h1>"+_21(m1)+"</h1>");
-});
-_4f=_4f.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(_52,m1){
-return _1c("<h2>"+_21(m1)+"</h2>");
-});
-_4f=_4f.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(_54,m1,m2){
-var _57=m1.length;
-return _1c("<h"+_57+">"+_21(m2)+"</h"+_57+">");
-});
-return _4f;
-};
-var _58;
-var _1d=function(_59){
-_59+="~0";
-var _5a=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;
-if(_4){
-_59=_59.replace(_5a,function(_5b,m1,m2){
-var _5e=m1;
-var _5f=(m2.search(/[*+-]/g)>-1)?"ul":"ol";
-_5e=_5e.replace(/\n{2,}/g,"\n\n\n");
-var _60=_58(_5e);
-_60=_60.replace(/\s+$/,"");
-_60="<"+_5f+">"+_60+"</"+_5f+">\n";
-return _60;
-});
-}else{
-_5a=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g;
-_59=_59.replace(_5a,function(_61,m1,m2,m3){
-var _65=m1;
-var _66=m2;
-var _67=(m3.search(/[*+-]/g)>-1)?"ul":"ol";
-var _66=_66.replace(/\n{2,}/g,"\n\n\n");
-var _68=_58(_66);
-_68=_65+"<"+_67+">\n"+_68+"</"+_67+">\n";
-return _68;
-});
-}
-_59=_59.replace(/~0/,"");
-return _59;
-};
-_58=function(_69){
-_4++;
-_69=_69.replace(/\n{2,}$/,"\n");
-_69+="~0";
-_69=_69.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm,function(_6a,m1,m2,m3,m4){
-var _6f=m4;
-var _70=m1;
-var _71=m2;
-if(_70||(_6f.search(/\n{2,}/)>-1)){
-_6f=_9(_72(_6f));
-}else{
-_6f=_1d(_72(_6f));
-_6f=_6f.replace(/\n$/,"");
-_6f=_21(_6f);
-}
-return "<li>"+_6f+"</li>\n";
-});
-_69=_69.replace(/~0/g,"");
-_4--;
-return _69;
-};
-var _1e=function(_73){
-_73+="~0";
-_73=_73.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(_74,m1,m2){
-var _77=m1;
-var _78=m2;
-_77=_79(_72(_77));
-_77=_6(_77);
-_77=_77.replace(/^\n+/g,"");
-_77=_77.replace(/\n+$/g,"");
-_77="<pre><code>"+_77+"\n</code></pre>";
-return _1c(_77)+_78;
-});
-_73=_73.replace(/~0/,"");
-return _73;
-};
-var _1c=function(_7a){
-_7a=_7a.replace(/(^\n+|\n+$)/g,"");
-return "\n\n~K"+(_3.push(_7a)-1)+"K\n\n";
-};
-var _23=function(_7b){
-_7b=_7b.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(_7c,m1,m2,m3,m4){
-var c=m3;
-c=c.replace(/^([ \t]*)/g,"");
-c=c.replace(/[ \t]*$/g,"");
-c=_79(c);
-return m1+"<code>"+c+"</code>";
-});
-return _7b;
-};
-var _79=function(_82){
-_82=_82.replace(/&/g,"&amp;");
-_82=_82.replace(/</g,"&lt;");
-_82=_82.replace(/>/g,"&gt;");
-_82=_2e(_82,"*_{}[]\\",false);
-return _82;
-};
-var _29=function(_83){
-_83=_83.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"<strong>$2</strong>");
-_83=_83.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"<em>$2</em>");
-return _83;
-};
-var _1f=function(_84){
-_84=_84.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(_85,m1){
-var bq=m1;
-bq=bq.replace(/^[ \t]*>[ \t]?/gm,"~0");
-bq=bq.replace(/~0/g,"");
-bq=bq.replace(/^[ \t]+$/gm,"");
-bq=_9(bq);
-bq=bq.replace(/(^|\n)/g,"$1 ");
-bq=bq.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(_88,m1){
-var pre=m1;
-pre=pre.replace(/^ /mg,"~0");
-pre=pre.replace(/~0/g,"");
-return pre;
-});
-return _1c("<blockquote>\n"+bq+"\n</blockquote>");
-});
-return _84;
-};
-var _20=function(_8b){
-_8b=_8b.replace(/^\n+/g,"");
-_8b=_8b.replace(/\n+$/g,"");
-var _8c=_8b.split(/\n{2,}/g);
-var _8d=new Array();
-var end=_8c.length;
-for(var i=0;i<end;i++){
-var str=_8c[i];
-if(str.search(/~K(\d+)K/g)>=0){
-_8d.push(str);
-}else{
-if(str.search(/\S/)>=0){
-str=_21(str);
-str=str.replace(/^([ \t]*)/g,"<p>");
-str+="</p>";
-_8d.push(str);
-}
-}
-}
-end=_8d.length;
-for(var i=0;i<end;i++){
-while(_8d[i].search(/~K(\d+)K/)>=0){
-var _91=_3[RegExp.$1];
-_91=_91.replace(/\$/g,"$$$$");
-_8d[i]=_8d[i].replace(/~K\d+K/,_91);
-}
-}
-return _8d.join("\n\n");
-};
-var _11=function(_92){
-_92=_92.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&amp;");
-_92=_92.replace(/<(?![a-z\/?\$!])/gi,"&lt;");
-return _92;
-};
-var _25=function(_93){
-_93=_93.replace(/\\(\\)/g,_94);
-_93=_93.replace(/\\([`*_{}\[\]()>#+-.!])/g,_94);
-return _93;
-};
-var _28=function(_95){
-_95=_95.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,"<a href=\"$1\">$1</a>");
-_95=_95.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,function(_96,m1){
-return _98(_a(m1));
-});
-return _95;
-};
-var _98=function(_99){
-function char2hex(ch){
-var _9b="0123456789ABCDEF";
-var dec=ch.charCodeAt(0);
-return (_9b.charAt(dec>>4)+_9b.charAt(dec&15));
-}
-var _9d=[function(ch){
-return "&#"+ch.charCodeAt(0)+";";
-},function(ch){
-return "&#x"+char2hex(ch)+";";
-},function(ch){
-return ch;
-}];
-_99="mailto:"+_99;
-_99=_99.replace(/./g,function(ch){
-if(ch=="@"){
-ch=_9d[Math.floor(Math.random()*2)](ch);
-}else{
-if(ch!=":"){
-var r=Math.random();
-ch=(r>0.9?_9d[2](ch):r>0.45?_9d[1](ch):_9d[0](ch));
-}
-}
-return ch;
-});
-_99="<a href=\""+_99+"\">"+_99+"</a>";
-_99=_99.replace(/">.+:/g,"\">");
-return _99;
-};
-var _a=function(_a3){
-_a3=_a3.replace(/~E(\d+)E/g,function(_a4,m1){
-var _a6=parseInt(m1);
-return String.fromCharCode(_a6);
-});
-return _a3;
-};
-var _72=function(_a7){
-_a7=_a7.replace(/^(\t|[ ]{1,4})/gm,"~0");
-_a7=_a7.replace(/~0/g,"");
-return _a7;
-};
-var _6=function(_a8){
-_a8=_a8.replace(/\t(?=\t)/g," ");
-_a8=_a8.replace(/\t/g,"~A~B");
-_a8=_a8.replace(/~B(.+?)~A/g,function(_a9,m1,m2){
-var _ac=m1;
-var _ad=4-_ac.length%4;
-for(var i=0;i<_ad;i++){
-_ac+=" ";
-}
-return _ac;
-});
-_a8=_a8.replace(/~A/g," ");
-_a8=_a8.replace(/~B/g,"");
-return _a8;
-};
-var _2e=function(_af,_b0,_b1){
-var _b2="(["+_b0.replace(/([\[\]\\])/g,"\\$1")+"])";
-if(_b1){
-_b2="\\\\"+_b2;
-}
-var _b3=new RegExp(_b2,"g");
-_af=_af.replace(_b3,_94);
-return _af;
-};
-var _94=function(_b4,m1){
-var _b6=m1.charCodeAt(0);
-return "~E"+_b6+"E";
-};
-};
-
+/*
+ A A L Source code at:
+ T C A <http://www.attacklab.net/>
+ T K B
+*/
+var Showdown={};Showdown.converter=function(){var a,b,c,d=0;this.makeHtml=function(d){a=[],b=[],c=[],d=d.replace(/~/g,"~T"),d=d.replace(/\$/g,"~D"),d=d.replace(/\r\n/g,"\n"),d=d.replace(/\r/g,"\n"),d="\n\n"+d+"\n\n",d=E(d),d=d.replace(/^[ \t]+$/mg,""),d=f(d),d=e(d),d=h(d),d=C(d),d=d.replace(/~D/g,"$$"),d=d.replace(/~T/g,"~");return d};var e=function(c){var c=c.replace(/^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*<?(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|\Z)/gm,function(c,d,e,f,g){d=d.toLowerCase(),a[d]=y(e);if(f)return f+g;g&&(b[d]=g.replace(/"/g,"&quot;"));return""});return c},f=function(a){a=a.replace(/\n/g,"\n\n");var b="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del",c="p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math";a=a.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm,g),a=a.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm,g),a=a.replace(/(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,g),a=a.replace(/(\n\n[ ]{0,3}<!(--[^\r]*?--\s*)+>[ \t]*(?=\n{2,}))/g,g),a=a.replace(/(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,g),a=a.replace(/\n\n/g,"\n");return a},g=function(a,b){var d=b;d=d.replace(/\n\n/g,"\n"),d=d.replace(/^\n/,""),d=d.replace(/\n+$/g,""),d="\n\n~K"+(c.push(d)-1)+"K\n\n";return d},h=function(a){a=o(a);var b=s("<hr />");a=a.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,b),a=a.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm,b),a=a.replace(/^[ ]{0,2}([ ]?\_[ ]?){3,}[ \t]*$/gm,b),a=q(a),a=r(a),a=w(a),a=f(a),a=x(a);return a},i=function(a){a=t(a),a=j(a),a=z(a),a=m(a),a=k(a),a=A(a),a=y(a),a=v(a),a=a.replace(/ +\n/g," <br />\n");return a},j=function(a){var b=/(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|<!(--.*?--\s*)+>)/gi;a=a.replace(b,function(a){var b=a.replace(/(.)<\/?code>(?=.)/g,"$1`");b=F(b,"\\`*_");return b});return a},k=function(a){a=a.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,l),a=a.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?(.*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,l),a=a.replace(/(\[([^\[\]]+)\])()()()()()/g,l);return a},l=function(c,d,e,f,g,h,i,j){j==undefined&&(j="");var k=d,l=e,m=f.toLowerCase(),n=g,o=j;if(n==""){m==""&&(m=l.toLowerCase().replace(/ ?\n/g," ")),n="#"+m;if(a[m]!=undefined)n=a[m],b[m]!=undefined&&(o=b[m]);else if(k.search(/\(\s*\)$/m)>-1)n="";else return k}n=F(n,"*_");var p='<a href="'+n+'"';o!=""&&(o=o.replace(/"/g,"&quot;"),o=F(o,"*_"),p+=' title="'+o+'"'),p+=">"+l+"</a>";return p},m=function(a){a=a.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g,n),a=a.replace(/(!\[(.*?)\]\s?\([ \t]*()<?(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,n);return a},n=function(c,d,e,f,g,h,i,j){var k=d,l=e,m=f.toLowerCase(),n=g,o=j;o||(o="");if(n==""){m==""&&(m=l.toLowerCase().replace(/ ?\n/g," ")),n="#"+m;if(a[m]!=undefined)n=a[m],b[m]!=undefined&&(o=b[m]);else return k}l=l.replace(/"/g,"&quot;"),n=F(n,"*_");var p='<img src="'+n+'" alt="'+l+'"';o=o.replace(/"/g,"&quot;"),o=F(o,"*_"),p+=' title="'+o+'"',p+=" />";return p},o=function(a){a=a.replace(/^(.+)[ \t]*\n=+[ \t]*\n+/gm,function(a,b){return s("<h1>"+i(b)+"</h1>")}),a=a.replace(/^(.+)[ \t]*\n-+[ \t]*\n+/gm,function(a,b){return s("<h2>"+i(b)+"</h2>")}),a=a.replace(/^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm,function(a,b,c){var d=b.length;return s("<h"+d+">"+i(c)+"</h"+d+">")});return a},p,q=function(a){a+="~0";var b=/^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm;d?a=a.replace(b,function(a,b,c){var d=b,e=c.search(/[*+-]/g)>-1?"ul":"ol";d=d.replace(/\n{2,}/g,"\n\n\n");var f=p(d);f=f.replace(/\s+$/,""),f="<"+e+">"+f+"</"+e+">\n";return f}):(b=/(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g,a=a.replace(b,function(a,b,c,d){var e=b,f=c,g=d.search(/[*+-]/g)>-1?"ul":"ol",f=f.replace(/\n{2,}/g,"\n\n\n"),h=p(f);h=e+"<"+g+">\n"+h+"</"+g+">\n";return h})),a=a.replace(/~0/,"");return a};p=function(a){d++,a=a.replace(/\n{2,}$/,"\n"),a+="~0",a=a.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm,function(a,b,c,d,e){var f=e,g=b,j=c;g||f.search(/\n{2,}/)>-1?f=h(D(f)):(f=q(D(f)),f=f.replace(/\n$/,""),f=i(f));return"<li>"+f+"</li>\n"}),a=a.replace(/~0/g,""),d--;return a};var r=function(a){a+="~0",a=a.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,function(a,b,c){var d=b,e=c;d=u(D(d)),d=E(d),d=d.replace(/^\n+/g,""),d=d.replace(/\n+$/g,""),d="<pre><code>"+d+"\n</code></pre>";return s(d)+e}),a=a.replace(/~0/,"");return a},s=function(a){a=a.replace(/(^\n+|\n+$)/g,"");return"\n\n~K"+(c.push(a)-1)+"K\n\n"},t=function(a){a=a.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(a,b,c,d,e){var f=d;f=f.replace(/^([ \t]*)/g,""),f=f.replace(/[ \t]*$/g,""),f=u(f);return b+"<code>"+f+"</code>"});return a},u=function(a){a=a.replace(/&/g,"&amp;"),a=a.replace(/</g,"&lt;"),a=a.replace(/>/g,"&gt;"),a=F(a,"*_{}[]\\",!1);return a},v=function(a){a=a.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"<strong>$2</strong>"),a=a.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"<em>$2</em>");return a},w=function(a){a=a.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(a,b){var c=b;c=c.replace(/^[ \t]*>[ \t]?/gm,"~0"),c=c.replace(/~0/g,""),c=c.replace(/^[ \t]+$/gm,""),c=h(c),c=c.replace(/(^|\n)/g,"$1 "),c=c.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(a,b){var c=b;c=c.replace(/^ /mg,"~0"),c=c.replace(/~0/g,"");return c});return s("<blockquote>\n"+c+"\n</blockquote>")});return a},x=function(a){a=a.replace(/^\n+/g,""),a=a.replace(/\n+$/g,"");var b=a.split(/\n{2,}/g),d=[],e=b.length;for(var f=0;f<e;f++){var g=b[f];g.search(/~K(\d+)K/g)>=0?d.push(g):g.search(/\S/)>=0&&(g=i(g),g=g.replace(/^([ \t]*)/g,"<p>"),g+="</p>",d.push(g))}e=d.length;for(var f=0;f<e;f++)while(d[f].search(/~K(\d+)K/)>=0){var h=c[RegExp.$1];h=h.replace(/\$/g,"$$$$"),d[f]=d[f].replace(/~K\d+K/,h)}return d.join("\n\n")},y=function(a){a=a.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&amp;"),a=a.replace(/<(?![a-z\/?\$!])/gi,"&lt;");return a},z=function(a){a=a.replace(/\\(\\)/g,G),a=a.replace(/\\([`*_{}\[\]()>#+-.!])/g,G);return a},A=function(a){a=a.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,'<a href="$1">$1</a>'),a=a.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,function(a,b){return B(C(b))});return a},B=function(a){function b(a){var b="0123456789ABCDEF",c=a.charCodeAt(0);return b.charAt(c>>4)+b.charAt(c&15)}var c=[function(a){return"&#"+a.charCodeAt(0)+";"},function(a){return"&#x"+b(a)+";"},function(a){return a}];a="mailto:"+a,a=a.replace(/./g,function(a){if(a=="@")a=c[Math.floor(Math.random()*2)](a);else if(a!=":"){var b=Math.random();a=b>.9?c[2](a):b>.45?c[1](a):c[0](a)}return a}),a='<a href="'+a+'">'+a+"</a>",a=a.replace(/">.+:/g,'">');return a},C=function(a){a=a.replace(/~E(\d+)E/g,function(a,b){var c=parseInt(b);return String.fromCharCode(c)});return a},D=function(a){a=a.replace(/^(\t|[ ]{1,4})/gm,"~0"),a=a.replace(/~0/g,"");return a},E=function(a){a=a.replace(/\t(?=\t)/g," "),a=a.replace(/\t/g,"~A~B"),a=a.replace(/~B(.+?)~A/g,function(a,b,c){var d=b,e=4-d.length%4;for(var f=0;f<e;f++)d+=" ";return d}),a=a.replace(/~A/g," "),a=a.replace(/~B/g,"");return a},F=function(a,b,c){var d="(["+b.replace(/([\[\]\\])/g,"\\$1")+"])";c&&(d="\\\\"+d);var e=new RegExp(d,"g");a=a.replace(e,G);return a},G=function(a,b){var c=b.charCodeAt(0);return"~E"+c+"E"}}
View
4 extras/coco.js
2 additions, 2 deletions not shown
Please sign in to comment.
Something went wrong with that request. Please try again.