From 97669e0d28081e89df573c8d89b24ebf5c5636fd Mon Sep 17 00:00:00 2001
From: "qingwei.li"
Date: Fri, 23 Dec 2016 09:25:30 +0800
Subject: [PATCH 1/5] Add similar projects into readme
---
README.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/README.md b/README.md
index bceee7b87..6b15d722c 100644
--- a/README.md
+++ b/README.md
@@ -58,6 +58,10 @@ These open-source projects are using docsify to generate their sites. Pull reque
- [docsify](https://docsify.js.org) - A magical documentation site generator.
- [Snipaste](https://docs.snipaste.com/) - A new way to boost your productivity.
+## Similar projects
+- [docute](https://github.com/egoist/docute) - π Effortlessly documentation done right
+- [docpress](https://github.com/docpress/docpress) - Documentation website generator
+
## Contributing
- Fork it!
From d0861d74272fb6748f9daef0323fc0ad29df7377 Mon Sep 17 00:00:00 2001
From: "qingwei.li"
Date: Fri, 23 Dec 2016 21:46:12 +0800
Subject: [PATCH 2/5] Fixed cover rendering timing
---
CHANGELOG.md | 4 ++++
docs/_coverpage.md | 2 +-
src/index.js | 12 +++++-------
src/render.js | 2 ++
4 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b8be2e708..d9f63294e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.3.3
+### Bug fixes
+- Fixed cover rendering timing
+
## 1.3.2
### Bug fixes
diff --git a/docs/_coverpage.md b/docs/_coverpage.md
index 08945c427..92ba59261 100644
--- a/docs/_coverpage.md
+++ b/docs/_coverpage.md
@@ -1,6 +1,6 @@

-# docsify 1.3.2
+# docsify 1.3.3
> A magical documentation site generator.
diff --git a/src/index.js b/src/index.js
index 9d2ac9e9f..2ca7ead3a 100644
--- a/src/index.js
+++ b/src/index.js
@@ -59,12 +59,8 @@ const mainRender = function (cb) {
}
// Render Cover page
- if (OPTIONS.coverpage) {
- if (page === OPTIONS.homepage) {
- load(OPTIONS.coverpage).then(render.renderCover)
- } else {
- render.renderCover()
- }
+ if (OPTIONS.coverpage && page === OPTIONS.homepage) {
+ load(OPTIONS.coverpage).then(render.renderCover)
}
cacheXhr && cacheXhr.abort && cacheXhr.abort()
@@ -72,6 +68,9 @@ const mainRender = function (cb) {
cacheXhr = load(page, 'GET', render.renderLoading)
cacheXhr.then(result => {
render.renderArticle(result)
+ // clear cover
+ if (OPTIONS.coverpage && page !== OPTIONS.homepage) render.renderCover()
+ // render sidebar
if (OPTIONS.loadSidebar) {
if (wait === false) cb()
wait = false
@@ -102,7 +101,6 @@ const Docsify = function () {
mainRender(_ => {
activeLink('aside.sidebar', true)
scrollIntoView()
- OPTIONS.coverpage && sticky()
})
}
diff --git a/src/render.js b/src/render.js
index 987269540..c021d0796 100644
--- a/src/render.js
+++ b/src/render.js
@@ -132,6 +132,8 @@ export function renderCover (content) {
!renderCover.rendered && renderTo('.cover-main', marked(content))
renderCover.rendered = true
}
+
+ sticky()
}
/**
From 668c5ca714bdffce1b4f22d2dce19f06f8a01cd5 Mon Sep 17 00:00:00 2001
From: "qingwei.li"
Date: Fri, 23 Dec 2016 21:47:15 +0800
Subject: [PATCH 3/5] fix lint
---
src/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/index.js b/src/index.js
index 2ca7ead3a..ba776a2aa 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,5 +1,5 @@
import { load, camel2kebab, isNil, getRoute } from './util'
-import { activeLink, scrollIntoView, sticky } from './event'
+import { activeLink, scrollIntoView } from './event'
import * as render from './render'
const OPTIONS = {
From 16623c9301a6f2fdc6927e9e916b8a926b66f2b5 Mon Sep 17 00:00:00 2001
From: "qingwei.li"
Date: Fri, 23 Dec 2016 21:47:31 +0800
Subject: [PATCH 4/5] bump 1.3.3
---
lib/docsify.js | 14 +++++++-------
lib/docsify.min.js | 4 ++--
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/lib/docsify.js b/lib/docsify.js
index cd71240fe..26a9b027a 100644
--- a/lib/docsify.js
+++ b/lib/docsify.js
@@ -2506,6 +2506,8 @@ function renderCover (content) {
!renderCover.rendered && renderTo('.cover-main', marked(content));
renderCover.rendered = true;
}
+
+ sticky();
}
/**
@@ -2610,12 +2612,8 @@ var mainRender = function (cb) {
}
// Render Cover page
- if (OPTIONS.coverpage) {
- if (page === OPTIONS.homepage) {
- load(OPTIONS.coverpage).then(renderCover);
- } else {
- renderCover();
- }
+ if (OPTIONS.coverpage && page === OPTIONS.homepage) {
+ load(OPTIONS.coverpage).then(renderCover);
}
cacheXhr && cacheXhr.abort && cacheXhr.abort();
@@ -2623,6 +2621,9 @@ var mainRender = function (cb) {
cacheXhr = load(page, 'GET', renderLoading);
cacheXhr.then(function (result) {
renderArticle(result);
+ // clear cover
+ if (OPTIONS.coverpage && page !== OPTIONS.homepage) { renderCover(); }
+ // render sidebar
if (OPTIONS.loadSidebar) {
if (wait === false) { cb(); }
wait = false;
@@ -2653,7 +2654,6 @@ var Docsify = function () {
mainRender(function (_) {
activeLink('aside.sidebar', true);
scrollIntoView();
- OPTIONS.coverpage && sticky();
});
};
diff --git a/lib/docsify.min.js b/lib/docsify.min.js
index 45edcf06f..bb2f6d7ed 100644
--- a/lib/docsify.min.js
+++ b/lib/docsify.min.js
@@ -1,2 +1,2 @@
-var Docsify=function(){"use strict";function e(e,t,n){void 0===t&&(t="GET");var r=new XMLHttpRequest;return r.open(t,e),r.send(),{then:function(e,t){if(void 0===t&&(t=function(){}),n){var i=setInterval(function(e){return n({step:Math.floor(5*Math.random()+1)})},500);r.addEventListener("progress",n),r.addEventListener("loadend",function(e){n(e),clearInterval(i)})}r.addEventListener("error",t),r.addEventListener("load",function(n){var r=n.target;r.status>=400?t(r):e(r.response)})},abort:function(){return 4!==r.readyState&&r.abort()}}}function t(e,t){var n=[],r={};return e.forEach(function(e){var i=e.level||1,a=i-1;i>t||(r[a]?(r[a].children=r[a].children||[],r[a].children.push(e)):n.push(e),r[i]=e)}),n}function n(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}function r(e){return null===e||void 0===e}function i(){var e=window.location;if(A===e.hash&&!r(C))return C;var t=e.hash.match(/^#\/([^#]+)/);return t=t&&2===t.length?t[1]:/^#\//.test(e.hash)?"":e.pathname,C=t,A=e.hash,t}function a(){return document.body.clientWidth<=600}function s(){function e(){for(var e=0,r=t.length;e10){var o=n[a.getAttribute("data-id")];if(!o||o===i)return;return i&&i.setAttribute("class",""),o.setAttribute("class","active"),void(i=o)}}}if(!a()){for(var t=document.querySelectorAll(".anchor"),n={},r=document.querySelectorAll(".sidebar li"),i=null,s=0,o=r.length;s=t||e.classList.contains("hidden")?document.body.classList.add("sticky"):document.body.classList.remove("sticky")}()}function p(e,t){return t={exports:{}},e(t,t.exports),t.exports}function g(e){return e?(/\/\//.test(e)||(e="https://github.com/"+e),e=e.replace(/^git\+/,""),'\n \n \n '):""}function h(e){return"\n "+e+'\n \n \n '}function f(){var e=", 100%, 85%",t="linear-gradient(to left bottom, hsl("+(Math.floor(255*Math.random())+e)+") 0%, hsl("+(Math.floor(255*Math.random())+e)+") 100%)";return''}function m(){return''}function b(e,t){return void 0===t&&(t=""),e&&e.length?(e.forEach(function(e){t+=''+e.title+"",e.children&&(t+='")}),t):""}function y(e,t){var n=document.querySelector("nav")||document.createElement("nav");j.repo||n.classList.add("no-badge"),e[t?"outerHTML":"innerHTML"]=g(j.repo)+(j.coverpage?f():"")+h(j.sidebarToggle?m():""),document.body.insertBefore(n,document.body.children[0]),u("button.sidebar-toggle"),j.coverpage?!a()&&window.addEventListener("scroll",d):document.body.classList.add("sticky")}function v(e){N("article",e?E(e):"not found"),x.rendered||x(null,j),k.rendered||k(null,j),x.rendered=!1,k.rendered=!1,j.auto2top&&c()}function k(e){T.navbar&&T.navbar===e||(T.navbar=e,k.rendered=!0,e&&N("nav",E(e)),l("nav"))}function x(e){var n=!1;e?e=E(e):j.sidebar?e=b(j.sidebar,""):(e=b(t(M,j.maxLevel),""),n=!0),x.rendered=!0,T.sidebar&&T.sidebar===e||(T.sidebar=e,N("aside.sidebar",e),n&&s(),M=[])}function w(e){w.dom=w.dom||document.querySelector("section.cover"),e?(w.dom.classList.remove("hidden"),!w.rendered&&N(".cover-main",E(e)),w.rendered=!0):w.dom.classList.add("hidden")}function S(e){var t,n=e.loaded,r=e.total,i=e.step;if(!T.loading){var a=document.createElement("div");a.classList.add("progress"),document.body.appendChild(a),T.loading=a}i?(t=parseInt(T.loading.style.width,10)+i,t=t>80?80:t):t=Math.floor(n/r*100),T.loading.style.opacity=1,T.loading.style.width=t>=95?"100%":t+"%",t>=95&&(clearTimeout(S.cacheTimeout),S.cacheTimeout=setTimeout(function(e){T.loading.style.opacity=0,T.loading.style.width="0%"},200))}function L(e){j=e}var _,C=null,A=null,$="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},E=p(function(e,t){(function(){function n(e){this.tokens=[],this.tokens.links={},this.options=e||d.defaults,this.rules=p.normal,this.options.gfm&&(this.options.tables?this.rules=p.tables:this.rules=p.gfm)}function r(e,t){if(this.options=t||d.defaults,this.links=e,this.rules=g.normal,this.renderer=this.options.renderer||new i,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=g.breaks:this.rules=g.gfm:this.options.pedantic&&(this.rules=g.pedantic)}function i(e){this.options=e||{}}function a(e){this.tokens=[],this.token=null,this.options=e||d.defaults,this.options.renderer=this.options.renderer||new i,this.renderer=this.options.renderer,this.renderer.options=this.options}function s(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function o(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function l(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}}function u(){}function c(e){for(var t,n,r=arguments,i=1;iAn error occured:
"+s(e.message+"",!0)+"
";throw e}}var p={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:u,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:u,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:u,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};p.bullet=/(?:[*+-]|\d+\.)/,p.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,p.item=l(p.item,"gm")(/bull/g,p.bullet)(),p.list=l(p.list)(/bull/g,p.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+p.def.source+")")(),p.blockquote=l(p.blockquote)("def",p.def)(),p._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",p.html=l(p.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,p._tag)(),p.paragraph=l(p.paragraph)("hr",p.hr)("heading",p.heading)("lheading",p.lheading)("blockquote",p.blockquote)("tag","<"+p._tag)("def",p.def)(),p.normal=c({},p),p.gfm=c({},p.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),p.gfm.paragraph=l(p.paragraph)("(?!","(?!"+p.gfm.fences.source.replace("\\1","\\2")+"|"+p.list.source.replace("\\1","\\3")+"|")(),p.tables=c({},p.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),n.rules=p,n.lex=function(e,t){var r=new n(t);return r.lex(e)},n.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},n.prototype.token=function(e,t,n){for(var r,i,a,s,o,l,u,c,d,g=this,e=e.replace(/^ +$/gm,"");e;)if((a=g.rules.newline.exec(e))&&(e=e.substring(a[0].length),a[0].length>1&&g.tokens.push({type:"space"})),a=g.rules.code.exec(e))e=e.substring(a[0].length),a=a[0].replace(/^ {4}/gm,""),g.tokens.push({type:"code",text:g.options.pedantic?a:a.replace(/\n+$/,"")});else if(a=g.rules.fences.exec(e))e=e.substring(a[0].length),g.tokens.push({type:"code",lang:a[2],text:a[3]||""});else if(a=g.rules.heading.exec(e))e=e.substring(a[0].length),g.tokens.push({type:"heading",depth:a[1].length,text:a[2]});else if(t&&(a=g.rules.nptable.exec(e))){for(e=e.substring(a[0].length),l={type:"table",header:a[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:a[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:a[3].replace(/\n$/,"").split("\n")},c=0;c ?/gm,""),g.token(a,t,!0),g.tokens.push({type:"blockquote_end"});else if(a=g.rules.list.exec(e)){for(e=e.substring(a[0].length),s=a[2],g.tokens.push({type:"list_start",ordered:s.length>1}),a=a[0].match(g.rules.item),r=!1,d=a.length,c=0;c1&&o.length>1||(e=a.slice(c+1).join("\n")+e,c=d-1)),i=r||/\n\n(?!\s*$)/.test(l),c!==d-1&&(r="\n"===l.charAt(l.length-1),i||(i=r)),g.tokens.push({type:i?"loose_item_start":"list_item_start"}),g.token(l,!1,n),g.tokens.push({type:"list_item_end"});g.tokens.push({type:"list_end"})}else if(a=g.rules.html.exec(e))e=e.substring(a[0].length),g.tokens.push({type:g.options.sanitize?"paragraph":"html",pre:!g.options.sanitizer&&("pre"===a[1]||"script"===a[1]||"style"===a[1]),text:a[0]});else if(!n&&t&&(a=g.rules.def.exec(e)))e=e.substring(a[0].length),g.tokens.links[a[1].toLowerCase()]={href:a[2],title:a[3]};else if(t&&(a=g.rules.table.exec(e))){for(e=e.substring(a[0].length),l={type:"table",header:a[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:a[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:a[3].replace(/(?: *\| *)?\n$/,"").split("\n")},c=0;c])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:u,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:u,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,g.link=l(g.link)("inside",g._inside)("href",g._href)(),g.reflink=l(g.reflink)("inside",g._inside)(),g.normal=c({},g),g.pedantic=c({},g.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),g.gfm=c({},g.normal,{escape:l(g.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:l(g.text)("]|","~]|")("|","|https?://|")()}),g.breaks=c({},g.gfm,{br:l(g.br)("{2,}","*")(),text:l(g.gfm.text)("{2,}","*")()}),r.rules=g,r.output=function(e,t,n){var i=new r(t,n);return i.output(e)},r.prototype.output=function(e){for(var t,n,r,i,a=this,o="";e;)if(i=a.rules.escape.exec(e))e=e.substring(i[0].length),o+=i[1];else if(i=a.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?a.mangle(i[1].substring(7)):a.mangle(i[1]),r=a.mangle("mailto:")+n):(n=s(i[1]),r=n),o+=a.renderer.link(r,null,n);else if(a.inLink||!(i=a.rules.url.exec(e))){if(i=a.rules.tag.exec(e))!a.inLink&&/^/i.test(i[0])&&(a.inLink=!1),e=e.substring(i[0].length),o+=a.options.sanitize?a.options.sanitizer?a.options.sanitizer(i[0]):s(i[0]):i[0];else if(i=a.rules.link.exec(e))e=e.substring(i[0].length),a.inLink=!0,o+=a.outputLink(i,{href:i[2],title:i[3]}),a.inLink=!1;else if((i=a.rules.reflink.exec(e))||(i=a.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=a.links[t.toLowerCase()],!t||!t.href){o+=i[0].charAt(0),e=i[0].substring(1)+e;continue}a.inLink=!0,o+=a.outputLink(i,t),a.inLink=!1}else if(i=a.rules.strong.exec(e))e=e.substring(i[0].length),o+=a.renderer.strong(a.output(i[2]||i[1]));else if(i=a.rules.em.exec(e))e=e.substring(i[0].length),o+=a.renderer.em(a.output(i[2]||i[1]));else if(i=a.rules.code.exec(e))e=e.substring(i[0].length),o+=a.renderer.codespan(s(i[2],!0));else if(i=a.rules.br.exec(e))e=e.substring(i[0].length),o+=a.renderer.br();else if(i=a.rules.del.exec(e))e=e.substring(i[0].length),o+=a.renderer.del(a.output(i[1]));else if(i=a.rules.text.exec(e))e=e.substring(i[0].length),o+=a.renderer.text(s(a.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=s(i[1]),r=n,o+=a.renderer.link(r,null,n);return o},r.prototype.outputLink=function(e,t){var n=s(t.href),r=t.title?s(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,s(e[1]))},r.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"β").replace(/--/g,"β").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1β").replace(/'/g,"β").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1β").replace(/"/g,"β").replace(/\.{3}/g,"β¦"):e},r.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i.5&&(t="x"+t.toString(16)),n+=""+t+";";return n},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?''+(n?e:s(e,!0))+"\n
\n":""+(n?e:s(e,!0))+"\n
"},i.prototype.blockquote=function(e){return"\n"+e+"
\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return"\n"},i.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},i.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+""+n+">\n"},i.prototype.listitem=function(e){return""+e+"\n"},i.prototype.paragraph=function(e){return""+e+"
\n"},i.prototype.table=function(e,t){return"\n"},i.prototype.tablerow=function(e){return"\n"+e+"
\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+""+n+">\n"},i.prototype.strong=function(e){return""+e+""},i.prototype.em=function(e){return""+e+""},i.prototype.codespan=function(e){return""+e+"
"},i.prototype.br=function(){return this.options.xhtml?"
":"
"},i.prototype.del=function(e){return""+e+""},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(o(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var i='"+n+""},i.prototype.image=function(e,t,n){var r='
":">"},i.prototype.text=function(e){return e},a.parse=function(e,t,n){var r=new a(t,n);return r.parse(e)},a.prototype.parse=function(e){var t=this;this.inline=new r(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var n="";this.next();)n+=t.tok();return n},a.prototype.next=function(){return this.token=this.tokens.pop()},a.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},a.prototype.parseText=function(){for(var e=this,t=this.token.text;"text"===this.peek().type;)t+="\n"+e.next().text;return this.inline.output(t)},a.prototype.tok=function(){var e=this;switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var t,n,r,i,a,s="",o="";for(r="",t=0;te.length)break e;if(!(b instanceof i)){c.lastIndex=0;var y=c.exec(b),v=1;if(!y&&g&&m!=a.length-1){var k=a[m+1].matchedStr||a[m+1],x=b+k;if(m=b.length)continue;var S=y.index+y[0].length,L=b.length+k.length;if(v=3,S<=L){if(a[m+1].greedy)continue;v=2,x=x.slice(0,L)}b=x}if(y){p&&(h=y[1].length);var w=y.index+h,y=y[0].slice(h),S=w+y.length,_=b.slice(0,w),C=b.slice(S),A=[m,v];_&&A.push(_);var $=new i(o,d?r.tokenize(y,d):y,f,y,g);A.push($),C&&A.push(C),Array.prototype.splice.apply(a,A)}}}}}return a},hooks:{all:{},add:function(e,t){var n=r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=r.hooks.all[e];if(n&&n.length)for(var i,a=0;i=n[a++];)i(t)}}},i=r.Token=function(e,t,n,r,i){this.type=e,this.content=t,this.alias=n,this.matchedStr=r||null,this.greedy=!!i};if(i.stringify=function(e,t,n){if("string"==typeof e)return e;if("Array"===r.util.type(e))return e.map(function(n){return i.stringify(n,t,e)}).join("");var a={type:e.type,content:i.stringify(e.content,t,n),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:n};if("comment"==a.type&&(a.attributes.spellcheck="true"),e.alias){var s="Array"===r.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(a.classes,s)}r.hooks.run("wrap",a);var o="";for(var l in a.attributes)o+=(o?" ":"")+l+'="'+(a.attributes[l]||"")+'"';return"<"+a.tag+' class="'+a.classes.join(" ")+'" '+o+">"+a.content+""+a.tag+">"},!t.document)return t.addEventListener?(t.addEventListener("message",function(e){var n=JSON.parse(e.data),i=n.language,a=n.code,s=n.immediateClose;t.postMessage(r.highlight(a,r.languages[i],i)),s&&t.close()},!1),t.Prism):t.Prism;var a=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return a&&(r.filename=a.src,document.addEventListener&&!a.hasAttribute("data-manual")&&("loading"!==document.readyState?requestAnimationFrame(r.highlightAll,0):document.addEventListener("DOMContentLoaded",r.highlightAll))),t.Prism}();"undefined"!=typeof e&&e.exports&&(e.exports=n),"undefined"!=typeof $&&($.Prism=n),n.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=.$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},n.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),n.languages.xml=n.languages.markup,n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},n.languages.css.atrule.inside.rest=n.util.clone(n.languages.css),n.languages.markup&&(n.languages.insertBefore("markup","tag",{style:{pattern:/(