From 99dbaa3050aab3d9cfa817a29695e4ff3c6cdfad Mon Sep 17 00:00:00 2001 From: jthegedus Date: Sat, 5 Jan 2019 19:19:54 +1100 Subject: [PATCH 01/37] document customising page title with sidebar --- docs/more-pages.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/more-pages.md b/docs/more-pages.md index 38184a2..46e7df8 100644 --- a/docs/more-pages.md +++ b/docs/more-pages.md @@ -72,6 +72,16 @@ You can specify `alias` to avoid unnecessary fallback. !> You can create a `README.md` file in a subdirectory to use it as the landing page for the route. +## Set Page Titles from Sidebar Selection + +A page's `title` tag is generated from the _selected_ sidebar item name. For better SEO, you can customize the title by specifying a string after the filename. + +```markdown + +* [Home](/) +* [Guide](guide.md "The greatest guide in the world") +``` + ## Table of Contents Once you've created `_sidebar.md`, the sidebar content is automatically generated based on the headers in the markdown files. From 11ea1f8d12dbf4c70221d72effaa2e90b7656d86 Mon Sep 17 00:00:00 2001 From: spiritree Date: Mon, 25 Feb 2019 09:38:56 +0800 Subject: [PATCH 02/37] fix: re-render gitalk when router changed --- src/plugins/gitalk.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/plugins/gitalk.js b/src/plugins/gitalk.js index 88d7e64..8ba9ace 100644 --- a/src/plugins/gitalk.js +++ b/src/plugins/gitalk.js @@ -7,10 +7,16 @@ function install(hook) { const main = dom.getNode('#main') div.style = `width: ${main.clientWidth}px; margin: 0 auto 20px;` dom.appendTo(dom.find('.content'), div) - const script = dom.create('script') - const content = `gitalk.render('gitalk-container')` - script.textContent = content - dom.appendTo(dom.body, script) + }) + + hook.doneEach(_ => { + const el = document.getElementById('gitalk-container') + while (el.hasChildNodes()) { + el.removeChild(el.firstChild) + } + + // eslint-disable-next-line + gitalk.render('gitalk-container') }) } From 01ea44106b13f93aba6c3dbfd81068d9b1931c98 Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Wed, 20 Feb 2019 21:36:47 +0100 Subject: [PATCH 03/37] fix xhr usage, fix init URL setup provide full test setup including fixtures --- package-lock.json | 6 -- package.json | 3 +- test/_helper.js | 103 ++++++++++++++++++-------------- test/fixtures/default/README.md | 6 ++ test/render.js | 12 ++-- 5 files changed, 71 insertions(+), 59 deletions(-) create mode 100644 test/fixtures/default/README.md diff --git a/package-lock.json b/package-lock.json index 9a205ac..a0582ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8791,12 +8791,6 @@ "async-limiter": "~1.0.0" } }, - "xhr2": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/xhr2/-/xhr2-0.1.4.tgz", - "integrity": "sha1-f4dliEdxbbUCYyOBL4GMras4el8=", - "dev": true - }, "xml-name-validator": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", diff --git a/package.json b/package.json index 5a7b8bc..33e6146 100644 --- a/package.json +++ b/package.json @@ -72,8 +72,7 @@ "rollup-plugin-node-resolve": "^3.0.0", "rollup-plugin-replace": "^2.0.0", "rollup-plugin-uglify": "^2.0.1", - "stylus": "^0.54.5", - "xhr2": "^0.1.4" + "stylus": "^0.54.5" }, "keywords": [ "doc", diff --git a/test/_helper.js b/test/_helper.js index bac1407..47e7578 100644 --- a/test/_helper.js +++ b/test/_helper.js @@ -1,45 +1,10 @@ // load ES6 modules in Node.js on the fly require = require('esm')(module/*, options*/) +const path = require('path') const {expect} = require('chai') const {JSDOM} = require('jsdom') -const XMLHttpRequest = require('xhr2') // JSDOM doesn't support XMLHttpRequest -// TODO: try to fix tests when using `
` in body -const markup = ` - - - -` -// TODO: this may not work if tests are mutate the DOM, instead a new instance needs to be created -// for every test case but that will slow down the tests -const dom = new JSDOM(markup) - -global.window = dom.window -global.document = dom.window.document -global.navigator = dom.window.navigator -global.location = dom.window.location -global.XMLHttpRequest = XMLHttpRequest - -const {initMixin} = require('../src/core/init') -const {routerMixin} = require('../src/core//router') -const {renderMixin} = require('../src/core//render') -const {fetchMixin} = require('../src/core/fetch') -const {eventMixin} = require('../src/core//event') - -// mimic src/core/index.js but for Node.js - -function Docsify() { - this._init() -} - -const proto = Docsify.prototype - -initMixin(proto) -routerMixin(proto) -renderMixin(proto) -fetchMixin(proto) -eventMixin(proto) function ready(callback) { const state = document.readyState @@ -50,16 +15,64 @@ function ready(callback) { document.addEventListener('DOMContentLoaded', callback) } -let docsify = null -module.exports.init = function(callback) { +module.exports.init = function(fixture = 'default', config = {}, markup) { + if (markup == null) { + markup = ` + + + +
+ + + ` + } + const rootPath = path.join(__dirname, 'fixtures', fixture) + + const dom = new JSDOM(markup) + dom.reconfigure({ url: 'file:///' + rootPath }) + + global.window = dom.window + global.document = dom.window.document + global.navigator = dom.window.navigator + global.location = dom.window.location + global.XMLHttpRequest = dom.window.XMLHttpRequest + + // mimic src/core/index.js but for Node.js + function Docsify() { + this._init() + } + + const proto = Docsify.prototype + + const {initMixin} = require('../src/core/init') + const {routerMixin} = require('../src/core//router') + const {renderMixin} = require('../src/core//render') + const {fetchMixin} = require('../src/core/fetch') + const {eventMixin} = require('../src/core//event') + + initMixin(proto) + routerMixin(proto) + renderMixin(proto) + fetchMixin(proto) + eventMixin(proto) + + const NOT_INIT_PATTERN = '' + return new Promise((resolve, reject) => { - // return cached version / TODO: see above: this might not scale, new instance of JSDOM is reqiured - if (docsify != null) { - return resolve(docsify) - } - ready(_ => { - docsify = new Docsify() - return resolve(docsify) + ready(() => { + const docsify = new Docsify() + // TODO: use callback instead of polling, but usually it works after 10ms + const id = setInterval(() => { + if (dom.window.document.body.innerHTML.indexOf(NOT_INIT_PATTERN) == -1) { + clearInterval(id) + return resolve({ + docsify: docsify, + dom: dom + }) + } + }, 10) }) }) diff --git a/test/fixtures/default/README.md b/test/fixtures/default/README.md new file mode 100644 index 0000000..28df398 --- /dev/null +++ b/test/fixtures/default/README.md @@ -0,0 +1,6 @@ + diff --git a/test/render.js b/test/render.js index 9cb502c..a00c1a4 100644 --- a/test/render.js +++ b/test/render.js @@ -6,14 +6,14 @@ const {init, expectSameDom} = require('./_helper') describe('render', function() { it('important content (tips)', async function() { - docsify = await init() + const {docsify, dom} = await init() const output = docsify.compiler.compile('!> **Time** is money, my friend!') expect(output).equal('

Time is money, my friend!

') }) describe('lists', function() { it('as unordered task list', async function() { - docsify = await init() + const {docsify, dom} = await init() const output = docsify.compiler.compile(` - [x] Task 1 - [ ] Task 2 @@ -26,7 +26,7 @@ describe('render', function() { }) it('as ordered task list', async function() { - docsify = await init() + const {docsify, dom} = await init() const output = docsify.compiler.compile(` 1. [ ] Task 1 2. [x] Task 2`) @@ -37,7 +37,7 @@ describe('render', function() { }) it('normal unordered', async function() { - docsify = await init() + const {docsify, dom} = await init() const output = docsify.compiler.compile(` - [linktext](link) - just text`) @@ -48,7 +48,7 @@ describe('render', function() { }) it('unordered with custom start', async function() { - docsify = await init() + const {docsify, dom} = await init() const output = docsify.compiler.compile(` 1. first 2. second @@ -67,7 +67,7 @@ text }) it('nested', async function() { - docsify = await init() + const {docsify, dom} = await init() const output = docsify.compiler.compile(` - 1 - 2 From dac0bfec6c442d0b9eefbf60f22cf3ae50eb751e Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Wed, 20 Feb 2019 21:37:02 +0100 Subject: [PATCH 04/37] split test into unit and integration provide some dummy tests cases --- package.json | 2 +- test/fixtures/simple/README.md | 18 ++++++++++++++++++ test/fixtures/simple/other-page.md | 16 ++++++++++++++++ test/integration/render.js | 13 +++++++++++++ test/integration/router.js | 13 +++++++++++++ test/{ => unit}/render.js | 2 +- 6 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 test/fixtures/simple/README.md create mode 100644 test/fixtures/simple/other-page.md create mode 100644 test/integration/render.js create mode 100644 test/integration/router.js rename test/{ => unit}/render.js (97%) diff --git a/package.json b/package.json index 33e6146..c61835b 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "dev": "run-p serve watch:*", "dev:ssr": "run-p serve:ssr watch:*", "lint": "eslint {src,packages} --fix", - "test": "mocha", + "test": "mocha test/*/**", "css": "stylus src/themes/*.styl -u autoprefixer-stylus", "watch:css": "run-p 'css -- -o themes -w'", "watch:js": "node build/build.js", diff --git a/test/fixtures/simple/README.md b/test/fixtures/simple/README.md new file mode 100644 index 0000000..0f3fd46 --- /dev/null +++ b/test/fixtures/simple/README.md @@ -0,0 +1,18 @@ +# Heading + +[another page](other.md) + +## II 1 + +### III 1 + +#### IV 1 + +##### V 1 + + +## II 2 + +### III 2 + +#### IV 2 diff --git a/test/fixtures/simple/other-page.md b/test/fixtures/simple/other-page.md new file mode 100644 index 0000000..4bc6e98 --- /dev/null +++ b/test/fixtures/simple/other-page.md @@ -0,0 +1,16 @@ +# Other + +## two 1 + +### three 1 + +#### four 1 + +##### five 1 + + +## two 2 + +### three 2 + +#### four 2 diff --git a/test/integration/render.js b/test/integration/render.js new file mode 100644 index 0000000..adddfc4 --- /dev/null +++ b/test/integration/render.js @@ -0,0 +1,13 @@ +const path = require('path') + +const {expect} = require('chai') + +const {init, expectSameDom} = require('../_helper') + +describe('full docsify initialization', function() { + it('TODO: check generated markup', async function() { + const {docsify, dom} = await init('simple', {loadSidebar: true}) + console.log(dom.window.document.body.innerHTML) + }) + +}) diff --git a/test/integration/router.js b/test/integration/router.js new file mode 100644 index 0000000..5408683 --- /dev/null +++ b/test/integration/router.js @@ -0,0 +1,13 @@ +const path = require('path') + +const {expect} = require('chai') + +const {init, expectSameDom} = require('../_helper') + +describe('router', function() { + it('TODO: trigger to load another page', async function() { + const {docsify} = await init() + window.location = '/?foo=bar' + }) + +}) diff --git a/test/render.js b/test/unit/render.js similarity index 97% rename from test/render.js rename to test/unit/render.js index a00c1a4..25043cf 100644 --- a/test/render.js +++ b/test/unit/render.js @@ -2,7 +2,7 @@ const path = require('path') const {expect} = require('chai') -const {init, expectSameDom} = require('./_helper') +const {init, expectSameDom} = require('../_helper') describe('render', function() { it('important content (tips)', async function() { From a35531967a1c418421d811ef3e64c6b94cac2aa6 Mon Sep 17 00:00:00 2001 From: Trevor Eyre Date: Mon, 25 Feb 2019 13:38:35 -0700 Subject: [PATCH 05/37] Fixed iframe overflow bug for mobile Safari (#782) Fixed iframe overflow bug for mobile Safari --- src/themes/basic/_layout.styl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/themes/basic/_layout.styl b/src/themes/basic/_layout.styl index 4e00e33..387fd79 100644 --- a/src/themes/basic/_layout.styl +++ b/src/themes/basic/_layout.styl @@ -323,6 +323,9 @@ body.sticky .markdown-section iframe border 1px solid #eee + /* fix horizontal overflow on iOS Safari */ + width 1px + min-width 100% .markdown-section table border-collapse collapse From 2039e0dd1c61083324279479fff4b291408f1e7c Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Wed, 6 Mar 2019 21:53:09 +0100 Subject: [PATCH 06/37] rework TODOs --- test/_helper.js | 2 +- test/integration/render.js | 1 + test/integration/router.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/test/_helper.js b/test/_helper.js index 47e7578..4b4abce 100644 --- a/test/_helper.js +++ b/test/_helper.js @@ -63,7 +63,7 @@ module.exports.init = function(fixture = 'default', config = {}, markup) { return new Promise((resolve, reject) => { ready(() => { const docsify = new Docsify() - // TODO: use callback instead of polling, but usually it works after 10ms + // NOTE: I was not able to get it working with a callback, but polling works usually at the first time const id = setInterval(() => { if (dom.window.document.body.innerHTML.indexOf(NOT_INIT_PATTERN) == -1) { clearInterval(id) diff --git a/test/integration/render.js b/test/integration/render.js index adddfc4..7b2b253 100644 --- a/test/integration/render.js +++ b/test/integration/render.js @@ -8,6 +8,7 @@ describe('full docsify initialization', function() { it('TODO: check generated markup', async function() { const {docsify, dom} = await init('simple', {loadSidebar: true}) console.log(dom.window.document.body.innerHTML) + // TODO: add some expectations }) }) diff --git a/test/integration/router.js b/test/integration/router.js index 5408683..b87e802 100644 --- a/test/integration/router.js +++ b/test/integration/router.js @@ -8,6 +8,7 @@ describe('router', function() { it('TODO: trigger to load another page', async function() { const {docsify} = await init() window.location = '/?foo=bar' + // TODO: add some expectations }) }) From 21cde839490ad7fe1ea93a759a4cd2dcb26e6056 Mon Sep 17 00:00:00 2001 From: Gemma Black Date: Wed, 13 Mar 2019 11:39:54 +0000 Subject: [PATCH 07/37] Docsify publishing with AWS Amplify steps This is to help users be able to publish Docsify with AWS Amplify, so they don't get stuck on redirect rules and hash state issues. --- docs/deploy.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/docs/deploy.md b/docs/deploy.md index fdf0167..7d47e0f 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -87,3 +87,45 @@ When using the HTML5 router, you need to set up redirect rules that redirect all ```sh /* /index.html 200 ``` + +## AWS Amplify + +1. Set the routerMode in the Docsify project `index.html` to *history* mode. + +```html + +``` + +2. Login to your [AWS Console](https://aws.amazon.com). +3. Go to the [AWS Amplify Dashboard](https://aws.amazon.com/amplify). +4. Choose the **Deploy** route to setup your project. +5. When prompted, keep the build settings empty if you're serving your docs within the root directory. If you're serving your docs from a different directory, customise your amplify.yml + +```yml +version: 0.1 +frontend: + phases: + build: + commands: + - echo "Nothing to build" + artifacts: + baseDirectory: /docs + files: + - '**/*' + cache: + paths: [] + +``` + +6. Add the following Redirect rules in their displayed order. + +| Source address | Target address | Type | +|----------------|----------------|---------------| +| /<*>.md | /<*>.md | 200 (Rewrite) | +| /<*> | /index.html | 200 (Rewrite) | + From 31654f12eccd3e8353e7e94cd20f895a1918cc9f Mon Sep 17 00:00:00 2001 From: Sylvain Brocard Date: Thu, 6 Dec 2018 15:30:58 +0100 Subject: [PATCH 08/37] feat: allows relative path, fixed #590 --- docs/configuration.md | 40 +++++++++++++++++++++++++++++++++ src/core/config.js | 3 ++- src/core/router/history/base.js | 7 +++++- src/core/router/util.js | 14 ++++++++++++ 4 files changed, 62 insertions(+), 2 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index 830748f..ba48475 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -150,6 +150,46 @@ window.$docsify = { }; ``` +## relativePath + +- Type: `Boolean` +- Default: `false` + +If **true** links are relative to the current context. + +For example, the directory structure is as follows: + +```text +. +└── docs + ├── README.md + ├── guide.md + └── zh-cn + ├── README.md + ├── guide.md + └── config + └── example.md +``` + +With relative path **enabled** and current URL `http://domain.com/zh-cn/README`, given links will resolve to: + +```text +guide.md => http://domain.com/zh-cn/guide +config/example.md => http://domain.com/zh-cn/config/example +../README.md => http://domain.com/README +/README.md => http://domain.com/README +``` + +```js +window.$docsify = { + // Relative path enabled + relativePath: true, + + // Relative path disabled (default value) + relativePath: false +}; +``` + ## coverpage - Type: `Boolean|String|String[]|Object` diff --git a/src/core/config.js b/src/core/config.js index 0a8763a..a1386b2 100644 --- a/src/core/config.js +++ b/src/core/config.js @@ -25,7 +25,8 @@ export default function () { formatUpdated: '', externalLinkTarget: '_blank', routerMode: 'hash', - noCompileLinks: [] + noCompileLinks: [], + relativePath: false }, window.$docsify ) diff --git a/src/core/router/history/base.js b/src/core/router/history/base.js index 0f9900d..c58a1f9 100644 --- a/src/core/router/history/base.js +++ b/src/core/router/history/base.js @@ -3,7 +3,8 @@ import { isAbsolutePath, stringifyQuery, cleanPath, - replaceSlug + replaceSlug, + resolvePath } from '../util' import {noop, merge} from '../../util/core' @@ -76,6 +77,10 @@ export class History { (idIndex > 0 ? currentRoute.substr(0, idIndex) : currentRoute) + path } + if (this.config.relativePath && !path.startsWith('/')) { + const currentDir = currentRoute.substr(0, currentRoute.lastIndexOf('/') + 1) + return cleanPath(resolvePath(currentDir + path)) + } return cleanPath('/' + path) } } diff --git a/src/core/router/util.js b/src/core/router/util.js index 217461f..2ed88c5 100644 --- a/src/core/router/util.js +++ b/src/core/router/util.js @@ -53,6 +53,20 @@ export const cleanPath = cached(path => { return path.replace(/^\/+/, '/').replace(/([^:])\/{2,}/g, '$1/') }) +export const resolvePath = cached(path => { + const segments = path.replace(/^\//, '').split('/') + let resolved = [] + for (let i = 0, len = segments.length; i < len; i++) { + const segment = segments[i] + if (segment === '..') { + resolved.pop() + } else if (segment !== '.') { + resolved.push(segment) + } + } + return '/' + resolved.join('/') +}) + export function getPath(...args) { return cleanPath(args.join('/')) } From ca8ae5071725515f7aa2c7d4ce24150adbc31ed0 Mon Sep 17 00:00:00 2001 From: Sylvain Brocard Date: Mon, 25 Mar 2019 17:20:09 +0100 Subject: [PATCH 09/37] IE compatibility and add unit tests --- src/core/router/history/base.js | 6 ++-- test/unit/base.js | 62 +++++++++++++++++++++++++++++++++ test/unit/util.js | 30 ++++++++++++++++ 3 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 test/unit/base.js create mode 100644 test/unit/util.js diff --git a/src/core/router/history/base.js b/src/core/router/history/base.js index c58a1f9..7ea763d 100644 --- a/src/core/router/history/base.js +++ b/src/core/router/history/base.js @@ -74,11 +74,11 @@ export class History { if (local) { const idIndex = currentRoute.indexOf('?') path = - (idIndex > 0 ? currentRoute.substr(0, idIndex) : currentRoute) + path + (idIndex > 0 ? currentRoute.substring(0, idIndex) : currentRoute) + path } - if (this.config.relativePath && !path.startsWith('/')) { - const currentDir = currentRoute.substr(0, currentRoute.lastIndexOf('/') + 1) + if (this.config.relativePath && path.indexOf('/') !== 0) { + const currentDir = currentRoute.substring(0, currentRoute.lastIndexOf('/') + 1) return cleanPath(resolvePath(currentDir + path)) } return cleanPath('/' + path) diff --git a/test/unit/base.js b/test/unit/base.js new file mode 100644 index 0000000..036700b --- /dev/null +++ b/test/unit/base.js @@ -0,0 +1,62 @@ +/* eslint-env node, chai, mocha */ +require = require('esm')(module/*, options*/) +const {expect} = require('chai') +const {History} = require('../../src/core/router/history/base') + +class MockHistory extends History { + parse(path) { + return {path} + } +} + +describe('router/history/base', function () { + describe('relativePath true', function () { + var history + + beforeEach(function () { + history = new MockHistory({relativePath: true}) + }) + + it('toURL', function () { + // WHEN + const url = history.toURL('guide.md', {}, '/zh-ch/') + + // THEN + expect(url).equal('/zh-ch/guide') + }) + + it('toURL with double dot', function () { + // WHEN + const url = history.toURL('../README.md', {}, '/zh-ch/') + + // THEN + expect(url).equal('/README') + }) + + it('toURL child path', function () { + // WHEN + const url = history.toURL('config/example.md', {}, '/zh-ch/') + + // THEN + expect(url).equal('/zh-ch/config/example') + }) + + it('toURL absolute path', function () { + // WHEN + const url = history.toURL('/README', {}, '/zh-ch/') + + // THEN + expect(url).equal('/README') + }) + }) + + it('toURL without relative path', function () { + const history = new MockHistory({relativePath: false}) + + // WHEN + const url = history.toURL('README', {}, '/zh-ch/') + + // THEN + expect(url).equal('/README') + }) +}) diff --git a/test/unit/util.js b/test/unit/util.js new file mode 100644 index 0000000..1e65daf --- /dev/null +++ b/test/unit/util.js @@ -0,0 +1,30 @@ +/* eslint-env node, chai, mocha */ +require = require('esm')(module/*, options*/) +const {expect} = require('chai') +const {resolvePath} = require('../../src/core/router/util') + +describe('router/util', function () { + it('resolvePath', async function () { + // WHEN + const result = resolvePath('hello.md') + + // THEN + expect(result).equal('/hello.md') + }) + + it('resolvePath with dot', async function () { + // WHEN + const result = resolvePath('./hello.md') + + // THEN + expect(result).equal('/hello.md') + }) + + it('resolvePath with two dots', async function () { + // WHEN + const result = resolvePath('test/../hello.md') + + // THEN + expect(result).equal('/hello.md') + }) +}) From 24e61f5e2f91feddec7f9fbe5ea6b492208ff9a0 Mon Sep 17 00:00:00 2001 From: cyrilf Date: Sat, 6 Apr 2019 00:11:54 +1000 Subject: [PATCH 10/37] Fix typo in Edit Button example Missing trailing slash in the Edit button url --- docs/write-a-plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/write-a-plugin.md b/docs/write-a-plugin.md index d6605d4..baa894e 100644 --- a/docs/write-a-plugin.md +++ b/docs/write-a-plugin.md @@ -79,7 +79,7 @@ window.$docsify = { function(hook, vm) { hook.beforeEach(function(html) { var url = - 'https://github.com/docsifyjs/docsify/blob/master/docs' + + 'https://github.com/docsifyjs/docsify/blob/master/docs/' + vm.route.file; var editHtml = '[📝 EDIT DOCUMENT](' + url + ')\n'; From 09616dec06fd94d06e9be1646a04eab445c3fdd6 Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sat, 13 Apr 2019 15:28:12 +0200 Subject: [PATCH 11/37] Update GitHub templates --- .github/ISSUE_TEMPLATE.md | 2 - .github/ISSUE_TEMPLATE/bug_report.md | 37 +++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 25 +++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 55 +++++++++++++++++++++-- 4 files changed, 114 insertions(+), 5 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 0bd565e..0000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,2 +0,0 @@ - \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..c713d06 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,37 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + + + + + +## Bug Report + +#### Steps to reproduce + + + +#### What is current behaviour + + + +#### What is the expected behaviour + +--- + +- [ ] Bug does still occur when all/other plugins are disabled? + + +Environment: + +``` +docsify version: +docsify plugins: +browser: +``` + + \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..501e4de --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,25 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- + + + + + +## Feature request + +#### What problem does this feature solve? + + + +#### What does the proposed API look like? + + + +#### How should this be implemented in your opinion? + + + +#### Are you willing to work on this yourself? diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 79a5281..bb31bd4 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,54 @@ -Please makes sure these boxes are checked before submitting your PR, thank you! + + + + + + +**Summary** + +**What kind of change does this PR introduce?** (check at least one) + +- [ ] Bugfix +- [ ] Feature +- [ ] Code style update +- [ ] Refactor +- [ ] Docs +- [ ] Build-related changes +- [ ] Other, please describe: + +If changing the UI of default theme, please provide the **before/after** screenshot: + +**Does this PR introduce a breaking change?** (check one) + +- [ ] Yes +- [ ] No + +If yes, please describe the impact and migration path for existing applications: + +**The PR fulfills these requirements:** + +- [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number) + +You have tested in the following browsers: (Providing a detailed version will be better.) + +- [ ] Chrome +- [ ] Firefox +- [ ] Safari +- [ ] Edge +- [ ] IE + +If adding a **new feature**, the PR's description includes: + +- [ ] A convincing reason for adding this feature +- [ ] Related documents have been updated +- [ ] Related tests have been updated + +To avoid wasting your time, it's best to open a **feature request issue** first and wait for approval before working on it. + + +**Other information:** + +--- -* [ ] Make sure you are merging your commits to `master` branch. -* [ ] Add some descriptions and refer relative issues for you PR. * [ ] DO NOT include files inside `lib` directory. + From b15eccfac04c6f2b287094f835a5b95fb0fe728d Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sat, 13 Apr 2019 15:33:20 +0200 Subject: [PATCH 12/37] add npm and nodejs version to template --- .github/ISSUE_TEMPLATE/bug_report.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index c713d06..49012b0 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -28,6 +28,8 @@ about: Create a report to help us improve Environment: ``` +npm version: +nodejs version: docsify version: docsify plugins: browser: From 044a5ec2b8ce4d8ad791148b58b512561d500286 Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sat, 13 Apr 2019 15:41:35 +0200 Subject: [PATCH 13/37] add OS to GitHub template --- .github/ISSUE_TEMPLATE/bug_report.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 49012b0..1acca9b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -28,6 +28,7 @@ about: Create a report to help us improve Environment: ``` +operating system: npm version: nodejs version: docsify version: From 0bd5c8b020cc5f176c3f0154ddaefb01466dbcce Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sat, 13 Apr 2019 15:42:22 +0200 Subject: [PATCH 14/37] fix #812 add empty themes directory for local watch setup --- themes/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 themes/.gitkeep diff --git a/themes/.gitkeep b/themes/.gitkeep new file mode 100644 index 0000000..e69de29 From 5f960102e740906c56c32e3010b74a7e25958e2f Mon Sep 17 00:00:00 2001 From: Persevere Von Date: Tue, 9 Apr 2019 22:44:53 +0800 Subject: [PATCH 15/37] Create .gitkeep Fix #812 --- themes/.gitkeep | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/.gitkeep b/themes/.gitkeep index e69de29..8b13789 100644 --- a/themes/.gitkeep +++ b/themes/.gitkeep @@ -0,0 +1 @@ + From a86de3d81a97ce3d8a633af7ef218b0da8d7ce0a Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Tue, 26 Feb 2019 08:27:59 +0100 Subject: [PATCH 16/37] Remove IE10 from supported browsers --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a1ae1c8..276d10b 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ - Smart full-text search plugin - Multiple themes - Useful plugin API -- Compatible with IE10+ +- Compatible with IE11 - Support SSR ([example](https://github.com/docsifyjs/docsify-ssr-demo)) - Support embedded files From 314e2d9d39a024270403a42eb19bd98e6cce8d17 Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sun, 14 Apr 2019 11:27:03 +0200 Subject: [PATCH 17/37] Align IE support from root README.md --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index d27f1ae..1c07a8f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -16,7 +16,7 @@ See the [Quick start](quickstart.md) guide for more details. - Multiple themes - Useful plugin API - Emoji support -- Compatible with IE10+ +- Compatible with IE11 - Support server-side rendering ([example](https://github.com/docsifyjs/docsify-ssr-demo)) ## Examples From 514a0279912b758f8522ea9a686a02e116e2a1fc Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sun, 14 Apr 2019 21:01:24 +0200 Subject: [PATCH 18/37] Minor update of bug template --- .github/ISSUE_TEMPLATE/bug_report.md | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 1acca9b..35d6b90 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -20,21 +20,19 @@ about: Create a report to help us improve #### What is the expected behaviour ---- + +#### Other relevant information + + - [ ] Bug does still occur when all/other plugins are disabled? - -Environment: - -``` -operating system: -npm version: -nodejs version: -docsify version: -docsify plugins: -browser: -``` +- Your OS: +- Node.js version: +- npm/yarn version: +- Browser version: +- Docsify version: +- Docsify plugins: \ No newline at end of file +👉 https://opencollective.com/docsify/donate --> From e8d850c9baa76b5f823613494d8f24c3652dcec3 Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sat, 13 Apr 2019 23:22:36 +0200 Subject: [PATCH 19/37] align dev index.html to production --- index.html | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/index.html b/index.html index f15433b..59e6911 100644 --- a/index.html +++ b/index.html @@ -21,48 +21,64 @@ + + + + From b93a667f240378d8502cd4a59ec1d4049d79b491 Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sun, 14 Apr 2019 16:48:38 +0200 Subject: [PATCH 20/37] provide plugin for matomo --- docs/index.html | 5 +++++ src/plugins/matomo.js | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/plugins/matomo.js diff --git a/docs/index.html b/docs/index.html index e07c79e..6d0e008 100644 --- a/docs/index.html +++ b/docs/index.html @@ -44,6 +44,10 @@ maxLevel: 4, subMaxLevel: 2, ga: 'UA-106147152-1', + matomo: { + host: '//matomo.thunderwave.de', + id: 6 + }, name: 'docsify', search: { noData: { @@ -84,6 +88,7 @@ + diff --git a/src/plugins/matomo.js b/src/plugins/matomo.js new file mode 100644 index 0000000..7b61cba --- /dev/null +++ b/src/plugins/matomo.js @@ -0,0 +1,37 @@ +function appendScript(options) { + const script = document.createElement('script') + script.async = true + script.src = options.host + '/matomo.js' + document.body.appendChild(script) +} + +function init(options) { + window._paq = window._paq || [] + window._paq.push(['trackPageView']) + window._paq.push(['enableLinkTracking']) + setTimeout(function() { + appendScript(options) + window._paq.push(['setTrackerUrl', options.host + '/matomo.php']) + window._paq.push(['setSiteId', options.id + '']) + }, 0) +} + +function collect() { + if (!window._paq) { + init($docsify.matomo) + } + window._paq.push(['setCustomUrl', window.location.hash.substr(1)]) + window._paq.push(['setDocumentTitle', document.title]) + window._paq.push(['trackPageView']) +} + +const install = function (hook) { + if (!$docsify.matomo) { + console.error('[Docsify] matomo is required.') + return + } + + hook.beforeEach(collect) +} + +$docsify.plugins = [].concat(install, $docsify.plugins) From da3e2d7b180a4bdc28f3edf5b6775704ebc0dc6d Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sun, 21 Apr 2019 11:53:30 +0200 Subject: [PATCH 21/37] Remove lib directory from version control --- lib/docsify.js | 5091 ---------------------------- lib/docsify.min.js | 1 - lib/plugins/disqus.js | 54 - lib/plugins/disqus.min.js | 1 - lib/plugins/emoji.js | 903 ----- lib/plugins/emoji.min.js | 1 - lib/plugins/external-script.js | 28 - lib/plugins/external-script.min.js | 1 - lib/plugins/front-matter.js | 496 --- lib/plugins/front-matter.min.js | 1 - lib/plugins/ga.js | 41 - lib/plugins/ga.min.js | 1 - lib/plugins/gitalk.js | 20 - lib/plugins/gitalk.min.js | 1 - lib/plugins/search.js | 364 -- lib/plugins/search.min.js | 1 - lib/plugins/zoom-image.js | 40 - lib/plugins/zoom-image.min.js | 1 - lib/themes/buble.css | 1 - lib/themes/dark.css | 1 - lib/themes/dolphin.css | 1 - lib/themes/pure.css | 1 - lib/themes/vue.css | 1 - 23 files changed, 7051 deletions(-) delete mode 100644 lib/docsify.js delete mode 100644 lib/docsify.min.js delete mode 100644 lib/plugins/disqus.js delete mode 100644 lib/plugins/disqus.min.js delete mode 100644 lib/plugins/emoji.js delete mode 100644 lib/plugins/emoji.min.js delete mode 100644 lib/plugins/external-script.js delete mode 100644 lib/plugins/external-script.min.js delete mode 100644 lib/plugins/front-matter.js delete mode 100644 lib/plugins/front-matter.min.js delete mode 100644 lib/plugins/ga.js delete mode 100644 lib/plugins/ga.min.js delete mode 100644 lib/plugins/gitalk.js delete mode 100644 lib/plugins/gitalk.min.js delete mode 100644 lib/plugins/search.js delete mode 100644 lib/plugins/search.min.js delete mode 100644 lib/plugins/zoom-image.js delete mode 100644 lib/plugins/zoom-image.min.js delete mode 100644 lib/themes/buble.css delete mode 100644 lib/themes/dark.css delete mode 100644 lib/themes/dolphin.css delete mode 100644 lib/themes/pure.css delete mode 100644 lib/themes/vue.css diff --git a/lib/docsify.js b/lib/docsify.js deleted file mode 100644 index 51cb092..0000000 --- a/lib/docsify.js +++ /dev/null @@ -1,5091 +0,0 @@ -(function () { -/** - * Create a cached version of a pure function. - */ -function cached(fn) { - var cache = Object.create(null); - return function (str) { - var key = isPrimitive(str) ? str : JSON.stringify(str); - var hit = cache[key]; - return hit || (cache[key] = fn(str)) - } -} - -/** - * Hyphenate a camelCase string. - */ -var hyphenate = cached(function (str) { - return str.replace(/([A-Z])/g, function (m) { return '-' + m.toLowerCase(); }) -}); - -var hasOwn = Object.prototype.hasOwnProperty; - -/** - * Simple Object.assign polyfill - */ -var merge = - Object.assign || - function (to) { - var arguments$1 = arguments; - - for (var i = 1; i < arguments.length; i++) { - var from = Object(arguments$1[i]); - - for (var key in from) { - if (hasOwn.call(from, key)) { - to[key] = from[key]; - } - } - } - - return to - }; - -/** - * Check if value is primitive - */ -function isPrimitive(value) { - return typeof value === 'string' || typeof value === 'number' -} - -/** - * Perform no operation. - */ -function noop() {} - -/** - * Check if value is function - */ -function isFn(obj) { - return typeof obj === 'function' -} - -function config () { - var config = merge( - { - el: '#app', - repo: '', - maxLevel: 6, - subMaxLevel: 0, - loadSidebar: null, - loadNavbar: null, - homepage: 'README.md', - coverpage: '', - basePath: '', - auto2top: false, - name: '', - themeColor: '', - nameLink: window.location.pathname, - autoHeader: false, - executeScript: null, - noEmoji: false, - ga: '', - ext: '.md', - mergeNavbar: false, - formatUpdated: '', - externalLinkTarget: '_blank', - routerMode: 'hash', - noCompileLinks: [] - }, - window.$docsify - ); - - var script = - document.currentScript || - [].slice - .call(document.getElementsByTagName('script')) - .filter(function (n) { return /docsify\./.test(n.src); })[0]; - - if (script) { - for (var prop in config) { - if (hasOwn.call(config, prop)) { - var val = script.getAttribute('data-' + hyphenate(prop)); - - if (isPrimitive(val)) { - config[prop] = val === '' ? true : val; - } - } - } - - if (config.loadSidebar === true) { - config.loadSidebar = '_sidebar' + config.ext; - } - if (config.loadNavbar === true) { - config.loadNavbar = '_navbar' + config.ext; - } - if (config.coverpage === true) { - config.coverpage = '_coverpage' + config.ext; - } - if (config.repo === true) { - config.repo = ''; - } - if (config.name === true) { - config.name = ''; - } - } - - window.$docsify = config; - - return config -} - -function initLifecycle(vm) { - var hooks = [ - 'init', - 'mounted', - 'beforeEach', - 'afterEach', - 'doneEach', - 'ready' - ]; - - vm._hooks = {}; - vm._lifecycle = {}; - hooks.forEach(function (hook) { - var arr = (vm._hooks[hook] = []); - vm._lifecycle[hook] = function (fn) { return arr.push(fn); }; - }); -} - -function callHook(vm, hook, data, next) { - if ( next === void 0 ) next = noop; - - var queue = vm._hooks[hook]; - - var step = function (index) { - var hook = queue[index]; - if (index >= queue.length) { - next(data); - } else if (typeof hook === 'function') { - if (hook.length === 2) { - hook(data, function (result) { - data = result; - step(index + 1); - }); - } else { - var result = hook(data); - data = result === undefined ? data : result; - step(index + 1); - } - } else { - step(index + 1); - } - }; - - step(0); -} - -var inBrowser = !false; - -var isMobile = inBrowser && document.body.clientWidth <= 600; - -/** - * @see https://github.com/MoOx/pjax/blob/master/lib/is-supported.js - */ -var supportsPushState = - inBrowser && - (function () { - // Borrowed wholesale from https://github.com/defunkt/jquery-pjax - return ( - window.history && - window.history.pushState && - window.history.replaceState && - // PushState isn’t reliable on iOS until 5. - !navigator.userAgent.match( - /((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/ - ) - ) - })(); - -var cacheNode = {}; - -/** - * Get Node - * @param {String|Element} el - * @param {Boolean} noCache - * @return {Element} - */ -function getNode(el, noCache) { - if ( noCache === void 0 ) noCache = false; - - if (typeof el === 'string') { - if (typeof window.Vue !== 'undefined') { - return find(el) - } - el = noCache ? find(el) : cacheNode[el] || (cacheNode[el] = find(el)); - } - - return el -} - -var $ = inBrowser && document; - -var body = inBrowser && $.body; - -var head = inBrowser && $.head; - -/** - * Find element - * @example - * find('nav') => document.querySelector('nav') - * find(nav, 'a') => nav.querySelector('a') - */ -function find(el, node) { - return node ? el.querySelector(node) : $.querySelector(el) -} - -/** - * Find all elements - * @example - * findAll('a') => [].slice.call(document.querySelectorAll('a')) - * findAll(nav, 'a') => [].slice.call(nav.querySelectorAll('a')) - */ -function findAll(el, node) { - return [].slice.call( - node ? el.querySelectorAll(node) : $.querySelectorAll(el) - ) -} - -function create(node, tpl) { - node = $.createElement(node); - if (tpl) { - node.innerHTML = tpl; - } - return node -} - -function appendTo(target, el) { - return target.appendChild(el) -} - -function before(target, el) { - return target.insertBefore(el, target.children[0]) -} - -function on(el, type, handler) { - isFn(type) ? - window.addEventListener(el, type) : - el.addEventListener(type, handler); -} - -function off(el, type, handler) { - isFn(type) ? - window.removeEventListener(el, type) : - el.removeEventListener(type, handler); -} - -/** - * Toggle class - * - * @example - * toggleClass(el, 'active') => el.classList.toggle('active') - * toggleClass(el, 'add', 'active') => el.classList.add('active') - */ -function toggleClass(el, type, val) { - el && el.classList[val ? type : 'toggle'](val || type); -} - -function style(content) { - appendTo(head, create('style', content)); -} - - -var dom = Object.freeze({ - getNode: getNode, - $: $, - body: body, - head: head, - find: find, - findAll: findAll, - create: create, - appendTo: appendTo, - before: before, - on: on, - off: off, - toggleClass: toggleClass, - style: style -}); - -/** - * Render github corner - * @param {Object} data - * @return {String} - */ -function corner(data) { - if (!data) { - return '' - } - if (!/\/\//.test(data)) { - data = 'https://github.com/' + data; - } - data = data.replace(/^git\+/, ''); - - return ( - "" + - '' + - '' - ) -} - -/** - * Render main content - */ -function main(config) { - var aside = - '' + - ''; - - return ( - (isMobile ? (aside + "
") : ("
" + aside)) + - '
' + - '
' + - '
' + - '
' - ) -} - -/** - * Cover Page - */ -function cover() { - var SL = ', 100%, 85%'; - var bgc = - 'linear-gradient(to left bottom, ' + - "hsl(" + (Math.floor(Math.random() * 255) + SL) + ") 0%," + - "hsl(" + (Math.floor(Math.random() * 255) + SL) + ") 100%)"; - - return ( - "
" + - '
' + - '
' + - '
' - ) -} - -/** - * Render tree - * @param {Array} tree - * @param {String} tpl - * @return {String} - */ -function tree(toc, tpl) { - if ( tpl === void 0 ) tpl = '
    {inner}
'; - - if (!toc || !toc.length) { - return '' - } - var innerHTML = ''; - toc.forEach(function (node) { - innerHTML += "
  • " + (node.title) + "
  • "; - if (node.children) { - innerHTML += tree(node.children, tpl); - } - }); - return tpl.replace('{inner}', innerHTML) -} - -function helper(className, content) { - return ("

    " + (content.slice(5).trim()) + "

    ") -} - -function theme(color) { - return ("") -} - -var barEl; -var timeId; - -/** - * Init progress component - */ -function init() { - var div = create('div'); - - div.classList.add('progress'); - appendTo(body, div); - barEl = div; -} -/** - * Render progress bar - */ -function progressbar (ref) { - var loaded = ref.loaded; - var total = ref.total; - var step = ref.step; - - var num; - - !barEl && init(); - - if (step) { - num = parseInt(barEl.style.width || 0, 10) + step; - num = num > 80 ? 80 : num; - } else { - num = Math.floor(loaded / total * 100); - } - - barEl.style.opacity = 1; - barEl.style.width = num >= 95 ? '100%' : num + '%'; - - if (num >= 95) { - clearTimeout(timeId); - timeId = setTimeout(function (_) { - barEl.style.opacity = 0; - barEl.style.width = '0%'; - }, 200); - } -} - -var cache = {}; - -/** - * Simple ajax get - * @param {string} url - * @param {boolean} [hasBar=false] has progress bar - * @return { then(resolve, reject), abort } - */ -function get(url, hasBar, headers) { - if ( hasBar === void 0 ) hasBar = false; - if ( headers === void 0 ) headers = {}; - - var xhr = new XMLHttpRequest(); - var on = function () { - xhr.addEventListener.apply(xhr, arguments); - }; - var cached$$1 = cache[url]; - - if (cached$$1) { - return {then: function (cb) { return cb(cached$$1.content, cached$$1.opt); }, abort: noop} - } - - xhr.open('GET', url); - for (var i in headers) { - if (hasOwn.call(headers, i)) { - xhr.setRequestHeader(i, headers[i]); - } - } - xhr.send(); - - return { - then: function (success, error) { - if ( error === void 0 ) error = noop; - - if (hasBar) { - var id = setInterval( - function (_) { return progressbar({ - step: Math.floor(Math.random() * 5 + 1) - }); }, - 500 - ); - - on('progress', progressbar); - on('loadend', function (evt) { - progressbar(evt); - clearInterval(id); - }); - } - - on('error', error); - on('load', function (ref) { - var target = ref.target; - - if (target.status >= 400) { - error(target); - } else { - var result = (cache[url] = { - content: target.response, - opt: { - updatedAt: xhr.getResponseHeader('last-modified') - } - }); - - success(result.content, result.opt); - } - }); - }, - abort: function (_) { return xhr.readyState !== 4 && xhr.abort(); } - } -} - -function replaceVar(block, color) { - block.innerHTML = block.innerHTML.replace( - /var\(\s*--theme-color.*?\)/g, - color - ); -} - -function cssVars (color) { - // Variable support - if (window.CSS && window.CSS.supports && window.CSS.supports('(--v:red)')) { - return - } - - var styleBlocks = findAll('style:not(.inserted),link'); - [].forEach.call(styleBlocks, function (block) { - if (block.nodeName === 'STYLE') { - replaceVar(block, color); - } else if (block.nodeName === 'LINK') { - var href = block.getAttribute('href'); - - if (!/\.css$/.test(href)) { - return - } - - get(href).then(function (res) { - var style$$1 = create('style', res); - - head.appendChild(style$$1); - replaceVar(style$$1, color); - }); - } - }); -} - -var RGX = /([^{]*?)\w(?=\})/g; - -var dict = { - YYYY: 'getFullYear', - YY: 'getYear', - MM: function (d) { - return d.getMonth() + 1; - }, - DD: 'getDate', - HH: 'getHours', - mm: 'getMinutes', - ss: 'getSeconds' -}; - -function tinydate (str) { - var parts=[], offset=0; - str.replace(RGX, function (key, _, idx) { - // save preceding string - parts.push(str.substring(offset, idx - 1)); - offset = idx += key.length + 1; - // save function - parts.push(function(d){ - return ('00' + (typeof dict[key]==='string' ? d[dict[key]]() : dict[key](d))).slice(-key.length); - }); - }); - - if (offset !== str.length) { - parts.push(str.substring(offset)); - } - - return function (arg) { - var out='', i=0, d=arg||new Date(); - for (; i ?(paragraph|[^\n]*)(?:\n|$))+/, - list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, - html: '^ {0,3}(?:' // optional indentation - + '<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)' // (1) - + '|comment[^\\n]*(\\n+|$)' // (2) - + '|<\\?[\\s\\S]*?\\?>\\n*' // (3) - + '|\\n*' // (4) - + '|\\n*' // (5) - + '|)[\\s\\S]*?(?:\\n{2,}|$)' // (6) - + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag - + '|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag - + ')', - def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, - table: noop, - lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, - paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/, - text: /^[^\n]+/ -}; - -block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/; -block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; -block.def = edit(block.def) - .replace('label', block._label) - .replace('title', block._title) - .getRegex(); - -block.bullet = /(?:[*+-]|\d+\.)/; -block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; -block.item = edit(block.item, 'gm') - .replace(/bull/g, block.bullet) - .getRegex(); - -block.list = edit(block.list) - .replace(/bull/g, block.bullet) - .replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))') - .replace('def', '\\n+(?=' + block.def.source + ')') - .getRegex(); - -block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' - + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' - + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' - + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' - + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' - + '|track|ul'; -block._comment = //; -block.html = edit(block.html, 'i') - .replace('comment', block._comment) - .replace('tag', block._tag) - .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/) - .getRegex(); - -block.paragraph = edit(block.paragraph) - .replace('hr', block.hr) - .replace('heading', block.heading) - .replace('lheading', block.lheading) - .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks - .getRegex(); - -block.blockquote = edit(block.blockquote) - .replace('paragraph', block.paragraph) - .getRegex(); - -/** - * Normal Block Grammar - */ - -block.normal = merge({}, block); - -/** - * GFM Block Grammar - */ - -block.gfm = merge({}, block.normal, { - fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/, - paragraph: /^/, - heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ -}); - -block.gfm.paragraph = edit(block.paragraph) - .replace('(?!', '(?!' - + block.gfm.fences.source.replace('\\1', '\\2') + '|' - + block.list.source.replace('\\1', '\\3') + '|') - .getRegex(); - -/** - * GFM + Tables Block Grammar - */ - -block.tables = merge({}, block.gfm, { - nptable: /^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/, - table: /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/ -}); - -/** - * Pedantic grammar - */ - -block.pedantic = merge({}, block.normal, { - html: edit( - '^ *(?:comment *(?:\\n|\\s*$)' - + '|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)' // closed tag - + '|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))') - .replace('comment', block._comment) - .replace(/tag/g, '(?!(?:' - + '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') - .getRegex(), - def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/ -}); - -/** - * Block Lexer - */ - -function Lexer(options) { - this.tokens = []; - this.tokens.links = Object.create(null); - this.options = options || marked.defaults; - this.rules = block.normal; - - if (this.options.pedantic) { - this.rules = block.pedantic; - } else if (this.options.gfm) { - if (this.options.tables) { - this.rules = block.tables; - } else { - this.rules = block.gfm; - } - } -} - -/** - * Expose Block Rules - */ - -Lexer.rules = block; - -/** - * Static Lex Method - */ - -Lexer.lex = function(src, options) { - var lexer = new Lexer(options); - return lexer.lex(src); -}; - -/** - * Preprocessing - */ - -Lexer.prototype.lex = function(src) { - src = src - .replace(/\r\n|\r/g, '\n') - .replace(/\t/g, ' ') - .replace(/\u00a0/g, ' ') - .replace(/\u2424/g, '\n'); - - return this.token(src, true); -}; - -/** - * Lexing - */ - -Lexer.prototype.token = function(src, top) { - var this$1 = this; - - src = src.replace(/^ +$/gm, ''); - var next, - loose, - cap, - bull, - b, - item, - listStart, - listItems, - t, - space, - i, - tag, - l, - isordered, - istask, - ischecked; - - while (src) { - // newline - if (cap = this$1.rules.newline.exec(src)) { - src = src.substring(cap[0].length); - if (cap[0].length > 1) { - this$1.tokens.push({ - type: 'space' - }); - } - } - - // code - if (cap = this$1.rules.code.exec(src)) { - src = src.substring(cap[0].length); - cap = cap[0].replace(/^ {4}/gm, ''); - this$1.tokens.push({ - type: 'code', - text: !this$1.options.pedantic - ? rtrim(cap, '\n') - : cap - }); - continue; - } - - // fences (gfm) - if (cap = this$1.rules.fences.exec(src)) { - src = src.substring(cap[0].length); - this$1.tokens.push({ - type: 'code', - lang: cap[2], - text: cap[3] || '' - }); - continue; - } - - // heading - if (cap = this$1.rules.heading.exec(src)) { - src = src.substring(cap[0].length); - this$1.tokens.push({ - type: 'heading', - depth: cap[1].length, - text: cap[2] - }); - continue; - } - - // table no leading pipe (gfm) - if (top && (cap = this$1.rules.nptable.exec(src))) { - item = { - type: 'table', - header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] - }; - - if (item.header.length === item.align.length) { - src = src.substring(cap[0].length); - - for (i = 0; i < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = splitCells(item.cells[i], item.header.length); - } - - this$1.tokens.push(item); - - continue; - } - } - - // hr - if (cap = this$1.rules.hr.exec(src)) { - src = src.substring(cap[0].length); - this$1.tokens.push({ - type: 'hr' - }); - continue; - } - - // blockquote - if (cap = this$1.rules.blockquote.exec(src)) { - src = src.substring(cap[0].length); - - this$1.tokens.push({ - type: 'blockquote_start' - }); - - cap = cap[0].replace(/^ *> ?/gm, ''); - - // Pass `top` to keep the current - // "toplevel" state. This is exactly - // how markdown.pl works. - this$1.token(cap, top); - - this$1.tokens.push({ - type: 'blockquote_end' - }); - - continue; - } - - // list - if (cap = this$1.rules.list.exec(src)) { - src = src.substring(cap[0].length); - bull = cap[2]; - isordered = bull.length > 1; - - listStart = { - type: 'list_start', - ordered: isordered, - start: isordered ? +bull : '', - loose: false - }; - - this$1.tokens.push(listStart); - - // Get each top-level item. - cap = cap[0].match(this$1.rules.item); - - listItems = []; - next = false; - l = cap.length; - i = 0; - - for (; i < l; i++) { - item = cap[i]; - - // Remove the list item's bullet - // so it is seen as the next token. - space = item.length; - item = item.replace(/^ *([*+-]|\d+\.) +/, ''); - - // Outdent whatever the - // list item contains. Hacky. - if (~item.indexOf('\n ')) { - space -= item.length; - item = !this$1.options.pedantic - ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') - : item.replace(/^ {1,4}/gm, ''); - } - - // Determine whether the next list item belongs here. - // Backpedal if it does not belong in this list. - if (this$1.options.smartLists && i !== l - 1) { - b = block.bullet.exec(cap[i + 1])[0]; - if (bull !== b && !(bull.length > 1 && b.length > 1)) { - src = cap.slice(i + 1).join('\n') + src; - i = l - 1; - } - } - - // Determine whether item is loose or not. - // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ - // for discount behavior. - loose = next || /\n\n(?!\s*$)/.test(item); - if (i !== l - 1) { - next = item.charAt(item.length - 1) === '\n'; - if (!loose) { loose = next; } - } - - if (loose) { - listStart.loose = true; - } - - // Check for task list items - istask = /^\[[ xX]\] /.test(item); - ischecked = undefined; - if (istask) { - ischecked = item[1] !== ' '; - item = item.replace(/^\[[ xX]\] +/, ''); - } - - t = { - type: 'list_item_start', - task: istask, - checked: ischecked, - loose: loose - }; - - listItems.push(t); - this$1.tokens.push(t); - - // Recurse. - this$1.token(item, false); - - this$1.tokens.push({ - type: 'list_item_end' - }); - } - - if (listStart.loose) { - l = listItems.length; - i = 0; - for (; i < l; i++) { - listItems[i].loose = true; - } - } - - this$1.tokens.push({ - type: 'list_end' - }); - - continue; - } - - // html - if (cap = this$1.rules.html.exec(src)) { - src = src.substring(cap[0].length); - this$1.tokens.push({ - type: this$1.options.sanitize - ? 'paragraph' - : 'html', - pre: !this$1.options.sanitizer - && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), - text: cap[0] - }); - continue; - } - - // def - if (top && (cap = this$1.rules.def.exec(src))) { - src = src.substring(cap[0].length); - if (cap[3]) { cap[3] = cap[3].substring(1, cap[3].length - 1); } - tag = cap[1].toLowerCase().replace(/\s+/g, ' '); - if (!this$1.tokens.links[tag]) { - this$1.tokens.links[tag] = { - href: cap[2], - title: cap[3] - }; - } - continue; - } - - // table (gfm) - if (top && (cap = this$1.rules.table.exec(src))) { - item = { - type: 'table', - header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3] ? cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') : [] - }; - - if (item.header.length === item.align.length) { - src = src.substring(cap[0].length); - - for (i = 0; i < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = splitCells( - item.cells[i].replace(/^ *\| *| *\| *$/g, ''), - item.header.length); - } - - this$1.tokens.push(item); - - continue; - } - } - - // lheading - if (cap = this$1.rules.lheading.exec(src)) { - src = src.substring(cap[0].length); - this$1.tokens.push({ - type: 'heading', - depth: cap[2] === '=' ? 1 : 2, - text: cap[1] - }); - continue; - } - - // top-level paragraph - if (top && (cap = this$1.rules.paragraph.exec(src))) { - src = src.substring(cap[0].length); - this$1.tokens.push({ - type: 'paragraph', - text: cap[1].charAt(cap[1].length - 1) === '\n' - ? cap[1].slice(0, -1) - : cap[1] - }); - continue; - } - - // text - if (cap = this$1.rules.text.exec(src)) { - // Top-level should never reach here. - src = src.substring(cap[0].length); - this$1.tokens.push({ - type: 'text', - text: cap[0] - }); - continue; - } - - if (src) { - throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); - } - } - - return this.tokens; -}; - -/** - * Inline-Level Grammar - */ - -var inline = { - escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, - autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, - url: noop, - tag: '^comment' - + '|^' // self-closing tag - + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag - + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. - + '|^' // declaration, e.g. - + '|^', // CDATA section - link: /^!?\[(label)\]\(href(?:\s+(title))?\s*\)/, - reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, - nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, - strong: /^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/, - em: /^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/, - code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, - br: /^( {2,}|\\)\n(?!\s*$)/, - del: noop, - text: /^(`+|[^`])[\s\S]*?(?=[\\?@\[\]\\^_`{|}~])/g; - -inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/; -inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/; -inline.autolink = edit(inline.autolink) - .replace('scheme', inline._scheme) - .replace('email', inline._email) - .getRegex(); - -inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/; - -inline.tag = edit(inline.tag) - .replace('comment', block._comment) - .replace('attribute', inline._attribute) - .getRegex(); - -inline._label = /(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/; -inline._href = /\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f\\]*\)|[^\s\x00-\x1f()\\])*?)/; -inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/; - -inline.link = edit(inline.link) - .replace('label', inline._label) - .replace('href', inline._href) - .replace('title', inline._title) - .getRegex(); - -inline.reflink = edit(inline.reflink) - .replace('label', inline._label) - .getRegex(); - -/** - * Normal Inline Grammar - */ - -inline.normal = merge({}, inline); - -/** - * Pedantic Inline Grammar - */ - -inline.pedantic = merge({}, inline.normal, { - strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, - em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/, - link: edit(/^!?\[(label)\]\((.*?)\)/) - .replace('label', inline._label) - .getRegex(), - reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/) - .replace('label', inline._label) - .getRegex() -}); - -/** - * GFM Inline Grammar - */ - -inline.gfm = merge({}, inline.normal, { - escape: edit(inline.escape).replace('])', '~|])').getRegex(), - _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/, - url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, - _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/, - del: /^~+(?=\S)([\s\S]*?\S)~+/, - text: edit(inline.text) - .replace(']|', '~]|') - .replace('|$', '|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&\'*+/=?^_`{\\|}~-]+@|$') - .getRegex() -}); - -inline.gfm.url = edit(inline.gfm.url) - .replace('email', inline.gfm._extended_email) - .getRegex(); -/** - * GFM + Line Breaks Inline Grammar - */ - -inline.breaks = merge({}, inline.gfm, { - br: edit(inline.br).replace('{2,}', '*').getRegex(), - text: edit(inline.gfm.text).replace('{2,}', '*').getRegex() -}); - -/** - * Inline Lexer & Compiler - */ - -function InlineLexer(links, options) { - this.options = options || marked.defaults; - this.links = links; - this.rules = inline.normal; - this.renderer = this.options.renderer || new Renderer(); - this.renderer.options = this.options; - - if (!this.links) { - throw new Error('Tokens array requires a `links` property.'); - } - - if (this.options.pedantic) { - this.rules = inline.pedantic; - } else if (this.options.gfm) { - if (this.options.breaks) { - this.rules = inline.breaks; - } else { - this.rules = inline.gfm; - } - } -} - -/** - * Expose Inline Rules - */ - -InlineLexer.rules = inline; - -/** - * Static Lexing/Compiling Method - */ - -InlineLexer.output = function(src, links, options) { - var inline = new InlineLexer(links, options); - return inline.output(src); -}; - -/** - * Lexing/Compiling - */ - -InlineLexer.prototype.output = function(src) { - var this$1 = this; - - var out = '', - link, - text, - href, - title, - cap, - prevCapZero; - - while (src) { - // escape - if (cap = this$1.rules.escape.exec(src)) { - src = src.substring(cap[0].length); - out += cap[1]; - continue; - } - - // autolink - if (cap = this$1.rules.autolink.exec(src)) { - src = src.substring(cap[0].length); - if (cap[2] === '@') { - text = escape(this$1.mangle(cap[1])); - href = 'mailto:' + text; - } else { - text = escape(cap[1]); - href = text; - } - out += this$1.renderer.link(href, null, text); - continue; - } - - // url (gfm) - if (!this$1.inLink && (cap = this$1.rules.url.exec(src))) { - if (cap[2] === '@') { - text = escape(cap[0]); - href = 'mailto:' + text; - } else { - // do extended autolink path validation - do { - prevCapZero = cap[0]; - cap[0] = this$1.rules._backpedal.exec(cap[0])[0]; - } while (prevCapZero !== cap[0]); - text = escape(cap[0]); - if (cap[1] === 'www.') { - href = 'http://' + text; - } else { - href = text; - } - } - src = src.substring(cap[0].length); - out += this$1.renderer.link(href, null, text); - continue; - } - - // tag - if (cap = this$1.rules.tag.exec(src)) { - if (!this$1.inLink && /^/i.test(cap[0])) { - this$1.inLink = false; - } - if (!this$1.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - this$1.inRawBlock = true; - } else if (this$1.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - this$1.inRawBlock = false; - } - - src = src.substring(cap[0].length); - out += this$1.options.sanitize - ? this$1.options.sanitizer - ? this$1.options.sanitizer(cap[0]) - : escape(cap[0]) - : cap[0]; - continue; - } - - // link - if (cap = this$1.rules.link.exec(src)) { - src = src.substring(cap[0].length); - this$1.inLink = true; - href = cap[2]; - if (this$1.options.pedantic) { - link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); - - if (link) { - href = link[1]; - title = link[3]; - } else { - title = ''; - } - } else { - title = cap[3] ? cap[3].slice(1, -1) : ''; - } - href = href.trim().replace(/^<([\s\S]*)>$/, '$1'); - out += this$1.outputLink(cap, { - href: InlineLexer.escapes(href), - title: InlineLexer.escapes(title) - }); - this$1.inLink = false; - continue; - } - - // reflink, nolink - if ((cap = this$1.rules.reflink.exec(src)) - || (cap = this$1.rules.nolink.exec(src))) { - src = src.substring(cap[0].length); - link = (cap[2] || cap[1]).replace(/\s+/g, ' '); - link = this$1.links[link.toLowerCase()]; - if (!link || !link.href) { - out += cap[0].charAt(0); - src = cap[0].substring(1) + src; - continue; - } - this$1.inLink = true; - out += this$1.outputLink(cap, link); - this$1.inLink = false; - continue; - } - - // strong - if (cap = this$1.rules.strong.exec(src)) { - src = src.substring(cap[0].length); - out += this$1.renderer.strong(this$1.output(cap[4] || cap[3] || cap[2] || cap[1])); - continue; - } - - // em - if (cap = this$1.rules.em.exec(src)) { - src = src.substring(cap[0].length); - out += this$1.renderer.em(this$1.output(cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1])); - continue; - } - - // code - if (cap = this$1.rules.code.exec(src)) { - src = src.substring(cap[0].length); - out += this$1.renderer.codespan(escape(cap[2].trim(), true)); - continue; - } - - // br - if (cap = this$1.rules.br.exec(src)) { - src = src.substring(cap[0].length); - out += this$1.renderer.br(); - continue; - } - - // del (gfm) - if (cap = this$1.rules.del.exec(src)) { - src = src.substring(cap[0].length); - out += this$1.renderer.del(this$1.output(cap[1])); - continue; - } - - // text - if (cap = this$1.rules.text.exec(src)) { - src = src.substring(cap[0].length); - if (this$1.inRawBlock) { - out += this$1.renderer.text(cap[0]); - } else { - out += this$1.renderer.text(escape(this$1.smartypants(cap[0]))); - } - continue; - } - - if (src) { - throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); - } - } - - return out; -}; - -InlineLexer.escapes = function(text) { - return text ? text.replace(InlineLexer.rules._escapes, '$1') : text; -}; - -/** - * Compile Link - */ - -InlineLexer.prototype.outputLink = function(cap, link) { - var href = link.href, - title = link.title ? escape(link.title) : null; - - return cap[0].charAt(0) !== '!' - ? this.renderer.link(href, title, this.output(cap[1])) - : this.renderer.image(href, title, escape(cap[1])); -}; - -/** - * Smartypants Transformations - */ - -InlineLexer.prototype.smartypants = function(text) { - if (!this.options.smartypants) { return text; } - return text - // em-dashes - .replace(/---/g, '\u2014') - // en-dashes - .replace(/--/g, '\u2013') - // opening singles - .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') - // closing singles & apostrophes - .replace(/'/g, '\u2019') - // opening doubles - .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') - // closing doubles - .replace(/"/g, '\u201d') - // ellipses - .replace(/\.{3}/g, '\u2026'); -}; - -/** - * Mangle Links - */ - -InlineLexer.prototype.mangle = function(text) { - if (!this.options.mangle) { return text; } - var out = '', - l = text.length, - i = 0, - ch; - - for (; i < l; i++) { - ch = text.charCodeAt(i); - if (Math.random() > 0.5) { - ch = 'x' + ch.toString(16); - } - out += '&#' + ch + ';'; - } - - return out; -}; - -/** - * Renderer - */ - -function Renderer(options) { - this.options = options || marked.defaults; -} - -Renderer.prototype.code = function(code, lang, escaped) { - if (this.options.highlight) { - var out = this.options.highlight(code, lang); - if (out != null && out !== code) { - escaped = true; - code = out; - } - } - - if (!lang) { - return '
    '
    -      + (escaped ? code : escape(code, true))
    -      + '
    '; - } - - return '
    '
    -    + (escaped ? code : escape(code, true))
    -    + '
    \n'; -}; - -Renderer.prototype.blockquote = function(quote) { - return '
    \n' + quote + '
    \n'; -}; - -Renderer.prototype.html = function(html) { - return html; -}; - -Renderer.prototype.heading = function(text, level, raw) { - if (this.options.headerIds) { - return '' - + text - + '\n'; - } - // ignore IDs - return '' + text + '\n'; -}; - -Renderer.prototype.hr = function() { - return this.options.xhtml ? '
    \n' : '
    \n'; -}; - -Renderer.prototype.list = function(body, ordered, start) { - var type = ordered ? 'ol' : 'ul', - startatt = (ordered && start !== 1) ? (' start="' + start + '"') : ''; - return '<' + type + startatt + '>\n' + body + '\n'; -}; - -Renderer.prototype.listitem = function(text) { - return '
  • ' + text + '
  • \n'; -}; - -Renderer.prototype.checkbox = function(checked) { - return ' '; -}; - -Renderer.prototype.paragraph = function(text) { - return '

    ' + text + '

    \n'; -}; - -Renderer.prototype.table = function(header, body) { - if (body) { body = '' + body + ''; } - - return '\n' - + '\n' - + header - + '\n' - + body - + '
    \n'; -}; - -Renderer.prototype.tablerow = function(content) { - return '\n' + content + '\n'; -}; - -Renderer.prototype.tablecell = function(content, flags) { - var type = flags.header ? 'th' : 'td'; - var tag = flags.align - ? '<' + type + ' align="' + flags.align + '">' - : '<' + type + '>'; - return tag + content + '\n'; -}; - -// span level renderer -Renderer.prototype.strong = function(text) { - return '' + text + ''; -}; - -Renderer.prototype.em = function(text) { - return '' + text + ''; -}; - -Renderer.prototype.codespan = function(text) { - return '' + text + ''; -}; - -Renderer.prototype.br = function() { - return this.options.xhtml ? '
    ' : '
    '; -}; - -Renderer.prototype.del = function(text) { - return '' + text + ''; -}; - -Renderer.prototype.link = function(href, title, text) { - if (this.options.sanitize) { - try { - var prot = decodeURIComponent(unescape(href)) - .replace(/[^\w:]/g, '') - .toLowerCase(); - } catch (e) { - return text; - } - if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { - return text; - } - } - if (this.options.baseUrl && !originIndependentUrl.test(href)) { - href = resolveUrl(this.options.baseUrl, href); - } - try { - href = encodeURI(href).replace(/%25/g, '%'); - } catch (e) { - return text; - } - var out = '
    '; - return out; -}; - -Renderer.prototype.image = function(href, title, text) { - if (this.options.baseUrl && !originIndependentUrl.test(href)) { - href = resolveUrl(this.options.baseUrl, href); - } - var out = '' + text + '' : '>'; - return out; -}; - -Renderer.prototype.text = function(text) { - return text; -}; - -/** - * TextRenderer - * returns only the textual part of the token - */ - -function TextRenderer() {} - -// no need for block level renderers - -TextRenderer.prototype.strong = -TextRenderer.prototype.em = -TextRenderer.prototype.codespan = -TextRenderer.prototype.del = -TextRenderer.prototype.text = function (text) { - return text; -}; - -TextRenderer.prototype.link = -TextRenderer.prototype.image = function(href, title, text) { - return '' + text; -}; - -TextRenderer.prototype.br = function() { - return ''; -}; - -/** - * Parsing & Compiling - */ - -function Parser(options) { - this.tokens = []; - this.token = null; - this.options = options || marked.defaults; - this.options.renderer = this.options.renderer || new Renderer(); - this.renderer = this.options.renderer; - this.renderer.options = this.options; -} - -/** - * Static Parse Method - */ - -Parser.parse = function(src, options) { - var parser = new Parser(options); - return parser.parse(src); -}; - -/** - * Parse Loop - */ - -Parser.prototype.parse = function(src) { - var this$1 = this; - - this.inline = new InlineLexer(src.links, this.options); - // use an InlineLexer with a TextRenderer to extract pure text - this.inlineText = new InlineLexer( - src.links, - merge({}, this.options, {renderer: new TextRenderer()}) - ); - this.tokens = src.reverse(); - - var out = ''; - while (this.next()) { - out += this$1.tok(); - } - - return out; -}; - -/** - * Next Token - */ - -Parser.prototype.next = function() { - return this.token = this.tokens.pop(); -}; - -/** - * Preview Next Token - */ - -Parser.prototype.peek = function() { - return this.tokens[this.tokens.length - 1] || 0; -}; - -/** - * Parse Text Tokens - */ - -Parser.prototype.parseText = function() { - var this$1 = this; - - var body = this.token.text; - - while (this.peek().type === 'text') { - body += '\n' + this$1.next().text; - } - - return this.inline.output(body); -}; - -/** - * Parse Current Token - */ - -Parser.prototype.tok = function() { - var this$1 = 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, - unescape(this.inlineText.output(this.token.text))); - } - case 'code': { - return this.renderer.code(this.token.text, - this.token.lang, - this.token.escaped); - } - case 'table': { - var header = '', - body = '', - i, - row, - cell, - j; - - // header - cell = ''; - for (i = 0; i < this.token.header.length; i++) { - cell += this$1.renderer.tablecell( - this$1.inline.output(this$1.token.header[i]), - { header: true, align: this$1.token.align[i] } - ); - } - header += this.renderer.tablerow(cell); - - for (i = 0; i < this.token.cells.length; i++) { - row = this$1.token.cells[i]; - - cell = ''; - for (j = 0; j < row.length; j++) { - cell += this$1.renderer.tablecell( - this$1.inline.output(row[j]), - { header: false, align: this$1.token.align[j] } - ); - } - - body += this$1.renderer.tablerow(cell); - } - return this.renderer.table(header, body); - } - case 'blockquote_start': { - body = ''; - - while (this.next().type !== 'blockquote_end') { - body += this$1.tok(); - } - - return this.renderer.blockquote(body); - } - case 'list_start': { - body = ''; - var ordered = this.token.ordered, - start = this.token.start; - - while (this.next().type !== 'list_end') { - body += this$1.tok(); - } - - return this.renderer.list(body, ordered, start); - } - case 'list_item_start': { - body = ''; - var loose = this.token.loose; - - if (this.token.task) { - body += this.renderer.checkbox(this.token.checked); - } - - while (this.next().type !== 'list_item_end') { - body += !loose && this$1.token.type === 'text' - ? this$1.parseText() - : this$1.tok(); - } - - return this.renderer.listitem(body); - } - case 'html': { - // TODO parse inline content if parameter markdown=1 - return this.renderer.html(this.token.text); - } - case 'paragraph': { - return this.renderer.paragraph(this.inline.output(this.token.text)); - } - case 'text': { - return this.renderer.paragraph(this.parseText()); - } - } -}; - -/** - * Helpers - */ - -function escape(html, encode) { - if (encode) { - if (escape.escapeTest.test(html)) { - return html.replace(escape.escapeReplace, function (ch) { return escape.replacements[ch] }); - } - } else { - if (escape.escapeTestNoEncode.test(html)) { - return html.replace(escape.escapeReplaceNoEncode, function (ch) { return escape.replacements[ch] }); - } - } - - return html; -} - -escape.escapeTest = /[&<>"']/; -escape.escapeReplace = /[&<>"']/g; -escape.replacements = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' -}; - -escape.escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/; -escape.escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g; - -function unescape(html) { - // explicitly match decimal, hex, and named HTML entities - return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, function(_, n) { - n = n.toLowerCase(); - if (n === 'colon') { return ':'; } - if (n.charAt(0) === '#') { - return n.charAt(1) === 'x' - ? String.fromCharCode(parseInt(n.substring(2), 16)) - : String.fromCharCode(+n.substring(1)); - } - return ''; - }); -} - -function edit(regex, opt) { - regex = regex.source || regex; - opt = opt || ''; - return { - replace: function(name, val) { - val = val.source || val; - val = val.replace(/(^|[^\[])\^/g, '$1'); - regex = regex.replace(name, val); - return this; - }, - getRegex: function() { - return new RegExp(regex, opt); - } - }; -} - -function resolveUrl(base, href) { - if (!baseUrls[' ' + base]) { - // we can ignore everything in base after the last slash of its path component, - // but we might need to add _that_ - // https://tools.ietf.org/html/rfc3986#section-3 - if (/^[^:]+:\/*[^/]*$/.test(base)) { - baseUrls[' ' + base] = base + '/'; - } else { - baseUrls[' ' + base] = rtrim(base, '/', true); - } - } - base = baseUrls[' ' + base]; - - if (href.slice(0, 2) === '//') { - return base.replace(/:[\s\S]*/, ':') + href; - } else if (href.charAt(0) === '/') { - return base.replace(/(:\/*[^/]*)[\s\S]*/, '$1') + href; - } else { - return base + href; - } -} -var baseUrls = {}; -var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i; - -function noop() {} -noop.exec = noop; - -function merge(obj) { - var arguments$1 = arguments; - - var i = 1, - target, - key; - - for (; i < arguments.length; i++) { - target = arguments$1[i]; - for (key in target) { - if (Object.prototype.hasOwnProperty.call(target, key)) { - obj[key] = target[key]; - } - } - } - - return obj; -} - -function splitCells(tableRow, count) { - // ensure that every cell-delimiting pipe has a space - // before it to distinguish it from an escaped pipe - var row = tableRow.replace(/\|/g, function (match, offset, str) { - var escaped = false, - curr = offset; - while (--curr >= 0 && str[curr] === '\\') { escaped = !escaped; } - if (escaped) { - // odd number of slashes means | is escaped - // so we leave it alone - return '|'; - } else { - // add space before unescaped | - return ' |'; - } - }), - cells = row.split(/ \|/), - i = 0; - - if (cells.length > count) { - cells.splice(count); - } else { - while (cells.length < count) { cells.push(''); } - } - - for (; i < cells.length; i++) { - // leading or trailing whitespace is ignored per the gfm spec - cells[i] = cells[i].trim().replace(/\\\|/g, '|'); - } - return cells; -} - -// Remove trailing 'c's. Equivalent to str.replace(/c*$/, ''). -// /c*$/ is vulnerable to REDOS. -// invert: Remove suffix of non-c chars instead. Default falsey. -function rtrim(str, c, invert) { - if (str.length === 0) { - return ''; - } - - // Length of suffix matching the invert condition. - var suffLen = 0; - - // Step left until we fail to match the invert condition. - while (suffLen < str.length) { - var currChar = str.charAt(str.length - suffLen - 1); - if (currChar === c && !invert) { - suffLen++; - } else if (currChar !== c && invert) { - suffLen++; - } else { - break; - } - } - - return str.substr(0, str.length - suffLen); -} - -/** - * Marked - */ - -function marked(src, opt, callback) { - // throw error in case of non string input - if (typeof src === 'undefined' || src === null) { - throw new Error('marked(): input parameter is undefined or null'); - } - if (typeof src !== 'string') { - throw new Error('marked(): input parameter is of type ' - + Object.prototype.toString.call(src) + ', string expected'); - } - - if (callback || typeof opt === 'function') { - if (!callback) { - callback = opt; - opt = null; - } - - opt = merge({}, marked.defaults, opt || {}); - - var highlight = opt.highlight, - tokens, - pending, - i = 0; - - try { - tokens = Lexer.lex(src, opt); - } catch (e) { - return callback(e); - } - - pending = tokens.length; - - var done = function(err) { - if (err) { - opt.highlight = highlight; - return callback(err); - } - - var out; - - try { - out = Parser.parse(tokens, opt); - } catch (e) { - err = e; - } - - opt.highlight = highlight; - - return err - ? callback(err) - : callback(null, out); - }; - - if (!highlight || highlight.length < 3) { - return done(); - } - - delete opt.highlight; - - if (!pending) { return done(); } - - for (; i < tokens.length; i++) { - (function(token) { - if (token.type !== 'code') { - return --pending || done(); - } - return highlight(token.text, token.lang, function(err, code) { - if (err) { return done(err); } - if (code == null || code === token.text) { - return --pending || done(); - } - token.text = code; - token.escaped = true; - --pending || done(); - }); - })(tokens[i]); - } - - return; - } - try { - if (opt) { opt = merge({}, marked.defaults, opt); } - return Parser.parse(Lexer.lex(src, opt), opt); - } catch (e) { - e.message += '\nPlease report this to https://github.com/markedjs/marked.'; - if ((opt || marked.defaults).silent) { - return '

    An error occurred:

    '
    -        + escape(e.message + '', true)
    -        + '
    '; - } - throw e; - } -} - -/** - * Options - */ - -marked.options = -marked.setOptions = function(opt) { - merge(marked.defaults, opt); - return marked; -}; - -marked.getDefaults = function () { - return { - baseUrl: null, - breaks: false, - gfm: true, - headerIds: true, - headerPrefix: '', - highlight: null, - langPrefix: 'language-', - mangle: true, - pedantic: false, - renderer: new Renderer(), - sanitize: false, - sanitizer: null, - silent: false, - smartLists: false, - smartypants: false, - tables: true, - xhtml: false - }; -}; - -marked.defaults = marked.getDefaults(); - -/** - * Expose - */ - -marked.Parser = Parser; -marked.parser = Parser.parse; - -marked.Renderer = Renderer; -marked.TextRenderer = TextRenderer; - -marked.Lexer = Lexer; -marked.lexer = Lexer.lex; - -marked.InlineLexer = InlineLexer; -marked.inlineLexer = InlineLexer.output; - -marked.parse = marked; - -{ - module.exports = marked; -} -})(commonjsGlobal || (typeof window !== 'undefined' ? window : commonjsGlobal)); -}); - -var prism = createCommonjsModule(function (module) { -/* ********************************************** - Begin prism-core.js -********************************************** */ - -var _self = (typeof window !== 'undefined') - ? window // if in browser - : ( - (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) - ? self // if in worker - : {} // if in node js - ); - -/** - * Prism: Lightweight, robust, elegant syntax highlighting - * MIT license http://www.opensource.org/licenses/mit-license.php/ - * @author Lea Verou http://lea.verou.me - */ - -var Prism = (function(){ - -// Private helper vars -var lang = /\blang(?:uage)?-([\w-]+)\b/i; -var uniqueId = 0; - -var _ = _self.Prism = { - manual: _self.Prism && _self.Prism.manual, - disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler, - util: { - encode: function (tokens) { - if (tokens instanceof Token) { - return new Token(tokens.type, _.util.encode(tokens.content), tokens.alias); - } else if (_.util.type(tokens) === 'Array') { - return tokens.map(_.util.encode); - } else { - return tokens.replace(/&/g, '&').replace(/ text.length) { - // Something went terribly wrong, ABORT, ABORT! - return; - } - - if (str instanceof Token) { - continue; - } - - if (greedy && i != strarr.length - 1) { - pattern.lastIndex = pos; - var match = pattern.exec(text); - if (!match) { - break; - } - - var from = match.index + (lookbehind ? match[1].length : 0), - to = match.index + match[0].length, - k = i, - p = pos; - - for (var len = strarr.length; k < len && (p < to || (!strarr[k].type && !strarr[k - 1].greedy)); ++k) { - p += strarr[k].length; - // Move the index i to the element in strarr that is closest to from - if (from >= p) { - ++i; - pos = p; - } - } - - // If strarr[i] is a Token, then the match starts inside another Token, which is invalid - if (strarr[i] instanceof Token) { - continue; - } - - // Number of tokens to delete and replace with the new match - delNum = k - i; - str = text.slice(pos, p); - match.index -= pos; - } else { - pattern.lastIndex = 0; - - var match = pattern.exec(str), - delNum = 1; - } - - if (!match) { - if (oneshot) { - break; - } - - continue; - } - - if(lookbehind) { - lookbehindLength = match[1] ? match[1].length : 0; - } - - var from = match.index + lookbehindLength, - match = match[0].slice(lookbehindLength), - to = from + match.length, - before = str.slice(0, from), - after = str.slice(to); - - var args = [i, delNum]; - - if (before) { - ++i; - pos += before.length; - args.push(before); - } - - var wrapped = new Token(token, inside? _.tokenize(match, inside) : match, alias, match, greedy); - - args.push(wrapped); - - if (after) { - args.push(after); - } - - Array.prototype.splice.apply(strarr, args); - - if (delNum != 1) - { _.matchGrammar(text, strarr, grammar, i, pos, true, token); } - - if (oneshot) - { break; } - } - } - } - }, - - tokenize: function(text, grammar, language) { - var strarr = [text]; - - var rest = grammar.rest; - - if (rest) { - for (var token in rest) { - grammar[token] = rest[token]; - } - - delete grammar.rest; - } - - _.matchGrammar(text, strarr, grammar, 0, 0, false); - - return strarr; - }, - - hooks: { - all: {}, - - add: function (name, callback) { - var hooks = _.hooks.all; - - hooks[name] = hooks[name] || []; - - hooks[name].push(callback); - }, - - run: function (name, env) { - var callbacks = _.hooks.all[name]; - - if (!callbacks || !callbacks.length) { - return; - } - - for (var i=0, callback; callback = callbacks[i++];) { - callback(env); - } - } - } -}; - -var Token = _.Token = function(type, content, alias, matchedStr, greedy) { - this.type = type; - this.content = content; - this.alias = alias; - // Copy of the full string this token was created from - this.length = (matchedStr || "").length|0; - this.greedy = !!greedy; -}; - -Token.stringify = function(o, language, parent) { - if (typeof o == 'string') { - return o; - } - - if (_.util.type(o) === 'Array') { - return o.map(function(element) { - return Token.stringify(element, language, o); - }).join(''); - } - - var env = { - type: o.type, - content: Token.stringify(o.content, language, parent), - tag: 'span', - classes: ['token', o.type], - attributes: {}, - language: language, - parent: parent - }; - - if (o.alias) { - var aliases = _.util.type(o.alias) === 'Array' ? o.alias : [o.alias]; - Array.prototype.push.apply(env.classes, aliases); - } - - _.hooks.run('wrap', env); - - var attributes = Object.keys(env.attributes).map(function(name) { - return name + '="' + (env.attributes[name] || '').replace(/"/g, '"') + '"'; - }).join(' '); - - return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + (attributes ? ' ' + attributes : '') + '>' + env.content + ''; - -}; - -if (!_self.document) { - if (!_self.addEventListener) { - // in Node.js - return _self.Prism; - } - - if (!_.disableWorkerMessageHandler) { - // In worker - _self.addEventListener('message', function (evt) { - var message = JSON.parse(evt.data), - lang = message.language, - code = message.code, - immediateClose = message.immediateClose; - - _self.postMessage(_.highlight(code, _.languages[lang], lang)); - if (immediateClose) { - _self.close(); - } - }, false); - } - - return _self.Prism; -} - -//Get current script and highlight -var script = document.currentScript || [].slice.call(document.getElementsByTagName("script")).pop(); - -if (script) { - _.filename = script.src; - - if (!_.manual && !script.hasAttribute('data-manual')) { - if(document.readyState !== "loading") { - if (window.requestAnimationFrame) { - window.requestAnimationFrame(_.highlightAll); - } else { - window.setTimeout(_.highlightAll, 16); - } - } - else { - document.addEventListener('DOMContentLoaded', _.highlightAll); - } - } -} - -return _self.Prism; - -})(); - -if ('object' !== 'undefined' && module.exports) { - module.exports = Prism; -} - -// hack for components to work correctly in node.js -if (typeof commonjsGlobal !== 'undefined') { - commonjsGlobal.Prism = Prism; -} - - -/* ********************************************** - Begin prism-markup.js -********************************************** */ - -Prism.languages.markup = { - 'comment': //, - 'prolog': /<\?[\s\S]+?\?>/, - 'doctype': //i, - 'cdata': //i, - 'tag': { - pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i, - greedy: true, - inside: { - 'tag': { - pattern: /^<\/?[^\s>\/]+/i, - inside: { - 'punctuation': /^<\/?/, - 'namespace': /^[^\s>\/:]+:/ - } - }, - 'attr-value': { - pattern: /=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i, - inside: { - 'punctuation': [ - /^=/, - { - pattern: /(^|[^\\])["']/, - lookbehind: true - } - ] - } - }, - 'punctuation': /\/?>/, - 'attr-name': { - pattern: /[^\s>\/]+/, - inside: { - 'namespace': /^[^\s>\/:]+:/ - } - } - - } - }, - 'entity': /&#?[\da-z]{1,8};/i -}; - -Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] = - Prism.languages.markup['entity']; - -// Plugin to make entity title show the real entity, idea by Roman Komarov -Prism.hooks.add('wrap', function(env) { - - if (env.type === 'entity') { - env.attributes['title'] = env.content.replace(/&/, '&'); - } -}); - -Prism.languages.xml = Prism.languages.markup; -Prism.languages.html = Prism.languages.markup; -Prism.languages.mathml = Prism.languages.markup; -Prism.languages.svg = Prism.languages.markup; - - -/* ********************************************** - Begin prism-css.js -********************************************** */ - -Prism.languages.css = { - 'comment': /\/\*[\s\S]*?\*\//, - 'atrule': { - pattern: /@[\w-]+?.*?(?:;|(?=\s*\{))/i, - inside: { - 'rule': /@[\w-]+/ - // See rest below - } - }, - 'url': /url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i, - 'selector': /[^{}\s][^{};]*?(?=\s*\{)/, - 'string': { - pattern: /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, - greedy: true - }, - 'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i, - 'important': /\B!important\b/i, - 'function': /[-a-z0-9]+(?=\()/i, - 'punctuation': /[(){};:]/ -}; - -Prism.languages.css['atrule'].inside.rest = Prism.languages.css; - -if (Prism.languages.markup) { - Prism.languages.insertBefore('markup', 'tag', { - 'style': { - pattern: /()[\s\S]*?(?=<\/style>)/i, - lookbehind: true, - inside: Prism.languages.css, - alias: 'language-css', - greedy: true - } - }); - - Prism.languages.insertBefore('inside', 'attr-value', { - 'style-attr': { - pattern: /\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i, - inside: { - 'attr-name': { - pattern: /^\s*style/i, - inside: Prism.languages.markup.tag.inside - }, - 'punctuation': /^\s*=\s*['"]|['"]\s*$/, - 'attr-value': { - pattern: /.+/i, - inside: Prism.languages.css - } - }, - alias: 'language-css' - } - }, Prism.languages.markup.tag); -} - -/* ********************************************** - Begin prism-clike.js -********************************************** */ - -Prism.languages.clike = { - 'comment': [ - { - pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, - lookbehind: true - }, - { - pattern: /(^|[^\\:])\/\/.*/, - lookbehind: true, - greedy: true - } - ], - 'string': { - pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, - greedy: true - }, - 'class-name': { - pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i, - lookbehind: true, - inside: { - punctuation: /[.\\]/ - } - }, - 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/, - 'boolean': /\b(?:true|false)\b/, - 'function': /[a-z0-9_]+(?=\()/i, - 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i, - 'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/, - 'punctuation': /[{}[\];(),.:]/ -}; - - -/* ********************************************** - Begin prism-javascript.js -********************************************** */ - -Prism.languages.javascript = Prism.languages.extend('clike', { - 'keyword': /\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/, - 'number': /\b(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/, - // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444) - 'function': /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/i, - 'operator': /-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/ -}); - -Prism.languages.insertBefore('javascript', 'keyword', { - 'regex': { - pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[[^\]\r\n]+]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})\]]))/, - lookbehind: true, - greedy: true - }, - // This must be declared before keyword because we use "function" inside the look-forward - 'function-variable': { - pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=\s*(?:function\b|(?:\([^()]*\)|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i, - alias: 'function' - }, - 'constant': /\b[A-Z][A-Z\d_]*\b/ -}); - -Prism.languages.insertBefore('javascript', 'string', { - 'template-string': { - pattern: /`(?:\\[\s\S]|\${[^}]+}|[^\\`])*`/, - greedy: true, - inside: { - 'interpolation': { - pattern: /\${[^}]+}/, - inside: { - 'interpolation-punctuation': { - pattern: /^\${|}$/, - alias: 'punctuation' - }, - rest: null // See below - } - }, - 'string': /[\s\S]+/ - } - } -}); -Prism.languages.javascript['template-string'].inside['interpolation'].inside.rest = Prism.languages.javascript; - -if (Prism.languages.markup) { - Prism.languages.insertBefore('markup', 'tag', { - 'script': { - pattern: /()[\s\S]*?(?=<\/script>)/i, - lookbehind: true, - inside: Prism.languages.javascript, - alias: 'language-javascript', - greedy: true - } - }); -} - -Prism.languages.js = Prism.languages.javascript; - - -/* ********************************************** - Begin prism-file-highlight.js -********************************************** */ - -(function () { - if (typeof self === 'undefined' || !self.Prism || !self.document || !document.querySelector) { - return; - } - - self.Prism.fileHighlight = function() { - - var Extensions = { - 'js': 'javascript', - 'py': 'python', - 'rb': 'ruby', - 'ps1': 'powershell', - 'psm1': 'powershell', - 'sh': 'bash', - 'bat': 'batch', - 'h': 'c', - 'tex': 'latex' - }; - - Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) { - var src = pre.getAttribute('data-src'); - - var language, parent = pre; - var lang = /\blang(?:uage)?-([\w-]+)\b/i; - while (parent && !lang.test(parent.className)) { - parent = parent.parentNode; - } - - if (parent) { - language = (pre.className.match(lang) || [, ''])[1]; - } - - if (!language) { - var extension = (src.match(/\.(\w+)$/) || [, ''])[1]; - language = Extensions[extension] || extension; - } - - var code = document.createElement('code'); - code.className = 'language-' + language; - - pre.textContent = ''; - - code.textContent = 'Loading…'; - - pre.appendChild(code); - - var xhr = new XMLHttpRequest(); - - xhr.open('GET', src, true); - - xhr.onreadystatechange = function () { - if (xhr.readyState == 4) { - - if (xhr.status < 400 && xhr.responseText) { - code.textContent = xhr.responseText; - - Prism.highlightElement(code); - } - else if (xhr.status >= 400) { - code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText; - } - else { - code.textContent = '✖ Error: File does not exist or is empty'; - } - } - }; - - xhr.send(null); - }); - - if (Prism.plugins.toolbar) { - Prism.plugins.toolbar.registerButton('download-file', function (env) { - var pre = env.element.parentNode; - if (!pre || !/pre/i.test(pre.nodeName) || !pre.hasAttribute('data-src') || !pre.hasAttribute('data-download-link')) { - return; - } - var src = pre.getAttribute('data-src'); - var a = document.createElement('a'); - a.textContent = pre.getAttribute('data-download-link-label') || 'Download'; - a.setAttribute('download', ''); - a.href = src; - return a; - }); - } - - }; - - document.addEventListener('DOMContentLoaded', self.Prism.fileHighlight); - -})(); -}); - -/** - * Gen toc tree - * @link https://github.com/killercup/grock/blob/5280ae63e16c5739e9233d9009bc235ed7d79a50/styles/solarized/assets/js/behavior.coffee#L54-L81 - * @param {Array} toc - * @param {Number} maxLevel - * @return {Array} - */ -function genTree(toc, maxLevel) { - var headlines = []; - var last = {}; - - toc.forEach(function (headline) { - var level = headline.level || 1; - var len = level - 1; - - if (level > maxLevel) { - return - } - if (last[len]) { - last[len].children = (last[len].children || []).concat(headline); - } else { - headlines.push(headline); - } - last[level] = headline; - }); - - return headlines -} - -var cache$1 = {}; -var re = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g; - -function lower(string) { - return string.toLowerCase() -} - -function slugify(str) { - if (typeof str !== 'string') { - return '' - } - - var slug = str - .trim() - .replace(/[A-Z]+/g, lower) - .replace(/<[^>\d]+>/g, '') - .replace(re, '') - .replace(/\s/g, '-') - .replace(/-+/g, '-') - .replace(/^(\d)/, '_$1'); - var count = cache$1[slug]; - - count = hasOwn.call(cache$1, slug) ? count + 1 : 0; - cache$1[slug] = count; - - if (count) { - slug = slug + '-' + count; - } - - return slug -} - -slugify.clear = function () { - cache$1 = {}; -}; - -function replace(m, $1) { - return '' + $1 + '' -} - -function emojify(text) { - return text - .replace(/<(pre|template|code)[^>]*?>[\s\S]+?<\/(pre|template|code)>/g, function (m) { return m.replace(/:/g, '__colon__'); }) - .replace(/:(\w+?):/ig, (inBrowser && window.emojify) || replace) - .replace(/__colon__/g, ':') -} - -var decode = decodeURIComponent; -var encode = encodeURIComponent; - -function parseQuery(query) { - var res = {}; - - query = query.trim().replace(/^(\?|#|&)/, ''); - - if (!query) { - return res - } - - // Simple parse - query.split('&').forEach(function (param) { - var parts = param.replace(/\+/g, ' ').split('='); - - res[parts[0]] = parts[1] && decode(parts[1]); - }); - - return res -} - -function stringifyQuery(obj, ignores) { - if ( ignores === void 0 ) ignores = []; - - var qs = []; - - for (var key in obj) { - if (ignores.indexOf(key) > -1) { - continue - } - qs.push( - obj[key] ? - ((encode(key)) + "=" + (encode(obj[key]))).toLowerCase() : - encode(key) - ); - } - - return qs.length ? ("?" + (qs.join('&'))) : '' -} - -var isAbsolutePath = cached(function (path) { - return /(:|(\/{2}))/g.test(path) -}); - -var getParentPath = cached(function (path) { - return /\/$/g.test(path) ? - path : - (path = path.match(/(\S*\/)[^/]+$/)) ? path[1] : '' -}); - -var cleanPath = cached(function (path) { - return path.replace(/^\/+/, '/').replace(/([^:])\/{2,}/g, '$1/') -}); - -function getPath() { - var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; - - return cleanPath(args.join('/')) -} - -var replaceSlug = cached(function (path) { - return path.replace('#', '?id=') -}); - -Prism.languages['markup-templating'] = {}; - -Object.defineProperties(Prism.languages['markup-templating'], { - buildPlaceholders: { - // Tokenize all inline templating expressions matching placeholderPattern - // If the replaceFilter function is provided, it will be called with every match. - // If it returns false, the match will not be replaced. - value: function (env, language, placeholderPattern, replaceFilter) { - if (env.language !== language) { - return; - } - - env.tokenStack = []; - - env.code = env.code.replace(placeholderPattern, function(match) { - if (typeof replaceFilter === 'function' && !replaceFilter(match)) { - return match; - } - var i = env.tokenStack.length; - // Check for existing strings - while (env.code.indexOf('___' + language.toUpperCase() + i + '___') !== -1) - { ++i; } - - // Create a sparse array - env.tokenStack[i] = match; - - return '___' + language.toUpperCase() + i + '___'; - }); - - // Switch the grammar to markup - env.grammar = Prism.languages.markup; - } - }, - tokenizePlaceholders: { - // Replace placeholders with proper tokens after tokenizing - value: function (env, language) { - if (env.language !== language || !env.tokenStack) { - return; - } - - // Switch the grammar back - env.grammar = Prism.languages[language]; - - var j = 0; - var keys = Object.keys(env.tokenStack); - var walkTokens = function (tokens) { - if (j >= keys.length) { - return; - } - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (typeof token === 'string' || (token.content && typeof token.content === 'string')) { - var k = keys[j]; - var t = env.tokenStack[k]; - var s = typeof token === 'string' ? token : token.content; - - var index = s.indexOf('___' + language.toUpperCase() + k + '___'); - if (index > -1) { - ++j; - var before = s.substring(0, index); - var middle = new Prism.Token(language, Prism.tokenize(t, env.grammar, language), 'language-' + language, t); - var after = s.substring(index + ('___' + language.toUpperCase() + k + '___').length); - var replacement; - if (before || after) { - replacement = [before, middle, after].filter(function (v) { return !!v; }); - walkTokens(replacement); - } else { - replacement = middle; - } - if (typeof token === 'string') { - Array.prototype.splice.apply(tokens, [i, 1].concat(replacement)); - } else { - token.content = replacement; - } - - if (j >= keys.length) { - break; - } - } - } else if (token.content && typeof token.content !== 'string') { - walkTokens(token.content); - } - } - }; - - walkTokens(env.tokens); - } - } -}); - -// See https://github.com/PrismJS/prism/pull/1367 -var cachedLinks = {}; - -function getAndRemoveConfig(str) { - if ( str === void 0 ) str = ''; - - var config = {}; - - if (str) { - str = str - .replace(/^'/, '') - .replace(/'$/, '') - .replace(/(?:^|\s):([\w-]+)=?([\w-]+)?/g, function (m, key, value) { - config[key] = (value && value.replace(/"/g, '')) || true; - return '' - }) - .trim(); - } - - return {str: str, config: config} -} - -var compileMedia = { - markdown: function markdown(url) { - return { - url: url - } - }, - mermaid: function mermaid(url) { - return { - url: url - } - }, - iframe: function iframe(url, title) { - return { - html: ("") - } - }, - video: function video(url, title) { - return { - html: ("") - } - }, - audio: function audio(url, title) { - return { - html: ("") - } - }, - code: function code(url, title) { - var lang = url.match(/\.(\w+)$/); - - lang = title || (lang && lang[1]); - if (lang === 'md') { - lang = 'markdown'; - } - - return { - url: url, - lang: lang - } - } -}; - -var Compiler = function Compiler(config, router) { - var this$1 = this; - - this.config = config; - this.router = router; - this.cacheTree = {}; - this.toc = []; - this.cacheTOC = {}; - this.linkTarget = config.externalLinkTarget || '_blank'; - this.contentBase = router.getBasePath(); - - var renderer = this._initRenderer(); - var compile; - var mdConf = config.markdown || {}; - - if (isFn(mdConf)) { - compile = mdConf(marked, renderer); - } else { - marked.setOptions( - merge(mdConf, { - renderer: merge(renderer, mdConf.renderer) - }) - ); - compile = marked; - } - - this._marked = compile; - this.compile = function (text) { - var isCached = true; - var result = cached(function (_) { - isCached = false; - var html = ''; - - if (!text) { - return text - } - - if (isPrimitive(text)) { - html = compile(text); - } else { - html = compile.parser(text); - } - - html = config.noEmoji ? html : emojify(html); - slugify.clear(); - - return html - })(text); - - var curFileName = this$1.router.parse().file; - - if (isCached) { - this$1.toc = this$1.cacheTOC[curFileName]; - } else { - this$1.cacheTOC[curFileName] = [].concat( this$1.toc ); - } - - return result - }; -}; - -Compiler.prototype.compileEmbed = function compileEmbed (href, title) { - var ref = getAndRemoveConfig(title); - var str = ref.str; - var config = ref.config; - var embed; - title = str; - - if (config.include) { - if (!isAbsolutePath(href)) { - href = getPath( - this.contentBase, - getParentPath(this.router.getCurrentPath()), - href - ); - } - - var media; - if (config.type && (media = compileMedia[config.type])) { - embed = media.call(this, href, title); - embed.type = config.type; - } else { - var type = 'code'; - if (/\.(md|markdown)/.test(href)) { - type = 'markdown'; - } else if (/\.mmd/.test(href)) { - type = 'mermaid'; - } else if (/\.html?/.test(href)) { - type = 'iframe'; - } else if (/\.(mp4|ogg)/.test(href)) { - type = 'video'; - } else if (/\.mp3/.test(href)) { - type = 'audio'; - } - embed = compileMedia[type].call(this, href, title); - embed.type = type; - } - embed.fragment = config.fragment; - - return embed - } -}; - -Compiler.prototype._matchNotCompileLink = function _matchNotCompileLink (link) { - var links = this.config.noCompileLinks || []; - - for (var i = 0; i < links.length; i++) { - var n = links[i]; - var re = cachedLinks[n] || (cachedLinks[n] = new RegExp(("^" + n + "$"))); - - if (re.test(link)) { - return link - } - } -}; - -Compiler.prototype._initRenderer = function _initRenderer () { - var renderer = new marked.Renderer(); - var ref = this; - var linkTarget = ref.linkTarget; - var router = ref.router; - var contentBase = ref.contentBase; - var _self = this; - var origin = {}; - - /** - * Render anchor tag - * @link https://github.com/markedjs/marked#overriding-renderer-methods - */ - origin.heading = renderer.heading = function (text, level) { - var ref = getAndRemoveConfig(text); - var str = ref.str; - var config = ref.config; - var nextToc = {level: level, title: str}; - - if (/{docsify-ignore}/g.test(str)) { - str = str.replace('{docsify-ignore}', ''); - nextToc.title = str; - nextToc.ignoreSubHeading = true; - } - - if (/{docsify-ignore-all}/g.test(str)) { - str = str.replace('{docsify-ignore-all}', ''); - nextToc.title = str; - nextToc.ignoreAllSubs = true; - } - - var slug = slugify(config.id || str); - var url = router.toURL(router.getCurrentPath(), {id: slug}); - nextToc.slug = url; - _self.toc.push(nextToc); - - return ("
    " + str + "") - }; - // Highlight code - origin.code = renderer.code = function (code, lang) { - if ( lang === void 0 ) lang = ''; - - code = code.replace(/@DOCSIFY_QM@/g, '`'); - var hl = prism.highlight( - code, - prism.languages[lang] || prism.languages.markup - ); - - return ("
    " + hl + "
    ") - }; - origin.link = renderer.link = function (href, title, text) { - if ( title === void 0 ) title = ''; - - var attrs = ''; - - var ref = getAndRemoveConfig(title); - var str = ref.str; - var config = ref.config; - title = str; - - if ( - !isAbsolutePath(href) && - !_self._matchNotCompileLink(href) && - !config.ignore - ) { - if (href === _self.config.homepage) { - href = 'README'; - } - href = router.toURL(href, null, router.getCurrentPath()); - } else { - attrs += href.indexOf('mailto:') === 0 ? '' : (" target=\"" + linkTarget + "\""); - } - - if (config.target) { - attrs += ' target=' + config.target; - } - - if (config.disabled) { - attrs += ' disabled'; - href = 'javascript:void(0)'; - } - - if (title) { - attrs += " title=\"" + title + "\""; - } - - return ("" + text + "") - }; - origin.paragraph = renderer.paragraph = function (text) { - var result; - if (/^!>/.test(text)) { - result = helper('tip', text); - } else if (/^\?>/.test(text)) { - result = helper('warn', text); - } else { - result = "

    " + text + "

    "; - } - return result - }; - origin.image = renderer.image = function (href, title, text) { - var url = href; - var attrs = ''; - - var ref = getAndRemoveConfig(title); - var str = ref.str; - var config = ref.config; - title = str; - - if (config['no-zoom']) { - attrs += ' data-no-zoom'; - } - - if (title) { - attrs += " title=\"" + title + "\""; - } - - var size = config.size; - if (size) { - var sizes = size.split('x'); - if (sizes[1]) { - attrs += 'width=' + sizes[0] + ' height=' + sizes[1]; - } else { - attrs += 'width=' + sizes[0]; - } - } - - if (!isAbsolutePath(href)) { - url = getPath(contentBase, getParentPath(router.getCurrentPath()), href); - } - - return ("\""") - }; - origin.list = renderer.list = function (body, ordered, start) { - var isTaskList = /
  • /.test(body.split('class="task-list"')[0]); - var isStartReq = start && start > 1; - var tag = ordered ? 'ol' : 'ul'; - var tagAttrs = [ - (isTaskList ? 'class="task-list"' : ''), - (isStartReq ? ("start=\"" + start + "\"") : '') - ].join(' ').trim(); - - return ("<" + tag + " " + tagAttrs + ">" + body + "") - }; - origin.listitem = renderer.listitem = function (text) { - var isTaskItem = /^(]*>)/.test(text); - var html = isTaskItem ? ("
  • ") : ("
  • " + text + "
  • "); - - return html - }; - - renderer.origin = origin; - - return renderer -}; - -/** - * Compile sidebar - */ -Compiler.prototype.sidebar = function sidebar (text, level) { - var currentPath = this.router.getCurrentPath(); - var html = ''; - - if (text) { - html = this.compile(text); - } else { - var tree$$1 = this.cacheTree[currentPath] || genTree(this.toc, level); - html = tree(tree$$1, '
      {inner}
    '); - this.cacheTree[currentPath] = tree$$1; - } - - return html -}; - -/** - * Compile sub sidebar - */ -Compiler.prototype.subSidebar = function subSidebar (level) { - if (!level) { - this.toc = []; - return - } - var currentPath = this.router.getCurrentPath(); - var ref = this; - var cacheTree = ref.cacheTree; - var toc = ref.toc; - - toc[0] && toc[0].ignoreAllSubs && toc.splice(0); - toc[0] && toc[0].level === 1 && toc.shift(); - - for (var i = 0; i < toc.length; i++) { - toc[i].ignoreSubHeading && toc.splice(i, 1) && i--; - } - - var tree$$1 = cacheTree[currentPath] || genTree(toc, level); - - cacheTree[currentPath] = tree$$1; - this.toc = []; - return tree(tree$$1) -}; - -Compiler.prototype.article = function article (text) { - return this.compile(text) -}; - -/** - * Compile cover page - */ -Compiler.prototype.cover = function cover$$1 (text) { - var cacheToc = this.toc.slice(); - var html = this.compile(text); - - this.toc = cacheToc.slice(); - - return html -}; - -var title = $.title; -/** - * Toggle button - */ -function btn(el) { - var toggle = function (_) { return body.classList.toggle('close'); }; - - el = getNode(el); - if (el == null) { - return - } - on(el, 'click', function (e) { - e.stopPropagation(); - toggle(); - }); - - isMobile && - on( - body, - 'click', - function (_) { return body.classList.contains('close') && toggle(); } - ); -} - -function collapse(el) { - el = getNode(el); - if (el == null) { - return - } - on(el, 'click', function (ref) { - var target = ref.target; - - if ( - target.nodeName === 'A' && - target.nextSibling && - target.nextSibling.classList.contains('app-sub-sidebar') - ) { - toggleClass(target.parentNode, 'collapse'); - } - }); -} - -function sticky() { - var cover = getNode('section.cover'); - if (!cover) { - return - } - var coverHeight = cover.getBoundingClientRect().height; - - if (window.pageYOffset >= coverHeight || cover.classList.contains('hidden')) { - toggleClass(body, 'add', 'sticky'); - } else { - toggleClass(body, 'remove', 'sticky'); - } -} - -/** - * Get and active link - * @param {object} router - * @param {string|element} el - * @param {Boolean} isParent acitve parent - * @param {Boolean} autoTitle auto set title - * @return {element} - */ -function getAndActive(router, el, isParent, autoTitle) { - el = getNode(el); - var links = []; - if (el != null) { - links = findAll(el, 'a'); - } - var hash = decodeURI(router.toURL(router.getCurrentPath())); - var target; - - links.sort(function (a, b) { return b.href.length - a.href.length; }).forEach(function (a) { - var href = a.getAttribute('href'); - var node = isParent ? a.parentNode : a; - - if (hash.indexOf(href) === 0 && !target) { - target = a; - toggleClass(node, 'add', 'active'); - } else { - toggleClass(node, 'remove', 'active'); - } - }); - - if (autoTitle) { - $.title = target ? (target.title || ((target.innerText) + " - " + title)) : title; - } - - return target -} - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true; } Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps); } if (staticProps) { defineProperties(Constructor, staticProps); } return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Tweezer = function () { - function Tweezer() { - var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - _classCallCheck(this, Tweezer); - - this.duration = opts.duration || 1000; - this.ease = opts.easing || this._defaultEase; - this.start = opts.start; - this.end = opts.end; - - this.frame = null; - this.next = null; - this.isRunning = false; - this.events = {}; - this.direction = this.start < this.end ? 'up' : 'down'; - } - - _createClass(Tweezer, [{ - key: 'begin', - value: function begin() { - if (!this.isRunning && this.next !== this.end) { - this.frame = window.requestAnimationFrame(this._tick.bind(this)); - } - return this; - } - }, { - key: 'stop', - value: function stop() { - window.cancelAnimationFrame(this.frame); - this.isRunning = false; - this.frame = null; - this.timeStart = null; - this.next = null; - return this; - } - }, { - key: 'on', - value: function on(name, handler) { - this.events[name] = this.events[name] || []; - this.events[name].push(handler); - return this; - } - }, { - key: 'emit', - value: function emit(name, val) { - var _this = this; - - var e = this.events[name]; - e && e.forEach(function (handler) { - return handler.call(_this, val); - }); - } - }, { - key: '_tick', - value: function _tick(currentTime) { - this.isRunning = true; - - var lastTick = this.next || this.start; - - if (!this.timeStart) { this.timeStart = currentTime; } - this.timeElapsed = currentTime - this.timeStart; - this.next = Math.round(this.ease(this.timeElapsed, this.start, this.end - this.start, this.duration)); - - if (this._shouldTick(lastTick)) { - this.emit('tick', this.next); - this.frame = window.requestAnimationFrame(this._tick.bind(this)); - } else { - this.emit('tick', this.end); - this.emit('done', null); - } - } - }, { - key: '_shouldTick', - value: function _shouldTick(lastTick) { - return { - up: this.next < this.end && lastTick <= this.next, - down: this.next > this.end && lastTick >= this.next - }[this.direction]; - } - }, { - key: '_defaultEase', - value: function _defaultEase(t, b, c, d) { - if ((t /= d / 2) < 1) { return c / 2 * t * t + b; } - return -c / 2 * (--t * (t - 2) - 1) + b; - } - }]); - - return Tweezer; -}(); - -var nav = {}; -var hoverOver = false; -var scroller = null; -var enableScrollEvent = true; -var coverHeight = 0; - -function scrollTo(el) { - if (scroller) { - scroller.stop(); - } - enableScrollEvent = false; - scroller = new Tweezer({ - start: window.pageYOffset, - end: el.getBoundingClientRect().top + window.pageYOffset, - duration: 500 - }) - .on('tick', function (v) { return window.scrollTo(0, v); }) - .on('done', function () { - enableScrollEvent = true; - scroller = null; - }) - .begin(); -} - -function highlight(path) { - if (!enableScrollEvent) { - return - } - var sidebar = getNode('.sidebar'); - var anchors = findAll('.anchor'); - var wrap = find(sidebar, '.sidebar-nav'); - var active = find(sidebar, 'li.active'); - var doc = document.documentElement; - var top = ((doc && doc.scrollTop) || document.body.scrollTop) - coverHeight; - var last; - - for (var i = 0, len = anchors.length; i < len; i += 1) { - var node = anchors[i]; - - if (node.offsetTop > top) { - if (!last) { - last = node; - } - break - } else { - last = node; - } - } - if (!last) { - return - } - var li = nav[getNavKey(decodeURIComponent(path), last.getAttribute('data-id'))]; - - if (!li || li === active) { - return - } - - active && active.classList.remove('active'); - li.classList.add('active'); - active = li; - - // Scroll into view - // https://github.com/vuejs/vuejs.org/blob/master/themes/vue/source/js/common.js#L282-L297 - if (!hoverOver && body.classList.contains('sticky')) { - var height = sidebar.clientHeight; - var curOffset = 0; - var cur = active.offsetTop + active.clientHeight + 40; - var isInView = - active.offsetTop >= wrap.scrollTop && cur <= wrap.scrollTop + height; - var notThan = cur - curOffset < height; - var top$1 = isInView ? wrap.scrollTop : notThan ? curOffset : cur - height; - - sidebar.scrollTop = top$1; - } -} - -function getNavKey(path, id) { - return (path + "?id=" + id) -} - -function scrollActiveSidebar(router) { - var cover = find('.cover.show'); - coverHeight = cover ? cover.offsetHeight : 0; - - var sidebar = getNode('.sidebar'); - var lis = []; - if (sidebar != null) { - lis = findAll(sidebar, 'li'); - } - - for (var i = 0, len = lis.length; i < len; i += 1) { - var li = lis[i]; - var a = li.querySelector('a'); - if (!a) { - continue - } - var href = a.getAttribute('href'); - - if (href !== '/') { - var ref = router.parse(href); - var id = ref.query.id; - var path$1 = ref.path; - if (id) { - href = getNavKey(path$1, id); - } - } - - if (href) { - nav[decodeURIComponent(href)] = li; - } - } - - if (isMobile) { - return - } - var path = router.getCurrentPath(); - off('scroll', function () { return highlight(path); }); - on('scroll', function () { return highlight(path); }); - on(sidebar, 'mouseover', function () { - hoverOver = true; - }); - on(sidebar, 'mouseleave', function () { - hoverOver = false; - }); -} - -function scrollIntoView(path, id) { - if (!id) { - return - } - - var section = find('#' + id); - section && scrollTo(section); - - var li = nav[getNavKey(path, id)]; - var sidebar = getNode('.sidebar'); - var active = find(sidebar, 'li.active'); - active && active.classList.remove('active'); - li && li.classList.add('active'); -} - -var scrollEl = $.scrollingElement || $.documentElement; - -function scroll2Top(offset) { - if ( offset === void 0 ) offset = 0; - - scrollEl.scrollTop = offset === true ? 0 : Number(offset); -} - -var cached$1 = {}; - -function walkFetchEmbed(ref, cb) { - var embedTokens = ref.embedTokens; - var compile = ref.compile; - var fetch = ref.fetch; - - var token; - var step = 0; - var count = 1; - - if (!embedTokens.length) { - return cb({}) - } - - while ((token = embedTokens[step++])) { - var next = (function (token) { - return function (text) { - var embedToken; - if (text) { - if (token.embed.type === 'markdown') { - embedToken = compile.lexer(text); - } else if (token.embed.type === 'code') { - if (token.embed.fragment) { - var fragment = token.embed.fragment; - var pattern = new RegExp(("(?:###|\\/\\/\\/)\\s*\\[" + fragment + "\\]([\\s\\S]*)(?:###|\\/\\/\\/)\\s*\\[" + fragment + "\\]")); - text = ((text.match(pattern) || [])[1] || '').trim(); - } - embedToken = compile.lexer( - '```' + - token.embed.lang + - '\n' + - text.replace(/`/g, '@DOCSIFY_QM@') + - '\n```\n' - ); - } else if (token.embed.type === 'mermaid') { - embedToken = [ - {type: 'html', text: ("
    \n" + text + "\n
    ")} - ]; - embedToken.links = {}; - } else { - embedToken = [{type: 'html', text: text}]; - embedToken.links = {}; - } - } - cb({token: token, embedToken: embedToken}); - if (++count >= step) { - cb({}); - } - } - })(token); - - if (token.embed.url) { - { - get(token.embed.url).then(next); - } - } else { - next(token.embed.html); - } - } -} - -function prerenderEmbed(ref, done) { - var compiler = ref.compiler; - var raw = ref.raw; if ( raw === void 0 ) raw = ''; - var fetch = ref.fetch; - - var hit = cached$1[raw]; - if (hit) { - var copy = hit.slice(); - copy.links = hit.links; - return done(copy) - } - - var compile = compiler._marked; - var tokens = compile.lexer(raw); - var embedTokens = []; - var linkRE = compile.InlineLexer.rules.link; - var links = tokens.links; - - tokens.forEach(function (token, index) { - if (token.type === 'paragraph') { - token.text = token.text.replace( - new RegExp(linkRE.source, 'g'), - function (src, filename, href, title) { - var embed = compiler.compileEmbed(href, title); - - if (embed) { - embedTokens.push({ - index: index, - embed: embed - }); - } - - return src - } - ); - } - }); - - var moveIndex = 0; - walkFetchEmbed({compile: compile, embedTokens: embedTokens, fetch: fetch}, function (ref) { - var embedToken = ref.embedToken; - var token = ref.token; - - if (token) { - var index = token.index + moveIndex; - - merge(links, embedToken.links); - - tokens = tokens - .slice(0, index) - .concat(embedToken, tokens.slice(index + 1)); - moveIndex += embedToken.length - 1; - } else { - cached$1[raw] = tokens.concat(); - tokens.links = cached$1[raw].links = links; - done(tokens); - } - }); -} - -function executeScript() { - var script = findAll('.markdown-section>script') - .filter(function (s) { return !/template/.test(s.type); })[0]; - if (!script) { - return false - } - var code = script.innerText.trim(); - if (!code) { - return false - } - - setTimeout(function (_) { - window.__EXECUTE_RESULT__ = new Function(code)(); - }, 0); -} - -function formatUpdated(html, updated, fn) { - updated = - typeof fn === 'function' ? - fn(updated) : - typeof fn === 'string' ? - tinydate(fn)(new Date(updated)) : - updated; - - return html.replace(/{docsify-updated}/g, updated) -} - -function renderMain(html) { - if (!html) { - html = '

    404 - Not found

    '; - } - - this._renderTo('.markdown-section', html); - // Render sidebar with the TOC - !this.config.loadSidebar && this._renderSidebar(); - - // Execute script - if ( - this.config.executeScript !== false && - typeof window.Vue !== 'undefined' && - !executeScript() - ) { - setTimeout(function (_) { - var vueVM = window.__EXECUTE_RESULT__; - vueVM && vueVM.$destroy && vueVM.$destroy(); - window.__EXECUTE_RESULT__ = new window.Vue().$mount('#main'); - }, 0); - } else { - this.config.executeScript && executeScript(); - } -} - -function renderNameLink(vm) { - var el = getNode('.app-name-link'); - var nameLink = vm.config.nameLink; - var path = vm.route.path; - - if (!el) { - return - } - - if (isPrimitive(vm.config.nameLink)) { - el.setAttribute('href', nameLink); - } else if (typeof nameLink === 'object') { - var match = Object.keys(nameLink).filter(function (key) { return path.indexOf(key) > -1; })[0]; - - el.setAttribute('href', nameLink[match]); - } -} - -function renderMixin(proto) { - proto._renderTo = function (el, content, replace) { - var node = getNode(el); - if (node) { - node[replace ? 'outerHTML' : 'innerHTML'] = content; - } - }; - - proto._renderSidebar = function (text) { - var ref = this.config; - var maxLevel = ref.maxLevel; - var subMaxLevel = ref.subMaxLevel; - var loadSidebar = ref.loadSidebar; - - this._renderTo('.sidebar-nav', this.compiler.sidebar(text, maxLevel)); - var activeEl = getAndActive(this.router, '.sidebar-nav', true, true); - if (loadSidebar && activeEl) { - activeEl.parentNode.innerHTML += - this.compiler.subSidebar(subMaxLevel) || ''; - } else { - // Reset toc - this.compiler.subSidebar(); - } - // Bind event - this._bindEventOnRendered(activeEl); - }; - - proto._bindEventOnRendered = function (activeEl) { - var ref = this.config; - var autoHeader = ref.autoHeader; - var auto2top = ref.auto2top; - - scrollActiveSidebar(this.router); - - if (autoHeader && activeEl) { - var main$$1 = getNode('#main'); - var firstNode = main$$1.children[0]; - if (firstNode && firstNode.tagName !== 'H1') { - var h1 = create('h1'); - h1.innerText = activeEl.innerText; - before(main$$1, h1); - } - } - - auto2top && scroll2Top(auto2top); - }; - - proto._renderNav = function (text) { - text && this._renderTo('nav', this.compiler.compile(text)); - if (this.config.loadNavbar) { - getAndActive(this.router, 'nav'); - } - }; - - proto._renderMain = function (text, opt, next) { - var this$1 = this; - if ( opt === void 0 ) opt = {}; - - if (!text) { - return renderMain.call(this, text) - } - - callHook(this, 'beforeEach', text, function (result) { - var html; - var callback = function () { - if (opt.updatedAt) { - html = formatUpdated(html, opt.updatedAt, this$1.config.formatUpdated); - } - - callHook(this$1, 'afterEach', html, function (text) { return renderMain.call(this$1, text); }); - }; - if (this$1.isHTML) { - html = this$1.result = text; - callback(); - next(); - } else { - prerenderEmbed( - { - compiler: this$1.compiler, - raw: result - }, - function (tokens) { - html = this$1.compiler.compile(tokens); - callback(); - next(); - } - ); - } - }); - }; - - proto._renderCover = function (text, coverOnly) { - var el = getNode('.cover'); - - toggleClass(getNode('main'), coverOnly ? 'add' : 'remove', 'hidden'); - if (!text) { - toggleClass(el, 'remove', 'show'); - return - } - toggleClass(el, 'add', 'show'); - - var html = this.coverIsHTML ? text : this.compiler.cover(text); - - var m = html - .trim() - .match('

    ([^<]*?)

    $'); - - if (m) { - if (m[2] === 'color') { - el.style.background = m[1] + (m[3] || ''); - } else { - var path = m[1]; - - toggleClass(el, 'add', 'has-mask'); - if (!isAbsolutePath(m[1])) { - path = getPath(this.router.getBasePath(), m[1]); - } - el.style.backgroundImage = "url(" + path + ")"; - el.style.backgroundSize = 'cover'; - el.style.backgroundPosition = 'center center'; - } - html = html.replace(m[0], ''); - } - - this._renderTo('.cover-main', html); - sticky(); - }; - - proto._updateRender = function () { - // Render name link - renderNameLink(this); - }; -} - -function initRender(vm) { - var config = vm.config; - - // Init markdown compiler - vm.compiler = new Compiler(config, vm.router); - if (inBrowser) { - window.__current_docsify_compiler__ = vm.compiler; - } - - var id = config.el || '#app'; - var navEl = find('nav') || create('nav'); - - var el = find(id); - var html = ''; - var navAppendToTarget = body; - - if (el) { - if (config.repo) { - html += corner(config.repo); - } - if (config.coverpage) { - html += cover(); - } - - if (config.logo) { - var isBase64 = /^data:image/.test(config.logo); - var isExternal = /(?:http[s]?:)?\/\//.test(config.logo); - var isRelative = /^\./.test(config.logo); - - if (!isBase64 && !isExternal && !isRelative) { - config.logo = getPath(vm.router.getBasePath(), config.logo); - } - } - - html += main(config); - // Render main app - vm._renderTo(el, html, true); - } else { - vm.rendered = true; - } - - if (config.mergeNavbar && isMobile) { - navAppendToTarget = find('.sidebar'); - } else { - navEl.classList.add('app-nav'); - - if (!config.repo) { - navEl.classList.add('no-badge'); - } - } - - // Add nav - if (config.loadNavbar) { - before(navAppendToTarget, navEl); - } - - if (config.themeColor) { - $.head.appendChild( - create('div', theme(config.themeColor)).firstElementChild - ); - // Polyfll - cssVars(config.themeColor); - } - vm._updateRender(); - toggleClass(body, 'ready'); -} - -var cached$2 = {}; - -function getAlias(path, alias, last) { - var match = Object.keys(alias).filter(function (key) { - var re = cached$2[key] || (cached$2[key] = new RegExp(("^" + key + "$"))); - return re.test(path) && path !== last - })[0]; - - return match ? - getAlias(path.replace(cached$2[match], alias[match]), alias, path) : - path -} - -function getFileName(path, ext) { - return new RegExp(("\\.(" + (ext.replace(/^\./, '')) + "|html)$"), 'g').test(path) ? - path : - /\/$/g.test(path) ? (path + "README" + ext) : ("" + path + ext) -} - -var History = function History(config) { - this.config = config; -}; - -History.prototype.getBasePath = function getBasePath () { - return this.config.basePath -}; - -History.prototype.getFile = function getFile (path, isRelative) { - if ( path === void 0 ) path = this.getCurrentPath(); - - var ref = this; - var config = ref.config; - var base = this.getBasePath(); - var ext = typeof config.ext === 'string' ? config.ext : '.md'; - - path = config.alias ? getAlias(path, config.alias) : path; - path = getFileName(path, ext); - path = path === ("/README" + ext) ? config.homepage || path : path; - path = isAbsolutePath(path) ? path : getPath(base, path); - - if (isRelative) { - path = path.replace(new RegExp(("^" + base)), ''); - } - - return path -}; - -History.prototype.onchange = function onchange (cb) { - if ( cb === void 0 ) cb = noop; - - cb(); -}; - -History.prototype.getCurrentPath = function getCurrentPath () {}; - -History.prototype.normalize = function normalize () {}; - -History.prototype.parse = function parse () {}; - -History.prototype.toURL = function toURL (path, params, currentRoute) { - var local = currentRoute && path[0] === '#'; - var route = this.parse(replaceSlug(path)); - - route.query = merge({}, route.query, params); - path = route.path + stringifyQuery(route.query); - path = path.replace(/\.md(\?)|\.md$/, '$1'); - - if (local) { - var idIndex = currentRoute.indexOf('?'); - path = - (idIndex > 0 ? currentRoute.substr(0, idIndex) : currentRoute) + path; - } - - return cleanPath('/' + path) -}; - -function replaceHash(path) { - var i = location.href.indexOf('#'); - location.replace(location.href.slice(0, i >= 0 ? i : 0) + '#' + path); -} - -var HashHistory = (function (History$$1) { - function HashHistory(config) { - History$$1.call(this, config); - this.mode = 'hash'; - } - - if ( History$$1 ) HashHistory.__proto__ = History$$1; - HashHistory.prototype = Object.create( History$$1 && History$$1.prototype ); - HashHistory.prototype.constructor = HashHistory; - - HashHistory.prototype.getBasePath = function getBasePath () { - var path = window.location.pathname || ''; - var base = this.config.basePath; - - return /^(\/|https?:)/g.test(base) ? base : cleanPath(path + '/' + base) - }; - - HashHistory.prototype.getCurrentPath = function getCurrentPath () { - // We can't use location.hash here because it's not - // consistent across browsers - Firefox will pre-decode it! - var href = location.href; - var index = href.indexOf('#'); - return index === -1 ? '' : href.slice(index + 1) - }; - - HashHistory.prototype.onchange = function onchange (cb) { - if ( cb === void 0 ) cb = noop; - - on('hashchange', cb); - }; - - HashHistory.prototype.normalize = function normalize () { - var path = this.getCurrentPath(); - - path = replaceSlug(path); - - if (path.charAt(0) === '/') { - return replaceHash(path) - } - replaceHash('/' + path); - }; - - /** - * Parse the url - * @param {string} [path=location.herf] - * @return {object} { path, query } - */ - HashHistory.prototype.parse = function parse (path) { - if ( path === void 0 ) path = location.href; - - var query = ''; - - var hashIndex = path.indexOf('#'); - if (hashIndex >= 0) { - path = path.slice(hashIndex + 1); - } - - var queryIndex = path.indexOf('?'); - if (queryIndex >= 0) { - query = path.slice(queryIndex + 1); - path = path.slice(0, queryIndex); - } - - return { - path: path, - file: this.getFile(path, true), - query: parseQuery(query) - } - }; - - HashHistory.prototype.toURL = function toURL (path, params, currentRoute) { - return '#' + History$$1.prototype.toURL.call(this, path, params, currentRoute) - }; - - return HashHistory; -}(History)); - -var HTML5History = (function (History$$1) { - function HTML5History(config) { - History$$1.call(this, config); - this.mode = 'history'; - } - - if ( History$$1 ) HTML5History.__proto__ = History$$1; - HTML5History.prototype = Object.create( History$$1 && History$$1.prototype ); - HTML5History.prototype.constructor = HTML5History; - - HTML5History.prototype.getCurrentPath = function getCurrentPath () { - var base = this.getBasePath(); - var path = window.location.pathname; - - if (base && path.indexOf(base) === 0) { - path = path.slice(base.length); - } - - return (path || '/') + window.location.search + window.location.hash - }; - - HTML5History.prototype.onchange = function onchange (cb) { - if ( cb === void 0 ) cb = noop; - - on('click', function (e) { - var el = e.target.tagName === 'A' ? e.target : e.target.parentNode; - - if (el.tagName === 'A' && !/_blank/.test(el.target)) { - e.preventDefault(); - var url = el.href; - window.history.pushState({key: url}, '', url); - cb(); - } - }); - - on('popstate', cb); - }; - - /** - * Parse the url - * @param {string} [path=location.href] - * @return {object} { path, query } - */ - HTML5History.prototype.parse = function parse (path) { - if ( path === void 0 ) path = location.href; - - var query = ''; - - var queryIndex = path.indexOf('?'); - if (queryIndex >= 0) { - query = path.slice(queryIndex + 1); - path = path.slice(0, queryIndex); - } - - var base = getPath(location.origin); - var baseIndex = path.indexOf(base); - - if (baseIndex > -1) { - path = path.slice(baseIndex + base.length); - } - - return { - path: path, - file: this.getFile(path), - query: parseQuery(query) - } - }; - - return HTML5History; -}(History)); - -function routerMixin(proto) { - proto.route = {}; -} - -var lastRoute = {}; - -function updateRender(vm) { - vm.router.normalize(); - vm.route = vm.router.parse(); - body.setAttribute('data-page', vm.route.file); -} - -function initRouter(vm) { - var config = vm.config; - var mode = config.routerMode || 'hash'; - var router; - - if (mode === 'history' && supportsPushState) { - router = new HTML5History(config); - } else { - router = new HashHistory(config); - } - - vm.router = router; - updateRender(vm); - lastRoute = vm.route; - - router.onchange(function (_) { - updateRender(vm); - vm._updateRender(); - - if (lastRoute.path === vm.route.path) { - vm.$resetEvents(); - return - } - - vm.$fetch(); - lastRoute = vm.route; - }); -} - -function eventMixin(proto) { - proto.$resetEvents = function () { - scrollIntoView(this.route.path, this.route.query.id); - - if (this.config.loadNavbar) { - getAndActive(this.router, 'nav'); - } - }; -} - -function initEvent(vm) { - // Bind toggle button - btn('button.sidebar-toggle', vm.router); - collapse('.sidebar', vm.router); - // Bind sticky effect - if (vm.config.coverpage) { - !isMobile && on('scroll', sticky); - } else { - body.classList.add('sticky'); - } -} - -function loadNested(path, qs, file, next, vm, first) { - path = first ? path : path.replace(/\/$/, ''); - path = getParentPath(path); - - if (!path) { - return - } - - get( - vm.router.getFile(path + file) + qs, - false, - vm.config.requestHeaders - ).then(next, function (_) { return loadNested(path, qs, file, next, vm); }); -} - -function fetchMixin(proto) { - var last; - - var abort = function () { return last && last.abort && last.abort(); }; - var request = function (url, hasbar, requestHeaders) { - abort(); - last = get(url, true, requestHeaders); - return last - }; - - var get404Path = function (path, config) { - var notFoundPage = config.notFoundPage; - var ext = config.ext; - var defaultPath = '_404' + (ext || '.md'); - var key; - var path404; - - switch (typeof notFoundPage) { - case 'boolean': - path404 = defaultPath; - break - case 'string': - path404 = notFoundPage; - break - - case 'object': - key = Object.keys(notFoundPage) - .sort(function (a, b) { return b.length - a.length; }) - .find(function (key) { return path.match(new RegExp('^' + key)); }); - - path404 = (key && notFoundPage[key]) || defaultPath; - break - - default: - break - } - - return path404 - }; - - proto._loadSideAndNav = function (path, qs, loadSidebar, cb) { - var this$1 = this; - - return function () { - if (!loadSidebar) { - return cb() - } - - var fn = function (result) { - this$1._renderSidebar(result); - cb(); - }; - - // Load sidebar - loadNested(path, qs, loadSidebar, fn, this$1, true); - } - }; - - proto._fetch = function (cb) { - var this$1 = this; - if ( cb === void 0 ) cb = noop; - - var ref = this.route; - var path = ref.path; - var query = ref.query; - var qs = stringifyQuery(query, ['id']); - var ref$1 = this.config; - var loadNavbar = ref$1.loadNavbar; - var requestHeaders = ref$1.requestHeaders; - var loadSidebar = ref$1.loadSidebar; - // Abort last request - - var file = this.router.getFile(path); - var req = request(file + qs, true, requestHeaders); - - // Current page is html - this.isHTML = /\.html$/g.test(file); - - // Load main content - req.then( - function (text, opt) { return this$1._renderMain( - text, - opt, - this$1._loadSideAndNav(path, qs, loadSidebar, cb) - ); }, - function (_) { - this$1._fetchFallbackPage(file, qs, cb) || this$1._fetch404(file, qs, cb); - } - ); - - // Load nav - loadNavbar && - loadNested( - path, - qs, - loadNavbar, - function (text) { return this$1._renderNav(text); }, - this, - true - ); - }; - - proto._fetchCover = function () { - var this$1 = this; - - var ref = this.config; - var coverpage = ref.coverpage; - var requestHeaders = ref.requestHeaders; - var query = this.route.query; - var root = getParentPath(this.route.path); - - if (coverpage) { - var path = null; - var routePath = this.route.path; - if (typeof coverpage === 'string') { - if (routePath === '/') { - path = coverpage; - } - } else if (Array.isArray(coverpage)) { - path = coverpage.indexOf(routePath) > -1 && '_coverpage'; - } else { - var cover = coverpage[routePath]; - path = cover === true ? '_coverpage' : cover; - } - - var coverOnly = Boolean(path) && this.config.onlyCover; - if (path) { - path = this.router.getFile(root + path); - this.coverIsHTML = /\.html$/g.test(path); - get(path + stringifyQuery(query, ['id']), false, requestHeaders).then( - function (text) { return this$1._renderCover(text, coverOnly); } - ); - } else { - this._renderCover(null, coverOnly); - } - return coverOnly - } - }; - - proto.$fetch = function (cb) { - var this$1 = this; - if ( cb === void 0 ) cb = noop; - - var done = function () { - callHook(this$1, 'doneEach'); - cb(); - }; - - var onlyCover = this._fetchCover(); - - if (onlyCover) { - done(); - } else { - this._fetch(function () { - this$1.$resetEvents(); - done(); - }); - } - }; - - proto._fetchFallbackPage = function (path, qs, cb) { - var this$1 = this; - if ( cb === void 0 ) cb = noop; - - var ref = this.config; - var requestHeaders = ref.requestHeaders; - var fallbackLanguages = ref.fallbackLanguages; - var loadSidebar = ref.loadSidebar; - - if (!fallbackLanguages) { - return false - } - - var local = path.split('/')[1]; - - if (fallbackLanguages.indexOf(local) === -1) { - return false - } - var newPath = path.replace(new RegExp(("^/" + local)), ''); - var req = request(newPath + qs, true, requestHeaders); - - req.then( - function (text, opt) { return this$1._renderMain( - text, - opt, - this$1._loadSideAndNav(path, qs, loadSidebar, cb) - ); }, - function () { return this$1._fetch404(path, qs, cb); } - ); - - return true - }; - /** - * Load the 404 page - * @param path - * @param qs - * @param cb - * @returns {*} - * @private - */ - proto._fetch404 = function (path, qs, cb) { - var this$1 = this; - if ( cb === void 0 ) cb = noop; - - var ref = this.config; - var loadSidebar = ref.loadSidebar; - var requestHeaders = ref.requestHeaders; - var notFoundPage = ref.notFoundPage; - - var fnLoadSideAndNav = this._loadSideAndNav(path, qs, loadSidebar, cb); - if (notFoundPage) { - var path404 = get404Path(path, this.config); - - request(this.router.getFile(path404), true, requestHeaders).then( - function (text, opt) { return this$1._renderMain(text, opt, fnLoadSideAndNav); }, - function () { return this$1._renderMain(null, {}, fnLoadSideAndNav); } - ); - return true - } - - this._renderMain(null, {}, fnLoadSideAndNav); - return false - }; -} - -function initFetch(vm) { - var ref = vm.config; - var loadSidebar = ref.loadSidebar; - - // Server-Side Rendering - if (vm.rendered) { - var activeEl = getAndActive(vm.router, '.sidebar-nav', true, true); - if (loadSidebar && activeEl) { - activeEl.parentNode.innerHTML += window.__SUB_SIDEBAR__; - } - vm._bindEventOnRendered(activeEl); - vm.$resetEvents(); - callHook(vm, 'doneEach'); - callHook(vm, 'ready'); - } else { - vm.$fetch(function (_) { return callHook(vm, 'ready'); }); - } -} - -function initMixin(proto) { - proto._init = function () { - var vm = this; - vm.config = config(); - - initLifecycle(vm); // Init hooks - initPlugin(vm); // Install plugins - callHook(vm, 'init'); - initRouter(vm); // Add router - initRender(vm); // Render base DOM - initEvent(vm); // Bind events - initFetch(vm); // Fetch data - callHook(vm, 'mounted'); - }; -} - -function initPlugin(vm) { - [].concat(vm.config.plugins).forEach(function (fn) { return isFn(fn) && fn(vm._lifecycle, vm); }); -} - - - -var util = Object.freeze({ - cached: cached, - hyphenate: hyphenate, - hasOwn: hasOwn, - merge: merge, - isPrimitive: isPrimitive, - noop: noop, - isFn: isFn, - inBrowser: inBrowser, - isMobile: isMobile, - supportsPushState: supportsPushState, - parseQuery: parseQuery, - stringifyQuery: stringifyQuery, - isAbsolutePath: isAbsolutePath, - getParentPath: getParentPath, - cleanPath: cleanPath, - getPath: getPath, - replaceSlug: replaceSlug -}); - -function initGlobalAPI () { - window.Docsify = { - util: util, - dom: dom, - get: get, - slugify: slugify, - version: '4.9.1' - }; - window.DocsifyCompiler = Compiler; - window.marked = marked; - window.Prism = prism; -} - -/** - * Fork https://github.com/bendrucker/document-ready/blob/master/index.js - */ -function ready(callback) { - var state = document.readyState; - - if (state === 'complete' || state === 'interactive') { - return setTimeout(callback, 0) - } - - document.addEventListener('DOMContentLoaded', callback); -} - -function Docsify() { - this._init(); -} - -var proto = Docsify.prototype; - -initMixin(proto); -routerMixin(proto); -renderMixin(proto); -fetchMixin(proto); -eventMixin(proto); - -/** - * Global API - */ -initGlobalAPI(); - -/** - * Run Docsify - */ -ready(function (_) { return new Docsify(); }); - -}()); diff --git a/lib/docsify.min.js b/lib/docsify.min.js deleted file mode 100644 index d2e60a3..0000000 --- a/lib/docsify.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(){function s(n){var r=Object.create(null);return function(e){var t=c(e)?e:JSON.stringify(e);return r[t]||(r[t]=n(e))}}var o=s(function(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),l=Object.prototype.hasOwnProperty,d=Object.assign||function(e){for(var t=arguments,n=1;n=a.length)i(r);else if("function"==typeof e)if(2===e.length)e(r,function(e){r=e,o(t+1)});else{var n=e(r);r=void 0===n?r:n,o(t+1)}else o(t+1)};o(0)}var f=!0,m=f&&document.body.clientWidth<=600,g=f&&window.history&&window.history.pushState&&window.history.replaceState&&!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/),n={};function v(e,t){if(void 0===t&&(t=!1),"string"==typeof e){if(void 0!==window.Vue)return x(e);e=t?x(e):n[e]||(n[e]=x(e))}return e}var b=f&&document,y=f&&b.body,k=f&&b.head;function x(e,t){return t?e.querySelector(t):b.querySelector(e)}function w(e,t){return[].slice.call(t?e.querySelectorAll(t):b.querySelectorAll(e))}function _(e,t){return e=b.createElement(e),t&&(e.innerHTML=t),e}function S(e,t){return e.appendChild(t)}function A(e,t){return e.insertBefore(t,e.children[0])}function C(e,t,n){u(t)?window.addEventListener(e,t):e.addEventListener(t,n)}function E(e,t,n){u(t)?window.removeEventListener(e,t):e.removeEventListener(t,n)}function $(e,t,n){e&&e.classList[n?t:"toggle"](n||t)}var L,T,e=Object.freeze({getNode:v,$:b,body:y,head:k,find:x,findAll:w,create:_,appendTo:S,before:A,on:C,off:E,toggleClass:$,style:function(e){S(k,_("style",e))}});function R(e,t){if(void 0===t&&(t='
      {inner}
    '),!e||!e.length)return"";var n="";return e.forEach(function(e){n+='
  • '+e.title+"
  • ",e.children&&(n+=R(e.children,t))}),t.replace("{inner}",n)}function r(e,t){return'

    '+t.slice(5).trim()+"

    "}function P(e){var t,n,r=e.loaded,i=e.total,a=e.step;!L&&((n=_("div")).classList.add("progress"),S(y,n),L=n),t=a?80<(t=parseInt(L.style.width||0,10)+a)?80:t:Math.floor(r/i*100),L.style.opacity=1,L.style.width=95<=t?"100%":t+"%",95<=t&&(clearTimeout(T),T=setTimeout(function(e){L.style.opacity=0,L.style.width="0%"},200))}var O={};function F(a,e,t){void 0===e&&(e=!1),void 0===t&&(t={});var o=new XMLHttpRequest,n=function(){o.addEventListener.apply(o,arguments)},r=O[a];if(r)return{then:function(e){return e(r.content,r.opt)},abort:p};for(var i in o.open("GET",a),t)l.call(t,i)&&o.setRequestHeader(i,t[i]);return o.send(),{then:function(r,i){if(void 0===i&&(i=p),e){var t=setInterval(function(e){return P({step:Math.floor(5*Math.random()+1)})},500);n("progress",P),n("loadend",function(e){P(e),clearInterval(t)})}n("error",i),n("load",function(e){var t=e.target;if(400<=t.status)i(t);else{var n=O[a]={content:t.response,opt:{updatedAt:o.getResponseHeader("last-modified")}};r(n.content,n.opt)}})},abort:function(e){return 4!==o.readyState&&o.abort()}}}function j(e,t){e.innerHTML=e.innerHTML.replace(/var\(\s*--theme-color.*?\)/g,t)}var N=/([^{]*?)\w(?=\})/g,z={YYYY:"getFullYear",YY:"getYear",MM:function(e){return e.getMonth()+1},DD:"getDate",HH:"getHours",mm:"getMinutes",ss:"getSeconds"};var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e,t){return e(t={exports:{}},t.exports),t.exports}var M=i(function(m,e){!function(e){var y={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:d,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:d,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:d,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,text:/^[^\n]+/};function l(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||f.defaults,this.rules=y.normal,this.options.pedantic?this.rules=y.pedantic:this.options.gfm&&(this.options.tables?this.rules=y.tables:this.rules=y.gfm)}y._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,y._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,y.def=t(y.def).replace("label",y._label).replace("title",y._title).getRegex(),y.bullet=/(?:[*+-]|\d+\.)/,y.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,y.item=t(y.item,"gm").replace(/bull/g,y.bullet).getRegex(),y.list=t(y.list).replace(/bull/g,y.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+y.def.source+")").getRegex(),y._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",y._comment=//,y.html=t(y.html,"i").replace("comment",y._comment).replace("tag",y._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),y.paragraph=t(y.paragraph).replace("hr",y.hr).replace("heading",y.heading).replace("lheading",y.lheading).replace("tag",y._tag).getRegex(),y.blockquote=t(y.blockquote).replace("paragraph",y.paragraph).getRegex(),y.normal=g({},y),y.gfm=g({},y.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),y.gfm.paragraph=t(y.paragraph).replace("(?!","(?!"+y.gfm.fences.source.replace("\\1","\\2")+"|"+y.list.source.replace("\\1","\\3")+"|").getRegex(),y.tables=g({},y.gfm,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),y.pedantic=g({},y.normal,{html:t("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",y._comment).replace(/tag/g,"(?!(?: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").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),l.rules=y,l.lex=function(e,t){return new l(t).lex(e)},l.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)},l.prototype.token=function(e,t){var n,r,i,a,o,s,l,c,u,p,h,d,g,f,m,v,b=this;for(e=e.replace(/^ +$/gm,"");e;)if((i=b.rules.newline.exec(e))&&(e=e.substring(i[0].length),1 ?/gm,""),b.token(i,t),b.tokens.push({type:"blockquote_end"});else if(i=b.rules.list.exec(e)){for(e=e.substring(i[0].length),l={type:"list_start",ordered:f=1<(a=i[2]).length,start:f?+a:"",loose:!1},b.tokens.push(l),n=!(c=[]),g=(i=i[0].match(b.rules.item)).length,h=0;h?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:d,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:d,text:/^(`+|[^`])[\s\S]*?(?=[\\?@\[\]\\^_`{|}~])/g,n._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,n._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,n.autolink=t(n.autolink).replace("scheme",n._scheme).replace("email",n._email).getRegex(),n._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,n.tag=t(n.tag).replace("comment",y._comment).replace("attribute",n._attribute).getRegex(),n._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/,n._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f\\]*\)|[^\s\x00-\x1f()\\])*?)/,n._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,n.link=t(n.link).replace("label",n._label).replace("href",n._href).replace("title",n._title).getRegex(),n.reflink=t(n.reflink).replace("label",n._label).getRegex(),n.normal=g({},n),n.pedantic=g({},n.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:t(/^!?\[(label)\]\((.*?)\)/).replace("label",n._label).getRegex(),reflink:t(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",n._label).getRegex()}),n.gfm=g({},n.normal,{escape:t(n.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:t(n.text).replace("]|","~]|").replace("|$","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|$").getRegex()}),n.gfm.url=t(n.gfm.url).replace("email",n.gfm._extended_email).getRegex(),n.breaks=g({},n.gfm,{br:t(n.br).replace("{2,}","*").getRegex(),text:t(n.gfm.text).replace("{2,}","*").getRegex()}),c.rules=n,c.output=function(e,t,n){return new c(t,n).output(e)},c.prototype.output=function(e){for(var t,n,r,i,a,o,s=this,l="";e;)if(a=s.rules.escape.exec(e))e=e.substring(a[0].length),l+=a[1];else if(a=s.rules.autolink.exec(e))e=e.substring(a[0].length),r="@"===a[2]?"mailto:"+(n=p(s.mangle(a[1]))):n=p(a[1]),l+=s.renderer.link(r,null,n);else if(s.inLink||!(a=s.rules.url.exec(e))){if(a=s.rules.tag.exec(e))!s.inLink&&/^/i.test(a[0])&&(s.inLink=!1),!s.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(a[0])?s.inRawBlock=!0:s.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(a[0])&&(s.inRawBlock=!1),e=e.substring(a[0].length),l+=s.options.sanitize?s.options.sanitizer?s.options.sanitizer(a[0]):p(a[0]):a[0];else if(a=s.rules.link.exec(e))e=e.substring(a[0].length),s.inLink=!0,r=a[2],i=s.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r))?(r=t[1],t[3]):"":a[3]?a[3].slice(1,-1):"",r=r.trim().replace(/^<([\s\S]*)>$/,"$1"),l+=s.outputLink(a,{href:c.escapes(r),title:c.escapes(i)}),s.inLink=!1;else if((a=s.rules.reflink.exec(e))||(a=s.rules.nolink.exec(e))){if(e=e.substring(a[0].length),t=(a[2]||a[1]).replace(/\s+/g," "),!(t=s.links[t.toLowerCase()])||!t.href){l+=a[0].charAt(0),e=a[0].substring(1)+e;continue}s.inLink=!0,l+=s.outputLink(a,t),s.inLink=!1}else if(a=s.rules.strong.exec(e))e=e.substring(a[0].length),l+=s.renderer.strong(s.output(a[4]||a[3]||a[2]||a[1]));else if(a=s.rules.em.exec(e))e=e.substring(a[0].length),l+=s.renderer.em(s.output(a[6]||a[5]||a[4]||a[3]||a[2]||a[1]));else if(a=s.rules.code.exec(e))e=e.substring(a[0].length),l+=s.renderer.codespan(p(a[2].trim(),!0));else if(a=s.rules.br.exec(e))e=e.substring(a[0].length),l+=s.renderer.br();else if(a=s.rules.del.exec(e))e=e.substring(a[0].length),l+=s.renderer.del(s.output(a[1]));else if(a=s.rules.text.exec(e))e=e.substring(a[0].length),s.inRawBlock?l+=s.renderer.text(a[0]):l+=s.renderer.text(p(s.smartypants(a[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else{if("@"===a[2])r="mailto:"+(n=p(a[0]));else{for(;o=a[0],a[0]=s.rules._backpedal.exec(a[0])[0],o!==a[0];);n=p(a[0]),r="www."===a[1]?"http://"+n:n}e=e.substring(a[0].length),l+=s.renderer.link(r,null,n)}return l},c.escapes=function(e){return e?e.replace(c.rules._escapes,"$1"):e},c.prototype.outputLink=function(e,t){var n=t.href,r=t.title?p(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,p(e[1]))},c.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},c.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i'+(n?e:p(e,!0))+"\n":"
    "+(n?e:p(e,!0))+"
    "},r.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},r.prototype.html=function(e){return e},r.prototype.heading=function(e,t,n){return this.options.headerIds?"'+e+"\n":""+e+"\n"},r.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},r.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},r.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},r.prototype.checkbox=function(e){return" "},r.prototype.paragraph=function(e){return"

    "+e+"

    \n"},r.prototype.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},r.prototype.tablerow=function(e){return"\n"+e+"\n"},r.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"},r.prototype.strong=function(e){return""+e+""},r.prototype.em=function(e){return""+e+""},r.prototype.codespan=function(e){return""+e+""},r.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},r.prototype.del=function(e){return""+e+""},r.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!s.test(e)&&(e=a(this.options.baseUrl,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return n}var i='
    "},r.prototype.image=function(e,t,n){this.options.baseUrl&&!s.test(e)&&(e=a(this.options.baseUrl,e));var r=''+n+'":">"},r.prototype.text=function(e){return e},i.prototype.strong=i.prototype.em=i.prototype.codespan=i.prototype.del=i.prototype.text=function(e){return e},i.prototype.link=i.prototype.image=function(e,t,n){return""+n},i.prototype.br=function(){return""},u.parse=function(e,t){return new u(t).parse(e)},u.prototype.parse=function(e){this.inline=new c(e.links,this.options),this.inlineText=new c(e.links,g({},this.options,{renderer:new i})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},u.prototype.next=function(){return this.token=this.tokens.pop()},u.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},u.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},u.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,h(this.inlineText.output(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="",o="";for(r="",t=0;t"']/,p.escapeReplace=/[&<>"']/g,p.replacements={"&":"&","<":"<",">":">",'"':""","'":"'"},p.escapeTestNoEncode=/[<>"']|&(?!#?\w+;)/,p.escapeReplaceNoEncode=/[<>"']|&(?!#?\w+;)/g;var o={},s=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function d(){}function g(e){for(var t,n,r=arguments,i=1;it)n.splice(t);else for(;n.lengthAn error occurred:

    "+p(e.message+"",!0)+"
    ";throw e}}d.exec=d,f.options=f.setOptions=function(e){return g(f.defaults,e),f},f.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new r,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},f.defaults=f.getDefaults(),f.Parser=u,f.parser=u.parse,f.Renderer=r,f.TextRenderer=i,f.Lexer=l,f.lexer=l.lex,f.InlineLexer=c,f.inlineLexer=c.output,f.parse=f,m.exports=f}(t||"undefined"!=typeof window&&window)}),a=i(function(e){var c="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},u=function(){var l=/\blang(?:uage)?-([\w-]+)\b/i,t=0,P=c.Prism={manual:c.Prism&&c.Prism.manual,disableWorkerMessageHandler:c.Prism&&c.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof o?new o(e.type,P.util.encode(e.content),e.alias):"Array"===P.util.type(e)?e.map(P.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(k instanceof s)){if(g&&b!=t.length-1){if(p.lastIndex=y,!(C=p.exec(e)))break;for(var x=C.index+(d?C[1].length:0),w=C.index+C[0].length,_=b,S=y,A=t.length;_"+r.content+""},!c.document)return c.addEventListener&&(P.disableWorkerMessageHandler||c.addEventListener("message",function(e){var t=JSON.parse(e.data),n=t.language,r=t.code,i=t.immediateClose;c.postMessage(P.highlight(r,P.languages[n],n)),i&&c.close()},!1)),c.Prism;var e=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return e&&(P.filename=e.src,P.manual||e.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(P.highlightAll):window.setTimeout(P.highlightAll,16):document.addEventListener("DOMContentLoaded",P.highlightAll))),c.Prism}();e.exports&&(e.exports=u),void 0!==t&&(t.Prism=u),u.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/(^|[^\\])["']/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},u.languages.markup.tag.inside["attr-value"].inside.entity=u.languages.markup.entity,u.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),u.languages.xml=u.languages.markup,u.languages.html=u.languages.markup,u.languages.mathml=u.languages.markup,u.languages.svg=u.languages.markup,u.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(?:;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^{}\s][^{};]*?(?=\s*\{)/,string:{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/\B!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},u.languages.css.atrule.inside.rest=u.languages.css,u.languages.markup&&(u.languages.insertBefore("markup","tag",{style:{pattern:/()[\s\S]*?(?=<\/style>)/i,lookbehind:!0,inside:u.languages.css,alias:"language-css",greedy:!0}}),u.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:u.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:u.languages.css}},alias:"language-css"}},u.languages.markup.tag)),u.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/[a-z0-9_]+(?=\()/i,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/},u.languages.javascript=u.languages.extend("clike",{keyword:/\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,function:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/i,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/}),u.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[[^\]\r\n]+]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=\s*(?:function\b|(?:\([^()]*\)|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i,alias:"function"},constant:/\b[A-Z][A-Z\d_]*\b/}),u.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${[^}]+}|[^\\`])*`/,greedy:!0,inside:{interpolation:{pattern:/\${[^}]+}/,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}}}),u.languages.javascript["template-string"].inside.interpolation.inside.rest=u.languages.javascript,u.languages.markup&&u.languages.insertBefore("markup","tag",{script:{pattern:/()[\s\S]*?(?=<\/script>)/i,lookbehind:!0,inside:u.languages.javascript,alias:"language-javascript",greedy:!0}}),u.languages.js=u.languages.javascript,"undefined"!=typeof self&&self.Prism&&self.document&&document.querySelector&&(self.Prism.fileHighlight=function(){var l={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"};Array.prototype.slice.call(document.querySelectorAll("pre[data-src]")).forEach(function(e){for(var t,n=e.getAttribute("data-src"),r=e,i=/\blang(?:uage)?-([\w-]+)\b/i;r&&!i.test(r.className);)r=r.parentNode;if(r&&(t=(e.className.match(i)||[,""])[1]),!t){var a=(n.match(/\.(\w+)$/)||[,""])[1];t=l[a]||a}var o=document.createElement("code");o.className="language-"+t,e.textContent="",o.textContent="Loading…",e.appendChild(o);var s=new XMLHttpRequest;s.open("GET",n,!0),s.onreadystatechange=function(){4==s.readyState&&(s.status<400&&s.responseText?(o.textContent=s.responseText,u.highlightElement(o)):400<=s.status?o.textContent="✖ Error "+s.status+" while fetching file: "+s.statusText:o.textContent="✖ Error: File does not exist or is empty")},s.send(null)}),u.plugins.toolbar&&u.plugins.toolbar.registerButton("download-file",function(e){var t=e.element.parentNode;if(t&&/pre/i.test(t.nodeName)&&t.hasAttribute("data-src")&&t.hasAttribute("data-download-link")){var n=t.getAttribute("data-src"),r=document.createElement("a");return r.textContent=t.getAttribute("data-download-link-label")||"Download",r.setAttribute("download",""),r.href=n,r}})},document.addEventListener("DOMContentLoaded",self.Prism.fileHighlight))});function q(e,r){var i=[],a={};return e.forEach(function(e){var t=e.level||1,n=t-1;r?@[\]^`{|}~]/g;function B(e){return e.toLowerCase()}function U(e){if("string"!=typeof e)return"";var t=e.trim().replace(/[A-Z]+/g,B).replace(/<[^>\d]+>/g,"").replace(I,"").replace(/\s/g,"-").replace(/-+/g,"-").replace(/^(\d)/,"_$1"),n=H[t];return n=l.call(H,t)?n+1:0,(H[t]=n)&&(t=t+"-"+n),t}function D(e,t){return''+t+''}U.clear=function(){H={}};var Z=decodeURIComponent,Y=encodeURIComponent;function W(e){var n={};return(e=e.trim().replace(/^(\?|#|&)/,""))&&e.split("&").forEach(function(e){var t=e.replace(/\+/g," ").split("=");n[t[0]]=t[1]&&Z(t[1])}),n}function G(e,t){void 0===t&&(t=[]);var n=[];for(var r in e)-1=g.length))for(var t=0;t=g.length)break}}else n.content&&"string"!=typeof n.content&&f(n.content)}};f(p.tokens)}}}});var ee={};function te(e){void 0===e&&(e="");var r={};return e&&(e=e.replace(/^'/,"").replace(/'$/,"").replace(/(?:^|\s):([\w-]+)=?([\w-]+)?/g,function(e,t,n){return r[t]=n&&n.replace(/"/g,"")||!0,""}).trim()),{str:e,config:r}}var ne={markdown:function(e){return{url:e}},mermaid:function(e){return{url:e}},iframe:function(e,t){return{html:'"}},video:function(e,t){return{html:'"}},audio:function(e,t){return{html:'"}},code:function(e,t){var n=e.match(/\.(\w+)$/);return"md"===(n=t||n&&n[1])&&(n="markdown"),{url:e,lang:n}}},re=function(i,e){var a=this;this.config=i,this.router=e,this.cacheTree={},this.toc=[],this.cacheTOC={},this.linkTarget=i.externalLinkTarget||"_blank",this.contentBase=e.getBasePath();var o,t=this._initRenderer(),n=i.markdown||{};o=u(n)?n(M,t):(M.setOptions(d(n,{renderer:d(t,n.renderer)})),M),this._marked=o,this.compile=function(n){var r=!0,e=s(function(e){r=!1;var t="";return n?(t=c(n)?o(n):o.parser(n),t=i.noEmoji?t:t.replace(/<(pre|template|code)[^>]*?>[\s\S]+?<\/(pre|template|code)>/g,function(e){return e.replace(/:/g,"__colon__")}).replace(/:(\w+?):/gi,f&&window.emojify||D).replace(/__colon__/g,":"),U.clear(),t):n})(n),t=a.router.parse().file;return r?a.toc=a.cacheTOC[t]:a.cacheTOC[t]=[].concat(a.toc),e}};re.prototype.compileEmbed=function(e,t){var n,r=te(t),i=r.str,a=r.config;if(t=i,a.include){var o;if(X(e)||(e=J(this.contentBase,Q(this.router.getCurrentPath()),e)),a.type&&(o=ne[a.type]))(n=o.call(this,e,t)).type=a.type;else{var s="code";/\.(md|markdown)/.test(e)?s="markdown":/\.mmd/.test(e)?s="mermaid":/\.html?/.test(e)?s="iframe":/\.(mp4|ogg)/.test(e)?s="video":/\.mp3/.test(e)&&(s="audio"),(n=ne[s].call(this,e,t)).type=s}return n.fragment=a.fragment,n}},re.prototype._matchNotCompileLink=function(e){for(var t=this.config.noCompileLinks||[],n=0;n
    '+r+""},t.code=e.code=function(e,t){return void 0===t&&(t=""),e=e.replace(/@DOCSIFY_QM@/g,"`"),'
    '+a.highlight(e,a.languages[t]||a.languages.markup)+"
    "},t.link=e.link=function(e,t,n){void 0===t&&(t="");var r="",i=te(t),a=i.str,o=i.config;return t=a,X(e)||l._matchNotCompileLink(e)||o.ignore?r+=0===e.indexOf("mailto:")?"":' target="'+s+'"':(e===l.config.homepage&&(e="README"),e=u.toURL(e,null,u.getCurrentPath())),o.target&&(r+=" target="+o.target),o.disabled&&(r+=" disabled",e="javascript:void(0)"),t&&(r+=' title="'+t+'"'),'"+n+""},t.paragraph=e.paragraph=function(e){return/^!>/.test(e)?r("tip",e):/^\?>/.test(e)?r("warn",e):"

    "+e+"

    "},t.image=e.image=function(e,t,n){var r=e,i="",a=te(t),o=a.str,s=a.config;t=o,s["no-zoom"]&&(i+=" data-no-zoom"),t&&(i+=' title="'+t+'"');var l=s.size;if(l){var c=l.split("x");c[1]?i+="width="+c[0]+" height="+c[1]:i+="width="+c[0]}return X(e)||(r=J(p,Q(u.getCurrentPath()),e)),''+n+'"},t.list=e.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+" "+[/
  • /.test(e.split('class="task-list"')[0])?'class="task-list"':"",n&&1"+e+""},t.listitem=e.listitem=function(e){return/^(]*>)/.test(e)?'
  • ":"
  • "+e+"
  • "},e.origin=t,e},re.prototype.sidebar=function(e,t){var n=this.router.getCurrentPath(),r="";if(e)r=this.compile(e);else{var i=this.cacheTree[n]||q(this.toc,t);r=R(i,"
      {inner}
    "),this.cacheTree[n]=i}return r},re.prototype.subSidebar=function(e){if(e){var t=this.router.getCurrentPath(),n=this.cacheTree,r=this.toc;r[0]&&r[0].ignoreAllSubs&&r.splice(0),r[0]&&1===r[0].level&&r.shift();for(var i=0;i=t||e.classList.contains("hidden")?$(y,"add","sticky"):$(y,"remove","sticky")}}function oe(e,t,r,n){var i=[];null!=(t=v(t))&&(i=w(t,"a"));var a,o=decodeURI(e.toURL(e.getCurrentPath()));return i.sort(function(e,t){return t.href.length-e.href.length}).forEach(function(e){var t=e.getAttribute("href"),n=r?e.parentNode:e;0!==o.indexOf(t)||a?$(n,"remove","active"):(a=e,$(n,"add","active"))}),n&&(b.title=a?a.title||a.innerText+" - "+ie:ie),a}var se=function(){function r(e,t){for(var n=0;nthis.end&&e>=this.next}[this.direction]}},{key:"_defaultEase",value:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t}}]),t}(),ce={},ue=!1,pe=null,he=!0,de=0;function ge(e){if(he){for(var t,n=v(".sidebar"),r=w(".anchor"),i=x(n,".sidebar-nav"),a=x(n,"li.active"),o=document.documentElement,s=(o&&o.scrollTop||document.body.scrollTop)-de,l=0,c=r.length;ls){t||(t=u);break}t=u}if(t){var p=ce[fe(decodeURIComponent(e),t.getAttribute("data-id"))];if(p&&p!==a&&(a&&a.classList.remove("active"),p.classList.add("active"),a=p,!ue&&y.classList.contains("sticky"))){var h=n.clientHeight,d=a.offsetTop+a.clientHeight+40,g=d-0=i.scrollTop&&d<=i.scrollTop+h?i.scrollTop:g?0:d-h;n.scrollTop=f}}}}function fe(e,t){return e+"?id="+t}function me(e,t){if(t){var n,r=x("#"+t);r&&(n=r,pe&&pe.stop(),he=!1,pe=new le({start:window.pageYOffset,end:n.getBoundingClientRect().top+window.pageYOffset,duration:500}).on("tick",function(e){return window.scrollTo(0,e)}).on("done",function(){he=!0,pe=null}).begin());var i=ce[fe(e,t)],a=x(v(".sidebar"),"li.active");a&&a.classList.remove("active"),i&&i.classList.add("active")}}var ve=b.scrollingElement||b.documentElement;var be={};function ye(e,i){var o=e.compiler,a=e.raw;void 0===a&&(a="");var t=e.fetch,n=be[a];if(n){var r=n.slice();return r.links=n.links,i(r)}var s=o._marked,l=s.lexer(a),c=[],u=s.InlineLexer.rules.link,p=l.links;l.forEach(function(e,a){"paragraph"===e.type&&(e.text=e.text.replace(new RegExp(u.source,"g"),function(e,t,n,r){var i=o.compileEmbed(n,r);return i&&c.push({index:a,embed:i}),e}))});var h=0;!function(e,a){var t,n=e.embedTokens,o=e.compile,s=(e.fetch,0),l=1;if(!n.length)return a({});for(;t=n[s++];){var r=function(i){return function(e){var t;if(e)if("markdown"===i.embed.type)t=o.lexer(e);else if("code"===i.embed.type){if(i.embed.fragment){var n=i.embed.fragment,r=new RegExp("(?:###|\\/\\/\\/)\\s*\\["+n+"\\]([\\s\\S]*)(?:###|\\/\\/\\/)\\s*\\["+n+"\\]");e=((e.match(r)||[])[1]||"").trim()}t=o.lexer("```"+i.embed.lang+"\n"+e.replace(/`/g,"@DOCSIFY_QM@")+"\n```\n")}else"mermaid"===i.embed.type?(t=[{type:"html",text:'
    \n'+e+"\n
    "}]).links={}:(t=[{type:"html",text:e}]).links={};a({token:i,embedToken:t}),++l>=s&&a({})}}(t);t.embed.url?F(t.embed.url).then(r):r(t.embed.html)}}({compile:s,embedTokens:c,fetch:t},function(e){var t=e.embedToken,n=e.token;if(n){var r=n.index+h;d(p,t.links),l=l.slice(0,r).concat(t,l.slice(r+1)),h+=t.length-1}else be[a]=l.concat(),l.links=be[a].links=p,i(l)})}function ke(){var e=w(".markdown-section>script").filter(function(e){return!/template/.test(e.type)})[0];if(!e)return!1;var t=e.innerText.trim();if(!t)return!1;setTimeout(function(e){window.__EXECUTE_RESULT__=new Function(t)()},0)}function xe(e,t,n){var r,i,a;return t="function"==typeof n?n(t):"string"==typeof n?(i=[],a=0,(r=n).replace(N,function(t,e,n){i.push(r.substring(a,n-1)),a=n+=t.length+1,i.push(function(e){return("00"+("string"==typeof z[t]?e[z[t]]():z[t](e))).slice(-t.length)})}),a!==r.length&&i.push(r.substring(a)),function(e){for(var t="",n=0,r=e||new Date;n'):""),t.coverpage&&(u+=(i=", 100%, 85%",'
    \x3c!--cover--\x3e
    ')),t.logo){var h=/^data:image/.test(t.logo),d=/(?:http[s]?:)?\/\//.test(t.logo),g=/^\./.test(t.logo);h||d||g||(t.logo=J(e.router.getBasePath(),t.logo))}u+=(r='',(m?r+"
    ":"
    "+r)+'
    \x3c!--main--\x3e
    '),e._renderTo(c,u,!0)}else e.rendered=!0;t.mergeNavbar&&m?p=x(".sidebar"):(l.classList.add("app-nav"),t.repo||l.classList.add("no-badge")),t.loadNavbar&&A(p,l),t.themeColor&&(b.head.appendChild(_("div",(o=t.themeColor,"")).firstElementChild),function(n){if(!(window.CSS&&window.CSS.supports&&window.CSS.supports("(--v:red)"))){var e=w("style:not(.inserted),link");[].forEach.call(e,function(e){if("STYLE"===e.nodeName)j(e,n);else if("LINK"===e.nodeName){var t=e.getAttribute("href");if(!/\.css$/.test(t))return;F(t).then(function(e){var t=_("style",e);k.appendChild(t),j(t,n)})}})}}(t.themeColor)),e._updateRender(),$(y,"ready")}var Se={};var Ae=function(e){this.config=e};function Ce(e){var t=location.href.indexOf("#");location.replace(location.href.slice(0,0<=t?t:0)+"#"+e)}Ae.prototype.getBasePath=function(){return this.config.basePath},Ae.prototype.getFile=function(e,t){void 0===e&&(e=this.getCurrentPath());var n,r,i=this.config,a=this.getBasePath(),o="string"==typeof i.ext?i.ext:".md";return e=i.alias?function e(t,n,r){var i=Object.keys(n).filter(function(e){return(Se[e]||(Se[e]=new RegExp("^"+e+"$"))).test(t)&&t!==r})[0];return i?e(t.replace(Se[i],n[i]),n,t):t}(e,i.alias):e,n=e,r=o,e=(e=new RegExp("\\.("+r.replace(/^\./,"")+"|html)$","g").test(n)?n:/\/$/g.test(n)?n+"README"+r:""+n+r)==="/README"+o&&i.homepage||e,e=X(e)?e:J(a,e),t&&(e=e.replace(new RegExp("^"+a),"")),e},Ae.prototype.onchange=function(e){void 0===e&&(e=p),e()},Ae.prototype.getCurrentPath=function(){},Ae.prototype.normalize=function(){},Ae.prototype.parse=function(){},Ae.prototype.toURL=function(e,t,n){var r=n&&"#"===e[0],i=this.parse(K(e));if(i.query=d({},i.query,t),e=(e=i.path+G(i.query)).replace(/\.md(\?)|\.md$/,"$1"),r){var a=n.indexOf("?");e=(0([^<]*?)

    $');if(i){if("color"===i[2])n.style.background=i[1]+(i[3]||"");else{var a=i[1];$(n,"add","has-mask"),X(i[1])||(a=J(this.router.getBasePath(),i[1])),n.style.backgroundImage="url("+a+")",n.style.backgroundSize="cover",n.style.backgroundPosition="center center"}r=r.replace(i[0],"")}this._renderTo(".cover-main",r),ae()}else $(n,"remove","show")},je._updateRender=function(){!function(e){var t=v(".app-name-link"),n=e.config.nameLink,r=e.route.path;if(t)if(c(e.config.nameLink))t.setAttribute("href",n);else if("object"==typeof n){var i=Object.keys(n).filter(function(e){return-1' -}; - -}()); diff --git a/lib/plugins/emoji.min.js b/lib/plugins/emoji.min.js deleted file mode 100644 index a305a42..0000000 --- a/lib/plugins/emoji.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(){var o=["+1","100","1234","8ball","a","ab","abc","abcd","accept","aerial_tramway","airplane","alarm_clock","alien","ambulance","anchor","angel","anger","angry","anguished","ant","apple","aquarius","aries","arrow_backward","arrow_double_down","arrow_double_up","arrow_down","arrow_down_small","arrow_forward","arrow_heading_down","arrow_heading_up","arrow_left","arrow_lower_left","arrow_lower_right","arrow_right","arrow_right_hook","arrow_up","arrow_up_down","arrow_up_small","arrow_upper_left","arrow_upper_right","arrows_clockwise","arrows_counterclockwise","art","articulated_lorry","astonished","athletic_shoe","atm","b","baby","baby_bottle","baby_chick","baby_symbol","back","baggage_claim","balloon","ballot_box_with_check","bamboo","banana","bangbang","bank","bar_chart","barber","baseball","basketball","bath","bathtub","battery","bear","bee","beer","beers","beetle","beginner","bell","bento","bicyclist","bike","bikini","bird","birthday","black_circle","black_joker","black_large_square","black_medium_small_square","black_medium_square","black_nib","black_small_square","black_square_button","blossom","blowfish","blue_book","blue_car","blue_heart","blush","boar","boat","bomb","book","bookmark","bookmark_tabs","books","boom","boot","bouquet","bow","bowling","bowtie","boy","bread","bride_with_veil","bridge_at_night","briefcase","broken_heart","bug","bulb","bullettrain_front","bullettrain_side","bus","busstop","bust_in_silhouette","busts_in_silhouette","cactus","cake","calendar","calling","camel","camera","cancer","candy","capital_abcd","capricorn","car","card_index","carousel_horse","cat","cat2","cd","chart","chart_with_downwards_trend","chart_with_upwards_trend","checkered_flag","cherries","cherry_blossom","chestnut","chicken","children_crossing","chocolate_bar","christmas_tree","church","cinema","circus_tent","city_sunrise","city_sunset","cl","clap","clapper","clipboard","clock1","clock10","clock1030","clock11","clock1130","clock12","clock1230","clock130","clock2","clock230","clock3","clock330","clock4","clock430","clock5","clock530","clock6","clock630","clock7","clock730","clock8","clock830","clock9","clock930","closed_book","closed_lock_with_key","closed_umbrella","cloud","clubs","cn","cocktail","coffee","cold_sweat","collision","computer","confetti_ball","confounded","confused","congratulations","construction","construction_worker","convenience_store","cookie","cool","cop","copyright","corn","couple","couple_with_heart","couplekiss","cow","cow2","credit_card","crescent_moon","crocodile","crossed_flags","crown","cry","crying_cat_face","crystal_ball","cupid","curly_loop","currency_exchange","curry","custard","customs","cyclone","dancer","dancers","dango","dart","dash","date","de","deciduous_tree","department_store","diamond_shape_with_a_dot_inside","diamonds","disappointed","disappointed_relieved","dizzy","dizzy_face","do_not_litter","dog","dog2","dollar","dolls","dolphin","door","doughnut","dragon","dragon_face","dress","dromedary_camel","droplet","dvd","e-mail","ear","ear_of_rice","earth_africa","earth_americas","earth_asia","egg","eggplant","eight","eight_pointed_black_star","eight_spoked_asterisk","electric_plug","elephant","email","end","envelope","envelope_with_arrow","es","euro","european_castle","european_post_office","evergreen_tree","exclamation","expressionless","eyeglasses","eyes","facepunch","factory","fallen_leaf","family","fast_forward","fax","fearful","feelsgood","feet","ferris_wheel","file_folder","finnadie","fire","fire_engine","fireworks","first_quarter_moon","first_quarter_moon_with_face","fish","fish_cake","fishing_pole_and_fish","fist","five","flags","flashlight","flipper","floppy_disk","flower_playing_cards","flushed","foggy","football","footprints","fork_and_knife","fountain","four","four_leaf_clover","fr","free","fried_shrimp","fries","frog","frowning","fu","fuelpump","full_moon","full_moon_with_face","game_die","gb","gem","gemini","ghost","gift","gift_heart","girl","globe_with_meridians","goat","goberserk","godmode","golf","grapes","green_apple","green_book","green_heart","grey_exclamation","grey_question","grimacing","grin","grinning","guardsman","guitar","gun","haircut","hamburger","hammer","hamster","hand","handbag","hankey","hash","hatched_chick","hatching_chick","headphones","hear_no_evil","heart","heart_decoration","heart_eyes","heart_eyes_cat","heartbeat","heartpulse","hearts","heavy_check_mark","heavy_division_sign","heavy_dollar_sign","heavy_exclamation_mark","heavy_minus_sign","heavy_multiplication_x","heavy_plus_sign","helicopter","herb","hibiscus","high_brightness","high_heel","hocho","honey_pot","honeybee","horse","horse_racing","hospital","hotel","hotsprings","hourglass","hourglass_flowing_sand","house","house_with_garden","hurtrealbad","hushed","ice_cream","icecream","id","ideograph_advantage","imp","inbox_tray","incoming_envelope","information_desk_person","information_source","innocent","interrobang","iphone","it","izakaya_lantern","jack_o_lantern","japan","japanese_castle","japanese_goblin","japanese_ogre","jeans","joy","joy_cat","jp","key","keycap_ten","kimono","kiss","kissing","kissing_cat","kissing_closed_eyes","kissing_heart","kissing_smiling_eyes","koala","koko","kr","lantern","large_blue_circle","large_blue_diamond","large_orange_diamond","last_quarter_moon","last_quarter_moon_with_face","laughing","leaves","ledger","left_luggage","left_right_arrow","leftwards_arrow_with_hook","lemon","leo","leopard","libra","light_rail","link","lips","lipstick","lock","lock_with_ink_pen","lollipop","loop","loud_sound","loudspeaker","love_hotel","love_letter","low_brightness","m","mag","mag_right","mahjong","mailbox","mailbox_closed","mailbox_with_mail","mailbox_with_no_mail","man","man_with_gua_pi_mao","man_with_turban","mans_shoe","maple_leaf","mask","massage","meat_on_bone","mega","melon","memo","mens","metal","metro","microphone","microscope","milky_way","minibus","minidisc","mobile_phone_off","money_with_wings","moneybag","monkey","monkey_face","monorail","moon","mortar_board","mount_fuji","mountain_bicyclist","mountain_cableway","mountain_railway","mouse","mouse2","movie_camera","moyai","muscle","mushroom","musical_keyboard","musical_note","musical_score","mute","nail_care","name_badge","neckbeard","necktie","negative_squared_cross_mark","neutral_face","new","new_moon","new_moon_with_face","newspaper","ng","night_with_stars","nine","no_bell","no_bicycles","no_entry","no_entry_sign","no_good","no_mobile_phones","no_mouth","no_pedestrians","no_smoking","non-potable_water","nose","notebook","notebook_with_decorative_cover","notes","nut_and_bolt","o","o2","ocean","octocat","octopus","oden","office","ok","ok_hand","ok_woman","older_man","older_woman","on","oncoming_automobile","oncoming_bus","oncoming_police_car","oncoming_taxi","one","open_book","open_file_folder","open_hands","open_mouth","ophiuchus","orange_book","outbox_tray","ox","package","page_facing_up","page_with_curl","pager","palm_tree","panda_face","paperclip","parking","part_alternation_mark","partly_sunny","passport_control","paw_prints","peach","pear","pencil","pencil2","penguin","pensive","performing_arts","persevere","person_frowning","person_with_blond_hair","person_with_pouting_face","phone","pig","pig2","pig_nose","pill","pineapple","pisces","pizza","point_down","point_left","point_right","point_up","point_up_2","police_car","poodle","poop","post_office","postal_horn","postbox","potable_water","pouch","poultry_leg","pound","pouting_cat","pray","princess","punch","purple_heart","purse","pushpin","put_litter_in_its_place","question","rabbit","rabbit2","racehorse","radio","radio_button","rage","rage1","rage2","rage3","rage4","railway_car","rainbow","raised_hand","raised_hands","raising_hand","ram","ramen","rat","recycle","red_car","red_circle","registered","relaxed","relieved","repeat","repeat_one","restroom","revolving_hearts","rewind","ribbon","rice","rice_ball","rice_cracker","rice_scene","ring","rocket","roller_coaster","rooster","rose","rotating_light","round_pushpin","rowboat","ru","rugby_football","runner","running","running_shirt_with_sash","sa","sagittarius","sailboat","sake","sandal","santa","satellite","satisfied","saxophone","school","school_satchel","scissors","scorpius","scream","scream_cat","scroll","seat","secret","see_no_evil","seedling","seven","shaved_ice","sheep","shell","ship","shipit","shirt","shit","shoe","shower","signal_strength","six","six_pointed_star","ski","skull","sleeping","sleepy","slot_machine","small_blue_diamond","small_orange_diamond","small_red_triangle","small_red_triangle_down","smile","smile_cat","smiley","smiley_cat","smiling_imp","smirk","smirk_cat","smoking","snail","snake","snowboarder","snowflake","snowman","sob","soccer","soon","sos","sound","space_invader","spades","spaghetti","sparkle","sparkler","sparkles","sparkling_heart","speak_no_evil","speaker","speech_balloon","speedboat","squirrel","star","star2","stars","station","statue_of_liberty","steam_locomotive","stew","straight_ruler","strawberry","stuck_out_tongue","stuck_out_tongue_closed_eyes","stuck_out_tongue_winking_eye","sun_with_face","sunflower","sunglasses","sunny","sunrise","sunrise_over_mountains","surfer","sushi","suspect","suspension_railway","sweat","sweat_drops","sweat_smile","sweet_potato","swimmer","symbols","syringe","tada","tanabata_tree","tangerine","taurus","taxi","tea","telephone","telephone_receiver","telescope","tennis","tent","thought_balloon","three","thumbsdown","thumbsup","ticket","tiger","tiger2","tired_face","tm","toilet","tokyo_tower","tomato","tongue","top","tophat","tractor","traffic_light","train","train2","tram","triangular_flag_on_post","triangular_ruler","trident","triumph","trolleybus","trollface","trophy","tropical_drink","tropical_fish","truck","trumpet","tshirt","tulip","turtle","tv","twisted_rightwards_arrows","two","two_hearts","two_men_holding_hands","two_women_holding_hands","u5272","u5408","u55b6","u6307","u6708","u6709","u6e80","u7121","u7533","u7981","u7a7a","uk","umbrella","unamused","underage","unlock","up","us","v","vertical_traffic_light","vhs","vibration_mode","video_camera","video_game","violin","virgo","volcano","vs","walking","waning_crescent_moon","waning_gibbous_moon","warning","watch","water_buffalo","watermelon","wave","wavy_dash","waxing_crescent_moon","waxing_gibbous_moon","wc","weary","wedding","whale","whale2","wheelchair","white_check_mark","white_circle","white_flower","white_large_square","white_medium_small_square","white_medium_square","white_small_square","white_square_button","wind_chime","wine_glass","wink","wolf","woman","womans_clothes","womans_hat","womens","worried","wrench","x","yellow_heart","yen","yum","zap","zero","zzz"];window.emojify=function(e,a){return-1===o.indexOf(a)?e:''+a+''}}(); diff --git a/lib/plugins/external-script.js b/lib/plugins/external-script.js deleted file mode 100644 index 9d0b332..0000000 --- a/lib/plugins/external-script.js +++ /dev/null @@ -1,28 +0,0 @@ -(function () { -function handleExternalScript() { - var container = Docsify.dom.getNode('#main'); - var scripts = Docsify.dom.findAll(container, 'script'); - - for (var i = scripts.length; i--;) { - var script = scripts[i]; - - if (script && script.src) { - var newScript = document.createElement('script'); - - Array.prototype.slice.call(script.attributes).forEach(function (attribute) { - newScript[attribute.name] = attribute.value; - }); - - script.parentNode.insertBefore(newScript, script); - script.parentNode.removeChild(script); - } - } -} - -var install = function (hook) { - hook.doneEach(handleExternalScript); -}; - -window.$docsify.plugins = [].concat(install, window.$docsify.plugins); - -}()); diff --git a/lib/plugins/external-script.min.js b/lib/plugins/external-script.min.js deleted file mode 100644 index c4f8026..0000000 --- a/lib/plugins/external-script.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(){function e(){for(var o=Docsify.dom.getNode("#main"),e=Docsify.dom.findAll(o,"script"),n=e.length;n--;){var i=e[n];if(i&&i.src){var t=document.createElement("script");Array.prototype.slice.call(i.attributes).forEach(function(o){t[o.name]=o.value}),i.parentNode.insertBefore(t,i),i.parentNode.removeChild(i)}}}window.$docsify.plugins=[].concat(function(o){o.doneEach(e)},window.$docsify.plugins)}(); diff --git a/lib/plugins/front-matter.js b/lib/plugins/front-matter.js deleted file mode 100644 index 9a625ab..0000000 --- a/lib/plugins/front-matter.js +++ /dev/null @@ -1,496 +0,0 @@ -(function () { -/** - * Fork https://github.com/egoist/docute/blob/master/src/utils/yaml.js - */ -/* eslint-disable */ -/* -YAML parser for Javascript -Author: Diogo Costa -This program is released under the MIT License as follows: -Copyright (c) 2011 Diogo Costa (costa.h4evr@gmail.com) -Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -/** - * @name YAML - * @namespace -*/ - -var errors = []; -var reference_blocks = []; -var processing_time = 0; -var regex$1 = { - regLevel: new RegExp('^([\\s\\-]+)'), - invalidLine: new RegExp('^\\-\\-\\-|^\\.\\.\\.|^\\s*#.*|^\\s*$'), - dashesString: new RegExp('^\\s*\\"([^\\"]*)\\"\\s*$'), - quotesString: new RegExp("^\\s*\\'([^\\']*)\\'\\s*$"), - float: new RegExp('^[+-]?[0-9]+\\.[0-9]+(e[+-]?[0-9]+(\\.[0-9]+)?)?$'), - integer: new RegExp('^[+-]?[0-9]+$'), - array: new RegExp('\\[\\s*(.*)\\s*\\]'), - map: new RegExp('\\{\\s*(.*)\\s*\\}'), - key_value: new RegExp('([a-z0-9_-][ a-z0-9_-]*):( .+)', 'i'), - single_key_value: new RegExp('^([a-z0-9_-][ a-z0-9_-]*):( .+?)$', 'i'), - key: new RegExp('([a-z0-9_-][ a-z0-9_-]+):( .+)?', 'i'), - item: new RegExp('^-\\s+'), - trim: new RegExp('^\\s+|\\s+$'), - comment: new RegExp('([^\\\'\\"#]+([\\\'\\"][^\\\'\\"]*[\\\'\\"])*)*(#.*)?') - }; - -/** - * @class A block of lines of a given level. - * @param {int} lvl The block's level. - * @private - */ -function Block(lvl) { - return { - /* The block's parent */ - parent: null, - /* Number of children */ - length: 0, - /* Block's level */ - level: lvl, - /* Lines of code to process */ - lines: [], - /* Blocks with greater level */ - children: [], - /* Add a block to the children collection */ - addChild: function(obj) { - this.children.push(obj); - obj.parent = this; - ++this.length; - } - } -} - -function parser$1(str) { - var regLevel = regex$1['regLevel']; - var invalidLine = regex$1['invalidLine']; - var lines = str.split('\n'); - var m; - var level = 0, - curLevel = 0; - - var blocks = []; - - var result = new Block(-1); - var currentBlock = new Block(0); - result.addChild(currentBlock); - var levels = []; - var line = ''; - - blocks.push(currentBlock); - levels.push(level); - - for (var i = 0, len = lines.length; i < len; ++i) { - line = lines[i]; - - if (line.match(invalidLine)) { - continue - } - - if ((m = regLevel.exec(line))) { - level = m[1].length; - } else { level = 0; } - - if (level > curLevel) { - var oldBlock = currentBlock; - currentBlock = new Block(level); - oldBlock.addChild(currentBlock); - blocks.push(currentBlock); - levels.push(level); - } else if (level < curLevel) { - var added = false; - - var k = levels.length - 1; - for (; k >= 0; --k) { - if (levels[k] == level) { - currentBlock = new Block(level); - blocks.push(currentBlock); - levels.push(level); - if (blocks[k].parent != null) { blocks[k].parent.addChild(currentBlock); } - added = true; - break - } - } - - if (!added) { - errors.push('Error: Invalid indentation at line ' + i + ': ' + line); - return - } - } - - currentBlock.lines.push(line.replace(regex$1['trim'], '')); - curLevel = level; - } - - return result -} - -function processValue(val) { - val = val.replace(regex$1['trim'], ''); - var m = null; - - if (val == 'true') { - return true - } else if (val == 'false') { - return false - } else if (val == '.NaN') { - return Number.NaN - } else if (val == 'null') { - return null - } else if (val == '.inf') { - return Number.POSITIVE_INFINITY - } else if (val == '-.inf') { - return Number.NEGATIVE_INFINITY - } else if ((m = val.match(regex$1['dashesString']))) { - return m[1] - } else if ((m = val.match(regex$1['quotesString']))) { - return m[1] - } else if ((m = val.match(regex$1['float']))) { - return parseFloat(m[0]) - } else if ((m = val.match(regex$1['integer']))) { - return parseInt(m[0]) - } else if (!isNaN((m = Date.parse(val)))) { - return new Date(m) - } else if ((m = val.match(regex$1['single_key_value']))) { - var res = {}; - res[m[1]] = processValue(m[2]); - return res - } else if ((m = val.match(regex$1['array']))) { - var count = 0, - c = ' '; - var res = []; - var content = ''; - var str = false; - for (var j = 0, lenJ = m[1].length; j < lenJ; ++j) { - c = m[1][j]; - if (c == "'" || c == '"') { - if (str === false) { - str = c; - content += c; - continue - } else if ((c == "'" && str == "'") || (c == '"' && str == '"')) { - str = false; - content += c; - continue - } - } else if (str === false && (c == '[' || c == '{')) { - ++count; - } else if (str === false && (c == ']' || c == '}')) { - --count; - } else if (str === false && count == 0 && c == ',') { - res.push(processValue(content)); - content = ''; - continue - } - - content += c; - } - - if (content.length > 0) { res.push(processValue(content)); } - return res - } else if ((m = val.match(regex$1['map']))) { - var count = 0, - c = ' '; - var res = []; - var content = ''; - var str = false; - for (var j = 0, lenJ = m[1].length; j < lenJ; ++j) { - c = m[1][j]; - if (c == "'" || c == '"') { - if (str === false) { - str = c; - content += c; - continue - } else if ((c == "'" && str == "'") || (c == '"' && str == '"')) { - str = false; - content += c; - continue - } - } else if (str === false && (c == '[' || c == '{')) { - ++count; - } else if (str === false && (c == ']' || c == '}')) { - --count; - } else if (str === false && count == 0 && c == ',') { - res.push(content); - content = ''; - continue - } - - content += c; - } - - if (content.length > 0) { res.push(content); } - - var newRes = {}; - for (var j = 0, lenJ = res.length; j < lenJ; ++j) { - if ((m = res[j].match(regex$1['key_value']))) { - newRes[m[1]] = processValue(m[2]); - } - } - - return newRes - } else { return val } -} - -function processFoldedBlock(block) { - var lines = block.lines; - var children = block.children; - var str = lines.join(' '); - var chunks = [str]; - for (var i = 0, len = children.length; i < len; ++i) { - chunks.push(processFoldedBlock(children[i])); - } - return chunks.join('\n') -} - -function processLiteralBlock(block) { - var lines = block.lines; - var children = block.children; - var str = lines.join('\n'); - for (var i = 0, len = children.length; i < len; ++i) { - str += processLiteralBlock(children[i]); - } - return str -} - -function processBlock(blocks) { - var m = null; - var res = {}; - var lines = null; - var children = null; - var currentObj = null; - - var level = -1; - - var processedBlocks = []; - - var isMap = true; - - for (var j = 0, lenJ = blocks.length; j < lenJ; ++j) { - if (level != -1 && level != blocks[j].level) { continue } - - processedBlocks.push(j); - - level = blocks[j].level; - lines = blocks[j].lines; - children = blocks[j].children; - currentObj = null; - - for (var i = 0, len = lines.length; i < len; ++i) { - var line = lines[i]; - - if ((m = line.match(regex$1['key']))) { - var key = m[1]; - - if (key[0] == '-') { - key = key.replace(regex$1['item'], ''); - if (isMap) { - isMap = false; - if (typeof res.length === 'undefined') { - res = []; - } - } - if (currentObj != null) { res.push(currentObj); } - currentObj = {}; - isMap = true; - } - - if (typeof m[2] != 'undefined') { - var value = m[2].replace(regex$1['trim'], ''); - if (value[0] == '&') { - var nb = processBlock(children); - if (currentObj != null) { currentObj[key] = nb; } - else { res[key] = nb; } - reference_blocks[value.substr(1)] = nb; - } else if (value[0] == '|') { - if (currentObj != null) - { currentObj[key] = processLiteralBlock(children.shift()); } - else { res[key] = processLiteralBlock(children.shift()); } - } else if (value[0] == '*') { - var v = value.substr(1); - var no = {}; - - if (typeof reference_blocks[v] == 'undefined') { - errors.push("Reference '" + v + "' not found!"); - } else { - for (var k in reference_blocks[v]) { - no[k] = reference_blocks[v][k]; - } - - if (currentObj != null) { currentObj[key] = no; } - else { res[key] = no; } - } - } else if (value[0] == '>') { - if (currentObj != null) - { currentObj[key] = processFoldedBlock(children.shift()); } - else { res[key] = processFoldedBlock(children.shift()); } - } else { - if (currentObj != null) { currentObj[key] = processValue(value); } - else { res[key] = processValue(value); } - } - } else { - if (currentObj != null) { currentObj[key] = processBlock(children); } - else { res[key] = processBlock(children); } - } - } else if (line.match(/^-\s*$/)) { - if (isMap) { - isMap = false; - if (typeof res.length === 'undefined') { - res = []; - } - } - if (currentObj != null) { res.push(currentObj); } - currentObj = {}; - isMap = true; - continue - } else if ((m = line.match(/^-\s*(.*)/))) { - if (currentObj != null) { currentObj.push(processValue(m[1])); } - else { - if (isMap) { - isMap = false; - if (typeof res.length === 'undefined') { - res = []; - } - } - res.push(processValue(m[1])); - } - continue - } - } - - if (currentObj != null) { - if (isMap) { - isMap = false; - if (typeof res.length === 'undefined') { - res = []; - } - } - res.push(currentObj); - } - } - - for (var j = processedBlocks.length - 1; j >= 0; --j) { - blocks.splice.call(blocks, processedBlocks[j], 1); - } - - return res -} - -function semanticAnalysis(blocks) { - var res = processBlock(blocks.children); - return res -} - -function preProcess(src) { - var m; - var lines = src.split('\n'); - - var r = regex$1['comment']; - - for (var i in lines) { - if ((m = lines[i].match(r))) { - /* var cmt = ""; - if(typeof m[3] != "undefined") - lines[i] = m[1]; - else if(typeof m[3] != "undefined") - lines[i] = m[3]; - else - lines[i] = ""; - */ - if (typeof m[3] !== 'undefined') { - lines[i] = m[0].substr(0, m[0].length - m[3].length); - } - } - } - - return lines.join('\n') -} - -function load(str) { - errors = []; - reference_blocks = []; - processing_time = new Date().getTime(); - var pre = preProcess(str); - var doc = parser$1(pre); - var res = semanticAnalysis(doc); - processing_time = new Date().getTime() - processing_time; - - return res -} - -/** - * Fork https://github.com/egoist/docute/blob/master/src/utils/front-matter.js - */ -/* eslint-disable */ -var optionalByteOrderMark = '\\ufeff?'; -var pattern = - '^(' + - optionalByteOrderMark + - '(= yaml =|---)' + - '$([\\s\\S]*?)' + - '(?:\\2|\\.\\.\\.)' + - '$' + - '' + - '(?:\\n)?)'; -// NOTE: If this pattern uses the 'g' flag the `regex` variable definition will -// need to be moved down into the functions that use it. -var regex = new RegExp(pattern, 'm'); - -function extractor(string) { - string = string || ''; - - var lines = string.split(/(\r?\n)/); - if (lines[0] && /= yaml =|---/.test(lines[0])) { - return parse(string) - } else { - return { attributes: {}, body: string } - } -} - -function parse(string) { - var match = regex.exec(string); - - if (!match) { - return { - attributes: {}, - body: string - } - } - - var yaml = match[match.length - 1].replace(/^\s+|\s+$/g, ''); - var attributes = load(yaml) || {}; - var body = string.replace(match[0], ''); - - return { attributes: attributes, body: body, frontmatter: yaml } -} - -var install = function (hook, vm) { - hook.beforeEach(function (content) { - var ref = extractor(content); - var attributes = ref.attributes; - var body = ref.body; - - vm.frontmatter = attributes; - - return body - }); -}; - -$docsify.plugins = [].concat(install, $docsify.plugins); - -}()); diff --git a/lib/plugins/front-matter.min.js b/lib/plugins/front-matter.min.js deleted file mode 100644 index 32f3a13..0000000 --- a/lib/plugins/front-matter.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(){var b=[],y=[],t=0,R={regLevel:new RegExp("^([\\s\\-]+)"),invalidLine:new RegExp("^\\-\\-\\-|^\\.\\.\\.|^\\s*#.*|^\\s*$"),dashesString:new RegExp('^\\s*\\"([^\\"]*)\\"\\s*$'),quotesString:new RegExp("^\\s*\\'([^\\']*)\\'\\s*$"),float:new RegExp("^[+-]?[0-9]+\\.[0-9]+(e[+-]?[0-9]+(\\.[0-9]+)?)?$"),integer:new RegExp("^[+-]?[0-9]+$"),array:new RegExp("\\[\\s*(.*)\\s*\\]"),map:new RegExp("\\{\\s*(.*)\\s*\\}"),key_value:new RegExp("([a-z0-9_-][ a-z0-9_-]*):( .+)","i"),single_key_value:new RegExp("^([a-z0-9_-][ a-z0-9_-]*):( .+?)$","i"),key:new RegExp("([a-z0-9_-][ a-z0-9_-]+):( .+)?","i"),item:new RegExp("^-\\s+"),trim:new RegExp("^\\s+|\\s+$"),comment:new RegExp("([^\\'\\\"#]+([\\'\\\"][^\\'\\\"]*[\\'\\\"])*)*(#.*)?")};function m(e){return{parent:null,length:0,level:e,lines:[],children:[],addChild:function(e){this.children.push(e),++(e.parent=this).length}}}function N(e){var n=null;if("true"==(e=e.replace(R.trim,"")))return!0;if("false"==e)return!1;if(".NaN"==e)return Number.NaN;if("null"==e)return null;if(".inf"==e)return Number.POSITIVE_INFINITY;if("-.inf"==e)return Number.NEGATIVE_INFINITY;if(n=e.match(R.dashesString))return n[1];if(n=e.match(R.quotesString))return n[1];if(n=e.match(R.float))return parseFloat(n[0]);if(n=e.match(R.integer))return parseInt(n[0]);if(isNaN(n=Date.parse(e))){if(n=e.match(R.single_key_value))return(i={})[n[1]]=N(n[2]),i;if(n=e.match(R.array)){for(var t=0,r=" ",i=[],l="",u=!1,a=0,s=n[1].length;a"==d[0]?null!=u?u[v]=_(l.shift()):r[v]=_(l.shift()):null!=u?u[v]=N(d):r[v]=N(d)}else null!=u?u[v]=e(l):r[v]=e(l)}else{if(g.match(/^-\s*$/)){f&&(f=!1,void 0===r.length&&(r=[])),null!=u&&r.push(u),u={},f=!0;continue}if(t=g.match(/^-\s*(.*)/)){null!=u?u.push(N(t[1])):(f&&(f=!1,void 0===r.length&&(r=[])),r.push(N(t[1])));continue}}}null!=u&&(f&&(f=!1,void 0===r.length&&(r=[])),r.push(u))}for(h=s.length-1;0<=h;--h)n.splice.call(n,s[h],1);return r}(e.children)}function l(e){b=[],y=[],t=(new Date).getTime();var n=r(function(e){var n,t=R.regLevel,r=R.invalidLine,i=e.split("\n"),l=0,u=0,a=[],s=new m(-1),f=new m(0);s.addChild(f);var h=[],o="";a.push(f),h.push(l);for(var c=0,p=i.length;c': '>', - '"': '"', - '\'': ''', - '/': '/' - }; - - return String(string).replace(/[&<>"'/]/g, function (s) { return entityMap[s]; }) -} - -function getAllPaths(router) { - var paths = []; - - Docsify.dom.findAll('.sidebar-nav a:not(.section-link):not([data-nosearch])').forEach(function (node) { - var href = node.href; - var originHref = node.getAttribute('href'); - var path = router.parse(href).path; - - if ( - path && - paths.indexOf(path) === -1 && - !Docsify.util.isAbsolutePath(originHref) - ) { - paths.push(path); - } - }); - - return paths -} - -function saveData(maxAge, expireKey, indexKey) { - localStorage.setItem(expireKey, Date.now() + maxAge); - localStorage.setItem(indexKey, JSON.stringify(INDEXS)); -} - -function genIndex(path, content, router, depth) { - if ( content === void 0 ) content = ''; - - var tokens = window.marked.lexer(content); - var slugify = window.Docsify.slugify; - var index = {}; - var slug; - - tokens.forEach(function (token) { - if (token.type === 'heading' && token.depth <= depth) { - slug = router.toURL(path, {id: slugify(token.text)}); - index[slug] = {slug: slug, title: token.text, body: ''}; - } else { - if (!slug) { - return - } - if (!index[slug]) { - index[slug] = {slug: slug, title: '', body: ''}; - } else if (index[slug].body) { - index[slug].body += '\n' + (token.text || ''); - } else { - index[slug].body = token.text; - } - } - }); - slugify.clear(); - return index -} - -/** - * @param {String} query - * @returns {Array} - */ -function search(query) { - var matchingResults = []; - var data = []; - Object.keys(INDEXS).forEach(function (key) { - data = data.concat(Object.keys(INDEXS[key]).map(function (page) { return INDEXS[key][page]; })); - }); - - query = query.trim(); - var keywords = query.split(/[\s\-,\\/]+/); - if (keywords.length !== 1) { - keywords = [].concat(query, keywords); - } - - var loop = function ( i ) { - var post = data[i]; - var isMatch = false; - var resultStr = ''; - var postTitle = post.title && post.title.trim(); - var postContent = post.body && post.body.trim(); - var postUrl = post.slug || ''; - - if (postTitle && postContent) { - keywords.forEach(function (keyword) { - // From https://github.com/sindresorhus/escape-string-regexp - var regEx = new RegExp( - keyword.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&'), - 'gi' - ); - var indexTitle = -1; - var indexContent = -1; - - indexTitle = postTitle && postTitle.search(regEx); - indexContent = postContent && postContent.search(regEx); - - if (indexTitle < 0 && indexContent < 0) { - isMatch = false; - } else { - isMatch = true; - if (indexContent < 0) { - indexContent = 0; - } - - var start = 0; - var end = 0; - - start = indexContent < 11 ? 0 : indexContent - 10; - end = start === 0 ? 70 : indexContent + keyword.length + 60; - - if (end > postContent.length) { - end = postContent.length; - } - - var matchContent = - '...' + - escapeHtml(postContent) - .substring(start, end) - .replace(regEx, ("" + keyword + "")) + - '...'; - - resultStr += matchContent; - } - }); - - if (isMatch) { - var matchingPost = { - title: escapeHtml(postTitle), - content: resultStr, - url: postUrl - }; - - matchingResults.push(matchingPost); - } - } - }; - - for (var i = 0; i < data.length; i++) loop( i ); - - return matchingResults -} - -function init$1(config, vm) { - var isAuto = config.paths === 'auto'; - - var expireKey = resolveExpireKey(config.namespace); - var indexKey = resolveIndexKey(config.namespace); - - var isExpired = localStorage.getItem(expireKey) < Date.now(); - - INDEXS = JSON.parse(localStorage.getItem(indexKey)); - - if (isExpired) { - INDEXS = {}; - } else if (!isAuto) { - return - } - - var paths = isAuto ? getAllPaths(vm.router) : config.paths; - var len = paths.length; - var count = 0; - - paths.forEach(function (path) { - if (INDEXS[path]) { - return count++ - } - - Docsify - .get(vm.router.getFile(path), false, vm.config.requestHeaders) - .then(function (result) { - INDEXS[path] = genIndex(path, result, vm.router, config.depth); - len === ++count && saveData(config.maxAge, expireKey, indexKey); - }); - }); -} - -var NO_DATA_TEXT = ''; -var options; - -function style() { - var code = "\n.sidebar {\n padding-top: 0;\n}\n\n.search {\n margin-bottom: 20px;\n padding: 6px;\n border-bottom: 1px solid #eee;\n}\n\n.search .input-wrap {\n display: flex;\n align-items: center;\n}\n\n.search .results-panel {\n display: none;\n}\n\n.search .results-panel.show {\n display: block;\n}\n\n.search input {\n outline: none;\n border: none;\n width: 100%;\n padding: 0 7px;\n line-height: 36px;\n font-size: 14px;\n}\n\n.search input::-webkit-search-decoration,\n.search input::-webkit-search-cancel-button,\n.search input {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n.search .clear-button {\n width: 36px;\n text-align: right;\n display: none;\n}\n\n.search .clear-button.show {\n display: block;\n}\n\n.search .clear-button svg {\n transform: scale(.5);\n}\n\n.search h2 {\n font-size: 17px;\n margin: 10px 0;\n}\n\n.search a {\n text-decoration: none;\n color: inherit;\n}\n\n.search .matching-post {\n border-bottom: 1px solid #eee;\n}\n\n.search .matching-post:last-child {\n border-bottom: 0;\n}\n\n.search p {\n font-size: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n\n.search p.empty {\n text-align: center;\n}\n\n.app-name.hide, .sidebar-nav.hide {\n display: none;\n}"; - - Docsify.dom.style(code); -} - -function tpl(defaultValue) { - if ( defaultValue === void 0 ) defaultValue = ''; - - var html = - "
    \n \n
    \n \n \n \n \n \n
    \n
    \n
    \n "; - var el = Docsify.dom.create('div', html); - var aside = Docsify.dom.find('aside'); - - Docsify.dom.toggleClass(el, 'search'); - Docsify.dom.before(aside, el); -} - -function doSearch(value) { - var $search = Docsify.dom.find('div.search'); - var $panel = Docsify.dom.find($search, '.results-panel'); - var $clearBtn = Docsify.dom.find($search, '.clear-button'); - var $sidebarNav = Docsify.dom.find('.sidebar-nav'); - var $appName = Docsify.dom.find('.app-name'); - - if (!value) { - $panel.classList.remove('show'); - $clearBtn.classList.remove('show'); - $panel.innerHTML = ''; - - if (options.hideOtherSidebarContent) { - $sidebarNav.classList.remove('hide'); - $appName.classList.remove('hide'); - } - return - } - var matchs = search(value); - - var html = ''; - matchs.forEach(function (post) { - html += ""; - }); - - $panel.classList.add('show'); - $clearBtn.classList.add('show'); - $panel.innerHTML = html || ("

    " + NO_DATA_TEXT + "

    "); - if (options.hideOtherSidebarContent) { - $sidebarNav.classList.add('hide'); - $appName.classList.add('hide'); - } -} - -function bindEvents() { - var $search = Docsify.dom.find('div.search'); - var $input = Docsify.dom.find($search, 'input'); - var $inputWrap = Docsify.dom.find($search, '.input-wrap'); - - var timeId; - // Prevent to Fold sidebar - Docsify.dom.on( - $search, - 'click', - function (e) { return e.target.tagName !== 'A' && e.stopPropagation(); } - ); - Docsify.dom.on($input, 'input', function (e) { - clearTimeout(timeId); - timeId = setTimeout(function (_) { return doSearch(e.target.value.trim()); }, 100); - }); - Docsify.dom.on($inputWrap, 'click', function (e) { - // Click input outside - if (e.target.tagName !== 'INPUT') { - $input.value = ''; - doSearch(); - } - }); -} - -function updatePlaceholder(text, path) { - var $input = Docsify.dom.getNode('.search input[type="search"]'); - - if (!$input) { - return - } - if (typeof text === 'string') { - $input.placeholder = text; - } else { - var match = Object.keys(text).filter(function (key) { return path.indexOf(key) > -1; })[0]; - $input.placeholder = text[match]; - } -} - -function updateNoData(text, path) { - if (typeof text === 'string') { - NO_DATA_TEXT = text; - } else { - var match = Object.keys(text).filter(function (key) { return path.indexOf(key) > -1; })[0]; - NO_DATA_TEXT = text[match]; - } -} - -function updateOptions(opts) { - options = opts; -} - -function init(opts, vm) { - var keywords = vm.router.parse().query.s; - - updateOptions(opts); - style(); - tpl(keywords); - bindEvents(); - keywords && setTimeout(function (_) { return doSearch(keywords); }, 500); -} - -function update(opts, vm) { - updateOptions(opts); - updatePlaceholder(opts.placeholder, vm.route.path); - updateNoData(opts.noData, vm.route.path); -} - -var CONFIG = { - placeholder: 'Type to search', - noData: 'No Results!', - paths: 'auto', - depth: 2, - maxAge: 86400000, // 1 day - hideOtherSidebarContent: false, - namespace: undefined -}; - -var install = function (hook, vm) { - var util = Docsify.util; - var opts = vm.config.search || CONFIG; - - if (Array.isArray(opts)) { - CONFIG.paths = opts; - } else if (typeof opts === 'object') { - CONFIG.paths = Array.isArray(opts.paths) ? opts.paths : 'auto'; - CONFIG.maxAge = util.isPrimitive(opts.maxAge) ? opts.maxAge : CONFIG.maxAge; - CONFIG.placeholder = opts.placeholder || CONFIG.placeholder; - CONFIG.noData = opts.noData || CONFIG.noData; - CONFIG.depth = opts.depth || CONFIG.depth; - CONFIG.hideOtherSidebarContent = opts.hideOtherSidebarContent || CONFIG.hideOtherSidebarContent; - CONFIG.namespace = opts.namespace || CONFIG.namespace; - } - - var isAuto = CONFIG.paths === 'auto'; - - hook.mounted(function (_) { - init(CONFIG, vm); - !isAuto && init$1(CONFIG, vm); - }); - hook.doneEach(function (_) { - update(CONFIG, vm); - isAuto && init$1(CONFIG, vm); - }); -}; - -$docsify.plugins = [].concat(install, $docsify.plugins); - -}()); diff --git a/lib/plugins/search.min.js b/lib/plugins/search.min.js deleted file mode 100644 index 14d5be2..0000000 --- a/lib/plugins/search.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(){var f={},u={EXPIRE_KEY:"docsify.search.expires",INDEX_KEY:"docsify.search.index"};function h(e){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(e).replace(/[&<>"'/]/g,function(e){return n[e]})}function o(o,r){var e,n,t="auto"===o.paths,s=(e=o.namespace)?u.EXPIRE_KEY+"/"+e:u.EXPIRE_KEY,c=(n=o.namespace)?u.INDEX_KEY+"/"+n:u.INDEX_KEY,a=localStorage.getItem(s)l.length&&(o=l.length);var r="..."+h(l).substring(i,o).replace(t,''+e+"")+"...";c+=r}}),s)){var a={title:h(d),content:c,url:t};i.push(a)}},t=0;t\n

    '+e.title+"

    \n

    "+e.content+"

    \n\n"}),t.classList.add("show"),a.classList.add("show"),t.innerHTML=s||'

    '+d+"

    ",c.hideOtherSidebarContent&&(i.classList.add("hide"),o.classList.add("hide"))}function l(e){c=e}function r(e,n){var t,a,i,o,r=n.router.parse().query.s;l(e),Docsify.dom.style("\n.sidebar {\n padding-top: 0;\n}\n\n.search {\n margin-bottom: 20px;\n padding: 6px;\n border-bottom: 1px solid #eee;\n}\n\n.search .input-wrap {\n display: flex;\n align-items: center;\n}\n\n.search .results-panel {\n display: none;\n}\n\n.search .results-panel.show {\n display: block;\n}\n\n.search input {\n outline: none;\n border: none;\n width: 100%;\n padding: 0 7px;\n line-height: 36px;\n font-size: 14px;\n}\n\n.search input::-webkit-search-decoration,\n.search input::-webkit-search-cancel-button,\n.search input {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n.search .clear-button {\n width: 36px;\n text-align: right;\n display: none;\n}\n\n.search .clear-button.show {\n display: block;\n}\n\n.search .clear-button svg {\n transform: scale(.5);\n}\n\n.search h2 {\n font-size: 17px;\n margin: 10px 0;\n}\n\n.search a {\n text-decoration: none;\n color: inherit;\n}\n\n.search .matching-post {\n border-bottom: 1px solid #eee;\n}\n\n.search .matching-post:last-child {\n border-bottom: 0;\n}\n\n.search p {\n font-size: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n\n.search p.empty {\n text-align: center;\n}\n\n.app-name.hide, .sidebar-nav.hide {\n display: none;\n}"),function(e){void 0===e&&(e="");var n='
    \n \n
    \n \n \n \n \n \n
    \n
    \n
    \n ',t=Docsify.dom.create("div",n),a=Docsify.dom.find("aside");Docsify.dom.toggleClass(t,"search"),Docsify.dom.before(a,t)}(r),a=Docsify.dom.find("div.search"),i=Docsify.dom.find(a,"input"),o=Docsify.dom.find(a,".input-wrap"),Docsify.dom.on(a,"click",function(e){return"A"!==e.target.tagName&&e.stopPropagation()}),Docsify.dom.on(i,"input",function(n){clearTimeout(t),t=setTimeout(function(e){return s(n.target.value.trim())},100)}),Docsify.dom.on(o,"click",function(e){"INPUT"!==e.target.tagName&&(i.value="",s())}),r&&setTimeout(function(e){return s(r)},500)}function p(e,n){l(e),function(e,n){var t=Docsify.dom.getNode('.search input[type="search"]');if(t)if("string"==typeof e)t.placeholder=e;else{var a=Object.keys(e).filter(function(e){return-1w.scrollOffset&&o(150);}},u=function(a){-1E.scrollOffset&&p(150)}},z=function(e){-1nav,body:not(.ready) [data-cloak]{display:none}div#app{font-size:30px;font-weight:lighter;margin:40vh auto;text-align:center}div#app:empty:before{content:"Loading..."}.emoji{height:1.2rem;vertical-align:middle}.progress{background-color:var(--theme-color,#0074d9);height:2px;left:0;position:fixed;right:0;top:0;transition:width .2s,opacity .4s;width:0;z-index:5}.search .search-keyword,.search a:hover{color:var(--theme-color,#0074d9)}.search .search-keyword{font-style:normal;font-weight:700}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:#34495e;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0;overflow-x:hidden}img{max-width:100%}a[disabled]{cursor:not-allowed;opacity:.6}kbd{border:1px solid #ccc;border-radius:3px;display:inline-block;font-size:12px!important;line-height:12px;margin-bottom:3px;padding:3px 5px;vertical-align:middle}li input[type=checkbox]{margin:0 .2em .25em 0;vertical-align:middle}.app-nav{margin:25px 60px 0 0;position:absolute;right:0;text-align:right;z-index:2}.app-nav.no-badge{margin-right:25px}.app-nav p{margin:0}.app-nav>a{margin:0 1rem;padding:5px 0}.app-nav li,.app-nav ul{display:inline-block;list-style:none;margin:0}.app-nav a{color:inherit;font-size:16px;text-decoration:none;transition:color .3s}.app-nav a.active,.app-nav a:hover{color:var(--theme-color,#0074d9)}.app-nav a.active{border-bottom:2px solid var(--theme-color,#0074d9)}.app-nav li{display:inline-block;margin:0 1rem;padding:5px 0;position:relative}.app-nav li ul{background-color:#fff;border:1px solid #ddd;border-bottom-color:#ccc;border-radius:4px;box-sizing:border-box;display:none;max-height:calc(100vh - 61px);overflow-y:auto;padding:10px 0;position:absolute;right:-15px;text-align:left;top:100%;white-space:nowrap}.app-nav li ul li{display:block;font-size:14px;line-height:1rem;margin:0;margin:8px 14px;white-space:nowrap}.app-nav li ul a{display:block;font-size:inherit;margin:0;padding:0}.app-nav li ul a.active{border-bottom:0}.app-nav li:hover ul{display:block}.github-corner{border-bottom:0;position:fixed;right:0;text-decoration:none;top:0;z-index:1}.github-corner:hover .octo-arm{animation:a .56s ease-in-out}.github-corner svg{color:#fff;fill:var(--theme-color,#0074d9);height:80px;width:80px}main{display:block;position:relative;width:100vw;height:100%;z-index:0}main.hidden{display:none}.anchor{display:inline-block;text-decoration:none;transition:all .3s}.anchor span{color:#34495e}.anchor:hover{text-decoration:underline}.sidebar{border-right:1px solid rgba(0,0,0,.07);overflow-y:auto;padding:40px 0 0;position:absolute;top:0;bottom:0;left:0;transition:transform .25s ease-out;width:16rem;z-index:3}.sidebar>h1{margin:0 auto 1rem;font-size:1.5rem;font-weight:300;text-align:center}.sidebar>h1 a{color:inherit;text-decoration:none}.sidebar>h1 .app-nav{display:block;position:static}.sidebar .sidebar-nav{line-height:2em;padding-bottom:40px}.sidebar li.collapse .app-sub-sidebar{display:none}.sidebar ul{margin:0 0 0 15px;padding:0}.sidebar li>p{font-weight:700;margin:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{border-bottom:none;display:block}.sidebar ul li ul{padding-left:20px}.sidebar::-webkit-scrollbar{width:4px}.sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}.sidebar:hover::-webkit-scrollbar-thumb{background:hsla(0,0%,53%,.4)}.sidebar:hover::-webkit-scrollbar-track{background:hsla(0,0%,53%,.1)}.sidebar-toggle{background-color:transparent;background-color:hsla(0,0%,100%,.8);border:0;outline:none;padding:10px;position:absolute;bottom:0;left:0;text-align:center;transition:opacity .3s;width:0;z-index:4}.sidebar-toggle .sidebar-toggle-button:hover{opacity:.4}.sidebar-toggle span{background-color:var(--theme-color,#0074d9);display:block;margin-bottom:4px;width:16px;height:2px}body.sticky .sidebar,body.sticky .sidebar-toggle{position:fixed}.content{padding-top:60px;position:absolute;top:0;right:0;bottom:0;left:16rem;transition:left .25s ease}.markdown-section{margin:0 auto;max-width:800px;padding:30px 15px 40px;position:relative}.markdown-section>*{box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}.markdown-section hr{border:none;border-bottom:1px solid #eee;margin:2em 0}.markdown-section iframe{border:1px solid #eee}.markdown-section table{border-collapse:collapse;border-spacing:0;display:block;margin-bottom:1rem;overflow:auto;width:100%}.markdown-section th{font-weight:700}.markdown-section td,.markdown-section th{border:1px solid #ddd;padding:6px 13px}.markdown-section tr{border-top:1px solid #ccc}.markdown-section p.tip,.markdown-section tr:nth-child(2n){background-color:#f8f8f8}.markdown-section p.tip{border-bottom-right-radius:2px;border-left:4px solid #f66;border-top-right-radius:2px;margin:2em 0;padding:12px 24px 12px 30px;position:relative}.markdown-section p.tip:before{background-color:#f66;border-radius:100%;color:#fff;content:"!";font-family:Dosis,Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:14px;font-weight:700;left:-12px;line-height:20px;position:absolute;height:20px;width:20px;text-align:center;top:14px}.markdown-section p.tip code{background-color:#efefef}.markdown-section p.tip em{color:#34495e}.markdown-section p.warn{background:rgba(0,116,217,.1);border-radius:2px;padding:1rem}.markdown-section ul.task-list>li{list-style-type:none}body.close .sidebar{transform:translateX(-16rem)}body.close .sidebar-toggle{width:auto}body.close .content{left:0}@media print{.app-nav,.github-corner,.sidebar,.sidebar-toggle{display:none}}@media screen and (max-width:768px){.github-corner,.sidebar,.sidebar-toggle{position:fixed}.app-nav{margin-top:16px}.app-nav li ul{top:30px}main{height:auto;overflow-x:hidden}.sidebar{left:-16rem;transition:transform .25s ease-out}.content{left:0;max-width:100vw;position:static;padding-top:20px;transition:transform .25s ease}.app-nav,.github-corner{transition:transform .25s ease-out}.sidebar-toggle{background-color:transparent;width:auto;padding:30px 30px 10px 10px}body.close .sidebar{transform:translateX(16rem)}body.close .sidebar-toggle{background-color:hsla(0,0%,100%,.8);transition:background-color 1s;width:0;padding:10px}body.close .content{transform:translateX(16rem)}body.close .app-nav,body.close .github-corner{display:none}.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:a .56s ease-in-out}}@keyframes a{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}section.cover{-ms-flex-align:center;align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;height:100vh;display:none}section.cover.show{display:-ms-flexbox;display:flex}section.cover.has-mask .mask{background-color:#fff;opacity:.8;position:absolute;top:0;height:100%;width:100%}section.cover .cover-main{-ms-flex:1;flex:1;margin:-20px 16px 0;text-align:center;z-index:1}section.cover a{color:inherit}section.cover a,section.cover a:hover{text-decoration:none}section.cover p{line-height:1.5rem;margin:1em 0}section.cover h1{color:inherit;font-size:2.5rem;font-weight:300;margin:.625rem 0 2.5rem;position:relative;text-align:center}section.cover h1 a{display:block}section.cover h1 small{bottom:-.4375rem;font-size:1rem;position:absolute}section.cover blockquote{font-size:1.5rem;text-align:center}section.cover ul{line-height:1.8;list-style-type:none;margin:1em auto;max-width:500px;padding:0}section.cover .cover-main>p:last-child a{border:1px solid var(--theme-color,#0074d9);border-radius:2rem;box-sizing:border-box;color:var(--theme-color,#0074d9);display:inline-block;font-size:1.05rem;letter-spacing:.1rem;margin:.5rem 1rem;padding:.75em 2rem;text-decoration:none;transition:all .15s ease}section.cover .cover-main>p:last-child a:last-child{background-color:var(--theme-color,#0074d9);color:#fff}section.cover .cover-main>p:last-child a:last-child:hover{color:inherit;opacity:.8}section.cover .cover-main>p:last-child a:hover{color:inherit}section.cover blockquote>p>a{border-bottom:2px solid var(--theme-color,#0074d9);transition:color .3s}section.cover blockquote>p>a:hover{color:var(--theme-color,#0074d9)}.sidebar{color:#364149;background-color:#fff}.sidebar a{color:#666;text-decoration:none}.sidebar li{list-style:none;margin:0;padding:.2em 0}.sidebar ul li ul{padding:0}.sidebar li.active{background-color:#eee}.sidebar li.active a{color:#333}.markdown-section h1,.markdown-section h2,.markdown-section h3,.markdown-section h4,.markdown-section strong{color:#333;font-weight:400}.markdown-section a{color:var(--theme-color,#0074d9);font-weight:400}.markdown-section ol,.markdown-section p,.markdown-section ul{line-height:1.6rem;margin:0 0 1em;word-spacing:.05rem}.markdown-section h1{font-size:2rem;font-weight:500;margin:0 0 1rem}.markdown-section h2{font-size:1.8rem;font-weight:400;margin:0 0 1rem;padding:1rem 0 0}.markdown-section h3{font-size:1.5rem;margin:52px 0 1.2rem}.markdown-section h4{font-size:1.25rem}.markdown-section h5{font-size:1rem}.markdown-section h6{color:#777;font-size:1rem}.markdown-section figure,.markdown-section ol,.markdown-section p,.markdown-section ul{margin:1.2em 0}.markdown-section ol,.markdown-section ul{padding-left:1.5rem}.markdown-section li{line-height:1.5;margin:0}.markdown-section blockquote{border-left:4px solid var(--theme-color,#0074d9);color:#858585;margin:2em 0;padding-left:20px}.markdown-section blockquote p{font-weight:600;margin-left:0}.markdown-section iframe{margin:1em 0}.markdown-section em{color:#7f8c8d}.markdown-section code{border-radius:3px;padding:.2em .4rem;white-space:nowrap}.markdown-section code,.markdown-section pre{background-color:#f9f9f9;font-family:Inconsolata}.markdown-section pre{border-left:2px solid #eee;font-size:16px;margin:0 0 1em;padding:8px;padding:0 10px 12px 0;overflow:auto;word-wrap:normal;position:relative}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#93a1a1}.token.punctuation{color:#586e75}.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#268bd2}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string,.token.url{color:#2aa198}.token.entity{color:#657b83;background:#eee8d5}.token.atrule,.token.attr-value,.token.keyword{color:#a11}.token.function{color:#b58900}.token.important,.token.regex,.token.variable{color:#cb4b16}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.markdown-section pre>code{background-color:#f8f8f8;border-radius:2px;display:block;font-family:Inconsolata;line-height:1.1rem;max-width:inherit;overflow:inherit;padding:20px .8em;position:relative;white-space:inherit}.markdown-section code:after,.markdown-section code:before{letter-spacing:.05rem}code .token{-webkit-font-smoothing:initial;-moz-osx-font-smoothing:initial;min-height:1.5rem} \ No newline at end of file diff --git a/lib/themes/dark.css b/lib/themes/dark.css deleted file mode 100644 index 6f749f2..0000000 --- a/lib/themes/dark.css +++ /dev/null @@ -1 +0,0 @@ -@import url("https://fonts.googleapis.com/css?family=Roboto+Mono|Source+Sans+Pro:300,400,600");*{-webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:none;-webkit-touch-callout:none;box-sizing:border-box}body:not(.ready){overflow:hidden}body:not(.ready) .app-nav,body:not(.ready)>nav,body:not(.ready) [data-cloak]{display:none}div#app{font-size:30px;font-weight:lighter;margin:40vh auto;text-align:center}div#app:empty:before{content:"Loading..."}.emoji{height:1.2rem;vertical-align:middle}.progress{background-color:var(--theme-color,#ea6f5a);height:2px;left:0;position:fixed;right:0;top:0;transition:width .2s,opacity .4s;width:0;z-index:5}.search .search-keyword,.search a:hover{color:var(--theme-color,#ea6f5a)}.search .search-keyword{font-style:normal;font-weight:700}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:#c8c8c8;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0;overflow-x:hidden}img{max-width:100%}a[disabled]{cursor:not-allowed;opacity:.6}kbd{border:1px solid #ccc;border-radius:3px;display:inline-block;font-size:12px!important;line-height:12px;margin-bottom:3px;padding:3px 5px;vertical-align:middle}li input[type=checkbox]{margin:0 .2em .25em 0;vertical-align:middle}.app-nav{margin:25px 60px 0 0;position:absolute;right:0;text-align:right;z-index:2}.app-nav.no-badge{margin-right:25px}.app-nav p{margin:0}.app-nav>a{margin:0 1rem;padding:5px 0}.app-nav li,.app-nav ul{display:inline-block;list-style:none;margin:0}.app-nav a{color:inherit;font-size:16px;text-decoration:none;transition:color .3s}.app-nav a.active,.app-nav a:hover{color:var(--theme-color,#ea6f5a)}.app-nav a.active{border-bottom:2px solid var(--theme-color,#ea6f5a)}.app-nav li{display:inline-block;margin:0 1rem;padding:5px 0;position:relative}.app-nav li ul{background-color:#fff;border:1px solid #ddd;border-bottom-color:#ccc;border-radius:4px;box-sizing:border-box;display:none;max-height:calc(100vh - 61px);overflow-y:auto;padding:10px 0;position:absolute;right:-15px;text-align:left;top:100%;white-space:nowrap}.app-nav li ul li{display:block;font-size:14px;line-height:1rem;margin:0;margin:8px 14px;white-space:nowrap}.app-nav li ul a{display:block;font-size:inherit;margin:0;padding:0}.app-nav li ul a.active{border-bottom:0}.app-nav li:hover ul{display:block}.github-corner{border-bottom:0;position:fixed;right:0;text-decoration:none;top:0;z-index:1}.github-corner:hover .octo-arm{animation:a .56s ease-in-out}.github-corner svg{color:#3f3f3f;fill:var(--theme-color,#ea6f5a);height:80px;width:80px}main{display:block;position:relative;width:100vw;height:100%;z-index:0}main.hidden{display:none}.anchor{display:inline-block;text-decoration:none;transition:all .3s}.anchor span{color:#c8c8c8}.anchor:hover{text-decoration:underline}.sidebar{border-right:1px solid rgba(0,0,0,.07);overflow-y:auto;padding:40px 0 0;position:absolute;top:0;bottom:0;left:0;transition:transform .25s ease-out;width:300px;z-index:3}.sidebar>h1{margin:0 auto 1rem;font-size:1.5rem;font-weight:300;text-align:center}.sidebar>h1 a{color:inherit;text-decoration:none}.sidebar>h1 .app-nav{display:block;position:static}.sidebar .sidebar-nav{line-height:2em;padding-bottom:40px}.sidebar li.collapse .app-sub-sidebar{display:none}.sidebar ul{margin:0 0 0 15px;padding:0}.sidebar li>p{font-weight:700;margin:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{border-bottom:none;display:block}.sidebar ul li ul{padding-left:20px}.sidebar::-webkit-scrollbar{width:4px}.sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}.sidebar:hover::-webkit-scrollbar-thumb{background:hsla(0,0%,53%,.4)}.sidebar:hover::-webkit-scrollbar-track{background:hsla(0,0%,53%,.1)}.sidebar-toggle{background-color:transparent;background-color:rgba(63,63,63,.8);border:0;outline:none;padding:10px;position:absolute;bottom:0;left:0;text-align:center;transition:opacity .3s;width:284px;z-index:4}.sidebar-toggle .sidebar-toggle-button:hover{opacity:.4}.sidebar-toggle span{background-color:var(--theme-color,#ea6f5a);display:block;margin-bottom:4px;width:16px;height:2px}body.sticky .sidebar,body.sticky .sidebar-toggle{position:fixed}.content{padding-top:60px;position:absolute;top:0;right:0;bottom:0;left:300px;transition:left .25s ease}.markdown-section{margin:0 auto;max-width:800px;padding:30px 15px 40px;position:relative}.markdown-section>*{box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}.markdown-section hr{border:none;border-bottom:1px solid #eee;margin:2em 0}.markdown-section iframe{border:1px solid #eee}.markdown-section table{border-collapse:collapse;border-spacing:0;display:block;margin-bottom:1rem;overflow:auto;width:100%}.markdown-section th{font-weight:700}.markdown-section td,.markdown-section th{border:1px solid #ddd;padding:6px 13px}.markdown-section tr{border-top:1px solid #ccc}.markdown-section p.tip,.markdown-section tr:nth-child(2n){background-color:#f8f8f8}.markdown-section p.tip{border-bottom-right-radius:2px;border-left:4px solid #f66;border-top-right-radius:2px;margin:2em 0;padding:12px 24px 12px 30px;position:relative}.markdown-section p.tip:before{background-color:#f66;border-radius:100%;color:#3f3f3f;content:"!";font-family:Dosis,Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:14px;font-weight:700;left:-12px;line-height:20px;position:absolute;height:20px;width:20px;text-align:center;top:14px}.markdown-section p.tip code{background-color:#efefef}.markdown-section p.tip em{color:#c8c8c8}.markdown-section p.warn{background:hsla(9,77%,64%,.1);border-radius:2px;padding:1rem}.markdown-section ul.task-list>li{list-style-type:none}body.close .sidebar{transform:translateX(-300px)}body.close .sidebar-toggle{width:auto}body.close .content{left:0}@media print{.app-nav,.github-corner,.sidebar,.sidebar-toggle{display:none}}@media screen and (max-width:768px){.github-corner,.sidebar,.sidebar-toggle{position:fixed}.app-nav{margin-top:16px}.app-nav li ul{top:30px}main{height:auto;overflow-x:hidden}.sidebar{left:-300px;transition:transform .25s ease-out}.content{left:0;max-width:100vw;position:static;padding-top:20px;transition:transform .25s ease}.app-nav,.github-corner{transition:transform .25s ease-out}.sidebar-toggle{background-color:transparent;width:auto;padding:30px 30px 10px 10px}body.close .sidebar{transform:translateX(300px)}body.close .sidebar-toggle{background-color:rgba(63,63,63,.8);transition:background-color 1s;width:284px;padding:10px}body.close .content{transform:translateX(300px)}body.close .app-nav,body.close .github-corner{display:none}.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:a .56s ease-in-out}}@keyframes a{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}section.cover{-ms-flex-align:center;align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;height:100vh;display:none}section.cover.show{display:-ms-flexbox;display:flex}section.cover.has-mask .mask{background-color:#3f3f3f;opacity:.8;position:absolute;top:0;height:100%;width:100%}section.cover .cover-main{-ms-flex:1;flex:1;margin:-20px 16px 0;text-align:center;z-index:1}section.cover a{color:inherit}section.cover a,section.cover a:hover{text-decoration:none}section.cover p{line-height:1.5rem;margin:1em 0}section.cover h1{color:inherit;font-size:2.5rem;font-weight:300;margin:.625rem 0 2.5rem;position:relative;text-align:center}section.cover h1 a{display:block}section.cover h1 small{bottom:-.4375rem;font-size:1rem;position:absolute}section.cover blockquote{font-size:1.5rem;text-align:center}section.cover ul{line-height:1.8;list-style-type:none;margin:1em auto;max-width:500px;padding:0}section.cover .cover-main>p:last-child a{border:1px solid var(--theme-color,#ea6f5a);border-radius:2rem;box-sizing:border-box;color:var(--theme-color,#ea6f5a);display:inline-block;font-size:1.05rem;letter-spacing:.1rem;margin:.5rem 1rem;padding:.75em 2rem;text-decoration:none;transition:all .15s ease}section.cover .cover-main>p:last-child a:last-child{background-color:var(--theme-color,#ea6f5a);color:#fff}section.cover .cover-main>p:last-child a:last-child:hover{color:inherit;opacity:.8}section.cover .cover-main>p:last-child a:hover{color:inherit}section.cover blockquote>p>a{border-bottom:2px solid var(--theme-color,#ea6f5a);transition:color .3s}section.cover blockquote>p>a:hover{color:var(--theme-color,#ea6f5a)}.sidebar,body{background-color:#3f3f3f}.sidebar{color:#c8c8c8}.sidebar li{margin:6px 15px 6px 0}.sidebar ul li a{color:#c8c8c8;font-size:14px;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.sidebar ul li a:hover{text-decoration:underline}.sidebar ul li ul{padding:0}.sidebar ul li.active>a{color:var(--theme-color,#ea6f5a);font-weight:600}.markdown-section h1,.markdown-section h2,.markdown-section h3,.markdown-section h4,.markdown-section strong{color:#657b83;font-weight:600}.markdown-section a{color:var(--theme-color,#ea6f5a);font-weight:600}.markdown-section h1{font-size:2rem;margin:0 0 1rem}.markdown-section h2{font-size:1.75rem;margin:45px 0 .8rem}.markdown-section h3{font-size:1.5rem;margin:40px 0 .6rem}.markdown-section h4{font-size:1.25rem}.markdown-section h5{font-size:1rem}.markdown-section h6{color:#777;font-size:1rem}.markdown-section figure,.markdown-section ol,.markdown-section p,.markdown-section ul{margin:1.2em 0}.markdown-section ol,.markdown-section p,.markdown-section ul{line-height:1.6rem;word-spacing:.05rem}.markdown-section ol,.markdown-section ul{padding-left:1.5rem}.markdown-section blockquote{border-left:4px solid var(--theme-color,#ea6f5a);color:#858585;margin:2em 0;padding-left:20px}.markdown-section blockquote p{font-weight:600;margin-left:0}.markdown-section iframe{margin:1em 0}.markdown-section em{color:#7f8c8d}.markdown-section code{border-radius:2px;color:#657b83;font-size:.8rem;margin:0 2px;padding:3px 5px;white-space:pre-wrap}.markdown-section code,.markdown-section pre{background-color:#282828;font-family:Roboto Mono,Monaco,courier,monospace}.markdown-section pre{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;line-height:1.5rem;margin:1.2em 0;overflow:auto;padding:0 1.4rem;position:relative;word-wrap:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#8e908c}.token.namespace{opacity:.7}.token.boolean,.token.number{color:#c76b29}.token.punctuation{color:#525252}.token.property{color:#c08b30}.token.tag{color:#2973b7}.token.string{color:var(--theme-color,#ea6f5a)}.token.selector{color:#6679cc}.token.attr-name{color:#2973b7}.language-css .token.string,.style .token.string,.token.entity,.token.url{color:#22a2c9}.token.attr-value,.token.control,.token.directive,.token.unit{color:var(--theme-color,#ea6f5a)}.token.keyword{color:#e96900}.token.atrule,.token.regex,.token.statement{color:#22a2c9}.token.placeholder,.token.variable{color:#3d8fd1}.token.deleted{text-decoration:line-through}.token.inserted{border-bottom:1px dotted #202746;text-decoration:none}.token.italic{font-style:italic}.token.bold,.token.important{font-weight:700}.token.important{color:#c94922}.token.entity{cursor:help}.markdown-section pre>code{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;background-color:#282828;border-radius:2px;color:#657b83;display:block;font-family:Roboto Mono,Monaco,courier,monospace;font-size:.8rem;line-height:inherit;margin:0 2px;max-width:inherit;overflow:inherit;padding:2.2em 5px;white-space:inherit}.markdown-section code:after,.markdown-section code:before{letter-spacing:.05rem}code .token{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;min-height:1.5rem}pre:after{color:#ccc;content:attr(data-lang);font-size:.6rem;font-weight:600;height:15px;line-height:15px;padding:5px 10px 0;position:absolute;right:0;text-align:right;top:0}.markdown-section p.tip{background-color:#282828;color:#657b83}input[type=search]{background:#4f4f4f;border-color:#4f4f4f;color:#c8c8c8} \ No newline at end of file diff --git a/lib/themes/dolphin.css b/lib/themes/dolphin.css deleted file mode 100644 index 86daa8d..0000000 --- a/lib/themes/dolphin.css +++ /dev/null @@ -1 +0,0 @@ -@import url("https://fonts.googleapis.com/css?family=Thasadith:400,400i,700");*{-webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:none;-webkit-touch-callout:none;box-sizing:border-box}body:not(.ready){overflow:hidden}body:not(.ready) .app-nav,body:not(.ready)>nav,body:not(.ready) [data-cloak]{display:none}div#app{font-size:30px;font-weight:lighter;margin:40vh auto;text-align:center}div#app:empty:before{content:"Loading..."}.emoji{height:1.2rem;vertical-align:middle}.progress{background-color:var(--theme-color,#0ff);height:2px;left:0;position:fixed;right:0;top:0;transition:width .2s,opacity .4s;width:0;z-index:5}.search .search-keyword,.search a:hover{color:var(--theme-color,#0ff)}.search .search-keyword{font-style:normal;font-weight:700}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:#34495e;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0;overflow-x:hidden}img{max-width:100%}a[disabled]{cursor:not-allowed;opacity:.6}kbd{border:1px solid #ccc;border-radius:3px;display:inline-block;font-size:12px!important;line-height:12px;margin-bottom:3px;padding:3px 5px;vertical-align:middle}li input[type=checkbox]{margin:0 .2em .25em 0;vertical-align:middle}.app-nav{margin:25px 60px 0 0;position:absolute;right:0;text-align:right;z-index:2}.app-nav.no-badge{margin-right:25px}.app-nav p{margin:0}.app-nav>a{margin:0 1rem;padding:5px 0}.app-nav li,.app-nav ul{display:inline-block;list-style:none;margin:0}.app-nav a{color:inherit;font-size:16px;text-decoration:none;transition:color .3s}.app-nav a.active,.app-nav a:hover{color:var(--theme-color,#0ff)}.app-nav a.active{border-bottom:2px solid var(--theme-color,#0ff)}.app-nav li{display:inline-block;margin:0 1rem;padding:5px 0;position:relative}.app-nav li ul{background-color:#fff;border:1px solid #ddd;border-bottom-color:#ccc;border-radius:4px;box-sizing:border-box;display:none;max-height:calc(100vh - 61px);overflow-y:auto;padding:10px 0;position:absolute;right:-15px;text-align:left;top:100%;white-space:nowrap}.app-nav li ul li{display:block;font-size:14px;line-height:1rem;margin:0;margin:8px 14px;white-space:nowrap}.app-nav li ul a{display:block;font-size:inherit;margin:0;padding:0}.app-nav li ul a.active{border-bottom:0}.app-nav li:hover ul{display:block}.github-corner{border-bottom:0;position:fixed;right:0;text-decoration:none;top:0;z-index:1}.github-corner:hover .octo-arm{animation:a .56s ease-in-out}.github-corner svg{color:azure;fill:var(--theme-color,#0ff);height:80px;width:80px}main{display:block;position:relative;width:100vw;height:100%;z-index:0}main.hidden{display:none}.anchor{display:inline-block;text-decoration:none;transition:all .3s}.anchor span{color:#34495e}.anchor:hover{text-decoration:underline}.sidebar{border-right:1px solid rgba(0,0,0,.07);overflow-y:auto;padding:40px 0 0;position:absolute;top:0;bottom:0;left:0;transition:transform .25s ease-out;width:300px;z-index:3}.sidebar>h1{margin:0 auto 1rem;font-size:1.5rem;font-weight:300;text-align:center}.sidebar>h1 a{color:inherit;text-decoration:none}.sidebar>h1 .app-nav{display:block;position:static}.sidebar .sidebar-nav{line-height:2em;padding-bottom:40px}.sidebar li.collapse .app-sub-sidebar{display:none}.sidebar ul{margin:0 0 0 15px;padding:0}.sidebar li>p{font-weight:700;margin:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{border-bottom:none;display:block}.sidebar ul li ul{padding-left:20px}.sidebar::-webkit-scrollbar{width:4px}.sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}.sidebar:hover::-webkit-scrollbar-thumb{background:hsla(0,0%,53%,.4)}.sidebar:hover::-webkit-scrollbar-track{background:hsla(0,0%,53%,.1)}.sidebar-toggle{background-color:transparent;background-color:rgba(240,255,255,.8);border:0;outline:none;padding:10px;position:absolute;bottom:0;left:0;text-align:center;transition:opacity .3s;width:284px;z-index:4}.sidebar-toggle .sidebar-toggle-button:hover{opacity:.4}.sidebar-toggle span{background-color:var(--theme-color,#0ff);display:block;margin-bottom:4px;width:16px;height:2px}body.sticky .sidebar,body.sticky .sidebar-toggle{position:fixed}.content{padding-top:60px;position:absolute;top:0;right:0;bottom:0;left:300px;transition:left .25s ease}.markdown-section{margin:0 auto;max-width:800px;padding:30px 15px 40px;position:relative}.markdown-section>*{box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}.markdown-section hr{border:none;border-bottom:1px solid #eee;margin:2em 0}.markdown-section iframe{border:1px solid #eee}.markdown-section table{border-collapse:collapse;border-spacing:0;display:block;margin-bottom:1rem;overflow:auto;width:100%}.markdown-section th{font-weight:700}.markdown-section td,.markdown-section th{border:1px solid #ddd;padding:6px 13px}.markdown-section tr{border-top:1px solid #ccc}.markdown-section p.tip,.markdown-section tr:nth-child(2n){background-color:#f8f8f8}.markdown-section p.tip{border-bottom-right-radius:2px;border-left:4px solid #f66;border-top-right-radius:2px;margin:2em 0;padding:12px 24px 12px 30px;position:relative}.markdown-section p.tip:before{background-color:#f66;border-radius:100%;color:azure;content:"!";font-family:Dosis,Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:14px;font-weight:700;left:-12px;line-height:20px;position:absolute;height:20px;width:20px;text-align:center;top:14px}.markdown-section p.tip code{background-color:#efefef}.markdown-section p.tip em{color:#34495e}.markdown-section p.warn{background:rgba(0,255,255,.1);border-radius:2px;padding:1rem}.markdown-section ul.task-list>li{list-style-type:none}body.close .sidebar{transform:translateX(-300px)}body.close .sidebar-toggle{width:auto}body.close .content{left:0}@media print{.app-nav,.github-corner,.sidebar,.sidebar-toggle{display:none}}@media screen and (max-width:768px){.github-corner,.sidebar,.sidebar-toggle{position:fixed}.app-nav{margin-top:16px}.app-nav li ul{top:30px}main{height:auto;overflow-x:hidden}.sidebar{left:-300px;transition:transform .25s ease-out}.content{left:0;max-width:100vw;position:static;padding-top:20px;transition:transform .25s ease}.app-nav,.github-corner{transition:transform .25s ease-out}.sidebar-toggle{background-color:transparent;width:auto;padding:30px 30px 10px 10px}body.close .sidebar{transform:translateX(300px)}body.close .sidebar-toggle{background-color:rgba(240,255,255,.8);transition:background-color 1s;width:284px;padding:10px}body.close .content{transform:translateX(300px)}body.close .app-nav,body.close .github-corner{display:none}.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:a .56s ease-in-out}}@keyframes a{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}section.cover{-ms-flex-align:center;align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;height:100vh;display:none}section.cover.show{display:-ms-flexbox;display:flex}section.cover.has-mask .mask{background-color:azure;opacity:.8;position:absolute;top:0;height:100%;width:100%}section.cover .cover-main{-ms-flex:1;flex:1;margin:-20px 16px 0;text-align:center;z-index:1}section.cover a{color:inherit}section.cover a,section.cover a:hover{text-decoration:none}section.cover p{line-height:1.5rem;margin:1em 0}section.cover h1{color:inherit;font-size:2.5rem;font-weight:300;margin:.625rem 0 2.5rem;position:relative;text-align:center}section.cover h1 a{display:block}section.cover h1 small{bottom:-.4375rem;font-size:1rem;position:absolute}section.cover blockquote{font-size:1.5rem;text-align:center}section.cover ul{line-height:1.8;list-style-type:none;margin:1em auto;max-width:500px;padding:0}section.cover .cover-main>p:last-child a{border:1px solid var(--theme-color,#0ff);border-radius:2rem;box-sizing:border-box;color:var(--theme-color,#0ff);display:inline-block;font-size:1.05rem;letter-spacing:.1rem;margin:.5rem 1rem;padding:.75em 2rem;text-decoration:none;transition:all .15s ease}section.cover .cover-main>p:last-child a:last-child{background-color:var(--theme-color,#0ff);color:#fff}section.cover .cover-main>p:last-child a:last-child:hover{color:inherit;opacity:.8}section.cover .cover-main>p:last-child a:hover{color:inherit}section.cover blockquote>p>a{border-bottom:2px solid var(--theme-color,#0ff);transition:color .3s}section.cover blockquote>p>a:hover{color:var(--theme-color,#0ff)}.sidebar,body{background-color:azure}.sidebar{color:#364149}.sidebar li{margin:6px 0}.sidebar ul li a{color:#505d6b;font-size:14px;font-weight:400;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.sidebar ul li a:hover{text-decoration:underline}.sidebar ul li ul{padding:0}.sidebar ul li.active>a{border-right:2px solid;color:var(--theme-color,#0ff);font-weight:600}.app-sub-sidebar li:before{content:"-";padding-right:4px;float:left}.markdown-section h1,.markdown-section h2,.markdown-section h3,.markdown-section h4,.markdown-section strong{color:#2c3e50;font-weight:600}.markdown-section a{color:var(--theme-color,#0ff);font-weight:600}.markdown-section a:hover{text-decoration:underline}.markdown-section h1{font-size:2rem;margin:0 0 1rem}.markdown-section h2{font-size:1.75rem;margin:45px 0 .8rem}.markdown-section h3{font-size:1.5rem;margin:40px 0 .6rem}.markdown-section h4{font-size:1.25rem}.markdown-section h5{font-size:1rem}.markdown-section h6{color:#777;font-size:1rem}.markdown-section figure,.markdown-section p{margin:1.2em 0}.markdown-section ol,.markdown-section p,.markdown-section ul{line-height:1.6rem;word-spacing:.05rem}.markdown-section ol,.markdown-section ul{padding-left:1.5rem}.markdown-section blockquote{border-left:4px solid var(--theme-color,#0ff);color:#858585;margin:2em 0;padding-left:20px}.markdown-section blockquote p{font-weight:600;margin-left:0}.markdown-section iframe{margin:1em 0}.markdown-section em{color:#7f8c8d}.markdown-section code{border-radius:2px;color:#e96900;font-size:.8rem;margin:0 2px;padding:3px 5px;white-space:pre-wrap}.markdown-section code,.markdown-section pre{background-color:#f8f8f8;font-family:Roboto Mono,Monaco,courier,monospace}.markdown-section pre{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;line-height:1.5rem;margin:1.2em 0;overflow:auto;padding:0 1.4rem;position:relative;word-wrap:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#8e908c}.token.namespace{opacity:.7}.token.boolean,.token.number{color:#c76b29}.token.punctuation{color:#525252}.token.property{color:#c08b30}.token.tag{color:#2973b7}.token.string{color:var(--theme-color,#0ff)}.token.selector{color:#6679cc}.token.attr-name{color:#2973b7}.language-css .token.string,.style .token.string,.token.entity,.token.url{color:#22a2c9}.token.attr-value,.token.control,.token.directive,.token.unit{color:var(--theme-color,#0ff)}.token.function,.token.keyword{color:#e96900}.token.atrule,.token.regex,.token.statement{color:#22a2c9}.token.placeholder,.token.variable{color:#3d8fd1}.token.deleted{text-decoration:line-through}.token.inserted{border-bottom:1px dotted #202746;text-decoration:none}.token.italic{font-style:italic}.token.bold,.token.important{font-weight:700}.token.important{color:#c94922}.token.entity{cursor:help}.markdown-section pre>code{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;background-color:#f8f8f8;border-radius:2px;color:#525252;display:block;font-family:Roboto Mono,Monaco,courier,monospace;font-size:.8rem;line-height:inherit;margin:0 2px;max-width:inherit;overflow:inherit;padding:2.2em 5px;white-space:inherit}.markdown-section code:after,.markdown-section code:before{letter-spacing:.05rem}code .token{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;min-height:1.5rem}pre:after{color:#ccc;content:attr(data-lang);font-size:.6rem;font-weight:600;height:15px;line-height:15px;padding:5px 10px 0;position:absolute;right:0;text-align:right;top:0} \ No newline at end of file diff --git a/lib/themes/pure.css b/lib/themes/pure.css deleted file mode 100644 index db31850..0000000 --- a/lib/themes/pure.css +++ /dev/null @@ -1 +0,0 @@ -*{-webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:none;-webkit-touch-callout:none;box-sizing:border-box}body:not(.ready){overflow:hidden}body:not(.ready) .app-nav,body:not(.ready)>nav,body:not(.ready) [data-cloak]{display:none}div#app{font-size:30px;font-weight:lighter;margin:40vh auto;text-align:center}div#app:empty:before{content:"Loading..."}.emoji{height:1.2rem;vertical-align:middle}.progress{background-color:var(--theme-color,#000);height:2px;left:0;position:fixed;right:0;top:0;transition:width .2s,opacity .4s;width:0;z-index:5}.search .search-keyword,.search a:hover{color:var(--theme-color,#000)}.search .search-keyword{font-style:normal;font-weight:700}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:#000;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0;overflow-x:hidden}img{max-width:100%}a[disabled]{cursor:not-allowed;opacity:.6}kbd{border:1px solid #ccc;border-radius:3px;display:inline-block;font-size:12px!important;line-height:12px;margin-bottom:3px;padding:3px 5px;vertical-align:middle}li input[type=checkbox]{margin:0 .2em .25em 0;vertical-align:middle}.app-nav{margin:25px 60px 0 0;position:absolute;right:0;text-align:right;z-index:2}.app-nav.no-badge{margin-right:25px}.app-nav p{margin:0}.app-nav>a{margin:0 1rem;padding:5px 0}.app-nav li,.app-nav ul{display:inline-block;list-style:none;margin:0}.app-nav a{color:inherit;font-size:16px;text-decoration:none;transition:color .3s}.app-nav a.active,.app-nav a:hover{color:var(--theme-color,#000)}.app-nav a.active{border-bottom:2px solid var(--theme-color,#000)}.app-nav li{display:inline-block;margin:0 1rem;padding:5px 0;position:relative}.app-nav li ul{background-color:#fff;border:1px solid #ddd;border-bottom-color:#ccc;border-radius:4px;box-sizing:border-box;display:none;max-height:calc(100vh - 61px);overflow-y:auto;padding:10px 0;position:absolute;right:-15px;text-align:left;top:100%;white-space:nowrap}.app-nav li ul li{display:block;font-size:14px;line-height:1rem;margin:0;margin:8px 14px;white-space:nowrap}.app-nav li ul a{display:block;font-size:inherit;margin:0;padding:0}.app-nav li ul a.active{border-bottom:0}.app-nav li:hover ul{display:block}.github-corner{border-bottom:0;position:fixed;right:0;text-decoration:none;top:0;z-index:1}.github-corner:hover .octo-arm{animation:a .56s ease-in-out}.github-corner svg{color:#fff;fill:var(--theme-color,#000);height:80px;width:80px}main{display:block;position:relative;width:100vw;height:100%;z-index:0}main.hidden{display:none}.anchor{display:inline-block;text-decoration:none;transition:all .3s}.anchor span{color:#000}.anchor:hover{text-decoration:underline}.sidebar{border-right:1px solid rgba(0,0,0,.07);overflow-y:auto;padding:40px 0 0;position:absolute;top:0;bottom:0;left:0;transition:transform .25s ease-out;width:300px;z-index:3}.sidebar>h1{margin:0 auto 1rem;font-size:1.5rem;font-weight:300;text-align:center}.sidebar>h1 a{color:inherit;text-decoration:none}.sidebar>h1 .app-nav{display:block;position:static}.sidebar .sidebar-nav{line-height:2em;padding-bottom:40px}.sidebar li.collapse .app-sub-sidebar{display:none}.sidebar ul{margin:0 0 0 15px;padding:0}.sidebar li>p{font-weight:700;margin:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{border-bottom:none;display:block}.sidebar ul li ul{padding-left:20px}.sidebar::-webkit-scrollbar{width:4px}.sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}.sidebar:hover::-webkit-scrollbar-thumb{background:hsla(0,0%,53%,.4)}.sidebar:hover::-webkit-scrollbar-track{background:hsla(0,0%,53%,.1)}.sidebar-toggle{background-color:transparent;background-color:hsla(0,0%,100%,.8);border:0;outline:none;padding:10px;position:absolute;bottom:0;left:0;text-align:center;transition:opacity .3s;width:284px;z-index:4}.sidebar-toggle .sidebar-toggle-button:hover{opacity:.4}.sidebar-toggle span{background-color:var(--theme-color,#000);display:block;margin-bottom:4px;width:16px;height:2px}body.sticky .sidebar,body.sticky .sidebar-toggle{position:fixed}.content{padding-top:60px;position:absolute;top:0;right:0;bottom:0;left:300px;transition:left .25s ease}.markdown-section{margin:0 auto;max-width:800px;padding:30px 15px 40px;position:relative}.markdown-section>*{box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}.markdown-section hr{border:none;border-bottom:1px solid #eee;margin:2em 0}.markdown-section iframe{border:1px solid #eee}.markdown-section table{border-collapse:collapse;border-spacing:0;display:block;margin-bottom:1rem;overflow:auto;width:100%}.markdown-section th{font-weight:700}.markdown-section td,.markdown-section th{border:1px solid #ddd;padding:6px 13px}.markdown-section tr{border-top:1px solid #ccc}.markdown-section p.tip,.markdown-section tr:nth-child(2n){background-color:#f8f8f8}.markdown-section p.tip{border-bottom-right-radius:2px;border-left:4px solid #f66;border-top-right-radius:2px;margin:2em 0;padding:12px 24px 12px 30px;position:relative}.markdown-section p.tip:before{background-color:#f66;border-radius:100%;color:#fff;content:"!";font-family:Dosis,Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:14px;font-weight:700;left:-12px;line-height:20px;position:absolute;height:20px;width:20px;text-align:center;top:14px}.markdown-section p.tip code{background-color:#efefef}.markdown-section p.tip em{color:#000}.markdown-section p.warn{background:rgba(0,0,0,.1);border-radius:2px;padding:1rem}.markdown-section ul.task-list>li{list-style-type:none}body.close .sidebar{transform:translateX(-300px)}body.close .sidebar-toggle{width:auto}body.close .content{left:0}@media print{.app-nav,.github-corner,.sidebar,.sidebar-toggle{display:none}}@media screen and (max-width:768px){.github-corner,.sidebar,.sidebar-toggle{position:fixed}.app-nav{margin-top:16px}.app-nav li ul{top:30px}main{height:auto;overflow-x:hidden}.sidebar{left:-300px;transition:transform .25s ease-out}.content{left:0;max-width:100vw;position:static;padding-top:20px;transition:transform .25s ease}.app-nav,.github-corner{transition:transform .25s ease-out}.sidebar-toggle{background-color:transparent;width:auto;padding:30px 30px 10px 10px}body.close .sidebar{transform:translateX(300px)}body.close .sidebar-toggle{background-color:hsla(0,0%,100%,.8);transition:background-color 1s;width:284px;padding:10px}body.close .content{transform:translateX(300px)}body.close .app-nav,body.close .github-corner{display:none}.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:a .56s ease-in-out}}@keyframes a{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}section.cover{-ms-flex-align:center;align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;height:100vh;display:none}section.cover.show{display:-ms-flexbox;display:flex}section.cover.has-mask .mask{background-color:#fff;opacity:.8;position:absolute;top:0;height:100%;width:100%}section.cover .cover-main{-ms-flex:1;flex:1;margin:-20px 16px 0;text-align:center;z-index:1}section.cover a{color:inherit}section.cover a,section.cover a:hover{text-decoration:none}section.cover p{line-height:1.5rem;margin:1em 0}section.cover h1{color:inherit;font-size:2.5rem;font-weight:300;margin:.625rem 0 2.5rem;position:relative;text-align:center}section.cover h1 a{display:block}section.cover h1 small{bottom:-.4375rem;font-size:1rem;position:absolute}section.cover blockquote{font-size:1.5rem;text-align:center}section.cover ul{line-height:1.8;list-style-type:none;margin:1em auto;max-width:500px;padding:0}section.cover .cover-main>p:last-child a{border:1px solid var(--theme-color,#000);border-radius:2rem;box-sizing:border-box;color:var(--theme-color,#000);display:inline-block;font-size:1.05rem;letter-spacing:.1rem;margin:.5rem 1rem;padding:.75em 2rem;text-decoration:none;transition:all .15s ease}section.cover .cover-main>p:last-child a:last-child{background-color:var(--theme-color,#000);color:#fff}section.cover .cover-main>p:last-child a:last-child:hover{color:inherit;opacity:.8}section.cover .cover-main>p:last-child a:hover{color:inherit}section.cover blockquote>p>a{border-bottom:2px solid var(--theme-color,#000);transition:color .3s}section.cover blockquote>p>a:hover{color:var(--theme-color,#000)} \ No newline at end of file diff --git a/lib/themes/vue.css b/lib/themes/vue.css deleted file mode 100644 index 7bfb520..0000000 --- a/lib/themes/vue.css +++ /dev/null @@ -1 +0,0 @@ -@import url("https://fonts.googleapis.com/css?family=Roboto+Mono|Source+Sans+Pro:300,400,600");*{-webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:none;-webkit-touch-callout:none;box-sizing:border-box}body:not(.ready){overflow:hidden}body:not(.ready) .app-nav,body:not(.ready)>nav,body:not(.ready) [data-cloak]{display:none}div#app{font-size:30px;font-weight:lighter;margin:40vh auto;text-align:center}div#app:empty:before{content:"Loading..."}.emoji{height:1.2rem;vertical-align:middle}.progress{background-color:var(--theme-color,#42b983);height:2px;left:0;position:fixed;right:0;top:0;transition:width .2s,opacity .4s;width:0;z-index:5}.search .search-keyword,.search a:hover{color:var(--theme-color,#42b983)}.search .search-keyword{font-style:normal;font-weight:700}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:#34495e;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0;overflow-x:hidden}img{max-width:100%}a[disabled]{cursor:not-allowed;opacity:.6}kbd{border:1px solid #ccc;border-radius:3px;display:inline-block;font-size:12px!important;line-height:12px;margin-bottom:3px;padding:3px 5px;vertical-align:middle}li input[type=checkbox]{margin:0 .2em .25em 0;vertical-align:middle}.app-nav{margin:25px 60px 0 0;position:absolute;right:0;text-align:right;z-index:2}.app-nav.no-badge{margin-right:25px}.app-nav p{margin:0}.app-nav>a{margin:0 1rem;padding:5px 0}.app-nav li,.app-nav ul{display:inline-block;list-style:none;margin:0}.app-nav a{color:inherit;font-size:16px;text-decoration:none;transition:color .3s}.app-nav a.active,.app-nav a:hover{color:var(--theme-color,#42b983)}.app-nav a.active{border-bottom:2px solid var(--theme-color,#42b983)}.app-nav li{display:inline-block;margin:0 1rem;padding:5px 0;position:relative}.app-nav li ul{background-color:#fff;border:1px solid #ddd;border-bottom-color:#ccc;border-radius:4px;box-sizing:border-box;display:none;max-height:calc(100vh - 61px);overflow-y:auto;padding:10px 0;position:absolute;right:-15px;text-align:left;top:100%;white-space:nowrap}.app-nav li ul li{display:block;font-size:14px;line-height:1rem;margin:0;margin:8px 14px;white-space:nowrap}.app-nav li ul a{display:block;font-size:inherit;margin:0;padding:0}.app-nav li ul a.active{border-bottom:0}.app-nav li:hover ul{display:block}.github-corner{border-bottom:0;position:fixed;right:0;text-decoration:none;top:0;z-index:1}.github-corner:hover .octo-arm{animation:a .56s ease-in-out}.github-corner svg{color:#fff;fill:var(--theme-color,#42b983);height:80px;width:80px}main{display:block;position:relative;width:100vw;height:100%;z-index:0}main.hidden{display:none}.anchor{display:inline-block;text-decoration:none;transition:all .3s}.anchor span{color:#34495e}.anchor:hover{text-decoration:underline}.sidebar{border-right:1px solid rgba(0,0,0,.07);overflow-y:auto;padding:40px 0 0;position:absolute;top:0;bottom:0;left:0;transition:transform .25s ease-out;width:300px;z-index:3}.sidebar>h1{margin:0 auto 1rem;font-size:1.5rem;font-weight:300;text-align:center}.sidebar>h1 a{color:inherit;text-decoration:none}.sidebar>h1 .app-nav{display:block;position:static}.sidebar .sidebar-nav{line-height:2em;padding-bottom:40px}.sidebar li.collapse .app-sub-sidebar{display:none}.sidebar ul{margin:0 0 0 15px;padding:0}.sidebar li>p{font-weight:700;margin:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{border-bottom:none;display:block}.sidebar ul li ul{padding-left:20px}.sidebar::-webkit-scrollbar{width:4px}.sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}.sidebar:hover::-webkit-scrollbar-thumb{background:hsla(0,0%,53%,.4)}.sidebar:hover::-webkit-scrollbar-track{background:hsla(0,0%,53%,.1)}.sidebar-toggle{background-color:transparent;background-color:hsla(0,0%,100%,.8);border:0;outline:none;padding:10px;position:absolute;bottom:0;left:0;text-align:center;transition:opacity .3s;width:284px;z-index:4}.sidebar-toggle .sidebar-toggle-button:hover{opacity:.4}.sidebar-toggle span{background-color:var(--theme-color,#42b983);display:block;margin-bottom:4px;width:16px;height:2px}body.sticky .sidebar,body.sticky .sidebar-toggle{position:fixed}.content{padding-top:60px;position:absolute;top:0;right:0;bottom:0;left:300px;transition:left .25s ease}.markdown-section{margin:0 auto;max-width:800px;padding:30px 15px 40px;position:relative}.markdown-section>*{box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}.markdown-section hr{border:none;border-bottom:1px solid #eee;margin:2em 0}.markdown-section iframe{border:1px solid #eee}.markdown-section table{border-collapse:collapse;border-spacing:0;display:block;margin-bottom:1rem;overflow:auto;width:100%}.markdown-section th{font-weight:700}.markdown-section td,.markdown-section th{border:1px solid #ddd;padding:6px 13px}.markdown-section tr{border-top:1px solid #ccc}.markdown-section p.tip,.markdown-section tr:nth-child(2n){background-color:#f8f8f8}.markdown-section p.tip{border-bottom-right-radius:2px;border-left:4px solid #f66;border-top-right-radius:2px;margin:2em 0;padding:12px 24px 12px 30px;position:relative}.markdown-section p.tip:before{background-color:#f66;border-radius:100%;color:#fff;content:"!";font-family:Dosis,Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:14px;font-weight:700;left:-12px;line-height:20px;position:absolute;height:20px;width:20px;text-align:center;top:14px}.markdown-section p.tip code{background-color:#efefef}.markdown-section p.tip em{color:#34495e}.markdown-section p.warn{background:rgba(66,185,131,.1);border-radius:2px;padding:1rem}.markdown-section ul.task-list>li{list-style-type:none}body.close .sidebar{transform:translateX(-300px)}body.close .sidebar-toggle{width:auto}body.close .content{left:0}@media print{.app-nav,.github-corner,.sidebar,.sidebar-toggle{display:none}}@media screen and (max-width:768px){.github-corner,.sidebar,.sidebar-toggle{position:fixed}.app-nav{margin-top:16px}.app-nav li ul{top:30px}main{height:auto;overflow-x:hidden}.sidebar{left:-300px;transition:transform .25s ease-out}.content{left:0;max-width:100vw;position:static;padding-top:20px;transition:transform .25s ease}.app-nav,.github-corner{transition:transform .25s ease-out}.sidebar-toggle{background-color:transparent;width:auto;padding:30px 30px 10px 10px}body.close .sidebar{transform:translateX(300px)}body.close .sidebar-toggle{background-color:hsla(0,0%,100%,.8);transition:background-color 1s;width:284px;padding:10px}body.close .content{transform:translateX(300px)}body.close .app-nav,body.close .github-corner{display:none}.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:a .56s ease-in-out}}@keyframes a{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}section.cover{-ms-flex-align:center;align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;height:100vh;display:none}section.cover.show{display:-ms-flexbox;display:flex}section.cover.has-mask .mask{background-color:#fff;opacity:.8;position:absolute;top:0;height:100%;width:100%}section.cover .cover-main{-ms-flex:1;flex:1;margin:-20px 16px 0;text-align:center;z-index:1}section.cover a{color:inherit}section.cover a,section.cover a:hover{text-decoration:none}section.cover p{line-height:1.5rem;margin:1em 0}section.cover h1{color:inherit;font-size:2.5rem;font-weight:300;margin:.625rem 0 2.5rem;position:relative;text-align:center}section.cover h1 a{display:block}section.cover h1 small{bottom:-.4375rem;font-size:1rem;position:absolute}section.cover blockquote{font-size:1.5rem;text-align:center}section.cover ul{line-height:1.8;list-style-type:none;margin:1em auto;max-width:500px;padding:0}section.cover .cover-main>p:last-child a{border:1px solid var(--theme-color,#42b983);border-radius:2rem;box-sizing:border-box;color:var(--theme-color,#42b983);display:inline-block;font-size:1.05rem;letter-spacing:.1rem;margin:.5rem 1rem;padding:.75em 2rem;text-decoration:none;transition:all .15s ease}section.cover .cover-main>p:last-child a:last-child{background-color:var(--theme-color,#42b983);color:#fff}section.cover .cover-main>p:last-child a:last-child:hover{color:inherit;opacity:.8}section.cover .cover-main>p:last-child a:hover{color:inherit}section.cover blockquote>p>a{border-bottom:2px solid var(--theme-color,#42b983);transition:color .3s}section.cover blockquote>p>a:hover{color:var(--theme-color,#42b983)}.sidebar,body{background-color:#fff}.sidebar{color:#364149}.sidebar li{margin:6px 0}.sidebar ul li a{color:#505d6b;font-size:14px;font-weight:400;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.sidebar ul li a:hover{text-decoration:underline}.sidebar ul li ul{padding:0}.sidebar ul li.active>a{border-right:2px solid;color:var(--theme-color,#42b983);font-weight:600}.app-sub-sidebar li:before{content:"-";padding-right:4px;float:left}.markdown-section h1,.markdown-section h2,.markdown-section h3,.markdown-section h4,.markdown-section strong{color:#2c3e50;font-weight:600}.markdown-section a{color:var(--theme-color,#42b983);font-weight:600}.markdown-section h1{font-size:2rem;margin:0 0 1rem}.markdown-section h2{font-size:1.75rem;margin:45px 0 .8rem}.markdown-section h3{font-size:1.5rem;margin:40px 0 .6rem}.markdown-section h4{font-size:1.25rem}.markdown-section h5{font-size:1rem}.markdown-section h6{color:#777;font-size:1rem}.markdown-section figure,.markdown-section p{margin:1.2em 0}.markdown-section ol,.markdown-section p,.markdown-section ul{line-height:1.6rem;word-spacing:.05rem}.markdown-section ol,.markdown-section ul{padding-left:1.5rem}.markdown-section blockquote{border-left:4px solid var(--theme-color,#42b983);color:#858585;margin:2em 0;padding-left:20px}.markdown-section blockquote p{font-weight:600;margin-left:0}.markdown-section iframe{margin:1em 0}.markdown-section em{color:#7f8c8d}.markdown-section code{border-radius:2px;color:#e96900;font-size:.8rem;margin:0 2px;padding:3px 5px;white-space:pre-wrap}.markdown-section code,.markdown-section pre{background-color:#f8f8f8;font-family:Roboto Mono,Monaco,courier,monospace}.markdown-section pre{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;line-height:1.5rem;margin:1.2em 0;overflow:auto;padding:0 1.4rem;position:relative;word-wrap:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#8e908c}.token.namespace{opacity:.7}.token.boolean,.token.number{color:#c76b29}.token.punctuation{color:#525252}.token.property{color:#c08b30}.token.tag{color:#2973b7}.token.string{color:var(--theme-color,#42b983)}.token.selector{color:#6679cc}.token.attr-name{color:#2973b7}.language-css .token.string,.style .token.string,.token.entity,.token.url{color:#22a2c9}.token.attr-value,.token.control,.token.directive,.token.unit{color:var(--theme-color,#42b983)}.token.function,.token.keyword{color:#e96900}.token.atrule,.token.regex,.token.statement{color:#22a2c9}.token.placeholder,.token.variable{color:#3d8fd1}.token.deleted{text-decoration:line-through}.token.inserted{border-bottom:1px dotted #202746;text-decoration:none}.token.italic{font-style:italic}.token.bold,.token.important{font-weight:700}.token.important{color:#c94922}.token.entity{cursor:help}.markdown-section pre>code{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;background-color:#f8f8f8;border-radius:2px;color:#525252;display:block;font-family:Roboto Mono,Monaco,courier,monospace;font-size:.8rem;line-height:inherit;margin:0 2px;max-width:inherit;overflow:inherit;padding:2.2em 5px;white-space:inherit}.markdown-section code:after,.markdown-section code:before{letter-spacing:.05rem}code .token{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;min-height:1.5rem}pre:after{color:#ccc;content:attr(data-lang);font-size:.6rem;font-weight:600;height:15px;line-height:15px;padding:5px 10px 0;position:absolute;right:0;text-align:right;top:0} \ No newline at end of file From e5bab8d967b98fe4ed7c5a143d0b361242199c3b Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sun, 21 Apr 2019 11:58:07 +0200 Subject: [PATCH 22/37] Add link to develop branch preview on netlify --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 276d10b..7854222 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ ## Links +- [`develop` branch preview](https://docsifyjs.netlify.com/) - [Documentation](https://docsify.js.org) - [CLI](https://github.com/docsifyjs/docsify-cli) - CDN: [UNPKG](https://unpkg.com/docsify/) | [jsDelivr](https://cdn.jsdelivr.net/npm/docsify/) | [cdnjs](https://cdnjs.com/libraries/docsify) From b38c2065e0b58e1d76bb10e3add0b73e4d50c8a2 Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sun, 21 Apr 2019 12:01:04 +0200 Subject: [PATCH 23/37] add execute access to release.sh --- build/release.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 build/release.sh diff --git a/build/release.sh b/build/release.sh old mode 100644 new mode 100755 From 5bcb016beeb5c88743da6e2feca872f2c6606074 Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sun, 21 Apr 2019 12:05:06 +0200 Subject: [PATCH 24/37] Keep themes directory which is required for npm run dev --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c61835b..92ba628 100644 --- a/package.json +++ b/package.json @@ -32,11 +32,11 @@ "watch:css": "run-p 'css -- -o themes -w'", "watch:js": "node build/build.js", "build:css:min": "mkdir lib/themes && run-p 'css -- -o lib/themes' && node build/mincss.js", - "build:css": "mkdir themes && run-p 'css -- -o themes'", + "build:css": "mkdir -p themes && run-p 'css -- -o themes'", "build:js": "cross-env NODE_ENV=production node build/build.js", "build:ssr": "node build/ssr.js", "build:cover": "node build/cover.js", - "build": "rimraf lib themes && run-s build:js build:css build:css:min build:ssr build:cover", + "build": "rimraf lib themes/* && run-s build:js build:css build:css:min build:ssr build:cover", "pub:next": "cross-env RELEASE_TAG=next sh build/release.sh", "pub": "sh build/release.sh", "postinstall": "opencollective postinstall" From af161cd3b46fb0a5a410875a8005c312da1a8c07 Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sun, 21 Apr 2019 12:06:16 +0200 Subject: [PATCH 25/37] [build] 4.9.2 next --- docs/_coverpage.md | 2 +- lib/docsify.js | 5111 +++++++++++++++++ lib/docsify.min.js | 1 + lib/plugins/disqus.js | 54 + lib/plugins/disqus.min.js | 1 + lib/plugins/emoji.js | 903 +++ lib/plugins/emoji.min.js | 1 + lib/plugins/external-script.js | 28 + lib/plugins/external-script.min.js | 1 + lib/plugins/front-matter.js | 496 ++ lib/plugins/front-matter.min.js | 1 + lib/plugins/ga.js | 41 + lib/plugins/ga.min.js | 1 + lib/plugins/gitalk.js | 26 + lib/plugins/gitalk.min.js | 1 + lib/plugins/search.js | 364 ++ lib/plugins/search.min.js | 1 + lib/plugins/zoom-image.js | 40 + lib/plugins/zoom-image.min.js | 1 + lib/themes/buble.css | 1 + lib/themes/dark.css | 1 + lib/themes/dolphin.css | 1 + lib/themes/pure.css | 1 + lib/themes/vue.css | 1 + .../docsify-server-renderer/package-lock.json | 2 +- packages/docsify-server-renderer/package.json | 2 +- 26 files changed, 7080 insertions(+), 3 deletions(-) create mode 100644 lib/docsify.js create mode 100644 lib/docsify.min.js create mode 100644 lib/plugins/disqus.js create mode 100644 lib/plugins/disqus.min.js create mode 100644 lib/plugins/emoji.js create mode 100644 lib/plugins/emoji.min.js create mode 100644 lib/plugins/external-script.js create mode 100644 lib/plugins/external-script.min.js create mode 100644 lib/plugins/front-matter.js create mode 100644 lib/plugins/front-matter.min.js create mode 100644 lib/plugins/ga.js create mode 100644 lib/plugins/ga.min.js create mode 100644 lib/plugins/gitalk.js create mode 100644 lib/plugins/gitalk.min.js create mode 100644 lib/plugins/search.js create mode 100644 lib/plugins/search.min.js create mode 100644 lib/plugins/zoom-image.js create mode 100644 lib/plugins/zoom-image.min.js create mode 100644 lib/themes/buble.css create mode 100644 lib/themes/dark.css create mode 100644 lib/themes/dolphin.css create mode 100644 lib/themes/pure.css create mode 100644 lib/themes/vue.css diff --git a/docs/_coverpage.md b/docs/_coverpage.md index 0a18f97..f337648 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -1,6 +1,6 @@ ![logo](_media/icon.svg) -# docsify 4.9.1 +# docsify 4.9.2 > A magical documentation site generator. diff --git a/lib/docsify.js b/lib/docsify.js new file mode 100644 index 0000000..a4745da --- /dev/null +++ b/lib/docsify.js @@ -0,0 +1,5111 @@ +(function () { +/** + * Create a cached version of a pure function. + */ +function cached(fn) { + var cache = Object.create(null); + return function (str) { + var key = isPrimitive(str) ? str : JSON.stringify(str); + var hit = cache[key]; + return hit || (cache[key] = fn(str)) + } +} + +/** + * Hyphenate a camelCase string. + */ +var hyphenate = cached(function (str) { + return str.replace(/([A-Z])/g, function (m) { return '-' + m.toLowerCase(); }) +}); + +var hasOwn = Object.prototype.hasOwnProperty; + +/** + * Simple Object.assign polyfill + */ +var merge = + Object.assign || + function (to) { + var arguments$1 = arguments; + + for (var i = 1; i < arguments.length; i++) { + var from = Object(arguments$1[i]); + + for (var key in from) { + if (hasOwn.call(from, key)) { + to[key] = from[key]; + } + } + } + + return to + }; + +/** + * Check if value is primitive + */ +function isPrimitive(value) { + return typeof value === 'string' || typeof value === 'number' +} + +/** + * Perform no operation. + */ +function noop() {} + +/** + * Check if value is function + */ +function isFn(obj) { + return typeof obj === 'function' +} + +function config () { + var config = merge( + { + el: '#app', + repo: '', + maxLevel: 6, + subMaxLevel: 0, + loadSidebar: null, + loadNavbar: null, + homepage: 'README.md', + coverpage: '', + basePath: '', + auto2top: false, + name: '', + themeColor: '', + nameLink: window.location.pathname, + autoHeader: false, + executeScript: null, + noEmoji: false, + ga: '', + ext: '.md', + mergeNavbar: false, + formatUpdated: '', + externalLinkTarget: '_blank', + routerMode: 'hash', + noCompileLinks: [], + relativePath: false + }, + window.$docsify + ); + + var script = + document.currentScript || + [].slice + .call(document.getElementsByTagName('script')) + .filter(function (n) { return /docsify\./.test(n.src); })[0]; + + if (script) { + for (var prop in config) { + if (hasOwn.call(config, prop)) { + var val = script.getAttribute('data-' + hyphenate(prop)); + + if (isPrimitive(val)) { + config[prop] = val === '' ? true : val; + } + } + } + + if (config.loadSidebar === true) { + config.loadSidebar = '_sidebar' + config.ext; + } + if (config.loadNavbar === true) { + config.loadNavbar = '_navbar' + config.ext; + } + if (config.coverpage === true) { + config.coverpage = '_coverpage' + config.ext; + } + if (config.repo === true) { + config.repo = ''; + } + if (config.name === true) { + config.name = ''; + } + } + + window.$docsify = config; + + return config +} + +function initLifecycle(vm) { + var hooks = [ + 'init', + 'mounted', + 'beforeEach', + 'afterEach', + 'doneEach', + 'ready' + ]; + + vm._hooks = {}; + vm._lifecycle = {}; + hooks.forEach(function (hook) { + var arr = (vm._hooks[hook] = []); + vm._lifecycle[hook] = function (fn) { return arr.push(fn); }; + }); +} + +function callHook(vm, hook, data, next) { + if ( next === void 0 ) next = noop; + + var queue = vm._hooks[hook]; + + var step = function (index) { + var hook = queue[index]; + if (index >= queue.length) { + next(data); + } else if (typeof hook === 'function') { + if (hook.length === 2) { + hook(data, function (result) { + data = result; + step(index + 1); + }); + } else { + var result = hook(data); + data = result === undefined ? data : result; + step(index + 1); + } + } else { + step(index + 1); + } + }; + + step(0); +} + +var inBrowser = !false; + +var isMobile = inBrowser && document.body.clientWidth <= 600; + +/** + * @see https://github.com/MoOx/pjax/blob/master/lib/is-supported.js + */ +var supportsPushState = + inBrowser && + (function () { + // Borrowed wholesale from https://github.com/defunkt/jquery-pjax + return ( + window.history && + window.history.pushState && + window.history.replaceState && + // PushState isn’t reliable on iOS until 5. + !navigator.userAgent.match( + /((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/ + ) + ) + })(); + +var cacheNode = {}; + +/** + * Get Node + * @param {String|Element} el + * @param {Boolean} noCache + * @return {Element} + */ +function getNode(el, noCache) { + if ( noCache === void 0 ) noCache = false; + + if (typeof el === 'string') { + if (typeof window.Vue !== 'undefined') { + return find(el) + } + el = noCache ? find(el) : cacheNode[el] || (cacheNode[el] = find(el)); + } + + return el +} + +var $ = inBrowser && document; + +var body = inBrowser && $.body; + +var head = inBrowser && $.head; + +/** + * Find element + * @example + * find('nav') => document.querySelector('nav') + * find(nav, 'a') => nav.querySelector('a') + */ +function find(el, node) { + return node ? el.querySelector(node) : $.querySelector(el) +} + +/** + * Find all elements + * @example + * findAll('a') => [].slice.call(document.querySelectorAll('a')) + * findAll(nav, 'a') => [].slice.call(nav.querySelectorAll('a')) + */ +function findAll(el, node) { + return [].slice.call( + node ? el.querySelectorAll(node) : $.querySelectorAll(el) + ) +} + +function create(node, tpl) { + node = $.createElement(node); + if (tpl) { + node.innerHTML = tpl; + } + return node +} + +function appendTo(target, el) { + return target.appendChild(el) +} + +function before(target, el) { + return target.insertBefore(el, target.children[0]) +} + +function on(el, type, handler) { + isFn(type) ? + window.addEventListener(el, type) : + el.addEventListener(type, handler); +} + +function off(el, type, handler) { + isFn(type) ? + window.removeEventListener(el, type) : + el.removeEventListener(type, handler); +} + +/** + * Toggle class + * + * @example + * toggleClass(el, 'active') => el.classList.toggle('active') + * toggleClass(el, 'add', 'active') => el.classList.add('active') + */ +function toggleClass(el, type, val) { + el && el.classList[val ? type : 'toggle'](val || type); +} + +function style(content) { + appendTo(head, create('style', content)); +} + + +var dom = Object.freeze({ + getNode: getNode, + $: $, + body: body, + head: head, + find: find, + findAll: findAll, + create: create, + appendTo: appendTo, + before: before, + on: on, + off: off, + toggleClass: toggleClass, + style: style +}); + +/** + * Render github corner + * @param {Object} data + * @return {String} + */ +function corner(data) { + if (!data) { + return '' + } + if (!/\/\//.test(data)) { + data = 'https://github.com/' + data; + } + data = data.replace(/^git\+/, ''); + + return ( + "" + + '' + + '' + ) +} + +/** + * Render main content + */ +function main(config) { + var aside = + '' + + ''; + + return ( + (isMobile ? (aside + "
    ") : ("
    " + aside)) + + '
    ' + + '
    ' + + '
    ' + + '
    ' + ) +} + +/** + * Cover Page + */ +function cover() { + var SL = ', 100%, 85%'; + var bgc = + 'linear-gradient(to left bottom, ' + + "hsl(" + (Math.floor(Math.random() * 255) + SL) + ") 0%," + + "hsl(" + (Math.floor(Math.random() * 255) + SL) + ") 100%)"; + + return ( + "
    " + + '
    ' + + '
    ' + + '
    ' + ) +} + +/** + * Render tree + * @param {Array} tree + * @param {String} tpl + * @return {String} + */ +function tree(toc, tpl) { + if ( tpl === void 0 ) tpl = '
      {inner}
    '; + + if (!toc || !toc.length) { + return '' + } + var innerHTML = ''; + toc.forEach(function (node) { + innerHTML += "
  • " + (node.title) + "
  • "; + if (node.children) { + innerHTML += tree(node.children, tpl); + } + }); + return tpl.replace('{inner}', innerHTML) +} + +function helper(className, content) { + return ("

    " + (content.slice(5).trim()) + "

    ") +} + +function theme(color) { + return ("") +} + +var barEl; +var timeId; + +/** + * Init progress component + */ +function init() { + var div = create('div'); + + div.classList.add('progress'); + appendTo(body, div); + barEl = div; +} +/** + * Render progress bar + */ +function progressbar (ref) { + var loaded = ref.loaded; + var total = ref.total; + var step = ref.step; + + var num; + + !barEl && init(); + + if (step) { + num = parseInt(barEl.style.width || 0, 10) + step; + num = num > 80 ? 80 : num; + } else { + num = Math.floor(loaded / total * 100); + } + + barEl.style.opacity = 1; + barEl.style.width = num >= 95 ? '100%' : num + '%'; + + if (num >= 95) { + clearTimeout(timeId); + timeId = setTimeout(function (_) { + barEl.style.opacity = 0; + barEl.style.width = '0%'; + }, 200); + } +} + +var cache = {}; + +/** + * Simple ajax get + * @param {string} url + * @param {boolean} [hasBar=false] has progress bar + * @return { then(resolve, reject), abort } + */ +function get(url, hasBar, headers) { + if ( hasBar === void 0 ) hasBar = false; + if ( headers === void 0 ) headers = {}; + + var xhr = new XMLHttpRequest(); + var on = function () { + xhr.addEventListener.apply(xhr, arguments); + }; + var cached$$1 = cache[url]; + + if (cached$$1) { + return {then: function (cb) { return cb(cached$$1.content, cached$$1.opt); }, abort: noop} + } + + xhr.open('GET', url); + for (var i in headers) { + if (hasOwn.call(headers, i)) { + xhr.setRequestHeader(i, headers[i]); + } + } + xhr.send(); + + return { + then: function (success, error) { + if ( error === void 0 ) error = noop; + + if (hasBar) { + var id = setInterval( + function (_) { return progressbar({ + step: Math.floor(Math.random() * 5 + 1) + }); }, + 500 + ); + + on('progress', progressbar); + on('loadend', function (evt) { + progressbar(evt); + clearInterval(id); + }); + } + + on('error', error); + on('load', function (ref) { + var target = ref.target; + + if (target.status >= 400) { + error(target); + } else { + var result = (cache[url] = { + content: target.response, + opt: { + updatedAt: xhr.getResponseHeader('last-modified') + } + }); + + success(result.content, result.opt); + } + }); + }, + abort: function (_) { return xhr.readyState !== 4 && xhr.abort(); } + } +} + +function replaceVar(block, color) { + block.innerHTML = block.innerHTML.replace( + /var\(\s*--theme-color.*?\)/g, + color + ); +} + +function cssVars (color) { + // Variable support + if (window.CSS && window.CSS.supports && window.CSS.supports('(--v:red)')) { + return + } + + var styleBlocks = findAll('style:not(.inserted),link'); + [].forEach.call(styleBlocks, function (block) { + if (block.nodeName === 'STYLE') { + replaceVar(block, color); + } else if (block.nodeName === 'LINK') { + var href = block.getAttribute('href'); + + if (!/\.css$/.test(href)) { + return + } + + get(href).then(function (res) { + var style$$1 = create('style', res); + + head.appendChild(style$$1); + replaceVar(style$$1, color); + }); + } + }); +} + +var RGX = /([^{]*?)\w(?=\})/g; + +var dict = { + YYYY: 'getFullYear', + YY: 'getYear', + MM: function (d) { + return d.getMonth() + 1; + }, + DD: 'getDate', + HH: 'getHours', + mm: 'getMinutes', + ss: 'getSeconds' +}; + +function tinydate (str) { + var parts=[], offset=0; + str.replace(RGX, function (key, _, idx) { + // save preceding string + parts.push(str.substring(offset, idx - 1)); + offset = idx += key.length + 1; + // save function + parts.push(function(d){ + return ('00' + (typeof dict[key]==='string' ? d[dict[key]]() : dict[key](d))).slice(-key.length); + }); + }); + + if (offset !== str.length) { + parts.push(str.substring(offset)); + } + + return function (arg) { + var out='', i=0, d=arg||new Date(); + for (; i ?(paragraph|[^\n]*)(?:\n|$))+/, + list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, + html: '^ {0,3}(?:' // optional indentation + + '<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)' // (1) + + '|comment[^\\n]*(\\n+|$)' // (2) + + '|<\\?[\\s\\S]*?\\?>\\n*' // (3) + + '|\\n*' // (4) + + '|\\n*' // (5) + + '|)[\\s\\S]*?(?:\\n{2,}|$)' // (6) + + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag + + '|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag + + ')', + def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, + table: noop, + lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, + paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/, + text: /^[^\n]+/ +}; + +block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/; +block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; +block.def = edit(block.def) + .replace('label', block._label) + .replace('title', block._title) + .getRegex(); + +block.bullet = /(?:[*+-]|\d+\.)/; +block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; +block.item = edit(block.item, 'gm') + .replace(/bull/g, block.bullet) + .getRegex(); + +block.list = edit(block.list) + .replace(/bull/g, block.bullet) + .replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))') + .replace('def', '\\n+(?=' + block.def.source + ')') + .getRegex(); + +block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + + '|track|ul'; +block._comment = //; +block.html = edit(block.html, 'i') + .replace('comment', block._comment) + .replace('tag', block._tag) + .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/) + .getRegex(); + +block.paragraph = edit(block.paragraph) + .replace('hr', block.hr) + .replace('heading', block.heading) + .replace('lheading', block.lheading) + .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks + .getRegex(); + +block.blockquote = edit(block.blockquote) + .replace('paragraph', block.paragraph) + .getRegex(); + +/** + * Normal Block Grammar + */ + +block.normal = merge({}, block); + +/** + * GFM Block Grammar + */ + +block.gfm = merge({}, block.normal, { + fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/, + paragraph: /^/, + heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ +}); + +block.gfm.paragraph = edit(block.paragraph) + .replace('(?!', '(?!' + + block.gfm.fences.source.replace('\\1', '\\2') + '|' + + block.list.source.replace('\\1', '\\3') + '|') + .getRegex(); + +/** + * GFM + Tables Block Grammar + */ + +block.tables = merge({}, block.gfm, { + nptable: /^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/, + table: /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/ +}); + +/** + * Pedantic grammar + */ + +block.pedantic = merge({}, block.normal, { + html: edit( + '^ *(?:comment *(?:\\n|\\s*$)' + + '|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)' // closed tag + + '|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))') + .replace('comment', block._comment) + .replace(/tag/g, '(?!(?:' + + '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') + .getRegex(), + def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/ +}); + +/** + * Block Lexer + */ + +function Lexer(options) { + this.tokens = []; + this.tokens.links = Object.create(null); + this.options = options || marked.defaults; + this.rules = block.normal; + + if (this.options.pedantic) { + this.rules = block.pedantic; + } else if (this.options.gfm) { + if (this.options.tables) { + this.rules = block.tables; + } else { + this.rules = block.gfm; + } + } +} + +/** + * Expose Block Rules + */ + +Lexer.rules = block; + +/** + * Static Lex Method + */ + +Lexer.lex = function(src, options) { + var lexer = new Lexer(options); + return lexer.lex(src); +}; + +/** + * Preprocessing + */ + +Lexer.prototype.lex = function(src) { + src = src + .replace(/\r\n|\r/g, '\n') + .replace(/\t/g, ' ') + .replace(/\u00a0/g, ' ') + .replace(/\u2424/g, '\n'); + + return this.token(src, true); +}; + +/** + * Lexing + */ + +Lexer.prototype.token = function(src, top) { + var this$1 = this; + + src = src.replace(/^ +$/gm, ''); + var next, + loose, + cap, + bull, + b, + item, + listStart, + listItems, + t, + space, + i, + tag, + l, + isordered, + istask, + ischecked; + + while (src) { + // newline + if (cap = this$1.rules.newline.exec(src)) { + src = src.substring(cap[0].length); + if (cap[0].length > 1) { + this$1.tokens.push({ + type: 'space' + }); + } + } + + // code + if (cap = this$1.rules.code.exec(src)) { + src = src.substring(cap[0].length); + cap = cap[0].replace(/^ {4}/gm, ''); + this$1.tokens.push({ + type: 'code', + text: !this$1.options.pedantic + ? rtrim(cap, '\n') + : cap + }); + continue; + } + + // fences (gfm) + if (cap = this$1.rules.fences.exec(src)) { + src = src.substring(cap[0].length); + this$1.tokens.push({ + type: 'code', + lang: cap[2], + text: cap[3] || '' + }); + continue; + } + + // heading + if (cap = this$1.rules.heading.exec(src)) { + src = src.substring(cap[0].length); + this$1.tokens.push({ + type: 'heading', + depth: cap[1].length, + text: cap[2] + }); + continue; + } + + // table no leading pipe (gfm) + if (top && (cap = this$1.rules.nptable.exec(src))) { + item = { + type: 'table', + header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] + }; + + if (item.header.length === item.align.length) { + src = src.substring(cap[0].length); + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } + } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = splitCells(item.cells[i], item.header.length); + } + + this$1.tokens.push(item); + + continue; + } + } + + // hr + if (cap = this$1.rules.hr.exec(src)) { + src = src.substring(cap[0].length); + this$1.tokens.push({ + type: 'hr' + }); + continue; + } + + // blockquote + if (cap = this$1.rules.blockquote.exec(src)) { + src = src.substring(cap[0].length); + + this$1.tokens.push({ + type: 'blockquote_start' + }); + + cap = cap[0].replace(/^ *> ?/gm, ''); + + // Pass `top` to keep the current + // "toplevel" state. This is exactly + // how markdown.pl works. + this$1.token(cap, top); + + this$1.tokens.push({ + type: 'blockquote_end' + }); + + continue; + } + + // list + if (cap = this$1.rules.list.exec(src)) { + src = src.substring(cap[0].length); + bull = cap[2]; + isordered = bull.length > 1; + + listStart = { + type: 'list_start', + ordered: isordered, + start: isordered ? +bull : '', + loose: false + }; + + this$1.tokens.push(listStart); + + // Get each top-level item. + cap = cap[0].match(this$1.rules.item); + + listItems = []; + next = false; + l = cap.length; + i = 0; + + for (; i < l; i++) { + item = cap[i]; + + // Remove the list item's bullet + // so it is seen as the next token. + space = item.length; + item = item.replace(/^ *([*+-]|\d+\.) +/, ''); + + // Outdent whatever the + // list item contains. Hacky. + if (~item.indexOf('\n ')) { + space -= item.length; + item = !this$1.options.pedantic + ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') + : item.replace(/^ {1,4}/gm, ''); + } + + // Determine whether the next list item belongs here. + // Backpedal if it does not belong in this list. + if (this$1.options.smartLists && i !== l - 1) { + b = block.bullet.exec(cap[i + 1])[0]; + if (bull !== b && !(bull.length > 1 && b.length > 1)) { + src = cap.slice(i + 1).join('\n') + src; + i = l - 1; + } + } + + // Determine whether item is loose or not. + // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ + // for discount behavior. + loose = next || /\n\n(?!\s*$)/.test(item); + if (i !== l - 1) { + next = item.charAt(item.length - 1) === '\n'; + if (!loose) { loose = next; } + } + + if (loose) { + listStart.loose = true; + } + + // Check for task list items + istask = /^\[[ xX]\] /.test(item); + ischecked = undefined; + if (istask) { + ischecked = item[1] !== ' '; + item = item.replace(/^\[[ xX]\] +/, ''); + } + + t = { + type: 'list_item_start', + task: istask, + checked: ischecked, + loose: loose + }; + + listItems.push(t); + this$1.tokens.push(t); + + // Recurse. + this$1.token(item, false); + + this$1.tokens.push({ + type: 'list_item_end' + }); + } + + if (listStart.loose) { + l = listItems.length; + i = 0; + for (; i < l; i++) { + listItems[i].loose = true; + } + } + + this$1.tokens.push({ + type: 'list_end' + }); + + continue; + } + + // html + if (cap = this$1.rules.html.exec(src)) { + src = src.substring(cap[0].length); + this$1.tokens.push({ + type: this$1.options.sanitize + ? 'paragraph' + : 'html', + pre: !this$1.options.sanitizer + && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), + text: cap[0] + }); + continue; + } + + // def + if (top && (cap = this$1.rules.def.exec(src))) { + src = src.substring(cap[0].length); + if (cap[3]) { cap[3] = cap[3].substring(1, cap[3].length - 1); } + tag = cap[1].toLowerCase().replace(/\s+/g, ' '); + if (!this$1.tokens.links[tag]) { + this$1.tokens.links[tag] = { + href: cap[2], + title: cap[3] + }; + } + continue; + } + + // table (gfm) + if (top && (cap = this$1.rules.table.exec(src))) { + item = { + type: 'table', + header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + cells: cap[3] ? cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') : [] + }; + + if (item.header.length === item.align.length) { + src = src.substring(cap[0].length); + + for (i = 0; i < item.align.length; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } + } + + for (i = 0; i < item.cells.length; i++) { + item.cells[i] = splitCells( + item.cells[i].replace(/^ *\| *| *\| *$/g, ''), + item.header.length); + } + + this$1.tokens.push(item); + + continue; + } + } + + // lheading + if (cap = this$1.rules.lheading.exec(src)) { + src = src.substring(cap[0].length); + this$1.tokens.push({ + type: 'heading', + depth: cap[2] === '=' ? 1 : 2, + text: cap[1] + }); + continue; + } + + // top-level paragraph + if (top && (cap = this$1.rules.paragraph.exec(src))) { + src = src.substring(cap[0].length); + this$1.tokens.push({ + type: 'paragraph', + text: cap[1].charAt(cap[1].length - 1) === '\n' + ? cap[1].slice(0, -1) + : cap[1] + }); + continue; + } + + // text + if (cap = this$1.rules.text.exec(src)) { + // Top-level should never reach here. + src = src.substring(cap[0].length); + this$1.tokens.push({ + type: 'text', + text: cap[0] + }); + continue; + } + + if (src) { + throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } + } + + return this.tokens; +}; + +/** + * Inline-Level Grammar + */ + +var inline = { + escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, + autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, + url: noop, + tag: '^comment' + + '|^' // self-closing tag + + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag + + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. + + '|^' // declaration, e.g. + + '|^', // CDATA section + link: /^!?\[(label)\]\(href(?:\s+(title))?\s*\)/, + reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, + nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, + strong: /^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/, + em: /^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/, + code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, + br: /^( {2,}|\\)\n(?!\s*$)/, + del: noop, + text: /^(`+|[^`])[\s\S]*?(?=[\\?@\[\]\\^_`{|}~])/g; + +inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/; +inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/; +inline.autolink = edit(inline.autolink) + .replace('scheme', inline._scheme) + .replace('email', inline._email) + .getRegex(); + +inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/; + +inline.tag = edit(inline.tag) + .replace('comment', block._comment) + .replace('attribute', inline._attribute) + .getRegex(); + +inline._label = /(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/; +inline._href = /\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f\\]*\)|[^\s\x00-\x1f()\\])*?)/; +inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/; + +inline.link = edit(inline.link) + .replace('label', inline._label) + .replace('href', inline._href) + .replace('title', inline._title) + .getRegex(); + +inline.reflink = edit(inline.reflink) + .replace('label', inline._label) + .getRegex(); + +/** + * Normal Inline Grammar + */ + +inline.normal = merge({}, inline); + +/** + * Pedantic Inline Grammar + */ + +inline.pedantic = merge({}, inline.normal, { + strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, + em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/, + link: edit(/^!?\[(label)\]\((.*?)\)/) + .replace('label', inline._label) + .getRegex(), + reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/) + .replace('label', inline._label) + .getRegex() +}); + +/** + * GFM Inline Grammar + */ + +inline.gfm = merge({}, inline.normal, { + escape: edit(inline.escape).replace('])', '~|])').getRegex(), + _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/, + url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, + _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/, + del: /^~+(?=\S)([\s\S]*?\S)~+/, + text: edit(inline.text) + .replace(']|', '~]|') + .replace('|$', '|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&\'*+/=?^_`{\\|}~-]+@|$') + .getRegex() +}); + +inline.gfm.url = edit(inline.gfm.url) + .replace('email', inline.gfm._extended_email) + .getRegex(); +/** + * GFM + Line Breaks Inline Grammar + */ + +inline.breaks = merge({}, inline.gfm, { + br: edit(inline.br).replace('{2,}', '*').getRegex(), + text: edit(inline.gfm.text).replace('{2,}', '*').getRegex() +}); + +/** + * Inline Lexer & Compiler + */ + +function InlineLexer(links, options) { + this.options = options || marked.defaults; + this.links = links; + this.rules = inline.normal; + this.renderer = this.options.renderer || new Renderer(); + this.renderer.options = this.options; + + if (!this.links) { + throw new Error('Tokens array requires a `links` property.'); + } + + if (this.options.pedantic) { + this.rules = inline.pedantic; + } else if (this.options.gfm) { + if (this.options.breaks) { + this.rules = inline.breaks; + } else { + this.rules = inline.gfm; + } + } +} + +/** + * Expose Inline Rules + */ + +InlineLexer.rules = inline; + +/** + * Static Lexing/Compiling Method + */ + +InlineLexer.output = function(src, links, options) { + var inline = new InlineLexer(links, options); + return inline.output(src); +}; + +/** + * Lexing/Compiling + */ + +InlineLexer.prototype.output = function(src) { + var this$1 = this; + + var out = '', + link, + text, + href, + title, + cap, + prevCapZero; + + while (src) { + // escape + if (cap = this$1.rules.escape.exec(src)) { + src = src.substring(cap[0].length); + out += cap[1]; + continue; + } + + // autolink + if (cap = this$1.rules.autolink.exec(src)) { + src = src.substring(cap[0].length); + if (cap[2] === '@') { + text = escape(this$1.mangle(cap[1])); + href = 'mailto:' + text; + } else { + text = escape(cap[1]); + href = text; + } + out += this$1.renderer.link(href, null, text); + continue; + } + + // url (gfm) + if (!this$1.inLink && (cap = this$1.rules.url.exec(src))) { + if (cap[2] === '@') { + text = escape(cap[0]); + href = 'mailto:' + text; + } else { + // do extended autolink path validation + do { + prevCapZero = cap[0]; + cap[0] = this$1.rules._backpedal.exec(cap[0])[0]; + } while (prevCapZero !== cap[0]); + text = escape(cap[0]); + if (cap[1] === 'www.') { + href = 'http://' + text; + } else { + href = text; + } + } + src = src.substring(cap[0].length); + out += this$1.renderer.link(href, null, text); + continue; + } + + // tag + if (cap = this$1.rules.tag.exec(src)) { + if (!this$1.inLink && /^/i.test(cap[0])) { + this$1.inLink = false; + } + if (!this$1.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { + this$1.inRawBlock = true; + } else if (this$1.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { + this$1.inRawBlock = false; + } + + src = src.substring(cap[0].length); + out += this$1.options.sanitize + ? this$1.options.sanitizer + ? this$1.options.sanitizer(cap[0]) + : escape(cap[0]) + : cap[0]; + continue; + } + + // link + if (cap = this$1.rules.link.exec(src)) { + src = src.substring(cap[0].length); + this$1.inLink = true; + href = cap[2]; + if (this$1.options.pedantic) { + link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); + + if (link) { + href = link[1]; + title = link[3]; + } else { + title = ''; + } + } else { + title = cap[3] ? cap[3].slice(1, -1) : ''; + } + href = href.trim().replace(/^<([\s\S]*)>$/, '$1'); + out += this$1.outputLink(cap, { + href: InlineLexer.escapes(href), + title: InlineLexer.escapes(title) + }); + this$1.inLink = false; + continue; + } + + // reflink, nolink + if ((cap = this$1.rules.reflink.exec(src)) + || (cap = this$1.rules.nolink.exec(src))) { + src = src.substring(cap[0].length); + link = (cap[2] || cap[1]).replace(/\s+/g, ' '); + link = this$1.links[link.toLowerCase()]; + if (!link || !link.href) { + out += cap[0].charAt(0); + src = cap[0].substring(1) + src; + continue; + } + this$1.inLink = true; + out += this$1.outputLink(cap, link); + this$1.inLink = false; + continue; + } + + // strong + if (cap = this$1.rules.strong.exec(src)) { + src = src.substring(cap[0].length); + out += this$1.renderer.strong(this$1.output(cap[4] || cap[3] || cap[2] || cap[1])); + continue; + } + + // em + if (cap = this$1.rules.em.exec(src)) { + src = src.substring(cap[0].length); + out += this$1.renderer.em(this$1.output(cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1])); + continue; + } + + // code + if (cap = this$1.rules.code.exec(src)) { + src = src.substring(cap[0].length); + out += this$1.renderer.codespan(escape(cap[2].trim(), true)); + continue; + } + + // br + if (cap = this$1.rules.br.exec(src)) { + src = src.substring(cap[0].length); + out += this$1.renderer.br(); + continue; + } + + // del (gfm) + if (cap = this$1.rules.del.exec(src)) { + src = src.substring(cap[0].length); + out += this$1.renderer.del(this$1.output(cap[1])); + continue; + } + + // text + if (cap = this$1.rules.text.exec(src)) { + src = src.substring(cap[0].length); + if (this$1.inRawBlock) { + out += this$1.renderer.text(cap[0]); + } else { + out += this$1.renderer.text(escape(this$1.smartypants(cap[0]))); + } + continue; + } + + if (src) { + throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); + } + } + + return out; +}; + +InlineLexer.escapes = function(text) { + return text ? text.replace(InlineLexer.rules._escapes, '$1') : text; +}; + +/** + * Compile Link + */ + +InlineLexer.prototype.outputLink = function(cap, link) { + var href = link.href, + title = link.title ? escape(link.title) : null; + + return cap[0].charAt(0) !== '!' + ? this.renderer.link(href, title, this.output(cap[1])) + : this.renderer.image(href, title, escape(cap[1])); +}; + +/** + * Smartypants Transformations + */ + +InlineLexer.prototype.smartypants = function(text) { + if (!this.options.smartypants) { return text; } + return text + // em-dashes + .replace(/---/g, '\u2014') + // en-dashes + .replace(/--/g, '\u2013') + // opening singles + .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') + // closing singles & apostrophes + .replace(/'/g, '\u2019') + // opening doubles + .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') + // closing doubles + .replace(/"/g, '\u201d') + // ellipses + .replace(/\.{3}/g, '\u2026'); +}; + +/** + * Mangle Links + */ + +InlineLexer.prototype.mangle = function(text) { + if (!this.options.mangle) { return text; } + var out = '', + l = text.length, + i = 0, + ch; + + for (; i < l; i++) { + ch = text.charCodeAt(i); + if (Math.random() > 0.5) { + ch = 'x' + ch.toString(16); + } + out += '&#' + ch + ';'; + } + + return out; +}; + +/** + * Renderer + */ + +function Renderer(options) { + this.options = options || marked.defaults; +} + +Renderer.prototype.code = function(code, lang, escaped) { + if (this.options.highlight) { + var out = this.options.highlight(code, lang); + if (out != null && out !== code) { + escaped = true; + code = out; + } + } + + if (!lang) { + return '
    '
    +      + (escaped ? code : escape(code, true))
    +      + '
    '; + } + + return '
    '
    +    + (escaped ? code : escape(code, true))
    +    + '
    \n'; +}; + +Renderer.prototype.blockquote = function(quote) { + return '
    \n' + quote + '
    \n'; +}; + +Renderer.prototype.html = function(html) { + return html; +}; + +Renderer.prototype.heading = function(text, level, raw) { + if (this.options.headerIds) { + return '' + + text + + '\n'; + } + // ignore IDs + return '' + text + '\n'; +}; + +Renderer.prototype.hr = function() { + return this.options.xhtml ? '
    \n' : '
    \n'; +}; + +Renderer.prototype.list = function(body, ordered, start) { + var type = ordered ? 'ol' : 'ul', + startatt = (ordered && start !== 1) ? (' start="' + start + '"') : ''; + return '<' + type + startatt + '>\n' + body + '\n'; +}; + +Renderer.prototype.listitem = function(text) { + return '
  • ' + text + '
  • \n'; +}; + +Renderer.prototype.checkbox = function(checked) { + return ' '; +}; + +Renderer.prototype.paragraph = function(text) { + return '

    ' + text + '

    \n'; +}; + +Renderer.prototype.table = function(header, body) { + if (body) { body = '' + body + ''; } + + return '\n' + + '\n' + + header + + '\n' + + body + + '
    \n'; +}; + +Renderer.prototype.tablerow = function(content) { + return '\n' + content + '\n'; +}; + +Renderer.prototype.tablecell = function(content, flags) { + var type = flags.header ? 'th' : 'td'; + var tag = flags.align + ? '<' + type + ' align="' + flags.align + '">' + : '<' + type + '>'; + return tag + content + '\n'; +}; + +// span level renderer +Renderer.prototype.strong = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.em = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.codespan = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.br = function() { + return this.options.xhtml ? '
    ' : '
    '; +}; + +Renderer.prototype.del = function(text) { + return '' + text + ''; +}; + +Renderer.prototype.link = function(href, title, text) { + if (this.options.sanitize) { + try { + var prot = decodeURIComponent(unescape(href)) + .replace(/[^\w:]/g, '') + .toLowerCase(); + } catch (e) { + return text; + } + if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { + return text; + } + } + if (this.options.baseUrl && !originIndependentUrl.test(href)) { + href = resolveUrl(this.options.baseUrl, href); + } + try { + href = encodeURI(href).replace(/%25/g, '%'); + } catch (e) { + return text; + } + var out = '
    '; + return out; +}; + +Renderer.prototype.image = function(href, title, text) { + if (this.options.baseUrl && !originIndependentUrl.test(href)) { + href = resolveUrl(this.options.baseUrl, href); + } + var out = '' + text + '' : '>'; + return out; +}; + +Renderer.prototype.text = function(text) { + return text; +}; + +/** + * TextRenderer + * returns only the textual part of the token + */ + +function TextRenderer() {} + +// no need for block level renderers + +TextRenderer.prototype.strong = +TextRenderer.prototype.em = +TextRenderer.prototype.codespan = +TextRenderer.prototype.del = +TextRenderer.prototype.text = function (text) { + return text; +}; + +TextRenderer.prototype.link = +TextRenderer.prototype.image = function(href, title, text) { + return '' + text; +}; + +TextRenderer.prototype.br = function() { + return ''; +}; + +/** + * Parsing & Compiling + */ + +function Parser(options) { + this.tokens = []; + this.token = null; + this.options = options || marked.defaults; + this.options.renderer = this.options.renderer || new Renderer(); + this.renderer = this.options.renderer; + this.renderer.options = this.options; +} + +/** + * Static Parse Method + */ + +Parser.parse = function(src, options) { + var parser = new Parser(options); + return parser.parse(src); +}; + +/** + * Parse Loop + */ + +Parser.prototype.parse = function(src) { + var this$1 = this; + + this.inline = new InlineLexer(src.links, this.options); + // use an InlineLexer with a TextRenderer to extract pure text + this.inlineText = new InlineLexer( + src.links, + merge({}, this.options, {renderer: new TextRenderer()}) + ); + this.tokens = src.reverse(); + + var out = ''; + while (this.next()) { + out += this$1.tok(); + } + + return out; +}; + +/** + * Next Token + */ + +Parser.prototype.next = function() { + return this.token = this.tokens.pop(); +}; + +/** + * Preview Next Token + */ + +Parser.prototype.peek = function() { + return this.tokens[this.tokens.length - 1] || 0; +}; + +/** + * Parse Text Tokens + */ + +Parser.prototype.parseText = function() { + var this$1 = this; + + var body = this.token.text; + + while (this.peek().type === 'text') { + body += '\n' + this$1.next().text; + } + + return this.inline.output(body); +}; + +/** + * Parse Current Token + */ + +Parser.prototype.tok = function() { + var this$1 = 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, + unescape(this.inlineText.output(this.token.text))); + } + case 'code': { + return this.renderer.code(this.token.text, + this.token.lang, + this.token.escaped); + } + case 'table': { + var header = '', + body = '', + i, + row, + cell, + j; + + // header + cell = ''; + for (i = 0; i < this.token.header.length; i++) { + cell += this$1.renderer.tablecell( + this$1.inline.output(this$1.token.header[i]), + { header: true, align: this$1.token.align[i] } + ); + } + header += this.renderer.tablerow(cell); + + for (i = 0; i < this.token.cells.length; i++) { + row = this$1.token.cells[i]; + + cell = ''; + for (j = 0; j < row.length; j++) { + cell += this$1.renderer.tablecell( + this$1.inline.output(row[j]), + { header: false, align: this$1.token.align[j] } + ); + } + + body += this$1.renderer.tablerow(cell); + } + return this.renderer.table(header, body); + } + case 'blockquote_start': { + body = ''; + + while (this.next().type !== 'blockquote_end') { + body += this$1.tok(); + } + + return this.renderer.blockquote(body); + } + case 'list_start': { + body = ''; + var ordered = this.token.ordered, + start = this.token.start; + + while (this.next().type !== 'list_end') { + body += this$1.tok(); + } + + return this.renderer.list(body, ordered, start); + } + case 'list_item_start': { + body = ''; + var loose = this.token.loose; + + if (this.token.task) { + body += this.renderer.checkbox(this.token.checked); + } + + while (this.next().type !== 'list_item_end') { + body += !loose && this$1.token.type === 'text' + ? this$1.parseText() + : this$1.tok(); + } + + return this.renderer.listitem(body); + } + case 'html': { + // TODO parse inline content if parameter markdown=1 + return this.renderer.html(this.token.text); + } + case 'paragraph': { + return this.renderer.paragraph(this.inline.output(this.token.text)); + } + case 'text': { + return this.renderer.paragraph(this.parseText()); + } + } +}; + +/** + * Helpers + */ + +function escape(html, encode) { + if (encode) { + if (escape.escapeTest.test(html)) { + return html.replace(escape.escapeReplace, function (ch) { return escape.replacements[ch] }); + } + } else { + if (escape.escapeTestNoEncode.test(html)) { + return html.replace(escape.escapeReplaceNoEncode, function (ch) { return escape.replacements[ch] }); + } + } + + return html; +} + +escape.escapeTest = /[&<>"']/; +escape.escapeReplace = /[&<>"']/g; +escape.replacements = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' +}; + +escape.escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/; +escape.escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g; + +function unescape(html) { + // explicitly match decimal, hex, and named HTML entities + return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, function(_, n) { + n = n.toLowerCase(); + if (n === 'colon') { return ':'; } + if (n.charAt(0) === '#') { + return n.charAt(1) === 'x' + ? String.fromCharCode(parseInt(n.substring(2), 16)) + : String.fromCharCode(+n.substring(1)); + } + return ''; + }); +} + +function edit(regex, opt) { + regex = regex.source || regex; + opt = opt || ''; + return { + replace: function(name, val) { + val = val.source || val; + val = val.replace(/(^|[^\[])\^/g, '$1'); + regex = regex.replace(name, val); + return this; + }, + getRegex: function() { + return new RegExp(regex, opt); + } + }; +} + +function resolveUrl(base, href) { + if (!baseUrls[' ' + base]) { + // we can ignore everything in base after the last slash of its path component, + // but we might need to add _that_ + // https://tools.ietf.org/html/rfc3986#section-3 + if (/^[^:]+:\/*[^/]*$/.test(base)) { + baseUrls[' ' + base] = base + '/'; + } else { + baseUrls[' ' + base] = rtrim(base, '/', true); + } + } + base = baseUrls[' ' + base]; + + if (href.slice(0, 2) === '//') { + return base.replace(/:[\s\S]*/, ':') + href; + } else if (href.charAt(0) === '/') { + return base.replace(/(:\/*[^/]*)[\s\S]*/, '$1') + href; + } else { + return base + href; + } +} +var baseUrls = {}; +var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i; + +function noop() {} +noop.exec = noop; + +function merge(obj) { + var arguments$1 = arguments; + + var i = 1, + target, + key; + + for (; i < arguments.length; i++) { + target = arguments$1[i]; + for (key in target) { + if (Object.prototype.hasOwnProperty.call(target, key)) { + obj[key] = target[key]; + } + } + } + + return obj; +} + +function splitCells(tableRow, count) { + // ensure that every cell-delimiting pipe has a space + // before it to distinguish it from an escaped pipe + var row = tableRow.replace(/\|/g, function (match, offset, str) { + var escaped = false, + curr = offset; + while (--curr >= 0 && str[curr] === '\\') { escaped = !escaped; } + if (escaped) { + // odd number of slashes means | is escaped + // so we leave it alone + return '|'; + } else { + // add space before unescaped | + return ' |'; + } + }), + cells = row.split(/ \|/), + i = 0; + + if (cells.length > count) { + cells.splice(count); + } else { + while (cells.length < count) { cells.push(''); } + } + + for (; i < cells.length; i++) { + // leading or trailing whitespace is ignored per the gfm spec + cells[i] = cells[i].trim().replace(/\\\|/g, '|'); + } + return cells; +} + +// Remove trailing 'c's. Equivalent to str.replace(/c*$/, ''). +// /c*$/ is vulnerable to REDOS. +// invert: Remove suffix of non-c chars instead. Default falsey. +function rtrim(str, c, invert) { + if (str.length === 0) { + return ''; + } + + // Length of suffix matching the invert condition. + var suffLen = 0; + + // Step left until we fail to match the invert condition. + while (suffLen < str.length) { + var currChar = str.charAt(str.length - suffLen - 1); + if (currChar === c && !invert) { + suffLen++; + } else if (currChar !== c && invert) { + suffLen++; + } else { + break; + } + } + + return str.substr(0, str.length - suffLen); +} + +/** + * Marked + */ + +function marked(src, opt, callback) { + // throw error in case of non string input + if (typeof src === 'undefined' || src === null) { + throw new Error('marked(): input parameter is undefined or null'); + } + if (typeof src !== 'string') { + throw new Error('marked(): input parameter is of type ' + + Object.prototype.toString.call(src) + ', string expected'); + } + + if (callback || typeof opt === 'function') { + if (!callback) { + callback = opt; + opt = null; + } + + opt = merge({}, marked.defaults, opt || {}); + + var highlight = opt.highlight, + tokens, + pending, + i = 0; + + try { + tokens = Lexer.lex(src, opt); + } catch (e) { + return callback(e); + } + + pending = tokens.length; + + var done = function(err) { + if (err) { + opt.highlight = highlight; + return callback(err); + } + + var out; + + try { + out = Parser.parse(tokens, opt); + } catch (e) { + err = e; + } + + opt.highlight = highlight; + + return err + ? callback(err) + : callback(null, out); + }; + + if (!highlight || highlight.length < 3) { + return done(); + } + + delete opt.highlight; + + if (!pending) { return done(); } + + for (; i < tokens.length; i++) { + (function(token) { + if (token.type !== 'code') { + return --pending || done(); + } + return highlight(token.text, token.lang, function(err, code) { + if (err) { return done(err); } + if (code == null || code === token.text) { + return --pending || done(); + } + token.text = code; + token.escaped = true; + --pending || done(); + }); + })(tokens[i]); + } + + return; + } + try { + if (opt) { opt = merge({}, marked.defaults, opt); } + return Parser.parse(Lexer.lex(src, opt), opt); + } catch (e) { + e.message += '\nPlease report this to https://github.com/markedjs/marked.'; + if ((opt || marked.defaults).silent) { + return '

    An error occurred:

    '
    +        + escape(e.message + '', true)
    +        + '
    '; + } + throw e; + } +} + +/** + * Options + */ + +marked.options = +marked.setOptions = function(opt) { + merge(marked.defaults, opt); + return marked; +}; + +marked.getDefaults = function () { + return { + baseUrl: null, + breaks: false, + gfm: true, + headerIds: true, + headerPrefix: '', + highlight: null, + langPrefix: 'language-', + mangle: true, + pedantic: false, + renderer: new Renderer(), + sanitize: false, + sanitizer: null, + silent: false, + smartLists: false, + smartypants: false, + tables: true, + xhtml: false + }; +}; + +marked.defaults = marked.getDefaults(); + +/** + * Expose + */ + +marked.Parser = Parser; +marked.parser = Parser.parse; + +marked.Renderer = Renderer; +marked.TextRenderer = TextRenderer; + +marked.Lexer = Lexer; +marked.lexer = Lexer.lex; + +marked.InlineLexer = InlineLexer; +marked.inlineLexer = InlineLexer.output; + +marked.parse = marked; + +{ + module.exports = marked; +} +})(commonjsGlobal || (typeof window !== 'undefined' ? window : commonjsGlobal)); +}); + +var prism = createCommonjsModule(function (module) { +/* ********************************************** + Begin prism-core.js +********************************************** */ + +var _self = (typeof window !== 'undefined') + ? window // if in browser + : ( + (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) + ? self // if in worker + : {} // if in node js + ); + +/** + * Prism: Lightweight, robust, elegant syntax highlighting + * MIT license http://www.opensource.org/licenses/mit-license.php/ + * @author Lea Verou http://lea.verou.me + */ + +var Prism = (function(){ + +// Private helper vars +var lang = /\blang(?:uage)?-([\w-]+)\b/i; +var uniqueId = 0; + +var _ = _self.Prism = { + manual: _self.Prism && _self.Prism.manual, + disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler, + util: { + encode: function (tokens) { + if (tokens instanceof Token) { + return new Token(tokens.type, _.util.encode(tokens.content), tokens.alias); + } else if (_.util.type(tokens) === 'Array') { + return tokens.map(_.util.encode); + } else { + return tokens.replace(/&/g, '&').replace(/ text.length) { + // Something went terribly wrong, ABORT, ABORT! + return; + } + + if (str instanceof Token) { + continue; + } + + if (greedy && i != strarr.length - 1) { + pattern.lastIndex = pos; + var match = pattern.exec(text); + if (!match) { + break; + } + + var from = match.index + (lookbehind ? match[1].length : 0), + to = match.index + match[0].length, + k = i, + p = pos; + + for (var len = strarr.length; k < len && (p < to || (!strarr[k].type && !strarr[k - 1].greedy)); ++k) { + p += strarr[k].length; + // Move the index i to the element in strarr that is closest to from + if (from >= p) { + ++i; + pos = p; + } + } + + // If strarr[i] is a Token, then the match starts inside another Token, which is invalid + if (strarr[i] instanceof Token) { + continue; + } + + // Number of tokens to delete and replace with the new match + delNum = k - i; + str = text.slice(pos, p); + match.index -= pos; + } else { + pattern.lastIndex = 0; + + var match = pattern.exec(str), + delNum = 1; + } + + if (!match) { + if (oneshot) { + break; + } + + continue; + } + + if(lookbehind) { + lookbehindLength = match[1] ? match[1].length : 0; + } + + var from = match.index + lookbehindLength, + match = match[0].slice(lookbehindLength), + to = from + match.length, + before = str.slice(0, from), + after = str.slice(to); + + var args = [i, delNum]; + + if (before) { + ++i; + pos += before.length; + args.push(before); + } + + var wrapped = new Token(token, inside? _.tokenize(match, inside) : match, alias, match, greedy); + + args.push(wrapped); + + if (after) { + args.push(after); + } + + Array.prototype.splice.apply(strarr, args); + + if (delNum != 1) + { _.matchGrammar(text, strarr, grammar, i, pos, true, token); } + + if (oneshot) + { break; } + } + } + } + }, + + tokenize: function(text, grammar, language) { + var strarr = [text]; + + var rest = grammar.rest; + + if (rest) { + for (var token in rest) { + grammar[token] = rest[token]; + } + + delete grammar.rest; + } + + _.matchGrammar(text, strarr, grammar, 0, 0, false); + + return strarr; + }, + + hooks: { + all: {}, + + add: function (name, callback) { + var hooks = _.hooks.all; + + hooks[name] = hooks[name] || []; + + hooks[name].push(callback); + }, + + run: function (name, env) { + var callbacks = _.hooks.all[name]; + + if (!callbacks || !callbacks.length) { + return; + } + + for (var i=0, callback; callback = callbacks[i++];) { + callback(env); + } + } + } +}; + +var Token = _.Token = function(type, content, alias, matchedStr, greedy) { + this.type = type; + this.content = content; + this.alias = alias; + // Copy of the full string this token was created from + this.length = (matchedStr || "").length|0; + this.greedy = !!greedy; +}; + +Token.stringify = function(o, language, parent) { + if (typeof o == 'string') { + return o; + } + + if (_.util.type(o) === 'Array') { + return o.map(function(element) { + return Token.stringify(element, language, o); + }).join(''); + } + + var env = { + type: o.type, + content: Token.stringify(o.content, language, parent), + tag: 'span', + classes: ['token', o.type], + attributes: {}, + language: language, + parent: parent + }; + + if (o.alias) { + var aliases = _.util.type(o.alias) === 'Array' ? o.alias : [o.alias]; + Array.prototype.push.apply(env.classes, aliases); + } + + _.hooks.run('wrap', env); + + var attributes = Object.keys(env.attributes).map(function(name) { + return name + '="' + (env.attributes[name] || '').replace(/"/g, '"') + '"'; + }).join(' '); + + return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + (attributes ? ' ' + attributes : '') + '>' + env.content + ''; + +}; + +if (!_self.document) { + if (!_self.addEventListener) { + // in Node.js + return _self.Prism; + } + + if (!_.disableWorkerMessageHandler) { + // In worker + _self.addEventListener('message', function (evt) { + var message = JSON.parse(evt.data), + lang = message.language, + code = message.code, + immediateClose = message.immediateClose; + + _self.postMessage(_.highlight(code, _.languages[lang], lang)); + if (immediateClose) { + _self.close(); + } + }, false); + } + + return _self.Prism; +} + +//Get current script and highlight +var script = document.currentScript || [].slice.call(document.getElementsByTagName("script")).pop(); + +if (script) { + _.filename = script.src; + + if (!_.manual && !script.hasAttribute('data-manual')) { + if(document.readyState !== "loading") { + if (window.requestAnimationFrame) { + window.requestAnimationFrame(_.highlightAll); + } else { + window.setTimeout(_.highlightAll, 16); + } + } + else { + document.addEventListener('DOMContentLoaded', _.highlightAll); + } + } +} + +return _self.Prism; + +})(); + +if ('object' !== 'undefined' && module.exports) { + module.exports = Prism; +} + +// hack for components to work correctly in node.js +if (typeof commonjsGlobal !== 'undefined') { + commonjsGlobal.Prism = Prism; +} + + +/* ********************************************** + Begin prism-markup.js +********************************************** */ + +Prism.languages.markup = { + 'comment': //, + 'prolog': /<\?[\s\S]+?\?>/, + 'doctype': //i, + 'cdata': //i, + 'tag': { + pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i, + greedy: true, + inside: { + 'tag': { + pattern: /^<\/?[^\s>\/]+/i, + inside: { + 'punctuation': /^<\/?/, + 'namespace': /^[^\s>\/:]+:/ + } + }, + 'attr-value': { + pattern: /=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i, + inside: { + 'punctuation': [ + /^=/, + { + pattern: /(^|[^\\])["']/, + lookbehind: true + } + ] + } + }, + 'punctuation': /\/?>/, + 'attr-name': { + pattern: /[^\s>\/]+/, + inside: { + 'namespace': /^[^\s>\/:]+:/ + } + } + + } + }, + 'entity': /&#?[\da-z]{1,8};/i +}; + +Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] = + Prism.languages.markup['entity']; + +// Plugin to make entity title show the real entity, idea by Roman Komarov +Prism.hooks.add('wrap', function(env) { + + if (env.type === 'entity') { + env.attributes['title'] = env.content.replace(/&/, '&'); + } +}); + +Prism.languages.xml = Prism.languages.markup; +Prism.languages.html = Prism.languages.markup; +Prism.languages.mathml = Prism.languages.markup; +Prism.languages.svg = Prism.languages.markup; + + +/* ********************************************** + Begin prism-css.js +********************************************** */ + +Prism.languages.css = { + 'comment': /\/\*[\s\S]*?\*\//, + 'atrule': { + pattern: /@[\w-]+?.*?(?:;|(?=\s*\{))/i, + inside: { + 'rule': /@[\w-]+/ + // See rest below + } + }, + 'url': /url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i, + 'selector': /[^{}\s][^{};]*?(?=\s*\{)/, + 'string': { + pattern: /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true + }, + 'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i, + 'important': /\B!important\b/i, + 'function': /[-a-z0-9]+(?=\()/i, + 'punctuation': /[(){};:]/ +}; + +Prism.languages.css['atrule'].inside.rest = Prism.languages.css; + +if (Prism.languages.markup) { + Prism.languages.insertBefore('markup', 'tag', { + 'style': { + pattern: /()[\s\S]*?(?=<\/style>)/i, + lookbehind: true, + inside: Prism.languages.css, + alias: 'language-css', + greedy: true + } + }); + + Prism.languages.insertBefore('inside', 'attr-value', { + 'style-attr': { + pattern: /\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i, + inside: { + 'attr-name': { + pattern: /^\s*style/i, + inside: Prism.languages.markup.tag.inside + }, + 'punctuation': /^\s*=\s*['"]|['"]\s*$/, + 'attr-value': { + pattern: /.+/i, + inside: Prism.languages.css + } + }, + alias: 'language-css' + } + }, Prism.languages.markup.tag); +} + +/* ********************************************** + Begin prism-clike.js +********************************************** */ + +Prism.languages.clike = { + 'comment': [ + { + pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, + lookbehind: true + }, + { + pattern: /(^|[^\\:])\/\/.*/, + lookbehind: true, + greedy: true + } + ], + 'string': { + pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true + }, + 'class-name': { + pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i, + lookbehind: true, + inside: { + punctuation: /[.\\]/ + } + }, + 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/, + 'boolean': /\b(?:true|false)\b/, + 'function': /[a-z0-9_]+(?=\()/i, + 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i, + 'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/, + 'punctuation': /[{}[\];(),.:]/ +}; + + +/* ********************************************** + Begin prism-javascript.js +********************************************** */ + +Prism.languages.javascript = Prism.languages.extend('clike', { + 'keyword': /\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/, + 'number': /\b(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/, + // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444) + 'function': /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/i, + 'operator': /-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/ +}); + +Prism.languages.insertBefore('javascript', 'keyword', { + 'regex': { + pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[[^\]\r\n]+]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})\]]))/, + lookbehind: true, + greedy: true + }, + // This must be declared before keyword because we use "function" inside the look-forward + 'function-variable': { + pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=\s*(?:function\b|(?:\([^()]*\)|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i, + alias: 'function' + }, + 'constant': /\b[A-Z][A-Z\d_]*\b/ +}); + +Prism.languages.insertBefore('javascript', 'string', { + 'template-string': { + pattern: /`(?:\\[\s\S]|\${[^}]+}|[^\\`])*`/, + greedy: true, + inside: { + 'interpolation': { + pattern: /\${[^}]+}/, + inside: { + 'interpolation-punctuation': { + pattern: /^\${|}$/, + alias: 'punctuation' + }, + rest: null // See below + } + }, + 'string': /[\s\S]+/ + } + } +}); +Prism.languages.javascript['template-string'].inside['interpolation'].inside.rest = Prism.languages.javascript; + +if (Prism.languages.markup) { + Prism.languages.insertBefore('markup', 'tag', { + 'script': { + pattern: /()[\s\S]*?(?=<\/script>)/i, + lookbehind: true, + inside: Prism.languages.javascript, + alias: 'language-javascript', + greedy: true + } + }); +} + +Prism.languages.js = Prism.languages.javascript; + + +/* ********************************************** + Begin prism-file-highlight.js +********************************************** */ + +(function () { + if (typeof self === 'undefined' || !self.Prism || !self.document || !document.querySelector) { + return; + } + + self.Prism.fileHighlight = function() { + + var Extensions = { + 'js': 'javascript', + 'py': 'python', + 'rb': 'ruby', + 'ps1': 'powershell', + 'psm1': 'powershell', + 'sh': 'bash', + 'bat': 'batch', + 'h': 'c', + 'tex': 'latex' + }; + + Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) { + var src = pre.getAttribute('data-src'); + + var language, parent = pre; + var lang = /\blang(?:uage)?-([\w-]+)\b/i; + while (parent && !lang.test(parent.className)) { + parent = parent.parentNode; + } + + if (parent) { + language = (pre.className.match(lang) || [, ''])[1]; + } + + if (!language) { + var extension = (src.match(/\.(\w+)$/) || [, ''])[1]; + language = Extensions[extension] || extension; + } + + var code = document.createElement('code'); + code.className = 'language-' + language; + + pre.textContent = ''; + + code.textContent = 'Loading…'; + + pre.appendChild(code); + + var xhr = new XMLHttpRequest(); + + xhr.open('GET', src, true); + + xhr.onreadystatechange = function () { + if (xhr.readyState == 4) { + + if (xhr.status < 400 && xhr.responseText) { + code.textContent = xhr.responseText; + + Prism.highlightElement(code); + } + else if (xhr.status >= 400) { + code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText; + } + else { + code.textContent = '✖ Error: File does not exist or is empty'; + } + } + }; + + xhr.send(null); + }); + + if (Prism.plugins.toolbar) { + Prism.plugins.toolbar.registerButton('download-file', function (env) { + var pre = env.element.parentNode; + if (!pre || !/pre/i.test(pre.nodeName) || !pre.hasAttribute('data-src') || !pre.hasAttribute('data-download-link')) { + return; + } + var src = pre.getAttribute('data-src'); + var a = document.createElement('a'); + a.textContent = pre.getAttribute('data-download-link-label') || 'Download'; + a.setAttribute('download', ''); + a.href = src; + return a; + }); + } + + }; + + document.addEventListener('DOMContentLoaded', self.Prism.fileHighlight); + +})(); +}); + +/** + * Gen toc tree + * @link https://github.com/killercup/grock/blob/5280ae63e16c5739e9233d9009bc235ed7d79a50/styles/solarized/assets/js/behavior.coffee#L54-L81 + * @param {Array} toc + * @param {Number} maxLevel + * @return {Array} + */ +function genTree(toc, maxLevel) { + var headlines = []; + var last = {}; + + toc.forEach(function (headline) { + var level = headline.level || 1; + var len = level - 1; + + if (level > maxLevel) { + return + } + if (last[len]) { + last[len].children = (last[len].children || []).concat(headline); + } else { + headlines.push(headline); + } + last[level] = headline; + }); + + return headlines +} + +var cache$1 = {}; +var re = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g; + +function lower(string) { + return string.toLowerCase() +} + +function slugify(str) { + if (typeof str !== 'string') { + return '' + } + + var slug = str + .trim() + .replace(/[A-Z]+/g, lower) + .replace(/<[^>\d]+>/g, '') + .replace(re, '') + .replace(/\s/g, '-') + .replace(/-+/g, '-') + .replace(/^(\d)/, '_$1'); + var count = cache$1[slug]; + + count = hasOwn.call(cache$1, slug) ? count + 1 : 0; + cache$1[slug] = count; + + if (count) { + slug = slug + '-' + count; + } + + return slug +} + +slugify.clear = function () { + cache$1 = {}; +}; + +function replace(m, $1) { + return '' + $1 + '' +} + +function emojify(text) { + return text + .replace(/<(pre|template|code)[^>]*?>[\s\S]+?<\/(pre|template|code)>/g, function (m) { return m.replace(/:/g, '__colon__'); }) + .replace(/:(\w+?):/ig, (inBrowser && window.emojify) || replace) + .replace(/__colon__/g, ':') +} + +var decode = decodeURIComponent; +var encode = encodeURIComponent; + +function parseQuery(query) { + var res = {}; + + query = query.trim().replace(/^(\?|#|&)/, ''); + + if (!query) { + return res + } + + // Simple parse + query.split('&').forEach(function (param) { + var parts = param.replace(/\+/g, ' ').split('='); + + res[parts[0]] = parts[1] && decode(parts[1]); + }); + + return res +} + +function stringifyQuery(obj, ignores) { + if ( ignores === void 0 ) ignores = []; + + var qs = []; + + for (var key in obj) { + if (ignores.indexOf(key) > -1) { + continue + } + qs.push( + obj[key] ? + ((encode(key)) + "=" + (encode(obj[key]))).toLowerCase() : + encode(key) + ); + } + + return qs.length ? ("?" + (qs.join('&'))) : '' +} + +var isAbsolutePath = cached(function (path) { + return /(:|(\/{2}))/g.test(path) +}); + +var getParentPath = cached(function (path) { + return /\/$/g.test(path) ? + path : + (path = path.match(/(\S*\/)[^/]+$/)) ? path[1] : '' +}); + +var cleanPath = cached(function (path) { + return path.replace(/^\/+/, '/').replace(/([^:])\/{2,}/g, '$1/') +}); + +var resolvePath = cached(function (path) { + var segments = path.replace(/^\//, '').split('/'); + var resolved = []; + for (var i = 0, len = segments.length; i < len; i++) { + var segment = segments[i]; + if (segment === '..') { + resolved.pop(); + } else if (segment !== '.') { + resolved.push(segment); + } + } + return '/' + resolved.join('/') +}); + +function getPath() { + var args = [], len = arguments.length; + while ( len-- ) args[ len ] = arguments[ len ]; + + return cleanPath(args.join('/')) +} + +var replaceSlug = cached(function (path) { + return path.replace('#', '?id=') +}); + +Prism.languages['markup-templating'] = {}; + +Object.defineProperties(Prism.languages['markup-templating'], { + buildPlaceholders: { + // Tokenize all inline templating expressions matching placeholderPattern + // If the replaceFilter function is provided, it will be called with every match. + // If it returns false, the match will not be replaced. + value: function (env, language, placeholderPattern, replaceFilter) { + if (env.language !== language) { + return; + } + + env.tokenStack = []; + + env.code = env.code.replace(placeholderPattern, function(match) { + if (typeof replaceFilter === 'function' && !replaceFilter(match)) { + return match; + } + var i = env.tokenStack.length; + // Check for existing strings + while (env.code.indexOf('___' + language.toUpperCase() + i + '___') !== -1) + { ++i; } + + // Create a sparse array + env.tokenStack[i] = match; + + return '___' + language.toUpperCase() + i + '___'; + }); + + // Switch the grammar to markup + env.grammar = Prism.languages.markup; + } + }, + tokenizePlaceholders: { + // Replace placeholders with proper tokens after tokenizing + value: function (env, language) { + if (env.language !== language || !env.tokenStack) { + return; + } + + // Switch the grammar back + env.grammar = Prism.languages[language]; + + var j = 0; + var keys = Object.keys(env.tokenStack); + var walkTokens = function (tokens) { + if (j >= keys.length) { + return; + } + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + if (typeof token === 'string' || (token.content && typeof token.content === 'string')) { + var k = keys[j]; + var t = env.tokenStack[k]; + var s = typeof token === 'string' ? token : token.content; + + var index = s.indexOf('___' + language.toUpperCase() + k + '___'); + if (index > -1) { + ++j; + var before = s.substring(0, index); + var middle = new Prism.Token(language, Prism.tokenize(t, env.grammar, language), 'language-' + language, t); + var after = s.substring(index + ('___' + language.toUpperCase() + k + '___').length); + var replacement; + if (before || after) { + replacement = [before, middle, after].filter(function (v) { return !!v; }); + walkTokens(replacement); + } else { + replacement = middle; + } + if (typeof token === 'string') { + Array.prototype.splice.apply(tokens, [i, 1].concat(replacement)); + } else { + token.content = replacement; + } + + if (j >= keys.length) { + break; + } + } + } else if (token.content && typeof token.content !== 'string') { + walkTokens(token.content); + } + } + }; + + walkTokens(env.tokens); + } + } +}); + +// See https://github.com/PrismJS/prism/pull/1367 +var cachedLinks = {}; + +function getAndRemoveConfig(str) { + if ( str === void 0 ) str = ''; + + var config = {}; + + if (str) { + str = str + .replace(/^'/, '') + .replace(/'$/, '') + .replace(/(?:^|\s):([\w-]+)=?([\w-]+)?/g, function (m, key, value) { + config[key] = (value && value.replace(/"/g, '')) || true; + return '' + }) + .trim(); + } + + return {str: str, config: config} +} + +var compileMedia = { + markdown: function markdown(url) { + return { + url: url + } + }, + mermaid: function mermaid(url) { + return { + url: url + } + }, + iframe: function iframe(url, title) { + return { + html: ("") + } + }, + video: function video(url, title) { + return { + html: ("") + } + }, + audio: function audio(url, title) { + return { + html: ("") + } + }, + code: function code(url, title) { + var lang = url.match(/\.(\w+)$/); + + lang = title || (lang && lang[1]); + if (lang === 'md') { + lang = 'markdown'; + } + + return { + url: url, + lang: lang + } + } +}; + +var Compiler = function Compiler(config, router) { + var this$1 = this; + + this.config = config; + this.router = router; + this.cacheTree = {}; + this.toc = []; + this.cacheTOC = {}; + this.linkTarget = config.externalLinkTarget || '_blank'; + this.contentBase = router.getBasePath(); + + var renderer = this._initRenderer(); + var compile; + var mdConf = config.markdown || {}; + + if (isFn(mdConf)) { + compile = mdConf(marked, renderer); + } else { + marked.setOptions( + merge(mdConf, { + renderer: merge(renderer, mdConf.renderer) + }) + ); + compile = marked; + } + + this._marked = compile; + this.compile = function (text) { + var isCached = true; + var result = cached(function (_) { + isCached = false; + var html = ''; + + if (!text) { + return text + } + + if (isPrimitive(text)) { + html = compile(text); + } else { + html = compile.parser(text); + } + + html = config.noEmoji ? html : emojify(html); + slugify.clear(); + + return html + })(text); + + var curFileName = this$1.router.parse().file; + + if (isCached) { + this$1.toc = this$1.cacheTOC[curFileName]; + } else { + this$1.cacheTOC[curFileName] = [].concat( this$1.toc ); + } + + return result + }; +}; + +Compiler.prototype.compileEmbed = function compileEmbed (href, title) { + var ref = getAndRemoveConfig(title); + var str = ref.str; + var config = ref.config; + var embed; + title = str; + + if (config.include) { + if (!isAbsolutePath(href)) { + href = getPath( + this.contentBase, + getParentPath(this.router.getCurrentPath()), + href + ); + } + + var media; + if (config.type && (media = compileMedia[config.type])) { + embed = media.call(this, href, title); + embed.type = config.type; + } else { + var type = 'code'; + if (/\.(md|markdown)/.test(href)) { + type = 'markdown'; + } else if (/\.mmd/.test(href)) { + type = 'mermaid'; + } else if (/\.html?/.test(href)) { + type = 'iframe'; + } else if (/\.(mp4|ogg)/.test(href)) { + type = 'video'; + } else if (/\.mp3/.test(href)) { + type = 'audio'; + } + embed = compileMedia[type].call(this, href, title); + embed.type = type; + } + embed.fragment = config.fragment; + + return embed + } +}; + +Compiler.prototype._matchNotCompileLink = function _matchNotCompileLink (link) { + var links = this.config.noCompileLinks || []; + + for (var i = 0; i < links.length; i++) { + var n = links[i]; + var re = cachedLinks[n] || (cachedLinks[n] = new RegExp(("^" + n + "$"))); + + if (re.test(link)) { + return link + } + } +}; + +Compiler.prototype._initRenderer = function _initRenderer () { + var renderer = new marked.Renderer(); + var ref = this; + var linkTarget = ref.linkTarget; + var router = ref.router; + var contentBase = ref.contentBase; + var _self = this; + var origin = {}; + + /** + * Render anchor tag + * @link https://github.com/markedjs/marked#overriding-renderer-methods + */ + origin.heading = renderer.heading = function (text, level) { + var ref = getAndRemoveConfig(text); + var str = ref.str; + var config = ref.config; + var nextToc = {level: level, title: str}; + + if (/{docsify-ignore}/g.test(str)) { + str = str.replace('{docsify-ignore}', ''); + nextToc.title = str; + nextToc.ignoreSubHeading = true; + } + + if (/{docsify-ignore-all}/g.test(str)) { + str = str.replace('{docsify-ignore-all}', ''); + nextToc.title = str; + nextToc.ignoreAllSubs = true; + } + + var slug = slugify(config.id || str); + var url = router.toURL(router.getCurrentPath(), {id: slug}); + nextToc.slug = url; + _self.toc.push(nextToc); + + return ("
    " + str + "") + }; + // Highlight code + origin.code = renderer.code = function (code, lang) { + if ( lang === void 0 ) lang = ''; + + code = code.replace(/@DOCSIFY_QM@/g, '`'); + var hl = prism.highlight( + code, + prism.languages[lang] || prism.languages.markup + ); + + return ("
    " + hl + "
    ") + }; + origin.link = renderer.link = function (href, title, text) { + if ( title === void 0 ) title = ''; + + var attrs = ''; + + var ref = getAndRemoveConfig(title); + var str = ref.str; + var config = ref.config; + title = str; + + if ( + !isAbsolutePath(href) && + !_self._matchNotCompileLink(href) && + !config.ignore + ) { + if (href === _self.config.homepage) { + href = 'README'; + } + href = router.toURL(href, null, router.getCurrentPath()); + } else { + attrs += href.indexOf('mailto:') === 0 ? '' : (" target=\"" + linkTarget + "\""); + } + + if (config.target) { + attrs += ' target=' + config.target; + } + + if (config.disabled) { + attrs += ' disabled'; + href = 'javascript:void(0)'; + } + + if (title) { + attrs += " title=\"" + title + "\""; + } + + return ("" + text + "") + }; + origin.paragraph = renderer.paragraph = function (text) { + var result; + if (/^!>/.test(text)) { + result = helper('tip', text); + } else if (/^\?>/.test(text)) { + result = helper('warn', text); + } else { + result = "

    " + text + "

    "; + } + return result + }; + origin.image = renderer.image = function (href, title, text) { + var url = href; + var attrs = ''; + + var ref = getAndRemoveConfig(title); + var str = ref.str; + var config = ref.config; + title = str; + + if (config['no-zoom']) { + attrs += ' data-no-zoom'; + } + + if (title) { + attrs += " title=\"" + title + "\""; + } + + var size = config.size; + if (size) { + var sizes = size.split('x'); + if (sizes[1]) { + attrs += 'width=' + sizes[0] + ' height=' + sizes[1]; + } else { + attrs += 'width=' + sizes[0]; + } + } + + if (!isAbsolutePath(href)) { + url = getPath(contentBase, getParentPath(router.getCurrentPath()), href); + } + + return ("\""") + }; + origin.list = renderer.list = function (body, ordered, start) { + var isTaskList = /
  • /.test(body.split('class="task-list"')[0]); + var isStartReq = start && start > 1; + var tag = ordered ? 'ol' : 'ul'; + var tagAttrs = [ + (isTaskList ? 'class="task-list"' : ''), + (isStartReq ? ("start=\"" + start + "\"") : '') + ].join(' ').trim(); + + return ("<" + tag + " " + tagAttrs + ">" + body + "") + }; + origin.listitem = renderer.listitem = function (text) { + var isTaskItem = /^(]*>)/.test(text); + var html = isTaskItem ? ("
  • ") : ("
  • " + text + "
  • "); + + return html + }; + + renderer.origin = origin; + + return renderer +}; + +/** + * Compile sidebar + */ +Compiler.prototype.sidebar = function sidebar (text, level) { + var currentPath = this.router.getCurrentPath(); + var html = ''; + + if (text) { + html = this.compile(text); + } else { + var tree$$1 = this.cacheTree[currentPath] || genTree(this.toc, level); + html = tree(tree$$1, '
      {inner}
    '); + this.cacheTree[currentPath] = tree$$1; + } + + return html +}; + +/** + * Compile sub sidebar + */ +Compiler.prototype.subSidebar = function subSidebar (level) { + if (!level) { + this.toc = []; + return + } + var currentPath = this.router.getCurrentPath(); + var ref = this; + var cacheTree = ref.cacheTree; + var toc = ref.toc; + + toc[0] && toc[0].ignoreAllSubs && toc.splice(0); + toc[0] && toc[0].level === 1 && toc.shift(); + + for (var i = 0; i < toc.length; i++) { + toc[i].ignoreSubHeading && toc.splice(i, 1) && i--; + } + + var tree$$1 = cacheTree[currentPath] || genTree(toc, level); + + cacheTree[currentPath] = tree$$1; + this.toc = []; + return tree(tree$$1) +}; + +Compiler.prototype.article = function article (text) { + return this.compile(text) +}; + +/** + * Compile cover page + */ +Compiler.prototype.cover = function cover$$1 (text) { + var cacheToc = this.toc.slice(); + var html = this.compile(text); + + this.toc = cacheToc.slice(); + + return html +}; + +var title = $.title; +/** + * Toggle button + */ +function btn(el) { + var toggle = function (_) { return body.classList.toggle('close'); }; + + el = getNode(el); + if (el == null) { + return + } + on(el, 'click', function (e) { + e.stopPropagation(); + toggle(); + }); + + isMobile && + on( + body, + 'click', + function (_) { return body.classList.contains('close') && toggle(); } + ); +} + +function collapse(el) { + el = getNode(el); + if (el == null) { + return + } + on(el, 'click', function (ref) { + var target = ref.target; + + if ( + target.nodeName === 'A' && + target.nextSibling && + target.nextSibling.classList.contains('app-sub-sidebar') + ) { + toggleClass(target.parentNode, 'collapse'); + } + }); +} + +function sticky() { + var cover = getNode('section.cover'); + if (!cover) { + return + } + var coverHeight = cover.getBoundingClientRect().height; + + if (window.pageYOffset >= coverHeight || cover.classList.contains('hidden')) { + toggleClass(body, 'add', 'sticky'); + } else { + toggleClass(body, 'remove', 'sticky'); + } +} + +/** + * Get and active link + * @param {object} router + * @param {string|element} el + * @param {Boolean} isParent acitve parent + * @param {Boolean} autoTitle auto set title + * @return {element} + */ +function getAndActive(router, el, isParent, autoTitle) { + el = getNode(el); + var links = []; + if (el != null) { + links = findAll(el, 'a'); + } + var hash = decodeURI(router.toURL(router.getCurrentPath())); + var target; + + links.sort(function (a, b) { return b.href.length - a.href.length; }).forEach(function (a) { + var href = a.getAttribute('href'); + var node = isParent ? a.parentNode : a; + + if (hash.indexOf(href) === 0 && !target) { + target = a; + toggleClass(node, 'add', 'active'); + } else { + toggleClass(node, 'remove', 'active'); + } + }); + + if (autoTitle) { + $.title = target ? (target.title || ((target.innerText) + " - " + title)) : title; + } + + return target +} + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true; } Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps); } if (staticProps) { defineProperties(Constructor, staticProps); } return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Tweezer = function () { + function Tweezer() { + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + _classCallCheck(this, Tweezer); + + this.duration = opts.duration || 1000; + this.ease = opts.easing || this._defaultEase; + this.start = opts.start; + this.end = opts.end; + + this.frame = null; + this.next = null; + this.isRunning = false; + this.events = {}; + this.direction = this.start < this.end ? 'up' : 'down'; + } + + _createClass(Tweezer, [{ + key: 'begin', + value: function begin() { + if (!this.isRunning && this.next !== this.end) { + this.frame = window.requestAnimationFrame(this._tick.bind(this)); + } + return this; + } + }, { + key: 'stop', + value: function stop() { + window.cancelAnimationFrame(this.frame); + this.isRunning = false; + this.frame = null; + this.timeStart = null; + this.next = null; + return this; + } + }, { + key: 'on', + value: function on(name, handler) { + this.events[name] = this.events[name] || []; + this.events[name].push(handler); + return this; + } + }, { + key: 'emit', + value: function emit(name, val) { + var _this = this; + + var e = this.events[name]; + e && e.forEach(function (handler) { + return handler.call(_this, val); + }); + } + }, { + key: '_tick', + value: function _tick(currentTime) { + this.isRunning = true; + + var lastTick = this.next || this.start; + + if (!this.timeStart) { this.timeStart = currentTime; } + this.timeElapsed = currentTime - this.timeStart; + this.next = Math.round(this.ease(this.timeElapsed, this.start, this.end - this.start, this.duration)); + + if (this._shouldTick(lastTick)) { + this.emit('tick', this.next); + this.frame = window.requestAnimationFrame(this._tick.bind(this)); + } else { + this.emit('tick', this.end); + this.emit('done', null); + } + } + }, { + key: '_shouldTick', + value: function _shouldTick(lastTick) { + return { + up: this.next < this.end && lastTick <= this.next, + down: this.next > this.end && lastTick >= this.next + }[this.direction]; + } + }, { + key: '_defaultEase', + value: function _defaultEase(t, b, c, d) { + if ((t /= d / 2) < 1) { return c / 2 * t * t + b; } + return -c / 2 * (--t * (t - 2) - 1) + b; + } + }]); + + return Tweezer; +}(); + +var nav = {}; +var hoverOver = false; +var scroller = null; +var enableScrollEvent = true; +var coverHeight = 0; + +function scrollTo(el) { + if (scroller) { + scroller.stop(); + } + enableScrollEvent = false; + scroller = new Tweezer({ + start: window.pageYOffset, + end: el.getBoundingClientRect().top + window.pageYOffset, + duration: 500 + }) + .on('tick', function (v) { return window.scrollTo(0, v); }) + .on('done', function () { + enableScrollEvent = true; + scroller = null; + }) + .begin(); +} + +function highlight(path) { + if (!enableScrollEvent) { + return + } + var sidebar = getNode('.sidebar'); + var anchors = findAll('.anchor'); + var wrap = find(sidebar, '.sidebar-nav'); + var active = find(sidebar, 'li.active'); + var doc = document.documentElement; + var top = ((doc && doc.scrollTop) || document.body.scrollTop) - coverHeight; + var last; + + for (var i = 0, len = anchors.length; i < len; i += 1) { + var node = anchors[i]; + + if (node.offsetTop > top) { + if (!last) { + last = node; + } + break + } else { + last = node; + } + } + if (!last) { + return + } + var li = nav[getNavKey(decodeURIComponent(path), last.getAttribute('data-id'))]; + + if (!li || li === active) { + return + } + + active && active.classList.remove('active'); + li.classList.add('active'); + active = li; + + // Scroll into view + // https://github.com/vuejs/vuejs.org/blob/master/themes/vue/source/js/common.js#L282-L297 + if (!hoverOver && body.classList.contains('sticky')) { + var height = sidebar.clientHeight; + var curOffset = 0; + var cur = active.offsetTop + active.clientHeight + 40; + var isInView = + active.offsetTop >= wrap.scrollTop && cur <= wrap.scrollTop + height; + var notThan = cur - curOffset < height; + var top$1 = isInView ? wrap.scrollTop : notThan ? curOffset : cur - height; + + sidebar.scrollTop = top$1; + } +} + +function getNavKey(path, id) { + return (path + "?id=" + id) +} + +function scrollActiveSidebar(router) { + var cover = find('.cover.show'); + coverHeight = cover ? cover.offsetHeight : 0; + + var sidebar = getNode('.sidebar'); + var lis = []; + if (sidebar != null) { + lis = findAll(sidebar, 'li'); + } + + for (var i = 0, len = lis.length; i < len; i += 1) { + var li = lis[i]; + var a = li.querySelector('a'); + if (!a) { + continue + } + var href = a.getAttribute('href'); + + if (href !== '/') { + var ref = router.parse(href); + var id = ref.query.id; + var path$1 = ref.path; + if (id) { + href = getNavKey(path$1, id); + } + } + + if (href) { + nav[decodeURIComponent(href)] = li; + } + } + + if (isMobile) { + return + } + var path = router.getCurrentPath(); + off('scroll', function () { return highlight(path); }); + on('scroll', function () { return highlight(path); }); + on(sidebar, 'mouseover', function () { + hoverOver = true; + }); + on(sidebar, 'mouseleave', function () { + hoverOver = false; + }); +} + +function scrollIntoView(path, id) { + if (!id) { + return + } + + var section = find('#' + id); + section && scrollTo(section); + + var li = nav[getNavKey(path, id)]; + var sidebar = getNode('.sidebar'); + var active = find(sidebar, 'li.active'); + active && active.classList.remove('active'); + li && li.classList.add('active'); +} + +var scrollEl = $.scrollingElement || $.documentElement; + +function scroll2Top(offset) { + if ( offset === void 0 ) offset = 0; + + scrollEl.scrollTop = offset === true ? 0 : Number(offset); +} + +var cached$1 = {}; + +function walkFetchEmbed(ref, cb) { + var embedTokens = ref.embedTokens; + var compile = ref.compile; + var fetch = ref.fetch; + + var token; + var step = 0; + var count = 1; + + if (!embedTokens.length) { + return cb({}) + } + + while ((token = embedTokens[step++])) { + var next = (function (token) { + return function (text) { + var embedToken; + if (text) { + if (token.embed.type === 'markdown') { + embedToken = compile.lexer(text); + } else if (token.embed.type === 'code') { + if (token.embed.fragment) { + var fragment = token.embed.fragment; + var pattern = new RegExp(("(?:###|\\/\\/\\/)\\s*\\[" + fragment + "\\]([\\s\\S]*)(?:###|\\/\\/\\/)\\s*\\[" + fragment + "\\]")); + text = ((text.match(pattern) || [])[1] || '').trim(); + } + embedToken = compile.lexer( + '```' + + token.embed.lang + + '\n' + + text.replace(/`/g, '@DOCSIFY_QM@') + + '\n```\n' + ); + } else if (token.embed.type === 'mermaid') { + embedToken = [ + {type: 'html', text: ("
    \n" + text + "\n
    ")} + ]; + embedToken.links = {}; + } else { + embedToken = [{type: 'html', text: text}]; + embedToken.links = {}; + } + } + cb({token: token, embedToken: embedToken}); + if (++count >= step) { + cb({}); + } + } + })(token); + + if (token.embed.url) { + { + get(token.embed.url).then(next); + } + } else { + next(token.embed.html); + } + } +} + +function prerenderEmbed(ref, done) { + var compiler = ref.compiler; + var raw = ref.raw; if ( raw === void 0 ) raw = ''; + var fetch = ref.fetch; + + var hit = cached$1[raw]; + if (hit) { + var copy = hit.slice(); + copy.links = hit.links; + return done(copy) + } + + var compile = compiler._marked; + var tokens = compile.lexer(raw); + var embedTokens = []; + var linkRE = compile.InlineLexer.rules.link; + var links = tokens.links; + + tokens.forEach(function (token, index) { + if (token.type === 'paragraph') { + token.text = token.text.replace( + new RegExp(linkRE.source, 'g'), + function (src, filename, href, title) { + var embed = compiler.compileEmbed(href, title); + + if (embed) { + embedTokens.push({ + index: index, + embed: embed + }); + } + + return src + } + ); + } + }); + + var moveIndex = 0; + walkFetchEmbed({compile: compile, embedTokens: embedTokens, fetch: fetch}, function (ref) { + var embedToken = ref.embedToken; + var token = ref.token; + + if (token) { + var index = token.index + moveIndex; + + merge(links, embedToken.links); + + tokens = tokens + .slice(0, index) + .concat(embedToken, tokens.slice(index + 1)); + moveIndex += embedToken.length - 1; + } else { + cached$1[raw] = tokens.concat(); + tokens.links = cached$1[raw].links = links; + done(tokens); + } + }); +} + +function executeScript() { + var script = findAll('.markdown-section>script') + .filter(function (s) { return !/template/.test(s.type); })[0]; + if (!script) { + return false + } + var code = script.innerText.trim(); + if (!code) { + return false + } + + setTimeout(function (_) { + window.__EXECUTE_RESULT__ = new Function(code)(); + }, 0); +} + +function formatUpdated(html, updated, fn) { + updated = + typeof fn === 'function' ? + fn(updated) : + typeof fn === 'string' ? + tinydate(fn)(new Date(updated)) : + updated; + + return html.replace(/{docsify-updated}/g, updated) +} + +function renderMain(html) { + if (!html) { + html = '

    404 - Not found

    '; + } + + this._renderTo('.markdown-section', html); + // Render sidebar with the TOC + !this.config.loadSidebar && this._renderSidebar(); + + // Execute script + if ( + this.config.executeScript !== false && + typeof window.Vue !== 'undefined' && + !executeScript() + ) { + setTimeout(function (_) { + var vueVM = window.__EXECUTE_RESULT__; + vueVM && vueVM.$destroy && vueVM.$destroy(); + window.__EXECUTE_RESULT__ = new window.Vue().$mount('#main'); + }, 0); + } else { + this.config.executeScript && executeScript(); + } +} + +function renderNameLink(vm) { + var el = getNode('.app-name-link'); + var nameLink = vm.config.nameLink; + var path = vm.route.path; + + if (!el) { + return + } + + if (isPrimitive(vm.config.nameLink)) { + el.setAttribute('href', nameLink); + } else if (typeof nameLink === 'object') { + var match = Object.keys(nameLink).filter(function (key) { return path.indexOf(key) > -1; })[0]; + + el.setAttribute('href', nameLink[match]); + } +} + +function renderMixin(proto) { + proto._renderTo = function (el, content, replace) { + var node = getNode(el); + if (node) { + node[replace ? 'outerHTML' : 'innerHTML'] = content; + } + }; + + proto._renderSidebar = function (text) { + var ref = this.config; + var maxLevel = ref.maxLevel; + var subMaxLevel = ref.subMaxLevel; + var loadSidebar = ref.loadSidebar; + + this._renderTo('.sidebar-nav', this.compiler.sidebar(text, maxLevel)); + var activeEl = getAndActive(this.router, '.sidebar-nav', true, true); + if (loadSidebar && activeEl) { + activeEl.parentNode.innerHTML += + this.compiler.subSidebar(subMaxLevel) || ''; + } else { + // Reset toc + this.compiler.subSidebar(); + } + // Bind event + this._bindEventOnRendered(activeEl); + }; + + proto._bindEventOnRendered = function (activeEl) { + var ref = this.config; + var autoHeader = ref.autoHeader; + var auto2top = ref.auto2top; + + scrollActiveSidebar(this.router); + + if (autoHeader && activeEl) { + var main$$1 = getNode('#main'); + var firstNode = main$$1.children[0]; + if (firstNode && firstNode.tagName !== 'H1') { + var h1 = create('h1'); + h1.innerText = activeEl.innerText; + before(main$$1, h1); + } + } + + auto2top && scroll2Top(auto2top); + }; + + proto._renderNav = function (text) { + text && this._renderTo('nav', this.compiler.compile(text)); + if (this.config.loadNavbar) { + getAndActive(this.router, 'nav'); + } + }; + + proto._renderMain = function (text, opt, next) { + var this$1 = this; + if ( opt === void 0 ) opt = {}; + + if (!text) { + return renderMain.call(this, text) + } + + callHook(this, 'beforeEach', text, function (result) { + var html; + var callback = function () { + if (opt.updatedAt) { + html = formatUpdated(html, opt.updatedAt, this$1.config.formatUpdated); + } + + callHook(this$1, 'afterEach', html, function (text) { return renderMain.call(this$1, text); }); + }; + if (this$1.isHTML) { + html = this$1.result = text; + callback(); + next(); + } else { + prerenderEmbed( + { + compiler: this$1.compiler, + raw: result + }, + function (tokens) { + html = this$1.compiler.compile(tokens); + callback(); + next(); + } + ); + } + }); + }; + + proto._renderCover = function (text, coverOnly) { + var el = getNode('.cover'); + + toggleClass(getNode('main'), coverOnly ? 'add' : 'remove', 'hidden'); + if (!text) { + toggleClass(el, 'remove', 'show'); + return + } + toggleClass(el, 'add', 'show'); + + var html = this.coverIsHTML ? text : this.compiler.cover(text); + + var m = html + .trim() + .match('

    ([^<]*?)

    $'); + + if (m) { + if (m[2] === 'color') { + el.style.background = m[1] + (m[3] || ''); + } else { + var path = m[1]; + + toggleClass(el, 'add', 'has-mask'); + if (!isAbsolutePath(m[1])) { + path = getPath(this.router.getBasePath(), m[1]); + } + el.style.backgroundImage = "url(" + path + ")"; + el.style.backgroundSize = 'cover'; + el.style.backgroundPosition = 'center center'; + } + html = html.replace(m[0], ''); + } + + this._renderTo('.cover-main', html); + sticky(); + }; + + proto._updateRender = function () { + // Render name link + renderNameLink(this); + }; +} + +function initRender(vm) { + var config = vm.config; + + // Init markdown compiler + vm.compiler = new Compiler(config, vm.router); + if (inBrowser) { + window.__current_docsify_compiler__ = vm.compiler; + } + + var id = config.el || '#app'; + var navEl = find('nav') || create('nav'); + + var el = find(id); + var html = ''; + var navAppendToTarget = body; + + if (el) { + if (config.repo) { + html += corner(config.repo); + } + if (config.coverpage) { + html += cover(); + } + + if (config.logo) { + var isBase64 = /^data:image/.test(config.logo); + var isExternal = /(?:http[s]?:)?\/\//.test(config.logo); + var isRelative = /^\./.test(config.logo); + + if (!isBase64 && !isExternal && !isRelative) { + config.logo = getPath(vm.router.getBasePath(), config.logo); + } + } + + html += main(config); + // Render main app + vm._renderTo(el, html, true); + } else { + vm.rendered = true; + } + + if (config.mergeNavbar && isMobile) { + navAppendToTarget = find('.sidebar'); + } else { + navEl.classList.add('app-nav'); + + if (!config.repo) { + navEl.classList.add('no-badge'); + } + } + + // Add nav + if (config.loadNavbar) { + before(navAppendToTarget, navEl); + } + + if (config.themeColor) { + $.head.appendChild( + create('div', theme(config.themeColor)).firstElementChild + ); + // Polyfll + cssVars(config.themeColor); + } + vm._updateRender(); + toggleClass(body, 'ready'); +} + +var cached$2 = {}; + +function getAlias(path, alias, last) { + var match = Object.keys(alias).filter(function (key) { + var re = cached$2[key] || (cached$2[key] = new RegExp(("^" + key + "$"))); + return re.test(path) && path !== last + })[0]; + + return match ? + getAlias(path.replace(cached$2[match], alias[match]), alias, path) : + path +} + +function getFileName(path, ext) { + return new RegExp(("\\.(" + (ext.replace(/^\./, '')) + "|html)$"), 'g').test(path) ? + path : + /\/$/g.test(path) ? (path + "README" + ext) : ("" + path + ext) +} + +var History = function History(config) { + this.config = config; +}; + +History.prototype.getBasePath = function getBasePath () { + return this.config.basePath +}; + +History.prototype.getFile = function getFile (path, isRelative) { + if ( path === void 0 ) path = this.getCurrentPath(); + + var ref = this; + var config = ref.config; + var base = this.getBasePath(); + var ext = typeof config.ext === 'string' ? config.ext : '.md'; + + path = config.alias ? getAlias(path, config.alias) : path; + path = getFileName(path, ext); + path = path === ("/README" + ext) ? config.homepage || path : path; + path = isAbsolutePath(path) ? path : getPath(base, path); + + if (isRelative) { + path = path.replace(new RegExp(("^" + base)), ''); + } + + return path +}; + +History.prototype.onchange = function onchange (cb) { + if ( cb === void 0 ) cb = noop; + + cb(); +}; + +History.prototype.getCurrentPath = function getCurrentPath () {}; + +History.prototype.normalize = function normalize () {}; + +History.prototype.parse = function parse () {}; + +History.prototype.toURL = function toURL (path, params, currentRoute) { + var local = currentRoute && path[0] === '#'; + var route = this.parse(replaceSlug(path)); + + route.query = merge({}, route.query, params); + path = route.path + stringifyQuery(route.query); + path = path.replace(/\.md(\?)|\.md$/, '$1'); + + if (local) { + var idIndex = currentRoute.indexOf('?'); + path = + (idIndex > 0 ? currentRoute.substring(0, idIndex) : currentRoute) + path; + } + + if (this.config.relativePath && path.indexOf('/') !== 0) { + var currentDir = currentRoute.substring(0, currentRoute.lastIndexOf('/') + 1); + return cleanPath(resolvePath(currentDir + path)) + } + return cleanPath('/' + path) +}; + +function replaceHash(path) { + var i = location.href.indexOf('#'); + location.replace(location.href.slice(0, i >= 0 ? i : 0) + '#' + path); +} + +var HashHistory = (function (History$$1) { + function HashHistory(config) { + History$$1.call(this, config); + this.mode = 'hash'; + } + + if ( History$$1 ) HashHistory.__proto__ = History$$1; + HashHistory.prototype = Object.create( History$$1 && History$$1.prototype ); + HashHistory.prototype.constructor = HashHistory; + + HashHistory.prototype.getBasePath = function getBasePath () { + var path = window.location.pathname || ''; + var base = this.config.basePath; + + return /^(\/|https?:)/g.test(base) ? base : cleanPath(path + '/' + base) + }; + + HashHistory.prototype.getCurrentPath = function getCurrentPath () { + // We can't use location.hash here because it's not + // consistent across browsers - Firefox will pre-decode it! + var href = location.href; + var index = href.indexOf('#'); + return index === -1 ? '' : href.slice(index + 1) + }; + + HashHistory.prototype.onchange = function onchange (cb) { + if ( cb === void 0 ) cb = noop; + + on('hashchange', cb); + }; + + HashHistory.prototype.normalize = function normalize () { + var path = this.getCurrentPath(); + + path = replaceSlug(path); + + if (path.charAt(0) === '/') { + return replaceHash(path) + } + replaceHash('/' + path); + }; + + /** + * Parse the url + * @param {string} [path=location.herf] + * @return {object} { path, query } + */ + HashHistory.prototype.parse = function parse (path) { + if ( path === void 0 ) path = location.href; + + var query = ''; + + var hashIndex = path.indexOf('#'); + if (hashIndex >= 0) { + path = path.slice(hashIndex + 1); + } + + var queryIndex = path.indexOf('?'); + if (queryIndex >= 0) { + query = path.slice(queryIndex + 1); + path = path.slice(0, queryIndex); + } + + return { + path: path, + file: this.getFile(path, true), + query: parseQuery(query) + } + }; + + HashHistory.prototype.toURL = function toURL (path, params, currentRoute) { + return '#' + History$$1.prototype.toURL.call(this, path, params, currentRoute) + }; + + return HashHistory; +}(History)); + +var HTML5History = (function (History$$1) { + function HTML5History(config) { + History$$1.call(this, config); + this.mode = 'history'; + } + + if ( History$$1 ) HTML5History.__proto__ = History$$1; + HTML5History.prototype = Object.create( History$$1 && History$$1.prototype ); + HTML5History.prototype.constructor = HTML5History; + + HTML5History.prototype.getCurrentPath = function getCurrentPath () { + var base = this.getBasePath(); + var path = window.location.pathname; + + if (base && path.indexOf(base) === 0) { + path = path.slice(base.length); + } + + return (path || '/') + window.location.search + window.location.hash + }; + + HTML5History.prototype.onchange = function onchange (cb) { + if ( cb === void 0 ) cb = noop; + + on('click', function (e) { + var el = e.target.tagName === 'A' ? e.target : e.target.parentNode; + + if (el.tagName === 'A' && !/_blank/.test(el.target)) { + e.preventDefault(); + var url = el.href; + window.history.pushState({key: url}, '', url); + cb(); + } + }); + + on('popstate', cb); + }; + + /** + * Parse the url + * @param {string} [path=location.href] + * @return {object} { path, query } + */ + HTML5History.prototype.parse = function parse (path) { + if ( path === void 0 ) path = location.href; + + var query = ''; + + var queryIndex = path.indexOf('?'); + if (queryIndex >= 0) { + query = path.slice(queryIndex + 1); + path = path.slice(0, queryIndex); + } + + var base = getPath(location.origin); + var baseIndex = path.indexOf(base); + + if (baseIndex > -1) { + path = path.slice(baseIndex + base.length); + } + + return { + path: path, + file: this.getFile(path), + query: parseQuery(query) + } + }; + + return HTML5History; +}(History)); + +function routerMixin(proto) { + proto.route = {}; +} + +var lastRoute = {}; + +function updateRender(vm) { + vm.router.normalize(); + vm.route = vm.router.parse(); + body.setAttribute('data-page', vm.route.file); +} + +function initRouter(vm) { + var config = vm.config; + var mode = config.routerMode || 'hash'; + var router; + + if (mode === 'history' && supportsPushState) { + router = new HTML5History(config); + } else { + router = new HashHistory(config); + } + + vm.router = router; + updateRender(vm); + lastRoute = vm.route; + + router.onchange(function (_) { + updateRender(vm); + vm._updateRender(); + + if (lastRoute.path === vm.route.path) { + vm.$resetEvents(); + return + } + + vm.$fetch(); + lastRoute = vm.route; + }); +} + +function eventMixin(proto) { + proto.$resetEvents = function () { + scrollIntoView(this.route.path, this.route.query.id); + + if (this.config.loadNavbar) { + getAndActive(this.router, 'nav'); + } + }; +} + +function initEvent(vm) { + // Bind toggle button + btn('button.sidebar-toggle', vm.router); + collapse('.sidebar', vm.router); + // Bind sticky effect + if (vm.config.coverpage) { + !isMobile && on('scroll', sticky); + } else { + body.classList.add('sticky'); + } +} + +function loadNested(path, qs, file, next, vm, first) { + path = first ? path : path.replace(/\/$/, ''); + path = getParentPath(path); + + if (!path) { + return + } + + get( + vm.router.getFile(path + file) + qs, + false, + vm.config.requestHeaders + ).then(next, function (_) { return loadNested(path, qs, file, next, vm); }); +} + +function fetchMixin(proto) { + var last; + + var abort = function () { return last && last.abort && last.abort(); }; + var request = function (url, hasbar, requestHeaders) { + abort(); + last = get(url, true, requestHeaders); + return last + }; + + var get404Path = function (path, config) { + var notFoundPage = config.notFoundPage; + var ext = config.ext; + var defaultPath = '_404' + (ext || '.md'); + var key; + var path404; + + switch (typeof notFoundPage) { + case 'boolean': + path404 = defaultPath; + break + case 'string': + path404 = notFoundPage; + break + + case 'object': + key = Object.keys(notFoundPage) + .sort(function (a, b) { return b.length - a.length; }) + .find(function (key) { return path.match(new RegExp('^' + key)); }); + + path404 = (key && notFoundPage[key]) || defaultPath; + break + + default: + break + } + + return path404 + }; + + proto._loadSideAndNav = function (path, qs, loadSidebar, cb) { + var this$1 = this; + + return function () { + if (!loadSidebar) { + return cb() + } + + var fn = function (result) { + this$1._renderSidebar(result); + cb(); + }; + + // Load sidebar + loadNested(path, qs, loadSidebar, fn, this$1, true); + } + }; + + proto._fetch = function (cb) { + var this$1 = this; + if ( cb === void 0 ) cb = noop; + + var ref = this.route; + var path = ref.path; + var query = ref.query; + var qs = stringifyQuery(query, ['id']); + var ref$1 = this.config; + var loadNavbar = ref$1.loadNavbar; + var requestHeaders = ref$1.requestHeaders; + var loadSidebar = ref$1.loadSidebar; + // Abort last request + + var file = this.router.getFile(path); + var req = request(file + qs, true, requestHeaders); + + // Current page is html + this.isHTML = /\.html$/g.test(file); + + // Load main content + req.then( + function (text, opt) { return this$1._renderMain( + text, + opt, + this$1._loadSideAndNav(path, qs, loadSidebar, cb) + ); }, + function (_) { + this$1._fetchFallbackPage(file, qs, cb) || this$1._fetch404(file, qs, cb); + } + ); + + // Load nav + loadNavbar && + loadNested( + path, + qs, + loadNavbar, + function (text) { return this$1._renderNav(text); }, + this, + true + ); + }; + + proto._fetchCover = function () { + var this$1 = this; + + var ref = this.config; + var coverpage = ref.coverpage; + var requestHeaders = ref.requestHeaders; + var query = this.route.query; + var root = getParentPath(this.route.path); + + if (coverpage) { + var path = null; + var routePath = this.route.path; + if (typeof coverpage === 'string') { + if (routePath === '/') { + path = coverpage; + } + } else if (Array.isArray(coverpage)) { + path = coverpage.indexOf(routePath) > -1 && '_coverpage'; + } else { + var cover = coverpage[routePath]; + path = cover === true ? '_coverpage' : cover; + } + + var coverOnly = Boolean(path) && this.config.onlyCover; + if (path) { + path = this.router.getFile(root + path); + this.coverIsHTML = /\.html$/g.test(path); + get(path + stringifyQuery(query, ['id']), false, requestHeaders).then( + function (text) { return this$1._renderCover(text, coverOnly); } + ); + } else { + this._renderCover(null, coverOnly); + } + return coverOnly + } + }; + + proto.$fetch = function (cb) { + var this$1 = this; + if ( cb === void 0 ) cb = noop; + + var done = function () { + callHook(this$1, 'doneEach'); + cb(); + }; + + var onlyCover = this._fetchCover(); + + if (onlyCover) { + done(); + } else { + this._fetch(function () { + this$1.$resetEvents(); + done(); + }); + } + }; + + proto._fetchFallbackPage = function (path, qs, cb) { + var this$1 = this; + if ( cb === void 0 ) cb = noop; + + var ref = this.config; + var requestHeaders = ref.requestHeaders; + var fallbackLanguages = ref.fallbackLanguages; + var loadSidebar = ref.loadSidebar; + + if (!fallbackLanguages) { + return false + } + + var local = path.split('/')[1]; + + if (fallbackLanguages.indexOf(local) === -1) { + return false + } + var newPath = path.replace(new RegExp(("^/" + local)), ''); + var req = request(newPath + qs, true, requestHeaders); + + req.then( + function (text, opt) { return this$1._renderMain( + text, + opt, + this$1._loadSideAndNav(path, qs, loadSidebar, cb) + ); }, + function () { return this$1._fetch404(path, qs, cb); } + ); + + return true + }; + /** + * Load the 404 page + * @param path + * @param qs + * @param cb + * @returns {*} + * @private + */ + proto._fetch404 = function (path, qs, cb) { + var this$1 = this; + if ( cb === void 0 ) cb = noop; + + var ref = this.config; + var loadSidebar = ref.loadSidebar; + var requestHeaders = ref.requestHeaders; + var notFoundPage = ref.notFoundPage; + + var fnLoadSideAndNav = this._loadSideAndNav(path, qs, loadSidebar, cb); + if (notFoundPage) { + var path404 = get404Path(path, this.config); + + request(this.router.getFile(path404), true, requestHeaders).then( + function (text, opt) { return this$1._renderMain(text, opt, fnLoadSideAndNav); }, + function () { return this$1._renderMain(null, {}, fnLoadSideAndNav); } + ); + return true + } + + this._renderMain(null, {}, fnLoadSideAndNav); + return false + }; +} + +function initFetch(vm) { + var ref = vm.config; + var loadSidebar = ref.loadSidebar; + + // Server-Side Rendering + if (vm.rendered) { + var activeEl = getAndActive(vm.router, '.sidebar-nav', true, true); + if (loadSidebar && activeEl) { + activeEl.parentNode.innerHTML += window.__SUB_SIDEBAR__; + } + vm._bindEventOnRendered(activeEl); + vm.$resetEvents(); + callHook(vm, 'doneEach'); + callHook(vm, 'ready'); + } else { + vm.$fetch(function (_) { return callHook(vm, 'ready'); }); + } +} + +function initMixin(proto) { + proto._init = function () { + var vm = this; + vm.config = config(); + + initLifecycle(vm); // Init hooks + initPlugin(vm); // Install plugins + callHook(vm, 'init'); + initRouter(vm); // Add router + initRender(vm); // Render base DOM + initEvent(vm); // Bind events + initFetch(vm); // Fetch data + callHook(vm, 'mounted'); + }; +} + +function initPlugin(vm) { + [].concat(vm.config.plugins).forEach(function (fn) { return isFn(fn) && fn(vm._lifecycle, vm); }); +} + + + +var util = Object.freeze({ + cached: cached, + hyphenate: hyphenate, + hasOwn: hasOwn, + merge: merge, + isPrimitive: isPrimitive, + noop: noop, + isFn: isFn, + inBrowser: inBrowser, + isMobile: isMobile, + supportsPushState: supportsPushState, + parseQuery: parseQuery, + stringifyQuery: stringifyQuery, + isAbsolutePath: isAbsolutePath, + getParentPath: getParentPath, + cleanPath: cleanPath, + resolvePath: resolvePath, + getPath: getPath, + replaceSlug: replaceSlug +}); + +function initGlobalAPI () { + window.Docsify = { + util: util, + dom: dom, + get: get, + slugify: slugify, + version: '4.9.2' + }; + window.DocsifyCompiler = Compiler; + window.marked = marked; + window.Prism = prism; +} + +/** + * Fork https://github.com/bendrucker/document-ready/blob/master/index.js + */ +function ready(callback) { + var state = document.readyState; + + if (state === 'complete' || state === 'interactive') { + return setTimeout(callback, 0) + } + + document.addEventListener('DOMContentLoaded', callback); +} + +function Docsify() { + this._init(); +} + +var proto = Docsify.prototype; + +initMixin(proto); +routerMixin(proto); +renderMixin(proto); +fetchMixin(proto); +eventMixin(proto); + +/** + * Global API + */ +initGlobalAPI(); + +/** + * Run Docsify + */ +ready(function (_) { return new Docsify(); }); + +}()); diff --git a/lib/docsify.min.js b/lib/docsify.min.js new file mode 100644 index 0000000..4f9a496 --- /dev/null +++ b/lib/docsify.min.js @@ -0,0 +1 @@ +!function(){function s(n){var r=Object.create(null);return function(e){var t=c(e)?e:JSON.stringify(e);return r[t]||(r[t]=n(e))}}var o=s(function(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),l=Object.prototype.hasOwnProperty,d=Object.assign||function(e){for(var t=arguments,n=1;n=a.length)i(r);else if("function"==typeof e)if(2===e.length)e(r,function(e){r=e,o(t+1)});else{var n=e(r);r=void 0===n?r:n,o(t+1)}else o(t+1)};o(0)}var f=!0,m=f&&document.body.clientWidth<=600,g=f&&window.history&&window.history.pushState&&window.history.replaceState&&!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/),n={};function v(e,t){if(void 0===t&&(t=!1),"string"==typeof e){if(void 0!==window.Vue)return x(e);e=t?x(e):n[e]||(n[e]=x(e))}return e}var b=f&&document,y=f&&b.body,k=f&&b.head;function x(e,t){return t?e.querySelector(t):b.querySelector(e)}function w(e,t){return[].slice.call(t?e.querySelectorAll(t):b.querySelectorAll(e))}function _(e,t){return e=b.createElement(e),t&&(e.innerHTML=t),e}function S(e,t){return e.appendChild(t)}function A(e,t){return e.insertBefore(t,e.children[0])}function C(e,t,n){u(t)?window.addEventListener(e,t):e.addEventListener(t,n)}function E(e,t,n){u(t)?window.removeEventListener(e,t):e.removeEventListener(t,n)}function $(e,t,n){e&&e.classList[n?t:"toggle"](n||t)}var L,T,e=Object.freeze({getNode:v,$:b,body:y,head:k,find:x,findAll:w,create:_,appendTo:S,before:A,on:C,off:E,toggleClass:$,style:function(e){S(k,_("style",e))}});function R(e,t){if(void 0===t&&(t='
      {inner}
    '),!e||!e.length)return"";var n="";return e.forEach(function(e){n+='
  • '+e.title+"
  • ",e.children&&(n+=R(e.children,t))}),t.replace("{inner}",n)}function r(e,t){return'

    '+t.slice(5).trim()+"

    "}function P(e){var t,n,r=e.loaded,i=e.total,a=e.step;!L&&((n=_("div")).classList.add("progress"),S(y,n),L=n),t=a?80<(t=parseInt(L.style.width||0,10)+a)?80:t:Math.floor(r/i*100),L.style.opacity=1,L.style.width=95<=t?"100%":t+"%",95<=t&&(clearTimeout(T),T=setTimeout(function(e){L.style.opacity=0,L.style.width="0%"},200))}var O={};function F(a,e,t){void 0===e&&(e=!1),void 0===t&&(t={});var o=new XMLHttpRequest,n=function(){o.addEventListener.apply(o,arguments)},r=O[a];if(r)return{then:function(e){return e(r.content,r.opt)},abort:p};for(var i in o.open("GET",a),t)l.call(t,i)&&o.setRequestHeader(i,t[i]);return o.send(),{then:function(r,i){if(void 0===i&&(i=p),e){var t=setInterval(function(e){return P({step:Math.floor(5*Math.random()+1)})},500);n("progress",P),n("loadend",function(e){P(e),clearInterval(t)})}n("error",i),n("load",function(e){var t=e.target;if(400<=t.status)i(t);else{var n=O[a]={content:t.response,opt:{updatedAt:o.getResponseHeader("last-modified")}};r(n.content,n.opt)}})},abort:function(e){return 4!==o.readyState&&o.abort()}}}function j(e,t){e.innerHTML=e.innerHTML.replace(/var\(\s*--theme-color.*?\)/g,t)}var N=/([^{]*?)\w(?=\})/g,z={YYYY:"getFullYear",YY:"getYear",MM:function(e){return e.getMonth()+1},DD:"getDate",HH:"getHours",mm:"getMinutes",ss:"getSeconds"};var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e,t){return e(t={exports:{}},t.exports),t.exports}var M=i(function(m,e){!function(e){var y={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:d,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:d,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:d,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,text:/^[^\n]+/};function l(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||f.defaults,this.rules=y.normal,this.options.pedantic?this.rules=y.pedantic:this.options.gfm&&(this.options.tables?this.rules=y.tables:this.rules=y.gfm)}y._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,y._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,y.def=t(y.def).replace("label",y._label).replace("title",y._title).getRegex(),y.bullet=/(?:[*+-]|\d+\.)/,y.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,y.item=t(y.item,"gm").replace(/bull/g,y.bullet).getRegex(),y.list=t(y.list).replace(/bull/g,y.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+y.def.source+")").getRegex(),y._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",y._comment=//,y.html=t(y.html,"i").replace("comment",y._comment).replace("tag",y._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),y.paragraph=t(y.paragraph).replace("hr",y.hr).replace("heading",y.heading).replace("lheading",y.lheading).replace("tag",y._tag).getRegex(),y.blockquote=t(y.blockquote).replace("paragraph",y.paragraph).getRegex(),y.normal=g({},y),y.gfm=g({},y.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),y.gfm.paragraph=t(y.paragraph).replace("(?!","(?!"+y.gfm.fences.source.replace("\\1","\\2")+"|"+y.list.source.replace("\\1","\\3")+"|").getRegex(),y.tables=g({},y.gfm,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),y.pedantic=g({},y.normal,{html:t("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",y._comment).replace(/tag/g,"(?!(?: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").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),l.rules=y,l.lex=function(e,t){return new l(t).lex(e)},l.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)},l.prototype.token=function(e,t){var n,r,i,a,o,s,l,c,u,p,h,d,g,f,m,v,b=this;for(e=e.replace(/^ +$/gm,"");e;)if((i=b.rules.newline.exec(e))&&(e=e.substring(i[0].length),1 ?/gm,""),b.token(i,t),b.tokens.push({type:"blockquote_end"});else if(i=b.rules.list.exec(e)){for(e=e.substring(i[0].length),l={type:"list_start",ordered:f=1<(a=i[2]).length,start:f?+a:"",loose:!1},b.tokens.push(l),n=!(c=[]),g=(i=i[0].match(b.rules.item)).length,h=0;h?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:d,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:d,text:/^(`+|[^`])[\s\S]*?(?=[\\?@\[\]\\^_`{|}~])/g,n._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,n._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,n.autolink=t(n.autolink).replace("scheme",n._scheme).replace("email",n._email).getRegex(),n._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,n.tag=t(n.tag).replace("comment",y._comment).replace("attribute",n._attribute).getRegex(),n._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/,n._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f\\]*\)|[^\s\x00-\x1f()\\])*?)/,n._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,n.link=t(n.link).replace("label",n._label).replace("href",n._href).replace("title",n._title).getRegex(),n.reflink=t(n.reflink).replace("label",n._label).getRegex(),n.normal=g({},n),n.pedantic=g({},n.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:t(/^!?\[(label)\]\((.*?)\)/).replace("label",n._label).getRegex(),reflink:t(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",n._label).getRegex()}),n.gfm=g({},n.normal,{escape:t(n.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:t(n.text).replace("]|","~]|").replace("|$","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|$").getRegex()}),n.gfm.url=t(n.gfm.url).replace("email",n.gfm._extended_email).getRegex(),n.breaks=g({},n.gfm,{br:t(n.br).replace("{2,}","*").getRegex(),text:t(n.gfm.text).replace("{2,}","*").getRegex()}),c.rules=n,c.output=function(e,t,n){return new c(t,n).output(e)},c.prototype.output=function(e){for(var t,n,r,i,a,o,s=this,l="";e;)if(a=s.rules.escape.exec(e))e=e.substring(a[0].length),l+=a[1];else if(a=s.rules.autolink.exec(e))e=e.substring(a[0].length),r="@"===a[2]?"mailto:"+(n=p(s.mangle(a[1]))):n=p(a[1]),l+=s.renderer.link(r,null,n);else if(s.inLink||!(a=s.rules.url.exec(e))){if(a=s.rules.tag.exec(e))!s.inLink&&/^/i.test(a[0])&&(s.inLink=!1),!s.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(a[0])?s.inRawBlock=!0:s.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(a[0])&&(s.inRawBlock=!1),e=e.substring(a[0].length),l+=s.options.sanitize?s.options.sanitizer?s.options.sanitizer(a[0]):p(a[0]):a[0];else if(a=s.rules.link.exec(e))e=e.substring(a[0].length),s.inLink=!0,r=a[2],i=s.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r))?(r=t[1],t[3]):"":a[3]?a[3].slice(1,-1):"",r=r.trim().replace(/^<([\s\S]*)>$/,"$1"),l+=s.outputLink(a,{href:c.escapes(r),title:c.escapes(i)}),s.inLink=!1;else if((a=s.rules.reflink.exec(e))||(a=s.rules.nolink.exec(e))){if(e=e.substring(a[0].length),t=(a[2]||a[1]).replace(/\s+/g," "),!(t=s.links[t.toLowerCase()])||!t.href){l+=a[0].charAt(0),e=a[0].substring(1)+e;continue}s.inLink=!0,l+=s.outputLink(a,t),s.inLink=!1}else if(a=s.rules.strong.exec(e))e=e.substring(a[0].length),l+=s.renderer.strong(s.output(a[4]||a[3]||a[2]||a[1]));else if(a=s.rules.em.exec(e))e=e.substring(a[0].length),l+=s.renderer.em(s.output(a[6]||a[5]||a[4]||a[3]||a[2]||a[1]));else if(a=s.rules.code.exec(e))e=e.substring(a[0].length),l+=s.renderer.codespan(p(a[2].trim(),!0));else if(a=s.rules.br.exec(e))e=e.substring(a[0].length),l+=s.renderer.br();else if(a=s.rules.del.exec(e))e=e.substring(a[0].length),l+=s.renderer.del(s.output(a[1]));else if(a=s.rules.text.exec(e))e=e.substring(a[0].length),s.inRawBlock?l+=s.renderer.text(a[0]):l+=s.renderer.text(p(s.smartypants(a[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else{if("@"===a[2])r="mailto:"+(n=p(a[0]));else{for(;o=a[0],a[0]=s.rules._backpedal.exec(a[0])[0],o!==a[0];);n=p(a[0]),r="www."===a[1]?"http://"+n:n}e=e.substring(a[0].length),l+=s.renderer.link(r,null,n)}return l},c.escapes=function(e){return e?e.replace(c.rules._escapes,"$1"):e},c.prototype.outputLink=function(e,t){var n=t.href,r=t.title?p(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,p(e[1]))},c.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},c.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i'+(n?e:p(e,!0))+"\n":"
    "+(n?e:p(e,!0))+"
    "},r.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},r.prototype.html=function(e){return e},r.prototype.heading=function(e,t,n){return this.options.headerIds?"'+e+"\n":""+e+"\n"},r.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},r.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},r.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},r.prototype.checkbox=function(e){return" "},r.prototype.paragraph=function(e){return"

    "+e+"

    \n"},r.prototype.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},r.prototype.tablerow=function(e){return"\n"+e+"\n"},r.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"},r.prototype.strong=function(e){return""+e+""},r.prototype.em=function(e){return""+e+""},r.prototype.codespan=function(e){return""+e+""},r.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},r.prototype.del=function(e){return""+e+""},r.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!s.test(e)&&(e=a(this.options.baseUrl,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return n}var i='
    "},r.prototype.image=function(e,t,n){this.options.baseUrl&&!s.test(e)&&(e=a(this.options.baseUrl,e));var r=''+n+'":">"},r.prototype.text=function(e){return e},i.prototype.strong=i.prototype.em=i.prototype.codespan=i.prototype.del=i.prototype.text=function(e){return e},i.prototype.link=i.prototype.image=function(e,t,n){return""+n},i.prototype.br=function(){return""},u.parse=function(e,t){return new u(t).parse(e)},u.prototype.parse=function(e){this.inline=new c(e.links,this.options),this.inlineText=new c(e.links,g({},this.options,{renderer:new i})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},u.prototype.next=function(){return this.token=this.tokens.pop()},u.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},u.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},u.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,h(this.inlineText.output(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="",o="";for(r="",t=0;t"']/,p.escapeReplace=/[&<>"']/g,p.replacements={"&":"&","<":"<",">":">",'"':""","'":"'"},p.escapeTestNoEncode=/[<>"']|&(?!#?\w+;)/,p.escapeReplaceNoEncode=/[<>"']|&(?!#?\w+;)/g;var o={},s=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function d(){}function g(e){for(var t,n,r=arguments,i=1;it)n.splice(t);else for(;n.lengthAn error occurred:

    "+p(e.message+"",!0)+"
    ";throw e}}d.exec=d,f.options=f.setOptions=function(e){return g(f.defaults,e),f},f.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new r,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},f.defaults=f.getDefaults(),f.Parser=u,f.parser=u.parse,f.Renderer=r,f.TextRenderer=i,f.Lexer=l,f.lexer=l.lex,f.InlineLexer=c,f.inlineLexer=c.output,f.parse=f,m.exports=f}(t||"undefined"!=typeof window&&window)}),a=i(function(e){var c="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},u=function(){var l=/\blang(?:uage)?-([\w-]+)\b/i,t=0,P=c.Prism={manual:c.Prism&&c.Prism.manual,disableWorkerMessageHandler:c.Prism&&c.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof o?new o(e.type,P.util.encode(e.content),e.alias):"Array"===P.util.type(e)?e.map(P.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(k instanceof s)){if(g&&b!=t.length-1){if(p.lastIndex=y,!(C=p.exec(e)))break;for(var x=C.index+(d?C[1].length:0),w=C.index+C[0].length,_=b,S=y,A=t.length;_"+r.content+""},!c.document)return c.addEventListener&&(P.disableWorkerMessageHandler||c.addEventListener("message",function(e){var t=JSON.parse(e.data),n=t.language,r=t.code,i=t.immediateClose;c.postMessage(P.highlight(r,P.languages[n],n)),i&&c.close()},!1)),c.Prism;var e=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return e&&(P.filename=e.src,P.manual||e.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(P.highlightAll):window.setTimeout(P.highlightAll,16):document.addEventListener("DOMContentLoaded",P.highlightAll))),c.Prism}();e.exports&&(e.exports=u),void 0!==t&&(t.Prism=u),u.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/(^|[^\\])["']/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},u.languages.markup.tag.inside["attr-value"].inside.entity=u.languages.markup.entity,u.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),u.languages.xml=u.languages.markup,u.languages.html=u.languages.markup,u.languages.mathml=u.languages.markup,u.languages.svg=u.languages.markup,u.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(?:;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^{}\s][^{};]*?(?=\s*\{)/,string:{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/\B!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},u.languages.css.atrule.inside.rest=u.languages.css,u.languages.markup&&(u.languages.insertBefore("markup","tag",{style:{pattern:/()[\s\S]*?(?=<\/style>)/i,lookbehind:!0,inside:u.languages.css,alias:"language-css",greedy:!0}}),u.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:u.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:u.languages.css}},alias:"language-css"}},u.languages.markup.tag)),u.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/[a-z0-9_]+(?=\()/i,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/},u.languages.javascript=u.languages.extend("clike",{keyword:/\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,function:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/i,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/}),u.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[[^\]\r\n]+]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=\s*(?:function\b|(?:\([^()]*\)|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i,alias:"function"},constant:/\b[A-Z][A-Z\d_]*\b/}),u.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${[^}]+}|[^\\`])*`/,greedy:!0,inside:{interpolation:{pattern:/\${[^}]+}/,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}}}),u.languages.javascript["template-string"].inside.interpolation.inside.rest=u.languages.javascript,u.languages.markup&&u.languages.insertBefore("markup","tag",{script:{pattern:/()[\s\S]*?(?=<\/script>)/i,lookbehind:!0,inside:u.languages.javascript,alias:"language-javascript",greedy:!0}}),u.languages.js=u.languages.javascript,"undefined"!=typeof self&&self.Prism&&self.document&&document.querySelector&&(self.Prism.fileHighlight=function(){var l={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"};Array.prototype.slice.call(document.querySelectorAll("pre[data-src]")).forEach(function(e){for(var t,n=e.getAttribute("data-src"),r=e,i=/\blang(?:uage)?-([\w-]+)\b/i;r&&!i.test(r.className);)r=r.parentNode;if(r&&(t=(e.className.match(i)||[,""])[1]),!t){var a=(n.match(/\.(\w+)$/)||[,""])[1];t=l[a]||a}var o=document.createElement("code");o.className="language-"+t,e.textContent="",o.textContent="Loading…",e.appendChild(o);var s=new XMLHttpRequest;s.open("GET",n,!0),s.onreadystatechange=function(){4==s.readyState&&(s.status<400&&s.responseText?(o.textContent=s.responseText,u.highlightElement(o)):400<=s.status?o.textContent="✖ Error "+s.status+" while fetching file: "+s.statusText:o.textContent="✖ Error: File does not exist or is empty")},s.send(null)}),u.plugins.toolbar&&u.plugins.toolbar.registerButton("download-file",function(e){var t=e.element.parentNode;if(t&&/pre/i.test(t.nodeName)&&t.hasAttribute("data-src")&&t.hasAttribute("data-download-link")){var n=t.getAttribute("data-src"),r=document.createElement("a");return r.textContent=t.getAttribute("data-download-link-label")||"Download",r.setAttribute("download",""),r.href=n,r}})},document.addEventListener("DOMContentLoaded",self.Prism.fileHighlight))});function q(e,r){var i=[],a={};return e.forEach(function(e){var t=e.level||1,n=t-1;r?@[\]^`{|}~]/g;function B(e){return e.toLowerCase()}function U(e){if("string"!=typeof e)return"";var t=e.trim().replace(/[A-Z]+/g,B).replace(/<[^>\d]+>/g,"").replace(H,"").replace(/\s/g,"-").replace(/-+/g,"-").replace(/^(\d)/,"_$1"),n=I[t];return n=l.call(I,t)?n+1:0,(I[t]=n)&&(t=t+"-"+n),t}function D(e,t){return''+t+''}U.clear=function(){I={}};var Z=decodeURIComponent,Y=encodeURIComponent;function W(e){var n={};return(e=e.trim().replace(/^(\?|#|&)/,""))&&e.split("&").forEach(function(e){var t=e.replace(/\+/g," ").split("=");n[t[0]]=t[1]&&Z(t[1])}),n}function G(e,t){void 0===t&&(t=[]);var n=[];for(var r in e)-1=g.length))for(var t=0;t=g.length)break}}else n.content&&"string"!=typeof n.content&&f(n.content)}};f(p.tokens)}}}});var te={};function ne(e){void 0===e&&(e="");var r={};return e&&(e=e.replace(/^'/,"").replace(/'$/,"").replace(/(?:^|\s):([\w-]+)=?([\w-]+)?/g,function(e,t,n){return r[t]=n&&n.replace(/"/g,"")||!0,""}).trim()),{str:e,config:r}}var re={markdown:function(e){return{url:e}},mermaid:function(e){return{url:e}},iframe:function(e,t){return{html:'"}},video:function(e,t){return{html:'"}},audio:function(e,t){return{html:'"}},code:function(e,t){var n=e.match(/\.(\w+)$/);return"md"===(n=t||n&&n[1])&&(n="markdown"),{url:e,lang:n}}},ie=function(i,e){var a=this;this.config=i,this.router=e,this.cacheTree={},this.toc=[],this.cacheTOC={},this.linkTarget=i.externalLinkTarget||"_blank",this.contentBase=e.getBasePath();var o,t=this._initRenderer(),n=i.markdown||{};o=u(n)?n(M,t):(M.setOptions(d(n,{renderer:d(t,n.renderer)})),M),this._marked=o,this.compile=function(n){var r=!0,e=s(function(e){r=!1;var t="";return n?(t=c(n)?o(n):o.parser(n),t=i.noEmoji?t:t.replace(/<(pre|template|code)[^>]*?>[\s\S]+?<\/(pre|template|code)>/g,function(e){return e.replace(/:/g,"__colon__")}).replace(/:(\w+?):/gi,f&&window.emojify||D).replace(/__colon__/g,":"),U.clear(),t):n})(n),t=a.router.parse().file;return r?a.toc=a.cacheTOC[t]:a.cacheTOC[t]=[].concat(a.toc),e}};ie.prototype.compileEmbed=function(e,t){var n,r=ne(t),i=r.str,a=r.config;if(t=i,a.include){var o;if(X(e)||(e=K(this.contentBase,Q(this.router.getCurrentPath()),e)),a.type&&(o=re[a.type]))(n=o.call(this,e,t)).type=a.type;else{var s="code";/\.(md|markdown)/.test(e)?s="markdown":/\.mmd/.test(e)?s="mermaid":/\.html?/.test(e)?s="iframe":/\.(mp4|ogg)/.test(e)?s="video":/\.mp3/.test(e)&&(s="audio"),(n=re[s].call(this,e,t)).type=s}return n.fragment=a.fragment,n}},ie.prototype._matchNotCompileLink=function(e){for(var t=this.config.noCompileLinks||[],n=0;n
    '+r+""},t.code=e.code=function(e,t){return void 0===t&&(t=""),e=e.replace(/@DOCSIFY_QM@/g,"`"),'
    '+a.highlight(e,a.languages[t]||a.languages.markup)+"
    "},t.link=e.link=function(e,t,n){void 0===t&&(t="");var r="",i=ne(t),a=i.str,o=i.config;return t=a,X(e)||l._matchNotCompileLink(e)||o.ignore?r+=0===e.indexOf("mailto:")?"":' target="'+s+'"':(e===l.config.homepage&&(e="README"),e=u.toURL(e,null,u.getCurrentPath())),o.target&&(r+=" target="+o.target),o.disabled&&(r+=" disabled",e="javascript:void(0)"),t&&(r+=' title="'+t+'"'),'"+n+""},t.paragraph=e.paragraph=function(e){return/^!>/.test(e)?r("tip",e):/^\?>/.test(e)?r("warn",e):"

    "+e+"

    "},t.image=e.image=function(e,t,n){var r=e,i="",a=ne(t),o=a.str,s=a.config;t=o,s["no-zoom"]&&(i+=" data-no-zoom"),t&&(i+=' title="'+t+'"');var l=s.size;if(l){var c=l.split("x");c[1]?i+="width="+c[0]+" height="+c[1]:i+="width="+c[0]}return X(e)||(r=K(p,Q(u.getCurrentPath()),e)),''+n+'"},t.list=e.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+" "+[/
  • /.test(e.split('class="task-list"')[0])?'class="task-list"':"",n&&1"+e+""},t.listitem=e.listitem=function(e){return/^(]*>)/.test(e)?'
  • ":"
  • "+e+"
  • "},e.origin=t,e},ie.prototype.sidebar=function(e,t){var n=this.router.getCurrentPath(),r="";if(e)r=this.compile(e);else{var i=this.cacheTree[n]||q(this.toc,t);r=R(i,"
      {inner}
    "),this.cacheTree[n]=i}return r},ie.prototype.subSidebar=function(e){if(e){var t=this.router.getCurrentPath(),n=this.cacheTree,r=this.toc;r[0]&&r[0].ignoreAllSubs&&r.splice(0),r[0]&&1===r[0].level&&r.shift();for(var i=0;i=t||e.classList.contains("hidden")?$(y,"add","sticky"):$(y,"remove","sticky")}}function se(e,t,r,n){var i=[];null!=(t=v(t))&&(i=w(t,"a"));var a,o=decodeURI(e.toURL(e.getCurrentPath()));return i.sort(function(e,t){return t.href.length-e.href.length}).forEach(function(e){var t=e.getAttribute("href"),n=r?e.parentNode:e;0!==o.indexOf(t)||a?$(n,"remove","active"):(a=e,$(n,"add","active"))}),n&&(b.title=a?a.title||a.innerText+" - "+ae:ae),a}var le=function(){function r(e,t){for(var n=0;nthis.end&&e>=this.next}[this.direction]}},{key:"_defaultEase",value:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t}}]),t}(),ue={},pe=!1,he=null,de=!0,ge=0;function fe(e){if(de){for(var t,n=v(".sidebar"),r=w(".anchor"),i=x(n,".sidebar-nav"),a=x(n,"li.active"),o=document.documentElement,s=(o&&o.scrollTop||document.body.scrollTop)-ge,l=0,c=r.length;ls){t||(t=u);break}t=u}if(t){var p=ue[me(decodeURIComponent(e),t.getAttribute("data-id"))];if(p&&p!==a&&(a&&a.classList.remove("active"),p.classList.add("active"),a=p,!pe&&y.classList.contains("sticky"))){var h=n.clientHeight,d=a.offsetTop+a.clientHeight+40,g=d-0=i.scrollTop&&d<=i.scrollTop+h?i.scrollTop:g?0:d-h;n.scrollTop=f}}}}function me(e,t){return e+"?id="+t}function ve(e,t){if(t){var n,r=x("#"+t);r&&(n=r,he&&he.stop(),de=!1,he=new ce({start:window.pageYOffset,end:n.getBoundingClientRect().top+window.pageYOffset,duration:500}).on("tick",function(e){return window.scrollTo(0,e)}).on("done",function(){de=!0,he=null}).begin());var i=ue[me(e,t)],a=x(v(".sidebar"),"li.active");a&&a.classList.remove("active"),i&&i.classList.add("active")}}var be=b.scrollingElement||b.documentElement;var ye={};function ke(e,i){var o=e.compiler,a=e.raw;void 0===a&&(a="");var t=e.fetch,n=ye[a];if(n){var r=n.slice();return r.links=n.links,i(r)}var s=o._marked,l=s.lexer(a),c=[],u=s.InlineLexer.rules.link,p=l.links;l.forEach(function(e,a){"paragraph"===e.type&&(e.text=e.text.replace(new RegExp(u.source,"g"),function(e,t,n,r){var i=o.compileEmbed(n,r);return i&&c.push({index:a,embed:i}),e}))});var h=0;!function(e,a){var t,n=e.embedTokens,o=e.compile,s=(e.fetch,0),l=1;if(!n.length)return a({});for(;t=n[s++];){var r=function(i){return function(e){var t;if(e)if("markdown"===i.embed.type)t=o.lexer(e);else if("code"===i.embed.type){if(i.embed.fragment){var n=i.embed.fragment,r=new RegExp("(?:###|\\/\\/\\/)\\s*\\["+n+"\\]([\\s\\S]*)(?:###|\\/\\/\\/)\\s*\\["+n+"\\]");e=((e.match(r)||[])[1]||"").trim()}t=o.lexer("```"+i.embed.lang+"\n"+e.replace(/`/g,"@DOCSIFY_QM@")+"\n```\n")}else"mermaid"===i.embed.type?(t=[{type:"html",text:'
    \n'+e+"\n
    "}]).links={}:(t=[{type:"html",text:e}]).links={};a({token:i,embedToken:t}),++l>=s&&a({})}}(t);t.embed.url?F(t.embed.url).then(r):r(t.embed.html)}}({compile:s,embedTokens:c,fetch:t},function(e){var t=e.embedToken,n=e.token;if(n){var r=n.index+h;d(p,t.links),l=l.slice(0,r).concat(t,l.slice(r+1)),h+=t.length-1}else ye[a]=l.concat(),l.links=ye[a].links=p,i(l)})}function xe(){var e=w(".markdown-section>script").filter(function(e){return!/template/.test(e.type)})[0];if(!e)return!1;var t=e.innerText.trim();if(!t)return!1;setTimeout(function(e){window.__EXECUTE_RESULT__=new Function(t)()},0)}function we(e,t,n){var r,i,a;return t="function"==typeof n?n(t):"string"==typeof n?(i=[],a=0,(r=n).replace(N,function(t,e,n){i.push(r.substring(a,n-1)),a=n+=t.length+1,i.push(function(e){return("00"+("string"==typeof z[t]?e[z[t]]():z[t](e))).slice(-t.length)})}),a!==r.length&&i.push(r.substring(a)),function(e){for(var t="",n=0,r=e||new Date;n'):""),t.coverpage&&(u+=(i=", 100%, 85%",'
    \x3c!--cover--\x3e
    ')),t.logo){var h=/^data:image/.test(t.logo),d=/(?:http[s]?:)?\/\//.test(t.logo),g=/^\./.test(t.logo);h||d||g||(t.logo=K(e.router.getBasePath(),t.logo))}u+=(r='',(m?r+"
    ":"
    "+r)+'
    \x3c!--main--\x3e
    '),e._renderTo(c,u,!0)}else e.rendered=!0;t.mergeNavbar&&m?p=x(".sidebar"):(l.classList.add("app-nav"),t.repo||l.classList.add("no-badge")),t.loadNavbar&&A(p,l),t.themeColor&&(b.head.appendChild(_("div",(o=t.themeColor,"")).firstElementChild),function(n){if(!(window.CSS&&window.CSS.supports&&window.CSS.supports("(--v:red)"))){var e=w("style:not(.inserted),link");[].forEach.call(e,function(e){if("STYLE"===e.nodeName)j(e,n);else if("LINK"===e.nodeName){var t=e.getAttribute("href");if(!/\.css$/.test(t))return;F(t).then(function(e){var t=_("style",e);k.appendChild(t),j(t,n)})}})}}(t.themeColor)),e._updateRender(),$(y,"ready")}var Ae={};var Ce=function(e){this.config=e};function Ee(e){var t=location.href.indexOf("#");location.replace(location.href.slice(0,0<=t?t:0)+"#"+e)}Ce.prototype.getBasePath=function(){return this.config.basePath},Ce.prototype.getFile=function(e,t){void 0===e&&(e=this.getCurrentPath());var n,r,i=this.config,a=this.getBasePath(),o="string"==typeof i.ext?i.ext:".md";return e=i.alias?function e(t,n,r){var i=Object.keys(n).filter(function(e){return(Ae[e]||(Ae[e]=new RegExp("^"+e+"$"))).test(t)&&t!==r})[0];return i?e(t.replace(Ae[i],n[i]),n,t):t}(e,i.alias):e,n=e,r=o,e=(e=new RegExp("\\.("+r.replace(/^\./,"")+"|html)$","g").test(n)?n:/\/$/g.test(n)?n+"README"+r:""+n+r)==="/README"+o&&i.homepage||e,e=X(e)?e:K(a,e),t&&(e=e.replace(new RegExp("^"+a),"")),e},Ce.prototype.onchange=function(e){void 0===e&&(e=p),e()},Ce.prototype.getCurrentPath=function(){},Ce.prototype.normalize=function(){},Ce.prototype.parse=function(){},Ce.prototype.toURL=function(e,t,n){var r=n&&"#"===e[0],i=this.parse(ee(e));if(i.query=d({},i.query,t),e=(e=i.path+G(i.query)).replace(/\.md(\?)|\.md$/,"$1"),r){var a=n.indexOf("?");e=(0([^<]*?)

    $');if(i){if("color"===i[2])n.style.background=i[1]+(i[3]||"");else{var a=i[1];$(n,"add","has-mask"),X(i[1])||(a=K(this.router.getBasePath(),i[1])),n.style.backgroundImage="url("+a+")",n.style.backgroundSize="cover",n.style.backgroundPosition="center center"}r=r.replace(i[0],"")}this._renderTo(".cover-main",r),oe()}else $(n,"remove","show")},Ne._updateRender=function(){!function(e){var t=v(".app-name-link"),n=e.config.nameLink,r=e.route.path;if(t)if(c(e.config.nameLink))t.setAttribute("href",n);else if("object"==typeof n){var i=Object.keys(n).filter(function(e){return-1' +}; + +}()); diff --git a/lib/plugins/emoji.min.js b/lib/plugins/emoji.min.js new file mode 100644 index 0000000..a305a42 --- /dev/null +++ b/lib/plugins/emoji.min.js @@ -0,0 +1 @@ +!function(){var o=["+1","100","1234","8ball","a","ab","abc","abcd","accept","aerial_tramway","airplane","alarm_clock","alien","ambulance","anchor","angel","anger","angry","anguished","ant","apple","aquarius","aries","arrow_backward","arrow_double_down","arrow_double_up","arrow_down","arrow_down_small","arrow_forward","arrow_heading_down","arrow_heading_up","arrow_left","arrow_lower_left","arrow_lower_right","arrow_right","arrow_right_hook","arrow_up","arrow_up_down","arrow_up_small","arrow_upper_left","arrow_upper_right","arrows_clockwise","arrows_counterclockwise","art","articulated_lorry","astonished","athletic_shoe","atm","b","baby","baby_bottle","baby_chick","baby_symbol","back","baggage_claim","balloon","ballot_box_with_check","bamboo","banana","bangbang","bank","bar_chart","barber","baseball","basketball","bath","bathtub","battery","bear","bee","beer","beers","beetle","beginner","bell","bento","bicyclist","bike","bikini","bird","birthday","black_circle","black_joker","black_large_square","black_medium_small_square","black_medium_square","black_nib","black_small_square","black_square_button","blossom","blowfish","blue_book","blue_car","blue_heart","blush","boar","boat","bomb","book","bookmark","bookmark_tabs","books","boom","boot","bouquet","bow","bowling","bowtie","boy","bread","bride_with_veil","bridge_at_night","briefcase","broken_heart","bug","bulb","bullettrain_front","bullettrain_side","bus","busstop","bust_in_silhouette","busts_in_silhouette","cactus","cake","calendar","calling","camel","camera","cancer","candy","capital_abcd","capricorn","car","card_index","carousel_horse","cat","cat2","cd","chart","chart_with_downwards_trend","chart_with_upwards_trend","checkered_flag","cherries","cherry_blossom","chestnut","chicken","children_crossing","chocolate_bar","christmas_tree","church","cinema","circus_tent","city_sunrise","city_sunset","cl","clap","clapper","clipboard","clock1","clock10","clock1030","clock11","clock1130","clock12","clock1230","clock130","clock2","clock230","clock3","clock330","clock4","clock430","clock5","clock530","clock6","clock630","clock7","clock730","clock8","clock830","clock9","clock930","closed_book","closed_lock_with_key","closed_umbrella","cloud","clubs","cn","cocktail","coffee","cold_sweat","collision","computer","confetti_ball","confounded","confused","congratulations","construction","construction_worker","convenience_store","cookie","cool","cop","copyright","corn","couple","couple_with_heart","couplekiss","cow","cow2","credit_card","crescent_moon","crocodile","crossed_flags","crown","cry","crying_cat_face","crystal_ball","cupid","curly_loop","currency_exchange","curry","custard","customs","cyclone","dancer","dancers","dango","dart","dash","date","de","deciduous_tree","department_store","diamond_shape_with_a_dot_inside","diamonds","disappointed","disappointed_relieved","dizzy","dizzy_face","do_not_litter","dog","dog2","dollar","dolls","dolphin","door","doughnut","dragon","dragon_face","dress","dromedary_camel","droplet","dvd","e-mail","ear","ear_of_rice","earth_africa","earth_americas","earth_asia","egg","eggplant","eight","eight_pointed_black_star","eight_spoked_asterisk","electric_plug","elephant","email","end","envelope","envelope_with_arrow","es","euro","european_castle","european_post_office","evergreen_tree","exclamation","expressionless","eyeglasses","eyes","facepunch","factory","fallen_leaf","family","fast_forward","fax","fearful","feelsgood","feet","ferris_wheel","file_folder","finnadie","fire","fire_engine","fireworks","first_quarter_moon","first_quarter_moon_with_face","fish","fish_cake","fishing_pole_and_fish","fist","five","flags","flashlight","flipper","floppy_disk","flower_playing_cards","flushed","foggy","football","footprints","fork_and_knife","fountain","four","four_leaf_clover","fr","free","fried_shrimp","fries","frog","frowning","fu","fuelpump","full_moon","full_moon_with_face","game_die","gb","gem","gemini","ghost","gift","gift_heart","girl","globe_with_meridians","goat","goberserk","godmode","golf","grapes","green_apple","green_book","green_heart","grey_exclamation","grey_question","grimacing","grin","grinning","guardsman","guitar","gun","haircut","hamburger","hammer","hamster","hand","handbag","hankey","hash","hatched_chick","hatching_chick","headphones","hear_no_evil","heart","heart_decoration","heart_eyes","heart_eyes_cat","heartbeat","heartpulse","hearts","heavy_check_mark","heavy_division_sign","heavy_dollar_sign","heavy_exclamation_mark","heavy_minus_sign","heavy_multiplication_x","heavy_plus_sign","helicopter","herb","hibiscus","high_brightness","high_heel","hocho","honey_pot","honeybee","horse","horse_racing","hospital","hotel","hotsprings","hourglass","hourglass_flowing_sand","house","house_with_garden","hurtrealbad","hushed","ice_cream","icecream","id","ideograph_advantage","imp","inbox_tray","incoming_envelope","information_desk_person","information_source","innocent","interrobang","iphone","it","izakaya_lantern","jack_o_lantern","japan","japanese_castle","japanese_goblin","japanese_ogre","jeans","joy","joy_cat","jp","key","keycap_ten","kimono","kiss","kissing","kissing_cat","kissing_closed_eyes","kissing_heart","kissing_smiling_eyes","koala","koko","kr","lantern","large_blue_circle","large_blue_diamond","large_orange_diamond","last_quarter_moon","last_quarter_moon_with_face","laughing","leaves","ledger","left_luggage","left_right_arrow","leftwards_arrow_with_hook","lemon","leo","leopard","libra","light_rail","link","lips","lipstick","lock","lock_with_ink_pen","lollipop","loop","loud_sound","loudspeaker","love_hotel","love_letter","low_brightness","m","mag","mag_right","mahjong","mailbox","mailbox_closed","mailbox_with_mail","mailbox_with_no_mail","man","man_with_gua_pi_mao","man_with_turban","mans_shoe","maple_leaf","mask","massage","meat_on_bone","mega","melon","memo","mens","metal","metro","microphone","microscope","milky_way","minibus","minidisc","mobile_phone_off","money_with_wings","moneybag","monkey","monkey_face","monorail","moon","mortar_board","mount_fuji","mountain_bicyclist","mountain_cableway","mountain_railway","mouse","mouse2","movie_camera","moyai","muscle","mushroom","musical_keyboard","musical_note","musical_score","mute","nail_care","name_badge","neckbeard","necktie","negative_squared_cross_mark","neutral_face","new","new_moon","new_moon_with_face","newspaper","ng","night_with_stars","nine","no_bell","no_bicycles","no_entry","no_entry_sign","no_good","no_mobile_phones","no_mouth","no_pedestrians","no_smoking","non-potable_water","nose","notebook","notebook_with_decorative_cover","notes","nut_and_bolt","o","o2","ocean","octocat","octopus","oden","office","ok","ok_hand","ok_woman","older_man","older_woman","on","oncoming_automobile","oncoming_bus","oncoming_police_car","oncoming_taxi","one","open_book","open_file_folder","open_hands","open_mouth","ophiuchus","orange_book","outbox_tray","ox","package","page_facing_up","page_with_curl","pager","palm_tree","panda_face","paperclip","parking","part_alternation_mark","partly_sunny","passport_control","paw_prints","peach","pear","pencil","pencil2","penguin","pensive","performing_arts","persevere","person_frowning","person_with_blond_hair","person_with_pouting_face","phone","pig","pig2","pig_nose","pill","pineapple","pisces","pizza","point_down","point_left","point_right","point_up","point_up_2","police_car","poodle","poop","post_office","postal_horn","postbox","potable_water","pouch","poultry_leg","pound","pouting_cat","pray","princess","punch","purple_heart","purse","pushpin","put_litter_in_its_place","question","rabbit","rabbit2","racehorse","radio","radio_button","rage","rage1","rage2","rage3","rage4","railway_car","rainbow","raised_hand","raised_hands","raising_hand","ram","ramen","rat","recycle","red_car","red_circle","registered","relaxed","relieved","repeat","repeat_one","restroom","revolving_hearts","rewind","ribbon","rice","rice_ball","rice_cracker","rice_scene","ring","rocket","roller_coaster","rooster","rose","rotating_light","round_pushpin","rowboat","ru","rugby_football","runner","running","running_shirt_with_sash","sa","sagittarius","sailboat","sake","sandal","santa","satellite","satisfied","saxophone","school","school_satchel","scissors","scorpius","scream","scream_cat","scroll","seat","secret","see_no_evil","seedling","seven","shaved_ice","sheep","shell","ship","shipit","shirt","shit","shoe","shower","signal_strength","six","six_pointed_star","ski","skull","sleeping","sleepy","slot_machine","small_blue_diamond","small_orange_diamond","small_red_triangle","small_red_triangle_down","smile","smile_cat","smiley","smiley_cat","smiling_imp","smirk","smirk_cat","smoking","snail","snake","snowboarder","snowflake","snowman","sob","soccer","soon","sos","sound","space_invader","spades","spaghetti","sparkle","sparkler","sparkles","sparkling_heart","speak_no_evil","speaker","speech_balloon","speedboat","squirrel","star","star2","stars","station","statue_of_liberty","steam_locomotive","stew","straight_ruler","strawberry","stuck_out_tongue","stuck_out_tongue_closed_eyes","stuck_out_tongue_winking_eye","sun_with_face","sunflower","sunglasses","sunny","sunrise","sunrise_over_mountains","surfer","sushi","suspect","suspension_railway","sweat","sweat_drops","sweat_smile","sweet_potato","swimmer","symbols","syringe","tada","tanabata_tree","tangerine","taurus","taxi","tea","telephone","telephone_receiver","telescope","tennis","tent","thought_balloon","three","thumbsdown","thumbsup","ticket","tiger","tiger2","tired_face","tm","toilet","tokyo_tower","tomato","tongue","top","tophat","tractor","traffic_light","train","train2","tram","triangular_flag_on_post","triangular_ruler","trident","triumph","trolleybus","trollface","trophy","tropical_drink","tropical_fish","truck","trumpet","tshirt","tulip","turtle","tv","twisted_rightwards_arrows","two","two_hearts","two_men_holding_hands","two_women_holding_hands","u5272","u5408","u55b6","u6307","u6708","u6709","u6e80","u7121","u7533","u7981","u7a7a","uk","umbrella","unamused","underage","unlock","up","us","v","vertical_traffic_light","vhs","vibration_mode","video_camera","video_game","violin","virgo","volcano","vs","walking","waning_crescent_moon","waning_gibbous_moon","warning","watch","water_buffalo","watermelon","wave","wavy_dash","waxing_crescent_moon","waxing_gibbous_moon","wc","weary","wedding","whale","whale2","wheelchair","white_check_mark","white_circle","white_flower","white_large_square","white_medium_small_square","white_medium_square","white_small_square","white_square_button","wind_chime","wine_glass","wink","wolf","woman","womans_clothes","womans_hat","womens","worried","wrench","x","yellow_heart","yen","yum","zap","zero","zzz"];window.emojify=function(e,a){return-1===o.indexOf(a)?e:''+a+''}}(); diff --git a/lib/plugins/external-script.js b/lib/plugins/external-script.js new file mode 100644 index 0000000..9d0b332 --- /dev/null +++ b/lib/plugins/external-script.js @@ -0,0 +1,28 @@ +(function () { +function handleExternalScript() { + var container = Docsify.dom.getNode('#main'); + var scripts = Docsify.dom.findAll(container, 'script'); + + for (var i = scripts.length; i--;) { + var script = scripts[i]; + + if (script && script.src) { + var newScript = document.createElement('script'); + + Array.prototype.slice.call(script.attributes).forEach(function (attribute) { + newScript[attribute.name] = attribute.value; + }); + + script.parentNode.insertBefore(newScript, script); + script.parentNode.removeChild(script); + } + } +} + +var install = function (hook) { + hook.doneEach(handleExternalScript); +}; + +window.$docsify.plugins = [].concat(install, window.$docsify.plugins); + +}()); diff --git a/lib/plugins/external-script.min.js b/lib/plugins/external-script.min.js new file mode 100644 index 0000000..c4f8026 --- /dev/null +++ b/lib/plugins/external-script.min.js @@ -0,0 +1 @@ +!function(){function e(){for(var o=Docsify.dom.getNode("#main"),e=Docsify.dom.findAll(o,"script"),n=e.length;n--;){var i=e[n];if(i&&i.src){var t=document.createElement("script");Array.prototype.slice.call(i.attributes).forEach(function(o){t[o.name]=o.value}),i.parentNode.insertBefore(t,i),i.parentNode.removeChild(i)}}}window.$docsify.plugins=[].concat(function(o){o.doneEach(e)},window.$docsify.plugins)}(); diff --git a/lib/plugins/front-matter.js b/lib/plugins/front-matter.js new file mode 100644 index 0000000..9a625ab --- /dev/null +++ b/lib/plugins/front-matter.js @@ -0,0 +1,496 @@ +(function () { +/** + * Fork https://github.com/egoist/docute/blob/master/src/utils/yaml.js + */ +/* eslint-disable */ +/* +YAML parser for Javascript +Author: Diogo Costa +This program is released under the MIT License as follows: +Copyright (c) 2011 Diogo Costa (costa.h4evr@gmail.com) +Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ + +/** + * @name YAML + * @namespace +*/ + +var errors = []; +var reference_blocks = []; +var processing_time = 0; +var regex$1 = { + regLevel: new RegExp('^([\\s\\-]+)'), + invalidLine: new RegExp('^\\-\\-\\-|^\\.\\.\\.|^\\s*#.*|^\\s*$'), + dashesString: new RegExp('^\\s*\\"([^\\"]*)\\"\\s*$'), + quotesString: new RegExp("^\\s*\\'([^\\']*)\\'\\s*$"), + float: new RegExp('^[+-]?[0-9]+\\.[0-9]+(e[+-]?[0-9]+(\\.[0-9]+)?)?$'), + integer: new RegExp('^[+-]?[0-9]+$'), + array: new RegExp('\\[\\s*(.*)\\s*\\]'), + map: new RegExp('\\{\\s*(.*)\\s*\\}'), + key_value: new RegExp('([a-z0-9_-][ a-z0-9_-]*):( .+)', 'i'), + single_key_value: new RegExp('^([a-z0-9_-][ a-z0-9_-]*):( .+?)$', 'i'), + key: new RegExp('([a-z0-9_-][ a-z0-9_-]+):( .+)?', 'i'), + item: new RegExp('^-\\s+'), + trim: new RegExp('^\\s+|\\s+$'), + comment: new RegExp('([^\\\'\\"#]+([\\\'\\"][^\\\'\\"]*[\\\'\\"])*)*(#.*)?') + }; + +/** + * @class A block of lines of a given level. + * @param {int} lvl The block's level. + * @private + */ +function Block(lvl) { + return { + /* The block's parent */ + parent: null, + /* Number of children */ + length: 0, + /* Block's level */ + level: lvl, + /* Lines of code to process */ + lines: [], + /* Blocks with greater level */ + children: [], + /* Add a block to the children collection */ + addChild: function(obj) { + this.children.push(obj); + obj.parent = this; + ++this.length; + } + } +} + +function parser$1(str) { + var regLevel = regex$1['regLevel']; + var invalidLine = regex$1['invalidLine']; + var lines = str.split('\n'); + var m; + var level = 0, + curLevel = 0; + + var blocks = []; + + var result = new Block(-1); + var currentBlock = new Block(0); + result.addChild(currentBlock); + var levels = []; + var line = ''; + + blocks.push(currentBlock); + levels.push(level); + + for (var i = 0, len = lines.length; i < len; ++i) { + line = lines[i]; + + if (line.match(invalidLine)) { + continue + } + + if ((m = regLevel.exec(line))) { + level = m[1].length; + } else { level = 0; } + + if (level > curLevel) { + var oldBlock = currentBlock; + currentBlock = new Block(level); + oldBlock.addChild(currentBlock); + blocks.push(currentBlock); + levels.push(level); + } else if (level < curLevel) { + var added = false; + + var k = levels.length - 1; + for (; k >= 0; --k) { + if (levels[k] == level) { + currentBlock = new Block(level); + blocks.push(currentBlock); + levels.push(level); + if (blocks[k].parent != null) { blocks[k].parent.addChild(currentBlock); } + added = true; + break + } + } + + if (!added) { + errors.push('Error: Invalid indentation at line ' + i + ': ' + line); + return + } + } + + currentBlock.lines.push(line.replace(regex$1['trim'], '')); + curLevel = level; + } + + return result +} + +function processValue(val) { + val = val.replace(regex$1['trim'], ''); + var m = null; + + if (val == 'true') { + return true + } else if (val == 'false') { + return false + } else if (val == '.NaN') { + return Number.NaN + } else if (val == 'null') { + return null + } else if (val == '.inf') { + return Number.POSITIVE_INFINITY + } else if (val == '-.inf') { + return Number.NEGATIVE_INFINITY + } else if ((m = val.match(regex$1['dashesString']))) { + return m[1] + } else if ((m = val.match(regex$1['quotesString']))) { + return m[1] + } else if ((m = val.match(regex$1['float']))) { + return parseFloat(m[0]) + } else if ((m = val.match(regex$1['integer']))) { + return parseInt(m[0]) + } else if (!isNaN((m = Date.parse(val)))) { + return new Date(m) + } else if ((m = val.match(regex$1['single_key_value']))) { + var res = {}; + res[m[1]] = processValue(m[2]); + return res + } else if ((m = val.match(regex$1['array']))) { + var count = 0, + c = ' '; + var res = []; + var content = ''; + var str = false; + for (var j = 0, lenJ = m[1].length; j < lenJ; ++j) { + c = m[1][j]; + if (c == "'" || c == '"') { + if (str === false) { + str = c; + content += c; + continue + } else if ((c == "'" && str == "'") || (c == '"' && str == '"')) { + str = false; + content += c; + continue + } + } else if (str === false && (c == '[' || c == '{')) { + ++count; + } else if (str === false && (c == ']' || c == '}')) { + --count; + } else if (str === false && count == 0 && c == ',') { + res.push(processValue(content)); + content = ''; + continue + } + + content += c; + } + + if (content.length > 0) { res.push(processValue(content)); } + return res + } else if ((m = val.match(regex$1['map']))) { + var count = 0, + c = ' '; + var res = []; + var content = ''; + var str = false; + for (var j = 0, lenJ = m[1].length; j < lenJ; ++j) { + c = m[1][j]; + if (c == "'" || c == '"') { + if (str === false) { + str = c; + content += c; + continue + } else if ((c == "'" && str == "'") || (c == '"' && str == '"')) { + str = false; + content += c; + continue + } + } else if (str === false && (c == '[' || c == '{')) { + ++count; + } else if (str === false && (c == ']' || c == '}')) { + --count; + } else if (str === false && count == 0 && c == ',') { + res.push(content); + content = ''; + continue + } + + content += c; + } + + if (content.length > 0) { res.push(content); } + + var newRes = {}; + for (var j = 0, lenJ = res.length; j < lenJ; ++j) { + if ((m = res[j].match(regex$1['key_value']))) { + newRes[m[1]] = processValue(m[2]); + } + } + + return newRes + } else { return val } +} + +function processFoldedBlock(block) { + var lines = block.lines; + var children = block.children; + var str = lines.join(' '); + var chunks = [str]; + for (var i = 0, len = children.length; i < len; ++i) { + chunks.push(processFoldedBlock(children[i])); + } + return chunks.join('\n') +} + +function processLiteralBlock(block) { + var lines = block.lines; + var children = block.children; + var str = lines.join('\n'); + for (var i = 0, len = children.length; i < len; ++i) { + str += processLiteralBlock(children[i]); + } + return str +} + +function processBlock(blocks) { + var m = null; + var res = {}; + var lines = null; + var children = null; + var currentObj = null; + + var level = -1; + + var processedBlocks = []; + + var isMap = true; + + for (var j = 0, lenJ = blocks.length; j < lenJ; ++j) { + if (level != -1 && level != blocks[j].level) { continue } + + processedBlocks.push(j); + + level = blocks[j].level; + lines = blocks[j].lines; + children = blocks[j].children; + currentObj = null; + + for (var i = 0, len = lines.length; i < len; ++i) { + var line = lines[i]; + + if ((m = line.match(regex$1['key']))) { + var key = m[1]; + + if (key[0] == '-') { + key = key.replace(regex$1['item'], ''); + if (isMap) { + isMap = false; + if (typeof res.length === 'undefined') { + res = []; + } + } + if (currentObj != null) { res.push(currentObj); } + currentObj = {}; + isMap = true; + } + + if (typeof m[2] != 'undefined') { + var value = m[2].replace(regex$1['trim'], ''); + if (value[0] == '&') { + var nb = processBlock(children); + if (currentObj != null) { currentObj[key] = nb; } + else { res[key] = nb; } + reference_blocks[value.substr(1)] = nb; + } else if (value[0] == '|') { + if (currentObj != null) + { currentObj[key] = processLiteralBlock(children.shift()); } + else { res[key] = processLiteralBlock(children.shift()); } + } else if (value[0] == '*') { + var v = value.substr(1); + var no = {}; + + if (typeof reference_blocks[v] == 'undefined') { + errors.push("Reference '" + v + "' not found!"); + } else { + for (var k in reference_blocks[v]) { + no[k] = reference_blocks[v][k]; + } + + if (currentObj != null) { currentObj[key] = no; } + else { res[key] = no; } + } + } else if (value[0] == '>') { + if (currentObj != null) + { currentObj[key] = processFoldedBlock(children.shift()); } + else { res[key] = processFoldedBlock(children.shift()); } + } else { + if (currentObj != null) { currentObj[key] = processValue(value); } + else { res[key] = processValue(value); } + } + } else { + if (currentObj != null) { currentObj[key] = processBlock(children); } + else { res[key] = processBlock(children); } + } + } else if (line.match(/^-\s*$/)) { + if (isMap) { + isMap = false; + if (typeof res.length === 'undefined') { + res = []; + } + } + if (currentObj != null) { res.push(currentObj); } + currentObj = {}; + isMap = true; + continue + } else if ((m = line.match(/^-\s*(.*)/))) { + if (currentObj != null) { currentObj.push(processValue(m[1])); } + else { + if (isMap) { + isMap = false; + if (typeof res.length === 'undefined') { + res = []; + } + } + res.push(processValue(m[1])); + } + continue + } + } + + if (currentObj != null) { + if (isMap) { + isMap = false; + if (typeof res.length === 'undefined') { + res = []; + } + } + res.push(currentObj); + } + } + + for (var j = processedBlocks.length - 1; j >= 0; --j) { + blocks.splice.call(blocks, processedBlocks[j], 1); + } + + return res +} + +function semanticAnalysis(blocks) { + var res = processBlock(blocks.children); + return res +} + +function preProcess(src) { + var m; + var lines = src.split('\n'); + + var r = regex$1['comment']; + + for (var i in lines) { + if ((m = lines[i].match(r))) { + /* var cmt = ""; + if(typeof m[3] != "undefined") + lines[i] = m[1]; + else if(typeof m[3] != "undefined") + lines[i] = m[3]; + else + lines[i] = ""; + */ + if (typeof m[3] !== 'undefined') { + lines[i] = m[0].substr(0, m[0].length - m[3].length); + } + } + } + + return lines.join('\n') +} + +function load(str) { + errors = []; + reference_blocks = []; + processing_time = new Date().getTime(); + var pre = preProcess(str); + var doc = parser$1(pre); + var res = semanticAnalysis(doc); + processing_time = new Date().getTime() - processing_time; + + return res +} + +/** + * Fork https://github.com/egoist/docute/blob/master/src/utils/front-matter.js + */ +/* eslint-disable */ +var optionalByteOrderMark = '\\ufeff?'; +var pattern = + '^(' + + optionalByteOrderMark + + '(= yaml =|---)' + + '$([\\s\\S]*?)' + + '(?:\\2|\\.\\.\\.)' + + '$' + + '' + + '(?:\\n)?)'; +// NOTE: If this pattern uses the 'g' flag the `regex` variable definition will +// need to be moved down into the functions that use it. +var regex = new RegExp(pattern, 'm'); + +function extractor(string) { + string = string || ''; + + var lines = string.split(/(\r?\n)/); + if (lines[0] && /= yaml =|---/.test(lines[0])) { + return parse(string) + } else { + return { attributes: {}, body: string } + } +} + +function parse(string) { + var match = regex.exec(string); + + if (!match) { + return { + attributes: {}, + body: string + } + } + + var yaml = match[match.length - 1].replace(/^\s+|\s+$/g, ''); + var attributes = load(yaml) || {}; + var body = string.replace(match[0], ''); + + return { attributes: attributes, body: body, frontmatter: yaml } +} + +var install = function (hook, vm) { + hook.beforeEach(function (content) { + var ref = extractor(content); + var attributes = ref.attributes; + var body = ref.body; + + vm.frontmatter = attributes; + + return body + }); +}; + +$docsify.plugins = [].concat(install, $docsify.plugins); + +}()); diff --git a/lib/plugins/front-matter.min.js b/lib/plugins/front-matter.min.js new file mode 100644 index 0000000..32f3a13 --- /dev/null +++ b/lib/plugins/front-matter.min.js @@ -0,0 +1 @@ +!function(){var b=[],y=[],t=0,R={regLevel:new RegExp("^([\\s\\-]+)"),invalidLine:new RegExp("^\\-\\-\\-|^\\.\\.\\.|^\\s*#.*|^\\s*$"),dashesString:new RegExp('^\\s*\\"([^\\"]*)\\"\\s*$'),quotesString:new RegExp("^\\s*\\'([^\\']*)\\'\\s*$"),float:new RegExp("^[+-]?[0-9]+\\.[0-9]+(e[+-]?[0-9]+(\\.[0-9]+)?)?$"),integer:new RegExp("^[+-]?[0-9]+$"),array:new RegExp("\\[\\s*(.*)\\s*\\]"),map:new RegExp("\\{\\s*(.*)\\s*\\}"),key_value:new RegExp("([a-z0-9_-][ a-z0-9_-]*):( .+)","i"),single_key_value:new RegExp("^([a-z0-9_-][ a-z0-9_-]*):( .+?)$","i"),key:new RegExp("([a-z0-9_-][ a-z0-9_-]+):( .+)?","i"),item:new RegExp("^-\\s+"),trim:new RegExp("^\\s+|\\s+$"),comment:new RegExp("([^\\'\\\"#]+([\\'\\\"][^\\'\\\"]*[\\'\\\"])*)*(#.*)?")};function m(e){return{parent:null,length:0,level:e,lines:[],children:[],addChild:function(e){this.children.push(e),++(e.parent=this).length}}}function N(e){var n=null;if("true"==(e=e.replace(R.trim,"")))return!0;if("false"==e)return!1;if(".NaN"==e)return Number.NaN;if("null"==e)return null;if(".inf"==e)return Number.POSITIVE_INFINITY;if("-.inf"==e)return Number.NEGATIVE_INFINITY;if(n=e.match(R.dashesString))return n[1];if(n=e.match(R.quotesString))return n[1];if(n=e.match(R.float))return parseFloat(n[0]);if(n=e.match(R.integer))return parseInt(n[0]);if(isNaN(n=Date.parse(e))){if(n=e.match(R.single_key_value))return(i={})[n[1]]=N(n[2]),i;if(n=e.match(R.array)){for(var t=0,r=" ",i=[],l="",u=!1,a=0,s=n[1].length;a"==d[0]?null!=u?u[v]=_(l.shift()):r[v]=_(l.shift()):null!=u?u[v]=N(d):r[v]=N(d)}else null!=u?u[v]=e(l):r[v]=e(l)}else{if(g.match(/^-\s*$/)){f&&(f=!1,void 0===r.length&&(r=[])),null!=u&&r.push(u),u={},f=!0;continue}if(t=g.match(/^-\s*(.*)/)){null!=u?u.push(N(t[1])):(f&&(f=!1,void 0===r.length&&(r=[])),r.push(N(t[1])));continue}}}null!=u&&(f&&(f=!1,void 0===r.length&&(r=[])),r.push(u))}for(h=s.length-1;0<=h;--h)n.splice.call(n,s[h],1);return r}(e.children)}function l(e){b=[],y=[],t=(new Date).getTime();var n=r(function(e){var n,t=R.regLevel,r=R.invalidLine,i=e.split("\n"),l=0,u=0,a=[],s=new m(-1),f=new m(0);s.addChild(f);var h=[],o="";a.push(f),h.push(l);for(var c=0,p=i.length;c': '>', + '"': '"', + '\'': ''', + '/': '/' + }; + + return String(string).replace(/[&<>"'/]/g, function (s) { return entityMap[s]; }) +} + +function getAllPaths(router) { + var paths = []; + + Docsify.dom.findAll('.sidebar-nav a:not(.section-link):not([data-nosearch])').forEach(function (node) { + var href = node.href; + var originHref = node.getAttribute('href'); + var path = router.parse(href).path; + + if ( + path && + paths.indexOf(path) === -1 && + !Docsify.util.isAbsolutePath(originHref) + ) { + paths.push(path); + } + }); + + return paths +} + +function saveData(maxAge, expireKey, indexKey) { + localStorage.setItem(expireKey, Date.now() + maxAge); + localStorage.setItem(indexKey, JSON.stringify(INDEXS)); +} + +function genIndex(path, content, router, depth) { + if ( content === void 0 ) content = ''; + + var tokens = window.marked.lexer(content); + var slugify = window.Docsify.slugify; + var index = {}; + var slug; + + tokens.forEach(function (token) { + if (token.type === 'heading' && token.depth <= depth) { + slug = router.toURL(path, {id: slugify(token.text)}); + index[slug] = {slug: slug, title: token.text, body: ''}; + } else { + if (!slug) { + return + } + if (!index[slug]) { + index[slug] = {slug: slug, title: '', body: ''}; + } else if (index[slug].body) { + index[slug].body += '\n' + (token.text || ''); + } else { + index[slug].body = token.text; + } + } + }); + slugify.clear(); + return index +} + +/** + * @param {String} query + * @returns {Array} + */ +function search(query) { + var matchingResults = []; + var data = []; + Object.keys(INDEXS).forEach(function (key) { + data = data.concat(Object.keys(INDEXS[key]).map(function (page) { return INDEXS[key][page]; })); + }); + + query = query.trim(); + var keywords = query.split(/[\s\-,\\/]+/); + if (keywords.length !== 1) { + keywords = [].concat(query, keywords); + } + + var loop = function ( i ) { + var post = data[i]; + var isMatch = false; + var resultStr = ''; + var postTitle = post.title && post.title.trim(); + var postContent = post.body && post.body.trim(); + var postUrl = post.slug || ''; + + if (postTitle && postContent) { + keywords.forEach(function (keyword) { + // From https://github.com/sindresorhus/escape-string-regexp + var regEx = new RegExp( + keyword.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&'), + 'gi' + ); + var indexTitle = -1; + var indexContent = -1; + + indexTitle = postTitle && postTitle.search(regEx); + indexContent = postContent && postContent.search(regEx); + + if (indexTitle < 0 && indexContent < 0) { + isMatch = false; + } else { + isMatch = true; + if (indexContent < 0) { + indexContent = 0; + } + + var start = 0; + var end = 0; + + start = indexContent < 11 ? 0 : indexContent - 10; + end = start === 0 ? 70 : indexContent + keyword.length + 60; + + if (end > postContent.length) { + end = postContent.length; + } + + var matchContent = + '...' + + escapeHtml(postContent) + .substring(start, end) + .replace(regEx, ("" + keyword + "")) + + '...'; + + resultStr += matchContent; + } + }); + + if (isMatch) { + var matchingPost = { + title: escapeHtml(postTitle), + content: resultStr, + url: postUrl + }; + + matchingResults.push(matchingPost); + } + } + }; + + for (var i = 0; i < data.length; i++) loop( i ); + + return matchingResults +} + +function init$1(config, vm) { + var isAuto = config.paths === 'auto'; + + var expireKey = resolveExpireKey(config.namespace); + var indexKey = resolveIndexKey(config.namespace); + + var isExpired = localStorage.getItem(expireKey) < Date.now(); + + INDEXS = JSON.parse(localStorage.getItem(indexKey)); + + if (isExpired) { + INDEXS = {}; + } else if (!isAuto) { + return + } + + var paths = isAuto ? getAllPaths(vm.router) : config.paths; + var len = paths.length; + var count = 0; + + paths.forEach(function (path) { + if (INDEXS[path]) { + return count++ + } + + Docsify + .get(vm.router.getFile(path), false, vm.config.requestHeaders) + .then(function (result) { + INDEXS[path] = genIndex(path, result, vm.router, config.depth); + len === ++count && saveData(config.maxAge, expireKey, indexKey); + }); + }); +} + +var NO_DATA_TEXT = ''; +var options; + +function style() { + var code = "\n.sidebar {\n padding-top: 0;\n}\n\n.search {\n margin-bottom: 20px;\n padding: 6px;\n border-bottom: 1px solid #eee;\n}\n\n.search .input-wrap {\n display: flex;\n align-items: center;\n}\n\n.search .results-panel {\n display: none;\n}\n\n.search .results-panel.show {\n display: block;\n}\n\n.search input {\n outline: none;\n border: none;\n width: 100%;\n padding: 0 7px;\n line-height: 36px;\n font-size: 14px;\n}\n\n.search input::-webkit-search-decoration,\n.search input::-webkit-search-cancel-button,\n.search input {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n.search .clear-button {\n width: 36px;\n text-align: right;\n display: none;\n}\n\n.search .clear-button.show {\n display: block;\n}\n\n.search .clear-button svg {\n transform: scale(.5);\n}\n\n.search h2 {\n font-size: 17px;\n margin: 10px 0;\n}\n\n.search a {\n text-decoration: none;\n color: inherit;\n}\n\n.search .matching-post {\n border-bottom: 1px solid #eee;\n}\n\n.search .matching-post:last-child {\n border-bottom: 0;\n}\n\n.search p {\n font-size: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n\n.search p.empty {\n text-align: center;\n}\n\n.app-name.hide, .sidebar-nav.hide {\n display: none;\n}"; + + Docsify.dom.style(code); +} + +function tpl(defaultValue) { + if ( defaultValue === void 0 ) defaultValue = ''; + + var html = + "
    \n \n
    \n \n \n \n \n \n
    \n
    \n
    \n "; + var el = Docsify.dom.create('div', html); + var aside = Docsify.dom.find('aside'); + + Docsify.dom.toggleClass(el, 'search'); + Docsify.dom.before(aside, el); +} + +function doSearch(value) { + var $search = Docsify.dom.find('div.search'); + var $panel = Docsify.dom.find($search, '.results-panel'); + var $clearBtn = Docsify.dom.find($search, '.clear-button'); + var $sidebarNav = Docsify.dom.find('.sidebar-nav'); + var $appName = Docsify.dom.find('.app-name'); + + if (!value) { + $panel.classList.remove('show'); + $clearBtn.classList.remove('show'); + $panel.innerHTML = ''; + + if (options.hideOtherSidebarContent) { + $sidebarNav.classList.remove('hide'); + $appName.classList.remove('hide'); + } + return + } + var matchs = search(value); + + var html = ''; + matchs.forEach(function (post) { + html += ""; + }); + + $panel.classList.add('show'); + $clearBtn.classList.add('show'); + $panel.innerHTML = html || ("

    " + NO_DATA_TEXT + "

    "); + if (options.hideOtherSidebarContent) { + $sidebarNav.classList.add('hide'); + $appName.classList.add('hide'); + } +} + +function bindEvents() { + var $search = Docsify.dom.find('div.search'); + var $input = Docsify.dom.find($search, 'input'); + var $inputWrap = Docsify.dom.find($search, '.input-wrap'); + + var timeId; + // Prevent to Fold sidebar + Docsify.dom.on( + $search, + 'click', + function (e) { return e.target.tagName !== 'A' && e.stopPropagation(); } + ); + Docsify.dom.on($input, 'input', function (e) { + clearTimeout(timeId); + timeId = setTimeout(function (_) { return doSearch(e.target.value.trim()); }, 100); + }); + Docsify.dom.on($inputWrap, 'click', function (e) { + // Click input outside + if (e.target.tagName !== 'INPUT') { + $input.value = ''; + doSearch(); + } + }); +} + +function updatePlaceholder(text, path) { + var $input = Docsify.dom.getNode('.search input[type="search"]'); + + if (!$input) { + return + } + if (typeof text === 'string') { + $input.placeholder = text; + } else { + var match = Object.keys(text).filter(function (key) { return path.indexOf(key) > -1; })[0]; + $input.placeholder = text[match]; + } +} + +function updateNoData(text, path) { + if (typeof text === 'string') { + NO_DATA_TEXT = text; + } else { + var match = Object.keys(text).filter(function (key) { return path.indexOf(key) > -1; })[0]; + NO_DATA_TEXT = text[match]; + } +} + +function updateOptions(opts) { + options = opts; +} + +function init(opts, vm) { + var keywords = vm.router.parse().query.s; + + updateOptions(opts); + style(); + tpl(keywords); + bindEvents(); + keywords && setTimeout(function (_) { return doSearch(keywords); }, 500); +} + +function update(opts, vm) { + updateOptions(opts); + updatePlaceholder(opts.placeholder, vm.route.path); + updateNoData(opts.noData, vm.route.path); +} + +var CONFIG = { + placeholder: 'Type to search', + noData: 'No Results!', + paths: 'auto', + depth: 2, + maxAge: 86400000, // 1 day + hideOtherSidebarContent: false, + namespace: undefined +}; + +var install = function (hook, vm) { + var util = Docsify.util; + var opts = vm.config.search || CONFIG; + + if (Array.isArray(opts)) { + CONFIG.paths = opts; + } else if (typeof opts === 'object') { + CONFIG.paths = Array.isArray(opts.paths) ? opts.paths : 'auto'; + CONFIG.maxAge = util.isPrimitive(opts.maxAge) ? opts.maxAge : CONFIG.maxAge; + CONFIG.placeholder = opts.placeholder || CONFIG.placeholder; + CONFIG.noData = opts.noData || CONFIG.noData; + CONFIG.depth = opts.depth || CONFIG.depth; + CONFIG.hideOtherSidebarContent = opts.hideOtherSidebarContent || CONFIG.hideOtherSidebarContent; + CONFIG.namespace = opts.namespace || CONFIG.namespace; + } + + var isAuto = CONFIG.paths === 'auto'; + + hook.mounted(function (_) { + init(CONFIG, vm); + !isAuto && init$1(CONFIG, vm); + }); + hook.doneEach(function (_) { + update(CONFIG, vm); + isAuto && init$1(CONFIG, vm); + }); +}; + +$docsify.plugins = [].concat(install, $docsify.plugins); + +}()); diff --git a/lib/plugins/search.min.js b/lib/plugins/search.min.js new file mode 100644 index 0000000..14d5be2 --- /dev/null +++ b/lib/plugins/search.min.js @@ -0,0 +1 @@ +!function(){var f={},u={EXPIRE_KEY:"docsify.search.expires",INDEX_KEY:"docsify.search.index"};function h(e){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(e).replace(/[&<>"'/]/g,function(e){return n[e]})}function o(o,r){var e,n,t="auto"===o.paths,s=(e=o.namespace)?u.EXPIRE_KEY+"/"+e:u.EXPIRE_KEY,c=(n=o.namespace)?u.INDEX_KEY+"/"+n:u.INDEX_KEY,a=localStorage.getItem(s)l.length&&(o=l.length);var r="..."+h(l).substring(i,o).replace(t,''+e+"")+"...";c+=r}}),s)){var a={title:h(d),content:c,url:t};i.push(a)}},t=0;t\n

    '+e.title+"

    \n

    "+e.content+"

    \n\n"}),t.classList.add("show"),a.classList.add("show"),t.innerHTML=s||'

    '+d+"

    ",c.hideOtherSidebarContent&&(i.classList.add("hide"),o.classList.add("hide"))}function l(e){c=e}function r(e,n){var t,a,i,o,r=n.router.parse().query.s;l(e),Docsify.dom.style("\n.sidebar {\n padding-top: 0;\n}\n\n.search {\n margin-bottom: 20px;\n padding: 6px;\n border-bottom: 1px solid #eee;\n}\n\n.search .input-wrap {\n display: flex;\n align-items: center;\n}\n\n.search .results-panel {\n display: none;\n}\n\n.search .results-panel.show {\n display: block;\n}\n\n.search input {\n outline: none;\n border: none;\n width: 100%;\n padding: 0 7px;\n line-height: 36px;\n font-size: 14px;\n}\n\n.search input::-webkit-search-decoration,\n.search input::-webkit-search-cancel-button,\n.search input {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n.search .clear-button {\n width: 36px;\n text-align: right;\n display: none;\n}\n\n.search .clear-button.show {\n display: block;\n}\n\n.search .clear-button svg {\n transform: scale(.5);\n}\n\n.search h2 {\n font-size: 17px;\n margin: 10px 0;\n}\n\n.search a {\n text-decoration: none;\n color: inherit;\n}\n\n.search .matching-post {\n border-bottom: 1px solid #eee;\n}\n\n.search .matching-post:last-child {\n border-bottom: 0;\n}\n\n.search p {\n font-size: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n\n.search p.empty {\n text-align: center;\n}\n\n.app-name.hide, .sidebar-nav.hide {\n display: none;\n}"),function(e){void 0===e&&(e="");var n='
    \n \n
    \n \n \n \n \n \n
    \n
    \n
    \n ',t=Docsify.dom.create("div",n),a=Docsify.dom.find("aside");Docsify.dom.toggleClass(t,"search"),Docsify.dom.before(a,t)}(r),a=Docsify.dom.find("div.search"),i=Docsify.dom.find(a,"input"),o=Docsify.dom.find(a,".input-wrap"),Docsify.dom.on(a,"click",function(e){return"A"!==e.target.tagName&&e.stopPropagation()}),Docsify.dom.on(i,"input",function(n){clearTimeout(t),t=setTimeout(function(e){return s(n.target.value.trim())},100)}),Docsify.dom.on(o,"click",function(e){"INPUT"!==e.target.tagName&&(i.value="",s())}),r&&setTimeout(function(e){return s(r)},500)}function p(e,n){l(e),function(e,n){var t=Docsify.dom.getNode('.search input[type="search"]');if(t)if("string"==typeof e)t.placeholder=e;else{var a=Object.keys(e).filter(function(e){return-1w.scrollOffset&&o(150);}},u=function(a){-1E.scrollOffset&&p(150)}},z=function(e){-1nav,body:not(.ready) [data-cloak]{display:none}div#app{font-size:30px;font-weight:lighter;margin:40vh auto;text-align:center}div#app:empty:before{content:"Loading..."}.emoji{height:1.2rem;vertical-align:middle}.progress{background-color:var(--theme-color,#0074d9);height:2px;left:0;position:fixed;right:0;top:0;transition:width .2s,opacity .4s;width:0;z-index:5}.search .search-keyword,.search a:hover{color:var(--theme-color,#0074d9)}.search .search-keyword{font-style:normal;font-weight:700}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:#34495e;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0;overflow-x:hidden}img{max-width:100%}a[disabled]{cursor:not-allowed;opacity:.6}kbd{border:1px solid #ccc;border-radius:3px;display:inline-block;font-size:12px!important;line-height:12px;margin-bottom:3px;padding:3px 5px;vertical-align:middle}li input[type=checkbox]{margin:0 .2em .25em 0;vertical-align:middle}.app-nav{margin:25px 60px 0 0;position:absolute;right:0;text-align:right;z-index:2}.app-nav.no-badge{margin-right:25px}.app-nav p{margin:0}.app-nav>a{margin:0 1rem;padding:5px 0}.app-nav li,.app-nav ul{display:inline-block;list-style:none;margin:0}.app-nav a{color:inherit;font-size:16px;text-decoration:none;transition:color .3s}.app-nav a.active,.app-nav a:hover{color:var(--theme-color,#0074d9)}.app-nav a.active{border-bottom:2px solid var(--theme-color,#0074d9)}.app-nav li{display:inline-block;margin:0 1rem;padding:5px 0;position:relative}.app-nav li ul{background-color:#fff;border:1px solid #ddd;border-bottom-color:#ccc;border-radius:4px;box-sizing:border-box;display:none;max-height:calc(100vh - 61px);overflow-y:auto;padding:10px 0;position:absolute;right:-15px;text-align:left;top:100%;white-space:nowrap}.app-nav li ul li{display:block;font-size:14px;line-height:1rem;margin:0;margin:8px 14px;white-space:nowrap}.app-nav li ul a{display:block;font-size:inherit;margin:0;padding:0}.app-nav li ul a.active{border-bottom:0}.app-nav li:hover ul{display:block}.github-corner{border-bottom:0;position:fixed;right:0;text-decoration:none;top:0;z-index:1}.github-corner:hover .octo-arm{animation:a .56s ease-in-out}.github-corner svg{color:#fff;fill:var(--theme-color,#0074d9);height:80px;width:80px}main{display:block;position:relative;width:100vw;height:100%;z-index:0}main.hidden{display:none}.anchor{display:inline-block;text-decoration:none;transition:all .3s}.anchor span{color:#34495e}.anchor:hover{text-decoration:underline}.sidebar{border-right:1px solid rgba(0,0,0,.07);overflow-y:auto;padding:40px 0 0;position:absolute;top:0;bottom:0;left:0;transition:transform .25s ease-out;width:16rem;z-index:3}.sidebar>h1{margin:0 auto 1rem;font-size:1.5rem;font-weight:300;text-align:center}.sidebar>h1 a{color:inherit;text-decoration:none}.sidebar>h1 .app-nav{display:block;position:static}.sidebar .sidebar-nav{line-height:2em;padding-bottom:40px}.sidebar li.collapse .app-sub-sidebar{display:none}.sidebar ul{margin:0 0 0 15px;padding:0}.sidebar li>p{font-weight:700;margin:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{border-bottom:none;display:block}.sidebar ul li ul{padding-left:20px}.sidebar::-webkit-scrollbar{width:4px}.sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}.sidebar:hover::-webkit-scrollbar-thumb{background:hsla(0,0%,53%,.4)}.sidebar:hover::-webkit-scrollbar-track{background:hsla(0,0%,53%,.1)}.sidebar-toggle{background-color:transparent;background-color:hsla(0,0%,100%,.8);border:0;outline:none;padding:10px;position:absolute;bottom:0;left:0;text-align:center;transition:opacity .3s;width:0;z-index:4}.sidebar-toggle .sidebar-toggle-button:hover{opacity:.4}.sidebar-toggle span{background-color:var(--theme-color,#0074d9);display:block;margin-bottom:4px;width:16px;height:2px}body.sticky .sidebar,body.sticky .sidebar-toggle{position:fixed}.content{padding-top:60px;position:absolute;top:0;right:0;bottom:0;left:16rem;transition:left .25s ease}.markdown-section{margin:0 auto;max-width:800px;padding:30px 15px 40px;position:relative}.markdown-section>*{box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}.markdown-section hr{border:none;border-bottom:1px solid #eee;margin:2em 0}.markdown-section iframe{border:1px solid #eee;width:1px;min-width:100%}.markdown-section table{border-collapse:collapse;border-spacing:0;display:block;margin-bottom:1rem;overflow:auto;width:100%}.markdown-section th{font-weight:700}.markdown-section td,.markdown-section th{border:1px solid #ddd;padding:6px 13px}.markdown-section tr{border-top:1px solid #ccc}.markdown-section p.tip,.markdown-section tr:nth-child(2n){background-color:#f8f8f8}.markdown-section p.tip{border-bottom-right-radius:2px;border-left:4px solid #f66;border-top-right-radius:2px;margin:2em 0;padding:12px 24px 12px 30px;position:relative}.markdown-section p.tip:before{background-color:#f66;border-radius:100%;color:#fff;content:"!";font-family:Dosis,Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:14px;font-weight:700;left:-12px;line-height:20px;position:absolute;height:20px;width:20px;text-align:center;top:14px}.markdown-section p.tip code{background-color:#efefef}.markdown-section p.tip em{color:#34495e}.markdown-section p.warn{background:rgba(0,116,217,.1);border-radius:2px;padding:1rem}.markdown-section ul.task-list>li{list-style-type:none}body.close .sidebar{transform:translateX(-16rem)}body.close .sidebar-toggle{width:auto}body.close .content{left:0}@media print{.app-nav,.github-corner,.sidebar,.sidebar-toggle{display:none}}@media screen and (max-width:768px){.github-corner,.sidebar,.sidebar-toggle{position:fixed}.app-nav{margin-top:16px}.app-nav li ul{top:30px}main{height:auto;overflow-x:hidden}.sidebar{left:-16rem;transition:transform .25s ease-out}.content{left:0;max-width:100vw;position:static;padding-top:20px;transition:transform .25s ease}.app-nav,.github-corner{transition:transform .25s ease-out}.sidebar-toggle{background-color:transparent;width:auto;padding:30px 30px 10px 10px}body.close .sidebar{transform:translateX(16rem)}body.close .sidebar-toggle{background-color:hsla(0,0%,100%,.8);transition:background-color 1s;width:0;padding:10px}body.close .content{transform:translateX(16rem)}body.close .app-nav,body.close .github-corner{display:none}.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:a .56s ease-in-out}}@keyframes a{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}section.cover{-ms-flex-align:center;align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;height:100vh;display:none}section.cover.show{display:-ms-flexbox;display:flex}section.cover.has-mask .mask{background-color:#fff;opacity:.8;position:absolute;top:0;height:100%;width:100%}section.cover .cover-main{-ms-flex:1;flex:1;margin:-20px 16px 0;text-align:center;z-index:1}section.cover a{color:inherit}section.cover a,section.cover a:hover{text-decoration:none}section.cover p{line-height:1.5rem;margin:1em 0}section.cover h1{color:inherit;font-size:2.5rem;font-weight:300;margin:.625rem 0 2.5rem;position:relative;text-align:center}section.cover h1 a{display:block}section.cover h1 small{bottom:-.4375rem;font-size:1rem;position:absolute}section.cover blockquote{font-size:1.5rem;text-align:center}section.cover ul{line-height:1.8;list-style-type:none;margin:1em auto;max-width:500px;padding:0}section.cover .cover-main>p:last-child a{border:1px solid var(--theme-color,#0074d9);border-radius:2rem;box-sizing:border-box;color:var(--theme-color,#0074d9);display:inline-block;font-size:1.05rem;letter-spacing:.1rem;margin:.5rem 1rem;padding:.75em 2rem;text-decoration:none;transition:all .15s ease}section.cover .cover-main>p:last-child a:last-child{background-color:var(--theme-color,#0074d9);color:#fff}section.cover .cover-main>p:last-child a:last-child:hover{color:inherit;opacity:.8}section.cover .cover-main>p:last-child a:hover{color:inherit}section.cover blockquote>p>a{border-bottom:2px solid var(--theme-color,#0074d9);transition:color .3s}section.cover blockquote>p>a:hover{color:var(--theme-color,#0074d9)}.sidebar{color:#364149;background-color:#fff}.sidebar a{color:#666;text-decoration:none}.sidebar li{list-style:none;margin:0;padding:.2em 0}.sidebar ul li ul{padding:0}.sidebar li.active{background-color:#eee}.sidebar li.active a{color:#333}.markdown-section h1,.markdown-section h2,.markdown-section h3,.markdown-section h4,.markdown-section strong{color:#333;font-weight:400}.markdown-section a{color:var(--theme-color,#0074d9);font-weight:400}.markdown-section ol,.markdown-section p,.markdown-section ul{line-height:1.6rem;margin:0 0 1em;word-spacing:.05rem}.markdown-section h1{font-size:2rem;font-weight:500;margin:0 0 1rem}.markdown-section h2{font-size:1.8rem;font-weight:400;margin:0 0 1rem;padding:1rem 0 0}.markdown-section h3{font-size:1.5rem;margin:52px 0 1.2rem}.markdown-section h4{font-size:1.25rem}.markdown-section h5{font-size:1rem}.markdown-section h6{color:#777;font-size:1rem}.markdown-section figure,.markdown-section ol,.markdown-section p,.markdown-section ul{margin:1.2em 0}.markdown-section ol,.markdown-section ul{padding-left:1.5rem}.markdown-section li{line-height:1.5;margin:0}.markdown-section blockquote{border-left:4px solid var(--theme-color,#0074d9);color:#858585;margin:2em 0;padding-left:20px}.markdown-section blockquote p{font-weight:600;margin-left:0}.markdown-section iframe{margin:1em 0}.markdown-section em{color:#7f8c8d}.markdown-section code{border-radius:3px;padding:.2em .4rem;white-space:nowrap}.markdown-section code,.markdown-section pre{background-color:#f9f9f9;font-family:Inconsolata}.markdown-section pre{border-left:2px solid #eee;font-size:16px;margin:0 0 1em;padding:8px;padding:0 10px 12px 0;overflow:auto;word-wrap:normal;position:relative}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#93a1a1}.token.punctuation{color:#586e75}.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#268bd2}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string,.token.url{color:#2aa198}.token.entity{color:#657b83;background:#eee8d5}.token.atrule,.token.attr-value,.token.keyword{color:#a11}.token.function{color:#b58900}.token.important,.token.regex,.token.variable{color:#cb4b16}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.markdown-section pre>code{background-color:#f8f8f8;border-radius:2px;display:block;font-family:Inconsolata;line-height:1.1rem;max-width:inherit;overflow:inherit;padding:20px .8em;position:relative;white-space:inherit}.markdown-section code:after,.markdown-section code:before{letter-spacing:.05rem}code .token{-webkit-font-smoothing:initial;-moz-osx-font-smoothing:initial;min-height:1.5rem} \ No newline at end of file diff --git a/lib/themes/dark.css b/lib/themes/dark.css new file mode 100644 index 0000000..112d926 --- /dev/null +++ b/lib/themes/dark.css @@ -0,0 +1 @@ +@import url("https://fonts.googleapis.com/css?family=Roboto+Mono|Source+Sans+Pro:300,400,600");*{-webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:none;-webkit-touch-callout:none;box-sizing:border-box}body:not(.ready){overflow:hidden}body:not(.ready) .app-nav,body:not(.ready)>nav,body:not(.ready) [data-cloak]{display:none}div#app{font-size:30px;font-weight:lighter;margin:40vh auto;text-align:center}div#app:empty:before{content:"Loading..."}.emoji{height:1.2rem;vertical-align:middle}.progress{background-color:var(--theme-color,#ea6f5a);height:2px;left:0;position:fixed;right:0;top:0;transition:width .2s,opacity .4s;width:0;z-index:5}.search .search-keyword,.search a:hover{color:var(--theme-color,#ea6f5a)}.search .search-keyword{font-style:normal;font-weight:700}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:#c8c8c8;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0;overflow-x:hidden}img{max-width:100%}a[disabled]{cursor:not-allowed;opacity:.6}kbd{border:1px solid #ccc;border-radius:3px;display:inline-block;font-size:12px!important;line-height:12px;margin-bottom:3px;padding:3px 5px;vertical-align:middle}li input[type=checkbox]{margin:0 .2em .25em 0;vertical-align:middle}.app-nav{margin:25px 60px 0 0;position:absolute;right:0;text-align:right;z-index:2}.app-nav.no-badge{margin-right:25px}.app-nav p{margin:0}.app-nav>a{margin:0 1rem;padding:5px 0}.app-nav li,.app-nav ul{display:inline-block;list-style:none;margin:0}.app-nav a{color:inherit;font-size:16px;text-decoration:none;transition:color .3s}.app-nav a.active,.app-nav a:hover{color:var(--theme-color,#ea6f5a)}.app-nav a.active{border-bottom:2px solid var(--theme-color,#ea6f5a)}.app-nav li{display:inline-block;margin:0 1rem;padding:5px 0;position:relative}.app-nav li ul{background-color:#fff;border:1px solid #ddd;border-bottom-color:#ccc;border-radius:4px;box-sizing:border-box;display:none;max-height:calc(100vh - 61px);overflow-y:auto;padding:10px 0;position:absolute;right:-15px;text-align:left;top:100%;white-space:nowrap}.app-nav li ul li{display:block;font-size:14px;line-height:1rem;margin:0;margin:8px 14px;white-space:nowrap}.app-nav li ul a{display:block;font-size:inherit;margin:0;padding:0}.app-nav li ul a.active{border-bottom:0}.app-nav li:hover ul{display:block}.github-corner{border-bottom:0;position:fixed;right:0;text-decoration:none;top:0;z-index:1}.github-corner:hover .octo-arm{animation:a .56s ease-in-out}.github-corner svg{color:#3f3f3f;fill:var(--theme-color,#ea6f5a);height:80px;width:80px}main{display:block;position:relative;width:100vw;height:100%;z-index:0}main.hidden{display:none}.anchor{display:inline-block;text-decoration:none;transition:all .3s}.anchor span{color:#c8c8c8}.anchor:hover{text-decoration:underline}.sidebar{border-right:1px solid rgba(0,0,0,.07);overflow-y:auto;padding:40px 0 0;position:absolute;top:0;bottom:0;left:0;transition:transform .25s ease-out;width:300px;z-index:3}.sidebar>h1{margin:0 auto 1rem;font-size:1.5rem;font-weight:300;text-align:center}.sidebar>h1 a{color:inherit;text-decoration:none}.sidebar>h1 .app-nav{display:block;position:static}.sidebar .sidebar-nav{line-height:2em;padding-bottom:40px}.sidebar li.collapse .app-sub-sidebar{display:none}.sidebar ul{margin:0 0 0 15px;padding:0}.sidebar li>p{font-weight:700;margin:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{border-bottom:none;display:block}.sidebar ul li ul{padding-left:20px}.sidebar::-webkit-scrollbar{width:4px}.sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}.sidebar:hover::-webkit-scrollbar-thumb{background:hsla(0,0%,53%,.4)}.sidebar:hover::-webkit-scrollbar-track{background:hsla(0,0%,53%,.1)}.sidebar-toggle{background-color:transparent;background-color:rgba(63,63,63,.8);border:0;outline:none;padding:10px;position:absolute;bottom:0;left:0;text-align:center;transition:opacity .3s;width:284px;z-index:4}.sidebar-toggle .sidebar-toggle-button:hover{opacity:.4}.sidebar-toggle span{background-color:var(--theme-color,#ea6f5a);display:block;margin-bottom:4px;width:16px;height:2px}body.sticky .sidebar,body.sticky .sidebar-toggle{position:fixed}.content{padding-top:60px;position:absolute;top:0;right:0;bottom:0;left:300px;transition:left .25s ease}.markdown-section{margin:0 auto;max-width:800px;padding:30px 15px 40px;position:relative}.markdown-section>*{box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}.markdown-section hr{border:none;border-bottom:1px solid #eee;margin:2em 0}.markdown-section iframe{border:1px solid #eee;width:1px;min-width:100%}.markdown-section table{border-collapse:collapse;border-spacing:0;display:block;margin-bottom:1rem;overflow:auto;width:100%}.markdown-section th{font-weight:700}.markdown-section td,.markdown-section th{border:1px solid #ddd;padding:6px 13px}.markdown-section tr{border-top:1px solid #ccc}.markdown-section p.tip,.markdown-section tr:nth-child(2n){background-color:#f8f8f8}.markdown-section p.tip{border-bottom-right-radius:2px;border-left:4px solid #f66;border-top-right-radius:2px;margin:2em 0;padding:12px 24px 12px 30px;position:relative}.markdown-section p.tip:before{background-color:#f66;border-radius:100%;color:#3f3f3f;content:"!";font-family:Dosis,Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:14px;font-weight:700;left:-12px;line-height:20px;position:absolute;height:20px;width:20px;text-align:center;top:14px}.markdown-section p.tip code{background-color:#efefef}.markdown-section p.tip em{color:#c8c8c8}.markdown-section p.warn{background:hsla(9,77%,64%,.1);border-radius:2px;padding:1rem}.markdown-section ul.task-list>li{list-style-type:none}body.close .sidebar{transform:translateX(-300px)}body.close .sidebar-toggle{width:auto}body.close .content{left:0}@media print{.app-nav,.github-corner,.sidebar,.sidebar-toggle{display:none}}@media screen and (max-width:768px){.github-corner,.sidebar,.sidebar-toggle{position:fixed}.app-nav{margin-top:16px}.app-nav li ul{top:30px}main{height:auto;overflow-x:hidden}.sidebar{left:-300px;transition:transform .25s ease-out}.content{left:0;max-width:100vw;position:static;padding-top:20px;transition:transform .25s ease}.app-nav,.github-corner{transition:transform .25s ease-out}.sidebar-toggle{background-color:transparent;width:auto;padding:30px 30px 10px 10px}body.close .sidebar{transform:translateX(300px)}body.close .sidebar-toggle{background-color:rgba(63,63,63,.8);transition:background-color 1s;width:284px;padding:10px}body.close .content{transform:translateX(300px)}body.close .app-nav,body.close .github-corner{display:none}.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:a .56s ease-in-out}}@keyframes a{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}section.cover{-ms-flex-align:center;align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;height:100vh;display:none}section.cover.show{display:-ms-flexbox;display:flex}section.cover.has-mask .mask{background-color:#3f3f3f;opacity:.8;position:absolute;top:0;height:100%;width:100%}section.cover .cover-main{-ms-flex:1;flex:1;margin:-20px 16px 0;text-align:center;z-index:1}section.cover a{color:inherit}section.cover a,section.cover a:hover{text-decoration:none}section.cover p{line-height:1.5rem;margin:1em 0}section.cover h1{color:inherit;font-size:2.5rem;font-weight:300;margin:.625rem 0 2.5rem;position:relative;text-align:center}section.cover h1 a{display:block}section.cover h1 small{bottom:-.4375rem;font-size:1rem;position:absolute}section.cover blockquote{font-size:1.5rem;text-align:center}section.cover ul{line-height:1.8;list-style-type:none;margin:1em auto;max-width:500px;padding:0}section.cover .cover-main>p:last-child a{border:1px solid var(--theme-color,#ea6f5a);border-radius:2rem;box-sizing:border-box;color:var(--theme-color,#ea6f5a);display:inline-block;font-size:1.05rem;letter-spacing:.1rem;margin:.5rem 1rem;padding:.75em 2rem;text-decoration:none;transition:all .15s ease}section.cover .cover-main>p:last-child a:last-child{background-color:var(--theme-color,#ea6f5a);color:#fff}section.cover .cover-main>p:last-child a:last-child:hover{color:inherit;opacity:.8}section.cover .cover-main>p:last-child a:hover{color:inherit}section.cover blockquote>p>a{border-bottom:2px solid var(--theme-color,#ea6f5a);transition:color .3s}section.cover blockquote>p>a:hover{color:var(--theme-color,#ea6f5a)}.sidebar,body{background-color:#3f3f3f}.sidebar{color:#c8c8c8}.sidebar li{margin:6px 15px 6px 0}.sidebar ul li a{color:#c8c8c8;font-size:14px;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.sidebar ul li a:hover{text-decoration:underline}.sidebar ul li ul{padding:0}.sidebar ul li.active>a{color:var(--theme-color,#ea6f5a);font-weight:600}.markdown-section h1,.markdown-section h2,.markdown-section h3,.markdown-section h4,.markdown-section strong{color:#657b83;font-weight:600}.markdown-section a{color:var(--theme-color,#ea6f5a);font-weight:600}.markdown-section h1{font-size:2rem;margin:0 0 1rem}.markdown-section h2{font-size:1.75rem;margin:45px 0 .8rem}.markdown-section h3{font-size:1.5rem;margin:40px 0 .6rem}.markdown-section h4{font-size:1.25rem}.markdown-section h5{font-size:1rem}.markdown-section h6{color:#777;font-size:1rem}.markdown-section figure,.markdown-section ol,.markdown-section p,.markdown-section ul{margin:1.2em 0}.markdown-section ol,.markdown-section p,.markdown-section ul{line-height:1.6rem;word-spacing:.05rem}.markdown-section ol,.markdown-section ul{padding-left:1.5rem}.markdown-section blockquote{border-left:4px solid var(--theme-color,#ea6f5a);color:#858585;margin:2em 0;padding-left:20px}.markdown-section blockquote p{font-weight:600;margin-left:0}.markdown-section iframe{margin:1em 0}.markdown-section em{color:#7f8c8d}.markdown-section code{border-radius:2px;color:#657b83;font-size:.8rem;margin:0 2px;padding:3px 5px;white-space:pre-wrap}.markdown-section code,.markdown-section pre{background-color:#282828;font-family:Roboto Mono,Monaco,courier,monospace}.markdown-section pre{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;line-height:1.5rem;margin:1.2em 0;overflow:auto;padding:0 1.4rem;position:relative;word-wrap:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#8e908c}.token.namespace{opacity:.7}.token.boolean,.token.number{color:#c76b29}.token.punctuation{color:#525252}.token.property{color:#c08b30}.token.tag{color:#2973b7}.token.string{color:var(--theme-color,#ea6f5a)}.token.selector{color:#6679cc}.token.attr-name{color:#2973b7}.language-css .token.string,.style .token.string,.token.entity,.token.url{color:#22a2c9}.token.attr-value,.token.control,.token.directive,.token.unit{color:var(--theme-color,#ea6f5a)}.token.keyword{color:#e96900}.token.atrule,.token.regex,.token.statement{color:#22a2c9}.token.placeholder,.token.variable{color:#3d8fd1}.token.deleted{text-decoration:line-through}.token.inserted{border-bottom:1px dotted #202746;text-decoration:none}.token.italic{font-style:italic}.token.bold,.token.important{font-weight:700}.token.important{color:#c94922}.token.entity{cursor:help}.markdown-section pre>code{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;background-color:#282828;border-radius:2px;color:#657b83;display:block;font-family:Roboto Mono,Monaco,courier,monospace;font-size:.8rem;line-height:inherit;margin:0 2px;max-width:inherit;overflow:inherit;padding:2.2em 5px;white-space:inherit}.markdown-section code:after,.markdown-section code:before{letter-spacing:.05rem}code .token{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;min-height:1.5rem}pre:after{color:#ccc;content:attr(data-lang);font-size:.6rem;font-weight:600;height:15px;line-height:15px;padding:5px 10px 0;position:absolute;right:0;text-align:right;top:0}.markdown-section p.tip{background-color:#282828;color:#657b83}input[type=search]{background:#4f4f4f;border-color:#4f4f4f;color:#c8c8c8} \ No newline at end of file diff --git a/lib/themes/dolphin.css b/lib/themes/dolphin.css new file mode 100644 index 0000000..cecdfb1 --- /dev/null +++ b/lib/themes/dolphin.css @@ -0,0 +1 @@ +@import url("https://fonts.googleapis.com/css?family=Thasadith:400,400i,700");*{-webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:none;-webkit-touch-callout:none;box-sizing:border-box}body:not(.ready){overflow:hidden}body:not(.ready) .app-nav,body:not(.ready)>nav,body:not(.ready) [data-cloak]{display:none}div#app{font-size:30px;font-weight:lighter;margin:40vh auto;text-align:center}div#app:empty:before{content:"Loading..."}.emoji{height:1.2rem;vertical-align:middle}.progress{background-color:var(--theme-color,#0ff);height:2px;left:0;position:fixed;right:0;top:0;transition:width .2s,opacity .4s;width:0;z-index:5}.search .search-keyword,.search a:hover{color:var(--theme-color,#0ff)}.search .search-keyword{font-style:normal;font-weight:700}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:#34495e;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0;overflow-x:hidden}img{max-width:100%}a[disabled]{cursor:not-allowed;opacity:.6}kbd{border:1px solid #ccc;border-radius:3px;display:inline-block;font-size:12px!important;line-height:12px;margin-bottom:3px;padding:3px 5px;vertical-align:middle}li input[type=checkbox]{margin:0 .2em .25em 0;vertical-align:middle}.app-nav{margin:25px 60px 0 0;position:absolute;right:0;text-align:right;z-index:2}.app-nav.no-badge{margin-right:25px}.app-nav p{margin:0}.app-nav>a{margin:0 1rem;padding:5px 0}.app-nav li,.app-nav ul{display:inline-block;list-style:none;margin:0}.app-nav a{color:inherit;font-size:16px;text-decoration:none;transition:color .3s}.app-nav a.active,.app-nav a:hover{color:var(--theme-color,#0ff)}.app-nav a.active{border-bottom:2px solid var(--theme-color,#0ff)}.app-nav li{display:inline-block;margin:0 1rem;padding:5px 0;position:relative}.app-nav li ul{background-color:#fff;border:1px solid #ddd;border-bottom-color:#ccc;border-radius:4px;box-sizing:border-box;display:none;max-height:calc(100vh - 61px);overflow-y:auto;padding:10px 0;position:absolute;right:-15px;text-align:left;top:100%;white-space:nowrap}.app-nav li ul li{display:block;font-size:14px;line-height:1rem;margin:0;margin:8px 14px;white-space:nowrap}.app-nav li ul a{display:block;font-size:inherit;margin:0;padding:0}.app-nav li ul a.active{border-bottom:0}.app-nav li:hover ul{display:block}.github-corner{border-bottom:0;position:fixed;right:0;text-decoration:none;top:0;z-index:1}.github-corner:hover .octo-arm{animation:a .56s ease-in-out}.github-corner svg{color:azure;fill:var(--theme-color,#0ff);height:80px;width:80px}main{display:block;position:relative;width:100vw;height:100%;z-index:0}main.hidden{display:none}.anchor{display:inline-block;text-decoration:none;transition:all .3s}.anchor span{color:#34495e}.anchor:hover{text-decoration:underline}.sidebar{border-right:1px solid rgba(0,0,0,.07);overflow-y:auto;padding:40px 0 0;position:absolute;top:0;bottom:0;left:0;transition:transform .25s ease-out;width:300px;z-index:3}.sidebar>h1{margin:0 auto 1rem;font-size:1.5rem;font-weight:300;text-align:center}.sidebar>h1 a{color:inherit;text-decoration:none}.sidebar>h1 .app-nav{display:block;position:static}.sidebar .sidebar-nav{line-height:2em;padding-bottom:40px}.sidebar li.collapse .app-sub-sidebar{display:none}.sidebar ul{margin:0 0 0 15px;padding:0}.sidebar li>p{font-weight:700;margin:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{border-bottom:none;display:block}.sidebar ul li ul{padding-left:20px}.sidebar::-webkit-scrollbar{width:4px}.sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}.sidebar:hover::-webkit-scrollbar-thumb{background:hsla(0,0%,53%,.4)}.sidebar:hover::-webkit-scrollbar-track{background:hsla(0,0%,53%,.1)}.sidebar-toggle{background-color:transparent;background-color:rgba(240,255,255,.8);border:0;outline:none;padding:10px;position:absolute;bottom:0;left:0;text-align:center;transition:opacity .3s;width:284px;z-index:4}.sidebar-toggle .sidebar-toggle-button:hover{opacity:.4}.sidebar-toggle span{background-color:var(--theme-color,#0ff);display:block;margin-bottom:4px;width:16px;height:2px}body.sticky .sidebar,body.sticky .sidebar-toggle{position:fixed}.content{padding-top:60px;position:absolute;top:0;right:0;bottom:0;left:300px;transition:left .25s ease}.markdown-section{margin:0 auto;max-width:800px;padding:30px 15px 40px;position:relative}.markdown-section>*{box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}.markdown-section hr{border:none;border-bottom:1px solid #eee;margin:2em 0}.markdown-section iframe{border:1px solid #eee;width:1px;min-width:100%}.markdown-section table{border-collapse:collapse;border-spacing:0;display:block;margin-bottom:1rem;overflow:auto;width:100%}.markdown-section th{font-weight:700}.markdown-section td,.markdown-section th{border:1px solid #ddd;padding:6px 13px}.markdown-section tr{border-top:1px solid #ccc}.markdown-section p.tip,.markdown-section tr:nth-child(2n){background-color:#f8f8f8}.markdown-section p.tip{border-bottom-right-radius:2px;border-left:4px solid #f66;border-top-right-radius:2px;margin:2em 0;padding:12px 24px 12px 30px;position:relative}.markdown-section p.tip:before{background-color:#f66;border-radius:100%;color:azure;content:"!";font-family:Dosis,Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:14px;font-weight:700;left:-12px;line-height:20px;position:absolute;height:20px;width:20px;text-align:center;top:14px}.markdown-section p.tip code{background-color:#efefef}.markdown-section p.tip em{color:#34495e}.markdown-section p.warn{background:rgba(0,255,255,.1);border-radius:2px;padding:1rem}.markdown-section ul.task-list>li{list-style-type:none}body.close .sidebar{transform:translateX(-300px)}body.close .sidebar-toggle{width:auto}body.close .content{left:0}@media print{.app-nav,.github-corner,.sidebar,.sidebar-toggle{display:none}}@media screen and (max-width:768px){.github-corner,.sidebar,.sidebar-toggle{position:fixed}.app-nav{margin-top:16px}.app-nav li ul{top:30px}main{height:auto;overflow-x:hidden}.sidebar{left:-300px;transition:transform .25s ease-out}.content{left:0;max-width:100vw;position:static;padding-top:20px;transition:transform .25s ease}.app-nav,.github-corner{transition:transform .25s ease-out}.sidebar-toggle{background-color:transparent;width:auto;padding:30px 30px 10px 10px}body.close .sidebar{transform:translateX(300px)}body.close .sidebar-toggle{background-color:rgba(240,255,255,.8);transition:background-color 1s;width:284px;padding:10px}body.close .content{transform:translateX(300px)}body.close .app-nav,body.close .github-corner{display:none}.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:a .56s ease-in-out}}@keyframes a{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}section.cover{-ms-flex-align:center;align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;height:100vh;display:none}section.cover.show{display:-ms-flexbox;display:flex}section.cover.has-mask .mask{background-color:azure;opacity:.8;position:absolute;top:0;height:100%;width:100%}section.cover .cover-main{-ms-flex:1;flex:1;margin:-20px 16px 0;text-align:center;z-index:1}section.cover a{color:inherit}section.cover a,section.cover a:hover{text-decoration:none}section.cover p{line-height:1.5rem;margin:1em 0}section.cover h1{color:inherit;font-size:2.5rem;font-weight:300;margin:.625rem 0 2.5rem;position:relative;text-align:center}section.cover h1 a{display:block}section.cover h1 small{bottom:-.4375rem;font-size:1rem;position:absolute}section.cover blockquote{font-size:1.5rem;text-align:center}section.cover ul{line-height:1.8;list-style-type:none;margin:1em auto;max-width:500px;padding:0}section.cover .cover-main>p:last-child a{border:1px solid var(--theme-color,#0ff);border-radius:2rem;box-sizing:border-box;color:var(--theme-color,#0ff);display:inline-block;font-size:1.05rem;letter-spacing:.1rem;margin:.5rem 1rem;padding:.75em 2rem;text-decoration:none;transition:all .15s ease}section.cover .cover-main>p:last-child a:last-child{background-color:var(--theme-color,#0ff);color:#fff}section.cover .cover-main>p:last-child a:last-child:hover{color:inherit;opacity:.8}section.cover .cover-main>p:last-child a:hover{color:inherit}section.cover blockquote>p>a{border-bottom:2px solid var(--theme-color,#0ff);transition:color .3s}section.cover blockquote>p>a:hover{color:var(--theme-color,#0ff)}.sidebar,body{background-color:azure}.sidebar{color:#364149}.sidebar li{margin:6px 0}.sidebar ul li a{color:#505d6b;font-size:14px;font-weight:400;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.sidebar ul li a:hover{text-decoration:underline}.sidebar ul li ul{padding:0}.sidebar ul li.active>a{border-right:2px solid;color:var(--theme-color,#0ff);font-weight:600}.app-sub-sidebar li:before{content:"-";padding-right:4px;float:left}.markdown-section h1,.markdown-section h2,.markdown-section h3,.markdown-section h4,.markdown-section strong{color:#2c3e50;font-weight:600}.markdown-section a{color:var(--theme-color,#0ff);font-weight:600}.markdown-section a:hover{text-decoration:underline}.markdown-section h1{font-size:2rem;margin:0 0 1rem}.markdown-section h2{font-size:1.75rem;margin:45px 0 .8rem}.markdown-section h3{font-size:1.5rem;margin:40px 0 .6rem}.markdown-section h4{font-size:1.25rem}.markdown-section h5{font-size:1rem}.markdown-section h6{color:#777;font-size:1rem}.markdown-section figure,.markdown-section p{margin:1.2em 0}.markdown-section ol,.markdown-section p,.markdown-section ul{line-height:1.6rem;word-spacing:.05rem}.markdown-section ol,.markdown-section ul{padding-left:1.5rem}.markdown-section blockquote{border-left:4px solid var(--theme-color,#0ff);color:#858585;margin:2em 0;padding-left:20px}.markdown-section blockquote p{font-weight:600;margin-left:0}.markdown-section iframe{margin:1em 0}.markdown-section em{color:#7f8c8d}.markdown-section code{border-radius:2px;color:#e96900;font-size:.8rem;margin:0 2px;padding:3px 5px;white-space:pre-wrap}.markdown-section code,.markdown-section pre{background-color:#f8f8f8;font-family:Roboto Mono,Monaco,courier,monospace}.markdown-section pre{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;line-height:1.5rem;margin:1.2em 0;overflow:auto;padding:0 1.4rem;position:relative;word-wrap:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#8e908c}.token.namespace{opacity:.7}.token.boolean,.token.number{color:#c76b29}.token.punctuation{color:#525252}.token.property{color:#c08b30}.token.tag{color:#2973b7}.token.string{color:var(--theme-color,#0ff)}.token.selector{color:#6679cc}.token.attr-name{color:#2973b7}.language-css .token.string,.style .token.string,.token.entity,.token.url{color:#22a2c9}.token.attr-value,.token.control,.token.directive,.token.unit{color:var(--theme-color,#0ff)}.token.function,.token.keyword{color:#e96900}.token.atrule,.token.regex,.token.statement{color:#22a2c9}.token.placeholder,.token.variable{color:#3d8fd1}.token.deleted{text-decoration:line-through}.token.inserted{border-bottom:1px dotted #202746;text-decoration:none}.token.italic{font-style:italic}.token.bold,.token.important{font-weight:700}.token.important{color:#c94922}.token.entity{cursor:help}.markdown-section pre>code{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;background-color:#f8f8f8;border-radius:2px;color:#525252;display:block;font-family:Roboto Mono,Monaco,courier,monospace;font-size:.8rem;line-height:inherit;margin:0 2px;max-width:inherit;overflow:inherit;padding:2.2em 5px;white-space:inherit}.markdown-section code:after,.markdown-section code:before{letter-spacing:.05rem}code .token{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;min-height:1.5rem}pre:after{color:#ccc;content:attr(data-lang);font-size:.6rem;font-weight:600;height:15px;line-height:15px;padding:5px 10px 0;position:absolute;right:0;text-align:right;top:0} \ No newline at end of file diff --git a/lib/themes/pure.css b/lib/themes/pure.css new file mode 100644 index 0000000..8bf43a1 --- /dev/null +++ b/lib/themes/pure.css @@ -0,0 +1 @@ +*{-webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:none;-webkit-touch-callout:none;box-sizing:border-box}body:not(.ready){overflow:hidden}body:not(.ready) .app-nav,body:not(.ready)>nav,body:not(.ready) [data-cloak]{display:none}div#app{font-size:30px;font-weight:lighter;margin:40vh auto;text-align:center}div#app:empty:before{content:"Loading..."}.emoji{height:1.2rem;vertical-align:middle}.progress{background-color:var(--theme-color,#000);height:2px;left:0;position:fixed;right:0;top:0;transition:width .2s,opacity .4s;width:0;z-index:5}.search .search-keyword,.search a:hover{color:var(--theme-color,#000)}.search .search-keyword{font-style:normal;font-weight:700}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:#000;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0;overflow-x:hidden}img{max-width:100%}a[disabled]{cursor:not-allowed;opacity:.6}kbd{border:1px solid #ccc;border-radius:3px;display:inline-block;font-size:12px!important;line-height:12px;margin-bottom:3px;padding:3px 5px;vertical-align:middle}li input[type=checkbox]{margin:0 .2em .25em 0;vertical-align:middle}.app-nav{margin:25px 60px 0 0;position:absolute;right:0;text-align:right;z-index:2}.app-nav.no-badge{margin-right:25px}.app-nav p{margin:0}.app-nav>a{margin:0 1rem;padding:5px 0}.app-nav li,.app-nav ul{display:inline-block;list-style:none;margin:0}.app-nav a{color:inherit;font-size:16px;text-decoration:none;transition:color .3s}.app-nav a.active,.app-nav a:hover{color:var(--theme-color,#000)}.app-nav a.active{border-bottom:2px solid var(--theme-color,#000)}.app-nav li{display:inline-block;margin:0 1rem;padding:5px 0;position:relative}.app-nav li ul{background-color:#fff;border:1px solid #ddd;border-bottom-color:#ccc;border-radius:4px;box-sizing:border-box;display:none;max-height:calc(100vh - 61px);overflow-y:auto;padding:10px 0;position:absolute;right:-15px;text-align:left;top:100%;white-space:nowrap}.app-nav li ul li{display:block;font-size:14px;line-height:1rem;margin:0;margin:8px 14px;white-space:nowrap}.app-nav li ul a{display:block;font-size:inherit;margin:0;padding:0}.app-nav li ul a.active{border-bottom:0}.app-nav li:hover ul{display:block}.github-corner{border-bottom:0;position:fixed;right:0;text-decoration:none;top:0;z-index:1}.github-corner:hover .octo-arm{animation:a .56s ease-in-out}.github-corner svg{color:#fff;fill:var(--theme-color,#000);height:80px;width:80px}main{display:block;position:relative;width:100vw;height:100%;z-index:0}main.hidden{display:none}.anchor{display:inline-block;text-decoration:none;transition:all .3s}.anchor span{color:#000}.anchor:hover{text-decoration:underline}.sidebar{border-right:1px solid rgba(0,0,0,.07);overflow-y:auto;padding:40px 0 0;position:absolute;top:0;bottom:0;left:0;transition:transform .25s ease-out;width:300px;z-index:3}.sidebar>h1{margin:0 auto 1rem;font-size:1.5rem;font-weight:300;text-align:center}.sidebar>h1 a{color:inherit;text-decoration:none}.sidebar>h1 .app-nav{display:block;position:static}.sidebar .sidebar-nav{line-height:2em;padding-bottom:40px}.sidebar li.collapse .app-sub-sidebar{display:none}.sidebar ul{margin:0 0 0 15px;padding:0}.sidebar li>p{font-weight:700;margin:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{border-bottom:none;display:block}.sidebar ul li ul{padding-left:20px}.sidebar::-webkit-scrollbar{width:4px}.sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}.sidebar:hover::-webkit-scrollbar-thumb{background:hsla(0,0%,53%,.4)}.sidebar:hover::-webkit-scrollbar-track{background:hsla(0,0%,53%,.1)}.sidebar-toggle{background-color:transparent;background-color:hsla(0,0%,100%,.8);border:0;outline:none;padding:10px;position:absolute;bottom:0;left:0;text-align:center;transition:opacity .3s;width:284px;z-index:4}.sidebar-toggle .sidebar-toggle-button:hover{opacity:.4}.sidebar-toggle span{background-color:var(--theme-color,#000);display:block;margin-bottom:4px;width:16px;height:2px}body.sticky .sidebar,body.sticky .sidebar-toggle{position:fixed}.content{padding-top:60px;position:absolute;top:0;right:0;bottom:0;left:300px;transition:left .25s ease}.markdown-section{margin:0 auto;max-width:800px;padding:30px 15px 40px;position:relative}.markdown-section>*{box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}.markdown-section hr{border:none;border-bottom:1px solid #eee;margin:2em 0}.markdown-section iframe{border:1px solid #eee;width:1px;min-width:100%}.markdown-section table{border-collapse:collapse;border-spacing:0;display:block;margin-bottom:1rem;overflow:auto;width:100%}.markdown-section th{font-weight:700}.markdown-section td,.markdown-section th{border:1px solid #ddd;padding:6px 13px}.markdown-section tr{border-top:1px solid #ccc}.markdown-section p.tip,.markdown-section tr:nth-child(2n){background-color:#f8f8f8}.markdown-section p.tip{border-bottom-right-radius:2px;border-left:4px solid #f66;border-top-right-radius:2px;margin:2em 0;padding:12px 24px 12px 30px;position:relative}.markdown-section p.tip:before{background-color:#f66;border-radius:100%;color:#fff;content:"!";font-family:Dosis,Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:14px;font-weight:700;left:-12px;line-height:20px;position:absolute;height:20px;width:20px;text-align:center;top:14px}.markdown-section p.tip code{background-color:#efefef}.markdown-section p.tip em{color:#000}.markdown-section p.warn{background:rgba(0,0,0,.1);border-radius:2px;padding:1rem}.markdown-section ul.task-list>li{list-style-type:none}body.close .sidebar{transform:translateX(-300px)}body.close .sidebar-toggle{width:auto}body.close .content{left:0}@media print{.app-nav,.github-corner,.sidebar,.sidebar-toggle{display:none}}@media screen and (max-width:768px){.github-corner,.sidebar,.sidebar-toggle{position:fixed}.app-nav{margin-top:16px}.app-nav li ul{top:30px}main{height:auto;overflow-x:hidden}.sidebar{left:-300px;transition:transform .25s ease-out}.content{left:0;max-width:100vw;position:static;padding-top:20px;transition:transform .25s ease}.app-nav,.github-corner{transition:transform .25s ease-out}.sidebar-toggle{background-color:transparent;width:auto;padding:30px 30px 10px 10px}body.close .sidebar{transform:translateX(300px)}body.close .sidebar-toggle{background-color:hsla(0,0%,100%,.8);transition:background-color 1s;width:284px;padding:10px}body.close .content{transform:translateX(300px)}body.close .app-nav,body.close .github-corner{display:none}.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:a .56s ease-in-out}}@keyframes a{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}section.cover{-ms-flex-align:center;align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;height:100vh;display:none}section.cover.show{display:-ms-flexbox;display:flex}section.cover.has-mask .mask{background-color:#fff;opacity:.8;position:absolute;top:0;height:100%;width:100%}section.cover .cover-main{-ms-flex:1;flex:1;margin:-20px 16px 0;text-align:center;z-index:1}section.cover a{color:inherit}section.cover a,section.cover a:hover{text-decoration:none}section.cover p{line-height:1.5rem;margin:1em 0}section.cover h1{color:inherit;font-size:2.5rem;font-weight:300;margin:.625rem 0 2.5rem;position:relative;text-align:center}section.cover h1 a{display:block}section.cover h1 small{bottom:-.4375rem;font-size:1rem;position:absolute}section.cover blockquote{font-size:1.5rem;text-align:center}section.cover ul{line-height:1.8;list-style-type:none;margin:1em auto;max-width:500px;padding:0}section.cover .cover-main>p:last-child a{border:1px solid var(--theme-color,#000);border-radius:2rem;box-sizing:border-box;color:var(--theme-color,#000);display:inline-block;font-size:1.05rem;letter-spacing:.1rem;margin:.5rem 1rem;padding:.75em 2rem;text-decoration:none;transition:all .15s ease}section.cover .cover-main>p:last-child a:last-child{background-color:var(--theme-color,#000);color:#fff}section.cover .cover-main>p:last-child a:last-child:hover{color:inherit;opacity:.8}section.cover .cover-main>p:last-child a:hover{color:inherit}section.cover blockquote>p>a{border-bottom:2px solid var(--theme-color,#000);transition:color .3s}section.cover blockquote>p>a:hover{color:var(--theme-color,#000)} \ No newline at end of file diff --git a/lib/themes/vue.css b/lib/themes/vue.css new file mode 100644 index 0000000..231973d --- /dev/null +++ b/lib/themes/vue.css @@ -0,0 +1 @@ +@import url("https://fonts.googleapis.com/css?family=Roboto+Mono|Source+Sans+Pro:300,400,600");*{-webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:none;-webkit-touch-callout:none;box-sizing:border-box}body:not(.ready){overflow:hidden}body:not(.ready) .app-nav,body:not(.ready)>nav,body:not(.ready) [data-cloak]{display:none}div#app{font-size:30px;font-weight:lighter;margin:40vh auto;text-align:center}div#app:empty:before{content:"Loading..."}.emoji{height:1.2rem;vertical-align:middle}.progress{background-color:var(--theme-color,#42b983);height:2px;left:0;position:fixed;right:0;top:0;transition:width .2s,opacity .4s;width:0;z-index:5}.search .search-keyword,.search a:hover{color:var(--theme-color,#42b983)}.search .search-keyword{font-style:normal;font-weight:700}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:#34495e;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0;overflow-x:hidden}img{max-width:100%}a[disabled]{cursor:not-allowed;opacity:.6}kbd{border:1px solid #ccc;border-radius:3px;display:inline-block;font-size:12px!important;line-height:12px;margin-bottom:3px;padding:3px 5px;vertical-align:middle}li input[type=checkbox]{margin:0 .2em .25em 0;vertical-align:middle}.app-nav{margin:25px 60px 0 0;position:absolute;right:0;text-align:right;z-index:2}.app-nav.no-badge{margin-right:25px}.app-nav p{margin:0}.app-nav>a{margin:0 1rem;padding:5px 0}.app-nav li,.app-nav ul{display:inline-block;list-style:none;margin:0}.app-nav a{color:inherit;font-size:16px;text-decoration:none;transition:color .3s}.app-nav a.active,.app-nav a:hover{color:var(--theme-color,#42b983)}.app-nav a.active{border-bottom:2px solid var(--theme-color,#42b983)}.app-nav li{display:inline-block;margin:0 1rem;padding:5px 0;position:relative}.app-nav li ul{background-color:#fff;border:1px solid #ddd;border-bottom-color:#ccc;border-radius:4px;box-sizing:border-box;display:none;max-height:calc(100vh - 61px);overflow-y:auto;padding:10px 0;position:absolute;right:-15px;text-align:left;top:100%;white-space:nowrap}.app-nav li ul li{display:block;font-size:14px;line-height:1rem;margin:0;margin:8px 14px;white-space:nowrap}.app-nav li ul a{display:block;font-size:inherit;margin:0;padding:0}.app-nav li ul a.active{border-bottom:0}.app-nav li:hover ul{display:block}.github-corner{border-bottom:0;position:fixed;right:0;text-decoration:none;top:0;z-index:1}.github-corner:hover .octo-arm{animation:a .56s ease-in-out}.github-corner svg{color:#fff;fill:var(--theme-color,#42b983);height:80px;width:80px}main{display:block;position:relative;width:100vw;height:100%;z-index:0}main.hidden{display:none}.anchor{display:inline-block;text-decoration:none;transition:all .3s}.anchor span{color:#34495e}.anchor:hover{text-decoration:underline}.sidebar{border-right:1px solid rgba(0,0,0,.07);overflow-y:auto;padding:40px 0 0;position:absolute;top:0;bottom:0;left:0;transition:transform .25s ease-out;width:300px;z-index:3}.sidebar>h1{margin:0 auto 1rem;font-size:1.5rem;font-weight:300;text-align:center}.sidebar>h1 a{color:inherit;text-decoration:none}.sidebar>h1 .app-nav{display:block;position:static}.sidebar .sidebar-nav{line-height:2em;padding-bottom:40px}.sidebar li.collapse .app-sub-sidebar{display:none}.sidebar ul{margin:0 0 0 15px;padding:0}.sidebar li>p{font-weight:700;margin:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{border-bottom:none;display:block}.sidebar ul li ul{padding-left:20px}.sidebar::-webkit-scrollbar{width:4px}.sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}.sidebar:hover::-webkit-scrollbar-thumb{background:hsla(0,0%,53%,.4)}.sidebar:hover::-webkit-scrollbar-track{background:hsla(0,0%,53%,.1)}.sidebar-toggle{background-color:transparent;background-color:hsla(0,0%,100%,.8);border:0;outline:none;padding:10px;position:absolute;bottom:0;left:0;text-align:center;transition:opacity .3s;width:284px;z-index:4}.sidebar-toggle .sidebar-toggle-button:hover{opacity:.4}.sidebar-toggle span{background-color:var(--theme-color,#42b983);display:block;margin-bottom:4px;width:16px;height:2px}body.sticky .sidebar,body.sticky .sidebar-toggle{position:fixed}.content{padding-top:60px;position:absolute;top:0;right:0;bottom:0;left:300px;transition:left .25s ease}.markdown-section{margin:0 auto;max-width:800px;padding:30px 15px 40px;position:relative}.markdown-section>*{box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}.markdown-section hr{border:none;border-bottom:1px solid #eee;margin:2em 0}.markdown-section iframe{border:1px solid #eee;width:1px;min-width:100%}.markdown-section table{border-collapse:collapse;border-spacing:0;display:block;margin-bottom:1rem;overflow:auto;width:100%}.markdown-section th{font-weight:700}.markdown-section td,.markdown-section th{border:1px solid #ddd;padding:6px 13px}.markdown-section tr{border-top:1px solid #ccc}.markdown-section p.tip,.markdown-section tr:nth-child(2n){background-color:#f8f8f8}.markdown-section p.tip{border-bottom-right-radius:2px;border-left:4px solid #f66;border-top-right-radius:2px;margin:2em 0;padding:12px 24px 12px 30px;position:relative}.markdown-section p.tip:before{background-color:#f66;border-radius:100%;color:#fff;content:"!";font-family:Dosis,Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:14px;font-weight:700;left:-12px;line-height:20px;position:absolute;height:20px;width:20px;text-align:center;top:14px}.markdown-section p.tip code{background-color:#efefef}.markdown-section p.tip em{color:#34495e}.markdown-section p.warn{background:rgba(66,185,131,.1);border-radius:2px;padding:1rem}.markdown-section ul.task-list>li{list-style-type:none}body.close .sidebar{transform:translateX(-300px)}body.close .sidebar-toggle{width:auto}body.close .content{left:0}@media print{.app-nav,.github-corner,.sidebar,.sidebar-toggle{display:none}}@media screen and (max-width:768px){.github-corner,.sidebar,.sidebar-toggle{position:fixed}.app-nav{margin-top:16px}.app-nav li ul{top:30px}main{height:auto;overflow-x:hidden}.sidebar{left:-300px;transition:transform .25s ease-out}.content{left:0;max-width:100vw;position:static;padding-top:20px;transition:transform .25s ease}.app-nav,.github-corner{transition:transform .25s ease-out}.sidebar-toggle{background-color:transparent;width:auto;padding:30px 30px 10px 10px}body.close .sidebar{transform:translateX(300px)}body.close .sidebar-toggle{background-color:hsla(0,0%,100%,.8);transition:background-color 1s;width:284px;padding:10px}body.close .content{transform:translateX(300px)}body.close .app-nav,body.close .github-corner{display:none}.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:a .56s ease-in-out}}@keyframes a{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}section.cover{-ms-flex-align:center;align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;height:100vh;display:none}section.cover.show{display:-ms-flexbox;display:flex}section.cover.has-mask .mask{background-color:#fff;opacity:.8;position:absolute;top:0;height:100%;width:100%}section.cover .cover-main{-ms-flex:1;flex:1;margin:-20px 16px 0;text-align:center;z-index:1}section.cover a{color:inherit}section.cover a,section.cover a:hover{text-decoration:none}section.cover p{line-height:1.5rem;margin:1em 0}section.cover h1{color:inherit;font-size:2.5rem;font-weight:300;margin:.625rem 0 2.5rem;position:relative;text-align:center}section.cover h1 a{display:block}section.cover h1 small{bottom:-.4375rem;font-size:1rem;position:absolute}section.cover blockquote{font-size:1.5rem;text-align:center}section.cover ul{line-height:1.8;list-style-type:none;margin:1em auto;max-width:500px;padding:0}section.cover .cover-main>p:last-child a{border:1px solid var(--theme-color,#42b983);border-radius:2rem;box-sizing:border-box;color:var(--theme-color,#42b983);display:inline-block;font-size:1.05rem;letter-spacing:.1rem;margin:.5rem 1rem;padding:.75em 2rem;text-decoration:none;transition:all .15s ease}section.cover .cover-main>p:last-child a:last-child{background-color:var(--theme-color,#42b983);color:#fff}section.cover .cover-main>p:last-child a:last-child:hover{color:inherit;opacity:.8}section.cover .cover-main>p:last-child a:hover{color:inherit}section.cover blockquote>p>a{border-bottom:2px solid var(--theme-color,#42b983);transition:color .3s}section.cover blockquote>p>a:hover{color:var(--theme-color,#42b983)}.sidebar,body{background-color:#fff}.sidebar{color:#364149}.sidebar li{margin:6px 0}.sidebar ul li a{color:#505d6b;font-size:14px;font-weight:400;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.sidebar ul li a:hover{text-decoration:underline}.sidebar ul li ul{padding:0}.sidebar ul li.active>a{border-right:2px solid;color:var(--theme-color,#42b983);font-weight:600}.app-sub-sidebar li:before{content:"-";padding-right:4px;float:left}.markdown-section h1,.markdown-section h2,.markdown-section h3,.markdown-section h4,.markdown-section strong{color:#2c3e50;font-weight:600}.markdown-section a{color:var(--theme-color,#42b983);font-weight:600}.markdown-section h1{font-size:2rem;margin:0 0 1rem}.markdown-section h2{font-size:1.75rem;margin:45px 0 .8rem}.markdown-section h3{font-size:1.5rem;margin:40px 0 .6rem}.markdown-section h4{font-size:1.25rem}.markdown-section h5{font-size:1rem}.markdown-section h6{color:#777;font-size:1rem}.markdown-section figure,.markdown-section p{margin:1.2em 0}.markdown-section ol,.markdown-section p,.markdown-section ul{line-height:1.6rem;word-spacing:.05rem}.markdown-section ol,.markdown-section ul{padding-left:1.5rem}.markdown-section blockquote{border-left:4px solid var(--theme-color,#42b983);color:#858585;margin:2em 0;padding-left:20px}.markdown-section blockquote p{font-weight:600;margin-left:0}.markdown-section iframe{margin:1em 0}.markdown-section em{color:#7f8c8d}.markdown-section code{border-radius:2px;color:#e96900;font-size:.8rem;margin:0 2px;padding:3px 5px;white-space:pre-wrap}.markdown-section code,.markdown-section pre{background-color:#f8f8f8;font-family:Roboto Mono,Monaco,courier,monospace}.markdown-section pre{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;line-height:1.5rem;margin:1.2em 0;overflow:auto;padding:0 1.4rem;position:relative;word-wrap:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#8e908c}.token.namespace{opacity:.7}.token.boolean,.token.number{color:#c76b29}.token.punctuation{color:#525252}.token.property{color:#c08b30}.token.tag{color:#2973b7}.token.string{color:var(--theme-color,#42b983)}.token.selector{color:#6679cc}.token.attr-name{color:#2973b7}.language-css .token.string,.style .token.string,.token.entity,.token.url{color:#22a2c9}.token.attr-value,.token.control,.token.directive,.token.unit{color:var(--theme-color,#42b983)}.token.function,.token.keyword{color:#e96900}.token.atrule,.token.regex,.token.statement{color:#22a2c9}.token.placeholder,.token.variable{color:#3d8fd1}.token.deleted{text-decoration:line-through}.token.inserted{border-bottom:1px dotted #202746;text-decoration:none}.token.italic{font-style:italic}.token.bold,.token.important{font-weight:700}.token.important{color:#c94922}.token.entity{cursor:help}.markdown-section pre>code{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;background-color:#f8f8f8;border-radius:2px;color:#525252;display:block;font-family:Roboto Mono,Monaco,courier,monospace;font-size:.8rem;line-height:inherit;margin:0 2px;max-width:inherit;overflow:inherit;padding:2.2em 5px;white-space:inherit}.markdown-section code:after,.markdown-section code:before{letter-spacing:.05rem}code .token{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;min-height:1.5rem}pre:after{color:#ccc;content:attr(data-lang);font-size:.6rem;font-weight:600;height:15px;line-height:15px;padding:5px 10px 0;position:absolute;right:0;text-align:right;top:0} \ No newline at end of file diff --git a/packages/docsify-server-renderer/package-lock.json b/packages/docsify-server-renderer/package-lock.json index ccb68d4..40e63e1 100644 --- a/packages/docsify-server-renderer/package-lock.json +++ b/packages/docsify-server-renderer/package-lock.json @@ -37,5 +37,5 @@ "integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ=" } }, - "version": "4.9.1" + "version": "4.9.2" } diff --git a/packages/docsify-server-renderer/package.json b/packages/docsify-server-renderer/package.json index 9960401..f7b9a6c 100644 --- a/packages/docsify-server-renderer/package.json +++ b/packages/docsify-server-renderer/package.json @@ -1,6 +1,6 @@ { "name": "docsify-server-renderer", - "version": "4.9.1", + "version": "4.9.2", "description": "docsify server renderer", "author": { "name": "qingwei-li", From d35527246122746a8cb6125c2be82fecfedca51b Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sun, 21 Apr 2019 12:06:17 +0200 Subject: [PATCH 26/37] chore: add changelog 4.9.2 --- CHANGELOG.md | 15 +++++++++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a50a98..cca2f84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ + +## [4.9.2](https://github.com/docsifyjs/docsify/compare/v4.9.1...v4.9.2) (2019-04-21) + + +### Bug Fixes + +* re-render gitalk when router changed ([11ea1f8](https://github.com/docsifyjs/docsify/commit/11ea1f8)) + + +### Features + +* allows relative path, fixed [#590](https://github.com/docsifyjs/docsify/issues/590) ([31654f1](https://github.com/docsifyjs/docsify/commit/31654f1)) + + + ## [4.9.1](https://github.com/docsifyjs/docsify/compare/v4.9.0...v4.9.1) (2019-02-21) diff --git a/package-lock.json b/package-lock.json index a0582ad..dc4de8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "docsify", - "version": "4.9.1", + "version": "4.9.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 92ba628..e17bdb9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "docsify", - "version": "4.9.1", + "version": "4.9.2", "description": "A magical documentation generator.", "author": { "name": "qingwei-li", From 6cc069cb9fa4dd0a2a147fe938ee4508243d3e27 Mon Sep 17 00:00:00 2001 From: Alexandru Cambose Date: Sat, 16 Feb 2019 22:27:11 +0200 Subject: [PATCH 27/37] Added filtering in sidebar for ignoreSubHeading --- src/core/render/compiler.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/render/compiler.js b/src/core/render/compiler.js index 91b954c..e2147fc 100644 --- a/src/core/render/compiler.js +++ b/src/core/render/compiler.js @@ -329,13 +329,17 @@ export class Compiler { * Compile sidebar */ sidebar(text, level) { + const {toc} = this const currentPath = this.router.getCurrentPath() let html = '' if (text) { html = this.compile(text) } else { - const tree = this.cacheTree[currentPath] || genTree(this.toc, level) + for (let i = 0; i < toc.length; i++) { + toc[i].ignoreSubHeading && toc.splice(i, 1) && i-- + } + const tree = this.cacheTree[currentPath] || genTree(toc, level) html = treeTpl(tree, '
      {inner}
    ') this.cacheTree[currentPath] = tree } @@ -360,7 +364,6 @@ export class Compiler { for (let i = 0; i < toc.length; i++) { toc[i].ignoreSubHeading && toc.splice(i, 1) && i-- } - const tree = cacheTree[currentPath] || genTree(toc, level) cacheTree[currentPath] = tree From 78f5564a303794ab0c9fa6d996827a81530b3d9a Mon Sep 17 00:00:00 2001 From: Alexandru Cambose Date: Sat, 16 Feb 2019 23:19:49 +0200 Subject: [PATCH 28/37] Updated to remove all headers under it --- src/core/render/compiler.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core/render/compiler.js b/src/core/render/compiler.js index e2147fc..354b6a9 100644 --- a/src/core/render/compiler.js +++ b/src/core/render/compiler.js @@ -337,7 +337,15 @@ export class Compiler { html = this.compile(text) } else { for (let i = 0; i < toc.length; i++) { - toc[i].ignoreSubHeading && toc.splice(i, 1) && i-- + if (toc[i].ignoreSubHeading) { + const deletedHeaderLevel = toc[i].level + toc.splice(i, 1) + // Remove headers who are under current header + for (let j = i; deletedHeaderLevel < toc[j].level && j < toc.length; j++) { + toc.splice(j, 1) && j-- && i++ + } + i-- + } } const tree = this.cacheTree[currentPath] || genTree(toc, level) html = treeTpl(tree, '
      {inner}
    ') From bc1d8e4bda335226e40bc47c2c3a70b6ae7b9525 Mon Sep 17 00:00:00 2001 From: Gorgi Kosev Date: Thu, 28 Mar 2019 02:47:49 +0000 Subject: [PATCH 29/37] add scoring and sort to search plugin --- src/plugins/search/search.js | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/plugins/search/search.js b/src/plugins/search/search.js index 4f14ecd..2c9febf 100644 --- a/src/plugins/search/search.js +++ b/src/plugins/search/search.js @@ -96,29 +96,27 @@ export function search(query) { for (let i = 0; i < data.length; i++) { const post = data[i] - let isMatch = false + let matchesScore = 0 let resultStr = '' const postTitle = post.title && post.title.trim() const postContent = post.body && post.body.trim() const postUrl = post.slug || '' - if (postTitle && postContent) { - keywords.forEach(keyword => { + if (postTitle) { + keywords.forEach( keyword => { // From https://github.com/sindresorhus/escape-string-regexp const regEx = new RegExp( keyword.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&'), 'gi' - ) + ); let indexTitle = -1 let indexContent = -1 - indexTitle = postTitle && postTitle.search(regEx) - indexContent = postContent && postContent.search(regEx) + indexTitle = postTitle ? postTitle.search(regEx) : -1 + indexContent = postContent ? postContent.search(regEx) : -1 - if (indexTitle < 0 && indexContent < 0) { - isMatch = false - } else { - isMatch = true + if (indexTitle >= 0 || indexContent >= 0) { + matchesScore += indexTitle >= 0 ? 3 : indexContent >= 0 ? 2 : 0; if (indexContent < 0) { indexContent = 0 } @@ -144,11 +142,12 @@ export function search(query) { } }) - if (isMatch) { + if (matchesScore > 0) { const matchingPost = { title: escapeHtml(postTitle), - content: resultStr, - url: postUrl + content: postContent ? resultStr : '', + url: postUrl, + score: matchesScore } matchingResults.push(matchingPost) @@ -156,7 +155,7 @@ export function search(query) { } } - return matchingResults + return matchingResults.sort((r1, r2) => r2.score - r1.score); } export function init(config, vm) { From 1ce53cf9ece044a9a3a8dd4715145e60e6ddaa0b Mon Sep 17 00:00:00 2001 From: Rodrigo Bermudez Schettino Date: Fri, 26 Apr 2019 11:25:17 +0800 Subject: [PATCH 30/37] Readme: Improve outdated links to showcase Link to Showcase in awesome-docsify. --- README.md | 2 +- docs/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7854222..b8da0d8 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Look at [this tutorial](https://docsify.js.org/#/quickstart) These projects are using docsify to generate their sites. Pull requests welcome :blush: -Move to [awesome-docsify](https://github.com/docsifyjs/awesome-docsify) +Move to [awesome-docsify](https://github.com/docsifyjs/awesome-docsify#showcase) ## Similar projects diff --git a/docs/README.md b/docs/README.md index 1c07a8f..e625420 100644 --- a/docs/README.md +++ b/docs/README.md @@ -21,7 +21,7 @@ See the [Quick start](quickstart.md) guide for more details. ## Examples -Check out the [Showcase](https://github.com/docsifyjs/docsify/#showcase) to see docsify in use. +Check out the [Showcase](https://github.com/docsifyjs/awesome-docsify#showcase) to see docsify in use. ## Donate From b847c20cabac612f5395736cf49df858f41b3090 Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sun, 5 May 2019 13:10:02 +0200 Subject: [PATCH 31/37] Remove lib files from version control --- lib/docsify.js | 5111 ---------------------------- lib/docsify.min.js | 1 - lib/plugins/disqus.js | 54 - lib/plugins/disqus.min.js | 1 - lib/plugins/emoji.js | 903 ----- lib/plugins/emoji.min.js | 1 - lib/plugins/external-script.js | 28 - lib/plugins/external-script.min.js | 1 - lib/plugins/front-matter.js | 496 --- lib/plugins/front-matter.min.js | 1 - lib/plugins/ga.js | 41 - lib/plugins/ga.min.js | 1 - lib/plugins/gitalk.js | 26 - lib/plugins/gitalk.min.js | 1 - lib/plugins/search.js | 364 -- lib/plugins/search.min.js | 1 - lib/plugins/zoom-image.js | 40 - lib/plugins/zoom-image.min.js | 1 - lib/themes/buble.css | 1 - lib/themes/dark.css | 1 - lib/themes/dolphin.css | 1 - lib/themes/pure.css | 1 - lib/themes/vue.css | 1 - 23 files changed, 7077 deletions(-) delete mode 100644 lib/docsify.js delete mode 100644 lib/docsify.min.js delete mode 100644 lib/plugins/disqus.js delete mode 100644 lib/plugins/disqus.min.js delete mode 100644 lib/plugins/emoji.js delete mode 100644 lib/plugins/emoji.min.js delete mode 100644 lib/plugins/external-script.js delete mode 100644 lib/plugins/external-script.min.js delete mode 100644 lib/plugins/front-matter.js delete mode 100644 lib/plugins/front-matter.min.js delete mode 100644 lib/plugins/ga.js delete mode 100644 lib/plugins/ga.min.js delete mode 100644 lib/plugins/gitalk.js delete mode 100644 lib/plugins/gitalk.min.js delete mode 100644 lib/plugins/search.js delete mode 100644 lib/plugins/search.min.js delete mode 100644 lib/plugins/zoom-image.js delete mode 100644 lib/plugins/zoom-image.min.js delete mode 100644 lib/themes/buble.css delete mode 100644 lib/themes/dark.css delete mode 100644 lib/themes/dolphin.css delete mode 100644 lib/themes/pure.css delete mode 100644 lib/themes/vue.css diff --git a/lib/docsify.js b/lib/docsify.js deleted file mode 100644 index a4745da..0000000 --- a/lib/docsify.js +++ /dev/null @@ -1,5111 +0,0 @@ -(function () { -/** - * Create a cached version of a pure function. - */ -function cached(fn) { - var cache = Object.create(null); - return function (str) { - var key = isPrimitive(str) ? str : JSON.stringify(str); - var hit = cache[key]; - return hit || (cache[key] = fn(str)) - } -} - -/** - * Hyphenate a camelCase string. - */ -var hyphenate = cached(function (str) { - return str.replace(/([A-Z])/g, function (m) { return '-' + m.toLowerCase(); }) -}); - -var hasOwn = Object.prototype.hasOwnProperty; - -/** - * Simple Object.assign polyfill - */ -var merge = - Object.assign || - function (to) { - var arguments$1 = arguments; - - for (var i = 1; i < arguments.length; i++) { - var from = Object(arguments$1[i]); - - for (var key in from) { - if (hasOwn.call(from, key)) { - to[key] = from[key]; - } - } - } - - return to - }; - -/** - * Check if value is primitive - */ -function isPrimitive(value) { - return typeof value === 'string' || typeof value === 'number' -} - -/** - * Perform no operation. - */ -function noop() {} - -/** - * Check if value is function - */ -function isFn(obj) { - return typeof obj === 'function' -} - -function config () { - var config = merge( - { - el: '#app', - repo: '', - maxLevel: 6, - subMaxLevel: 0, - loadSidebar: null, - loadNavbar: null, - homepage: 'README.md', - coverpage: '', - basePath: '', - auto2top: false, - name: '', - themeColor: '', - nameLink: window.location.pathname, - autoHeader: false, - executeScript: null, - noEmoji: false, - ga: '', - ext: '.md', - mergeNavbar: false, - formatUpdated: '', - externalLinkTarget: '_blank', - routerMode: 'hash', - noCompileLinks: [], - relativePath: false - }, - window.$docsify - ); - - var script = - document.currentScript || - [].slice - .call(document.getElementsByTagName('script')) - .filter(function (n) { return /docsify\./.test(n.src); })[0]; - - if (script) { - for (var prop in config) { - if (hasOwn.call(config, prop)) { - var val = script.getAttribute('data-' + hyphenate(prop)); - - if (isPrimitive(val)) { - config[prop] = val === '' ? true : val; - } - } - } - - if (config.loadSidebar === true) { - config.loadSidebar = '_sidebar' + config.ext; - } - if (config.loadNavbar === true) { - config.loadNavbar = '_navbar' + config.ext; - } - if (config.coverpage === true) { - config.coverpage = '_coverpage' + config.ext; - } - if (config.repo === true) { - config.repo = ''; - } - if (config.name === true) { - config.name = ''; - } - } - - window.$docsify = config; - - return config -} - -function initLifecycle(vm) { - var hooks = [ - 'init', - 'mounted', - 'beforeEach', - 'afterEach', - 'doneEach', - 'ready' - ]; - - vm._hooks = {}; - vm._lifecycle = {}; - hooks.forEach(function (hook) { - var arr = (vm._hooks[hook] = []); - vm._lifecycle[hook] = function (fn) { return arr.push(fn); }; - }); -} - -function callHook(vm, hook, data, next) { - if ( next === void 0 ) next = noop; - - var queue = vm._hooks[hook]; - - var step = function (index) { - var hook = queue[index]; - if (index >= queue.length) { - next(data); - } else if (typeof hook === 'function') { - if (hook.length === 2) { - hook(data, function (result) { - data = result; - step(index + 1); - }); - } else { - var result = hook(data); - data = result === undefined ? data : result; - step(index + 1); - } - } else { - step(index + 1); - } - }; - - step(0); -} - -var inBrowser = !false; - -var isMobile = inBrowser && document.body.clientWidth <= 600; - -/** - * @see https://github.com/MoOx/pjax/blob/master/lib/is-supported.js - */ -var supportsPushState = - inBrowser && - (function () { - // Borrowed wholesale from https://github.com/defunkt/jquery-pjax - return ( - window.history && - window.history.pushState && - window.history.replaceState && - // PushState isn’t reliable on iOS until 5. - !navigator.userAgent.match( - /((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/ - ) - ) - })(); - -var cacheNode = {}; - -/** - * Get Node - * @param {String|Element} el - * @param {Boolean} noCache - * @return {Element} - */ -function getNode(el, noCache) { - if ( noCache === void 0 ) noCache = false; - - if (typeof el === 'string') { - if (typeof window.Vue !== 'undefined') { - return find(el) - } - el = noCache ? find(el) : cacheNode[el] || (cacheNode[el] = find(el)); - } - - return el -} - -var $ = inBrowser && document; - -var body = inBrowser && $.body; - -var head = inBrowser && $.head; - -/** - * Find element - * @example - * find('nav') => document.querySelector('nav') - * find(nav, 'a') => nav.querySelector('a') - */ -function find(el, node) { - return node ? el.querySelector(node) : $.querySelector(el) -} - -/** - * Find all elements - * @example - * findAll('a') => [].slice.call(document.querySelectorAll('a')) - * findAll(nav, 'a') => [].slice.call(nav.querySelectorAll('a')) - */ -function findAll(el, node) { - return [].slice.call( - node ? el.querySelectorAll(node) : $.querySelectorAll(el) - ) -} - -function create(node, tpl) { - node = $.createElement(node); - if (tpl) { - node.innerHTML = tpl; - } - return node -} - -function appendTo(target, el) { - return target.appendChild(el) -} - -function before(target, el) { - return target.insertBefore(el, target.children[0]) -} - -function on(el, type, handler) { - isFn(type) ? - window.addEventListener(el, type) : - el.addEventListener(type, handler); -} - -function off(el, type, handler) { - isFn(type) ? - window.removeEventListener(el, type) : - el.removeEventListener(type, handler); -} - -/** - * Toggle class - * - * @example - * toggleClass(el, 'active') => el.classList.toggle('active') - * toggleClass(el, 'add', 'active') => el.classList.add('active') - */ -function toggleClass(el, type, val) { - el && el.classList[val ? type : 'toggle'](val || type); -} - -function style(content) { - appendTo(head, create('style', content)); -} - - -var dom = Object.freeze({ - getNode: getNode, - $: $, - body: body, - head: head, - find: find, - findAll: findAll, - create: create, - appendTo: appendTo, - before: before, - on: on, - off: off, - toggleClass: toggleClass, - style: style -}); - -/** - * Render github corner - * @param {Object} data - * @return {String} - */ -function corner(data) { - if (!data) { - return '' - } - if (!/\/\//.test(data)) { - data = 'https://github.com/' + data; - } - data = data.replace(/^git\+/, ''); - - return ( - "" + - '' + - '' - ) -} - -/** - * Render main content - */ -function main(config) { - var aside = - '' + - ''; - - return ( - (isMobile ? (aside + "
    ") : ("
    " + aside)) + - '
    ' + - '
    ' + - '
    ' + - '
    ' - ) -} - -/** - * Cover Page - */ -function cover() { - var SL = ', 100%, 85%'; - var bgc = - 'linear-gradient(to left bottom, ' + - "hsl(" + (Math.floor(Math.random() * 255) + SL) + ") 0%," + - "hsl(" + (Math.floor(Math.random() * 255) + SL) + ") 100%)"; - - return ( - "
    " + - '
    ' + - '
    ' + - '
    ' - ) -} - -/** - * Render tree - * @param {Array} tree - * @param {String} tpl - * @return {String} - */ -function tree(toc, tpl) { - if ( tpl === void 0 ) tpl = '
      {inner}
    '; - - if (!toc || !toc.length) { - return '' - } - var innerHTML = ''; - toc.forEach(function (node) { - innerHTML += "
  • " + (node.title) + "
  • "; - if (node.children) { - innerHTML += tree(node.children, tpl); - } - }); - return tpl.replace('{inner}', innerHTML) -} - -function helper(className, content) { - return ("

    " + (content.slice(5).trim()) + "

    ") -} - -function theme(color) { - return ("") -} - -var barEl; -var timeId; - -/** - * Init progress component - */ -function init() { - var div = create('div'); - - div.classList.add('progress'); - appendTo(body, div); - barEl = div; -} -/** - * Render progress bar - */ -function progressbar (ref) { - var loaded = ref.loaded; - var total = ref.total; - var step = ref.step; - - var num; - - !barEl && init(); - - if (step) { - num = parseInt(barEl.style.width || 0, 10) + step; - num = num > 80 ? 80 : num; - } else { - num = Math.floor(loaded / total * 100); - } - - barEl.style.opacity = 1; - barEl.style.width = num >= 95 ? '100%' : num + '%'; - - if (num >= 95) { - clearTimeout(timeId); - timeId = setTimeout(function (_) { - barEl.style.opacity = 0; - barEl.style.width = '0%'; - }, 200); - } -} - -var cache = {}; - -/** - * Simple ajax get - * @param {string} url - * @param {boolean} [hasBar=false] has progress bar - * @return { then(resolve, reject), abort } - */ -function get(url, hasBar, headers) { - if ( hasBar === void 0 ) hasBar = false; - if ( headers === void 0 ) headers = {}; - - var xhr = new XMLHttpRequest(); - var on = function () { - xhr.addEventListener.apply(xhr, arguments); - }; - var cached$$1 = cache[url]; - - if (cached$$1) { - return {then: function (cb) { return cb(cached$$1.content, cached$$1.opt); }, abort: noop} - } - - xhr.open('GET', url); - for (var i in headers) { - if (hasOwn.call(headers, i)) { - xhr.setRequestHeader(i, headers[i]); - } - } - xhr.send(); - - return { - then: function (success, error) { - if ( error === void 0 ) error = noop; - - if (hasBar) { - var id = setInterval( - function (_) { return progressbar({ - step: Math.floor(Math.random() * 5 + 1) - }); }, - 500 - ); - - on('progress', progressbar); - on('loadend', function (evt) { - progressbar(evt); - clearInterval(id); - }); - } - - on('error', error); - on('load', function (ref) { - var target = ref.target; - - if (target.status >= 400) { - error(target); - } else { - var result = (cache[url] = { - content: target.response, - opt: { - updatedAt: xhr.getResponseHeader('last-modified') - } - }); - - success(result.content, result.opt); - } - }); - }, - abort: function (_) { return xhr.readyState !== 4 && xhr.abort(); } - } -} - -function replaceVar(block, color) { - block.innerHTML = block.innerHTML.replace( - /var\(\s*--theme-color.*?\)/g, - color - ); -} - -function cssVars (color) { - // Variable support - if (window.CSS && window.CSS.supports && window.CSS.supports('(--v:red)')) { - return - } - - var styleBlocks = findAll('style:not(.inserted),link'); - [].forEach.call(styleBlocks, function (block) { - if (block.nodeName === 'STYLE') { - replaceVar(block, color); - } else if (block.nodeName === 'LINK') { - var href = block.getAttribute('href'); - - if (!/\.css$/.test(href)) { - return - } - - get(href).then(function (res) { - var style$$1 = create('style', res); - - head.appendChild(style$$1); - replaceVar(style$$1, color); - }); - } - }); -} - -var RGX = /([^{]*?)\w(?=\})/g; - -var dict = { - YYYY: 'getFullYear', - YY: 'getYear', - MM: function (d) { - return d.getMonth() + 1; - }, - DD: 'getDate', - HH: 'getHours', - mm: 'getMinutes', - ss: 'getSeconds' -}; - -function tinydate (str) { - var parts=[], offset=0; - str.replace(RGX, function (key, _, idx) { - // save preceding string - parts.push(str.substring(offset, idx - 1)); - offset = idx += key.length + 1; - // save function - parts.push(function(d){ - return ('00' + (typeof dict[key]==='string' ? d[dict[key]]() : dict[key](d))).slice(-key.length); - }); - }); - - if (offset !== str.length) { - parts.push(str.substring(offset)); - } - - return function (arg) { - var out='', i=0, d=arg||new Date(); - for (; i ?(paragraph|[^\n]*)(?:\n|$))+/, - list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, - html: '^ {0,3}(?:' // optional indentation - + '<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)' // (1) - + '|comment[^\\n]*(\\n+|$)' // (2) - + '|<\\?[\\s\\S]*?\\?>\\n*' // (3) - + '|\\n*' // (4) - + '|\\n*' // (5) - + '|)[\\s\\S]*?(?:\\n{2,}|$)' // (6) - + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) open tag - + '|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)' // (7) closing tag - + ')', - def: /^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, - table: noop, - lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, - paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/, - text: /^[^\n]+/ -}; - -block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/; -block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; -block.def = edit(block.def) - .replace('label', block._label) - .replace('title', block._title) - .getRegex(); - -block.bullet = /(?:[*+-]|\d+\.)/; -block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; -block.item = edit(block.item, 'gm') - .replace(/bull/g, block.bullet) - .getRegex(); - -block.list = edit(block.list) - .replace(/bull/g, block.bullet) - .replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))') - .replace('def', '\\n+(?=' + block.def.source + ')') - .getRegex(); - -block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' - + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' - + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' - + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' - + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' - + '|track|ul'; -block._comment = //; -block.html = edit(block.html, 'i') - .replace('comment', block._comment) - .replace('tag', block._tag) - .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/) - .getRegex(); - -block.paragraph = edit(block.paragraph) - .replace('hr', block.hr) - .replace('heading', block.heading) - .replace('lheading', block.lheading) - .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks - .getRegex(); - -block.blockquote = edit(block.blockquote) - .replace('paragraph', block.paragraph) - .getRegex(); - -/** - * Normal Block Grammar - */ - -block.normal = merge({}, block); - -/** - * GFM Block Grammar - */ - -block.gfm = merge({}, block.normal, { - fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/, - paragraph: /^/, - heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ -}); - -block.gfm.paragraph = edit(block.paragraph) - .replace('(?!', '(?!' - + block.gfm.fences.source.replace('\\1', '\\2') + '|' - + block.list.source.replace('\\1', '\\3') + '|') - .getRegex(); - -/** - * GFM + Tables Block Grammar - */ - -block.tables = merge({}, block.gfm, { - nptable: /^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/, - table: /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/ -}); - -/** - * Pedantic grammar - */ - -block.pedantic = merge({}, block.normal, { - html: edit( - '^ *(?:comment *(?:\\n|\\s*$)' - + '|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)' // closed tag - + '|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))') - .replace('comment', block._comment) - .replace(/tag/g, '(?!(?:' - + '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') - .getRegex(), - def: /^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/ -}); - -/** - * Block Lexer - */ - -function Lexer(options) { - this.tokens = []; - this.tokens.links = Object.create(null); - this.options = options || marked.defaults; - this.rules = block.normal; - - if (this.options.pedantic) { - this.rules = block.pedantic; - } else if (this.options.gfm) { - if (this.options.tables) { - this.rules = block.tables; - } else { - this.rules = block.gfm; - } - } -} - -/** - * Expose Block Rules - */ - -Lexer.rules = block; - -/** - * Static Lex Method - */ - -Lexer.lex = function(src, options) { - var lexer = new Lexer(options); - return lexer.lex(src); -}; - -/** - * Preprocessing - */ - -Lexer.prototype.lex = function(src) { - src = src - .replace(/\r\n|\r/g, '\n') - .replace(/\t/g, ' ') - .replace(/\u00a0/g, ' ') - .replace(/\u2424/g, '\n'); - - return this.token(src, true); -}; - -/** - * Lexing - */ - -Lexer.prototype.token = function(src, top) { - var this$1 = this; - - src = src.replace(/^ +$/gm, ''); - var next, - loose, - cap, - bull, - b, - item, - listStart, - listItems, - t, - space, - i, - tag, - l, - isordered, - istask, - ischecked; - - while (src) { - // newline - if (cap = this$1.rules.newline.exec(src)) { - src = src.substring(cap[0].length); - if (cap[0].length > 1) { - this$1.tokens.push({ - type: 'space' - }); - } - } - - // code - if (cap = this$1.rules.code.exec(src)) { - src = src.substring(cap[0].length); - cap = cap[0].replace(/^ {4}/gm, ''); - this$1.tokens.push({ - type: 'code', - text: !this$1.options.pedantic - ? rtrim(cap, '\n') - : cap - }); - continue; - } - - // fences (gfm) - if (cap = this$1.rules.fences.exec(src)) { - src = src.substring(cap[0].length); - this$1.tokens.push({ - type: 'code', - lang: cap[2], - text: cap[3] || '' - }); - continue; - } - - // heading - if (cap = this$1.rules.heading.exec(src)) { - src = src.substring(cap[0].length); - this$1.tokens.push({ - type: 'heading', - depth: cap[1].length, - text: cap[2] - }); - continue; - } - - // table no leading pipe (gfm) - if (top && (cap = this$1.rules.nptable.exec(src))) { - item = { - type: 'table', - header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] - }; - - if (item.header.length === item.align.length) { - src = src.substring(cap[0].length); - - for (i = 0; i < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = splitCells(item.cells[i], item.header.length); - } - - this$1.tokens.push(item); - - continue; - } - } - - // hr - if (cap = this$1.rules.hr.exec(src)) { - src = src.substring(cap[0].length); - this$1.tokens.push({ - type: 'hr' - }); - continue; - } - - // blockquote - if (cap = this$1.rules.blockquote.exec(src)) { - src = src.substring(cap[0].length); - - this$1.tokens.push({ - type: 'blockquote_start' - }); - - cap = cap[0].replace(/^ *> ?/gm, ''); - - // Pass `top` to keep the current - // "toplevel" state. This is exactly - // how markdown.pl works. - this$1.token(cap, top); - - this$1.tokens.push({ - type: 'blockquote_end' - }); - - continue; - } - - // list - if (cap = this$1.rules.list.exec(src)) { - src = src.substring(cap[0].length); - bull = cap[2]; - isordered = bull.length > 1; - - listStart = { - type: 'list_start', - ordered: isordered, - start: isordered ? +bull : '', - loose: false - }; - - this$1.tokens.push(listStart); - - // Get each top-level item. - cap = cap[0].match(this$1.rules.item); - - listItems = []; - next = false; - l = cap.length; - i = 0; - - for (; i < l; i++) { - item = cap[i]; - - // Remove the list item's bullet - // so it is seen as the next token. - space = item.length; - item = item.replace(/^ *([*+-]|\d+\.) +/, ''); - - // Outdent whatever the - // list item contains. Hacky. - if (~item.indexOf('\n ')) { - space -= item.length; - item = !this$1.options.pedantic - ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') - : item.replace(/^ {1,4}/gm, ''); - } - - // Determine whether the next list item belongs here. - // Backpedal if it does not belong in this list. - if (this$1.options.smartLists && i !== l - 1) { - b = block.bullet.exec(cap[i + 1])[0]; - if (bull !== b && !(bull.length > 1 && b.length > 1)) { - src = cap.slice(i + 1).join('\n') + src; - i = l - 1; - } - } - - // Determine whether item is loose or not. - // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ - // for discount behavior. - loose = next || /\n\n(?!\s*$)/.test(item); - if (i !== l - 1) { - next = item.charAt(item.length - 1) === '\n'; - if (!loose) { loose = next; } - } - - if (loose) { - listStart.loose = true; - } - - // Check for task list items - istask = /^\[[ xX]\] /.test(item); - ischecked = undefined; - if (istask) { - ischecked = item[1] !== ' '; - item = item.replace(/^\[[ xX]\] +/, ''); - } - - t = { - type: 'list_item_start', - task: istask, - checked: ischecked, - loose: loose - }; - - listItems.push(t); - this$1.tokens.push(t); - - // Recurse. - this$1.token(item, false); - - this$1.tokens.push({ - type: 'list_item_end' - }); - } - - if (listStart.loose) { - l = listItems.length; - i = 0; - for (; i < l; i++) { - listItems[i].loose = true; - } - } - - this$1.tokens.push({ - type: 'list_end' - }); - - continue; - } - - // html - if (cap = this$1.rules.html.exec(src)) { - src = src.substring(cap[0].length); - this$1.tokens.push({ - type: this$1.options.sanitize - ? 'paragraph' - : 'html', - pre: !this$1.options.sanitizer - && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), - text: cap[0] - }); - continue; - } - - // def - if (top && (cap = this$1.rules.def.exec(src))) { - src = src.substring(cap[0].length); - if (cap[3]) { cap[3] = cap[3].substring(1, cap[3].length - 1); } - tag = cap[1].toLowerCase().replace(/\s+/g, ' '); - if (!this$1.tokens.links[tag]) { - this$1.tokens.links[tag] = { - href: cap[2], - title: cap[3] - }; - } - continue; - } - - // table (gfm) - if (top && (cap = this$1.rules.table.exec(src))) { - item = { - type: 'table', - header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3] ? cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') : [] - }; - - if (item.header.length === item.align.length) { - src = src.substring(cap[0].length); - - for (i = 0; i < item.align.length; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - - for (i = 0; i < item.cells.length; i++) { - item.cells[i] = splitCells( - item.cells[i].replace(/^ *\| *| *\| *$/g, ''), - item.header.length); - } - - this$1.tokens.push(item); - - continue; - } - } - - // lheading - if (cap = this$1.rules.lheading.exec(src)) { - src = src.substring(cap[0].length); - this$1.tokens.push({ - type: 'heading', - depth: cap[2] === '=' ? 1 : 2, - text: cap[1] - }); - continue; - } - - // top-level paragraph - if (top && (cap = this$1.rules.paragraph.exec(src))) { - src = src.substring(cap[0].length); - this$1.tokens.push({ - type: 'paragraph', - text: cap[1].charAt(cap[1].length - 1) === '\n' - ? cap[1].slice(0, -1) - : cap[1] - }); - continue; - } - - // text - if (cap = this$1.rules.text.exec(src)) { - // Top-level should never reach here. - src = src.substring(cap[0].length); - this$1.tokens.push({ - type: 'text', - text: cap[0] - }); - continue; - } - - if (src) { - throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); - } - } - - return this.tokens; -}; - -/** - * Inline-Level Grammar - */ - -var inline = { - escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, - autolink: /^<(scheme:[^\s\x00-\x1f<>]*|email)>/, - url: noop, - tag: '^comment' - + '|^' // self-closing tag - + '|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>' // open tag - + '|^<\\?[\\s\\S]*?\\?>' // processing instruction, e.g. - + '|^' // declaration, e.g. - + '|^', // CDATA section - link: /^!?\[(label)\]\(href(?:\s+(title))?\s*\)/, - reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/, - nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/, - strong: /^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/, - em: /^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/, - code: /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, - br: /^( {2,}|\\)\n(?!\s*$)/, - del: noop, - text: /^(`+|[^`])[\s\S]*?(?=[\\?@\[\]\\^_`{|}~])/g; - -inline._scheme = /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/; -inline._email = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/; -inline.autolink = edit(inline.autolink) - .replace('scheme', inline._scheme) - .replace('email', inline._email) - .getRegex(); - -inline._attribute = /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/; - -inline.tag = edit(inline.tag) - .replace('comment', block._comment) - .replace('attribute', inline._attribute) - .getRegex(); - -inline._label = /(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/; -inline._href = /\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f\\]*\)|[^\s\x00-\x1f()\\])*?)/; -inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/; - -inline.link = edit(inline.link) - .replace('label', inline._label) - .replace('href', inline._href) - .replace('title', inline._title) - .getRegex(); - -inline.reflink = edit(inline.reflink) - .replace('label', inline._label) - .getRegex(); - -/** - * Normal Inline Grammar - */ - -inline.normal = merge({}, inline); - -/** - * Pedantic Inline Grammar - */ - -inline.pedantic = merge({}, inline.normal, { - strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, - em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/, - link: edit(/^!?\[(label)\]\((.*?)\)/) - .replace('label', inline._label) - .getRegex(), - reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/) - .replace('label', inline._label) - .getRegex() -}); - -/** - * GFM Inline Grammar - */ - -inline.gfm = merge({}, inline.normal, { - escape: edit(inline.escape).replace('])', '~|])').getRegex(), - _extended_email: /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/, - url: /^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, - _backpedal: /(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/, - del: /^~+(?=\S)([\s\S]*?\S)~+/, - text: edit(inline.text) - .replace(']|', '~]|') - .replace('|$', '|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&\'*+/=?^_`{\\|}~-]+@|$') - .getRegex() -}); - -inline.gfm.url = edit(inline.gfm.url) - .replace('email', inline.gfm._extended_email) - .getRegex(); -/** - * GFM + Line Breaks Inline Grammar - */ - -inline.breaks = merge({}, inline.gfm, { - br: edit(inline.br).replace('{2,}', '*').getRegex(), - text: edit(inline.gfm.text).replace('{2,}', '*').getRegex() -}); - -/** - * Inline Lexer & Compiler - */ - -function InlineLexer(links, options) { - this.options = options || marked.defaults; - this.links = links; - this.rules = inline.normal; - this.renderer = this.options.renderer || new Renderer(); - this.renderer.options = this.options; - - if (!this.links) { - throw new Error('Tokens array requires a `links` property.'); - } - - if (this.options.pedantic) { - this.rules = inline.pedantic; - } else if (this.options.gfm) { - if (this.options.breaks) { - this.rules = inline.breaks; - } else { - this.rules = inline.gfm; - } - } -} - -/** - * Expose Inline Rules - */ - -InlineLexer.rules = inline; - -/** - * Static Lexing/Compiling Method - */ - -InlineLexer.output = function(src, links, options) { - var inline = new InlineLexer(links, options); - return inline.output(src); -}; - -/** - * Lexing/Compiling - */ - -InlineLexer.prototype.output = function(src) { - var this$1 = this; - - var out = '', - link, - text, - href, - title, - cap, - prevCapZero; - - while (src) { - // escape - if (cap = this$1.rules.escape.exec(src)) { - src = src.substring(cap[0].length); - out += cap[1]; - continue; - } - - // autolink - if (cap = this$1.rules.autolink.exec(src)) { - src = src.substring(cap[0].length); - if (cap[2] === '@') { - text = escape(this$1.mangle(cap[1])); - href = 'mailto:' + text; - } else { - text = escape(cap[1]); - href = text; - } - out += this$1.renderer.link(href, null, text); - continue; - } - - // url (gfm) - if (!this$1.inLink && (cap = this$1.rules.url.exec(src))) { - if (cap[2] === '@') { - text = escape(cap[0]); - href = 'mailto:' + text; - } else { - // do extended autolink path validation - do { - prevCapZero = cap[0]; - cap[0] = this$1.rules._backpedal.exec(cap[0])[0]; - } while (prevCapZero !== cap[0]); - text = escape(cap[0]); - if (cap[1] === 'www.') { - href = 'http://' + text; - } else { - href = text; - } - } - src = src.substring(cap[0].length); - out += this$1.renderer.link(href, null, text); - continue; - } - - // tag - if (cap = this$1.rules.tag.exec(src)) { - if (!this$1.inLink && /^/i.test(cap[0])) { - this$1.inLink = false; - } - if (!this$1.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - this$1.inRawBlock = true; - } else if (this$1.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - this$1.inRawBlock = false; - } - - src = src.substring(cap[0].length); - out += this$1.options.sanitize - ? this$1.options.sanitizer - ? this$1.options.sanitizer(cap[0]) - : escape(cap[0]) - : cap[0]; - continue; - } - - // link - if (cap = this$1.rules.link.exec(src)) { - src = src.substring(cap[0].length); - this$1.inLink = true; - href = cap[2]; - if (this$1.options.pedantic) { - link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); - - if (link) { - href = link[1]; - title = link[3]; - } else { - title = ''; - } - } else { - title = cap[3] ? cap[3].slice(1, -1) : ''; - } - href = href.trim().replace(/^<([\s\S]*)>$/, '$1'); - out += this$1.outputLink(cap, { - href: InlineLexer.escapes(href), - title: InlineLexer.escapes(title) - }); - this$1.inLink = false; - continue; - } - - // reflink, nolink - if ((cap = this$1.rules.reflink.exec(src)) - || (cap = this$1.rules.nolink.exec(src))) { - src = src.substring(cap[0].length); - link = (cap[2] || cap[1]).replace(/\s+/g, ' '); - link = this$1.links[link.toLowerCase()]; - if (!link || !link.href) { - out += cap[0].charAt(0); - src = cap[0].substring(1) + src; - continue; - } - this$1.inLink = true; - out += this$1.outputLink(cap, link); - this$1.inLink = false; - continue; - } - - // strong - if (cap = this$1.rules.strong.exec(src)) { - src = src.substring(cap[0].length); - out += this$1.renderer.strong(this$1.output(cap[4] || cap[3] || cap[2] || cap[1])); - continue; - } - - // em - if (cap = this$1.rules.em.exec(src)) { - src = src.substring(cap[0].length); - out += this$1.renderer.em(this$1.output(cap[6] || cap[5] || cap[4] || cap[3] || cap[2] || cap[1])); - continue; - } - - // code - if (cap = this$1.rules.code.exec(src)) { - src = src.substring(cap[0].length); - out += this$1.renderer.codespan(escape(cap[2].trim(), true)); - continue; - } - - // br - if (cap = this$1.rules.br.exec(src)) { - src = src.substring(cap[0].length); - out += this$1.renderer.br(); - continue; - } - - // del (gfm) - if (cap = this$1.rules.del.exec(src)) { - src = src.substring(cap[0].length); - out += this$1.renderer.del(this$1.output(cap[1])); - continue; - } - - // text - if (cap = this$1.rules.text.exec(src)) { - src = src.substring(cap[0].length); - if (this$1.inRawBlock) { - out += this$1.renderer.text(cap[0]); - } else { - out += this$1.renderer.text(escape(this$1.smartypants(cap[0]))); - } - continue; - } - - if (src) { - throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); - } - } - - return out; -}; - -InlineLexer.escapes = function(text) { - return text ? text.replace(InlineLexer.rules._escapes, '$1') : text; -}; - -/** - * Compile Link - */ - -InlineLexer.prototype.outputLink = function(cap, link) { - var href = link.href, - title = link.title ? escape(link.title) : null; - - return cap[0].charAt(0) !== '!' - ? this.renderer.link(href, title, this.output(cap[1])) - : this.renderer.image(href, title, escape(cap[1])); -}; - -/** - * Smartypants Transformations - */ - -InlineLexer.prototype.smartypants = function(text) { - if (!this.options.smartypants) { return text; } - return text - // em-dashes - .replace(/---/g, '\u2014') - // en-dashes - .replace(/--/g, '\u2013') - // opening singles - .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') - // closing singles & apostrophes - .replace(/'/g, '\u2019') - // opening doubles - .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') - // closing doubles - .replace(/"/g, '\u201d') - // ellipses - .replace(/\.{3}/g, '\u2026'); -}; - -/** - * Mangle Links - */ - -InlineLexer.prototype.mangle = function(text) { - if (!this.options.mangle) { return text; } - var out = '', - l = text.length, - i = 0, - ch; - - for (; i < l; i++) { - ch = text.charCodeAt(i); - if (Math.random() > 0.5) { - ch = 'x' + ch.toString(16); - } - out += '&#' + ch + ';'; - } - - return out; -}; - -/** - * Renderer - */ - -function Renderer(options) { - this.options = options || marked.defaults; -} - -Renderer.prototype.code = function(code, lang, escaped) { - if (this.options.highlight) { - var out = this.options.highlight(code, lang); - if (out != null && out !== code) { - escaped = true; - code = out; - } - } - - if (!lang) { - return '
    '
    -      + (escaped ? code : escape(code, true))
    -      + '
    '; - } - - return '
    '
    -    + (escaped ? code : escape(code, true))
    -    + '
    \n'; -}; - -Renderer.prototype.blockquote = function(quote) { - return '
    \n' + quote + '
    \n'; -}; - -Renderer.prototype.html = function(html) { - return html; -}; - -Renderer.prototype.heading = function(text, level, raw) { - if (this.options.headerIds) { - return '' - + text - + '\n'; - } - // ignore IDs - return '' + text + '\n'; -}; - -Renderer.prototype.hr = function() { - return this.options.xhtml ? '
    \n' : '
    \n'; -}; - -Renderer.prototype.list = function(body, ordered, start) { - var type = ordered ? 'ol' : 'ul', - startatt = (ordered && start !== 1) ? (' start="' + start + '"') : ''; - return '<' + type + startatt + '>\n' + body + '\n'; -}; - -Renderer.prototype.listitem = function(text) { - return '
  • ' + text + '
  • \n'; -}; - -Renderer.prototype.checkbox = function(checked) { - return ' '; -}; - -Renderer.prototype.paragraph = function(text) { - return '

    ' + text + '

    \n'; -}; - -Renderer.prototype.table = function(header, body) { - if (body) { body = '' + body + ''; } - - return '\n' - + '\n' - + header - + '\n' - + body - + '
    \n'; -}; - -Renderer.prototype.tablerow = function(content) { - return '\n' + content + '\n'; -}; - -Renderer.prototype.tablecell = function(content, flags) { - var type = flags.header ? 'th' : 'td'; - var tag = flags.align - ? '<' + type + ' align="' + flags.align + '">' - : '<' + type + '>'; - return tag + content + '\n'; -}; - -// span level renderer -Renderer.prototype.strong = function(text) { - return '' + text + ''; -}; - -Renderer.prototype.em = function(text) { - return '' + text + ''; -}; - -Renderer.prototype.codespan = function(text) { - return '' + text + ''; -}; - -Renderer.prototype.br = function() { - return this.options.xhtml ? '
    ' : '
    '; -}; - -Renderer.prototype.del = function(text) { - return '' + text + ''; -}; - -Renderer.prototype.link = function(href, title, text) { - if (this.options.sanitize) { - try { - var prot = decodeURIComponent(unescape(href)) - .replace(/[^\w:]/g, '') - .toLowerCase(); - } catch (e) { - return text; - } - if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { - return text; - } - } - if (this.options.baseUrl && !originIndependentUrl.test(href)) { - href = resolveUrl(this.options.baseUrl, href); - } - try { - href = encodeURI(href).replace(/%25/g, '%'); - } catch (e) { - return text; - } - var out = '
    '; - return out; -}; - -Renderer.prototype.image = function(href, title, text) { - if (this.options.baseUrl && !originIndependentUrl.test(href)) { - href = resolveUrl(this.options.baseUrl, href); - } - var out = '' + text + '' : '>'; - return out; -}; - -Renderer.prototype.text = function(text) { - return text; -}; - -/** - * TextRenderer - * returns only the textual part of the token - */ - -function TextRenderer() {} - -// no need for block level renderers - -TextRenderer.prototype.strong = -TextRenderer.prototype.em = -TextRenderer.prototype.codespan = -TextRenderer.prototype.del = -TextRenderer.prototype.text = function (text) { - return text; -}; - -TextRenderer.prototype.link = -TextRenderer.prototype.image = function(href, title, text) { - return '' + text; -}; - -TextRenderer.prototype.br = function() { - return ''; -}; - -/** - * Parsing & Compiling - */ - -function Parser(options) { - this.tokens = []; - this.token = null; - this.options = options || marked.defaults; - this.options.renderer = this.options.renderer || new Renderer(); - this.renderer = this.options.renderer; - this.renderer.options = this.options; -} - -/** - * Static Parse Method - */ - -Parser.parse = function(src, options) { - var parser = new Parser(options); - return parser.parse(src); -}; - -/** - * Parse Loop - */ - -Parser.prototype.parse = function(src) { - var this$1 = this; - - this.inline = new InlineLexer(src.links, this.options); - // use an InlineLexer with a TextRenderer to extract pure text - this.inlineText = new InlineLexer( - src.links, - merge({}, this.options, {renderer: new TextRenderer()}) - ); - this.tokens = src.reverse(); - - var out = ''; - while (this.next()) { - out += this$1.tok(); - } - - return out; -}; - -/** - * Next Token - */ - -Parser.prototype.next = function() { - return this.token = this.tokens.pop(); -}; - -/** - * Preview Next Token - */ - -Parser.prototype.peek = function() { - return this.tokens[this.tokens.length - 1] || 0; -}; - -/** - * Parse Text Tokens - */ - -Parser.prototype.parseText = function() { - var this$1 = this; - - var body = this.token.text; - - while (this.peek().type === 'text') { - body += '\n' + this$1.next().text; - } - - return this.inline.output(body); -}; - -/** - * Parse Current Token - */ - -Parser.prototype.tok = function() { - var this$1 = 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, - unescape(this.inlineText.output(this.token.text))); - } - case 'code': { - return this.renderer.code(this.token.text, - this.token.lang, - this.token.escaped); - } - case 'table': { - var header = '', - body = '', - i, - row, - cell, - j; - - // header - cell = ''; - for (i = 0; i < this.token.header.length; i++) { - cell += this$1.renderer.tablecell( - this$1.inline.output(this$1.token.header[i]), - { header: true, align: this$1.token.align[i] } - ); - } - header += this.renderer.tablerow(cell); - - for (i = 0; i < this.token.cells.length; i++) { - row = this$1.token.cells[i]; - - cell = ''; - for (j = 0; j < row.length; j++) { - cell += this$1.renderer.tablecell( - this$1.inline.output(row[j]), - { header: false, align: this$1.token.align[j] } - ); - } - - body += this$1.renderer.tablerow(cell); - } - return this.renderer.table(header, body); - } - case 'blockquote_start': { - body = ''; - - while (this.next().type !== 'blockquote_end') { - body += this$1.tok(); - } - - return this.renderer.blockquote(body); - } - case 'list_start': { - body = ''; - var ordered = this.token.ordered, - start = this.token.start; - - while (this.next().type !== 'list_end') { - body += this$1.tok(); - } - - return this.renderer.list(body, ordered, start); - } - case 'list_item_start': { - body = ''; - var loose = this.token.loose; - - if (this.token.task) { - body += this.renderer.checkbox(this.token.checked); - } - - while (this.next().type !== 'list_item_end') { - body += !loose && this$1.token.type === 'text' - ? this$1.parseText() - : this$1.tok(); - } - - return this.renderer.listitem(body); - } - case 'html': { - // TODO parse inline content if parameter markdown=1 - return this.renderer.html(this.token.text); - } - case 'paragraph': { - return this.renderer.paragraph(this.inline.output(this.token.text)); - } - case 'text': { - return this.renderer.paragraph(this.parseText()); - } - } -}; - -/** - * Helpers - */ - -function escape(html, encode) { - if (encode) { - if (escape.escapeTest.test(html)) { - return html.replace(escape.escapeReplace, function (ch) { return escape.replacements[ch] }); - } - } else { - if (escape.escapeTestNoEncode.test(html)) { - return html.replace(escape.escapeReplaceNoEncode, function (ch) { return escape.replacements[ch] }); - } - } - - return html; -} - -escape.escapeTest = /[&<>"']/; -escape.escapeReplace = /[&<>"']/g; -escape.replacements = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' -}; - -escape.escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/; -escape.escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g; - -function unescape(html) { - // explicitly match decimal, hex, and named HTML entities - return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, function(_, n) { - n = n.toLowerCase(); - if (n === 'colon') { return ':'; } - if (n.charAt(0) === '#') { - return n.charAt(1) === 'x' - ? String.fromCharCode(parseInt(n.substring(2), 16)) - : String.fromCharCode(+n.substring(1)); - } - return ''; - }); -} - -function edit(regex, opt) { - regex = regex.source || regex; - opt = opt || ''; - return { - replace: function(name, val) { - val = val.source || val; - val = val.replace(/(^|[^\[])\^/g, '$1'); - regex = regex.replace(name, val); - return this; - }, - getRegex: function() { - return new RegExp(regex, opt); - } - }; -} - -function resolveUrl(base, href) { - if (!baseUrls[' ' + base]) { - // we can ignore everything in base after the last slash of its path component, - // but we might need to add _that_ - // https://tools.ietf.org/html/rfc3986#section-3 - if (/^[^:]+:\/*[^/]*$/.test(base)) { - baseUrls[' ' + base] = base + '/'; - } else { - baseUrls[' ' + base] = rtrim(base, '/', true); - } - } - base = baseUrls[' ' + base]; - - if (href.slice(0, 2) === '//') { - return base.replace(/:[\s\S]*/, ':') + href; - } else if (href.charAt(0) === '/') { - return base.replace(/(:\/*[^/]*)[\s\S]*/, '$1') + href; - } else { - return base + href; - } -} -var baseUrls = {}; -var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i; - -function noop() {} -noop.exec = noop; - -function merge(obj) { - var arguments$1 = arguments; - - var i = 1, - target, - key; - - for (; i < arguments.length; i++) { - target = arguments$1[i]; - for (key in target) { - if (Object.prototype.hasOwnProperty.call(target, key)) { - obj[key] = target[key]; - } - } - } - - return obj; -} - -function splitCells(tableRow, count) { - // ensure that every cell-delimiting pipe has a space - // before it to distinguish it from an escaped pipe - var row = tableRow.replace(/\|/g, function (match, offset, str) { - var escaped = false, - curr = offset; - while (--curr >= 0 && str[curr] === '\\') { escaped = !escaped; } - if (escaped) { - // odd number of slashes means | is escaped - // so we leave it alone - return '|'; - } else { - // add space before unescaped | - return ' |'; - } - }), - cells = row.split(/ \|/), - i = 0; - - if (cells.length > count) { - cells.splice(count); - } else { - while (cells.length < count) { cells.push(''); } - } - - for (; i < cells.length; i++) { - // leading or trailing whitespace is ignored per the gfm spec - cells[i] = cells[i].trim().replace(/\\\|/g, '|'); - } - return cells; -} - -// Remove trailing 'c's. Equivalent to str.replace(/c*$/, ''). -// /c*$/ is vulnerable to REDOS. -// invert: Remove suffix of non-c chars instead. Default falsey. -function rtrim(str, c, invert) { - if (str.length === 0) { - return ''; - } - - // Length of suffix matching the invert condition. - var suffLen = 0; - - // Step left until we fail to match the invert condition. - while (suffLen < str.length) { - var currChar = str.charAt(str.length - suffLen - 1); - if (currChar === c && !invert) { - suffLen++; - } else if (currChar !== c && invert) { - suffLen++; - } else { - break; - } - } - - return str.substr(0, str.length - suffLen); -} - -/** - * Marked - */ - -function marked(src, opt, callback) { - // throw error in case of non string input - if (typeof src === 'undefined' || src === null) { - throw new Error('marked(): input parameter is undefined or null'); - } - if (typeof src !== 'string') { - throw new Error('marked(): input parameter is of type ' - + Object.prototype.toString.call(src) + ', string expected'); - } - - if (callback || typeof opt === 'function') { - if (!callback) { - callback = opt; - opt = null; - } - - opt = merge({}, marked.defaults, opt || {}); - - var highlight = opt.highlight, - tokens, - pending, - i = 0; - - try { - tokens = Lexer.lex(src, opt); - } catch (e) { - return callback(e); - } - - pending = tokens.length; - - var done = function(err) { - if (err) { - opt.highlight = highlight; - return callback(err); - } - - var out; - - try { - out = Parser.parse(tokens, opt); - } catch (e) { - err = e; - } - - opt.highlight = highlight; - - return err - ? callback(err) - : callback(null, out); - }; - - if (!highlight || highlight.length < 3) { - return done(); - } - - delete opt.highlight; - - if (!pending) { return done(); } - - for (; i < tokens.length; i++) { - (function(token) { - if (token.type !== 'code') { - return --pending || done(); - } - return highlight(token.text, token.lang, function(err, code) { - if (err) { return done(err); } - if (code == null || code === token.text) { - return --pending || done(); - } - token.text = code; - token.escaped = true; - --pending || done(); - }); - })(tokens[i]); - } - - return; - } - try { - if (opt) { opt = merge({}, marked.defaults, opt); } - return Parser.parse(Lexer.lex(src, opt), opt); - } catch (e) { - e.message += '\nPlease report this to https://github.com/markedjs/marked.'; - if ((opt || marked.defaults).silent) { - return '

    An error occurred:

    '
    -        + escape(e.message + '', true)
    -        + '
    '; - } - throw e; - } -} - -/** - * Options - */ - -marked.options = -marked.setOptions = function(opt) { - merge(marked.defaults, opt); - return marked; -}; - -marked.getDefaults = function () { - return { - baseUrl: null, - breaks: false, - gfm: true, - headerIds: true, - headerPrefix: '', - highlight: null, - langPrefix: 'language-', - mangle: true, - pedantic: false, - renderer: new Renderer(), - sanitize: false, - sanitizer: null, - silent: false, - smartLists: false, - smartypants: false, - tables: true, - xhtml: false - }; -}; - -marked.defaults = marked.getDefaults(); - -/** - * Expose - */ - -marked.Parser = Parser; -marked.parser = Parser.parse; - -marked.Renderer = Renderer; -marked.TextRenderer = TextRenderer; - -marked.Lexer = Lexer; -marked.lexer = Lexer.lex; - -marked.InlineLexer = InlineLexer; -marked.inlineLexer = InlineLexer.output; - -marked.parse = marked; - -{ - module.exports = marked; -} -})(commonjsGlobal || (typeof window !== 'undefined' ? window : commonjsGlobal)); -}); - -var prism = createCommonjsModule(function (module) { -/* ********************************************** - Begin prism-core.js -********************************************** */ - -var _self = (typeof window !== 'undefined') - ? window // if in browser - : ( - (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) - ? self // if in worker - : {} // if in node js - ); - -/** - * Prism: Lightweight, robust, elegant syntax highlighting - * MIT license http://www.opensource.org/licenses/mit-license.php/ - * @author Lea Verou http://lea.verou.me - */ - -var Prism = (function(){ - -// Private helper vars -var lang = /\blang(?:uage)?-([\w-]+)\b/i; -var uniqueId = 0; - -var _ = _self.Prism = { - manual: _self.Prism && _self.Prism.manual, - disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler, - util: { - encode: function (tokens) { - if (tokens instanceof Token) { - return new Token(tokens.type, _.util.encode(tokens.content), tokens.alias); - } else if (_.util.type(tokens) === 'Array') { - return tokens.map(_.util.encode); - } else { - return tokens.replace(/&/g, '&').replace(/ text.length) { - // Something went terribly wrong, ABORT, ABORT! - return; - } - - if (str instanceof Token) { - continue; - } - - if (greedy && i != strarr.length - 1) { - pattern.lastIndex = pos; - var match = pattern.exec(text); - if (!match) { - break; - } - - var from = match.index + (lookbehind ? match[1].length : 0), - to = match.index + match[0].length, - k = i, - p = pos; - - for (var len = strarr.length; k < len && (p < to || (!strarr[k].type && !strarr[k - 1].greedy)); ++k) { - p += strarr[k].length; - // Move the index i to the element in strarr that is closest to from - if (from >= p) { - ++i; - pos = p; - } - } - - // If strarr[i] is a Token, then the match starts inside another Token, which is invalid - if (strarr[i] instanceof Token) { - continue; - } - - // Number of tokens to delete and replace with the new match - delNum = k - i; - str = text.slice(pos, p); - match.index -= pos; - } else { - pattern.lastIndex = 0; - - var match = pattern.exec(str), - delNum = 1; - } - - if (!match) { - if (oneshot) { - break; - } - - continue; - } - - if(lookbehind) { - lookbehindLength = match[1] ? match[1].length : 0; - } - - var from = match.index + lookbehindLength, - match = match[0].slice(lookbehindLength), - to = from + match.length, - before = str.slice(0, from), - after = str.slice(to); - - var args = [i, delNum]; - - if (before) { - ++i; - pos += before.length; - args.push(before); - } - - var wrapped = new Token(token, inside? _.tokenize(match, inside) : match, alias, match, greedy); - - args.push(wrapped); - - if (after) { - args.push(after); - } - - Array.prototype.splice.apply(strarr, args); - - if (delNum != 1) - { _.matchGrammar(text, strarr, grammar, i, pos, true, token); } - - if (oneshot) - { break; } - } - } - } - }, - - tokenize: function(text, grammar, language) { - var strarr = [text]; - - var rest = grammar.rest; - - if (rest) { - for (var token in rest) { - grammar[token] = rest[token]; - } - - delete grammar.rest; - } - - _.matchGrammar(text, strarr, grammar, 0, 0, false); - - return strarr; - }, - - hooks: { - all: {}, - - add: function (name, callback) { - var hooks = _.hooks.all; - - hooks[name] = hooks[name] || []; - - hooks[name].push(callback); - }, - - run: function (name, env) { - var callbacks = _.hooks.all[name]; - - if (!callbacks || !callbacks.length) { - return; - } - - for (var i=0, callback; callback = callbacks[i++];) { - callback(env); - } - } - } -}; - -var Token = _.Token = function(type, content, alias, matchedStr, greedy) { - this.type = type; - this.content = content; - this.alias = alias; - // Copy of the full string this token was created from - this.length = (matchedStr || "").length|0; - this.greedy = !!greedy; -}; - -Token.stringify = function(o, language, parent) { - if (typeof o == 'string') { - return o; - } - - if (_.util.type(o) === 'Array') { - return o.map(function(element) { - return Token.stringify(element, language, o); - }).join(''); - } - - var env = { - type: o.type, - content: Token.stringify(o.content, language, parent), - tag: 'span', - classes: ['token', o.type], - attributes: {}, - language: language, - parent: parent - }; - - if (o.alias) { - var aliases = _.util.type(o.alias) === 'Array' ? o.alias : [o.alias]; - Array.prototype.push.apply(env.classes, aliases); - } - - _.hooks.run('wrap', env); - - var attributes = Object.keys(env.attributes).map(function(name) { - return name + '="' + (env.attributes[name] || '').replace(/"/g, '"') + '"'; - }).join(' '); - - return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + (attributes ? ' ' + attributes : '') + '>' + env.content + ''; - -}; - -if (!_self.document) { - if (!_self.addEventListener) { - // in Node.js - return _self.Prism; - } - - if (!_.disableWorkerMessageHandler) { - // In worker - _self.addEventListener('message', function (evt) { - var message = JSON.parse(evt.data), - lang = message.language, - code = message.code, - immediateClose = message.immediateClose; - - _self.postMessage(_.highlight(code, _.languages[lang], lang)); - if (immediateClose) { - _self.close(); - } - }, false); - } - - return _self.Prism; -} - -//Get current script and highlight -var script = document.currentScript || [].slice.call(document.getElementsByTagName("script")).pop(); - -if (script) { - _.filename = script.src; - - if (!_.manual && !script.hasAttribute('data-manual')) { - if(document.readyState !== "loading") { - if (window.requestAnimationFrame) { - window.requestAnimationFrame(_.highlightAll); - } else { - window.setTimeout(_.highlightAll, 16); - } - } - else { - document.addEventListener('DOMContentLoaded', _.highlightAll); - } - } -} - -return _self.Prism; - -})(); - -if ('object' !== 'undefined' && module.exports) { - module.exports = Prism; -} - -// hack for components to work correctly in node.js -if (typeof commonjsGlobal !== 'undefined') { - commonjsGlobal.Prism = Prism; -} - - -/* ********************************************** - Begin prism-markup.js -********************************************** */ - -Prism.languages.markup = { - 'comment': //, - 'prolog': /<\?[\s\S]+?\?>/, - 'doctype': //i, - 'cdata': //i, - 'tag': { - pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i, - greedy: true, - inside: { - 'tag': { - pattern: /^<\/?[^\s>\/]+/i, - inside: { - 'punctuation': /^<\/?/, - 'namespace': /^[^\s>\/:]+:/ - } - }, - 'attr-value': { - pattern: /=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i, - inside: { - 'punctuation': [ - /^=/, - { - pattern: /(^|[^\\])["']/, - lookbehind: true - } - ] - } - }, - 'punctuation': /\/?>/, - 'attr-name': { - pattern: /[^\s>\/]+/, - inside: { - 'namespace': /^[^\s>\/:]+:/ - } - } - - } - }, - 'entity': /&#?[\da-z]{1,8};/i -}; - -Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] = - Prism.languages.markup['entity']; - -// Plugin to make entity title show the real entity, idea by Roman Komarov -Prism.hooks.add('wrap', function(env) { - - if (env.type === 'entity') { - env.attributes['title'] = env.content.replace(/&/, '&'); - } -}); - -Prism.languages.xml = Prism.languages.markup; -Prism.languages.html = Prism.languages.markup; -Prism.languages.mathml = Prism.languages.markup; -Prism.languages.svg = Prism.languages.markup; - - -/* ********************************************** - Begin prism-css.js -********************************************** */ - -Prism.languages.css = { - 'comment': /\/\*[\s\S]*?\*\//, - 'atrule': { - pattern: /@[\w-]+?.*?(?:;|(?=\s*\{))/i, - inside: { - 'rule': /@[\w-]+/ - // See rest below - } - }, - 'url': /url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i, - 'selector': /[^{}\s][^{};]*?(?=\s*\{)/, - 'string': { - pattern: /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, - greedy: true - }, - 'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i, - 'important': /\B!important\b/i, - 'function': /[-a-z0-9]+(?=\()/i, - 'punctuation': /[(){};:]/ -}; - -Prism.languages.css['atrule'].inside.rest = Prism.languages.css; - -if (Prism.languages.markup) { - Prism.languages.insertBefore('markup', 'tag', { - 'style': { - pattern: /()[\s\S]*?(?=<\/style>)/i, - lookbehind: true, - inside: Prism.languages.css, - alias: 'language-css', - greedy: true - } - }); - - Prism.languages.insertBefore('inside', 'attr-value', { - 'style-attr': { - pattern: /\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i, - inside: { - 'attr-name': { - pattern: /^\s*style/i, - inside: Prism.languages.markup.tag.inside - }, - 'punctuation': /^\s*=\s*['"]|['"]\s*$/, - 'attr-value': { - pattern: /.+/i, - inside: Prism.languages.css - } - }, - alias: 'language-css' - } - }, Prism.languages.markup.tag); -} - -/* ********************************************** - Begin prism-clike.js -********************************************** */ - -Prism.languages.clike = { - 'comment': [ - { - pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, - lookbehind: true - }, - { - pattern: /(^|[^\\:])\/\/.*/, - lookbehind: true, - greedy: true - } - ], - 'string': { - pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, - greedy: true - }, - 'class-name': { - pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i, - lookbehind: true, - inside: { - punctuation: /[.\\]/ - } - }, - 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/, - 'boolean': /\b(?:true|false)\b/, - 'function': /[a-z0-9_]+(?=\()/i, - 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i, - 'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/, - 'punctuation': /[{}[\];(),.:]/ -}; - - -/* ********************************************** - Begin prism-javascript.js -********************************************** */ - -Prism.languages.javascript = Prism.languages.extend('clike', { - 'keyword': /\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/, - 'number': /\b(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/, - // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444) - 'function': /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/i, - 'operator': /-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/ -}); - -Prism.languages.insertBefore('javascript', 'keyword', { - 'regex': { - pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[[^\]\r\n]+]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})\]]))/, - lookbehind: true, - greedy: true - }, - // This must be declared before keyword because we use "function" inside the look-forward - 'function-variable': { - pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=\s*(?:function\b|(?:\([^()]*\)|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i, - alias: 'function' - }, - 'constant': /\b[A-Z][A-Z\d_]*\b/ -}); - -Prism.languages.insertBefore('javascript', 'string', { - 'template-string': { - pattern: /`(?:\\[\s\S]|\${[^}]+}|[^\\`])*`/, - greedy: true, - inside: { - 'interpolation': { - pattern: /\${[^}]+}/, - inside: { - 'interpolation-punctuation': { - pattern: /^\${|}$/, - alias: 'punctuation' - }, - rest: null // See below - } - }, - 'string': /[\s\S]+/ - } - } -}); -Prism.languages.javascript['template-string'].inside['interpolation'].inside.rest = Prism.languages.javascript; - -if (Prism.languages.markup) { - Prism.languages.insertBefore('markup', 'tag', { - 'script': { - pattern: /()[\s\S]*?(?=<\/script>)/i, - lookbehind: true, - inside: Prism.languages.javascript, - alias: 'language-javascript', - greedy: true - } - }); -} - -Prism.languages.js = Prism.languages.javascript; - - -/* ********************************************** - Begin prism-file-highlight.js -********************************************** */ - -(function () { - if (typeof self === 'undefined' || !self.Prism || !self.document || !document.querySelector) { - return; - } - - self.Prism.fileHighlight = function() { - - var Extensions = { - 'js': 'javascript', - 'py': 'python', - 'rb': 'ruby', - 'ps1': 'powershell', - 'psm1': 'powershell', - 'sh': 'bash', - 'bat': 'batch', - 'h': 'c', - 'tex': 'latex' - }; - - Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach(function (pre) { - var src = pre.getAttribute('data-src'); - - var language, parent = pre; - var lang = /\blang(?:uage)?-([\w-]+)\b/i; - while (parent && !lang.test(parent.className)) { - parent = parent.parentNode; - } - - if (parent) { - language = (pre.className.match(lang) || [, ''])[1]; - } - - if (!language) { - var extension = (src.match(/\.(\w+)$/) || [, ''])[1]; - language = Extensions[extension] || extension; - } - - var code = document.createElement('code'); - code.className = 'language-' + language; - - pre.textContent = ''; - - code.textContent = 'Loading…'; - - pre.appendChild(code); - - var xhr = new XMLHttpRequest(); - - xhr.open('GET', src, true); - - xhr.onreadystatechange = function () { - if (xhr.readyState == 4) { - - if (xhr.status < 400 && xhr.responseText) { - code.textContent = xhr.responseText; - - Prism.highlightElement(code); - } - else if (xhr.status >= 400) { - code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText; - } - else { - code.textContent = '✖ Error: File does not exist or is empty'; - } - } - }; - - xhr.send(null); - }); - - if (Prism.plugins.toolbar) { - Prism.plugins.toolbar.registerButton('download-file', function (env) { - var pre = env.element.parentNode; - if (!pre || !/pre/i.test(pre.nodeName) || !pre.hasAttribute('data-src') || !pre.hasAttribute('data-download-link')) { - return; - } - var src = pre.getAttribute('data-src'); - var a = document.createElement('a'); - a.textContent = pre.getAttribute('data-download-link-label') || 'Download'; - a.setAttribute('download', ''); - a.href = src; - return a; - }); - } - - }; - - document.addEventListener('DOMContentLoaded', self.Prism.fileHighlight); - -})(); -}); - -/** - * Gen toc tree - * @link https://github.com/killercup/grock/blob/5280ae63e16c5739e9233d9009bc235ed7d79a50/styles/solarized/assets/js/behavior.coffee#L54-L81 - * @param {Array} toc - * @param {Number} maxLevel - * @return {Array} - */ -function genTree(toc, maxLevel) { - var headlines = []; - var last = {}; - - toc.forEach(function (headline) { - var level = headline.level || 1; - var len = level - 1; - - if (level > maxLevel) { - return - } - if (last[len]) { - last[len].children = (last[len].children || []).concat(headline); - } else { - headlines.push(headline); - } - last[level] = headline; - }); - - return headlines -} - -var cache$1 = {}; -var re = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g; - -function lower(string) { - return string.toLowerCase() -} - -function slugify(str) { - if (typeof str !== 'string') { - return '' - } - - var slug = str - .trim() - .replace(/[A-Z]+/g, lower) - .replace(/<[^>\d]+>/g, '') - .replace(re, '') - .replace(/\s/g, '-') - .replace(/-+/g, '-') - .replace(/^(\d)/, '_$1'); - var count = cache$1[slug]; - - count = hasOwn.call(cache$1, slug) ? count + 1 : 0; - cache$1[slug] = count; - - if (count) { - slug = slug + '-' + count; - } - - return slug -} - -slugify.clear = function () { - cache$1 = {}; -}; - -function replace(m, $1) { - return '' + $1 + '' -} - -function emojify(text) { - return text - .replace(/<(pre|template|code)[^>]*?>[\s\S]+?<\/(pre|template|code)>/g, function (m) { return m.replace(/:/g, '__colon__'); }) - .replace(/:(\w+?):/ig, (inBrowser && window.emojify) || replace) - .replace(/__colon__/g, ':') -} - -var decode = decodeURIComponent; -var encode = encodeURIComponent; - -function parseQuery(query) { - var res = {}; - - query = query.trim().replace(/^(\?|#|&)/, ''); - - if (!query) { - return res - } - - // Simple parse - query.split('&').forEach(function (param) { - var parts = param.replace(/\+/g, ' ').split('='); - - res[parts[0]] = parts[1] && decode(parts[1]); - }); - - return res -} - -function stringifyQuery(obj, ignores) { - if ( ignores === void 0 ) ignores = []; - - var qs = []; - - for (var key in obj) { - if (ignores.indexOf(key) > -1) { - continue - } - qs.push( - obj[key] ? - ((encode(key)) + "=" + (encode(obj[key]))).toLowerCase() : - encode(key) - ); - } - - return qs.length ? ("?" + (qs.join('&'))) : '' -} - -var isAbsolutePath = cached(function (path) { - return /(:|(\/{2}))/g.test(path) -}); - -var getParentPath = cached(function (path) { - return /\/$/g.test(path) ? - path : - (path = path.match(/(\S*\/)[^/]+$/)) ? path[1] : '' -}); - -var cleanPath = cached(function (path) { - return path.replace(/^\/+/, '/').replace(/([^:])\/{2,}/g, '$1/') -}); - -var resolvePath = cached(function (path) { - var segments = path.replace(/^\//, '').split('/'); - var resolved = []; - for (var i = 0, len = segments.length; i < len; i++) { - var segment = segments[i]; - if (segment === '..') { - resolved.pop(); - } else if (segment !== '.') { - resolved.push(segment); - } - } - return '/' + resolved.join('/') -}); - -function getPath() { - var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; - - return cleanPath(args.join('/')) -} - -var replaceSlug = cached(function (path) { - return path.replace('#', '?id=') -}); - -Prism.languages['markup-templating'] = {}; - -Object.defineProperties(Prism.languages['markup-templating'], { - buildPlaceholders: { - // Tokenize all inline templating expressions matching placeholderPattern - // If the replaceFilter function is provided, it will be called with every match. - // If it returns false, the match will not be replaced. - value: function (env, language, placeholderPattern, replaceFilter) { - if (env.language !== language) { - return; - } - - env.tokenStack = []; - - env.code = env.code.replace(placeholderPattern, function(match) { - if (typeof replaceFilter === 'function' && !replaceFilter(match)) { - return match; - } - var i = env.tokenStack.length; - // Check for existing strings - while (env.code.indexOf('___' + language.toUpperCase() + i + '___') !== -1) - { ++i; } - - // Create a sparse array - env.tokenStack[i] = match; - - return '___' + language.toUpperCase() + i + '___'; - }); - - // Switch the grammar to markup - env.grammar = Prism.languages.markup; - } - }, - tokenizePlaceholders: { - // Replace placeholders with proper tokens after tokenizing - value: function (env, language) { - if (env.language !== language || !env.tokenStack) { - return; - } - - // Switch the grammar back - env.grammar = Prism.languages[language]; - - var j = 0; - var keys = Object.keys(env.tokenStack); - var walkTokens = function (tokens) { - if (j >= keys.length) { - return; - } - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (typeof token === 'string' || (token.content && typeof token.content === 'string')) { - var k = keys[j]; - var t = env.tokenStack[k]; - var s = typeof token === 'string' ? token : token.content; - - var index = s.indexOf('___' + language.toUpperCase() + k + '___'); - if (index > -1) { - ++j; - var before = s.substring(0, index); - var middle = new Prism.Token(language, Prism.tokenize(t, env.grammar, language), 'language-' + language, t); - var after = s.substring(index + ('___' + language.toUpperCase() + k + '___').length); - var replacement; - if (before || after) { - replacement = [before, middle, after].filter(function (v) { return !!v; }); - walkTokens(replacement); - } else { - replacement = middle; - } - if (typeof token === 'string') { - Array.prototype.splice.apply(tokens, [i, 1].concat(replacement)); - } else { - token.content = replacement; - } - - if (j >= keys.length) { - break; - } - } - } else if (token.content && typeof token.content !== 'string') { - walkTokens(token.content); - } - } - }; - - walkTokens(env.tokens); - } - } -}); - -// See https://github.com/PrismJS/prism/pull/1367 -var cachedLinks = {}; - -function getAndRemoveConfig(str) { - if ( str === void 0 ) str = ''; - - var config = {}; - - if (str) { - str = str - .replace(/^'/, '') - .replace(/'$/, '') - .replace(/(?:^|\s):([\w-]+)=?([\w-]+)?/g, function (m, key, value) { - config[key] = (value && value.replace(/"/g, '')) || true; - return '' - }) - .trim(); - } - - return {str: str, config: config} -} - -var compileMedia = { - markdown: function markdown(url) { - return { - url: url - } - }, - mermaid: function mermaid(url) { - return { - url: url - } - }, - iframe: function iframe(url, title) { - return { - html: ("") - } - }, - video: function video(url, title) { - return { - html: ("") - } - }, - audio: function audio(url, title) { - return { - html: ("") - } - }, - code: function code(url, title) { - var lang = url.match(/\.(\w+)$/); - - lang = title || (lang && lang[1]); - if (lang === 'md') { - lang = 'markdown'; - } - - return { - url: url, - lang: lang - } - } -}; - -var Compiler = function Compiler(config, router) { - var this$1 = this; - - this.config = config; - this.router = router; - this.cacheTree = {}; - this.toc = []; - this.cacheTOC = {}; - this.linkTarget = config.externalLinkTarget || '_blank'; - this.contentBase = router.getBasePath(); - - var renderer = this._initRenderer(); - var compile; - var mdConf = config.markdown || {}; - - if (isFn(mdConf)) { - compile = mdConf(marked, renderer); - } else { - marked.setOptions( - merge(mdConf, { - renderer: merge(renderer, mdConf.renderer) - }) - ); - compile = marked; - } - - this._marked = compile; - this.compile = function (text) { - var isCached = true; - var result = cached(function (_) { - isCached = false; - var html = ''; - - if (!text) { - return text - } - - if (isPrimitive(text)) { - html = compile(text); - } else { - html = compile.parser(text); - } - - html = config.noEmoji ? html : emojify(html); - slugify.clear(); - - return html - })(text); - - var curFileName = this$1.router.parse().file; - - if (isCached) { - this$1.toc = this$1.cacheTOC[curFileName]; - } else { - this$1.cacheTOC[curFileName] = [].concat( this$1.toc ); - } - - return result - }; -}; - -Compiler.prototype.compileEmbed = function compileEmbed (href, title) { - var ref = getAndRemoveConfig(title); - var str = ref.str; - var config = ref.config; - var embed; - title = str; - - if (config.include) { - if (!isAbsolutePath(href)) { - href = getPath( - this.contentBase, - getParentPath(this.router.getCurrentPath()), - href - ); - } - - var media; - if (config.type && (media = compileMedia[config.type])) { - embed = media.call(this, href, title); - embed.type = config.type; - } else { - var type = 'code'; - if (/\.(md|markdown)/.test(href)) { - type = 'markdown'; - } else if (/\.mmd/.test(href)) { - type = 'mermaid'; - } else if (/\.html?/.test(href)) { - type = 'iframe'; - } else if (/\.(mp4|ogg)/.test(href)) { - type = 'video'; - } else if (/\.mp3/.test(href)) { - type = 'audio'; - } - embed = compileMedia[type].call(this, href, title); - embed.type = type; - } - embed.fragment = config.fragment; - - return embed - } -}; - -Compiler.prototype._matchNotCompileLink = function _matchNotCompileLink (link) { - var links = this.config.noCompileLinks || []; - - for (var i = 0; i < links.length; i++) { - var n = links[i]; - var re = cachedLinks[n] || (cachedLinks[n] = new RegExp(("^" + n + "$"))); - - if (re.test(link)) { - return link - } - } -}; - -Compiler.prototype._initRenderer = function _initRenderer () { - var renderer = new marked.Renderer(); - var ref = this; - var linkTarget = ref.linkTarget; - var router = ref.router; - var contentBase = ref.contentBase; - var _self = this; - var origin = {}; - - /** - * Render anchor tag - * @link https://github.com/markedjs/marked#overriding-renderer-methods - */ - origin.heading = renderer.heading = function (text, level) { - var ref = getAndRemoveConfig(text); - var str = ref.str; - var config = ref.config; - var nextToc = {level: level, title: str}; - - if (/{docsify-ignore}/g.test(str)) { - str = str.replace('{docsify-ignore}', ''); - nextToc.title = str; - nextToc.ignoreSubHeading = true; - } - - if (/{docsify-ignore-all}/g.test(str)) { - str = str.replace('{docsify-ignore-all}', ''); - nextToc.title = str; - nextToc.ignoreAllSubs = true; - } - - var slug = slugify(config.id || str); - var url = router.toURL(router.getCurrentPath(), {id: slug}); - nextToc.slug = url; - _self.toc.push(nextToc); - - return ("
    " + str + "") - }; - // Highlight code - origin.code = renderer.code = function (code, lang) { - if ( lang === void 0 ) lang = ''; - - code = code.replace(/@DOCSIFY_QM@/g, '`'); - var hl = prism.highlight( - code, - prism.languages[lang] || prism.languages.markup - ); - - return ("
    " + hl + "
    ") - }; - origin.link = renderer.link = function (href, title, text) { - if ( title === void 0 ) title = ''; - - var attrs = ''; - - var ref = getAndRemoveConfig(title); - var str = ref.str; - var config = ref.config; - title = str; - - if ( - !isAbsolutePath(href) && - !_self._matchNotCompileLink(href) && - !config.ignore - ) { - if (href === _self.config.homepage) { - href = 'README'; - } - href = router.toURL(href, null, router.getCurrentPath()); - } else { - attrs += href.indexOf('mailto:') === 0 ? '' : (" target=\"" + linkTarget + "\""); - } - - if (config.target) { - attrs += ' target=' + config.target; - } - - if (config.disabled) { - attrs += ' disabled'; - href = 'javascript:void(0)'; - } - - if (title) { - attrs += " title=\"" + title + "\""; - } - - return ("" + text + "") - }; - origin.paragraph = renderer.paragraph = function (text) { - var result; - if (/^!>/.test(text)) { - result = helper('tip', text); - } else if (/^\?>/.test(text)) { - result = helper('warn', text); - } else { - result = "

    " + text + "

    "; - } - return result - }; - origin.image = renderer.image = function (href, title, text) { - var url = href; - var attrs = ''; - - var ref = getAndRemoveConfig(title); - var str = ref.str; - var config = ref.config; - title = str; - - if (config['no-zoom']) { - attrs += ' data-no-zoom'; - } - - if (title) { - attrs += " title=\"" + title + "\""; - } - - var size = config.size; - if (size) { - var sizes = size.split('x'); - if (sizes[1]) { - attrs += 'width=' + sizes[0] + ' height=' + sizes[1]; - } else { - attrs += 'width=' + sizes[0]; - } - } - - if (!isAbsolutePath(href)) { - url = getPath(contentBase, getParentPath(router.getCurrentPath()), href); - } - - return ("\""") - }; - origin.list = renderer.list = function (body, ordered, start) { - var isTaskList = /
  • /.test(body.split('class="task-list"')[0]); - var isStartReq = start && start > 1; - var tag = ordered ? 'ol' : 'ul'; - var tagAttrs = [ - (isTaskList ? 'class="task-list"' : ''), - (isStartReq ? ("start=\"" + start + "\"") : '') - ].join(' ').trim(); - - return ("<" + tag + " " + tagAttrs + ">" + body + "") - }; - origin.listitem = renderer.listitem = function (text) { - var isTaskItem = /^(]*>)/.test(text); - var html = isTaskItem ? ("
  • ") : ("
  • " + text + "
  • "); - - return html - }; - - renderer.origin = origin; - - return renderer -}; - -/** - * Compile sidebar - */ -Compiler.prototype.sidebar = function sidebar (text, level) { - var currentPath = this.router.getCurrentPath(); - var html = ''; - - if (text) { - html = this.compile(text); - } else { - var tree$$1 = this.cacheTree[currentPath] || genTree(this.toc, level); - html = tree(tree$$1, '
      {inner}
    '); - this.cacheTree[currentPath] = tree$$1; - } - - return html -}; - -/** - * Compile sub sidebar - */ -Compiler.prototype.subSidebar = function subSidebar (level) { - if (!level) { - this.toc = []; - return - } - var currentPath = this.router.getCurrentPath(); - var ref = this; - var cacheTree = ref.cacheTree; - var toc = ref.toc; - - toc[0] && toc[0].ignoreAllSubs && toc.splice(0); - toc[0] && toc[0].level === 1 && toc.shift(); - - for (var i = 0; i < toc.length; i++) { - toc[i].ignoreSubHeading && toc.splice(i, 1) && i--; - } - - var tree$$1 = cacheTree[currentPath] || genTree(toc, level); - - cacheTree[currentPath] = tree$$1; - this.toc = []; - return tree(tree$$1) -}; - -Compiler.prototype.article = function article (text) { - return this.compile(text) -}; - -/** - * Compile cover page - */ -Compiler.prototype.cover = function cover$$1 (text) { - var cacheToc = this.toc.slice(); - var html = this.compile(text); - - this.toc = cacheToc.slice(); - - return html -}; - -var title = $.title; -/** - * Toggle button - */ -function btn(el) { - var toggle = function (_) { return body.classList.toggle('close'); }; - - el = getNode(el); - if (el == null) { - return - } - on(el, 'click', function (e) { - e.stopPropagation(); - toggle(); - }); - - isMobile && - on( - body, - 'click', - function (_) { return body.classList.contains('close') && toggle(); } - ); -} - -function collapse(el) { - el = getNode(el); - if (el == null) { - return - } - on(el, 'click', function (ref) { - var target = ref.target; - - if ( - target.nodeName === 'A' && - target.nextSibling && - target.nextSibling.classList.contains('app-sub-sidebar') - ) { - toggleClass(target.parentNode, 'collapse'); - } - }); -} - -function sticky() { - var cover = getNode('section.cover'); - if (!cover) { - return - } - var coverHeight = cover.getBoundingClientRect().height; - - if (window.pageYOffset >= coverHeight || cover.classList.contains('hidden')) { - toggleClass(body, 'add', 'sticky'); - } else { - toggleClass(body, 'remove', 'sticky'); - } -} - -/** - * Get and active link - * @param {object} router - * @param {string|element} el - * @param {Boolean} isParent acitve parent - * @param {Boolean} autoTitle auto set title - * @return {element} - */ -function getAndActive(router, el, isParent, autoTitle) { - el = getNode(el); - var links = []; - if (el != null) { - links = findAll(el, 'a'); - } - var hash = decodeURI(router.toURL(router.getCurrentPath())); - var target; - - links.sort(function (a, b) { return b.href.length - a.href.length; }).forEach(function (a) { - var href = a.getAttribute('href'); - var node = isParent ? a.parentNode : a; - - if (hash.indexOf(href) === 0 && !target) { - target = a; - toggleClass(node, 'add', 'active'); - } else { - toggleClass(node, 'remove', 'active'); - } - }); - - if (autoTitle) { - $.title = target ? (target.title || ((target.innerText) + " - " + title)) : title; - } - - return target -} - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) { descriptor.writable = true; } Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) { defineProperties(Constructor.prototype, protoProps); } if (staticProps) { defineProperties(Constructor, staticProps); } return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Tweezer = function () { - function Tweezer() { - var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; - - _classCallCheck(this, Tweezer); - - this.duration = opts.duration || 1000; - this.ease = opts.easing || this._defaultEase; - this.start = opts.start; - this.end = opts.end; - - this.frame = null; - this.next = null; - this.isRunning = false; - this.events = {}; - this.direction = this.start < this.end ? 'up' : 'down'; - } - - _createClass(Tweezer, [{ - key: 'begin', - value: function begin() { - if (!this.isRunning && this.next !== this.end) { - this.frame = window.requestAnimationFrame(this._tick.bind(this)); - } - return this; - } - }, { - key: 'stop', - value: function stop() { - window.cancelAnimationFrame(this.frame); - this.isRunning = false; - this.frame = null; - this.timeStart = null; - this.next = null; - return this; - } - }, { - key: 'on', - value: function on(name, handler) { - this.events[name] = this.events[name] || []; - this.events[name].push(handler); - return this; - } - }, { - key: 'emit', - value: function emit(name, val) { - var _this = this; - - var e = this.events[name]; - e && e.forEach(function (handler) { - return handler.call(_this, val); - }); - } - }, { - key: '_tick', - value: function _tick(currentTime) { - this.isRunning = true; - - var lastTick = this.next || this.start; - - if (!this.timeStart) { this.timeStart = currentTime; } - this.timeElapsed = currentTime - this.timeStart; - this.next = Math.round(this.ease(this.timeElapsed, this.start, this.end - this.start, this.duration)); - - if (this._shouldTick(lastTick)) { - this.emit('tick', this.next); - this.frame = window.requestAnimationFrame(this._tick.bind(this)); - } else { - this.emit('tick', this.end); - this.emit('done', null); - } - } - }, { - key: '_shouldTick', - value: function _shouldTick(lastTick) { - return { - up: this.next < this.end && lastTick <= this.next, - down: this.next > this.end && lastTick >= this.next - }[this.direction]; - } - }, { - key: '_defaultEase', - value: function _defaultEase(t, b, c, d) { - if ((t /= d / 2) < 1) { return c / 2 * t * t + b; } - return -c / 2 * (--t * (t - 2) - 1) + b; - } - }]); - - return Tweezer; -}(); - -var nav = {}; -var hoverOver = false; -var scroller = null; -var enableScrollEvent = true; -var coverHeight = 0; - -function scrollTo(el) { - if (scroller) { - scroller.stop(); - } - enableScrollEvent = false; - scroller = new Tweezer({ - start: window.pageYOffset, - end: el.getBoundingClientRect().top + window.pageYOffset, - duration: 500 - }) - .on('tick', function (v) { return window.scrollTo(0, v); }) - .on('done', function () { - enableScrollEvent = true; - scroller = null; - }) - .begin(); -} - -function highlight(path) { - if (!enableScrollEvent) { - return - } - var sidebar = getNode('.sidebar'); - var anchors = findAll('.anchor'); - var wrap = find(sidebar, '.sidebar-nav'); - var active = find(sidebar, 'li.active'); - var doc = document.documentElement; - var top = ((doc && doc.scrollTop) || document.body.scrollTop) - coverHeight; - var last; - - for (var i = 0, len = anchors.length; i < len; i += 1) { - var node = anchors[i]; - - if (node.offsetTop > top) { - if (!last) { - last = node; - } - break - } else { - last = node; - } - } - if (!last) { - return - } - var li = nav[getNavKey(decodeURIComponent(path), last.getAttribute('data-id'))]; - - if (!li || li === active) { - return - } - - active && active.classList.remove('active'); - li.classList.add('active'); - active = li; - - // Scroll into view - // https://github.com/vuejs/vuejs.org/blob/master/themes/vue/source/js/common.js#L282-L297 - if (!hoverOver && body.classList.contains('sticky')) { - var height = sidebar.clientHeight; - var curOffset = 0; - var cur = active.offsetTop + active.clientHeight + 40; - var isInView = - active.offsetTop >= wrap.scrollTop && cur <= wrap.scrollTop + height; - var notThan = cur - curOffset < height; - var top$1 = isInView ? wrap.scrollTop : notThan ? curOffset : cur - height; - - sidebar.scrollTop = top$1; - } -} - -function getNavKey(path, id) { - return (path + "?id=" + id) -} - -function scrollActiveSidebar(router) { - var cover = find('.cover.show'); - coverHeight = cover ? cover.offsetHeight : 0; - - var sidebar = getNode('.sidebar'); - var lis = []; - if (sidebar != null) { - lis = findAll(sidebar, 'li'); - } - - for (var i = 0, len = lis.length; i < len; i += 1) { - var li = lis[i]; - var a = li.querySelector('a'); - if (!a) { - continue - } - var href = a.getAttribute('href'); - - if (href !== '/') { - var ref = router.parse(href); - var id = ref.query.id; - var path$1 = ref.path; - if (id) { - href = getNavKey(path$1, id); - } - } - - if (href) { - nav[decodeURIComponent(href)] = li; - } - } - - if (isMobile) { - return - } - var path = router.getCurrentPath(); - off('scroll', function () { return highlight(path); }); - on('scroll', function () { return highlight(path); }); - on(sidebar, 'mouseover', function () { - hoverOver = true; - }); - on(sidebar, 'mouseleave', function () { - hoverOver = false; - }); -} - -function scrollIntoView(path, id) { - if (!id) { - return - } - - var section = find('#' + id); - section && scrollTo(section); - - var li = nav[getNavKey(path, id)]; - var sidebar = getNode('.sidebar'); - var active = find(sidebar, 'li.active'); - active && active.classList.remove('active'); - li && li.classList.add('active'); -} - -var scrollEl = $.scrollingElement || $.documentElement; - -function scroll2Top(offset) { - if ( offset === void 0 ) offset = 0; - - scrollEl.scrollTop = offset === true ? 0 : Number(offset); -} - -var cached$1 = {}; - -function walkFetchEmbed(ref, cb) { - var embedTokens = ref.embedTokens; - var compile = ref.compile; - var fetch = ref.fetch; - - var token; - var step = 0; - var count = 1; - - if (!embedTokens.length) { - return cb({}) - } - - while ((token = embedTokens[step++])) { - var next = (function (token) { - return function (text) { - var embedToken; - if (text) { - if (token.embed.type === 'markdown') { - embedToken = compile.lexer(text); - } else if (token.embed.type === 'code') { - if (token.embed.fragment) { - var fragment = token.embed.fragment; - var pattern = new RegExp(("(?:###|\\/\\/\\/)\\s*\\[" + fragment + "\\]([\\s\\S]*)(?:###|\\/\\/\\/)\\s*\\[" + fragment + "\\]")); - text = ((text.match(pattern) || [])[1] || '').trim(); - } - embedToken = compile.lexer( - '```' + - token.embed.lang + - '\n' + - text.replace(/`/g, '@DOCSIFY_QM@') + - '\n```\n' - ); - } else if (token.embed.type === 'mermaid') { - embedToken = [ - {type: 'html', text: ("
    \n" + text + "\n
    ")} - ]; - embedToken.links = {}; - } else { - embedToken = [{type: 'html', text: text}]; - embedToken.links = {}; - } - } - cb({token: token, embedToken: embedToken}); - if (++count >= step) { - cb({}); - } - } - })(token); - - if (token.embed.url) { - { - get(token.embed.url).then(next); - } - } else { - next(token.embed.html); - } - } -} - -function prerenderEmbed(ref, done) { - var compiler = ref.compiler; - var raw = ref.raw; if ( raw === void 0 ) raw = ''; - var fetch = ref.fetch; - - var hit = cached$1[raw]; - if (hit) { - var copy = hit.slice(); - copy.links = hit.links; - return done(copy) - } - - var compile = compiler._marked; - var tokens = compile.lexer(raw); - var embedTokens = []; - var linkRE = compile.InlineLexer.rules.link; - var links = tokens.links; - - tokens.forEach(function (token, index) { - if (token.type === 'paragraph') { - token.text = token.text.replace( - new RegExp(linkRE.source, 'g'), - function (src, filename, href, title) { - var embed = compiler.compileEmbed(href, title); - - if (embed) { - embedTokens.push({ - index: index, - embed: embed - }); - } - - return src - } - ); - } - }); - - var moveIndex = 0; - walkFetchEmbed({compile: compile, embedTokens: embedTokens, fetch: fetch}, function (ref) { - var embedToken = ref.embedToken; - var token = ref.token; - - if (token) { - var index = token.index + moveIndex; - - merge(links, embedToken.links); - - tokens = tokens - .slice(0, index) - .concat(embedToken, tokens.slice(index + 1)); - moveIndex += embedToken.length - 1; - } else { - cached$1[raw] = tokens.concat(); - tokens.links = cached$1[raw].links = links; - done(tokens); - } - }); -} - -function executeScript() { - var script = findAll('.markdown-section>script') - .filter(function (s) { return !/template/.test(s.type); })[0]; - if (!script) { - return false - } - var code = script.innerText.trim(); - if (!code) { - return false - } - - setTimeout(function (_) { - window.__EXECUTE_RESULT__ = new Function(code)(); - }, 0); -} - -function formatUpdated(html, updated, fn) { - updated = - typeof fn === 'function' ? - fn(updated) : - typeof fn === 'string' ? - tinydate(fn)(new Date(updated)) : - updated; - - return html.replace(/{docsify-updated}/g, updated) -} - -function renderMain(html) { - if (!html) { - html = '

    404 - Not found

    '; - } - - this._renderTo('.markdown-section', html); - // Render sidebar with the TOC - !this.config.loadSidebar && this._renderSidebar(); - - // Execute script - if ( - this.config.executeScript !== false && - typeof window.Vue !== 'undefined' && - !executeScript() - ) { - setTimeout(function (_) { - var vueVM = window.__EXECUTE_RESULT__; - vueVM && vueVM.$destroy && vueVM.$destroy(); - window.__EXECUTE_RESULT__ = new window.Vue().$mount('#main'); - }, 0); - } else { - this.config.executeScript && executeScript(); - } -} - -function renderNameLink(vm) { - var el = getNode('.app-name-link'); - var nameLink = vm.config.nameLink; - var path = vm.route.path; - - if (!el) { - return - } - - if (isPrimitive(vm.config.nameLink)) { - el.setAttribute('href', nameLink); - } else if (typeof nameLink === 'object') { - var match = Object.keys(nameLink).filter(function (key) { return path.indexOf(key) > -1; })[0]; - - el.setAttribute('href', nameLink[match]); - } -} - -function renderMixin(proto) { - proto._renderTo = function (el, content, replace) { - var node = getNode(el); - if (node) { - node[replace ? 'outerHTML' : 'innerHTML'] = content; - } - }; - - proto._renderSidebar = function (text) { - var ref = this.config; - var maxLevel = ref.maxLevel; - var subMaxLevel = ref.subMaxLevel; - var loadSidebar = ref.loadSidebar; - - this._renderTo('.sidebar-nav', this.compiler.sidebar(text, maxLevel)); - var activeEl = getAndActive(this.router, '.sidebar-nav', true, true); - if (loadSidebar && activeEl) { - activeEl.parentNode.innerHTML += - this.compiler.subSidebar(subMaxLevel) || ''; - } else { - // Reset toc - this.compiler.subSidebar(); - } - // Bind event - this._bindEventOnRendered(activeEl); - }; - - proto._bindEventOnRendered = function (activeEl) { - var ref = this.config; - var autoHeader = ref.autoHeader; - var auto2top = ref.auto2top; - - scrollActiveSidebar(this.router); - - if (autoHeader && activeEl) { - var main$$1 = getNode('#main'); - var firstNode = main$$1.children[0]; - if (firstNode && firstNode.tagName !== 'H1') { - var h1 = create('h1'); - h1.innerText = activeEl.innerText; - before(main$$1, h1); - } - } - - auto2top && scroll2Top(auto2top); - }; - - proto._renderNav = function (text) { - text && this._renderTo('nav', this.compiler.compile(text)); - if (this.config.loadNavbar) { - getAndActive(this.router, 'nav'); - } - }; - - proto._renderMain = function (text, opt, next) { - var this$1 = this; - if ( opt === void 0 ) opt = {}; - - if (!text) { - return renderMain.call(this, text) - } - - callHook(this, 'beforeEach', text, function (result) { - var html; - var callback = function () { - if (opt.updatedAt) { - html = formatUpdated(html, opt.updatedAt, this$1.config.formatUpdated); - } - - callHook(this$1, 'afterEach', html, function (text) { return renderMain.call(this$1, text); }); - }; - if (this$1.isHTML) { - html = this$1.result = text; - callback(); - next(); - } else { - prerenderEmbed( - { - compiler: this$1.compiler, - raw: result - }, - function (tokens) { - html = this$1.compiler.compile(tokens); - callback(); - next(); - } - ); - } - }); - }; - - proto._renderCover = function (text, coverOnly) { - var el = getNode('.cover'); - - toggleClass(getNode('main'), coverOnly ? 'add' : 'remove', 'hidden'); - if (!text) { - toggleClass(el, 'remove', 'show'); - return - } - toggleClass(el, 'add', 'show'); - - var html = this.coverIsHTML ? text : this.compiler.cover(text); - - var m = html - .trim() - .match('

    ([^<]*?)

    $'); - - if (m) { - if (m[2] === 'color') { - el.style.background = m[1] + (m[3] || ''); - } else { - var path = m[1]; - - toggleClass(el, 'add', 'has-mask'); - if (!isAbsolutePath(m[1])) { - path = getPath(this.router.getBasePath(), m[1]); - } - el.style.backgroundImage = "url(" + path + ")"; - el.style.backgroundSize = 'cover'; - el.style.backgroundPosition = 'center center'; - } - html = html.replace(m[0], ''); - } - - this._renderTo('.cover-main', html); - sticky(); - }; - - proto._updateRender = function () { - // Render name link - renderNameLink(this); - }; -} - -function initRender(vm) { - var config = vm.config; - - // Init markdown compiler - vm.compiler = new Compiler(config, vm.router); - if (inBrowser) { - window.__current_docsify_compiler__ = vm.compiler; - } - - var id = config.el || '#app'; - var navEl = find('nav') || create('nav'); - - var el = find(id); - var html = ''; - var navAppendToTarget = body; - - if (el) { - if (config.repo) { - html += corner(config.repo); - } - if (config.coverpage) { - html += cover(); - } - - if (config.logo) { - var isBase64 = /^data:image/.test(config.logo); - var isExternal = /(?:http[s]?:)?\/\//.test(config.logo); - var isRelative = /^\./.test(config.logo); - - if (!isBase64 && !isExternal && !isRelative) { - config.logo = getPath(vm.router.getBasePath(), config.logo); - } - } - - html += main(config); - // Render main app - vm._renderTo(el, html, true); - } else { - vm.rendered = true; - } - - if (config.mergeNavbar && isMobile) { - navAppendToTarget = find('.sidebar'); - } else { - navEl.classList.add('app-nav'); - - if (!config.repo) { - navEl.classList.add('no-badge'); - } - } - - // Add nav - if (config.loadNavbar) { - before(navAppendToTarget, navEl); - } - - if (config.themeColor) { - $.head.appendChild( - create('div', theme(config.themeColor)).firstElementChild - ); - // Polyfll - cssVars(config.themeColor); - } - vm._updateRender(); - toggleClass(body, 'ready'); -} - -var cached$2 = {}; - -function getAlias(path, alias, last) { - var match = Object.keys(alias).filter(function (key) { - var re = cached$2[key] || (cached$2[key] = new RegExp(("^" + key + "$"))); - return re.test(path) && path !== last - })[0]; - - return match ? - getAlias(path.replace(cached$2[match], alias[match]), alias, path) : - path -} - -function getFileName(path, ext) { - return new RegExp(("\\.(" + (ext.replace(/^\./, '')) + "|html)$"), 'g').test(path) ? - path : - /\/$/g.test(path) ? (path + "README" + ext) : ("" + path + ext) -} - -var History = function History(config) { - this.config = config; -}; - -History.prototype.getBasePath = function getBasePath () { - return this.config.basePath -}; - -History.prototype.getFile = function getFile (path, isRelative) { - if ( path === void 0 ) path = this.getCurrentPath(); - - var ref = this; - var config = ref.config; - var base = this.getBasePath(); - var ext = typeof config.ext === 'string' ? config.ext : '.md'; - - path = config.alias ? getAlias(path, config.alias) : path; - path = getFileName(path, ext); - path = path === ("/README" + ext) ? config.homepage || path : path; - path = isAbsolutePath(path) ? path : getPath(base, path); - - if (isRelative) { - path = path.replace(new RegExp(("^" + base)), ''); - } - - return path -}; - -History.prototype.onchange = function onchange (cb) { - if ( cb === void 0 ) cb = noop; - - cb(); -}; - -History.prototype.getCurrentPath = function getCurrentPath () {}; - -History.prototype.normalize = function normalize () {}; - -History.prototype.parse = function parse () {}; - -History.prototype.toURL = function toURL (path, params, currentRoute) { - var local = currentRoute && path[0] === '#'; - var route = this.parse(replaceSlug(path)); - - route.query = merge({}, route.query, params); - path = route.path + stringifyQuery(route.query); - path = path.replace(/\.md(\?)|\.md$/, '$1'); - - if (local) { - var idIndex = currentRoute.indexOf('?'); - path = - (idIndex > 0 ? currentRoute.substring(0, idIndex) : currentRoute) + path; - } - - if (this.config.relativePath && path.indexOf('/') !== 0) { - var currentDir = currentRoute.substring(0, currentRoute.lastIndexOf('/') + 1); - return cleanPath(resolvePath(currentDir + path)) - } - return cleanPath('/' + path) -}; - -function replaceHash(path) { - var i = location.href.indexOf('#'); - location.replace(location.href.slice(0, i >= 0 ? i : 0) + '#' + path); -} - -var HashHistory = (function (History$$1) { - function HashHistory(config) { - History$$1.call(this, config); - this.mode = 'hash'; - } - - if ( History$$1 ) HashHistory.__proto__ = History$$1; - HashHistory.prototype = Object.create( History$$1 && History$$1.prototype ); - HashHistory.prototype.constructor = HashHistory; - - HashHistory.prototype.getBasePath = function getBasePath () { - var path = window.location.pathname || ''; - var base = this.config.basePath; - - return /^(\/|https?:)/g.test(base) ? base : cleanPath(path + '/' + base) - }; - - HashHistory.prototype.getCurrentPath = function getCurrentPath () { - // We can't use location.hash here because it's not - // consistent across browsers - Firefox will pre-decode it! - var href = location.href; - var index = href.indexOf('#'); - return index === -1 ? '' : href.slice(index + 1) - }; - - HashHistory.prototype.onchange = function onchange (cb) { - if ( cb === void 0 ) cb = noop; - - on('hashchange', cb); - }; - - HashHistory.prototype.normalize = function normalize () { - var path = this.getCurrentPath(); - - path = replaceSlug(path); - - if (path.charAt(0) === '/') { - return replaceHash(path) - } - replaceHash('/' + path); - }; - - /** - * Parse the url - * @param {string} [path=location.herf] - * @return {object} { path, query } - */ - HashHistory.prototype.parse = function parse (path) { - if ( path === void 0 ) path = location.href; - - var query = ''; - - var hashIndex = path.indexOf('#'); - if (hashIndex >= 0) { - path = path.slice(hashIndex + 1); - } - - var queryIndex = path.indexOf('?'); - if (queryIndex >= 0) { - query = path.slice(queryIndex + 1); - path = path.slice(0, queryIndex); - } - - return { - path: path, - file: this.getFile(path, true), - query: parseQuery(query) - } - }; - - HashHistory.prototype.toURL = function toURL (path, params, currentRoute) { - return '#' + History$$1.prototype.toURL.call(this, path, params, currentRoute) - }; - - return HashHistory; -}(History)); - -var HTML5History = (function (History$$1) { - function HTML5History(config) { - History$$1.call(this, config); - this.mode = 'history'; - } - - if ( History$$1 ) HTML5History.__proto__ = History$$1; - HTML5History.prototype = Object.create( History$$1 && History$$1.prototype ); - HTML5History.prototype.constructor = HTML5History; - - HTML5History.prototype.getCurrentPath = function getCurrentPath () { - var base = this.getBasePath(); - var path = window.location.pathname; - - if (base && path.indexOf(base) === 0) { - path = path.slice(base.length); - } - - return (path || '/') + window.location.search + window.location.hash - }; - - HTML5History.prototype.onchange = function onchange (cb) { - if ( cb === void 0 ) cb = noop; - - on('click', function (e) { - var el = e.target.tagName === 'A' ? e.target : e.target.parentNode; - - if (el.tagName === 'A' && !/_blank/.test(el.target)) { - e.preventDefault(); - var url = el.href; - window.history.pushState({key: url}, '', url); - cb(); - } - }); - - on('popstate', cb); - }; - - /** - * Parse the url - * @param {string} [path=location.href] - * @return {object} { path, query } - */ - HTML5History.prototype.parse = function parse (path) { - if ( path === void 0 ) path = location.href; - - var query = ''; - - var queryIndex = path.indexOf('?'); - if (queryIndex >= 0) { - query = path.slice(queryIndex + 1); - path = path.slice(0, queryIndex); - } - - var base = getPath(location.origin); - var baseIndex = path.indexOf(base); - - if (baseIndex > -1) { - path = path.slice(baseIndex + base.length); - } - - return { - path: path, - file: this.getFile(path), - query: parseQuery(query) - } - }; - - return HTML5History; -}(History)); - -function routerMixin(proto) { - proto.route = {}; -} - -var lastRoute = {}; - -function updateRender(vm) { - vm.router.normalize(); - vm.route = vm.router.parse(); - body.setAttribute('data-page', vm.route.file); -} - -function initRouter(vm) { - var config = vm.config; - var mode = config.routerMode || 'hash'; - var router; - - if (mode === 'history' && supportsPushState) { - router = new HTML5History(config); - } else { - router = new HashHistory(config); - } - - vm.router = router; - updateRender(vm); - lastRoute = vm.route; - - router.onchange(function (_) { - updateRender(vm); - vm._updateRender(); - - if (lastRoute.path === vm.route.path) { - vm.$resetEvents(); - return - } - - vm.$fetch(); - lastRoute = vm.route; - }); -} - -function eventMixin(proto) { - proto.$resetEvents = function () { - scrollIntoView(this.route.path, this.route.query.id); - - if (this.config.loadNavbar) { - getAndActive(this.router, 'nav'); - } - }; -} - -function initEvent(vm) { - // Bind toggle button - btn('button.sidebar-toggle', vm.router); - collapse('.sidebar', vm.router); - // Bind sticky effect - if (vm.config.coverpage) { - !isMobile && on('scroll', sticky); - } else { - body.classList.add('sticky'); - } -} - -function loadNested(path, qs, file, next, vm, first) { - path = first ? path : path.replace(/\/$/, ''); - path = getParentPath(path); - - if (!path) { - return - } - - get( - vm.router.getFile(path + file) + qs, - false, - vm.config.requestHeaders - ).then(next, function (_) { return loadNested(path, qs, file, next, vm); }); -} - -function fetchMixin(proto) { - var last; - - var abort = function () { return last && last.abort && last.abort(); }; - var request = function (url, hasbar, requestHeaders) { - abort(); - last = get(url, true, requestHeaders); - return last - }; - - var get404Path = function (path, config) { - var notFoundPage = config.notFoundPage; - var ext = config.ext; - var defaultPath = '_404' + (ext || '.md'); - var key; - var path404; - - switch (typeof notFoundPage) { - case 'boolean': - path404 = defaultPath; - break - case 'string': - path404 = notFoundPage; - break - - case 'object': - key = Object.keys(notFoundPage) - .sort(function (a, b) { return b.length - a.length; }) - .find(function (key) { return path.match(new RegExp('^' + key)); }); - - path404 = (key && notFoundPage[key]) || defaultPath; - break - - default: - break - } - - return path404 - }; - - proto._loadSideAndNav = function (path, qs, loadSidebar, cb) { - var this$1 = this; - - return function () { - if (!loadSidebar) { - return cb() - } - - var fn = function (result) { - this$1._renderSidebar(result); - cb(); - }; - - // Load sidebar - loadNested(path, qs, loadSidebar, fn, this$1, true); - } - }; - - proto._fetch = function (cb) { - var this$1 = this; - if ( cb === void 0 ) cb = noop; - - var ref = this.route; - var path = ref.path; - var query = ref.query; - var qs = stringifyQuery(query, ['id']); - var ref$1 = this.config; - var loadNavbar = ref$1.loadNavbar; - var requestHeaders = ref$1.requestHeaders; - var loadSidebar = ref$1.loadSidebar; - // Abort last request - - var file = this.router.getFile(path); - var req = request(file + qs, true, requestHeaders); - - // Current page is html - this.isHTML = /\.html$/g.test(file); - - // Load main content - req.then( - function (text, opt) { return this$1._renderMain( - text, - opt, - this$1._loadSideAndNav(path, qs, loadSidebar, cb) - ); }, - function (_) { - this$1._fetchFallbackPage(file, qs, cb) || this$1._fetch404(file, qs, cb); - } - ); - - // Load nav - loadNavbar && - loadNested( - path, - qs, - loadNavbar, - function (text) { return this$1._renderNav(text); }, - this, - true - ); - }; - - proto._fetchCover = function () { - var this$1 = this; - - var ref = this.config; - var coverpage = ref.coverpage; - var requestHeaders = ref.requestHeaders; - var query = this.route.query; - var root = getParentPath(this.route.path); - - if (coverpage) { - var path = null; - var routePath = this.route.path; - if (typeof coverpage === 'string') { - if (routePath === '/') { - path = coverpage; - } - } else if (Array.isArray(coverpage)) { - path = coverpage.indexOf(routePath) > -1 && '_coverpage'; - } else { - var cover = coverpage[routePath]; - path = cover === true ? '_coverpage' : cover; - } - - var coverOnly = Boolean(path) && this.config.onlyCover; - if (path) { - path = this.router.getFile(root + path); - this.coverIsHTML = /\.html$/g.test(path); - get(path + stringifyQuery(query, ['id']), false, requestHeaders).then( - function (text) { return this$1._renderCover(text, coverOnly); } - ); - } else { - this._renderCover(null, coverOnly); - } - return coverOnly - } - }; - - proto.$fetch = function (cb) { - var this$1 = this; - if ( cb === void 0 ) cb = noop; - - var done = function () { - callHook(this$1, 'doneEach'); - cb(); - }; - - var onlyCover = this._fetchCover(); - - if (onlyCover) { - done(); - } else { - this._fetch(function () { - this$1.$resetEvents(); - done(); - }); - } - }; - - proto._fetchFallbackPage = function (path, qs, cb) { - var this$1 = this; - if ( cb === void 0 ) cb = noop; - - var ref = this.config; - var requestHeaders = ref.requestHeaders; - var fallbackLanguages = ref.fallbackLanguages; - var loadSidebar = ref.loadSidebar; - - if (!fallbackLanguages) { - return false - } - - var local = path.split('/')[1]; - - if (fallbackLanguages.indexOf(local) === -1) { - return false - } - var newPath = path.replace(new RegExp(("^/" + local)), ''); - var req = request(newPath + qs, true, requestHeaders); - - req.then( - function (text, opt) { return this$1._renderMain( - text, - opt, - this$1._loadSideAndNav(path, qs, loadSidebar, cb) - ); }, - function () { return this$1._fetch404(path, qs, cb); } - ); - - return true - }; - /** - * Load the 404 page - * @param path - * @param qs - * @param cb - * @returns {*} - * @private - */ - proto._fetch404 = function (path, qs, cb) { - var this$1 = this; - if ( cb === void 0 ) cb = noop; - - var ref = this.config; - var loadSidebar = ref.loadSidebar; - var requestHeaders = ref.requestHeaders; - var notFoundPage = ref.notFoundPage; - - var fnLoadSideAndNav = this._loadSideAndNav(path, qs, loadSidebar, cb); - if (notFoundPage) { - var path404 = get404Path(path, this.config); - - request(this.router.getFile(path404), true, requestHeaders).then( - function (text, opt) { return this$1._renderMain(text, opt, fnLoadSideAndNav); }, - function () { return this$1._renderMain(null, {}, fnLoadSideAndNav); } - ); - return true - } - - this._renderMain(null, {}, fnLoadSideAndNav); - return false - }; -} - -function initFetch(vm) { - var ref = vm.config; - var loadSidebar = ref.loadSidebar; - - // Server-Side Rendering - if (vm.rendered) { - var activeEl = getAndActive(vm.router, '.sidebar-nav', true, true); - if (loadSidebar && activeEl) { - activeEl.parentNode.innerHTML += window.__SUB_SIDEBAR__; - } - vm._bindEventOnRendered(activeEl); - vm.$resetEvents(); - callHook(vm, 'doneEach'); - callHook(vm, 'ready'); - } else { - vm.$fetch(function (_) { return callHook(vm, 'ready'); }); - } -} - -function initMixin(proto) { - proto._init = function () { - var vm = this; - vm.config = config(); - - initLifecycle(vm); // Init hooks - initPlugin(vm); // Install plugins - callHook(vm, 'init'); - initRouter(vm); // Add router - initRender(vm); // Render base DOM - initEvent(vm); // Bind events - initFetch(vm); // Fetch data - callHook(vm, 'mounted'); - }; -} - -function initPlugin(vm) { - [].concat(vm.config.plugins).forEach(function (fn) { return isFn(fn) && fn(vm._lifecycle, vm); }); -} - - - -var util = Object.freeze({ - cached: cached, - hyphenate: hyphenate, - hasOwn: hasOwn, - merge: merge, - isPrimitive: isPrimitive, - noop: noop, - isFn: isFn, - inBrowser: inBrowser, - isMobile: isMobile, - supportsPushState: supportsPushState, - parseQuery: parseQuery, - stringifyQuery: stringifyQuery, - isAbsolutePath: isAbsolutePath, - getParentPath: getParentPath, - cleanPath: cleanPath, - resolvePath: resolvePath, - getPath: getPath, - replaceSlug: replaceSlug -}); - -function initGlobalAPI () { - window.Docsify = { - util: util, - dom: dom, - get: get, - slugify: slugify, - version: '4.9.2' - }; - window.DocsifyCompiler = Compiler; - window.marked = marked; - window.Prism = prism; -} - -/** - * Fork https://github.com/bendrucker/document-ready/blob/master/index.js - */ -function ready(callback) { - var state = document.readyState; - - if (state === 'complete' || state === 'interactive') { - return setTimeout(callback, 0) - } - - document.addEventListener('DOMContentLoaded', callback); -} - -function Docsify() { - this._init(); -} - -var proto = Docsify.prototype; - -initMixin(proto); -routerMixin(proto); -renderMixin(proto); -fetchMixin(proto); -eventMixin(proto); - -/** - * Global API - */ -initGlobalAPI(); - -/** - * Run Docsify - */ -ready(function (_) { return new Docsify(); }); - -}()); diff --git a/lib/docsify.min.js b/lib/docsify.min.js deleted file mode 100644 index 4f9a496..0000000 --- a/lib/docsify.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(){function s(n){var r=Object.create(null);return function(e){var t=c(e)?e:JSON.stringify(e);return r[t]||(r[t]=n(e))}}var o=s(function(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),l=Object.prototype.hasOwnProperty,d=Object.assign||function(e){for(var t=arguments,n=1;n=a.length)i(r);else if("function"==typeof e)if(2===e.length)e(r,function(e){r=e,o(t+1)});else{var n=e(r);r=void 0===n?r:n,o(t+1)}else o(t+1)};o(0)}var f=!0,m=f&&document.body.clientWidth<=600,g=f&&window.history&&window.history.pushState&&window.history.replaceState&&!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/),n={};function v(e,t){if(void 0===t&&(t=!1),"string"==typeof e){if(void 0!==window.Vue)return x(e);e=t?x(e):n[e]||(n[e]=x(e))}return e}var b=f&&document,y=f&&b.body,k=f&&b.head;function x(e,t){return t?e.querySelector(t):b.querySelector(e)}function w(e,t){return[].slice.call(t?e.querySelectorAll(t):b.querySelectorAll(e))}function _(e,t){return e=b.createElement(e),t&&(e.innerHTML=t),e}function S(e,t){return e.appendChild(t)}function A(e,t){return e.insertBefore(t,e.children[0])}function C(e,t,n){u(t)?window.addEventListener(e,t):e.addEventListener(t,n)}function E(e,t,n){u(t)?window.removeEventListener(e,t):e.removeEventListener(t,n)}function $(e,t,n){e&&e.classList[n?t:"toggle"](n||t)}var L,T,e=Object.freeze({getNode:v,$:b,body:y,head:k,find:x,findAll:w,create:_,appendTo:S,before:A,on:C,off:E,toggleClass:$,style:function(e){S(k,_("style",e))}});function R(e,t){if(void 0===t&&(t='
      {inner}
    '),!e||!e.length)return"";var n="";return e.forEach(function(e){n+='
  • '+e.title+"
  • ",e.children&&(n+=R(e.children,t))}),t.replace("{inner}",n)}function r(e,t){return'

    '+t.slice(5).trim()+"

    "}function P(e){var t,n,r=e.loaded,i=e.total,a=e.step;!L&&((n=_("div")).classList.add("progress"),S(y,n),L=n),t=a?80<(t=parseInt(L.style.width||0,10)+a)?80:t:Math.floor(r/i*100),L.style.opacity=1,L.style.width=95<=t?"100%":t+"%",95<=t&&(clearTimeout(T),T=setTimeout(function(e){L.style.opacity=0,L.style.width="0%"},200))}var O={};function F(a,e,t){void 0===e&&(e=!1),void 0===t&&(t={});var o=new XMLHttpRequest,n=function(){o.addEventListener.apply(o,arguments)},r=O[a];if(r)return{then:function(e){return e(r.content,r.opt)},abort:p};for(var i in o.open("GET",a),t)l.call(t,i)&&o.setRequestHeader(i,t[i]);return o.send(),{then:function(r,i){if(void 0===i&&(i=p),e){var t=setInterval(function(e){return P({step:Math.floor(5*Math.random()+1)})},500);n("progress",P),n("loadend",function(e){P(e),clearInterval(t)})}n("error",i),n("load",function(e){var t=e.target;if(400<=t.status)i(t);else{var n=O[a]={content:t.response,opt:{updatedAt:o.getResponseHeader("last-modified")}};r(n.content,n.opt)}})},abort:function(e){return 4!==o.readyState&&o.abort()}}}function j(e,t){e.innerHTML=e.innerHTML.replace(/var\(\s*--theme-color.*?\)/g,t)}var N=/([^{]*?)\w(?=\})/g,z={YYYY:"getFullYear",YY:"getYear",MM:function(e){return e.getMonth()+1},DD:"getDate",HH:"getHours",mm:"getMinutes",ss:"getSeconds"};var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e,t){return e(t={exports:{}},t.exports),t.exports}var M=i(function(m,e){!function(e){var y={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:d,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:d,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:d,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,text:/^[^\n]+/};function l(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||f.defaults,this.rules=y.normal,this.options.pedantic?this.rules=y.pedantic:this.options.gfm&&(this.options.tables?this.rules=y.tables:this.rules=y.gfm)}y._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,y._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,y.def=t(y.def).replace("label",y._label).replace("title",y._title).getRegex(),y.bullet=/(?:[*+-]|\d+\.)/,y.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,y.item=t(y.item,"gm").replace(/bull/g,y.bullet).getRegex(),y.list=t(y.list).replace(/bull/g,y.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+y.def.source+")").getRegex(),y._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",y._comment=//,y.html=t(y.html,"i").replace("comment",y._comment).replace("tag",y._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),y.paragraph=t(y.paragraph).replace("hr",y.hr).replace("heading",y.heading).replace("lheading",y.lheading).replace("tag",y._tag).getRegex(),y.blockquote=t(y.blockquote).replace("paragraph",y.paragraph).getRegex(),y.normal=g({},y),y.gfm=g({},y.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),y.gfm.paragraph=t(y.paragraph).replace("(?!","(?!"+y.gfm.fences.source.replace("\\1","\\2")+"|"+y.list.source.replace("\\1","\\3")+"|").getRegex(),y.tables=g({},y.gfm,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),y.pedantic=g({},y.normal,{html:t("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",y._comment).replace(/tag/g,"(?!(?: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").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),l.rules=y,l.lex=function(e,t){return new l(t).lex(e)},l.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)},l.prototype.token=function(e,t){var n,r,i,a,o,s,l,c,u,p,h,d,g,f,m,v,b=this;for(e=e.replace(/^ +$/gm,"");e;)if((i=b.rules.newline.exec(e))&&(e=e.substring(i[0].length),1 ?/gm,""),b.token(i,t),b.tokens.push({type:"blockquote_end"});else if(i=b.rules.list.exec(e)){for(e=e.substring(i[0].length),l={type:"list_start",ordered:f=1<(a=i[2]).length,start:f?+a:"",loose:!1},b.tokens.push(l),n=!(c=[]),g=(i=i[0].match(b.rules.item)).length,h=0;h?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:d,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_)|^_([^\s_][\s\S]*?[^\s])_(?!_)|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:d,text:/^(`+|[^`])[\s\S]*?(?=[\\?@\[\]\\^_`{|}~])/g,n._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,n._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,n.autolink=t(n.autolink).replace("scheme",n._scheme).replace("email",n._email).getRegex(),n._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,n.tag=t(n.tag).replace("comment",y._comment).replace("attribute",n._attribute).getRegex(),n._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/,n._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f\\]*\)|[^\s\x00-\x1f()\\])*?)/,n._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,n.link=t(n.link).replace("label",n._label).replace("href",n._href).replace("title",n._title).getRegex(),n.reflink=t(n.reflink).replace("label",n._label).getRegex(),n.normal=g({},n),n.pedantic=g({},n.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:t(/^!?\[(label)\]\((.*?)\)/).replace("label",n._label).getRegex(),reflink:t(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",n._label).getRegex()}),n.gfm=g({},n.normal,{escape:t(n.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:t(n.text).replace("]|","~]|").replace("|$","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|$").getRegex()}),n.gfm.url=t(n.gfm.url).replace("email",n.gfm._extended_email).getRegex(),n.breaks=g({},n.gfm,{br:t(n.br).replace("{2,}","*").getRegex(),text:t(n.gfm.text).replace("{2,}","*").getRegex()}),c.rules=n,c.output=function(e,t,n){return new c(t,n).output(e)},c.prototype.output=function(e){for(var t,n,r,i,a,o,s=this,l="";e;)if(a=s.rules.escape.exec(e))e=e.substring(a[0].length),l+=a[1];else if(a=s.rules.autolink.exec(e))e=e.substring(a[0].length),r="@"===a[2]?"mailto:"+(n=p(s.mangle(a[1]))):n=p(a[1]),l+=s.renderer.link(r,null,n);else if(s.inLink||!(a=s.rules.url.exec(e))){if(a=s.rules.tag.exec(e))!s.inLink&&/^/i.test(a[0])&&(s.inLink=!1),!s.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(a[0])?s.inRawBlock=!0:s.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(a[0])&&(s.inRawBlock=!1),e=e.substring(a[0].length),l+=s.options.sanitize?s.options.sanitizer?s.options.sanitizer(a[0]):p(a[0]):a[0];else if(a=s.rules.link.exec(e))e=e.substring(a[0].length),s.inLink=!0,r=a[2],i=s.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r))?(r=t[1],t[3]):"":a[3]?a[3].slice(1,-1):"",r=r.trim().replace(/^<([\s\S]*)>$/,"$1"),l+=s.outputLink(a,{href:c.escapes(r),title:c.escapes(i)}),s.inLink=!1;else if((a=s.rules.reflink.exec(e))||(a=s.rules.nolink.exec(e))){if(e=e.substring(a[0].length),t=(a[2]||a[1]).replace(/\s+/g," "),!(t=s.links[t.toLowerCase()])||!t.href){l+=a[0].charAt(0),e=a[0].substring(1)+e;continue}s.inLink=!0,l+=s.outputLink(a,t),s.inLink=!1}else if(a=s.rules.strong.exec(e))e=e.substring(a[0].length),l+=s.renderer.strong(s.output(a[4]||a[3]||a[2]||a[1]));else if(a=s.rules.em.exec(e))e=e.substring(a[0].length),l+=s.renderer.em(s.output(a[6]||a[5]||a[4]||a[3]||a[2]||a[1]));else if(a=s.rules.code.exec(e))e=e.substring(a[0].length),l+=s.renderer.codespan(p(a[2].trim(),!0));else if(a=s.rules.br.exec(e))e=e.substring(a[0].length),l+=s.renderer.br();else if(a=s.rules.del.exec(e))e=e.substring(a[0].length),l+=s.renderer.del(s.output(a[1]));else if(a=s.rules.text.exec(e))e=e.substring(a[0].length),s.inRawBlock?l+=s.renderer.text(a[0]):l+=s.renderer.text(p(s.smartypants(a[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else{if("@"===a[2])r="mailto:"+(n=p(a[0]));else{for(;o=a[0],a[0]=s.rules._backpedal.exec(a[0])[0],o!==a[0];);n=p(a[0]),r="www."===a[1]?"http://"+n:n}e=e.substring(a[0].length),l+=s.renderer.link(r,null,n)}return l},c.escapes=function(e){return e?e.replace(c.rules._escapes,"$1"):e},c.prototype.outputLink=function(e,t){var n=t.href,r=t.title?p(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,p(e[1]))},c.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},c.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i'+(n?e:p(e,!0))+"\n":"
    "+(n?e:p(e,!0))+"
    "},r.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},r.prototype.html=function(e){return e},r.prototype.heading=function(e,t,n){return this.options.headerIds?"'+e+"\n":""+e+"\n"},r.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},r.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},r.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},r.prototype.checkbox=function(e){return" "},r.prototype.paragraph=function(e){return"

    "+e+"

    \n"},r.prototype.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},r.prototype.tablerow=function(e){return"\n"+e+"\n"},r.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"},r.prototype.strong=function(e){return""+e+""},r.prototype.em=function(e){return""+e+""},r.prototype.codespan=function(e){return""+e+""},r.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},r.prototype.del=function(e){return""+e+""},r.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(h(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return n}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return n}this.options.baseUrl&&!s.test(e)&&(e=a(this.options.baseUrl,e));try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return n}var i='
    "},r.prototype.image=function(e,t,n){this.options.baseUrl&&!s.test(e)&&(e=a(this.options.baseUrl,e));var r=''+n+'":">"},r.prototype.text=function(e){return e},i.prototype.strong=i.prototype.em=i.prototype.codespan=i.prototype.del=i.prototype.text=function(e){return e},i.prototype.link=i.prototype.image=function(e,t,n){return""+n},i.prototype.br=function(){return""},u.parse=function(e,t){return new u(t).parse(e)},u.prototype.parse=function(e){this.inline=new c(e.links,this.options),this.inlineText=new c(e.links,g({},this.options,{renderer:new i})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},u.prototype.next=function(){return this.token=this.tokens.pop()},u.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},u.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},u.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,h(this.inlineText.output(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="",o="";for(r="",t=0;t"']/,p.escapeReplace=/[&<>"']/g,p.replacements={"&":"&","<":"<",">":">",'"':""","'":"'"},p.escapeTestNoEncode=/[<>"']|&(?!#?\w+;)/,p.escapeReplaceNoEncode=/[<>"']|&(?!#?\w+;)/g;var o={},s=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function d(){}function g(e){for(var t,n,r=arguments,i=1;it)n.splice(t);else for(;n.lengthAn error occurred:

    "+p(e.message+"",!0)+"
    ";throw e}}d.exec=d,f.options=f.setOptions=function(e){return g(f.defaults,e),f},f.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new r,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},f.defaults=f.getDefaults(),f.Parser=u,f.parser=u.parse,f.Renderer=r,f.TextRenderer=i,f.Lexer=l,f.lexer=l.lex,f.InlineLexer=c,f.inlineLexer=c.output,f.parse=f,m.exports=f}(t||"undefined"!=typeof window&&window)}),a=i(function(e){var c="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},u=function(){var l=/\blang(?:uage)?-([\w-]+)\b/i,t=0,P=c.Prism={manual:c.Prism&&c.Prism.manual,disableWorkerMessageHandler:c.Prism&&c.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof o?new o(e.type,P.util.encode(e.content),e.alias):"Array"===P.util.type(e)?e.map(P.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(k instanceof s)){if(g&&b!=t.length-1){if(p.lastIndex=y,!(C=p.exec(e)))break;for(var x=C.index+(d?C[1].length:0),w=C.index+C[0].length,_=b,S=y,A=t.length;_"+r.content+""},!c.document)return c.addEventListener&&(P.disableWorkerMessageHandler||c.addEventListener("message",function(e){var t=JSON.parse(e.data),n=t.language,r=t.code,i=t.immediateClose;c.postMessage(P.highlight(r,P.languages[n],n)),i&&c.close()},!1)),c.Prism;var e=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return e&&(P.filename=e.src,P.manual||e.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(P.highlightAll):window.setTimeout(P.highlightAll,16):document.addEventListener("DOMContentLoaded",P.highlightAll))),c.Prism}();e.exports&&(e.exports=u),void 0!==t&&(t.Prism=u),u.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/(^|[^\\])["']/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},u.languages.markup.tag.inside["attr-value"].inside.entity=u.languages.markup.entity,u.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),u.languages.xml=u.languages.markup,u.languages.html=u.languages.markup,u.languages.mathml=u.languages.markup,u.languages.svg=u.languages.markup,u.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(?:;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^{}\s][^{};]*?(?=\s*\{)/,string:{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/\B!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},u.languages.css.atrule.inside.rest=u.languages.css,u.languages.markup&&(u.languages.insertBefore("markup","tag",{style:{pattern:/()[\s\S]*?(?=<\/style>)/i,lookbehind:!0,inside:u.languages.css,alias:"language-css",greedy:!0}}),u.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:u.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:u.languages.css}},alias:"language-css"}},u.languages.markup.tag)),u.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/[a-z0-9_]+(?=\()/i,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/},u.languages.javascript=u.languages.extend("clike",{keyword:/\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,function:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/i,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/}),u.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[[^\]\r\n]+]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=\s*(?:function\b|(?:\([^()]*\)|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i,alias:"function"},constant:/\b[A-Z][A-Z\d_]*\b/}),u.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${[^}]+}|[^\\`])*`/,greedy:!0,inside:{interpolation:{pattern:/\${[^}]+}/,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}}}),u.languages.javascript["template-string"].inside.interpolation.inside.rest=u.languages.javascript,u.languages.markup&&u.languages.insertBefore("markup","tag",{script:{pattern:/()[\s\S]*?(?=<\/script>)/i,lookbehind:!0,inside:u.languages.javascript,alias:"language-javascript",greedy:!0}}),u.languages.js=u.languages.javascript,"undefined"!=typeof self&&self.Prism&&self.document&&document.querySelector&&(self.Prism.fileHighlight=function(){var l={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"};Array.prototype.slice.call(document.querySelectorAll("pre[data-src]")).forEach(function(e){for(var t,n=e.getAttribute("data-src"),r=e,i=/\blang(?:uage)?-([\w-]+)\b/i;r&&!i.test(r.className);)r=r.parentNode;if(r&&(t=(e.className.match(i)||[,""])[1]),!t){var a=(n.match(/\.(\w+)$/)||[,""])[1];t=l[a]||a}var o=document.createElement("code");o.className="language-"+t,e.textContent="",o.textContent="Loading…",e.appendChild(o);var s=new XMLHttpRequest;s.open("GET",n,!0),s.onreadystatechange=function(){4==s.readyState&&(s.status<400&&s.responseText?(o.textContent=s.responseText,u.highlightElement(o)):400<=s.status?o.textContent="✖ Error "+s.status+" while fetching file: "+s.statusText:o.textContent="✖ Error: File does not exist or is empty")},s.send(null)}),u.plugins.toolbar&&u.plugins.toolbar.registerButton("download-file",function(e){var t=e.element.parentNode;if(t&&/pre/i.test(t.nodeName)&&t.hasAttribute("data-src")&&t.hasAttribute("data-download-link")){var n=t.getAttribute("data-src"),r=document.createElement("a");return r.textContent=t.getAttribute("data-download-link-label")||"Download",r.setAttribute("download",""),r.href=n,r}})},document.addEventListener("DOMContentLoaded",self.Prism.fileHighlight))});function q(e,r){var i=[],a={};return e.forEach(function(e){var t=e.level||1,n=t-1;r?@[\]^`{|}~]/g;function B(e){return e.toLowerCase()}function U(e){if("string"!=typeof e)return"";var t=e.trim().replace(/[A-Z]+/g,B).replace(/<[^>\d]+>/g,"").replace(H,"").replace(/\s/g,"-").replace(/-+/g,"-").replace(/^(\d)/,"_$1"),n=I[t];return n=l.call(I,t)?n+1:0,(I[t]=n)&&(t=t+"-"+n),t}function D(e,t){return''+t+''}U.clear=function(){I={}};var Z=decodeURIComponent,Y=encodeURIComponent;function W(e){var n={};return(e=e.trim().replace(/^(\?|#|&)/,""))&&e.split("&").forEach(function(e){var t=e.replace(/\+/g," ").split("=");n[t[0]]=t[1]&&Z(t[1])}),n}function G(e,t){void 0===t&&(t=[]);var n=[];for(var r in e)-1=g.length))for(var t=0;t=g.length)break}}else n.content&&"string"!=typeof n.content&&f(n.content)}};f(p.tokens)}}}});var te={};function ne(e){void 0===e&&(e="");var r={};return e&&(e=e.replace(/^'/,"").replace(/'$/,"").replace(/(?:^|\s):([\w-]+)=?([\w-]+)?/g,function(e,t,n){return r[t]=n&&n.replace(/"/g,"")||!0,""}).trim()),{str:e,config:r}}var re={markdown:function(e){return{url:e}},mermaid:function(e){return{url:e}},iframe:function(e,t){return{html:'"}},video:function(e,t){return{html:'"}},audio:function(e,t){return{html:'"}},code:function(e,t){var n=e.match(/\.(\w+)$/);return"md"===(n=t||n&&n[1])&&(n="markdown"),{url:e,lang:n}}},ie=function(i,e){var a=this;this.config=i,this.router=e,this.cacheTree={},this.toc=[],this.cacheTOC={},this.linkTarget=i.externalLinkTarget||"_blank",this.contentBase=e.getBasePath();var o,t=this._initRenderer(),n=i.markdown||{};o=u(n)?n(M,t):(M.setOptions(d(n,{renderer:d(t,n.renderer)})),M),this._marked=o,this.compile=function(n){var r=!0,e=s(function(e){r=!1;var t="";return n?(t=c(n)?o(n):o.parser(n),t=i.noEmoji?t:t.replace(/<(pre|template|code)[^>]*?>[\s\S]+?<\/(pre|template|code)>/g,function(e){return e.replace(/:/g,"__colon__")}).replace(/:(\w+?):/gi,f&&window.emojify||D).replace(/__colon__/g,":"),U.clear(),t):n})(n),t=a.router.parse().file;return r?a.toc=a.cacheTOC[t]:a.cacheTOC[t]=[].concat(a.toc),e}};ie.prototype.compileEmbed=function(e,t){var n,r=ne(t),i=r.str,a=r.config;if(t=i,a.include){var o;if(X(e)||(e=K(this.contentBase,Q(this.router.getCurrentPath()),e)),a.type&&(o=re[a.type]))(n=o.call(this,e,t)).type=a.type;else{var s="code";/\.(md|markdown)/.test(e)?s="markdown":/\.mmd/.test(e)?s="mermaid":/\.html?/.test(e)?s="iframe":/\.(mp4|ogg)/.test(e)?s="video":/\.mp3/.test(e)&&(s="audio"),(n=re[s].call(this,e,t)).type=s}return n.fragment=a.fragment,n}},ie.prototype._matchNotCompileLink=function(e){for(var t=this.config.noCompileLinks||[],n=0;n
    '+r+""},t.code=e.code=function(e,t){return void 0===t&&(t=""),e=e.replace(/@DOCSIFY_QM@/g,"`"),'
    '+a.highlight(e,a.languages[t]||a.languages.markup)+"
    "},t.link=e.link=function(e,t,n){void 0===t&&(t="");var r="",i=ne(t),a=i.str,o=i.config;return t=a,X(e)||l._matchNotCompileLink(e)||o.ignore?r+=0===e.indexOf("mailto:")?"":' target="'+s+'"':(e===l.config.homepage&&(e="README"),e=u.toURL(e,null,u.getCurrentPath())),o.target&&(r+=" target="+o.target),o.disabled&&(r+=" disabled",e="javascript:void(0)"),t&&(r+=' title="'+t+'"'),'"+n+""},t.paragraph=e.paragraph=function(e){return/^!>/.test(e)?r("tip",e):/^\?>/.test(e)?r("warn",e):"

    "+e+"

    "},t.image=e.image=function(e,t,n){var r=e,i="",a=ne(t),o=a.str,s=a.config;t=o,s["no-zoom"]&&(i+=" data-no-zoom"),t&&(i+=' title="'+t+'"');var l=s.size;if(l){var c=l.split("x");c[1]?i+="width="+c[0]+" height="+c[1]:i+="width="+c[0]}return X(e)||(r=K(p,Q(u.getCurrentPath()),e)),''+n+'"},t.list=e.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+" "+[/
  • /.test(e.split('class="task-list"')[0])?'class="task-list"':"",n&&1"+e+""},t.listitem=e.listitem=function(e){return/^(]*>)/.test(e)?'
  • ":"
  • "+e+"
  • "},e.origin=t,e},ie.prototype.sidebar=function(e,t){var n=this.router.getCurrentPath(),r="";if(e)r=this.compile(e);else{var i=this.cacheTree[n]||q(this.toc,t);r=R(i,"
      {inner}
    "),this.cacheTree[n]=i}return r},ie.prototype.subSidebar=function(e){if(e){var t=this.router.getCurrentPath(),n=this.cacheTree,r=this.toc;r[0]&&r[0].ignoreAllSubs&&r.splice(0),r[0]&&1===r[0].level&&r.shift();for(var i=0;i=t||e.classList.contains("hidden")?$(y,"add","sticky"):$(y,"remove","sticky")}}function se(e,t,r,n){var i=[];null!=(t=v(t))&&(i=w(t,"a"));var a,o=decodeURI(e.toURL(e.getCurrentPath()));return i.sort(function(e,t){return t.href.length-e.href.length}).forEach(function(e){var t=e.getAttribute("href"),n=r?e.parentNode:e;0!==o.indexOf(t)||a?$(n,"remove","active"):(a=e,$(n,"add","active"))}),n&&(b.title=a?a.title||a.innerText+" - "+ae:ae),a}var le=function(){function r(e,t){for(var n=0;nthis.end&&e>=this.next}[this.direction]}},{key:"_defaultEase",value:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t}}]),t}(),ue={},pe=!1,he=null,de=!0,ge=0;function fe(e){if(de){for(var t,n=v(".sidebar"),r=w(".anchor"),i=x(n,".sidebar-nav"),a=x(n,"li.active"),o=document.documentElement,s=(o&&o.scrollTop||document.body.scrollTop)-ge,l=0,c=r.length;ls){t||(t=u);break}t=u}if(t){var p=ue[me(decodeURIComponent(e),t.getAttribute("data-id"))];if(p&&p!==a&&(a&&a.classList.remove("active"),p.classList.add("active"),a=p,!pe&&y.classList.contains("sticky"))){var h=n.clientHeight,d=a.offsetTop+a.clientHeight+40,g=d-0=i.scrollTop&&d<=i.scrollTop+h?i.scrollTop:g?0:d-h;n.scrollTop=f}}}}function me(e,t){return e+"?id="+t}function ve(e,t){if(t){var n,r=x("#"+t);r&&(n=r,he&&he.stop(),de=!1,he=new ce({start:window.pageYOffset,end:n.getBoundingClientRect().top+window.pageYOffset,duration:500}).on("tick",function(e){return window.scrollTo(0,e)}).on("done",function(){de=!0,he=null}).begin());var i=ue[me(e,t)],a=x(v(".sidebar"),"li.active");a&&a.classList.remove("active"),i&&i.classList.add("active")}}var be=b.scrollingElement||b.documentElement;var ye={};function ke(e,i){var o=e.compiler,a=e.raw;void 0===a&&(a="");var t=e.fetch,n=ye[a];if(n){var r=n.slice();return r.links=n.links,i(r)}var s=o._marked,l=s.lexer(a),c=[],u=s.InlineLexer.rules.link,p=l.links;l.forEach(function(e,a){"paragraph"===e.type&&(e.text=e.text.replace(new RegExp(u.source,"g"),function(e,t,n,r){var i=o.compileEmbed(n,r);return i&&c.push({index:a,embed:i}),e}))});var h=0;!function(e,a){var t,n=e.embedTokens,o=e.compile,s=(e.fetch,0),l=1;if(!n.length)return a({});for(;t=n[s++];){var r=function(i){return function(e){var t;if(e)if("markdown"===i.embed.type)t=o.lexer(e);else if("code"===i.embed.type){if(i.embed.fragment){var n=i.embed.fragment,r=new RegExp("(?:###|\\/\\/\\/)\\s*\\["+n+"\\]([\\s\\S]*)(?:###|\\/\\/\\/)\\s*\\["+n+"\\]");e=((e.match(r)||[])[1]||"").trim()}t=o.lexer("```"+i.embed.lang+"\n"+e.replace(/`/g,"@DOCSIFY_QM@")+"\n```\n")}else"mermaid"===i.embed.type?(t=[{type:"html",text:'
    \n'+e+"\n
    "}]).links={}:(t=[{type:"html",text:e}]).links={};a({token:i,embedToken:t}),++l>=s&&a({})}}(t);t.embed.url?F(t.embed.url).then(r):r(t.embed.html)}}({compile:s,embedTokens:c,fetch:t},function(e){var t=e.embedToken,n=e.token;if(n){var r=n.index+h;d(p,t.links),l=l.slice(0,r).concat(t,l.slice(r+1)),h+=t.length-1}else ye[a]=l.concat(),l.links=ye[a].links=p,i(l)})}function xe(){var e=w(".markdown-section>script").filter(function(e){return!/template/.test(e.type)})[0];if(!e)return!1;var t=e.innerText.trim();if(!t)return!1;setTimeout(function(e){window.__EXECUTE_RESULT__=new Function(t)()},0)}function we(e,t,n){var r,i,a;return t="function"==typeof n?n(t):"string"==typeof n?(i=[],a=0,(r=n).replace(N,function(t,e,n){i.push(r.substring(a,n-1)),a=n+=t.length+1,i.push(function(e){return("00"+("string"==typeof z[t]?e[z[t]]():z[t](e))).slice(-t.length)})}),a!==r.length&&i.push(r.substring(a)),function(e){for(var t="",n=0,r=e||new Date;n'):""),t.coverpage&&(u+=(i=", 100%, 85%",'
    \x3c!--cover--\x3e
    ')),t.logo){var h=/^data:image/.test(t.logo),d=/(?:http[s]?:)?\/\//.test(t.logo),g=/^\./.test(t.logo);h||d||g||(t.logo=K(e.router.getBasePath(),t.logo))}u+=(r='',(m?r+"
    ":"
    "+r)+'
    \x3c!--main--\x3e
    '),e._renderTo(c,u,!0)}else e.rendered=!0;t.mergeNavbar&&m?p=x(".sidebar"):(l.classList.add("app-nav"),t.repo||l.classList.add("no-badge")),t.loadNavbar&&A(p,l),t.themeColor&&(b.head.appendChild(_("div",(o=t.themeColor,"")).firstElementChild),function(n){if(!(window.CSS&&window.CSS.supports&&window.CSS.supports("(--v:red)"))){var e=w("style:not(.inserted),link");[].forEach.call(e,function(e){if("STYLE"===e.nodeName)j(e,n);else if("LINK"===e.nodeName){var t=e.getAttribute("href");if(!/\.css$/.test(t))return;F(t).then(function(e){var t=_("style",e);k.appendChild(t),j(t,n)})}})}}(t.themeColor)),e._updateRender(),$(y,"ready")}var Ae={};var Ce=function(e){this.config=e};function Ee(e){var t=location.href.indexOf("#");location.replace(location.href.slice(0,0<=t?t:0)+"#"+e)}Ce.prototype.getBasePath=function(){return this.config.basePath},Ce.prototype.getFile=function(e,t){void 0===e&&(e=this.getCurrentPath());var n,r,i=this.config,a=this.getBasePath(),o="string"==typeof i.ext?i.ext:".md";return e=i.alias?function e(t,n,r){var i=Object.keys(n).filter(function(e){return(Ae[e]||(Ae[e]=new RegExp("^"+e+"$"))).test(t)&&t!==r})[0];return i?e(t.replace(Ae[i],n[i]),n,t):t}(e,i.alias):e,n=e,r=o,e=(e=new RegExp("\\.("+r.replace(/^\./,"")+"|html)$","g").test(n)?n:/\/$/g.test(n)?n+"README"+r:""+n+r)==="/README"+o&&i.homepage||e,e=X(e)?e:K(a,e),t&&(e=e.replace(new RegExp("^"+a),"")),e},Ce.prototype.onchange=function(e){void 0===e&&(e=p),e()},Ce.prototype.getCurrentPath=function(){},Ce.prototype.normalize=function(){},Ce.prototype.parse=function(){},Ce.prototype.toURL=function(e,t,n){var r=n&&"#"===e[0],i=this.parse(ee(e));if(i.query=d({},i.query,t),e=(e=i.path+G(i.query)).replace(/\.md(\?)|\.md$/,"$1"),r){var a=n.indexOf("?");e=(0([^<]*?)

    $');if(i){if("color"===i[2])n.style.background=i[1]+(i[3]||"");else{var a=i[1];$(n,"add","has-mask"),X(i[1])||(a=K(this.router.getBasePath(),i[1])),n.style.backgroundImage="url("+a+")",n.style.backgroundSize="cover",n.style.backgroundPosition="center center"}r=r.replace(i[0],"")}this._renderTo(".cover-main",r),oe()}else $(n,"remove","show")},Ne._updateRender=function(){!function(e){var t=v(".app-name-link"),n=e.config.nameLink,r=e.route.path;if(t)if(c(e.config.nameLink))t.setAttribute("href",n);else if("object"==typeof n){var i=Object.keys(n).filter(function(e){return-1' -}; - -}()); diff --git a/lib/plugins/emoji.min.js b/lib/plugins/emoji.min.js deleted file mode 100644 index a305a42..0000000 --- a/lib/plugins/emoji.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(){var o=["+1","100","1234","8ball","a","ab","abc","abcd","accept","aerial_tramway","airplane","alarm_clock","alien","ambulance","anchor","angel","anger","angry","anguished","ant","apple","aquarius","aries","arrow_backward","arrow_double_down","arrow_double_up","arrow_down","arrow_down_small","arrow_forward","arrow_heading_down","arrow_heading_up","arrow_left","arrow_lower_left","arrow_lower_right","arrow_right","arrow_right_hook","arrow_up","arrow_up_down","arrow_up_small","arrow_upper_left","arrow_upper_right","arrows_clockwise","arrows_counterclockwise","art","articulated_lorry","astonished","athletic_shoe","atm","b","baby","baby_bottle","baby_chick","baby_symbol","back","baggage_claim","balloon","ballot_box_with_check","bamboo","banana","bangbang","bank","bar_chart","barber","baseball","basketball","bath","bathtub","battery","bear","bee","beer","beers","beetle","beginner","bell","bento","bicyclist","bike","bikini","bird","birthday","black_circle","black_joker","black_large_square","black_medium_small_square","black_medium_square","black_nib","black_small_square","black_square_button","blossom","blowfish","blue_book","blue_car","blue_heart","blush","boar","boat","bomb","book","bookmark","bookmark_tabs","books","boom","boot","bouquet","bow","bowling","bowtie","boy","bread","bride_with_veil","bridge_at_night","briefcase","broken_heart","bug","bulb","bullettrain_front","bullettrain_side","bus","busstop","bust_in_silhouette","busts_in_silhouette","cactus","cake","calendar","calling","camel","camera","cancer","candy","capital_abcd","capricorn","car","card_index","carousel_horse","cat","cat2","cd","chart","chart_with_downwards_trend","chart_with_upwards_trend","checkered_flag","cherries","cherry_blossom","chestnut","chicken","children_crossing","chocolate_bar","christmas_tree","church","cinema","circus_tent","city_sunrise","city_sunset","cl","clap","clapper","clipboard","clock1","clock10","clock1030","clock11","clock1130","clock12","clock1230","clock130","clock2","clock230","clock3","clock330","clock4","clock430","clock5","clock530","clock6","clock630","clock7","clock730","clock8","clock830","clock9","clock930","closed_book","closed_lock_with_key","closed_umbrella","cloud","clubs","cn","cocktail","coffee","cold_sweat","collision","computer","confetti_ball","confounded","confused","congratulations","construction","construction_worker","convenience_store","cookie","cool","cop","copyright","corn","couple","couple_with_heart","couplekiss","cow","cow2","credit_card","crescent_moon","crocodile","crossed_flags","crown","cry","crying_cat_face","crystal_ball","cupid","curly_loop","currency_exchange","curry","custard","customs","cyclone","dancer","dancers","dango","dart","dash","date","de","deciduous_tree","department_store","diamond_shape_with_a_dot_inside","diamonds","disappointed","disappointed_relieved","dizzy","dizzy_face","do_not_litter","dog","dog2","dollar","dolls","dolphin","door","doughnut","dragon","dragon_face","dress","dromedary_camel","droplet","dvd","e-mail","ear","ear_of_rice","earth_africa","earth_americas","earth_asia","egg","eggplant","eight","eight_pointed_black_star","eight_spoked_asterisk","electric_plug","elephant","email","end","envelope","envelope_with_arrow","es","euro","european_castle","european_post_office","evergreen_tree","exclamation","expressionless","eyeglasses","eyes","facepunch","factory","fallen_leaf","family","fast_forward","fax","fearful","feelsgood","feet","ferris_wheel","file_folder","finnadie","fire","fire_engine","fireworks","first_quarter_moon","first_quarter_moon_with_face","fish","fish_cake","fishing_pole_and_fish","fist","five","flags","flashlight","flipper","floppy_disk","flower_playing_cards","flushed","foggy","football","footprints","fork_and_knife","fountain","four","four_leaf_clover","fr","free","fried_shrimp","fries","frog","frowning","fu","fuelpump","full_moon","full_moon_with_face","game_die","gb","gem","gemini","ghost","gift","gift_heart","girl","globe_with_meridians","goat","goberserk","godmode","golf","grapes","green_apple","green_book","green_heart","grey_exclamation","grey_question","grimacing","grin","grinning","guardsman","guitar","gun","haircut","hamburger","hammer","hamster","hand","handbag","hankey","hash","hatched_chick","hatching_chick","headphones","hear_no_evil","heart","heart_decoration","heart_eyes","heart_eyes_cat","heartbeat","heartpulse","hearts","heavy_check_mark","heavy_division_sign","heavy_dollar_sign","heavy_exclamation_mark","heavy_minus_sign","heavy_multiplication_x","heavy_plus_sign","helicopter","herb","hibiscus","high_brightness","high_heel","hocho","honey_pot","honeybee","horse","horse_racing","hospital","hotel","hotsprings","hourglass","hourglass_flowing_sand","house","house_with_garden","hurtrealbad","hushed","ice_cream","icecream","id","ideograph_advantage","imp","inbox_tray","incoming_envelope","information_desk_person","information_source","innocent","interrobang","iphone","it","izakaya_lantern","jack_o_lantern","japan","japanese_castle","japanese_goblin","japanese_ogre","jeans","joy","joy_cat","jp","key","keycap_ten","kimono","kiss","kissing","kissing_cat","kissing_closed_eyes","kissing_heart","kissing_smiling_eyes","koala","koko","kr","lantern","large_blue_circle","large_blue_diamond","large_orange_diamond","last_quarter_moon","last_quarter_moon_with_face","laughing","leaves","ledger","left_luggage","left_right_arrow","leftwards_arrow_with_hook","lemon","leo","leopard","libra","light_rail","link","lips","lipstick","lock","lock_with_ink_pen","lollipop","loop","loud_sound","loudspeaker","love_hotel","love_letter","low_brightness","m","mag","mag_right","mahjong","mailbox","mailbox_closed","mailbox_with_mail","mailbox_with_no_mail","man","man_with_gua_pi_mao","man_with_turban","mans_shoe","maple_leaf","mask","massage","meat_on_bone","mega","melon","memo","mens","metal","metro","microphone","microscope","milky_way","minibus","minidisc","mobile_phone_off","money_with_wings","moneybag","monkey","monkey_face","monorail","moon","mortar_board","mount_fuji","mountain_bicyclist","mountain_cableway","mountain_railway","mouse","mouse2","movie_camera","moyai","muscle","mushroom","musical_keyboard","musical_note","musical_score","mute","nail_care","name_badge","neckbeard","necktie","negative_squared_cross_mark","neutral_face","new","new_moon","new_moon_with_face","newspaper","ng","night_with_stars","nine","no_bell","no_bicycles","no_entry","no_entry_sign","no_good","no_mobile_phones","no_mouth","no_pedestrians","no_smoking","non-potable_water","nose","notebook","notebook_with_decorative_cover","notes","nut_and_bolt","o","o2","ocean","octocat","octopus","oden","office","ok","ok_hand","ok_woman","older_man","older_woman","on","oncoming_automobile","oncoming_bus","oncoming_police_car","oncoming_taxi","one","open_book","open_file_folder","open_hands","open_mouth","ophiuchus","orange_book","outbox_tray","ox","package","page_facing_up","page_with_curl","pager","palm_tree","panda_face","paperclip","parking","part_alternation_mark","partly_sunny","passport_control","paw_prints","peach","pear","pencil","pencil2","penguin","pensive","performing_arts","persevere","person_frowning","person_with_blond_hair","person_with_pouting_face","phone","pig","pig2","pig_nose","pill","pineapple","pisces","pizza","point_down","point_left","point_right","point_up","point_up_2","police_car","poodle","poop","post_office","postal_horn","postbox","potable_water","pouch","poultry_leg","pound","pouting_cat","pray","princess","punch","purple_heart","purse","pushpin","put_litter_in_its_place","question","rabbit","rabbit2","racehorse","radio","radio_button","rage","rage1","rage2","rage3","rage4","railway_car","rainbow","raised_hand","raised_hands","raising_hand","ram","ramen","rat","recycle","red_car","red_circle","registered","relaxed","relieved","repeat","repeat_one","restroom","revolving_hearts","rewind","ribbon","rice","rice_ball","rice_cracker","rice_scene","ring","rocket","roller_coaster","rooster","rose","rotating_light","round_pushpin","rowboat","ru","rugby_football","runner","running","running_shirt_with_sash","sa","sagittarius","sailboat","sake","sandal","santa","satellite","satisfied","saxophone","school","school_satchel","scissors","scorpius","scream","scream_cat","scroll","seat","secret","see_no_evil","seedling","seven","shaved_ice","sheep","shell","ship","shipit","shirt","shit","shoe","shower","signal_strength","six","six_pointed_star","ski","skull","sleeping","sleepy","slot_machine","small_blue_diamond","small_orange_diamond","small_red_triangle","small_red_triangle_down","smile","smile_cat","smiley","smiley_cat","smiling_imp","smirk","smirk_cat","smoking","snail","snake","snowboarder","snowflake","snowman","sob","soccer","soon","sos","sound","space_invader","spades","spaghetti","sparkle","sparkler","sparkles","sparkling_heart","speak_no_evil","speaker","speech_balloon","speedboat","squirrel","star","star2","stars","station","statue_of_liberty","steam_locomotive","stew","straight_ruler","strawberry","stuck_out_tongue","stuck_out_tongue_closed_eyes","stuck_out_tongue_winking_eye","sun_with_face","sunflower","sunglasses","sunny","sunrise","sunrise_over_mountains","surfer","sushi","suspect","suspension_railway","sweat","sweat_drops","sweat_smile","sweet_potato","swimmer","symbols","syringe","tada","tanabata_tree","tangerine","taurus","taxi","tea","telephone","telephone_receiver","telescope","tennis","tent","thought_balloon","three","thumbsdown","thumbsup","ticket","tiger","tiger2","tired_face","tm","toilet","tokyo_tower","tomato","tongue","top","tophat","tractor","traffic_light","train","train2","tram","triangular_flag_on_post","triangular_ruler","trident","triumph","trolleybus","trollface","trophy","tropical_drink","tropical_fish","truck","trumpet","tshirt","tulip","turtle","tv","twisted_rightwards_arrows","two","two_hearts","two_men_holding_hands","two_women_holding_hands","u5272","u5408","u55b6","u6307","u6708","u6709","u6e80","u7121","u7533","u7981","u7a7a","uk","umbrella","unamused","underage","unlock","up","us","v","vertical_traffic_light","vhs","vibration_mode","video_camera","video_game","violin","virgo","volcano","vs","walking","waning_crescent_moon","waning_gibbous_moon","warning","watch","water_buffalo","watermelon","wave","wavy_dash","waxing_crescent_moon","waxing_gibbous_moon","wc","weary","wedding","whale","whale2","wheelchair","white_check_mark","white_circle","white_flower","white_large_square","white_medium_small_square","white_medium_square","white_small_square","white_square_button","wind_chime","wine_glass","wink","wolf","woman","womans_clothes","womans_hat","womens","worried","wrench","x","yellow_heart","yen","yum","zap","zero","zzz"];window.emojify=function(e,a){return-1===o.indexOf(a)?e:''+a+''}}(); diff --git a/lib/plugins/external-script.js b/lib/plugins/external-script.js deleted file mode 100644 index 9d0b332..0000000 --- a/lib/plugins/external-script.js +++ /dev/null @@ -1,28 +0,0 @@ -(function () { -function handleExternalScript() { - var container = Docsify.dom.getNode('#main'); - var scripts = Docsify.dom.findAll(container, 'script'); - - for (var i = scripts.length; i--;) { - var script = scripts[i]; - - if (script && script.src) { - var newScript = document.createElement('script'); - - Array.prototype.slice.call(script.attributes).forEach(function (attribute) { - newScript[attribute.name] = attribute.value; - }); - - script.parentNode.insertBefore(newScript, script); - script.parentNode.removeChild(script); - } - } -} - -var install = function (hook) { - hook.doneEach(handleExternalScript); -}; - -window.$docsify.plugins = [].concat(install, window.$docsify.plugins); - -}()); diff --git a/lib/plugins/external-script.min.js b/lib/plugins/external-script.min.js deleted file mode 100644 index c4f8026..0000000 --- a/lib/plugins/external-script.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(){function e(){for(var o=Docsify.dom.getNode("#main"),e=Docsify.dom.findAll(o,"script"),n=e.length;n--;){var i=e[n];if(i&&i.src){var t=document.createElement("script");Array.prototype.slice.call(i.attributes).forEach(function(o){t[o.name]=o.value}),i.parentNode.insertBefore(t,i),i.parentNode.removeChild(i)}}}window.$docsify.plugins=[].concat(function(o){o.doneEach(e)},window.$docsify.plugins)}(); diff --git a/lib/plugins/front-matter.js b/lib/plugins/front-matter.js deleted file mode 100644 index 9a625ab..0000000 --- a/lib/plugins/front-matter.js +++ /dev/null @@ -1,496 +0,0 @@ -(function () { -/** - * Fork https://github.com/egoist/docute/blob/master/src/utils/yaml.js - */ -/* eslint-disable */ -/* -YAML parser for Javascript -Author: Diogo Costa -This program is released under the MIT License as follows: -Copyright (c) 2011 Diogo Costa (costa.h4evr@gmail.com) -Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -/** - * @name YAML - * @namespace -*/ - -var errors = []; -var reference_blocks = []; -var processing_time = 0; -var regex$1 = { - regLevel: new RegExp('^([\\s\\-]+)'), - invalidLine: new RegExp('^\\-\\-\\-|^\\.\\.\\.|^\\s*#.*|^\\s*$'), - dashesString: new RegExp('^\\s*\\"([^\\"]*)\\"\\s*$'), - quotesString: new RegExp("^\\s*\\'([^\\']*)\\'\\s*$"), - float: new RegExp('^[+-]?[0-9]+\\.[0-9]+(e[+-]?[0-9]+(\\.[0-9]+)?)?$'), - integer: new RegExp('^[+-]?[0-9]+$'), - array: new RegExp('\\[\\s*(.*)\\s*\\]'), - map: new RegExp('\\{\\s*(.*)\\s*\\}'), - key_value: new RegExp('([a-z0-9_-][ a-z0-9_-]*):( .+)', 'i'), - single_key_value: new RegExp('^([a-z0-9_-][ a-z0-9_-]*):( .+?)$', 'i'), - key: new RegExp('([a-z0-9_-][ a-z0-9_-]+):( .+)?', 'i'), - item: new RegExp('^-\\s+'), - trim: new RegExp('^\\s+|\\s+$'), - comment: new RegExp('([^\\\'\\"#]+([\\\'\\"][^\\\'\\"]*[\\\'\\"])*)*(#.*)?') - }; - -/** - * @class A block of lines of a given level. - * @param {int} lvl The block's level. - * @private - */ -function Block(lvl) { - return { - /* The block's parent */ - parent: null, - /* Number of children */ - length: 0, - /* Block's level */ - level: lvl, - /* Lines of code to process */ - lines: [], - /* Blocks with greater level */ - children: [], - /* Add a block to the children collection */ - addChild: function(obj) { - this.children.push(obj); - obj.parent = this; - ++this.length; - } - } -} - -function parser$1(str) { - var regLevel = regex$1['regLevel']; - var invalidLine = regex$1['invalidLine']; - var lines = str.split('\n'); - var m; - var level = 0, - curLevel = 0; - - var blocks = []; - - var result = new Block(-1); - var currentBlock = new Block(0); - result.addChild(currentBlock); - var levels = []; - var line = ''; - - blocks.push(currentBlock); - levels.push(level); - - for (var i = 0, len = lines.length; i < len; ++i) { - line = lines[i]; - - if (line.match(invalidLine)) { - continue - } - - if ((m = regLevel.exec(line))) { - level = m[1].length; - } else { level = 0; } - - if (level > curLevel) { - var oldBlock = currentBlock; - currentBlock = new Block(level); - oldBlock.addChild(currentBlock); - blocks.push(currentBlock); - levels.push(level); - } else if (level < curLevel) { - var added = false; - - var k = levels.length - 1; - for (; k >= 0; --k) { - if (levels[k] == level) { - currentBlock = new Block(level); - blocks.push(currentBlock); - levels.push(level); - if (blocks[k].parent != null) { blocks[k].parent.addChild(currentBlock); } - added = true; - break - } - } - - if (!added) { - errors.push('Error: Invalid indentation at line ' + i + ': ' + line); - return - } - } - - currentBlock.lines.push(line.replace(regex$1['trim'], '')); - curLevel = level; - } - - return result -} - -function processValue(val) { - val = val.replace(regex$1['trim'], ''); - var m = null; - - if (val == 'true') { - return true - } else if (val == 'false') { - return false - } else if (val == '.NaN') { - return Number.NaN - } else if (val == 'null') { - return null - } else if (val == '.inf') { - return Number.POSITIVE_INFINITY - } else if (val == '-.inf') { - return Number.NEGATIVE_INFINITY - } else if ((m = val.match(regex$1['dashesString']))) { - return m[1] - } else if ((m = val.match(regex$1['quotesString']))) { - return m[1] - } else if ((m = val.match(regex$1['float']))) { - return parseFloat(m[0]) - } else if ((m = val.match(regex$1['integer']))) { - return parseInt(m[0]) - } else if (!isNaN((m = Date.parse(val)))) { - return new Date(m) - } else if ((m = val.match(regex$1['single_key_value']))) { - var res = {}; - res[m[1]] = processValue(m[2]); - return res - } else if ((m = val.match(regex$1['array']))) { - var count = 0, - c = ' '; - var res = []; - var content = ''; - var str = false; - for (var j = 0, lenJ = m[1].length; j < lenJ; ++j) { - c = m[1][j]; - if (c == "'" || c == '"') { - if (str === false) { - str = c; - content += c; - continue - } else if ((c == "'" && str == "'") || (c == '"' && str == '"')) { - str = false; - content += c; - continue - } - } else if (str === false && (c == '[' || c == '{')) { - ++count; - } else if (str === false && (c == ']' || c == '}')) { - --count; - } else if (str === false && count == 0 && c == ',') { - res.push(processValue(content)); - content = ''; - continue - } - - content += c; - } - - if (content.length > 0) { res.push(processValue(content)); } - return res - } else if ((m = val.match(regex$1['map']))) { - var count = 0, - c = ' '; - var res = []; - var content = ''; - var str = false; - for (var j = 0, lenJ = m[1].length; j < lenJ; ++j) { - c = m[1][j]; - if (c == "'" || c == '"') { - if (str === false) { - str = c; - content += c; - continue - } else if ((c == "'" && str == "'") || (c == '"' && str == '"')) { - str = false; - content += c; - continue - } - } else if (str === false && (c == '[' || c == '{')) { - ++count; - } else if (str === false && (c == ']' || c == '}')) { - --count; - } else if (str === false && count == 0 && c == ',') { - res.push(content); - content = ''; - continue - } - - content += c; - } - - if (content.length > 0) { res.push(content); } - - var newRes = {}; - for (var j = 0, lenJ = res.length; j < lenJ; ++j) { - if ((m = res[j].match(regex$1['key_value']))) { - newRes[m[1]] = processValue(m[2]); - } - } - - return newRes - } else { return val } -} - -function processFoldedBlock(block) { - var lines = block.lines; - var children = block.children; - var str = lines.join(' '); - var chunks = [str]; - for (var i = 0, len = children.length; i < len; ++i) { - chunks.push(processFoldedBlock(children[i])); - } - return chunks.join('\n') -} - -function processLiteralBlock(block) { - var lines = block.lines; - var children = block.children; - var str = lines.join('\n'); - for (var i = 0, len = children.length; i < len; ++i) { - str += processLiteralBlock(children[i]); - } - return str -} - -function processBlock(blocks) { - var m = null; - var res = {}; - var lines = null; - var children = null; - var currentObj = null; - - var level = -1; - - var processedBlocks = []; - - var isMap = true; - - for (var j = 0, lenJ = blocks.length; j < lenJ; ++j) { - if (level != -1 && level != blocks[j].level) { continue } - - processedBlocks.push(j); - - level = blocks[j].level; - lines = blocks[j].lines; - children = blocks[j].children; - currentObj = null; - - for (var i = 0, len = lines.length; i < len; ++i) { - var line = lines[i]; - - if ((m = line.match(regex$1['key']))) { - var key = m[1]; - - if (key[0] == '-') { - key = key.replace(regex$1['item'], ''); - if (isMap) { - isMap = false; - if (typeof res.length === 'undefined') { - res = []; - } - } - if (currentObj != null) { res.push(currentObj); } - currentObj = {}; - isMap = true; - } - - if (typeof m[2] != 'undefined') { - var value = m[2].replace(regex$1['trim'], ''); - if (value[0] == '&') { - var nb = processBlock(children); - if (currentObj != null) { currentObj[key] = nb; } - else { res[key] = nb; } - reference_blocks[value.substr(1)] = nb; - } else if (value[0] == '|') { - if (currentObj != null) - { currentObj[key] = processLiteralBlock(children.shift()); } - else { res[key] = processLiteralBlock(children.shift()); } - } else if (value[0] == '*') { - var v = value.substr(1); - var no = {}; - - if (typeof reference_blocks[v] == 'undefined') { - errors.push("Reference '" + v + "' not found!"); - } else { - for (var k in reference_blocks[v]) { - no[k] = reference_blocks[v][k]; - } - - if (currentObj != null) { currentObj[key] = no; } - else { res[key] = no; } - } - } else if (value[0] == '>') { - if (currentObj != null) - { currentObj[key] = processFoldedBlock(children.shift()); } - else { res[key] = processFoldedBlock(children.shift()); } - } else { - if (currentObj != null) { currentObj[key] = processValue(value); } - else { res[key] = processValue(value); } - } - } else { - if (currentObj != null) { currentObj[key] = processBlock(children); } - else { res[key] = processBlock(children); } - } - } else if (line.match(/^-\s*$/)) { - if (isMap) { - isMap = false; - if (typeof res.length === 'undefined') { - res = []; - } - } - if (currentObj != null) { res.push(currentObj); } - currentObj = {}; - isMap = true; - continue - } else if ((m = line.match(/^-\s*(.*)/))) { - if (currentObj != null) { currentObj.push(processValue(m[1])); } - else { - if (isMap) { - isMap = false; - if (typeof res.length === 'undefined') { - res = []; - } - } - res.push(processValue(m[1])); - } - continue - } - } - - if (currentObj != null) { - if (isMap) { - isMap = false; - if (typeof res.length === 'undefined') { - res = []; - } - } - res.push(currentObj); - } - } - - for (var j = processedBlocks.length - 1; j >= 0; --j) { - blocks.splice.call(blocks, processedBlocks[j], 1); - } - - return res -} - -function semanticAnalysis(blocks) { - var res = processBlock(blocks.children); - return res -} - -function preProcess(src) { - var m; - var lines = src.split('\n'); - - var r = regex$1['comment']; - - for (var i in lines) { - if ((m = lines[i].match(r))) { - /* var cmt = ""; - if(typeof m[3] != "undefined") - lines[i] = m[1]; - else if(typeof m[3] != "undefined") - lines[i] = m[3]; - else - lines[i] = ""; - */ - if (typeof m[3] !== 'undefined') { - lines[i] = m[0].substr(0, m[0].length - m[3].length); - } - } - } - - return lines.join('\n') -} - -function load(str) { - errors = []; - reference_blocks = []; - processing_time = new Date().getTime(); - var pre = preProcess(str); - var doc = parser$1(pre); - var res = semanticAnalysis(doc); - processing_time = new Date().getTime() - processing_time; - - return res -} - -/** - * Fork https://github.com/egoist/docute/blob/master/src/utils/front-matter.js - */ -/* eslint-disable */ -var optionalByteOrderMark = '\\ufeff?'; -var pattern = - '^(' + - optionalByteOrderMark + - '(= yaml =|---)' + - '$([\\s\\S]*?)' + - '(?:\\2|\\.\\.\\.)' + - '$' + - '' + - '(?:\\n)?)'; -// NOTE: If this pattern uses the 'g' flag the `regex` variable definition will -// need to be moved down into the functions that use it. -var regex = new RegExp(pattern, 'm'); - -function extractor(string) { - string = string || ''; - - var lines = string.split(/(\r?\n)/); - if (lines[0] && /= yaml =|---/.test(lines[0])) { - return parse(string) - } else { - return { attributes: {}, body: string } - } -} - -function parse(string) { - var match = regex.exec(string); - - if (!match) { - return { - attributes: {}, - body: string - } - } - - var yaml = match[match.length - 1].replace(/^\s+|\s+$/g, ''); - var attributes = load(yaml) || {}; - var body = string.replace(match[0], ''); - - return { attributes: attributes, body: body, frontmatter: yaml } -} - -var install = function (hook, vm) { - hook.beforeEach(function (content) { - var ref = extractor(content); - var attributes = ref.attributes; - var body = ref.body; - - vm.frontmatter = attributes; - - return body - }); -}; - -$docsify.plugins = [].concat(install, $docsify.plugins); - -}()); diff --git a/lib/plugins/front-matter.min.js b/lib/plugins/front-matter.min.js deleted file mode 100644 index 32f3a13..0000000 --- a/lib/plugins/front-matter.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(){var b=[],y=[],t=0,R={regLevel:new RegExp("^([\\s\\-]+)"),invalidLine:new RegExp("^\\-\\-\\-|^\\.\\.\\.|^\\s*#.*|^\\s*$"),dashesString:new RegExp('^\\s*\\"([^\\"]*)\\"\\s*$'),quotesString:new RegExp("^\\s*\\'([^\\']*)\\'\\s*$"),float:new RegExp("^[+-]?[0-9]+\\.[0-9]+(e[+-]?[0-9]+(\\.[0-9]+)?)?$"),integer:new RegExp("^[+-]?[0-9]+$"),array:new RegExp("\\[\\s*(.*)\\s*\\]"),map:new RegExp("\\{\\s*(.*)\\s*\\}"),key_value:new RegExp("([a-z0-9_-][ a-z0-9_-]*):( .+)","i"),single_key_value:new RegExp("^([a-z0-9_-][ a-z0-9_-]*):( .+?)$","i"),key:new RegExp("([a-z0-9_-][ a-z0-9_-]+):( .+)?","i"),item:new RegExp("^-\\s+"),trim:new RegExp("^\\s+|\\s+$"),comment:new RegExp("([^\\'\\\"#]+([\\'\\\"][^\\'\\\"]*[\\'\\\"])*)*(#.*)?")};function m(e){return{parent:null,length:0,level:e,lines:[],children:[],addChild:function(e){this.children.push(e),++(e.parent=this).length}}}function N(e){var n=null;if("true"==(e=e.replace(R.trim,"")))return!0;if("false"==e)return!1;if(".NaN"==e)return Number.NaN;if("null"==e)return null;if(".inf"==e)return Number.POSITIVE_INFINITY;if("-.inf"==e)return Number.NEGATIVE_INFINITY;if(n=e.match(R.dashesString))return n[1];if(n=e.match(R.quotesString))return n[1];if(n=e.match(R.float))return parseFloat(n[0]);if(n=e.match(R.integer))return parseInt(n[0]);if(isNaN(n=Date.parse(e))){if(n=e.match(R.single_key_value))return(i={})[n[1]]=N(n[2]),i;if(n=e.match(R.array)){for(var t=0,r=" ",i=[],l="",u=!1,a=0,s=n[1].length;a"==d[0]?null!=u?u[v]=_(l.shift()):r[v]=_(l.shift()):null!=u?u[v]=N(d):r[v]=N(d)}else null!=u?u[v]=e(l):r[v]=e(l)}else{if(g.match(/^-\s*$/)){f&&(f=!1,void 0===r.length&&(r=[])),null!=u&&r.push(u),u={},f=!0;continue}if(t=g.match(/^-\s*(.*)/)){null!=u?u.push(N(t[1])):(f&&(f=!1,void 0===r.length&&(r=[])),r.push(N(t[1])));continue}}}null!=u&&(f&&(f=!1,void 0===r.length&&(r=[])),r.push(u))}for(h=s.length-1;0<=h;--h)n.splice.call(n,s[h],1);return r}(e.children)}function l(e){b=[],y=[],t=(new Date).getTime();var n=r(function(e){var n,t=R.regLevel,r=R.invalidLine,i=e.split("\n"),l=0,u=0,a=[],s=new m(-1),f=new m(0);s.addChild(f);var h=[],o="";a.push(f),h.push(l);for(var c=0,p=i.length;c': '>', - '"': '"', - '\'': ''', - '/': '/' - }; - - return String(string).replace(/[&<>"'/]/g, function (s) { return entityMap[s]; }) -} - -function getAllPaths(router) { - var paths = []; - - Docsify.dom.findAll('.sidebar-nav a:not(.section-link):not([data-nosearch])').forEach(function (node) { - var href = node.href; - var originHref = node.getAttribute('href'); - var path = router.parse(href).path; - - if ( - path && - paths.indexOf(path) === -1 && - !Docsify.util.isAbsolutePath(originHref) - ) { - paths.push(path); - } - }); - - return paths -} - -function saveData(maxAge, expireKey, indexKey) { - localStorage.setItem(expireKey, Date.now() + maxAge); - localStorage.setItem(indexKey, JSON.stringify(INDEXS)); -} - -function genIndex(path, content, router, depth) { - if ( content === void 0 ) content = ''; - - var tokens = window.marked.lexer(content); - var slugify = window.Docsify.slugify; - var index = {}; - var slug; - - tokens.forEach(function (token) { - if (token.type === 'heading' && token.depth <= depth) { - slug = router.toURL(path, {id: slugify(token.text)}); - index[slug] = {slug: slug, title: token.text, body: ''}; - } else { - if (!slug) { - return - } - if (!index[slug]) { - index[slug] = {slug: slug, title: '', body: ''}; - } else if (index[slug].body) { - index[slug].body += '\n' + (token.text || ''); - } else { - index[slug].body = token.text; - } - } - }); - slugify.clear(); - return index -} - -/** - * @param {String} query - * @returns {Array} - */ -function search(query) { - var matchingResults = []; - var data = []; - Object.keys(INDEXS).forEach(function (key) { - data = data.concat(Object.keys(INDEXS[key]).map(function (page) { return INDEXS[key][page]; })); - }); - - query = query.trim(); - var keywords = query.split(/[\s\-,\\/]+/); - if (keywords.length !== 1) { - keywords = [].concat(query, keywords); - } - - var loop = function ( i ) { - var post = data[i]; - var isMatch = false; - var resultStr = ''; - var postTitle = post.title && post.title.trim(); - var postContent = post.body && post.body.trim(); - var postUrl = post.slug || ''; - - if (postTitle && postContent) { - keywords.forEach(function (keyword) { - // From https://github.com/sindresorhus/escape-string-regexp - var regEx = new RegExp( - keyword.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&'), - 'gi' - ); - var indexTitle = -1; - var indexContent = -1; - - indexTitle = postTitle && postTitle.search(regEx); - indexContent = postContent && postContent.search(regEx); - - if (indexTitle < 0 && indexContent < 0) { - isMatch = false; - } else { - isMatch = true; - if (indexContent < 0) { - indexContent = 0; - } - - var start = 0; - var end = 0; - - start = indexContent < 11 ? 0 : indexContent - 10; - end = start === 0 ? 70 : indexContent + keyword.length + 60; - - if (end > postContent.length) { - end = postContent.length; - } - - var matchContent = - '...' + - escapeHtml(postContent) - .substring(start, end) - .replace(regEx, ("" + keyword + "")) + - '...'; - - resultStr += matchContent; - } - }); - - if (isMatch) { - var matchingPost = { - title: escapeHtml(postTitle), - content: resultStr, - url: postUrl - }; - - matchingResults.push(matchingPost); - } - } - }; - - for (var i = 0; i < data.length; i++) loop( i ); - - return matchingResults -} - -function init$1(config, vm) { - var isAuto = config.paths === 'auto'; - - var expireKey = resolveExpireKey(config.namespace); - var indexKey = resolveIndexKey(config.namespace); - - var isExpired = localStorage.getItem(expireKey) < Date.now(); - - INDEXS = JSON.parse(localStorage.getItem(indexKey)); - - if (isExpired) { - INDEXS = {}; - } else if (!isAuto) { - return - } - - var paths = isAuto ? getAllPaths(vm.router) : config.paths; - var len = paths.length; - var count = 0; - - paths.forEach(function (path) { - if (INDEXS[path]) { - return count++ - } - - Docsify - .get(vm.router.getFile(path), false, vm.config.requestHeaders) - .then(function (result) { - INDEXS[path] = genIndex(path, result, vm.router, config.depth); - len === ++count && saveData(config.maxAge, expireKey, indexKey); - }); - }); -} - -var NO_DATA_TEXT = ''; -var options; - -function style() { - var code = "\n.sidebar {\n padding-top: 0;\n}\n\n.search {\n margin-bottom: 20px;\n padding: 6px;\n border-bottom: 1px solid #eee;\n}\n\n.search .input-wrap {\n display: flex;\n align-items: center;\n}\n\n.search .results-panel {\n display: none;\n}\n\n.search .results-panel.show {\n display: block;\n}\n\n.search input {\n outline: none;\n border: none;\n width: 100%;\n padding: 0 7px;\n line-height: 36px;\n font-size: 14px;\n}\n\n.search input::-webkit-search-decoration,\n.search input::-webkit-search-cancel-button,\n.search input {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n.search .clear-button {\n width: 36px;\n text-align: right;\n display: none;\n}\n\n.search .clear-button.show {\n display: block;\n}\n\n.search .clear-button svg {\n transform: scale(.5);\n}\n\n.search h2 {\n font-size: 17px;\n margin: 10px 0;\n}\n\n.search a {\n text-decoration: none;\n color: inherit;\n}\n\n.search .matching-post {\n border-bottom: 1px solid #eee;\n}\n\n.search .matching-post:last-child {\n border-bottom: 0;\n}\n\n.search p {\n font-size: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n\n.search p.empty {\n text-align: center;\n}\n\n.app-name.hide, .sidebar-nav.hide {\n display: none;\n}"; - - Docsify.dom.style(code); -} - -function tpl(defaultValue) { - if ( defaultValue === void 0 ) defaultValue = ''; - - var html = - "
    \n \n
    \n \n \n \n \n \n
    \n
    \n
    \n "; - var el = Docsify.dom.create('div', html); - var aside = Docsify.dom.find('aside'); - - Docsify.dom.toggleClass(el, 'search'); - Docsify.dom.before(aside, el); -} - -function doSearch(value) { - var $search = Docsify.dom.find('div.search'); - var $panel = Docsify.dom.find($search, '.results-panel'); - var $clearBtn = Docsify.dom.find($search, '.clear-button'); - var $sidebarNav = Docsify.dom.find('.sidebar-nav'); - var $appName = Docsify.dom.find('.app-name'); - - if (!value) { - $panel.classList.remove('show'); - $clearBtn.classList.remove('show'); - $panel.innerHTML = ''; - - if (options.hideOtherSidebarContent) { - $sidebarNav.classList.remove('hide'); - $appName.classList.remove('hide'); - } - return - } - var matchs = search(value); - - var html = ''; - matchs.forEach(function (post) { - html += ""; - }); - - $panel.classList.add('show'); - $clearBtn.classList.add('show'); - $panel.innerHTML = html || ("

    " + NO_DATA_TEXT + "

    "); - if (options.hideOtherSidebarContent) { - $sidebarNav.classList.add('hide'); - $appName.classList.add('hide'); - } -} - -function bindEvents() { - var $search = Docsify.dom.find('div.search'); - var $input = Docsify.dom.find($search, 'input'); - var $inputWrap = Docsify.dom.find($search, '.input-wrap'); - - var timeId; - // Prevent to Fold sidebar - Docsify.dom.on( - $search, - 'click', - function (e) { return e.target.tagName !== 'A' && e.stopPropagation(); } - ); - Docsify.dom.on($input, 'input', function (e) { - clearTimeout(timeId); - timeId = setTimeout(function (_) { return doSearch(e.target.value.trim()); }, 100); - }); - Docsify.dom.on($inputWrap, 'click', function (e) { - // Click input outside - if (e.target.tagName !== 'INPUT') { - $input.value = ''; - doSearch(); - } - }); -} - -function updatePlaceholder(text, path) { - var $input = Docsify.dom.getNode('.search input[type="search"]'); - - if (!$input) { - return - } - if (typeof text === 'string') { - $input.placeholder = text; - } else { - var match = Object.keys(text).filter(function (key) { return path.indexOf(key) > -1; })[0]; - $input.placeholder = text[match]; - } -} - -function updateNoData(text, path) { - if (typeof text === 'string') { - NO_DATA_TEXT = text; - } else { - var match = Object.keys(text).filter(function (key) { return path.indexOf(key) > -1; })[0]; - NO_DATA_TEXT = text[match]; - } -} - -function updateOptions(opts) { - options = opts; -} - -function init(opts, vm) { - var keywords = vm.router.parse().query.s; - - updateOptions(opts); - style(); - tpl(keywords); - bindEvents(); - keywords && setTimeout(function (_) { return doSearch(keywords); }, 500); -} - -function update(opts, vm) { - updateOptions(opts); - updatePlaceholder(opts.placeholder, vm.route.path); - updateNoData(opts.noData, vm.route.path); -} - -var CONFIG = { - placeholder: 'Type to search', - noData: 'No Results!', - paths: 'auto', - depth: 2, - maxAge: 86400000, // 1 day - hideOtherSidebarContent: false, - namespace: undefined -}; - -var install = function (hook, vm) { - var util = Docsify.util; - var opts = vm.config.search || CONFIG; - - if (Array.isArray(opts)) { - CONFIG.paths = opts; - } else if (typeof opts === 'object') { - CONFIG.paths = Array.isArray(opts.paths) ? opts.paths : 'auto'; - CONFIG.maxAge = util.isPrimitive(opts.maxAge) ? opts.maxAge : CONFIG.maxAge; - CONFIG.placeholder = opts.placeholder || CONFIG.placeholder; - CONFIG.noData = opts.noData || CONFIG.noData; - CONFIG.depth = opts.depth || CONFIG.depth; - CONFIG.hideOtherSidebarContent = opts.hideOtherSidebarContent || CONFIG.hideOtherSidebarContent; - CONFIG.namespace = opts.namespace || CONFIG.namespace; - } - - var isAuto = CONFIG.paths === 'auto'; - - hook.mounted(function (_) { - init(CONFIG, vm); - !isAuto && init$1(CONFIG, vm); - }); - hook.doneEach(function (_) { - update(CONFIG, vm); - isAuto && init$1(CONFIG, vm); - }); -}; - -$docsify.plugins = [].concat(install, $docsify.plugins); - -}()); diff --git a/lib/plugins/search.min.js b/lib/plugins/search.min.js deleted file mode 100644 index 14d5be2..0000000 --- a/lib/plugins/search.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(){var f={},u={EXPIRE_KEY:"docsify.search.expires",INDEX_KEY:"docsify.search.index"};function h(e){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(e).replace(/[&<>"'/]/g,function(e){return n[e]})}function o(o,r){var e,n,t="auto"===o.paths,s=(e=o.namespace)?u.EXPIRE_KEY+"/"+e:u.EXPIRE_KEY,c=(n=o.namespace)?u.INDEX_KEY+"/"+n:u.INDEX_KEY,a=localStorage.getItem(s)l.length&&(o=l.length);var r="..."+h(l).substring(i,o).replace(t,''+e+"")+"...";c+=r}}),s)){var a={title:h(d),content:c,url:t};i.push(a)}},t=0;t\n

    '+e.title+"

    \n

    "+e.content+"

    \n\n"}),t.classList.add("show"),a.classList.add("show"),t.innerHTML=s||'

    '+d+"

    ",c.hideOtherSidebarContent&&(i.classList.add("hide"),o.classList.add("hide"))}function l(e){c=e}function r(e,n){var t,a,i,o,r=n.router.parse().query.s;l(e),Docsify.dom.style("\n.sidebar {\n padding-top: 0;\n}\n\n.search {\n margin-bottom: 20px;\n padding: 6px;\n border-bottom: 1px solid #eee;\n}\n\n.search .input-wrap {\n display: flex;\n align-items: center;\n}\n\n.search .results-panel {\n display: none;\n}\n\n.search .results-panel.show {\n display: block;\n}\n\n.search input {\n outline: none;\n border: none;\n width: 100%;\n padding: 0 7px;\n line-height: 36px;\n font-size: 14px;\n}\n\n.search input::-webkit-search-decoration,\n.search input::-webkit-search-cancel-button,\n.search input {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n.search .clear-button {\n width: 36px;\n text-align: right;\n display: none;\n}\n\n.search .clear-button.show {\n display: block;\n}\n\n.search .clear-button svg {\n transform: scale(.5);\n}\n\n.search h2 {\n font-size: 17px;\n margin: 10px 0;\n}\n\n.search a {\n text-decoration: none;\n color: inherit;\n}\n\n.search .matching-post {\n border-bottom: 1px solid #eee;\n}\n\n.search .matching-post:last-child {\n border-bottom: 0;\n}\n\n.search p {\n font-size: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n\n.search p.empty {\n text-align: center;\n}\n\n.app-name.hide, .sidebar-nav.hide {\n display: none;\n}"),function(e){void 0===e&&(e="");var n='
    \n \n
    \n \n \n \n \n \n
    \n
    \n
    \n ',t=Docsify.dom.create("div",n),a=Docsify.dom.find("aside");Docsify.dom.toggleClass(t,"search"),Docsify.dom.before(a,t)}(r),a=Docsify.dom.find("div.search"),i=Docsify.dom.find(a,"input"),o=Docsify.dom.find(a,".input-wrap"),Docsify.dom.on(a,"click",function(e){return"A"!==e.target.tagName&&e.stopPropagation()}),Docsify.dom.on(i,"input",function(n){clearTimeout(t),t=setTimeout(function(e){return s(n.target.value.trim())},100)}),Docsify.dom.on(o,"click",function(e){"INPUT"!==e.target.tagName&&(i.value="",s())}),r&&setTimeout(function(e){return s(r)},500)}function p(e,n){l(e),function(e,n){var t=Docsify.dom.getNode('.search input[type="search"]');if(t)if("string"==typeof e)t.placeholder=e;else{var a=Object.keys(e).filter(function(e){return-1w.scrollOffset&&o(150);}},u=function(a){-1E.scrollOffset&&p(150)}},z=function(e){-1nav,body:not(.ready) [data-cloak]{display:none}div#app{font-size:30px;font-weight:lighter;margin:40vh auto;text-align:center}div#app:empty:before{content:"Loading..."}.emoji{height:1.2rem;vertical-align:middle}.progress{background-color:var(--theme-color,#0074d9);height:2px;left:0;position:fixed;right:0;top:0;transition:width .2s,opacity .4s;width:0;z-index:5}.search .search-keyword,.search a:hover{color:var(--theme-color,#0074d9)}.search .search-keyword{font-style:normal;font-weight:700}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:#34495e;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0;overflow-x:hidden}img{max-width:100%}a[disabled]{cursor:not-allowed;opacity:.6}kbd{border:1px solid #ccc;border-radius:3px;display:inline-block;font-size:12px!important;line-height:12px;margin-bottom:3px;padding:3px 5px;vertical-align:middle}li input[type=checkbox]{margin:0 .2em .25em 0;vertical-align:middle}.app-nav{margin:25px 60px 0 0;position:absolute;right:0;text-align:right;z-index:2}.app-nav.no-badge{margin-right:25px}.app-nav p{margin:0}.app-nav>a{margin:0 1rem;padding:5px 0}.app-nav li,.app-nav ul{display:inline-block;list-style:none;margin:0}.app-nav a{color:inherit;font-size:16px;text-decoration:none;transition:color .3s}.app-nav a.active,.app-nav a:hover{color:var(--theme-color,#0074d9)}.app-nav a.active{border-bottom:2px solid var(--theme-color,#0074d9)}.app-nav li{display:inline-block;margin:0 1rem;padding:5px 0;position:relative}.app-nav li ul{background-color:#fff;border:1px solid #ddd;border-bottom-color:#ccc;border-radius:4px;box-sizing:border-box;display:none;max-height:calc(100vh - 61px);overflow-y:auto;padding:10px 0;position:absolute;right:-15px;text-align:left;top:100%;white-space:nowrap}.app-nav li ul li{display:block;font-size:14px;line-height:1rem;margin:0;margin:8px 14px;white-space:nowrap}.app-nav li ul a{display:block;font-size:inherit;margin:0;padding:0}.app-nav li ul a.active{border-bottom:0}.app-nav li:hover ul{display:block}.github-corner{border-bottom:0;position:fixed;right:0;text-decoration:none;top:0;z-index:1}.github-corner:hover .octo-arm{animation:a .56s ease-in-out}.github-corner svg{color:#fff;fill:var(--theme-color,#0074d9);height:80px;width:80px}main{display:block;position:relative;width:100vw;height:100%;z-index:0}main.hidden{display:none}.anchor{display:inline-block;text-decoration:none;transition:all .3s}.anchor span{color:#34495e}.anchor:hover{text-decoration:underline}.sidebar{border-right:1px solid rgba(0,0,0,.07);overflow-y:auto;padding:40px 0 0;position:absolute;top:0;bottom:0;left:0;transition:transform .25s ease-out;width:16rem;z-index:3}.sidebar>h1{margin:0 auto 1rem;font-size:1.5rem;font-weight:300;text-align:center}.sidebar>h1 a{color:inherit;text-decoration:none}.sidebar>h1 .app-nav{display:block;position:static}.sidebar .sidebar-nav{line-height:2em;padding-bottom:40px}.sidebar li.collapse .app-sub-sidebar{display:none}.sidebar ul{margin:0 0 0 15px;padding:0}.sidebar li>p{font-weight:700;margin:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{border-bottom:none;display:block}.sidebar ul li ul{padding-left:20px}.sidebar::-webkit-scrollbar{width:4px}.sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}.sidebar:hover::-webkit-scrollbar-thumb{background:hsla(0,0%,53%,.4)}.sidebar:hover::-webkit-scrollbar-track{background:hsla(0,0%,53%,.1)}.sidebar-toggle{background-color:transparent;background-color:hsla(0,0%,100%,.8);border:0;outline:none;padding:10px;position:absolute;bottom:0;left:0;text-align:center;transition:opacity .3s;width:0;z-index:4}.sidebar-toggle .sidebar-toggle-button:hover{opacity:.4}.sidebar-toggle span{background-color:var(--theme-color,#0074d9);display:block;margin-bottom:4px;width:16px;height:2px}body.sticky .sidebar,body.sticky .sidebar-toggle{position:fixed}.content{padding-top:60px;position:absolute;top:0;right:0;bottom:0;left:16rem;transition:left .25s ease}.markdown-section{margin:0 auto;max-width:800px;padding:30px 15px 40px;position:relative}.markdown-section>*{box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}.markdown-section hr{border:none;border-bottom:1px solid #eee;margin:2em 0}.markdown-section iframe{border:1px solid #eee;width:1px;min-width:100%}.markdown-section table{border-collapse:collapse;border-spacing:0;display:block;margin-bottom:1rem;overflow:auto;width:100%}.markdown-section th{font-weight:700}.markdown-section td,.markdown-section th{border:1px solid #ddd;padding:6px 13px}.markdown-section tr{border-top:1px solid #ccc}.markdown-section p.tip,.markdown-section tr:nth-child(2n){background-color:#f8f8f8}.markdown-section p.tip{border-bottom-right-radius:2px;border-left:4px solid #f66;border-top-right-radius:2px;margin:2em 0;padding:12px 24px 12px 30px;position:relative}.markdown-section p.tip:before{background-color:#f66;border-radius:100%;color:#fff;content:"!";font-family:Dosis,Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:14px;font-weight:700;left:-12px;line-height:20px;position:absolute;height:20px;width:20px;text-align:center;top:14px}.markdown-section p.tip code{background-color:#efefef}.markdown-section p.tip em{color:#34495e}.markdown-section p.warn{background:rgba(0,116,217,.1);border-radius:2px;padding:1rem}.markdown-section ul.task-list>li{list-style-type:none}body.close .sidebar{transform:translateX(-16rem)}body.close .sidebar-toggle{width:auto}body.close .content{left:0}@media print{.app-nav,.github-corner,.sidebar,.sidebar-toggle{display:none}}@media screen and (max-width:768px){.github-corner,.sidebar,.sidebar-toggle{position:fixed}.app-nav{margin-top:16px}.app-nav li ul{top:30px}main{height:auto;overflow-x:hidden}.sidebar{left:-16rem;transition:transform .25s ease-out}.content{left:0;max-width:100vw;position:static;padding-top:20px;transition:transform .25s ease}.app-nav,.github-corner{transition:transform .25s ease-out}.sidebar-toggle{background-color:transparent;width:auto;padding:30px 30px 10px 10px}body.close .sidebar{transform:translateX(16rem)}body.close .sidebar-toggle{background-color:hsla(0,0%,100%,.8);transition:background-color 1s;width:0;padding:10px}body.close .content{transform:translateX(16rem)}body.close .app-nav,body.close .github-corner{display:none}.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:a .56s ease-in-out}}@keyframes a{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}section.cover{-ms-flex-align:center;align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;height:100vh;display:none}section.cover.show{display:-ms-flexbox;display:flex}section.cover.has-mask .mask{background-color:#fff;opacity:.8;position:absolute;top:0;height:100%;width:100%}section.cover .cover-main{-ms-flex:1;flex:1;margin:-20px 16px 0;text-align:center;z-index:1}section.cover a{color:inherit}section.cover a,section.cover a:hover{text-decoration:none}section.cover p{line-height:1.5rem;margin:1em 0}section.cover h1{color:inherit;font-size:2.5rem;font-weight:300;margin:.625rem 0 2.5rem;position:relative;text-align:center}section.cover h1 a{display:block}section.cover h1 small{bottom:-.4375rem;font-size:1rem;position:absolute}section.cover blockquote{font-size:1.5rem;text-align:center}section.cover ul{line-height:1.8;list-style-type:none;margin:1em auto;max-width:500px;padding:0}section.cover .cover-main>p:last-child a{border:1px solid var(--theme-color,#0074d9);border-radius:2rem;box-sizing:border-box;color:var(--theme-color,#0074d9);display:inline-block;font-size:1.05rem;letter-spacing:.1rem;margin:.5rem 1rem;padding:.75em 2rem;text-decoration:none;transition:all .15s ease}section.cover .cover-main>p:last-child a:last-child{background-color:var(--theme-color,#0074d9);color:#fff}section.cover .cover-main>p:last-child a:last-child:hover{color:inherit;opacity:.8}section.cover .cover-main>p:last-child a:hover{color:inherit}section.cover blockquote>p>a{border-bottom:2px solid var(--theme-color,#0074d9);transition:color .3s}section.cover blockquote>p>a:hover{color:var(--theme-color,#0074d9)}.sidebar{color:#364149;background-color:#fff}.sidebar a{color:#666;text-decoration:none}.sidebar li{list-style:none;margin:0;padding:.2em 0}.sidebar ul li ul{padding:0}.sidebar li.active{background-color:#eee}.sidebar li.active a{color:#333}.markdown-section h1,.markdown-section h2,.markdown-section h3,.markdown-section h4,.markdown-section strong{color:#333;font-weight:400}.markdown-section a{color:var(--theme-color,#0074d9);font-weight:400}.markdown-section ol,.markdown-section p,.markdown-section ul{line-height:1.6rem;margin:0 0 1em;word-spacing:.05rem}.markdown-section h1{font-size:2rem;font-weight:500;margin:0 0 1rem}.markdown-section h2{font-size:1.8rem;font-weight:400;margin:0 0 1rem;padding:1rem 0 0}.markdown-section h3{font-size:1.5rem;margin:52px 0 1.2rem}.markdown-section h4{font-size:1.25rem}.markdown-section h5{font-size:1rem}.markdown-section h6{color:#777;font-size:1rem}.markdown-section figure,.markdown-section ol,.markdown-section p,.markdown-section ul{margin:1.2em 0}.markdown-section ol,.markdown-section ul{padding-left:1.5rem}.markdown-section li{line-height:1.5;margin:0}.markdown-section blockquote{border-left:4px solid var(--theme-color,#0074d9);color:#858585;margin:2em 0;padding-left:20px}.markdown-section blockquote p{font-weight:600;margin-left:0}.markdown-section iframe{margin:1em 0}.markdown-section em{color:#7f8c8d}.markdown-section code{border-radius:3px;padding:.2em .4rem;white-space:nowrap}.markdown-section code,.markdown-section pre{background-color:#f9f9f9;font-family:Inconsolata}.markdown-section pre{border-left:2px solid #eee;font-size:16px;margin:0 0 1em;padding:8px;padding:0 10px 12px 0;overflow:auto;word-wrap:normal;position:relative}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#93a1a1}.token.punctuation{color:#586e75}.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#268bd2}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string,.token.url{color:#2aa198}.token.entity{color:#657b83;background:#eee8d5}.token.atrule,.token.attr-value,.token.keyword{color:#a11}.token.function{color:#b58900}.token.important,.token.regex,.token.variable{color:#cb4b16}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.markdown-section pre>code{background-color:#f8f8f8;border-radius:2px;display:block;font-family:Inconsolata;line-height:1.1rem;max-width:inherit;overflow:inherit;padding:20px .8em;position:relative;white-space:inherit}.markdown-section code:after,.markdown-section code:before{letter-spacing:.05rem}code .token{-webkit-font-smoothing:initial;-moz-osx-font-smoothing:initial;min-height:1.5rem} \ No newline at end of file diff --git a/lib/themes/dark.css b/lib/themes/dark.css deleted file mode 100644 index 112d926..0000000 --- a/lib/themes/dark.css +++ /dev/null @@ -1 +0,0 @@ -@import url("https://fonts.googleapis.com/css?family=Roboto+Mono|Source+Sans+Pro:300,400,600");*{-webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:none;-webkit-touch-callout:none;box-sizing:border-box}body:not(.ready){overflow:hidden}body:not(.ready) .app-nav,body:not(.ready)>nav,body:not(.ready) [data-cloak]{display:none}div#app{font-size:30px;font-weight:lighter;margin:40vh auto;text-align:center}div#app:empty:before{content:"Loading..."}.emoji{height:1.2rem;vertical-align:middle}.progress{background-color:var(--theme-color,#ea6f5a);height:2px;left:0;position:fixed;right:0;top:0;transition:width .2s,opacity .4s;width:0;z-index:5}.search .search-keyword,.search a:hover{color:var(--theme-color,#ea6f5a)}.search .search-keyword{font-style:normal;font-weight:700}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:#c8c8c8;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0;overflow-x:hidden}img{max-width:100%}a[disabled]{cursor:not-allowed;opacity:.6}kbd{border:1px solid #ccc;border-radius:3px;display:inline-block;font-size:12px!important;line-height:12px;margin-bottom:3px;padding:3px 5px;vertical-align:middle}li input[type=checkbox]{margin:0 .2em .25em 0;vertical-align:middle}.app-nav{margin:25px 60px 0 0;position:absolute;right:0;text-align:right;z-index:2}.app-nav.no-badge{margin-right:25px}.app-nav p{margin:0}.app-nav>a{margin:0 1rem;padding:5px 0}.app-nav li,.app-nav ul{display:inline-block;list-style:none;margin:0}.app-nav a{color:inherit;font-size:16px;text-decoration:none;transition:color .3s}.app-nav a.active,.app-nav a:hover{color:var(--theme-color,#ea6f5a)}.app-nav a.active{border-bottom:2px solid var(--theme-color,#ea6f5a)}.app-nav li{display:inline-block;margin:0 1rem;padding:5px 0;position:relative}.app-nav li ul{background-color:#fff;border:1px solid #ddd;border-bottom-color:#ccc;border-radius:4px;box-sizing:border-box;display:none;max-height:calc(100vh - 61px);overflow-y:auto;padding:10px 0;position:absolute;right:-15px;text-align:left;top:100%;white-space:nowrap}.app-nav li ul li{display:block;font-size:14px;line-height:1rem;margin:0;margin:8px 14px;white-space:nowrap}.app-nav li ul a{display:block;font-size:inherit;margin:0;padding:0}.app-nav li ul a.active{border-bottom:0}.app-nav li:hover ul{display:block}.github-corner{border-bottom:0;position:fixed;right:0;text-decoration:none;top:0;z-index:1}.github-corner:hover .octo-arm{animation:a .56s ease-in-out}.github-corner svg{color:#3f3f3f;fill:var(--theme-color,#ea6f5a);height:80px;width:80px}main{display:block;position:relative;width:100vw;height:100%;z-index:0}main.hidden{display:none}.anchor{display:inline-block;text-decoration:none;transition:all .3s}.anchor span{color:#c8c8c8}.anchor:hover{text-decoration:underline}.sidebar{border-right:1px solid rgba(0,0,0,.07);overflow-y:auto;padding:40px 0 0;position:absolute;top:0;bottom:0;left:0;transition:transform .25s ease-out;width:300px;z-index:3}.sidebar>h1{margin:0 auto 1rem;font-size:1.5rem;font-weight:300;text-align:center}.sidebar>h1 a{color:inherit;text-decoration:none}.sidebar>h1 .app-nav{display:block;position:static}.sidebar .sidebar-nav{line-height:2em;padding-bottom:40px}.sidebar li.collapse .app-sub-sidebar{display:none}.sidebar ul{margin:0 0 0 15px;padding:0}.sidebar li>p{font-weight:700;margin:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{border-bottom:none;display:block}.sidebar ul li ul{padding-left:20px}.sidebar::-webkit-scrollbar{width:4px}.sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}.sidebar:hover::-webkit-scrollbar-thumb{background:hsla(0,0%,53%,.4)}.sidebar:hover::-webkit-scrollbar-track{background:hsla(0,0%,53%,.1)}.sidebar-toggle{background-color:transparent;background-color:rgba(63,63,63,.8);border:0;outline:none;padding:10px;position:absolute;bottom:0;left:0;text-align:center;transition:opacity .3s;width:284px;z-index:4}.sidebar-toggle .sidebar-toggle-button:hover{opacity:.4}.sidebar-toggle span{background-color:var(--theme-color,#ea6f5a);display:block;margin-bottom:4px;width:16px;height:2px}body.sticky .sidebar,body.sticky .sidebar-toggle{position:fixed}.content{padding-top:60px;position:absolute;top:0;right:0;bottom:0;left:300px;transition:left .25s ease}.markdown-section{margin:0 auto;max-width:800px;padding:30px 15px 40px;position:relative}.markdown-section>*{box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}.markdown-section hr{border:none;border-bottom:1px solid #eee;margin:2em 0}.markdown-section iframe{border:1px solid #eee;width:1px;min-width:100%}.markdown-section table{border-collapse:collapse;border-spacing:0;display:block;margin-bottom:1rem;overflow:auto;width:100%}.markdown-section th{font-weight:700}.markdown-section td,.markdown-section th{border:1px solid #ddd;padding:6px 13px}.markdown-section tr{border-top:1px solid #ccc}.markdown-section p.tip,.markdown-section tr:nth-child(2n){background-color:#f8f8f8}.markdown-section p.tip{border-bottom-right-radius:2px;border-left:4px solid #f66;border-top-right-radius:2px;margin:2em 0;padding:12px 24px 12px 30px;position:relative}.markdown-section p.tip:before{background-color:#f66;border-radius:100%;color:#3f3f3f;content:"!";font-family:Dosis,Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:14px;font-weight:700;left:-12px;line-height:20px;position:absolute;height:20px;width:20px;text-align:center;top:14px}.markdown-section p.tip code{background-color:#efefef}.markdown-section p.tip em{color:#c8c8c8}.markdown-section p.warn{background:hsla(9,77%,64%,.1);border-radius:2px;padding:1rem}.markdown-section ul.task-list>li{list-style-type:none}body.close .sidebar{transform:translateX(-300px)}body.close .sidebar-toggle{width:auto}body.close .content{left:0}@media print{.app-nav,.github-corner,.sidebar,.sidebar-toggle{display:none}}@media screen and (max-width:768px){.github-corner,.sidebar,.sidebar-toggle{position:fixed}.app-nav{margin-top:16px}.app-nav li ul{top:30px}main{height:auto;overflow-x:hidden}.sidebar{left:-300px;transition:transform .25s ease-out}.content{left:0;max-width:100vw;position:static;padding-top:20px;transition:transform .25s ease}.app-nav,.github-corner{transition:transform .25s ease-out}.sidebar-toggle{background-color:transparent;width:auto;padding:30px 30px 10px 10px}body.close .sidebar{transform:translateX(300px)}body.close .sidebar-toggle{background-color:rgba(63,63,63,.8);transition:background-color 1s;width:284px;padding:10px}body.close .content{transform:translateX(300px)}body.close .app-nav,body.close .github-corner{display:none}.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:a .56s ease-in-out}}@keyframes a{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}section.cover{-ms-flex-align:center;align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;height:100vh;display:none}section.cover.show{display:-ms-flexbox;display:flex}section.cover.has-mask .mask{background-color:#3f3f3f;opacity:.8;position:absolute;top:0;height:100%;width:100%}section.cover .cover-main{-ms-flex:1;flex:1;margin:-20px 16px 0;text-align:center;z-index:1}section.cover a{color:inherit}section.cover a,section.cover a:hover{text-decoration:none}section.cover p{line-height:1.5rem;margin:1em 0}section.cover h1{color:inherit;font-size:2.5rem;font-weight:300;margin:.625rem 0 2.5rem;position:relative;text-align:center}section.cover h1 a{display:block}section.cover h1 small{bottom:-.4375rem;font-size:1rem;position:absolute}section.cover blockquote{font-size:1.5rem;text-align:center}section.cover ul{line-height:1.8;list-style-type:none;margin:1em auto;max-width:500px;padding:0}section.cover .cover-main>p:last-child a{border:1px solid var(--theme-color,#ea6f5a);border-radius:2rem;box-sizing:border-box;color:var(--theme-color,#ea6f5a);display:inline-block;font-size:1.05rem;letter-spacing:.1rem;margin:.5rem 1rem;padding:.75em 2rem;text-decoration:none;transition:all .15s ease}section.cover .cover-main>p:last-child a:last-child{background-color:var(--theme-color,#ea6f5a);color:#fff}section.cover .cover-main>p:last-child a:last-child:hover{color:inherit;opacity:.8}section.cover .cover-main>p:last-child a:hover{color:inherit}section.cover blockquote>p>a{border-bottom:2px solid var(--theme-color,#ea6f5a);transition:color .3s}section.cover blockquote>p>a:hover{color:var(--theme-color,#ea6f5a)}.sidebar,body{background-color:#3f3f3f}.sidebar{color:#c8c8c8}.sidebar li{margin:6px 15px 6px 0}.sidebar ul li a{color:#c8c8c8;font-size:14px;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.sidebar ul li a:hover{text-decoration:underline}.sidebar ul li ul{padding:0}.sidebar ul li.active>a{color:var(--theme-color,#ea6f5a);font-weight:600}.markdown-section h1,.markdown-section h2,.markdown-section h3,.markdown-section h4,.markdown-section strong{color:#657b83;font-weight:600}.markdown-section a{color:var(--theme-color,#ea6f5a);font-weight:600}.markdown-section h1{font-size:2rem;margin:0 0 1rem}.markdown-section h2{font-size:1.75rem;margin:45px 0 .8rem}.markdown-section h3{font-size:1.5rem;margin:40px 0 .6rem}.markdown-section h4{font-size:1.25rem}.markdown-section h5{font-size:1rem}.markdown-section h6{color:#777;font-size:1rem}.markdown-section figure,.markdown-section ol,.markdown-section p,.markdown-section ul{margin:1.2em 0}.markdown-section ol,.markdown-section p,.markdown-section ul{line-height:1.6rem;word-spacing:.05rem}.markdown-section ol,.markdown-section ul{padding-left:1.5rem}.markdown-section blockquote{border-left:4px solid var(--theme-color,#ea6f5a);color:#858585;margin:2em 0;padding-left:20px}.markdown-section blockquote p{font-weight:600;margin-left:0}.markdown-section iframe{margin:1em 0}.markdown-section em{color:#7f8c8d}.markdown-section code{border-radius:2px;color:#657b83;font-size:.8rem;margin:0 2px;padding:3px 5px;white-space:pre-wrap}.markdown-section code,.markdown-section pre{background-color:#282828;font-family:Roboto Mono,Monaco,courier,monospace}.markdown-section pre{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;line-height:1.5rem;margin:1.2em 0;overflow:auto;padding:0 1.4rem;position:relative;word-wrap:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#8e908c}.token.namespace{opacity:.7}.token.boolean,.token.number{color:#c76b29}.token.punctuation{color:#525252}.token.property{color:#c08b30}.token.tag{color:#2973b7}.token.string{color:var(--theme-color,#ea6f5a)}.token.selector{color:#6679cc}.token.attr-name{color:#2973b7}.language-css .token.string,.style .token.string,.token.entity,.token.url{color:#22a2c9}.token.attr-value,.token.control,.token.directive,.token.unit{color:var(--theme-color,#ea6f5a)}.token.keyword{color:#e96900}.token.atrule,.token.regex,.token.statement{color:#22a2c9}.token.placeholder,.token.variable{color:#3d8fd1}.token.deleted{text-decoration:line-through}.token.inserted{border-bottom:1px dotted #202746;text-decoration:none}.token.italic{font-style:italic}.token.bold,.token.important{font-weight:700}.token.important{color:#c94922}.token.entity{cursor:help}.markdown-section pre>code{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;background-color:#282828;border-radius:2px;color:#657b83;display:block;font-family:Roboto Mono,Monaco,courier,monospace;font-size:.8rem;line-height:inherit;margin:0 2px;max-width:inherit;overflow:inherit;padding:2.2em 5px;white-space:inherit}.markdown-section code:after,.markdown-section code:before{letter-spacing:.05rem}code .token{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;min-height:1.5rem}pre:after{color:#ccc;content:attr(data-lang);font-size:.6rem;font-weight:600;height:15px;line-height:15px;padding:5px 10px 0;position:absolute;right:0;text-align:right;top:0}.markdown-section p.tip{background-color:#282828;color:#657b83}input[type=search]{background:#4f4f4f;border-color:#4f4f4f;color:#c8c8c8} \ No newline at end of file diff --git a/lib/themes/dolphin.css b/lib/themes/dolphin.css deleted file mode 100644 index cecdfb1..0000000 --- a/lib/themes/dolphin.css +++ /dev/null @@ -1 +0,0 @@ -@import url("https://fonts.googleapis.com/css?family=Thasadith:400,400i,700");*{-webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:none;-webkit-touch-callout:none;box-sizing:border-box}body:not(.ready){overflow:hidden}body:not(.ready) .app-nav,body:not(.ready)>nav,body:not(.ready) [data-cloak]{display:none}div#app{font-size:30px;font-weight:lighter;margin:40vh auto;text-align:center}div#app:empty:before{content:"Loading..."}.emoji{height:1.2rem;vertical-align:middle}.progress{background-color:var(--theme-color,#0ff);height:2px;left:0;position:fixed;right:0;top:0;transition:width .2s,opacity .4s;width:0;z-index:5}.search .search-keyword,.search a:hover{color:var(--theme-color,#0ff)}.search .search-keyword{font-style:normal;font-weight:700}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:#34495e;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0;overflow-x:hidden}img{max-width:100%}a[disabled]{cursor:not-allowed;opacity:.6}kbd{border:1px solid #ccc;border-radius:3px;display:inline-block;font-size:12px!important;line-height:12px;margin-bottom:3px;padding:3px 5px;vertical-align:middle}li input[type=checkbox]{margin:0 .2em .25em 0;vertical-align:middle}.app-nav{margin:25px 60px 0 0;position:absolute;right:0;text-align:right;z-index:2}.app-nav.no-badge{margin-right:25px}.app-nav p{margin:0}.app-nav>a{margin:0 1rem;padding:5px 0}.app-nav li,.app-nav ul{display:inline-block;list-style:none;margin:0}.app-nav a{color:inherit;font-size:16px;text-decoration:none;transition:color .3s}.app-nav a.active,.app-nav a:hover{color:var(--theme-color,#0ff)}.app-nav a.active{border-bottom:2px solid var(--theme-color,#0ff)}.app-nav li{display:inline-block;margin:0 1rem;padding:5px 0;position:relative}.app-nav li ul{background-color:#fff;border:1px solid #ddd;border-bottom-color:#ccc;border-radius:4px;box-sizing:border-box;display:none;max-height:calc(100vh - 61px);overflow-y:auto;padding:10px 0;position:absolute;right:-15px;text-align:left;top:100%;white-space:nowrap}.app-nav li ul li{display:block;font-size:14px;line-height:1rem;margin:0;margin:8px 14px;white-space:nowrap}.app-nav li ul a{display:block;font-size:inherit;margin:0;padding:0}.app-nav li ul a.active{border-bottom:0}.app-nav li:hover ul{display:block}.github-corner{border-bottom:0;position:fixed;right:0;text-decoration:none;top:0;z-index:1}.github-corner:hover .octo-arm{animation:a .56s ease-in-out}.github-corner svg{color:azure;fill:var(--theme-color,#0ff);height:80px;width:80px}main{display:block;position:relative;width:100vw;height:100%;z-index:0}main.hidden{display:none}.anchor{display:inline-block;text-decoration:none;transition:all .3s}.anchor span{color:#34495e}.anchor:hover{text-decoration:underline}.sidebar{border-right:1px solid rgba(0,0,0,.07);overflow-y:auto;padding:40px 0 0;position:absolute;top:0;bottom:0;left:0;transition:transform .25s ease-out;width:300px;z-index:3}.sidebar>h1{margin:0 auto 1rem;font-size:1.5rem;font-weight:300;text-align:center}.sidebar>h1 a{color:inherit;text-decoration:none}.sidebar>h1 .app-nav{display:block;position:static}.sidebar .sidebar-nav{line-height:2em;padding-bottom:40px}.sidebar li.collapse .app-sub-sidebar{display:none}.sidebar ul{margin:0 0 0 15px;padding:0}.sidebar li>p{font-weight:700;margin:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{border-bottom:none;display:block}.sidebar ul li ul{padding-left:20px}.sidebar::-webkit-scrollbar{width:4px}.sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}.sidebar:hover::-webkit-scrollbar-thumb{background:hsla(0,0%,53%,.4)}.sidebar:hover::-webkit-scrollbar-track{background:hsla(0,0%,53%,.1)}.sidebar-toggle{background-color:transparent;background-color:rgba(240,255,255,.8);border:0;outline:none;padding:10px;position:absolute;bottom:0;left:0;text-align:center;transition:opacity .3s;width:284px;z-index:4}.sidebar-toggle .sidebar-toggle-button:hover{opacity:.4}.sidebar-toggle span{background-color:var(--theme-color,#0ff);display:block;margin-bottom:4px;width:16px;height:2px}body.sticky .sidebar,body.sticky .sidebar-toggle{position:fixed}.content{padding-top:60px;position:absolute;top:0;right:0;bottom:0;left:300px;transition:left .25s ease}.markdown-section{margin:0 auto;max-width:800px;padding:30px 15px 40px;position:relative}.markdown-section>*{box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}.markdown-section hr{border:none;border-bottom:1px solid #eee;margin:2em 0}.markdown-section iframe{border:1px solid #eee;width:1px;min-width:100%}.markdown-section table{border-collapse:collapse;border-spacing:0;display:block;margin-bottom:1rem;overflow:auto;width:100%}.markdown-section th{font-weight:700}.markdown-section td,.markdown-section th{border:1px solid #ddd;padding:6px 13px}.markdown-section tr{border-top:1px solid #ccc}.markdown-section p.tip,.markdown-section tr:nth-child(2n){background-color:#f8f8f8}.markdown-section p.tip{border-bottom-right-radius:2px;border-left:4px solid #f66;border-top-right-radius:2px;margin:2em 0;padding:12px 24px 12px 30px;position:relative}.markdown-section p.tip:before{background-color:#f66;border-radius:100%;color:azure;content:"!";font-family:Dosis,Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:14px;font-weight:700;left:-12px;line-height:20px;position:absolute;height:20px;width:20px;text-align:center;top:14px}.markdown-section p.tip code{background-color:#efefef}.markdown-section p.tip em{color:#34495e}.markdown-section p.warn{background:rgba(0,255,255,.1);border-radius:2px;padding:1rem}.markdown-section ul.task-list>li{list-style-type:none}body.close .sidebar{transform:translateX(-300px)}body.close .sidebar-toggle{width:auto}body.close .content{left:0}@media print{.app-nav,.github-corner,.sidebar,.sidebar-toggle{display:none}}@media screen and (max-width:768px){.github-corner,.sidebar,.sidebar-toggle{position:fixed}.app-nav{margin-top:16px}.app-nav li ul{top:30px}main{height:auto;overflow-x:hidden}.sidebar{left:-300px;transition:transform .25s ease-out}.content{left:0;max-width:100vw;position:static;padding-top:20px;transition:transform .25s ease}.app-nav,.github-corner{transition:transform .25s ease-out}.sidebar-toggle{background-color:transparent;width:auto;padding:30px 30px 10px 10px}body.close .sidebar{transform:translateX(300px)}body.close .sidebar-toggle{background-color:rgba(240,255,255,.8);transition:background-color 1s;width:284px;padding:10px}body.close .content{transform:translateX(300px)}body.close .app-nav,body.close .github-corner{display:none}.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:a .56s ease-in-out}}@keyframes a{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}section.cover{-ms-flex-align:center;align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;height:100vh;display:none}section.cover.show{display:-ms-flexbox;display:flex}section.cover.has-mask .mask{background-color:azure;opacity:.8;position:absolute;top:0;height:100%;width:100%}section.cover .cover-main{-ms-flex:1;flex:1;margin:-20px 16px 0;text-align:center;z-index:1}section.cover a{color:inherit}section.cover a,section.cover a:hover{text-decoration:none}section.cover p{line-height:1.5rem;margin:1em 0}section.cover h1{color:inherit;font-size:2.5rem;font-weight:300;margin:.625rem 0 2.5rem;position:relative;text-align:center}section.cover h1 a{display:block}section.cover h1 small{bottom:-.4375rem;font-size:1rem;position:absolute}section.cover blockquote{font-size:1.5rem;text-align:center}section.cover ul{line-height:1.8;list-style-type:none;margin:1em auto;max-width:500px;padding:0}section.cover .cover-main>p:last-child a{border:1px solid var(--theme-color,#0ff);border-radius:2rem;box-sizing:border-box;color:var(--theme-color,#0ff);display:inline-block;font-size:1.05rem;letter-spacing:.1rem;margin:.5rem 1rem;padding:.75em 2rem;text-decoration:none;transition:all .15s ease}section.cover .cover-main>p:last-child a:last-child{background-color:var(--theme-color,#0ff);color:#fff}section.cover .cover-main>p:last-child a:last-child:hover{color:inherit;opacity:.8}section.cover .cover-main>p:last-child a:hover{color:inherit}section.cover blockquote>p>a{border-bottom:2px solid var(--theme-color,#0ff);transition:color .3s}section.cover blockquote>p>a:hover{color:var(--theme-color,#0ff)}.sidebar,body{background-color:azure}.sidebar{color:#364149}.sidebar li{margin:6px 0}.sidebar ul li a{color:#505d6b;font-size:14px;font-weight:400;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.sidebar ul li a:hover{text-decoration:underline}.sidebar ul li ul{padding:0}.sidebar ul li.active>a{border-right:2px solid;color:var(--theme-color,#0ff);font-weight:600}.app-sub-sidebar li:before{content:"-";padding-right:4px;float:left}.markdown-section h1,.markdown-section h2,.markdown-section h3,.markdown-section h4,.markdown-section strong{color:#2c3e50;font-weight:600}.markdown-section a{color:var(--theme-color,#0ff);font-weight:600}.markdown-section a:hover{text-decoration:underline}.markdown-section h1{font-size:2rem;margin:0 0 1rem}.markdown-section h2{font-size:1.75rem;margin:45px 0 .8rem}.markdown-section h3{font-size:1.5rem;margin:40px 0 .6rem}.markdown-section h4{font-size:1.25rem}.markdown-section h5{font-size:1rem}.markdown-section h6{color:#777;font-size:1rem}.markdown-section figure,.markdown-section p{margin:1.2em 0}.markdown-section ol,.markdown-section p,.markdown-section ul{line-height:1.6rem;word-spacing:.05rem}.markdown-section ol,.markdown-section ul{padding-left:1.5rem}.markdown-section blockquote{border-left:4px solid var(--theme-color,#0ff);color:#858585;margin:2em 0;padding-left:20px}.markdown-section blockquote p{font-weight:600;margin-left:0}.markdown-section iframe{margin:1em 0}.markdown-section em{color:#7f8c8d}.markdown-section code{border-radius:2px;color:#e96900;font-size:.8rem;margin:0 2px;padding:3px 5px;white-space:pre-wrap}.markdown-section code,.markdown-section pre{background-color:#f8f8f8;font-family:Roboto Mono,Monaco,courier,monospace}.markdown-section pre{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;line-height:1.5rem;margin:1.2em 0;overflow:auto;padding:0 1.4rem;position:relative;word-wrap:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#8e908c}.token.namespace{opacity:.7}.token.boolean,.token.number{color:#c76b29}.token.punctuation{color:#525252}.token.property{color:#c08b30}.token.tag{color:#2973b7}.token.string{color:var(--theme-color,#0ff)}.token.selector{color:#6679cc}.token.attr-name{color:#2973b7}.language-css .token.string,.style .token.string,.token.entity,.token.url{color:#22a2c9}.token.attr-value,.token.control,.token.directive,.token.unit{color:var(--theme-color,#0ff)}.token.function,.token.keyword{color:#e96900}.token.atrule,.token.regex,.token.statement{color:#22a2c9}.token.placeholder,.token.variable{color:#3d8fd1}.token.deleted{text-decoration:line-through}.token.inserted{border-bottom:1px dotted #202746;text-decoration:none}.token.italic{font-style:italic}.token.bold,.token.important{font-weight:700}.token.important{color:#c94922}.token.entity{cursor:help}.markdown-section pre>code{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;background-color:#f8f8f8;border-radius:2px;color:#525252;display:block;font-family:Roboto Mono,Monaco,courier,monospace;font-size:.8rem;line-height:inherit;margin:0 2px;max-width:inherit;overflow:inherit;padding:2.2em 5px;white-space:inherit}.markdown-section code:after,.markdown-section code:before{letter-spacing:.05rem}code .token{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;min-height:1.5rem}pre:after{color:#ccc;content:attr(data-lang);font-size:.6rem;font-weight:600;height:15px;line-height:15px;padding:5px 10px 0;position:absolute;right:0;text-align:right;top:0} \ No newline at end of file diff --git a/lib/themes/pure.css b/lib/themes/pure.css deleted file mode 100644 index 8bf43a1..0000000 --- a/lib/themes/pure.css +++ /dev/null @@ -1 +0,0 @@ -*{-webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:none;-webkit-touch-callout:none;box-sizing:border-box}body:not(.ready){overflow:hidden}body:not(.ready) .app-nav,body:not(.ready)>nav,body:not(.ready) [data-cloak]{display:none}div#app{font-size:30px;font-weight:lighter;margin:40vh auto;text-align:center}div#app:empty:before{content:"Loading..."}.emoji{height:1.2rem;vertical-align:middle}.progress{background-color:var(--theme-color,#000);height:2px;left:0;position:fixed;right:0;top:0;transition:width .2s,opacity .4s;width:0;z-index:5}.search .search-keyword,.search a:hover{color:var(--theme-color,#000)}.search .search-keyword{font-style:normal;font-weight:700}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:#000;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0;overflow-x:hidden}img{max-width:100%}a[disabled]{cursor:not-allowed;opacity:.6}kbd{border:1px solid #ccc;border-radius:3px;display:inline-block;font-size:12px!important;line-height:12px;margin-bottom:3px;padding:3px 5px;vertical-align:middle}li input[type=checkbox]{margin:0 .2em .25em 0;vertical-align:middle}.app-nav{margin:25px 60px 0 0;position:absolute;right:0;text-align:right;z-index:2}.app-nav.no-badge{margin-right:25px}.app-nav p{margin:0}.app-nav>a{margin:0 1rem;padding:5px 0}.app-nav li,.app-nav ul{display:inline-block;list-style:none;margin:0}.app-nav a{color:inherit;font-size:16px;text-decoration:none;transition:color .3s}.app-nav a.active,.app-nav a:hover{color:var(--theme-color,#000)}.app-nav a.active{border-bottom:2px solid var(--theme-color,#000)}.app-nav li{display:inline-block;margin:0 1rem;padding:5px 0;position:relative}.app-nav li ul{background-color:#fff;border:1px solid #ddd;border-bottom-color:#ccc;border-radius:4px;box-sizing:border-box;display:none;max-height:calc(100vh - 61px);overflow-y:auto;padding:10px 0;position:absolute;right:-15px;text-align:left;top:100%;white-space:nowrap}.app-nav li ul li{display:block;font-size:14px;line-height:1rem;margin:0;margin:8px 14px;white-space:nowrap}.app-nav li ul a{display:block;font-size:inherit;margin:0;padding:0}.app-nav li ul a.active{border-bottom:0}.app-nav li:hover ul{display:block}.github-corner{border-bottom:0;position:fixed;right:0;text-decoration:none;top:0;z-index:1}.github-corner:hover .octo-arm{animation:a .56s ease-in-out}.github-corner svg{color:#fff;fill:var(--theme-color,#000);height:80px;width:80px}main{display:block;position:relative;width:100vw;height:100%;z-index:0}main.hidden{display:none}.anchor{display:inline-block;text-decoration:none;transition:all .3s}.anchor span{color:#000}.anchor:hover{text-decoration:underline}.sidebar{border-right:1px solid rgba(0,0,0,.07);overflow-y:auto;padding:40px 0 0;position:absolute;top:0;bottom:0;left:0;transition:transform .25s ease-out;width:300px;z-index:3}.sidebar>h1{margin:0 auto 1rem;font-size:1.5rem;font-weight:300;text-align:center}.sidebar>h1 a{color:inherit;text-decoration:none}.sidebar>h1 .app-nav{display:block;position:static}.sidebar .sidebar-nav{line-height:2em;padding-bottom:40px}.sidebar li.collapse .app-sub-sidebar{display:none}.sidebar ul{margin:0 0 0 15px;padding:0}.sidebar li>p{font-weight:700;margin:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{border-bottom:none;display:block}.sidebar ul li ul{padding-left:20px}.sidebar::-webkit-scrollbar{width:4px}.sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}.sidebar:hover::-webkit-scrollbar-thumb{background:hsla(0,0%,53%,.4)}.sidebar:hover::-webkit-scrollbar-track{background:hsla(0,0%,53%,.1)}.sidebar-toggle{background-color:transparent;background-color:hsla(0,0%,100%,.8);border:0;outline:none;padding:10px;position:absolute;bottom:0;left:0;text-align:center;transition:opacity .3s;width:284px;z-index:4}.sidebar-toggle .sidebar-toggle-button:hover{opacity:.4}.sidebar-toggle span{background-color:var(--theme-color,#000);display:block;margin-bottom:4px;width:16px;height:2px}body.sticky .sidebar,body.sticky .sidebar-toggle{position:fixed}.content{padding-top:60px;position:absolute;top:0;right:0;bottom:0;left:300px;transition:left .25s ease}.markdown-section{margin:0 auto;max-width:800px;padding:30px 15px 40px;position:relative}.markdown-section>*{box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}.markdown-section hr{border:none;border-bottom:1px solid #eee;margin:2em 0}.markdown-section iframe{border:1px solid #eee;width:1px;min-width:100%}.markdown-section table{border-collapse:collapse;border-spacing:0;display:block;margin-bottom:1rem;overflow:auto;width:100%}.markdown-section th{font-weight:700}.markdown-section td,.markdown-section th{border:1px solid #ddd;padding:6px 13px}.markdown-section tr{border-top:1px solid #ccc}.markdown-section p.tip,.markdown-section tr:nth-child(2n){background-color:#f8f8f8}.markdown-section p.tip{border-bottom-right-radius:2px;border-left:4px solid #f66;border-top-right-radius:2px;margin:2em 0;padding:12px 24px 12px 30px;position:relative}.markdown-section p.tip:before{background-color:#f66;border-radius:100%;color:#fff;content:"!";font-family:Dosis,Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:14px;font-weight:700;left:-12px;line-height:20px;position:absolute;height:20px;width:20px;text-align:center;top:14px}.markdown-section p.tip code{background-color:#efefef}.markdown-section p.tip em{color:#000}.markdown-section p.warn{background:rgba(0,0,0,.1);border-radius:2px;padding:1rem}.markdown-section ul.task-list>li{list-style-type:none}body.close .sidebar{transform:translateX(-300px)}body.close .sidebar-toggle{width:auto}body.close .content{left:0}@media print{.app-nav,.github-corner,.sidebar,.sidebar-toggle{display:none}}@media screen and (max-width:768px){.github-corner,.sidebar,.sidebar-toggle{position:fixed}.app-nav{margin-top:16px}.app-nav li ul{top:30px}main{height:auto;overflow-x:hidden}.sidebar{left:-300px;transition:transform .25s ease-out}.content{left:0;max-width:100vw;position:static;padding-top:20px;transition:transform .25s ease}.app-nav,.github-corner{transition:transform .25s ease-out}.sidebar-toggle{background-color:transparent;width:auto;padding:30px 30px 10px 10px}body.close .sidebar{transform:translateX(300px)}body.close .sidebar-toggle{background-color:hsla(0,0%,100%,.8);transition:background-color 1s;width:284px;padding:10px}body.close .content{transform:translateX(300px)}body.close .app-nav,body.close .github-corner{display:none}.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:a .56s ease-in-out}}@keyframes a{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}section.cover{-ms-flex-align:center;align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;height:100vh;display:none}section.cover.show{display:-ms-flexbox;display:flex}section.cover.has-mask .mask{background-color:#fff;opacity:.8;position:absolute;top:0;height:100%;width:100%}section.cover .cover-main{-ms-flex:1;flex:1;margin:-20px 16px 0;text-align:center;z-index:1}section.cover a{color:inherit}section.cover a,section.cover a:hover{text-decoration:none}section.cover p{line-height:1.5rem;margin:1em 0}section.cover h1{color:inherit;font-size:2.5rem;font-weight:300;margin:.625rem 0 2.5rem;position:relative;text-align:center}section.cover h1 a{display:block}section.cover h1 small{bottom:-.4375rem;font-size:1rem;position:absolute}section.cover blockquote{font-size:1.5rem;text-align:center}section.cover ul{line-height:1.8;list-style-type:none;margin:1em auto;max-width:500px;padding:0}section.cover .cover-main>p:last-child a{border:1px solid var(--theme-color,#000);border-radius:2rem;box-sizing:border-box;color:var(--theme-color,#000);display:inline-block;font-size:1.05rem;letter-spacing:.1rem;margin:.5rem 1rem;padding:.75em 2rem;text-decoration:none;transition:all .15s ease}section.cover .cover-main>p:last-child a:last-child{background-color:var(--theme-color,#000);color:#fff}section.cover .cover-main>p:last-child a:last-child:hover{color:inherit;opacity:.8}section.cover .cover-main>p:last-child a:hover{color:inherit}section.cover blockquote>p>a{border-bottom:2px solid var(--theme-color,#000);transition:color .3s}section.cover blockquote>p>a:hover{color:var(--theme-color,#000)} \ No newline at end of file diff --git a/lib/themes/vue.css b/lib/themes/vue.css deleted file mode 100644 index 231973d..0000000 --- a/lib/themes/vue.css +++ /dev/null @@ -1 +0,0 @@ -@import url("https://fonts.googleapis.com/css?family=Roboto+Mono|Source+Sans+Pro:300,400,600");*{-webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:none;-webkit-touch-callout:none;box-sizing:border-box}body:not(.ready){overflow:hidden}body:not(.ready) .app-nav,body:not(.ready)>nav,body:not(.ready) [data-cloak]{display:none}div#app{font-size:30px;font-weight:lighter;margin:40vh auto;text-align:center}div#app:empty:before{content:"Loading..."}.emoji{height:1.2rem;vertical-align:middle}.progress{background-color:var(--theme-color,#42b983);height:2px;left:0;position:fixed;right:0;top:0;transition:width .2s,opacity .4s;width:0;z-index:5}.search .search-keyword,.search a:hover{color:var(--theme-color,#42b983)}.search .search-keyword{font-style:normal;font-weight:700}body,html{height:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:#34495e;font-family:Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:15px;letter-spacing:0;margin:0;overflow-x:hidden}img{max-width:100%}a[disabled]{cursor:not-allowed;opacity:.6}kbd{border:1px solid #ccc;border-radius:3px;display:inline-block;font-size:12px!important;line-height:12px;margin-bottom:3px;padding:3px 5px;vertical-align:middle}li input[type=checkbox]{margin:0 .2em .25em 0;vertical-align:middle}.app-nav{margin:25px 60px 0 0;position:absolute;right:0;text-align:right;z-index:2}.app-nav.no-badge{margin-right:25px}.app-nav p{margin:0}.app-nav>a{margin:0 1rem;padding:5px 0}.app-nav li,.app-nav ul{display:inline-block;list-style:none;margin:0}.app-nav a{color:inherit;font-size:16px;text-decoration:none;transition:color .3s}.app-nav a.active,.app-nav a:hover{color:var(--theme-color,#42b983)}.app-nav a.active{border-bottom:2px solid var(--theme-color,#42b983)}.app-nav li{display:inline-block;margin:0 1rem;padding:5px 0;position:relative}.app-nav li ul{background-color:#fff;border:1px solid #ddd;border-bottom-color:#ccc;border-radius:4px;box-sizing:border-box;display:none;max-height:calc(100vh - 61px);overflow-y:auto;padding:10px 0;position:absolute;right:-15px;text-align:left;top:100%;white-space:nowrap}.app-nav li ul li{display:block;font-size:14px;line-height:1rem;margin:0;margin:8px 14px;white-space:nowrap}.app-nav li ul a{display:block;font-size:inherit;margin:0;padding:0}.app-nav li ul a.active{border-bottom:0}.app-nav li:hover ul{display:block}.github-corner{border-bottom:0;position:fixed;right:0;text-decoration:none;top:0;z-index:1}.github-corner:hover .octo-arm{animation:a .56s ease-in-out}.github-corner svg{color:#fff;fill:var(--theme-color,#42b983);height:80px;width:80px}main{display:block;position:relative;width:100vw;height:100%;z-index:0}main.hidden{display:none}.anchor{display:inline-block;text-decoration:none;transition:all .3s}.anchor span{color:#34495e}.anchor:hover{text-decoration:underline}.sidebar{border-right:1px solid rgba(0,0,0,.07);overflow-y:auto;padding:40px 0 0;position:absolute;top:0;bottom:0;left:0;transition:transform .25s ease-out;width:300px;z-index:3}.sidebar>h1{margin:0 auto 1rem;font-size:1.5rem;font-weight:300;text-align:center}.sidebar>h1 a{color:inherit;text-decoration:none}.sidebar>h1 .app-nav{display:block;position:static}.sidebar .sidebar-nav{line-height:2em;padding-bottom:40px}.sidebar li.collapse .app-sub-sidebar{display:none}.sidebar ul{margin:0 0 0 15px;padding:0}.sidebar li>p{font-weight:700;margin:0}.sidebar ul,.sidebar ul li{list-style:none}.sidebar ul li a{border-bottom:none;display:block}.sidebar ul li ul{padding-left:20px}.sidebar::-webkit-scrollbar{width:4px}.sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}.sidebar:hover::-webkit-scrollbar-thumb{background:hsla(0,0%,53%,.4)}.sidebar:hover::-webkit-scrollbar-track{background:hsla(0,0%,53%,.1)}.sidebar-toggle{background-color:transparent;background-color:hsla(0,0%,100%,.8);border:0;outline:none;padding:10px;position:absolute;bottom:0;left:0;text-align:center;transition:opacity .3s;width:284px;z-index:4}.sidebar-toggle .sidebar-toggle-button:hover{opacity:.4}.sidebar-toggle span{background-color:var(--theme-color,#42b983);display:block;margin-bottom:4px;width:16px;height:2px}body.sticky .sidebar,body.sticky .sidebar-toggle{position:fixed}.content{padding-top:60px;position:absolute;top:0;right:0;bottom:0;left:300px;transition:left .25s ease}.markdown-section{margin:0 auto;max-width:800px;padding:30px 15px 40px;position:relative}.markdown-section>*{box-sizing:border-box;font-size:inherit}.markdown-section>:first-child{margin-top:0!important}.markdown-section hr{border:none;border-bottom:1px solid #eee;margin:2em 0}.markdown-section iframe{border:1px solid #eee;width:1px;min-width:100%}.markdown-section table{border-collapse:collapse;border-spacing:0;display:block;margin-bottom:1rem;overflow:auto;width:100%}.markdown-section th{font-weight:700}.markdown-section td,.markdown-section th{border:1px solid #ddd;padding:6px 13px}.markdown-section tr{border-top:1px solid #ccc}.markdown-section p.tip,.markdown-section tr:nth-child(2n){background-color:#f8f8f8}.markdown-section p.tip{border-bottom-right-radius:2px;border-left:4px solid #f66;border-top-right-radius:2px;margin:2em 0;padding:12px 24px 12px 30px;position:relative}.markdown-section p.tip:before{background-color:#f66;border-radius:100%;color:#fff;content:"!";font-family:Dosis,Source Sans Pro,Helvetica Neue,Arial,sans-serif;font-size:14px;font-weight:700;left:-12px;line-height:20px;position:absolute;height:20px;width:20px;text-align:center;top:14px}.markdown-section p.tip code{background-color:#efefef}.markdown-section p.tip em{color:#34495e}.markdown-section p.warn{background:rgba(66,185,131,.1);border-radius:2px;padding:1rem}.markdown-section ul.task-list>li{list-style-type:none}body.close .sidebar{transform:translateX(-300px)}body.close .sidebar-toggle{width:auto}body.close .content{left:0}@media print{.app-nav,.github-corner,.sidebar,.sidebar-toggle{display:none}}@media screen and (max-width:768px){.github-corner,.sidebar,.sidebar-toggle{position:fixed}.app-nav{margin-top:16px}.app-nav li ul{top:30px}main{height:auto;overflow-x:hidden}.sidebar{left:-300px;transition:transform .25s ease-out}.content{left:0;max-width:100vw;position:static;padding-top:20px;transition:transform .25s ease}.app-nav,.github-corner{transition:transform .25s ease-out}.sidebar-toggle{background-color:transparent;width:auto;padding:30px 30px 10px 10px}body.close .sidebar{transform:translateX(300px)}body.close .sidebar-toggle{background-color:hsla(0,0%,100%,.8);transition:background-color 1s;width:284px;padding:10px}body.close .content{transform:translateX(300px)}body.close .app-nav,body.close .github-corner{display:none}.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:a .56s ease-in-out}}@keyframes a{0%,to{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}section.cover{-ms-flex-align:center;align-items:center;background-position:50%;background-repeat:no-repeat;background-size:cover;height:100vh;display:none}section.cover.show{display:-ms-flexbox;display:flex}section.cover.has-mask .mask{background-color:#fff;opacity:.8;position:absolute;top:0;height:100%;width:100%}section.cover .cover-main{-ms-flex:1;flex:1;margin:-20px 16px 0;text-align:center;z-index:1}section.cover a{color:inherit}section.cover a,section.cover a:hover{text-decoration:none}section.cover p{line-height:1.5rem;margin:1em 0}section.cover h1{color:inherit;font-size:2.5rem;font-weight:300;margin:.625rem 0 2.5rem;position:relative;text-align:center}section.cover h1 a{display:block}section.cover h1 small{bottom:-.4375rem;font-size:1rem;position:absolute}section.cover blockquote{font-size:1.5rem;text-align:center}section.cover ul{line-height:1.8;list-style-type:none;margin:1em auto;max-width:500px;padding:0}section.cover .cover-main>p:last-child a{border:1px solid var(--theme-color,#42b983);border-radius:2rem;box-sizing:border-box;color:var(--theme-color,#42b983);display:inline-block;font-size:1.05rem;letter-spacing:.1rem;margin:.5rem 1rem;padding:.75em 2rem;text-decoration:none;transition:all .15s ease}section.cover .cover-main>p:last-child a:last-child{background-color:var(--theme-color,#42b983);color:#fff}section.cover .cover-main>p:last-child a:last-child:hover{color:inherit;opacity:.8}section.cover .cover-main>p:last-child a:hover{color:inherit}section.cover blockquote>p>a{border-bottom:2px solid var(--theme-color,#42b983);transition:color .3s}section.cover blockquote>p>a:hover{color:var(--theme-color,#42b983)}.sidebar,body{background-color:#fff}.sidebar{color:#364149}.sidebar li{margin:6px 0}.sidebar ul li a{color:#505d6b;font-size:14px;font-weight:400;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.sidebar ul li a:hover{text-decoration:underline}.sidebar ul li ul{padding:0}.sidebar ul li.active>a{border-right:2px solid;color:var(--theme-color,#42b983);font-weight:600}.app-sub-sidebar li:before{content:"-";padding-right:4px;float:left}.markdown-section h1,.markdown-section h2,.markdown-section h3,.markdown-section h4,.markdown-section strong{color:#2c3e50;font-weight:600}.markdown-section a{color:var(--theme-color,#42b983);font-weight:600}.markdown-section h1{font-size:2rem;margin:0 0 1rem}.markdown-section h2{font-size:1.75rem;margin:45px 0 .8rem}.markdown-section h3{font-size:1.5rem;margin:40px 0 .6rem}.markdown-section h4{font-size:1.25rem}.markdown-section h5{font-size:1rem}.markdown-section h6{color:#777;font-size:1rem}.markdown-section figure,.markdown-section p{margin:1.2em 0}.markdown-section ol,.markdown-section p,.markdown-section ul{line-height:1.6rem;word-spacing:.05rem}.markdown-section ol,.markdown-section ul{padding-left:1.5rem}.markdown-section blockquote{border-left:4px solid var(--theme-color,#42b983);color:#858585;margin:2em 0;padding-left:20px}.markdown-section blockquote p{font-weight:600;margin-left:0}.markdown-section iframe{margin:1em 0}.markdown-section em{color:#7f8c8d}.markdown-section code{border-radius:2px;color:#e96900;font-size:.8rem;margin:0 2px;padding:3px 5px;white-space:pre-wrap}.markdown-section code,.markdown-section pre{background-color:#f8f8f8;font-family:Roboto Mono,Monaco,courier,monospace}.markdown-section pre{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;line-height:1.5rem;margin:1.2em 0;overflow:auto;padding:0 1.4rem;position:relative;word-wrap:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#8e908c}.token.namespace{opacity:.7}.token.boolean,.token.number{color:#c76b29}.token.punctuation{color:#525252}.token.property{color:#c08b30}.token.tag{color:#2973b7}.token.string{color:var(--theme-color,#42b983)}.token.selector{color:#6679cc}.token.attr-name{color:#2973b7}.language-css .token.string,.style .token.string,.token.entity,.token.url{color:#22a2c9}.token.attr-value,.token.control,.token.directive,.token.unit{color:var(--theme-color,#42b983)}.token.function,.token.keyword{color:#e96900}.token.atrule,.token.regex,.token.statement{color:#22a2c9}.token.placeholder,.token.variable{color:#3d8fd1}.token.deleted{text-decoration:line-through}.token.inserted{border-bottom:1px dotted #202746;text-decoration:none}.token.italic{font-style:italic}.token.bold,.token.important{font-weight:700}.token.important{color:#c94922}.token.entity{cursor:help}.markdown-section pre>code{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;background-color:#f8f8f8;border-radius:2px;color:#525252;display:block;font-family:Roboto Mono,Monaco,courier,monospace;font-size:.8rem;line-height:inherit;margin:0 2px;max-width:inherit;overflow:inherit;padding:2.2em 5px;white-space:inherit}.markdown-section code:after,.markdown-section code:before{letter-spacing:.05rem}code .token{-moz-osx-font-smoothing:initial;-webkit-font-smoothing:initial;min-height:1.5rem}pre:after{color:#ccc;content:attr(data-lang);font-size:.6rem;font-weight:600;height:15px;line-height:15px;padding:5px 10px 0;position:absolute;right:0;text-align:right;top:0} \ No newline at end of file From 3f503810903b6f5e18c4be80fb19fdf05dddea99 Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sun, 5 May 2019 13:24:20 +0200 Subject: [PATCH 32/37] Add matomo plugin to build script --- build/build.js | 1 + 1 file changed, 1 insertion(+) diff --git a/build/build.js b/build/build.js index b9068b9..7b61224 100644 --- a/build/build.js +++ b/build/build.js @@ -55,6 +55,7 @@ const buildAllPlugin = function () { var plugins = [ {name: 'search', input: 'search/index.js'}, {name: 'ga', input: 'ga.js'}, + {name: 'matomo', input: 'matomo.js'}, {name: 'emoji', input: 'emoji.js'}, {name: 'external-script', input: 'external-script.js'}, {name: 'front-matter', input: 'front-matter/index.js'}, From 76cc0f672b0d41bb0cadf1b61c2af2604e4fe643 Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sun, 5 May 2019 13:14:28 +0200 Subject: [PATCH 33/37] Cleanup gitignore --- .gitignore | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 556ff6c..ea4b5b8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ *.log .DS_Store -/themes/* -!.gitkeep +.idea node_modules -/lib/ -.idea \ No newline at end of file +themes/ +lib/ + +# exceptions +!.gitkeep \ No newline at end of file From 5bd24fb83c08e83d35e2eb6581a0f8ec2cf5296a Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sun, 5 May 2019 18:35:34 +0200 Subject: [PATCH 34/37] Do not commit any files in lib during release --- build/release.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/build/release.sh b/build/release.sh index da15a38..a328322 100755 --- a/build/release.sh +++ b/build/release.sh @@ -29,7 +29,6 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then # commit git add -A - git add -f lib/ -A git commit -m "[build] $VERSION $RELEASE_TAG" npm --no-git-tag-version version $VERSION --message "[release] $VERSION $RELEASE_TAG" From 7bdcadc7d768c9099cf495fa0142897dca297ba8 Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sun, 5 May 2019 18:41:17 +0200 Subject: [PATCH 35/37] [build] 4.9.4 next --- docs/_coverpage.md | 2 +- packages/docsify-server-renderer/package-lock.json | 2 +- packages/docsify-server-renderer/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/_coverpage.md b/docs/_coverpage.md index f337648..1decbd6 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -1,6 +1,6 @@ ![logo](_media/icon.svg) -# docsify 4.9.2 +# docsify 4.9.4 > A magical documentation site generator. diff --git a/packages/docsify-server-renderer/package-lock.json b/packages/docsify-server-renderer/package-lock.json index 40e63e1..e8ff0a6 100644 --- a/packages/docsify-server-renderer/package-lock.json +++ b/packages/docsify-server-renderer/package-lock.json @@ -37,5 +37,5 @@ "integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ=" } }, - "version": "4.9.2" + "version": "4.9.4" } diff --git a/packages/docsify-server-renderer/package.json b/packages/docsify-server-renderer/package.json index f7b9a6c..5ff206e 100644 --- a/packages/docsify-server-renderer/package.json +++ b/packages/docsify-server-renderer/package.json @@ -1,6 +1,6 @@ { "name": "docsify-server-renderer", - "version": "4.9.2", + "version": "4.9.4", "description": "docsify server renderer", "author": { "name": "qingwei-li", From 676f84cffa9d713fbad662371870d7db2109a9b3 Mon Sep 17 00:00:00 2001 From: Anton Wilhelm Date: Sun, 5 May 2019 18:41:18 +0200 Subject: [PATCH 36/37] chore: add changelog 4.9.4 --- CHANGELOG.md | 5 +++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cca2f84..267d402 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ + +## [4.9.4](https://github.com/docsifyjs/docsify/compare/v4.9.2...v4.9.4) (2019-05-05) + + + ## [4.9.2](https://github.com/docsifyjs/docsify/compare/v4.9.1...v4.9.2) (2019-04-21) diff --git a/package-lock.json b/package-lock.json index dc4de8a..bb18bcb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "docsify", - "version": "4.9.2", + "version": "4.9.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e17bdb9..1661f40 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "docsify", - "version": "4.9.2", + "version": "4.9.4", "description": "A magical documentation generator.", "author": { "name": "qingwei-li", From 8ea4865c84e56a01dc07bb027cf748363e1b34aa Mon Sep 17 00:00:00 2001 From: Parkjunwoo Date: Tue, 18 Jun 2019 00:30:43 +0900 Subject: [PATCH 37/37] Fix typo --- docs/deploy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/deploy.md b/docs/deploy.md index 7d47e0f..a879f2e 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -15,7 +15,7 @@ It is recommended that you save your files to the `./docs` subfolder of the `mas ![github pages](_images/deploy-github-pages.png) !> You can also save files in the root directory and select `master branch`. -You'll need to place a `.nojekyll` file in the deploy location (such as `/docs` or the gh-pages branch +You'll need to place a `.nojekyll` file in the deploy location (such as `/docs` or the gh-pages branch) ## GitLab Pages