diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 0000000..a3b8548
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,5 @@
+.git
+packages/docsify-server-renderer/build.js
+node_modules
+build
+server.js
\ No newline at end of file
diff --git a/.eslintrc b/.eslintrc
index d5691ad..a8f7cd0 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -1,6 +1,20 @@
{
- "extends": ["vue"],
+ "extends": "xo-space/browser",
+ "rules": {
+ "semi": [2, "never"],
+ "no-return-assign": "off",
+ "no-unused-expressions": "off",
+ "no-new-func": "off",
+ "no-multi-assign": "off",
+ "no-mixed-operators": "off",
+ "max-params": "off",
+ "no-script-url": "off",
+ "camelcase": "off",
+ "no-warning-comments": "off"
+ },
"globals": {
- "XMLHttpRequest": true
+ "Docsify": true,
+ "$docsify": true,
+ "process": true
}
}
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000..35d6b90
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,38 @@
+---
+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
+
+
+
+#### Other relevant information
+
+
+- [ ] Bug does still occur when all/other plugins are disabled?
+
+- Your OS:
+- Node.js version:
+- npm/yarn version:
+- Browser version:
+- Docsify version:
+- Docsify plugins:
+
+
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
new file mode 100644
index 0000000..bb31bd4
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+**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:**
+
+---
+
+* [ ] DO NOT include files inside `lib` directory.
+
diff --git a/.gitignore b/.gitignore
index b915831..ea4b5b8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,9 @@
*.log
+.DS_Store
+.idea
node_modules
-yarn.lock
+themes/
+lib/
+
+# exceptions
+!.gitkeep
\ No newline at end of file
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 0000000..41b1431
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1,5 @@
+.eslintignore
+.eslintrc
+.github/
+.gitignore
+.travis.yml
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..b7d6eb8
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "prettier.eslintIntegration": true
+}
diff --git a/404.dev.html b/404.dev.html
deleted file mode 100644
index b2437df..0000000
--- a/404.dev.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
- En
- 中文
-
-
-
-
-
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c6a5869..267d402 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,37 +1,753 @@
-## 0.4.2
-## Bug fixes
-- Correct catch ajax error
+
+## [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)
+
+
+### Bug Fixes
+
+* re-render gitalk when router changed ([11ea1f8](https://github.com/docsifyjs/docsify/commit/11ea1f8))
-## 0.4.1
-## Bug fixes
-- catch ajax error
-## 0.4.0
### Features
-- Custom sidebar
-### Bug fixes
-- Fix undefined language
+* 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)
+
+
+### Bug Fixes
+
+* github assets url ([#774](https://github.com/docsifyjs/docsify/issues/774)) ([140bf10](https://github.com/docsifyjs/docsify/commit/140bf10))
+
+
+
+
+# [4.9.0](https://github.com/docsifyjs/docsify/compare/v4.8.6...v4.9.0) (2019-02-19)
+
+
+### Bug Fixes
+
+* task list rendering (Fix [#749](https://github.com/docsifyjs/docsify/issues/749)) ([#757](https://github.com/docsifyjs/docsify/issues/757)) ([69ef489](https://github.com/docsifyjs/docsify/commit/69ef489))
+* upgrade npm-run-all ([049726e](https://github.com/docsifyjs/docsify/commit/049726e))
-## 0.3.1
-### Bug fixes
-- Strip HTML tag when rendering the headings
-## 0.3.0
### Features
-- Add minified css files
-- Add max level option
-- Add pure.css
-## 0.2.1
-### Bug fixes
-- Fix vue.css
+* **search-plugin:** add namespace option ([#706](https://github.com/docsifyjs/docsify/issues/706)) ([28beff8](https://github.com/docsifyjs/docsify/commit/28beff8))
+* Add new theme "dolphin" ([#735](https://github.com/docsifyjs/docsify/issues/735)) ([c3345ba](https://github.com/docsifyjs/docsify/commit/c3345ba))
+* Provide code fragments feature ([#748](https://github.com/docsifyjs/docsify/issues/748)) ([1447c8a](https://github.com/docsifyjs/docsify/commit/1447c8a))
-## 0.2.0
-### Bug fixes
-- Fix route
-- Remove dynamic title
-## 0.1.0
+
+
+## [4.8.6](https://github.com/docsifyjs/docsify/compare/v4.8.5...v4.8.6) (2018-11-12)
+
+
+### Bug Fixes
+
+* IE10 compatibility ([#691](https://github.com/docsifyjs/docsify/issues/691)) ([4db8cd6](https://github.com/docsifyjs/docsify/commit/4db8cd6))
+
+
+
+
+## [4.8.5](https://github.com/docsifyjs/docsify/compare/v4.8.4...v4.8.5) (2018-11-02)
+
+
+### Bug Fixes
+
+* expose version info for Docsify, fixed [#641](https://github.com/docsifyjs/docsify/issues/641) ([aa719e3](https://github.com/docsifyjs/docsify/commit/aa719e3))
+
+
+
+
+## [4.8.4](https://github.com/docsifyjs/docsify/compare/v4.8.3...v4.8.4) (2018-11-01)
+
+
+### Bug Fixes
+
+* **cover:** Compatible with legacy styles, fixed [#677](https://github.com/docsifyjs/docsify/issues/677) ([#678](https://github.com/docsifyjs/docsify/issues/678)) ([1a945d4](https://github.com/docsifyjs/docsify/commit/1a945d4))
+
+
+
+
+
+## [4.8.3](https://github.com/docsifyjs/docsify/compare/v4.8.2...v4.8.3) (2018-11-01)
+
+Fix the last release files has the old version marked...
+
+
+
+## [4.8.2](https://github.com/docsifyjs/docsify/compare/v4.8.1...v4.8.2) (2018-11-01)
+
+### Bug Fixes
+
+- cover button style, fixed [#670](https://github.com/docsifyjs/docsify/issues/670), fixed [#665](https://github.com/docsifyjs/docsify/issues/665) ([#675](https://github.com/docsifyjs/docsify/issues/675)) ([fcd1087](https://github.com/docsifyjs/docsify/commit/fcd1087))
+- update match regex ([#669](https://github.com/docsifyjs/docsify/issues/669)) ([2edf47e](https://github.com/docsifyjs/docsify/commit/2edf47e))
+- use copy of cached value ([#668](https://github.com/docsifyjs/docsify/issues/668)) ([5fcf210](https://github.com/docsifyjs/docsify/commit/5fcf210))
+- **compiler:** import prism-markup-templating, fixed [#672](https://github.com/docsifyjs/docsify/issues/672) ([#676](https://github.com/docsifyjs/docsify/issues/676)) ([fdd8826](https://github.com/docsifyjs/docsify/commit/fdd8826))
+
### Features
-- Add buble.css
\ No newline at end of file
+
+- add heading config id ([#671](https://github.com/docsifyjs/docsify/issues/671)) ([ab19b13](https://github.com/docsifyjs/docsify/commit/ab19b13))
+
+
+
+## [4.8.1](https://github.com/docsifyjs/docsify/compare/v4.8.0...v4.8.1) (2018-10-31)
+
+### Bug Fixes
+
+- ssr package dep, fixed [#605](https://github.com/docsifyjs/docsify/issues/605) ([2bc880d](https://github.com/docsifyjs/docsify/commit/2bc880d))
+- **compiler:** extra quotes for codeblock ([4f588e0](https://github.com/docsifyjs/docsify/commit/4f588e0))
+- **compiler:** prevent render of html code in paragraph, fixed [#663](https://github.com/docsifyjs/docsify/issues/663) ([d35059d](https://github.com/docsifyjs/docsify/commit/d35059d))
+
+### Features
+
+- upgrade PrismJS, fixed [#534](https://github.com/docsifyjs/docsify/issues/534) ([4805cb5](https://github.com/docsifyjs/docsify/commit/4805cb5))
+
+
+
+# [4.8.0](https://github.com/docsifyjs/docsify/compare/v4.7.1...v4.8.0) (2018-10-31)
+
+### Bug Fixes
+
+- Cache TOC for later usage in the case of cached file html ([#649](https://github.com/docsifyjs/docsify/issues/649)) ([9e86017](https://github.com/docsifyjs/docsify/commit/9e86017))
+- improve external script plugin ([#632](https://github.com/docsifyjs/docsify/issues/632)) ([50c2434](https://github.com/docsifyjs/docsify/commit/50c2434))
+- missing variable declaration ([#660](https://github.com/docsifyjs/docsify/issues/660)) ([1ce37bd](https://github.com/docsifyjs/docsify/commit/1ce37bd))
+- Remove target for mailto links ([#652](https://github.com/docsifyjs/docsify/issues/652)) ([18f0f03](https://github.com/docsifyjs/docsify/commit/18f0f03))
+- Update getAllPath query selector ([#653](https://github.com/docsifyjs/docsify/issues/653)) ([f6f4e32](https://github.com/docsifyjs/docsify/commit/f6f4e32))
+- Update vue.styl ([#634](https://github.com/docsifyjs/docsify/issues/634)) ([bf060be](https://github.com/docsifyjs/docsify/commit/bf060be))
+
+### Features
+
+- Add docsify version to $window.docsify object ([#641](https://github.com/docsifyjs/docsify/issues/641)) ([94bc415](https://github.com/docsifyjs/docsify/commit/94bc415)), closes [#521](https://github.com/docsifyjs/docsify/issues/521)
+- **compiler:** support embedded mermaid ([#629](https://github.com/docsifyjs/docsify/issues/629)) ([42ea8af](https://github.com/docsifyjs/docsify/commit/42ea8af))
+- Add hideOtherSidebarContent option ([#661](https://github.com/docsifyjs/docsify/issues/661)) ([4a23c4a](https://github.com/docsifyjs/docsify/commit/4a23c4a))
+- Allow base64, external, and relative logo values ([#642](https://github.com/docsifyjs/docsify/issues/642)) ([0a0802a](https://github.com/docsifyjs/docsify/commit/0a0802a)), closes [#577](https://github.com/docsifyjs/docsify/issues/577)
+- upgrade marked to 0.5.x, fixed [#645](https://github.com/docsifyjs/docsify/issues/645), close [#644](https://github.com/docsifyjs/docsify/issues/644) ([#662](https://github.com/docsifyjs/docsify/issues/662)) ([a39b214](https://github.com/docsifyjs/docsify/commit/a39b214))
+
+
+
+## [4.7.1](https://github.com/docsifyjs/docsify/compare/v4.7.0...v4.7.1) (2018-08-30)
+
+
+
+# [4.7.0](https://github.com/QingWei-Li/docsify/compare/v4.6.9...v4.7.0) (2018-06-29)
+
+### Bug Fixes
+
+- alldow addition content in sidebar, fix [#518](https://github.com/QingWei-Li/docsify/issues/518), fix 539 ([#543](https://github.com/QingWei-Li/docsify/issues/543)) ([04b36b0](https://github.com/QingWei-Li/docsify/commit/04b36b0))
+- async install config, fixed [#425](https://github.com/QingWei-Li/docsify/issues/425) ([e4e011c](https://github.com/QingWei-Li/docsify/commit/e4e011c))
+- loading embed files synchronously, fixed [#525](https://github.com/QingWei-Li/docsify/issues/525), fixed [#527](https://github.com/QingWei-Li/docsify/issues/527) ([#544](https://github.com/QingWei-Li/docsify/issues/544)) ([feea7f9](https://github.com/QingWei-Li/docsify/commit/feea7f9))
+- path include chinese character cause hilight bug ([#556](https://github.com/QingWei-Li/docsify/issues/556)) ([a5f333a](https://github.com/QingWei-Li/docsify/commit/a5f333a))
+
+### Features
+
+- add logo option, [#264](https://github.com/QingWei-Li/docsify/issues/264) ([#541](https://github.com/QingWei-Li/docsify/issues/541)) ([ee72dd0](https://github.com/QingWei-Li/docsify/commit/ee72dd0))
+- add unpkg field, close [#531](https://github.com/QingWei-Li/docsify/issues/531) ([#558](https://github.com/QingWei-Li/docsify/issues/558)) ([5c0de0a](https://github.com/QingWei-Li/docsify/commit/5c0de0a))
+- support image resizing, resolve [#508](https://github.com/QingWei-Li/docsify/issues/508) ([#545](https://github.com/QingWei-Li/docsify/issues/545)) ([3a7ad62](https://github.com/QingWei-Li/docsify/commit/3a7ad62))
+
+
+
+## [4.6.10](https://github.com/QingWei-Li/docsify/compare/v4.6.9...v4.6.10) (2018-03-25)
+
+### Bug Fixes
+
+- async install config, fixed [#425](https://github.com/QingWei-Li/docsify/issues/425) ([e4e011c](https://github.com/QingWei-Li/docsify/commit/e4e011c))
+
+
+
+## [4.6.9](https://github.com/QingWei-Li/docsify/compare/v4.6.8...v4.6.9) (2018-03-10)
+
+### Bug Fixes
+
+- upgrade medium-zoom, fixed [#417](https://github.com/QingWei-Li/docsify/issues/417) ([6a3d69a](https://github.com/QingWei-Li/docsify/commit/6a3d69a))
+
+
+
+## [4.6.8](https://github.com/QingWei-Li/docsify/compare/v4.6.7...v4.6.8) (2018-03-06)
+
+### Bug Fixes
+
+- resolve path of image and embed files, fixed [#412](https://github.com/QingWei-Li/docsify/issues/412) ([bfd0d18](https://github.com/QingWei-Li/docsify/commit/bfd0d18))
+
+
+
+## [4.6.7](https://github.com/QingWei-Li/docsify/compare/v4.6.6...v4.6.7) (2018-03-03)
+
+### Bug Fixes
+
+- layout css, fixed [#409](https://github.com/QingWei-Li/docsify/issues/409) ([aeb692e](https://github.com/QingWei-Li/docsify/commit/aeb692e))
+
+
+
+## [4.6.6](https://github.com/QingWei-Li/docsify/compare/v4.6.5...v4.6.6) (2018-03-03)
+
+
+
+## [4.6.5](https://github.com/QingWei-Li/docsify/compare/v4.6.4...v4.6.5) (2018-03-03)
+
+### Bug Fixes
+
+- **navbar:** Now Navbar isn't append to DOM when loadNavbar is falsy ([#407](https://github.com/QingWei-Li/docsify/issues/407)) ([0933445](https://github.com/QingWei-Li/docsify/commit/0933445))
+
+### Features
+
+- **config:** Add 404 page options. ([#406](https://github.com/QingWei-Li/docsify/issues/406)) ([9b3b445](https://github.com/QingWei-Li/docsify/commit/9b3b445))
+
+
+
+## [4.6.4](https://github.com/QingWei-Li/docsify/compare/v4.6.3...v4.6.4) (2018-03-01)
+
+### Bug Fixes
+
+- **render:** Disable markdown parsing when the file is an HTML ([#403](https://github.com/QingWei-Li/docsify/issues/403)) ([278a75e](https://github.com/QingWei-Li/docsify/commit/278a75e))
+
+### Features
+
+- **fetch:** Add fallback languages configuration. ([#402](https://github.com/QingWei-Li/docsify/issues/402)) ([ecc0e04](https://github.com/QingWei-Li/docsify/commit/ecc0e04))
+
+
+
+## [4.6.3](https://github.com/QingWei-Li/docsify/compare/v4.6.2...v4.6.3) (2018-02-15)
+
+### Bug Fixes
+
+- **hook:** beforeEach don\'t work, fixed [#393](https://github.com/QingWei-Li/docsify/issues/393) ([6a09059](https://github.com/QingWei-Li/docsify/commit/6a09059))
+
+
+
+## [4.6.2](https://github.com/QingWei-Li/docsify/compare/v4.6.1...v4.6.2) (2018-02-14)
+
+### Bug Fixes
+
+- **embed:** broken in IE, fixed [#389](https://github.com/QingWei-Li/docsify/issues/389), fixed [#391](https://github.com/QingWei-Li/docsify/issues/391) ([45a7464](https://github.com/QingWei-Li/docsify/commit/45a7464))
+- **embed:** init value ([890a7bf](https://github.com/QingWei-Li/docsify/commit/890a7bf))
+
+
+
+## [4.6.1](https://github.com/QingWei-Li/docsify/compare/v4.6.0...v4.6.1) (2018-02-12)
+
+### Bug Fixes
+
+- **embed** compatible ssr ([dc0c3ce](https://github.com/QingWei-Li/docsify/commit/dc0c3ce))
+- **embed** async fetch embed files, fixed [#387](https://github.com/QingWei-Li/docsify/issues/387)
+
+
+
+# [4.6.0](https://github.com/QingWei-Li/docsify/compare/v4.5.9...v4.6.0) (2018-02-11)
+
+### Bug Fixes
+
+- **search:** custom clear button, fixed [#271](https://github.com/QingWei-Li/docsify/issues/271) ([864aa18](https://github.com/QingWei-Li/docsify/commit/864aa18))
+- **search:** escape special characters for search, fixed [#369](https://github.com/QingWei-Li/docsify/issues/369) ([9755439](https://github.com/QingWei-Li/docsify/commit/9755439))
+- build config ([342438f](https://github.com/QingWei-Li/docsify/commit/342438f))
+- button style for coverpage, fixed [#362](https://github.com/QingWei-Li/docsify/issues/362) ([85428ef](https://github.com/QingWei-Li/docsify/commit/85428ef))
+- dropdown scroll style, fixed [#346](https://github.com/QingWei-Li/docsify/issues/346) ([c4d83f2](https://github.com/QingWei-Li/docsify/commit/c4d83f2))
+- highlight homepage link, fixed [#304](https://github.com/QingWei-Li/docsify/issues/304) ([f960c19](https://github.com/QingWei-Li/docsify/commit/f960c19))
+- homepage link ([e097f88](https://github.com/QingWei-Li/docsify/commit/e097f88))
+- onlyCover ([033be4f](https://github.com/QingWei-Li/docsify/commit/033be4f))
+- ssr compatible embedd ([ebc10c4](https://github.com/QingWei-Li/docsify/commit/ebc10c4))
+- ssr coverpage, fixed [#273](https://github.com/QingWei-Li/docsify/issues/273) ([9e824a4](https://github.com/QingWei-Li/docsify/commit/9e824a4))
+
+### Features
+
+- click sidebar menu add collapse and expand, close [#294](https://github.com/QingWei-Li/docsify/issues/294) ([5e161a1](https://github.com/QingWei-Li/docsify/commit/5e161a1))
+- **compiler:** support embedded file as code block, close [#134](https://github.com/QingWei-Li/docsify/issues/134) ([761ccc2](https://github.com/QingWei-Li/docsify/commit/761ccc2))
+- **compiler:** support embedded markdown, html, video, etc files, close [#383](https://github.com/QingWei-Li/docsify/issues/383), close [#333](https://github.com/QingWei-Li/docsify/issues/333) ([524f52f](https://github.com/QingWei-Li/docsify/commit/524f52f))
+- **cover:** add onlyCover option, close [#382](https://github.com/QingWei-Li/docsify/issues/382) ([b265fdd](https://github.com/QingWei-Li/docsify/commit/b265fdd))
+- **fetch:** add requestHeaders option, fixed [#336](https://github.com/QingWei-Li/docsify/issues/336) ([54ab4c9](https://github.com/QingWei-Li/docsify/commit/54ab4c9))
+- **render:** add ext option for custom file extenstion, close [#340](https://github.com/QingWei-Li/docsify/issues/340) ([248aa72](https://github.com/QingWei-Li/docsify/commit/248aa72))
+- **render:** mutilple coverpage, close [#315](https://github.com/QingWei-Li/docsify/issues/315) ([f68ddf5](https://github.com/QingWei-Li/docsify/commit/f68ddf5))
+
+
+
+## [4.5.9](https://github.com/QingWei-Li/docsify/compare/v4.5.8...v4.5.9) (2018-02-07)
+
+### Bug Fixes
+
+- upgrade marked ([4157173](https://github.com/QingWei-Li/docsify/commit/4157173))
+
+
+
+## [4.5.8](https://github.com/QingWei-Li/docsify/compare/v4.5.6...v4.5.8) (2018-02-07)
+
+### Bug Fixes
+
+- cover style, fixed [#381](https://github.com/QingWei-Li/docsify/issues/381) ([368754e](https://github.com/QingWei-Li/docsify/commit/368754e))
+- updated deps ([#337](https://github.com/QingWei-Li/docsify/issues/337)) ([a12d393](https://github.com/QingWei-Li/docsify/commit/a12d393))
+
+
+
+## [4.5.7](https://github.com/QingWei-Li/docsify/compare/v4.5.6...v4.5.7) (2017-12-29)
+
+### Features
+
+- add navigation plugin, closed [#180](https://github.com/QingWei-Li/docsify/issues/180) ([f78be4c](https://github.com/QingWei-Li/docsify/commit/f78be4c))
+
+
+
+## [4.5.6](https://github.com/QingWei-Li/docsify/compare/v4.5.3...v4.5.6) (2017-12-14)
+
+### Bug Fixes
+
+- **style:** increase the tap targets of menu button, fixed [#325](https://github.com/QingWei-Li/docsify/issues/325) ([888f217](https://github.com/QingWei-Li/docsify/commit/888f217))
+
+
+
+## [4.5.5](https://github.com/QingWei-Li/docsify/compare/v4.5.4...v4.5.5) (2017-11-30)
+
+### Bug Fixes
+
+- disqus plugin issue ([#318](https://github.com/QingWei-Li/docsify/issues/318)) ([041b33e](https://github.com/QingWei-Li/docsify/commit/041b33e)), closes [#317](https://github.com/QingWei-Li/docsify/issues/317)
+
+
+
+## [4.5.4](https://github.com/QingWei-Li/docsify/compare/v4.5.2...v4.5.4) (2017-11-29)
+
+### Bug Fixes
+
+- **compiler:** task lists style, fixed [#215](https://github.com/QingWei-Li/docsify/issues/215) ([e43ded4](https://github.com/QingWei-Li/docsify/commit/e43ded4))
+
+### Features
+
+- add gitalk plugin ([#306](https://github.com/QingWei-Li/docsify/issues/306)) ([9208e64](https://github.com/QingWei-Li/docsify/commit/9208e64))
+
+
+
+## [4.5.3](https://github.com/QingWei-Li/docsify/compare/v4.5.2...v4.5.3) (2017-11-11)
+
+### Features
+
+- add gitalk plugin ([#306](https://github.com/QingWei-Li/docsify/issues/306)) ([9208e64](https://github.com/QingWei-Li/docsify/commit/9208e64))
+
+
+
+## [4.5.2](https://github.com/QingWei-Li/docsify/compare/v4.5.1...v4.5.2) (2017-11-09)
+
+### Features
+
+- github task lists, close [#215](https://github.com/QingWei-Li/docsify/issues/215) ([#305](https://github.com/QingWei-Li/docsify/issues/305)) ([d486eef](https://github.com/QingWei-Li/docsify/commit/d486eef))
+
+
+
+## [4.5.1](https://github.com/QingWei-Li/docsify/compare/v4.5.0...v4.5.1) (2017-11-07)
+
+### Features
+
+- fetch files with the query params, fixed [#303](https://github.com/QingWei-Li/docsify/issues/303) ([2a2ed96](https://github.com/QingWei-Li/docsify/commit/2a2ed96))
+
+
+
+# [4.5.0](https://github.com/QingWei-Li/docsify/compare/v4.4.1...v4.5.0) (2017-11-04)
+
+### Features
+
+- add disqus plugin, closed [#123](https://github.com/QingWei-Li/docsify/issues/123) ([fd7d4e0](https://github.com/QingWei-Li/docsify/commit/fd7d4e0))
+
+
+
+## [4.4.1](https://github.com/QingWei-Li/docsify/compare/v4.4.0...v4.4.1) (2017-10-31)
+
+### Bug Fixes
+
+- {docsify-ignore-all} and {docsify-ignore} bug ([#299](https://github.com/QingWei-Li/docsify/issues/299)) ([cc98f56](https://github.com/QingWei-Li/docsify/commit/cc98f56))
+- zoom image plugin issue, fixed [#187](https://github.com/QingWei-Li/docsify/issues/187) ([#300](https://github.com/QingWei-Li/docsify/issues/300)) ([fa772cf](https://github.com/QingWei-Li/docsify/commit/fa772cf))
+
+
+
+# [4.4.0](https://github.com/QingWei-Li/docsify/compare/v4.3.15...v4.4.0) (2017-10-30)
+
+### Bug Fixes
+
+- sidebar style issue on firefox, fixed [#184](https://github.com/QingWei-Li/docsify/issues/184) ([#297](https://github.com/QingWei-Li/docsify/issues/297)) ([36bfc9d](https://github.com/QingWei-Li/docsify/commit/36bfc9d))
+
+### Features
+
+- add helper for disabled link, fixed [#295](https://github.com/QingWei-Li/docsify/issues/295) ([#296](https://github.com/QingWei-Li/docsify/issues/296)) ([4ad96f3](https://github.com/QingWei-Li/docsify/commit/4ad96f3))
+
+
+
+## [4.3.15](https://github.com/QingWei-Li/docsify/compare/v4.3.14...v4.3.15) (2017-10-20)
+
+### Bug Fixes
+
+- scroll active sidebar ([a2b8eae](https://github.com/QingWei-Li/docsify/commit/a2b8eae))
+
+
+
+## [4.3.14](https://github.com/QingWei-Li/docsify/compare/v4.3.13...v4.3.14) (2017-10-20)
+
+### Bug Fixes
+
+- codesponsor style ([ab68268](https://github.com/QingWei-Li/docsify/commit/ab68268))
+
+
+
+## [4.3.13](https://github.com/QingWei-Li/docsify/compare/v4.3.12...v4.3.13) (2017-10-17)
+
+### Bug Fixes
+
+- duplicate results in search fixed [#257](https://github.com/QingWei-Li/docsify/issues/257) ([#284](https://github.com/QingWei-Li/docsify/issues/284)) ([3476f6f](https://github.com/QingWei-Li/docsify/commit/3476f6f))
+
+### Features
+
+- make whole search result clickable ([#285](https://github.com/QingWei-Li/docsify/issues/285)) ([1b91227](https://github.com/QingWei-Li/docsify/commit/1b91227))
+
+
+
+## [4.3.12](https://github.com/QingWei-Li/docsify/compare/v4.3.11...v4.3.12) (2017-10-15)
+
+### Bug Fixes
+
+- incorrect active link ([#281](https://github.com/QingWei-Li/docsify/issues/281)) ([a3ab379](https://github.com/QingWei-Li/docsify/commit/a3ab379))
+
+
+
+## [4.3.11](https://github.com/QingWei-Li/docsify/compare/v4.3.10...v4.3.11) (2017-10-15)
+
+### Bug Fixes
+
+- broken links to same page heading, fix [#278](https://github.com/QingWei-Li/docsify/issues/278), fix [#279](https://github.com/QingWei-Li/docsify/issues/279) ([91d6337](https://github.com/QingWei-Li/docsify/commit/91d6337))
+
+
+
+## [4.3.10](https://github.com/QingWei-Li/docsify/compare/v4.3.9...v4.3.10) (2017-10-12)
+
+### Bug Fixes
+
+- link render issue after page refreshing ([#276](https://github.com/QingWei-Li/docsify/issues/276)) ([abd885e](https://github.com/QingWei-Li/docsify/commit/abd885e))
+
+
+
+## [4.3.9](https://github.com/QingWei-Li/docsify/compare/v4.3.8...v4.3.9) (2017-10-11)
+
+### Bug Fixes
+
+- scroll issue in IE ([#275](https://github.com/QingWei-Li/docsify/issues/275)) ([3e94cb6](https://github.com/QingWei-Li/docsify/commit/3e94cb6))
+
+
+
+## [4.3.8](https://github.com/QingWei-Li/docsify/compare/v4.3.7...v4.3.8) (2017-10-07)
+
+### Bug Fixes
+
+- **slugify:** GitHub compatible heading links, fixed [#272](https://github.com/QingWei-Li/docsify/issues/272) ([9b4e666](https://github.com/QingWei-Li/docsify/commit/9b4e666))
+
+
+
+## [4.3.7](https://github.com/QingWei-Li/docsify/compare/v4.3.6...v4.3.7) (2017-10-02)
+
+### Bug Fixes
+
+- **slugify:** GitHub compatible heading links, fixed [#267](https://github.com/QingWei-Li/docsify/issues/267) ([c195d2d](https://github.com/QingWei-Li/docsify/commit/c195d2d))
+
+
+
+## [4.3.6](https://github.com/QingWei-Li/docsify/compare/v4.3.5...v4.3.6) (2017-09-21)
+
+### Bug Fixes
+
+- style for codesponsor plugin ([08afec7](https://github.com/QingWei-Li/docsify/commit/08afec7))
+
+
+
+## [4.3.5](https://github.com/QingWei-Li/docsify/compare/v4.3.4...v4.3.5) (2017-09-20)
+
+### Bug Fixes
+
+- missed symbol ([#254](https://github.com/QingWei-Li/docsify/issues/254)) ([6c702d3](https://github.com/QingWei-Li/docsify/commit/6c702d3))
+
+### Features
+
+- **plugin:** add codesponsor plugin ([46ac4c3](https://github.com/QingWei-Li/docsify/commit/46ac4c3))
+
+
+
+## [4.3.4](https://github.com/QingWei-Li/docsify/compare/v4.3.3...v4.3.4) (2017-09-07)
+
+### Bug Fixes
+
+- scroll position issue, fixed [#234](https://github.com/QingWei-Li/docsify/issues/234) ([388ed3d](https://github.com/QingWei-Li/docsify/commit/388ed3d))
+
+
+
+## [4.3.3](https://github.com/QingWei-Li/docsify/compare/v4.3.2...v4.3.3) (2017-09-06)
+
+### Bug Fixes
+
+- **buble.css:** tweaks code block style, fixed [#249](https://github.com/QingWei-Li/docsify/issues/249) ([9d43051](https://github.com/QingWei-Li/docsify/commit/9d43051))
+
+### Features
+
+- add doc for react and vue demo box plugin ([#247](https://github.com/QingWei-Li/docsify/issues/247)) ([f0aca19](https://github.com/QingWei-Li/docsify/commit/f0aca19))
+
+
+
+## [4.3.2](https://github.com/QingWei-Li/docsify/compare/v4.3.1...v4.3.2) (2017-09-01)
+
+### Bug Fixes
+
+- sidebar highlight ([f82f419](https://github.com/QingWei-Li/docsify/commit/f82f419))
+
+### Features
+
+- add Edit on github plugin (thanks [@njleonzhang](https://github.com/njleonzhang)) ([a0e1ea8](https://github.com/QingWei-Li/docsify/commit/a0e1ea8))
+
+
+
+## [4.3.1](https://github.com/QingWei-Li/docsify/compare/v4.2.9...v4.3.1) (2017-08-30)
+
+### Features
+
+- **markdown:** supports mermaid [#137](https://github.com/QingWei-Li/docsify/issues/137) ([f4800e0](https://github.com/QingWei-Li/docsify/commit/f4800e0))
+
+
+
+# [4.3.0](https://github.com/QingWei-Li/docsify/compare/v4.2.9...v4.3.0) (2017-08-17)
+
+### Features
+
+- **markdown:** supports mermaid [#137](https://github.com/QingWei-Li/docsify/issues/137) ([f4800e0](https://github.com/QingWei-Li/docsify/commit/f4800e0))
+
+
+
+## [4.2.9](https://github.com/QingWei-Li/docsify/compare/v4.2.8...v4.2.9) (2017-08-15)
+
+### Bug Fixes
+
+- ensure document ready before init Docsify [#233](https://github.com/QingWei-Li/docsify/issues/233)
+
+
+
+## [4.2.8](https://github.com/QingWei-Li/docsify/compare/v4.2.7...v4.2.8) (2017-08-10)
+
+### Features
+
+- **compiler:** support for setting target attribute for link, fixed [#230](https://github.com/QingWei-Li/docsify/issues/230) ([7f270f9](https://github.com/QingWei-Li/docsify/commit/7f270f9))
+
+
+
+## [4.2.7](https://github.com/QingWei-Li/docsify/compare/v4.2.4...v4.2.7) (2017-08-05)
+
+### Bug Fixes
+
+- **release:** release shell ([628e211](https://github.com/QingWei-Li/docsify/commit/628e211))
+- **style:** nowrap => pre-wrap, fixed [#228](https://github.com/QingWei-Li/docsify/issues/228) ([a88252c](https://github.com/QingWei-Li/docsify/commit/a88252c))
+
+
+
+## [4.2.6](https://github.com/QingWei-Li/docsify/compare/v4.2.4...v4.2.6) (2017-07-27)
+
+### Bug Fixes
+
+- **css:** hide the nav when the content has not yet been loaded ([1fa1619](https://github.com/QingWei-Li/docsify/commit/1fa1619))
+- **release:** release shell ([628e211](https://github.com/QingWei-Li/docsify/commit/628e211))
+
+
+
+## [4.2.4](https://github.com/QingWei-Li/docsify/compare/v4.2.2...v4.2.4) (2017-07-26)
+
+### Bug Fixes
+
+- **render:** Remove getRootNode to be compatible with the lower version of Chrome, fixed [#225](https://github.com/QingWei-Li/docsify/issues/225) ([b8dd346](https://github.com/QingWei-Li/docsify/commit/b8dd346))
+
+
+
+## [4.2.3](https://github.com/QingWei-Li/docsify/compare/v4.2.2...v4.2.3) (2017-07-26)
+
+### Features
+
+- **search:** Supports the max depth of the search headline, fixed [#223](https://github.com/QingWei-Li/docsify/issues/223), resolve [#129](https://github.com/QingWei-Li/docsify/issues/129) ([b7b589b](https://github.com/QingWei-Li/docsify/commit/b7b589b))
+
+
+
+## [4.2.2](https://github.com/QingWei-Li/docsify/compare/v4.2.1...v4.2.2) (2017-07-24)
+
+### Bug Fixes
+
+- style rerender due to setting themeColor ([17ff3d1](https://github.com/QingWei-Li/docsify/commit/17ff3d1))
+
+
+
+## [4.2.1](https://github.com/QingWei-Li/docsify/compare/v4.2.0...v4.2.1) (2017-07-19)
+
+- give the navbar some line-height (#216)
+- Remove unnecessary moduleName option from rollup config for plugins (#209)
+
+
+
+# [4.2.0](https://github.com/QingWei-Li/docsify/compare/v4.1.14...v4.2.0) (2017-07-10)
+
+### Bug Fixes
+
+- not found page ([9af8559](https://github.com/QingWei-Li/docsify/commit/9af8559))
+
+### Features
+
+- alias option supports regexp, resolve [#183](https://github.com/QingWei-Li/docsify/issues/183) ([c4aa22c](https://github.com/QingWei-Li/docsify/commit/c4aa22c))
+- ignore to compiled link, fixed [#203](https://github.com/QingWei-Li/docsify/issues/203) ([#204](https://github.com/QingWei-Li/docsify/issues/204)) ([2e00f4c](https://github.com/QingWei-Li/docsify/commit/2e00f4c))
+
+
+
+## [4.1.14](https://github.com/QingWei-Li/docsify/compare/v4.1.13...v4.1.14) (2017-06-24)
+
+### Bug Fixes
+
+- get file path, fixed jrappen/sublime-distractionless/commit/81bfadd391428823191cc03eca956a2312e04d13#commitcomment-22427070 ([e8117e5](https://github.com/QingWei-Li/docsify/commit/e8117e5)), closes [jrappen/sublime-distractionless/commit/81bfadd391428823191cc03eca956a2312e04d13#commitcomment-22427070](https://github.com/jrappen/sublime-distractionless/commit/81bfadd391428823191cc03eca956a2312e04d13/issues/commitcomment-22427070)
+
+### Features
+
+- add context attribute, fixed [#191](https://github.com/QingWei-Li/docsify/issues/191) ([ce0e9ac](https://github.com/QingWei-Li/docsify/commit/ce0e9ac))
+
+
+
+## [4.1.13](https://github.com/QingWei-Li/docsify/compare/v4.1.12...v4.1.13) (2017-06-11)
+
+
+
+## [4.1.12](https://github.com/QingWei-Li/docsify/compare/v4.1.11...v4.1.12) (2017-06-03)
+
+### Bug Fixes
+
+- **render:** subtitle in side bar shows undefined, fixed [#182](https://github.com/QingWei-Li/docsify/issues/182) ([d087d57](https://github.com/QingWei-Li/docsify/commit/d087d57))
+
+
+
+## [4.1.11](https://github.com/QingWei-Li/docsify/compare/v4.1.10...v4.1.11) (2017-06-02)
+
+### Bug Fixes
+
+- **compiler:** force reset toc when rendering sidebar fixed [#181](https://github.com/QingWei-Li/docsify/issues/181) ([ccf4c7c](https://github.com/QingWei-Li/docsify/commit/ccf4c7c))
+- **render:** autoHeader does not work ([1304d2e](https://github.com/QingWei-Li/docsify/commit/1304d2e))
+
+
+
+## [4.1.10](https://github.com/QingWei-Li/docsify/compare/v4.1.9...v4.1.10) (2017-06-02)
+
+### Bug Fixes
+
+- **hash:** hash routing crashes when url has querystring ([6d48ce1](https://github.com/QingWei-Li/docsify/commit/6d48ce1))
+
+
+
+## [4.1.9](https://github.com/QingWei-Li/docsify/compare/v4.1.8...v4.1.9) (2017-05-31)
+
+### Bug Fixes
+
+- can't render toc on first load ([d9b487e](https://github.com/QingWei-Li/docsify/commit/d9b487e))
+- **lifecycle:** continue to handle data ([955d3d5](https://github.com/QingWei-Li/docsify/commit/955d3d5))
+- **render:** broken name link, fixed [#167](https://github.com/QingWei-Li/docsify/issues/167) ([91b66a5](https://github.com/QingWei-Li/docsify/commit/91b66a5))
+
+
+
+## [4.1.8](https://github.com/QingWei-Li/docsify/compare/v4.1.7...v4.1.8) (2017-05-31)
+
+### Bug Fixes
+
+- auto replace version ([22b50f0](https://github.com/QingWei-Li/docsify/commit/22b50f0))
+- update edit button demo ([ec887c1](https://github.com/QingWei-Li/docsify/commit/ec887c1))
+
+### Features
+
+- add edit button demo ([a64cee1](https://github.com/QingWei-Li/docsify/commit/a64cee1))
+- add edit button demo, close [#162](https://github.com/QingWei-Li/docsify/issues/162) ([036fdac](https://github.com/QingWei-Li/docsify/commit/036fdac))
+
+
+
+## [4.1.7](https://github.com/QingWei-Li/docsify/compare/v4.1.6...v4.1.7) (2017-05-30)
+
+### Bug Fixes
+
+- **ssr:** clean files ([0014895](https://github.com/QingWei-Li/docsify/commit/0014895))
+
+
+
+## [4.1.6](https://github.com/QingWei-Li/docsify/compare/v4.1.5...v4.1.6) (2017-05-30)
+
+### Bug Fixes
+
+- **ssr:** add debug ([6b9e092](https://github.com/QingWei-Li/docsify/commit/6b9e092))
+
+
+
+## [4.1.5](https://github.com/QingWei-Li/docsify/compare/v4.1.4...v4.1.5) (2017-05-30)
+
+### Bug Fixes
+
+- **ssr:** missing package ([6db8c9e](https://github.com/QingWei-Li/docsify/commit/6db8c9e))
+
+
+
+## [4.1.4](https://github.com/QingWei-Li/docsify/compare/v4.1.3...v4.1.4) (2017-05-30)
+
+### Bug Fixes
+
+- **ssr:** file path ([79a83bc](https://github.com/QingWei-Li/docsify/commit/79a83bc))
+
+
+
+## [4.1.3](https://github.com/QingWei-Li/docsify/compare/v4.1.2...v4.1.3) (2017-05-30)
+
+### Bug Fixes
+
+- update babel config ([9825db4](https://github.com/QingWei-Li/docsify/commit/9825db4))
+
+
+
+## [4.1.2](https://github.com/QingWei-Li/docsify/compare/v4.1.1...v4.1.2) (2017-05-30)
+
+### Bug Fixes
+
+- update babel config ([80dba19](https://github.com/QingWei-Li/docsify/commit/80dba19))
+
+
+
+## [4.1.1](https://github.com/QingWei-Li/docsify/compare/v4.1.0...v4.1.1) (2017-05-30)
+
+### Bug Fixes
+
+- build for ssr package ([4cb20a5](https://github.com/QingWei-Li/docsify/commit/4cb20a5))
+- remove history mode ([0e74e6c](https://github.com/QingWei-Li/docsify/commit/0e74e6c))
+
+
+
+# [4.1.0](https://github.com/QingWei-Li/docsify/compare/v4.0.2...v4.1.0) (2017-05-30)
+
+
+
+## [4.0.2](https://github.com/QingWei-Li/docsify/compare/v4.0.1...v4.0.2) (2017-05-30)
+
+### Bug Fixes
+
+- basePath for history mode ([fc1cd3f](https://github.com/QingWei-Li/docsify/commit/fc1cd3f))
+
+
+
+## [4.0.1](https://github.com/QingWei-Li/docsify/compare/v4.0.0...v4.0.1) (2017-05-29)
+
+### Bug Fixes
+
+- **ssr:** remove context ([4626157](https://github.com/QingWei-Li/docsify/commit/4626157))
+- lint ([b764b6e](https://github.com/QingWei-Li/docsify/commit/b764b6e))
+
+
+
+# [4.0.0](https://github.com/QingWei-Li/docsify/compare/v3.7.3...v4.0.0) (2017-05-29)
+
+### Bug Fixes
+
+- **render:** init event in ssr ([eba1c98](https://github.com/QingWei-Li/docsify/commit/eba1c98))
+- lint ([1f4514d](https://github.com/QingWei-Li/docsify/commit/1f4514d))
+
+### Features
+
+- finish ssr ([3444884](https://github.com/QingWei-Li/docsify/commit/3444884))
+- init ocsify-server-renderer ([6dea685](https://github.com/QingWei-Li/docsify/commit/6dea685))
+- support history mode ([f095eb8](https://github.com/QingWei-Li/docsify/commit/f095eb8))
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..77d2ce7
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,67 @@
+# Contribute
+
+## Introduction
+
+First, thank you for considering contributing to docsify! It's people like you that make the open source community such a great community! 😊
+
+We welcome any type of contribution, not only code. You can help with
+- **QA**: file bug reports, the more details you can give the better (e.g. screenshots with the console open)
+- **Marketing**: writing blog posts, howto's, printing stickers, ...
+- **Community**: presenting the project at meetups, organizing a dedicated meetup for the local community, ...
+- **Code**: take a look at the [open issues](issues). Even if you can't write code, commenting on them, showing that you care about a given issue matters. It helps us triage them.
+- **Money**: we welcome financial contributions in full transparency on our [open collective](https://opencollective.com/docsify).
+
+## Your First Contribution
+
+Working on your first Pull Request? You can learn how from this *free* series, [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github).
+
+## Submitting code
+
+Any code change should be submitted as a pull request. The description should explain what the code does and give steps to execute it. The pull request should also contain tests.
+
+## Code review process
+
+The bigger the pull request, the longer it will take to review and merge. Try to break down large pull requests in smaller chunks that are easier to review and merge.
+It is also always helpful to have some context for your pull request. What was the purpose? Why does it matter to you?
+
+## Financial contributions
+
+We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/docsify).
+Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed.
+
+## Questions
+
+If you have any questions, create an [issue](issue) (protip: do a quick search first to see if someone else didn't ask the same question before!).
+You can also reach us at hello@docsify.opencollective.com.
+
+## Credits
+
+### Contributors
+
+Thank you to all the people who have already contributed to docsify!
+
+
+
+### Backers
+
+Thank you to all our backers! [[Become a backer](https://opencollective.com/docsify#backer)]
+
+
+
+
+### Sponsors
+
+Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/docsify#sponsor))
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/HISTORY.md b/HISTORY.md
new file mode 100644
index 0000000..fb720fd
--- /dev/null
+++ b/HISTORY.md
@@ -0,0 +1,736 @@
+
+
+## [3.7.3](https://github.com/QingWei-Li/docsify/compare/v3.7.2...v3.7.3) (2017-05-22)
+
+
+### Bug Fixes
+
+* **render:** find => filter ([eca3368](https://github.com/QingWei-Li/docsify/commit/eca3368))
+
+
+
+
+## [3.7.2](https://github.com/QingWei-Li/docsify/compare/v3.7.1...v3.7.2) (2017-05-19)
+
+
+
+
+## [3.7.1](https://github.com/QingWei-Li/docsify/compare/v3.7.0...v3.7.1) (2017-05-19)
+
+
+### Bug Fixes
+
+* docsify-updated is undefined ([b2b4742](https://github.com/QingWei-Li/docsify/commit/b2b4742))
+
+
+
+
+# [3.7.0](https://github.com/QingWei-Li/docsify/compare/v3.6.6...v3.7.0) (2017-05-16)
+
+
+### Features
+
+* add docsify-updated, close [#158](https://github.com/QingWei-Li/docsify/issues/158) ([d2be5ae](https://github.com/QingWei-Li/docsify/commit/d2be5ae))
+* add externalLinkTarget, close [#149](https://github.com/QingWei-Li/docsify/issues/149) ([2d73285](https://github.com/QingWei-Li/docsify/commit/2d73285))
+
+
+
+
+## [3.6.6](https://github.com/QingWei-Li/docsify/compare/v3.6.5...v3.6.6) (2017-05-06)
+
+
+### Features
+
+* support query string for the search, fixed [#156](https://github.com/QingWei-Li/docsify/issues/156) ([da75d70](https://github.com/QingWei-Li/docsify/commit/da75d70))
+
+
+
+
+## [3.6.5](https://github.com/QingWei-Li/docsify/compare/v3.6.4...v3.6.5) (2017-04-28)
+
+
+### Bug Fixes
+
+* **util:** fix crash, fixed [#154](https://github.com/QingWei-Li/docsify/issues/154) ([51832d3](https://github.com/QingWei-Li/docsify/commit/51832d3))
+
+
+
+
+## [3.6.4](https://github.com/QingWei-Li/docsify/compare/v3.6.3...v3.6.4) (2017-04-28)
+
+
+### Bug Fixes
+
+* **util:** correctly clean up duplicate slashes, fixed [#153](https://github.com/QingWei-Li/docsify/issues/153) ([76c041a](https://github.com/QingWei-Li/docsify/commit/76c041a))
+
+
+
+
+## [3.6.3](https://github.com/QingWei-Li/docsify/compare/v3.6.2...v3.6.3) (2017-04-25)
+
+
+### Bug Fixes
+
+* **external-script:** script attrs ([2653849](https://github.com/QingWei-Li/docsify/commit/2653849))
+
+
+
+
+## [3.6.2](https://github.com/QingWei-Li/docsify/compare/v3.6.0...v3.6.2) (2017-04-12)
+
+
+### Features
+
+* **event:** Collapse the sidebar when click outside element in the small screen ([9b7e5f5](https://github.com/QingWei-Li/docsify/commit/9b7e5f5))
+* **external-script:** detect more than one script dom, fixed [#146](https://github.com/QingWei-Li/docsify/issues/146) ([94d6603](https://github.com/QingWei-Li/docsify/commit/94d6603))
+
+
+
+
+# [3.6.0](https://github.com/QingWei-Li/docsify/compare/v3.5.2...v3.6.0) (2017-04-09)
+
+
+### Features
+
+* **render:** add mergeNavbar option, close [#125](https://github.com/QingWei-Li/docsify/issues/125), [#124](https://github.com/QingWei-Li/docsify/issues/124) ([#145](https://github.com/QingWei-Li/docsify/issues/145)) ([9220523](https://github.com/QingWei-Li/docsify/commit/9220523))
+
+
+
+
+## [3.5.2](https://github.com/QingWei-Li/docsify/compare/v3.5.1...v3.5.2) (2017-04-05)
+
+
+
+
+## [3.5.1](https://github.com/QingWei-Li/docsify/compare/v3.5.0...v3.5.1) (2017-03-25)
+
+
+### Bug Fixes
+
+* .md file extension regex ([594299f](https://github.com/QingWei-Li/docsify/commit/594299f))
+
+
+
+
+# [3.5.0](https://github.com/QingWei-Li/docsify/compare/v3.4.4...v3.5.0) (2017-03-25)
+
+
+### Bug Fixes
+
+* adjust display on small screens ([bf35471](https://github.com/QingWei-Li/docsify/commit/bf35471))
+* navbar labels for German ([b022aaf](https://github.com/QingWei-Li/docsify/commit/b022aaf))
+
+
+### Features
+
+* **route:** auto remove .md extension ([8f11653](https://github.com/QingWei-Li/docsify/commit/8f11653))
+
+
+
+
+## [3.4.4](https://github.com/QingWei-Li/docsify/compare/v3.4.3...v3.4.4) (2017-03-17)
+
+
+### Bug Fixes
+
+* **search:** fix input style ([2d6a51b](https://github.com/QingWei-Li/docsify/commit/2d6a51b))
+
+
+
+
+## [3.4.3](https://github.com/QingWei-Li/docsify/compare/v3.4.2...v3.4.3) (2017-03-16)
+
+
+
+
+## [3.4.2](https://github.com/QingWei-Li/docsify/compare/v3.4.1...v3.4.2) (2017-03-11)
+
+
+### Features
+
+* **emojify:** add no-emoji option ([3aef37a](https://github.com/QingWei-Li/docsify/commit/3aef37a))
+
+
+
+
+## [3.4.1](https://github.com/QingWei-Li/docsify/compare/v3.4.0...v3.4.1) (2017-03-10)
+
+
+### Bug Fixes
+
+* **dom:** Disable the dom cache when vue is present, fixed [#119](https://github.com/QingWei-Li/docsify/issues/119) ([b9a7275](https://github.com/QingWei-Li/docsify/commit/b9a7275))
+
+
+
+
+# [3.4.0](https://github.com/QingWei-Li/docsify/compare/v3.3.0...v3.4.0) (2017-03-09)
+
+
+### Features
+
+* **zoom-image:** add plugin ([50fa6fc](https://github.com/QingWei-Li/docsify/commit/50fa6fc))
+
+
+
+
+# [3.3.0](https://github.com/QingWei-Li/docsify/compare/v3.2.0...v3.3.0) (2017-03-07)
+
+
+
+
+# [3.2.0](https://github.com/QingWei-Li/docsify/compare/v3.1.2...v3.2.0) (2017-02-28)
+
+
+### Bug Fixes
+
+* **fetch:** load sidebar and navbar for parent path, fixed [#100](https://github.com/QingWei-Li/docsify/issues/100) ([f3fc596](https://github.com/QingWei-Li/docsify/commit/f3fc596))
+* **render:** Toc rendering error, fixed [#106](https://github.com/QingWei-Li/docsify/issues/106) ([0d59ee9](https://github.com/QingWei-Li/docsify/commit/0d59ee9))
+
+
+### Features
+
+* **search:** Localization for no data tip, close [#103](https://github.com/QingWei-Li/docsify/issues/103) ([d3c9fbd](https://github.com/QingWei-Li/docsify/commit/d3c9fbd))
+
+
+
+
+## [3.1.2](https://github.com/QingWei-Li/docsify/compare/v3.1.1...v3.1.2) (2017-02-27)
+
+
+
+
+## [3.1.1](https://github.com/QingWei-Li/docsify/compare/v3.1.0...v3.1.1) (2017-02-24)
+
+
+### Bug Fixes
+
+* **render:** custom cover background image ([8f9bf29](https://github.com/QingWei-Li/docsify/commit/8f9bf29))
+* **search:** don't search nameLink, fixed [#102](https://github.com/QingWei-Li/docsify/issues/102) ([507d9e8](https://github.com/QingWei-Li/docsify/commit/507d9e8))
+* **tpl:** extra character, fixed [#101](https://github.com/QingWei-Li/docsify/issues/101) ([d67d25f](https://github.com/QingWei-Li/docsify/commit/d67d25f))
+
+
+
+
+# [3.1.0](https://github.com/QingWei-Li/docsify/compare/v3.0.5...v3.1.0) (2017-02-22)
+
+
+### Bug Fixes
+
+* **search:** incorrect anchor link, fixed [#90](https://github.com/QingWei-Li/docsify/issues/90) ([b8a3d8f](https://github.com/QingWei-Li/docsify/commit/b8a3d8f))
+* **sw:** update white list ([f2975a5](https://github.com/QingWei-Li/docsify/commit/f2975a5))
+
+
+### Features
+
+* **emoji:** add emoji plugin ([855c450](https://github.com/QingWei-Li/docsify/commit/855c450))
+
+
+
+
+## [3.0.5](https://github.com/QingWei-Li/docsify/compare/v3.0.4...v3.0.5) (2017-02-21)
+
+
+### Bug Fixes
+
+* **event:** highlight sidebar when clicked, fixed [#86](https://github.com/QingWei-Li/docsify/issues/86) ([2a1157a](https://github.com/QingWei-Li/docsify/commit/2a1157a))
+* **gen-tree:** cache toc list, fixed [#88](https://github.com/QingWei-Li/docsify/issues/88) ([3394ebb](https://github.com/QingWei-Li/docsify/commit/3394ebb))
+* **layout.css:** loading style ([42b2dba](https://github.com/QingWei-Li/docsify/commit/42b2dba))
+
+
+### Features
+
+* **pwa:** add sw.js ([f7111b5](https://github.com/QingWei-Li/docsify/commit/f7111b5))
+
+
+
+
+## [3.0.4](https://github.com/QingWei-Li/docsify/compare/v3.0.3...v3.0.4) (2017-02-20)
+
+
+### Bug Fixes
+
+* **render:** disable rendering sub list when loadSidebar is false ([35dd2e1](https://github.com/QingWei-Li/docsify/commit/35dd2e1))
+* **render:** execute script ([780c1e5](https://github.com/QingWei-Li/docsify/commit/780c1e5))
+
+
+
+
+## [3.0.3](https://github.com/QingWei-Li/docsify/compare/v3.0.2...v3.0.3) (2017-02-19)
+
+
+
+
+## [3.0.2](https://github.com/QingWei-Li/docsify/compare/v3.0.1...v3.0.2) (2017-02-19)
+
+
+### Bug Fixes
+
+* **compiler:** link ([3b127a1](https://github.com/QingWei-Li/docsify/commit/3b127a1))
+* **search:** add lazy input ([bf593a7](https://github.com/QingWei-Li/docsify/commit/bf593a7))
+
+
+
+
+## [3.0.1](https://github.com/QingWei-Li/docsify/compare/v3.0.0...v3.0.1) (2017-02-19)
+
+
+### Bug Fixes
+
+* **route:** empty alias ([cd99b52](https://github.com/QingWei-Li/docsify/commit/cd99b52))
+
+
+
+
+# [3.0.0](https://github.com/QingWei-Li/docsify/compare/v2.4.3...v3.0.0) (2017-02-19)
+
+
+### Bug Fixes
+
+* **compiler:** link ([c7e09c3](https://github.com/QingWei-Li/docsify/commit/c7e09c3))
+* **render:** support html file ([7b6a2ac](https://github.com/QingWei-Li/docsify/commit/7b6a2ac))
+* **search:** escape html ([fcb66e8](https://github.com/QingWei-Li/docsify/commit/fcb66e8))
+* **search:** fix default config ([2efd859](https://github.com/QingWei-Li/docsify/commit/2efd859))
+
+
+### Features
+
+* **front-matter:** add front matter[WIP] ([dbb9278](https://github.com/QingWei-Li/docsify/commit/dbb9278))
+* **render:** add auto header ([b7768b1](https://github.com/QingWei-Li/docsify/commit/b7768b1))
+* **search:** Localization for search placeholder, close [#80](https://github.com/QingWei-Li/docsify/issues/80) ([2351c3e](https://github.com/QingWei-Li/docsify/commit/2351c3e))
+* **themes:** add loading info ([86594a3](https://github.com/QingWei-Li/docsify/commit/86594a3))
+
+
+
+
+## [2.4.3](https://github.com/QingWei-Li/docsify/compare/v2.4.2...v2.4.3) (2017-02-15)
+
+
+
+
+## [2.4.2](https://github.com/QingWei-Li/docsify/compare/v2.4.1...v2.4.2) (2017-02-14)
+
+
+### Bug Fixes
+
+* **index:** load file path error ([dc536a3](https://github.com/QingWei-Li/docsify/commit/dc536a3))
+
+
+
+
+## [2.4.1](https://github.com/QingWei-Li/docsify/compare/v2.4.0...v2.4.1) (2017-02-13)
+
+
+### Bug Fixes
+
+* **index:** cover page ([dd0c84b](https://github.com/QingWei-Li/docsify/commit/dd0c84b))
+
+
+
+
+# [2.4.0](https://github.com/QingWei-Li/docsify/compare/v2.3.0...v2.4.0) (2017-02-13)
+
+
+### Features
+
+* **hook:** add doneEach ([c6f7602](https://github.com/QingWei-Li/docsify/commit/c6f7602))
+
+
+
+
+# [2.3.0](https://github.com/QingWei-Li/docsify/compare/v2.2.1...v2.3.0) (2017-02-13)
+
+
+### Bug Fixes
+
+* **event:** has no effect on a FF mobile browser, fixed [#67](https://github.com/QingWei-Li/docsify/issues/67) ([0ff36c2](https://github.com/QingWei-Li/docsify/commit/0ff36c2))
+* **render:** custom marked renderer ([bf559b4](https://github.com/QingWei-Li/docsify/commit/bf559b4))
+* **render:** fix render link ([a866744](https://github.com/QingWei-Li/docsify/commit/a866744))
+* **render:** image url ([6f87529](https://github.com/QingWei-Li/docsify/commit/6f87529))
+* **render:** render link ([38ea660](https://github.com/QingWei-Li/docsify/commit/38ea660))
+* **src:** fix route ([324301a](https://github.com/QingWei-Li/docsify/commit/324301a))
+* **src:** get alias ([784173e](https://github.com/QingWei-Li/docsify/commit/784173e))
+* **src:** get alias ([ce99a04](https://github.com/QingWei-Li/docsify/commit/ce99a04))
+* **themes:** fix navbar style ([fa54b52](https://github.com/QingWei-Li/docsify/commit/fa54b52))
+* **themes:** update navbar style ([4864d1b](https://github.com/QingWei-Li/docsify/commit/4864d1b))
+
+
+### Features
+
+* **hook:** support custom plugin ([9e81a59](https://github.com/QingWei-Li/docsify/commit/9e81a59))
+* **src:** add alias feature ([24412cd](https://github.com/QingWei-Li/docsify/commit/24412cd))
+* **src:** dynamic title and fix sidebar style ([6b30eb6](https://github.com/QingWei-Li/docsify/commit/6b30eb6))
+
+
+
+
+## [2.2.1](https://github.com/QingWei-Li/docsify/compare/v2.2.0...v2.2.1) (2017-02-11)
+
+
+### Bug Fixes
+
+* **event:** scroll active sidebar ([50f5fc2](https://github.com/QingWei-Li/docsify/commit/50f5fc2))
+* **search:** crash when not content, fixed [#68](https://github.com/QingWei-Li/docsify/issues/68) ([9d3cc89](https://github.com/QingWei-Li/docsify/commit/9d3cc89))
+* **search:** not work in mobile ([3941304](https://github.com/QingWei-Li/docsify/commit/3941304))
+
+
+
+
+# [2.2.0](https://github.com/QingWei-Li/docsify/compare/v2.1.0...v2.2.0) (2017-02-09)
+
+
+### Features
+
+* **plugins:** add Google Analytics plugin ([#66](https://github.com/QingWei-Li/docsify/issues/66)) ([ac61bb0](https://github.com/QingWei-Li/docsify/commit/ac61bb0))
+
+
+
+
+# [2.1.0](https://github.com/QingWei-Li/docsify/compare/v2.0.3...v2.1.0) (2017-02-09)
+
+
+### Bug Fixes
+
+* render name ([12e2479](https://github.com/QingWei-Li/docsify/commit/12e2479))
+* **vue.css:** update sidebar style ([fc140ef](https://github.com/QingWei-Li/docsify/commit/fc140ef))
+
+
+### Features
+
+* add search, close [#43](https://github.com/QingWei-Li/docsify/issues/43) ([eb5ff3e](https://github.com/QingWei-Li/docsify/commit/eb5ff3e))
+
+
+
+
+## [2.0.3](https://github.com/QingWei-Li/docsify/compare/v2.0.2...v2.0.3) (2017-02-07)
+
+
+### Bug Fixes
+
+* css var polyfill ([8cd386a](https://github.com/QingWei-Li/docsify/commit/8cd386a))
+* css var polyfill ([cbaee21](https://github.com/QingWei-Li/docsify/commit/cbaee21))
+* rendering emojis ([8c7e4d7](https://github.com/QingWei-Li/docsify/commit/8c7e4d7))
+
+
+
+
+## [2.0.2](https://github.com/QingWei-Li/docsify/compare/v2.0.1...v2.0.2) (2017-02-05)
+
+
+### Bug Fixes
+
+* button style in cover page ([4470855](https://github.com/QingWei-Li/docsify/commit/4470855))
+
+
+
+
+## [2.0.1](https://github.com/QingWei-Li/docsify/compare/v2.0.0...v2.0.1) (2017-02-05)
+
+
+
+
+# [2.0.0](https://github.com/QingWei-Li/docsify/compare/v1.10.5...v2.0.0) (2017-02-05)
+
+
+### Features
+
+* customize the theme color ([5cc9f05](https://github.com/QingWei-Li/docsify/commit/5cc9f05))
+
+
+
+
+## [1.10.5](https://github.com/QingWei-Li/docsify/compare/v1.10.4...v1.10.5) (2017-01-28)
+
+
+
+
+## [1.10.4](https://github.com/QingWei-Li/docsify/compare/v1.10.3...v1.10.4) (2017-01-27)
+
+
+
+
+## [1.10.3](https://github.com/QingWei-Li/docsify/compare/v1.10.2...v1.10.3) (2017-01-27)
+
+
+
+
+## [1.10.2](https://github.com/QingWei-Li/docsify/compare/v1.10.1...v1.10.2) (2017-01-25)
+
+
+
+
+## [1.10.1](https://github.com/QingWei-Li/docsify/compare/v1.10.0...v1.10.1) (2017-01-25)
+
+
+
+
+# [1.10.0](https://github.com/QingWei-Li/docsify/compare/v1.9.0...v1.10.0) (2017-01-25)
+
+
+
+
+# [1.9.0](https://github.com/QingWei-Li/docsify/compare/v1.8.0...v1.9.0) (2017-01-24)
+
+
+
+
+# [1.8.0](https://github.com/QingWei-Li/docsify/compare/v1.7.4...v1.8.0) (2017-01-24)
+
+
+
+
+## [1.7.4](https://github.com/QingWei-Li/docsify/compare/v1.7.3...v1.7.4) (2017-01-13)
+
+
+
+
+## [1.7.3](https://github.com/QingWei-Li/docsify/compare/v1.7.2...v1.7.3) (2017-01-13)
+
+
+
+
+## [1.7.2](https://github.com/QingWei-Li/docsify/compare/v1.7.1...v1.7.2) (2017-01-12)
+
+
+
+
+## [1.7.1](https://github.com/QingWei-Li/docsify/compare/v1.7.0...v1.7.1) (2017-01-12)
+
+
+
+
+# [1.7.0](https://github.com/QingWei-Li/docsify/compare/v1.6.1...v1.7.0) (2017-01-12)
+
+
+
+
+## [1.6.1](https://github.com/QingWei-Li/docsify/compare/v1.6.0...v1.6.1) (2017-01-10)
+
+
+
+
+# [1.6.0](https://github.com/QingWei-Li/docsify/compare/v1.5.2...v1.6.0) (2017-01-10)
+
+
+
+
+## [1.5.2](https://github.com/QingWei-Li/docsify/compare/v1.5.1...v1.5.2) (2017-01-10)
+
+
+
+
+## [1.5.1](https://github.com/QingWei-Li/docsify/compare/v1.5.0...v1.5.1) (2017-01-09)
+
+
+
+
+# [1.5.0](https://github.com/QingWei-Li/docsify/compare/v1.4.3...v1.5.0) (2017-01-04)
+
+
+### Features
+
+* Markdown parser is configurable, [#42](https://github.com/QingWei-Li/docsify/issues/42) ([8b1000a](https://github.com/QingWei-Li/docsify/commit/8b1000a))
+
+
+
+
+## [1.4.3](https://github.com/QingWei-Li/docsify/compare/v1.4.2...v1.4.3) (2017-01-01)
+
+
+
+
+## [1.4.2](https://github.com/QingWei-Li/docsify/compare/v1.4.1...v1.4.2) (2016-12-31)
+
+
+
+
+## [1.4.1](https://github.com/QingWei-Li/docsify/compare/v1.4.0...v1.4.1) (2016-12-31)
+
+
+
+
+# [1.4.0](https://github.com/QingWei-Li/docsify/compare/v1.3.5...v1.4.0) (2016-12-31)
+
+
+
+
+## [1.3.5](https://github.com/QingWei-Li/docsify/compare/v1.3.4...v1.3.5) (2016-12-25)
+
+
+
+
+## [1.3.4](https://github.com/QingWei-Li/docsify/compare/v1.3.3...v1.3.4) (2016-12-25)
+
+
+
+
+## [1.3.3](https://github.com/QingWei-Li/docsify/compare/v1.3.2...v1.3.3) (2016-12-23)
+
+
+
+
+## [1.3.2](https://github.com/QingWei-Li/docsify/compare/v1.3.1...v1.3.2) (2016-12-22)
+
+
+
+
+## [1.3.1](https://github.com/QingWei-Li/docsify/compare/v1.3.0...v1.3.1) (2016-12-22)
+
+
+
+
+# [1.3.0](https://github.com/QingWei-Li/docsify/compare/v1.2.0...v1.3.0) (2016-12-21)
+
+
+
+
+# [1.2.0](https://github.com/QingWei-Li/docsify/compare/v1.1.7...v1.2.0) (2016-12-20)
+
+
+
+
+## [1.1.7](https://github.com/QingWei-Li/docsify/compare/v1.1.6...v1.1.7) (2016-12-19)
+
+
+
+
+## [1.1.6](https://github.com/QingWei-Li/docsify/compare/v1.1.5...v1.1.6) (2016-12-18)
+
+
+
+
+## [1.1.5](https://github.com/QingWei-Li/docsify/compare/v1.1.4...v1.1.5) (2016-12-18)
+
+
+
+
+## [1.1.4](https://github.com/QingWei-Li/docsify/compare/v1.1.3...v1.1.4) (2016-12-17)
+
+
+
+
+## [1.1.3](https://github.com/QingWei-Li/docsify/compare/v1.1.2...v1.1.3) (2016-12-17)
+
+
+
+
+## [1.1.2](https://github.com/QingWei-Li/docsify/compare/v1.1.1...v1.1.2) (2016-12-17)
+
+
+
+
+## [1.1.1](https://github.com/QingWei-Li/docsify/compare/v1.1.0...v1.1.1) (2016-12-17)
+
+
+
+
+# [1.1.0](https://github.com/QingWei-Li/docsify/compare/v1.0.3...v1.1.0) (2016-12-16)
+
+
+
+
+## [1.0.3](https://github.com/QingWei-Li/docsify/compare/v1.0.2...v1.0.3) (2016-12-13)
+
+
+
+
+## [1.0.2](https://github.com/QingWei-Li/docsify/compare/v1.0.1...v1.0.2) (2016-12-13)
+
+
+
+
+## [1.0.1](https://github.com/QingWei-Li/docsify/compare/v1.0.0...v1.0.1) (2016-12-08)
+
+
+
+
+# [1.0.0](https://github.com/QingWei-Li/docsify/compare/v0.7.0...v1.0.0) (2016-12-08)
+
+
+
+
+# [0.7.0](https://github.com/QingWei-Li/docsify/compare/v0.6.1...v0.7.0) (2016-11-30)
+
+
+
+
+## [0.6.1](https://github.com/QingWei-Li/docsify/compare/v0.6.0...v0.6.1) (2016-11-29)
+
+
+
+
+# [0.6.0](https://github.com/QingWei-Li/docsify/compare/v0.5.0...v0.6.0) (2016-11-29)
+
+
+
+
+# [0.5.0](https://github.com/QingWei-Li/docsify/compare/v0.4.2...v0.5.0) (2016-11-28)
+
+
+
+
+## [0.4.2](https://github.com/QingWei-Li/docsify/compare/v0.4.1...v0.4.2) (2016-11-28)
+
+
+
+
+## [0.4.1](https://github.com/QingWei-Li/docsify/compare/v0.4.0...v0.4.1) (2016-11-28)
+
+
+
+
+# [0.4.0](https://github.com/QingWei-Li/docsify/compare/v0.3.1...v0.4.0) (2016-11-27)
+
+
+### Features
+
+* custom sidebar, [#4](https://github.com/QingWei-Li/docsify/issues/4) ([#5](https://github.com/QingWei-Li/docsify/issues/5)) ([37e7984](https://github.com/QingWei-Li/docsify/commit/37e7984))
+
+
+
+
+## [0.3.1](https://github.com/QingWei-Li/docsify/compare/v0.3.0...v0.3.1) (2016-11-27)
+
+
+
+
+# [0.3.0](https://github.com/QingWei-Li/docsify/compare/v0.2.1...v0.3.0) (2016-11-27)
+
+
+
+
+## [0.2.1](https://github.com/QingWei-Li/docsify/compare/v0.2.0...v0.2.1) (2016-11-26)
+
+
+
+
+# [0.2.0](https://github.com/QingWei-Li/docsify/compare/v0.1.0...v0.2.0) (2016-11-26)
+
+
+
+
+# [0.1.0](https://github.com/QingWei-Li/docsify/compare/v0.0.5...v0.1.0) (2016-11-26)
+
+
+
+
+## [0.0.5](https://github.com/QingWei-Li/docsify/compare/v0.0.4...v0.0.5) (2016-11-24)
+
+
+
+
+## [0.0.4](https://github.com/QingWei-Li/docsify/compare/v0.0.3...v0.0.4) (2016-11-22)
+
+
+
+
+## [0.0.3](https://github.com/QingWei-Li/docsify/compare/v0.0.2...v0.0.3) (2016-11-20)
+
+
+
+
+## [0.0.2](https://github.com/QingWei-Li/docsify/compare/v0.0.1...v0.0.2) (2016-11-20)
+
+
+
+
+## 0.0.1 (2016-11-20)
diff --git a/LICENSE b/LICENSE
index 4808f79..37a4ac5 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2016 cinwell.li
+Copyright (c) 2016 - present cinwell.li
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 725610c..b8da0d8 100644
--- a/README.md
+++ b/README.md
@@ -1,39 +1,111 @@
-# docsify
-[](https://travis-ci.org/QingWei-Li/docsify)
-[](https://www.npmjs.com/package/docsify)
+
+
+
+
+
->🃏 A magical documentation site generator.
+
+ A magical documentation site generator.
+
+
+
+
+
+
+
+
+
+
+
+Gold Sponsor via Open Collective
+
+
+
+
+
+
## Links
-- [Documentation](https://qingwei-li.github.io/docsify)
-- [CLI](https://github.com/QingWei-Li/docsify-cli)
+
+- [`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)
+- [Awesome docsify](https://github.com/docsifyjs/awesome-docsify)
+- [Community chat](https://gitter.im/docsifyjs/Lobby)
## Features
-- Easy and lightweight
-- Custom themes
-- No build
+
+- No statically built html files
+- Simple and lightweight (~21kB gzipped)
+- Smart full-text search plugin
+- Multiple themes
+- Useful plugin API
+- Compatible with IE11
+- Support SSR ([example](https://github.com/docsifyjs/docsify-ssr-demo))
+- Support embedded files
## Quick start
-Create `404.html` and `README.md` into `/docs`.
-404.html
+Look at [this tutorial](https://docsify.js.org/#/quickstart)
-```html
-
-
-
-
-
-
-
-
-
+[](https://codesandbox.io/s/307qqv236)
+
+## Showcase
+
+These projects are using docsify to generate their sites. Pull requests welcome :blush:
+
+Move to [awesome-docsify](https://github.com/docsifyjs/awesome-docsify#showcase)
+
+## Similar projects
+
+| Project | Description |
+| ------------------------------------------------ | ---------------------------------------- |
+| [docute](https://github.com/egoist/docute) | 📜 Effortlessly documentation done right |
+| [docpress](https://github.com/docpress/docpress) | Documentation website generator |
+
+## Contributing
+
+- Fork it!
+- Create your feature branch: `git checkout -b my-new-feature`
+- Commit your changes: `git commit -am 'Add some feature'`
+- Push to the branch: `git push origin my-new-feature`
+- Submit a pull request
+
+## Development
+
+```bash
+npm run bootstrap && npm run dev
```
-## How to contribute
+## Backers
-- Fork it and clone!
-- Run `npm i && npm run dev`
+Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/docsify#backers)]
+
+
+
+## Sponsors
+
+Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/docsify#silver-sponsors)]
+
+
+
+
+
+
+
+
+
+
+
+
+## Contributors
+
+This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
+
## License
-MIT
+
+[MIT](LICENSE)
+
+[](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fdocsifyjs%2Fdocsify?ref=badge_large)
diff --git a/app.js b/app.js
deleted file mode 100644
index c3b48bc..0000000
--- a/app.js
+++ /dev/null
@@ -1,12 +0,0 @@
-var serveStatic = require('serve-static')
-var http = require('http')
-var fs = require('fs')
-
-http.createServer(function (req, res) {
- serveStatic('.')(req, res, function () {
- res.writeHead(404, { 'Content-Type': 'text/html' })
- res.end(fs.readFileSync('404.dev.html'))
- })
-}).listen(3000)
-
-console.log(`\nListening at http://localhost:3000\n`)
diff --git a/build/build-css.js b/build/build-css.js
deleted file mode 100644
index 48732d2..0000000
--- a/build/build-css.js
+++ /dev/null
@@ -1,20 +0,0 @@
-var fs = require('fs')
-var cssnano = require('cssnano').process
-var resolve = require('path').resolve
-
-var save = function (file, content) {
- fs.writeFileSync(resolve(__dirname, '../lib/themes/', file), content)
-}
-var load = function (file) {
- return fs.readFileSync(resolve(__dirname, '../themes/', file)).toString()
-}
-
-var list = fs.readdirSync(resolve(__dirname, '../themes'))
-
-list.forEach(function (file) {
- cssnano(load(file))
- .then(function (result) {
- save(file, result.css)
- console.log('cssnao - ' + file)
- })
-})
diff --git a/build/build.js b/build/build.js
index b6862ed..7b61224 100644
--- a/build/build.js
+++ b/build/build.js
@@ -1,34 +1,119 @@
-var rollup = require('rollup')
-var buble = require('rollup-plugin-buble')
-var commonjs = require('rollup-plugin-commonjs')
-var nodeResolve = require('rollup-plugin-node-resolve')
-var uglify = require('rollup-plugin-uglify')
+const rollup = require('rollup')
+const buble = require('rollup-plugin-buble')
+const commonjs = require('rollup-plugin-commonjs')
+const nodeResolve = require('rollup-plugin-node-resolve')
+const uglify = require('rollup-plugin-uglify')
+const replace = require('rollup-plugin-replace')
+const isProd = process.env.NODE_ENV === 'production'
+const version = process.env.VERSION || require('../package.json').version
+const chokidar = require('chokidar')
+const path = require('path')
-var build = function (opts) {
+const build = function (opts) {
rollup
.rollup({
- entry: 'src/' + opts.entry,
- plugins: [buble()].concat(opts.plugins || [])
+ input: opts.input,
+ plugins: (opts.plugins || []).concat([
+ buble(),
+ commonjs(),
+ nodeResolve(),
+ replace({
+ __VERSION__: version,
+ 'process.env.SSR': false
+ })
+ ])
})
.then(function (bundle) {
- var dest = 'lib/' + (opts.output || opts.entry)
+ var dest = 'lib/' + (opts.output || opts.input)
console.log(dest)
bundle.write({
- format: 'umd',
- moduleName: opts.moduleName || 'Docsify',
- dest: dest
+ format: 'iife',
+ file: dest,
+ strict: false
})
})
+ .catch(function (err) {
+ console.error(err)
+ })
+}
+const buildCore = function () {
+ build({
+ input: 'src/core/index.js',
+ output: 'docsify.js'
+ })
+
+ if (isProd) {
+ build({
+ input: 'src/core/index.js',
+ output: 'docsify.min.js',
+ plugins: [uglify()]
+ })
+ }
+}
+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'},
+ {name: 'zoom-image', input: 'zoom-image.js'},
+ {name: 'disqus', input: 'disqus.js'},
+ {name: 'gitalk', input: 'gitalk.js'}
+ ]
+
+ plugins.forEach(item => {
+ build({
+ input: 'src/plugins/' + item.input,
+ output: 'plugins/' + item.name + '.js'
+ })
+ })
+
+ if (isProd) {
+ plugins.forEach(item => {
+ build({
+ input: 'src/plugins/' + item.input,
+ output: 'plugins/' + item.name + '.min.js',
+ plugins: [uglify()]
+ })
+ })
+ }
}
-build({
- entry: 'index.js',
- output: 'docsify.js',
- plugins: [commonjs(), nodeResolve()]
-})
-build({
- entry: 'index.js',
- output: 'docsify.min.js',
- plugins: [commonjs(), nodeResolve(), uglify()]
-})
+if (!isProd) {
+ chokidar
+ .watch(['src/core', 'src/plugins'], {
+ atomic: true,
+ awaitWriteFinish: {
+ stabilityThreshold: 1000,
+ pollInterval: 100
+ }
+ })
+ .on('change', p => {
+ console.log('[watch] ', p)
+ const dirs = p.split(path.sep)
+ if (dirs[1] === 'core') {
+ buildCore()
+ } else if (dirs[2]) {
+ const name = path.basename(dirs[2], '.js')
+ const input = `src/plugins/${name}${
+ /\.js/.test(dirs[2]) ? '' : '/index'
+ }.js`
+
+ build({
+ input,
+ output: 'plugins/' + name + '.js'
+ })
+ }
+ })
+ .on('ready', () => {
+ console.log('[start]')
+ buildCore()
+ buildAllPlugin()
+ })
+} else {
+ buildCore()
+ buildAllPlugin()
+}
diff --git a/build/cover.js b/build/cover.js
new file mode 100644
index 0000000..fbd27f7
--- /dev/null
+++ b/build/cover.js
@@ -0,0 +1,14 @@
+var fs = require('fs')
+var read = fs.readFileSync
+var write = fs.writeFileSync
+var version = process.env.VERSION || require('../package.json').version
+
+var file = __dirname + '/../docs/_coverpage.md'
+var cover = read(file, 'utf8').toString()
+
+console.log('Replace version number in cover page...')
+cover = cover.replace(
+ /(\S+)?<\/small>/g,
+ '' + version + ' '
+)
+write(file, cover)
diff --git a/build/mincss.js b/build/mincss.js
new file mode 100644
index 0000000..f6c5ec2
--- /dev/null
+++ b/build/mincss.js
@@ -0,0 +1,12 @@
+const cssnano = require('cssnano').process
+const path = require('path')
+const fs = require('fs')
+
+files = fs.readdirSync(path.resolve('lib/themes'))
+
+files.forEach(file => {
+ file = path.resolve('lib/themes', file)
+ cssnano(fs.readFileSync(file)).then(result => {
+ fs.writeFileSync(file, result.css)
+ })
+})
diff --git a/build/release.sh b/build/release.sh
new file mode 100755
index 0000000..a328322
--- /dev/null
+++ b/build/release.sh
@@ -0,0 +1,50 @@
+set -e
+
+if [[ -z $1 ]]; then
+ echo "Enter new version: "
+ read VERSION
+else
+ VERSION=$1
+fi
+
+read -p "Releasing $VERSION $RELEASE_TAG - are you sure? (y/n) " -n 1 -r
+echo
+if [[ $REPLY =~ ^[Yy]$ ]]; then
+ echo "Releasing $VERSION ..."
+
+ npm run test
+
+ # build
+ VERSION=$VERSION npm run build
+
+ # update packages
+ cd packages/docsify-server-renderer
+ npm version $VERSION
+ if [[ -z $RELEASE_TAG ]]; then
+ npm publish
+ else
+ npm publish --tag $RELEASE_TAG
+ fi
+ cd -
+
+ # commit
+ git add -A
+ git commit -m "[build] $VERSION $RELEASE_TAG"
+ npm --no-git-tag-version version $VERSION --message "[release] $VERSION $RELEASE_TAG"
+
+ # changelog
+ node_modules/.bin/conventional-changelog -p angular -i CHANGELOG.md -s
+
+ git add .
+ git commit -m "chore: add changelog $VERSION"
+
+ # publish
+ git tag v$VERSION
+ git push origin refs/tags/v$VERSION
+ git push
+ if [[ -z $RELEASE_TAG ]]; then
+ npm publish
+ else
+ npm publish --tag $RELEASE_TAG
+ fi
+fi
diff --git a/build/ssr.js b/build/ssr.js
new file mode 100644
index 0000000..16b93ca
--- /dev/null
+++ b/build/ssr.js
@@ -0,0 +1,34 @@
+var rollup = require('rollup')
+var buble = require('rollup-plugin-buble')
+var async = require('rollup-plugin-async')
+var replace = require('rollup-plugin-replace')
+
+rollup
+ .rollup({
+ input: 'packages/docsify-server-renderer/index.js',
+ plugins: [
+ async(),
+ replace({
+ __VERSION__: process.env.VERSION || require('../package.json').version,
+ 'process.env.SSR': true
+ }),
+ buble({
+ transforms: {
+ generator: false
+ }
+ })
+ ],
+ onwarn: function () {}
+ })
+ .then(function (bundle) {
+ var dest = 'packages/docsify-server-renderer/build.js'
+
+ console.log(dest)
+ bundle.write({
+ format: 'cjs',
+ file: dest
+ })
+ })
+ .catch(function (err) {
+ console.error(err)
+ })
diff --git a/docs/.nojekyll b/docs/.nojekyll
new file mode 100644
index 0000000..e69de29
diff --git a/docs/404.html b/docs/404.html
deleted file mode 100644
index bf641c3..0000000
--- a/docs/404.html
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
- Docsify
-
-
-
-
-
-
- En
- 中文
-
-
-
-
-
diff --git a/docs/README.md b/docs/README.md
index 5b439d3..e625420 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -1,146 +1,32 @@
-# docsify
+## docsify
> A magical documentation site generator.
+## What it is
+
+docsify generates your documentation website on the fly. Unlike GitBook, it does not generate static html files. Instead, it smartly loads and parses your Markdown files and displays them as a website. To start using it, all you need to do is create an `index.html` and [deploy it on GitHub Pages](deploy.md).
+
+See the [Quick start](quickstart.md) guide for more details.
+
## Features
-- Easy and lightweight
-- Custom themes
-- No build
-## Quick Start
+- No statically built html files
+- Simple and lightweight (~21kB gzipped)
+- Smart full-text search plugin
+- Multiple themes
+- Useful plugin API
+- Emoji support
+- Compatible with IE11
+- Support server-side rendering ([example](https://github.com/docsifyjs/docsify-ssr-demo))
-### Create a project
-First create a project, then create a `docs` folder
-```shell
-mkdir my-project && cd my-project
-mkdir docs && cd docs
-```
+## Examples
-### Create entry file
-Create a `404.html` file
+Check out the [Showcase](https://github.com/docsifyjs/awesome-docsify#showcase) to see docsify in use.
-```html
-
-
-
-
-
-
-
-
-
-
-
-```
+## Donate
-Create `README.md` as the main page
+Please consider donating if you think docsify is helpful to you or that my work is valuable. I am happy if you can help me [buy a cup of coffee](https://github.com/QingWei-Li/donate). :heart:
-```
-# Title
-
-## balabala
-```
-
-### Deploy!
-Push and open the **GitHub Pages** feature
-
-
-## CLI
-
-Easy to setup and preivew a docs.
-
-### Install
-```shell
-npm i docsify-cli -g
-```
-
-### Setup
-
-Setup a boilerplate docs
-```shell
-docsify init docs
-```
-
-### Preview
-Preview and serve your docs using
-```shell
-docsify serve docs
-```
-
-Read more [docsify-cli](https://github.com/QingWei-Li/docsify-cli)
-
-## Themes
-Currently available `vue.css` and `buble.css`
-```html
-
-
-```
-
-Minified files
-
-```html
-
-
-```
-
-## More
-
-### Multiple pages
-If you need other pages, directly create the markdown file, such as `guide.md` is `/guide`.
-
-### Navbar
-Code in `404.html`
-
-```html
-
- En
- 中文
-
-```
-
-### Options
-
-#### repo
-Display the [GitHub Corner](http://tholman.com/github-corners/) widget.
-
-```html
-
-```
-
-#### max-level
-Toc level.
-
-```html
-
-```
-
-#### el
-Root element.
-
-```html
-
-```
-
-#### sidebar
-
-Custom sidebar. if it'set, the TOC will be disabeld. Bind global variables on the `data-sidebar`.
-
-
-
-```html
-
-
-```
+## Community
+Users and the development team are usually in the [Gitter chat room](https://gitter.im/docsifyjs/Lobby).
diff --git a/docs/_coverpage.md b/docs/_coverpage.md
new file mode 100644
index 0000000..1decbd6
--- /dev/null
+++ b/docs/_coverpage.md
@@ -0,0 +1,12 @@
+
+
+# docsify 4.9.4
+
+> A magical documentation site generator.
+
+- Simple and lightweight (~21kB gzipped)
+- No statically built html files
+- Multiple themes
+
+[GitHub](https://github.com/docsifyjs/docsify/)
+[Getting Started](#docsify)
diff --git a/docs/_images/deploy-github-pages.png b/docs/_images/deploy-github-pages.png
new file mode 100644
index 0000000..278e40b
Binary files /dev/null and b/docs/_images/deploy-github-pages.png differ
diff --git a/docs/_images/nested-navbar.png b/docs/_images/nested-navbar.png
new file mode 100644
index 0000000..25f2341
Binary files /dev/null and b/docs/_images/nested-navbar.png differ
diff --git a/docs/_images/zh-cn/nested-navbar.png b/docs/_images/zh-cn/nested-navbar.png
new file mode 100644
index 0000000..0b2a1c9
Binary files /dev/null and b/docs/_images/zh-cn/nested-navbar.png differ
diff --git a/docs/_media/example.html b/docs/_media/example.html
new file mode 100644
index 0000000..d35ee16
--- /dev/null
+++ b/docs/_media/example.html
@@ -0,0 +1 @@
+To infinity and Beyond!
\ No newline at end of file
diff --git a/docs/_media/example.js b/docs/_media/example.js
new file mode 100644
index 0000000..7b6f668
--- /dev/null
+++ b/docs/_media/example.js
@@ -0,0 +1,16 @@
+import fetch from 'fetch'
+
+const URL = 'https://example.com'
+const PORT = 8080
+
+/// [demo]
+const result = fetch(`${URL}:${PORT}`)
+ .then(function(response) {
+ return response.json();
+ })
+ .then(function(myJson) {
+ console.log(JSON.stringify(myJson));
+ });
+/// [demo]
+
+result.then(console.log).catch(console.error)
diff --git a/docs/_media/example.md b/docs/_media/example.md
new file mode 100644
index 0000000..6ee6494
--- /dev/null
+++ b/docs/_media/example.md
@@ -0,0 +1 @@
+> This is from the `example.md`
diff --git a/docs/_media/favicon.ico b/docs/_media/favicon.ico
new file mode 100644
index 0000000..da9dd34
Binary files /dev/null and b/docs/_media/favicon.ico differ
diff --git a/docs/_media/icon.svg b/docs/_media/icon.svg
new file mode 100644
index 0000000..7f125e6
--- /dev/null
+++ b/docs/_media/icon.svg
@@ -0,0 +1,30 @@
+
+
+
+ icon
+ Created with Sketch.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/_navbar.md b/docs/_navbar.md
new file mode 100644
index 0000000..47a2356
--- /dev/null
+++ b/docs/_navbar.md
@@ -0,0 +1,6 @@
+- Translations
+ - [:uk: English](/)
+ - [:cn: 中文](/zh-cn/)
+ - [:de: Deutsch](/de-de/)
+ - [:es: Spanish](/es/)
+ - [:ru: Russian](/ru/)
diff --git a/docs/_sidebar.md b/docs/_sidebar.md
new file mode 100644
index 0000000..051514b
--- /dev/null
+++ b/docs/_sidebar.md
@@ -0,0 +1,28 @@
+- Getting started
+
+ - [Quick start](quickstart.md)
+ - [Writing more pages](more-pages.md)
+ - [Custom navbar](custom-navbar.md)
+ - [Cover page](cover.md)
+
+- Customization
+
+ - [Configuration](configuration.md)
+ - [Themes](themes.md)
+ - [List of Plugins](plugins.md)
+ - [Write a Plugin](write-a-plugin.md)
+ - [Markdown configuration](markdown.md)
+ - [Language highlighting](language-highlight.md)
+
+- Guide
+
+ - [Deploy](deploy.md)
+ - [Helpers](helpers.md)
+ - [Vue compatibility](vue.md)
+ - [CDN](cdn.md)
+ - [Offline Mode(PWA)](pwa.md)
+ - [Server-Side Rendering(SSR)](ssr.md)
+ - [Embed Files](embed-files.md)
+
+- [Awesome docsify](awesome.md)
+- [Changelog](changelog.md)
diff --git a/docs/cdn.md b/docs/cdn.md
new file mode 100644
index 0000000..eba77a8
--- /dev/null
+++ b/docs/cdn.md
@@ -0,0 +1,50 @@
+# CDN
+
+Recommended: [unpkg](//unpkg.com), which will reflect the latest version as soon as it is published to npm. You can also browse the source of the npm package at [unpkg.com/docsify/](//unpkg.com/docsify/).
+
+## Latest version
+
+```html
+
+
+
+
+
+```
+
+Alternatively, use [compressed files](#compressed-file).
+
+## Specific version
+
+```html
+
+
+
+
+
+```
+
+## Compressed file
+
+```html
+
+
+
+
+
+```
+
+```html
+
+
+
+
+
+```
+
+## Other CDN
+
+- http://www.bootcdn.cn/docsify
+- https://cdn.jsdelivr.net/npm/docsify/
+- https://cdnjs.com/libraries/docsify
+
diff --git a/docs/configuration.md b/docs/configuration.md
new file mode 100644
index 0000000..ba48475
--- /dev/null
+++ b/docs/configuration.md
@@ -0,0 +1,518 @@
+# Configuration
+
+You can configure the `window.$docsify`.
+
+```html
+
+```
+
+## el
+
+- Type: `String`
+- Default: `#app`
+
+The DOM element to be mounted on initialization. It can be a CSS selector string or an actual HTMLElement.
+
+```js
+window.$docsify = {
+ el: '#app'
+};
+```
+
+## repo
+
+- Type: `String`
+- Default: `null`
+
+Configure the repository url or a string of `username/repo` can add the [GitHub Corner](http://tholman.com/github-corners/) widget in the top right corner of the site.
+
+```js
+window.$docsify = {
+ repo: 'docsifyjs/docsify',
+ // or
+ repo: 'https://github.com/docsifyjs/docsify/'
+};
+```
+
+## maxLevel
+
+- Type: `Number`
+- Default: `6`
+
+Maximum Table of content level.
+
+```js
+window.$docsify = {
+ maxLevel: 4
+};
+```
+
+## loadNavbar
+
+- Type: `Boolean|String`
+- Default: `false`
+
+Loads navbar from the Markdown file `_navbar.md` if **true**, or else from the path specified.
+
+```js
+window.$docsify = {
+ // load from _navbar.md
+ loadNavbar: true,
+
+ // load from nav.md
+ loadNavbar: 'nav.md'
+};
+```
+
+## loadSidebar
+
+- Type: `Boolean|String`
+- Default: `false`
+
+Loads sidebar from the Markdown file `_sidebar.md` if **true**, or else from the path specified.
+
+```js
+window.$docsify = {
+ // load from _sidebar.md
+ loadSidebar: true,
+
+ // load from summary.md
+ loadSidebar: 'summary.md'
+};
+```
+
+## subMaxLevel
+
+- Type: `Number`
+- Default: `0`
+
+Add table of contents (TOC) in custom sidebar.
+
+```js
+window.$docsify = {
+ subMaxLevel: 2
+};
+```
+
+## auto2top
+
+- Type: `Boolean`
+- Default: `false`
+
+Scrolls to the top of the screen when the route is changed.
+
+```js
+window.$docsify = {
+ auto2top: true
+};
+```
+
+## homepage
+
+- Type: `String`
+- Default: `README.md`
+
+`README.md` in your docs folder will be treated as homepage for your website, but sometimes you may need to serve another file as your homepage.
+
+```js
+window.$docsify = {
+ // Change to /home.md
+ homepage: 'home.md',
+
+ // Or use the readme in your repo
+ homepage:
+ 'https://raw.githubusercontent.com/docsifyjs/docsify/master/README.md'
+};
+```
+
+## basePath
+
+- Type: `String`
+
+Base path of the website. You can set it to another directory or another domain name.
+
+```js
+window.$docsify = {
+ basePath: '/path/',
+
+ // Load the files from another site
+ basePath: 'https://docsify.js.org/',
+
+ // Even can load files from other repo
+ basePath:
+ 'https://raw.githubusercontent.com/ryanmcdermott/clean-code-javascript/master/'
+};
+```
+
+## 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`
+- Default: `false`
+
+Activate the [cover feature](cover.md). If true, it will load from `_coverpage.md`.
+
+```js
+window.$docsify = {
+ coverpage: true,
+
+ // Custom file name
+ coverpage: 'cover.md',
+
+ // mutiple covers
+ coverpage: ['/', '/zh-cn/'],
+
+ // mutiple covers and custom file name
+ coverpage: {
+ '/': 'cover.md',
+ '/zh-cn/': 'cover.md'
+ }
+};
+```
+
+## logo
+
+- Type: `String`
+
+Website logo as it appears in the sidebar, you can resize by CSS.
+
+```js
+window.$docsify = {
+ logo: '/_media/icon.svg'
+};
+```
+
+## name
+
+- Type: `String`
+
+Website name as it appears in the sidebar.
+
+```js
+window.$docsify = {
+ name: 'docsify'
+};
+```
+
+## nameLink
+
+- Type: `String`
+- Default: `window.location.pathname`
+
+The name of the link.
+
+```js
+window.$docsify = {
+ nameLink: '/',
+
+ // For each route
+ nameLink: {
+ '/zh-cn/': '/zh-cn/',
+ '/': '/'
+ }
+};
+```
+
+## markdown
+
+- Type: `Function`
+
+See [Markdown configuration](markdown.md).
+
+```js
+window.$docsify = {
+ // object
+ markdown: {
+ smartypants: true,
+ renderer: {
+ link: function() {
+ // ...
+ }
+ }
+ },
+
+ // function
+ markdown: function(marked, renderer) {
+ // ...
+ return marked;
+ }
+};
+```
+
+## themeColor
+
+- Type: `String`
+
+Customize the theme color. Use [CSS3 variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables) feature and polyfill in old browser.
+
+```js
+window.$docsify = {
+ themeColor: '#3F51B5'
+};
+```
+
+## alias
+
+- Type: `Object`
+
+Set the route alias. You can freely manage routing rules. Supports RegExp.
+
+```js
+window.$docsify = {
+ alias: {
+ '/foo/(+*)': '/bar/$1', // supports regexp
+ '/zh-cn/changelog': '/changelog',
+ '/changelog':
+ 'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG',
+ '/.*/_sidebar.md': '/_sidebar.md' // See #301
+ }
+};
+```
+
+## autoHeader
+
+- type: `Boolean`
+
+If `loadSidebar` and `autoHeader` are both enabled, for each link in `_sidebar.md`, prepend a header to the page before converting it to html. Compare [#78](https://github.com/docsifyjs/docsify/issues/78).
+
+```js
+window.$docsify = {
+ loadSidebar: true,
+ autoHeader: true
+};
+```
+
+## executeScript
+
+- type: `Boolean`
+
+Execute the script on the page. Only parse the first script tag([demo](themes)). If Vue is present, it is turned on by default.
+
+```js
+window.$docsify = {
+ executeScript: true
+};
+```
+
+```markdown
+## This is test
+
+
+```
+
+Note that if you are running an external script, e.g. an embedded jsfiddle demo, make sure to include the [external-script](plugins.md?id=external-script) plugin.
+
+## noEmoji
+
+- type: `Boolean`
+
+Disabled emoji parse.
+
+```js
+window.$docsify = {
+ noEmoji: true
+};
+```
+
+## mergeNavbar
+
+- type: `Boolean`
+
+Navbar will be merged with the sidebar on smaller screens.
+
+```js
+window.$docsify = {
+ mergeNavbar: true
+};
+```
+
+## formatUpdated
+
+- type: `String|Function`
+
+We can display the file update date through **{docsify-updated} ** variable. And format it by `formatUpdated`.
+See https://github.com/lukeed/tinydate#patterns
+
+```js
+window.$docsify = {
+ formatUpdated: '{MM}/{DD} {HH}:{mm}',
+
+ formatUpdated: function(time) {
+ // ...
+
+ return time;
+ }
+};
+```
+
+## externalLinkTarget
+
+- type: `String`
+- default: `_blank`
+
+Target to open external links. Default `'_blank'` (new window/tab)
+
+```js
+window.$docsify = {
+ externalLinkTarget: '_self' // default: '_blank'
+};
+```
+
+## routerMode
+
+- type: `String`
+- default: `hash`
+
+```js
+window.$docsify = {
+ routerMode: 'history' // default: 'hash'
+};
+```
+
+## noCompileLinks
+
+- type: `Array`
+
+Sometimes we do not want docsify to handle our links. See [#203](https://github.com/docsifyjs/docsify/issues/203)
+
+```js
+window.$docsify = {
+ noCompileLinks: ['/foo', '/bar/.*']
+};
+```
+
+## onlyCover
+
+- type: `Boolean`
+
+Only coverpage is loaded when visiting the home page.
+
+```js
+window.$docsify = {
+ onlyCover: false
+};
+```
+
+## requestHeaders
+
+- type: `Object`
+
+Set the request resource headers.
+
+```js
+window.$docsify = {
+ requestHeaders: {
+ 'x-token': 'xxx'
+ }
+};
+```
+
+## ext
+
+- type: `String`
+
+Request file extension.
+
+```js
+window.$docsify = {
+ ext: '.md'
+};
+```
+
+## fallbackLanguages
+
+- type: `Array`
+
+List of languages that will fallback to the default language when a page is request and didn't exists for the given local.
+
+Example:
+
+- try to fetch the page of `/de/overview`. If this page exists, it'll be displayed
+- then try to fetch the default page `/overview` (depending on the default language). If this page exists, it'll be displayed
+- then display 404 page.
+
+```js
+window.$docsify = {
+ fallbackLanguages: ['fr', 'de']
+};
+```
+
+## notFoundPage
+
+- type: `Boolean` | `String` | `Object`
+
+Load the `_404.md` file:
+
+```js
+window.$docsify = {
+ notFoundPage: true
+};
+```
+
+Load the customised path of the 404 page:
+
+```js
+window.$docsify = {
+ notFoundPage: 'my404.md'
+};
+```
+
+Load the right 404 page according to the localisation:
+
+```js
+window.$docsify = {
+ notFoundPage: {
+ '/': '_404.md',
+ '/de': 'de/_404.md'
+ }
+};
+```
+
+> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.
diff --git a/docs/cover.md b/docs/cover.md
new file mode 100644
index 0000000..555f4ff
--- /dev/null
+++ b/docs/cover.md
@@ -0,0 +1,99 @@
+# Cover
+
+Activate the cover feature by setting `coverpage` to **true**, compare [coverpage configuration](configuration.md#coverpage).
+
+## Basic usage
+
+Set `coverpage` to **true**, and create a `_coverpage.md`:
+
+```html
+
+
+
+
+```
+
+```markdown
+
+
+
+
+# docsify 3.5
+
+> A magical documentation site generator.
+
+- Simple and lightweight (~21kB gzipped)
+- No statically built html files
+- Multiple themes
+
+[GitHub](https://github.com/docsifyjs/docsify/)
+[Get Started](#docsify)
+```
+
+!> A document site can have only one coverpage!
+
+## Custom background
+
+The background color is generated randomly by default. You can customize the background color or a background image:
+
+```markdown
+
+
+# docsify 3.5
+
+[GitHub](https://github.com/docsifyjs/docsify/)
+[Get Started](#quick-start)
+
+
+
+
+
+
+
+
+```
+
+## Coverpage as homepage
+
+Normally, the coverpage and the homepage appear at the same time. Of course, you can also separate the coverpage by [onlyCover option](configuration.md#onlycover).
+
+## Multiple covers
+
+If your docs site is in more than one language, it may be useful to set multiple covers.
+
+For example, your docs structure is like this
+
+```text
+.
+└── docs
+ ├── README.md
+ ├── guide.md
+ ├── _coverpage.md
+ └── zh-cn
+ ├── README.md
+ └── guide.md
+ └── _coverpage.md
+```
+
+Now, you can set
+
+```js
+window.$docsify = {
+ coverpage: ['/', '/zh-cn/']
+};
+```
+
+Or a special file name
+
+```js
+window.$docsify = {
+ coverpage: {
+ '/': 'cover.md',
+ '/zh-cn/': 'cover.md'
+ }
+};
+```
diff --git a/docs/custom-navbar.md b/docs/custom-navbar.md
new file mode 100644
index 0000000..324ad81
--- /dev/null
+++ b/docs/custom-navbar.md
@@ -0,0 +1,96 @@
+# Custom navbar
+
+## HTML
+
+If you need custom navigation, you can create a HTML-based navigation bar.
+
+!> Note that documentation links begin with `#/`.
+
+```html
+
+
+
+
+ EN
+ 中文
+
+
+
+```
+
+## Markdown
+
+Alternatively, you can create a custom markdown-based navigation file by setting `loadNavbar` to **true** and creating `_navbar.md`, compare [loadNavbar configuration](configuration.md#loadnavbar).
+
+```html
+
+
+
+
+```
+
+```markdown
+
+
+* [En](/)
+* [chinese](/zh-cn/)
+```
+
+!> You need to create a `.nojekyll` in `./docs` to prevent GitHub Pages from ignoring files that begin with an underscore.
+
+`_navbar.md` is loaded from each level directory. If the current directory doesn't have `_navbar.md`, it will fall back to the parent directory. If, for example, the current path is `/guide/quick-start`, the `_navbar.md` will be loaded from `/guide/_navbar.md`.
+
+## Nesting
+
+You can create sub-lists by indenting items that are under a certain parent.
+
+```markdown
+
+
+* Getting started
+
+ * [Quick start](quickstart.md)
+ * [Writing more pages](more-pages.md)
+ * [Custom navbar](custom-navbar.md)
+ * [Cover page](cover.md)
+
+* Configuration
+ * [Configuration](configuration.md)
+ * [Themes](themes.md)
+ * [Using plugins](plugins.md)
+ * [Markdown configuration](markdown.md)
+ * [Language highlight](language-highlight.md)
+```
+
+renders as
+
+
+
+## Combining custom navbars with the emoji plugin
+
+If you use the [emoji plugin](plugins#emoji):
+
+```html
+
+
+
+
+
+```
+
+you could, for example, use flag emojis in your custom navbar Markdown file:
+
+```markdown
+
+
+* [:us:, :uk:](/)
+* [:cn:](/zh-cn/)
+```
diff --git a/docs/deploy.md b/docs/deploy.md
new file mode 100644
index 0000000..a879f2e
--- /dev/null
+++ b/docs/deploy.md
@@ -0,0 +1,131 @@
+# Deploy
+
+Similar to [GitBook](https://www.gitbook.com), you can deploy files to GitHub Pages, GitLab Pages or VPS.
+
+## GitHub Pages
+
+There're three places to populate your docs for your Github repository:
+
+- `docs/` folder
+- master branch
+- gh-pages branch
+
+It is recommended that you save your files to the `./docs` subfolder of the `master` branch of your repository. Then select `master branch /docs folder` as your Github Pages source in your repositories' settings page.
+
+
+
+!> 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)
+
+## GitLab Pages
+
+If you are deploying your master branch, include `.gitlab-ci.yml` with the following script:
+
+?> The `.public` workaround is so `cp` doesn't also copy `public/` to itself in an infinite loop.
+
+```YAML
+pages:
+ stage: deploy
+ script:
+ - mkdir .public
+ - cp -r * .public
+ - mv .public public
+ artifacts:
+ paths:
+ - public
+ only:
+ - master
+```
+
+!> You can replace script with `- cp -r docs/. public`, if `./docs` is your Docsify subfolder.
+
+## Firebase Hosting
+
+!> You'll need to install the Firebase CLI using `npm i -g firebase-tools` after signing into the [Firebase Console](https://console.firebase.google.com) using a Google Account.
+
+Using Terminal determine and navigate to the directory for your Firebase Project - this could be `~/Projects/Docs` etc. From there, run `firebase init`, choosing `Hosting` from the menu (use **space** to select, **arrow keys** to change options and **enter** to confirm). Follow the setup instructions.
+
+You should have your `firebase.json` file looking similar to this (I changed the deployment directory from `public` to `site`):
+
+```json
+{
+ "hosting": {
+ "public": "site",
+ "ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
+ }
+}
+```
+
+Once finished, build the starting template by running `docsify init ./site` (replacing site with the deployment directory you determined when running `firebase init` - public by default). Add/edit the documentation, then run `firebase deploy` from the base project directory.
+
+## VPS
+
+Try following nginx config.
+
+```nginx
+server {
+ listen 80;
+ server_name your.domain.com;
+
+ location / {
+ alias /path/to/dir/of/docs/;
+ index index.html;
+ }
+}
+```
+
+## Netlify
+
+1. Login to your [Netlify](https://www.netlify.com/) account.
+2. In the [dashboard](https://app.netlify.com/) page, click **New site from Git**.
+3. Choose a repository where you store your docs, leave the **Build Command** area blank, fill in the Publish directory area with the directory of your `index.html`, for example it should be docs if you populated it at `docs/index.html`.
+
+### HTML5 router
+
+When using the HTML5 router, you need to set up redirect rules that redirect all requests to your `index.html`, it's pretty simple when you're using Netlify, populate a `\redirects` file in the docs directory and you're all set:
+
+```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) |
+
diff --git a/docs/embed-files.md b/docs/embed-files.md
new file mode 100644
index 0000000..dab2efe
--- /dev/null
+++ b/docs/embed-files.md
@@ -0,0 +1,81 @@
+# Embed files
+
+With docsify 4.6 it is now possible to embed any type of file.
+You can embed these files as video, audio, iframes, or code blocks, and even Markdown files can even be embedded directly into the document.
+
+For example, here embedded a Markdown file. You only need to do this:
+
+```markdown
+[filename](_media/example.md ':include')
+```
+
+Then the content of `example.md` will be displayed directly here
+
+[filename](_media/example.md ':include')
+
+You can check the original content for [example.md](_media/example.md ':ignore').
+
+Normally, this will compiled into a link, but in docsify, if you add `:include` it will be embedded.
+
+## Embedded file type
+
+Currently, file extension are automatically recognized and embedded in different ways.
+
+This is a supported embedding type:
+
+* **iframe** `.html`, `.htm`
+* **markdown** `.markdown`, `.md`
+* **audio** `.mp3`
+* **video** `.mp4`, `.ogg`
+* **code** other file extension
+
+Of course, you can force the specified. For example, you want to Markdown file as code block embedded.
+
+```markdown
+[filename](_media/example.md ':include :type=code')
+```
+
+You will get it
+
+[filename](_media/example.md ':include :type=code')
+
+## Embedded code fragments
+Sometimes you don't want to embed a whole file. Maybe because you need just a few lines but you want to compile and test the file in CI.
+
+```markdown
+[filename](_media/example.js ':include :type=code :fragment=demo')
+```
+
+In your code file you need to surround the fragment between `/// [demo]` lines (before and after the fragment).
+Alternatively you can use `### [demo]`.
+
+Example:
+
+[filename](_media/example.js ':include :type=code :fragment=demo')
+
+
+## Tag attribute
+
+If you embed the file as `iframe`, `audio` and `video`, then you may need to set the attributes of these tags.
+
+```markdown
+[cinwell website](https://cinwell.com ':include :type=iframe width=100% height=400px')
+```
+
+[cinwell website](https://cinwell.com ':include :type=iframe width=100% height=400px')
+
+Did you see it? You only need to write directly. You can check [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe) for these attributes.
+
+## The code block highlight
+
+Embedding any type of source code file, you can specify the highlighted language or automatically identify.
+
+```markdown
+[](_media/example.html ':include :type=code text')
+```
+
+⬇️
+
+[](_media/example.html ':include :type=code text')
+
+?> How to set highlight? You can see [here](language-highlight.md).
diff --git a/docs/helpers.md b/docs/helpers.md
new file mode 100644
index 0000000..b047d36
--- /dev/null
+++ b/docs/helpers.md
@@ -0,0 +1,145 @@
+# Doc helper
+
+docsify extends Markdown syntax to make your documents more readable.
+
+## important content
+
+Important content like:
+
+```markdown
+!> **Time** is money, my friend!
+```
+
+is rendered as:
+
+!> **Time** is money, my friend!
+
+## General tips
+
+General tips like:
+
+```markdown
+?> _TODO_ unit test
+```
+
+are rendered as:
+
+?> _TODO_ unit test
+
+## Ignore to compile link
+
+Some time we will put some other relative path to the link, you have to need to tell docsify you don't need to compile this link. For example
+
+```md
+[link](/demo/)
+```
+
+It will be compiled to `link ` and will be loaded `/demo/README.md`. Maybe you want to jump to `/demo/index.html`.
+
+Now you can do that
+
+```md
+[link](/demo/ ':ignore')
+```
+
+You will get `link `html. Do not worry, you can still set title for link.
+
+```md
+[link](/demo/ ':ignore title')
+
+link
+```
+
+## Set target attribute for link
+
+```md
+[link](/demo ':target=_blank')
+[link](/demo2 ':target=_self')
+```
+
+## Disable link
+
+```md
+[link](/demo ':disabled')
+```
+
+## Github Task Lists
+
+```md
+- [ ] foo
+- bar
+- [x] baz
+- [] bam <~ not working
+ - [ ] bim
+ - [ ] lim
+```
+
+- [ ] foo
+- bar
+- [x] baz
+- [] bam <~ not working
+ - [ ] bim
+ - [ ] lim
+
+## Image resizing
+
+```md
+
+
+
+
+
+
+```
+
+
+
+
+
+## Customise ID for headings
+
+```md
+### 你好,世界! :id=hello-world
+```
+
+## Markdown in html tag
+
+You need to insert a space between the html and markdown content.
+This is useful for rendering markdown content in the details element.
+
+```markdown
+
+Self-assessment (Click to expand)
+
+- Abc
+- Abc
+
+
+```
+
+
+Self-assessment (Click to expand)
+
+- Abc
+- Abc
+
+
+
+Or markdown content can be wrapped in html tag.
+
+```markdown
+
+
+- listitem
+- listitem
+- listitem
+
+
+```
+
+
+
+- Abc
+- Abc
+
+
diff --git a/docs/index.html b/docs/index.html
new file mode 100644
index 0000000..6d0e008
--- /dev/null
+++ b/docs/index.html
@@ -0,0 +1,104 @@
+
+
+
+
+
+ docsify
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Loading ...
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/language-highlight.md b/docs/language-highlight.md
new file mode 100644
index 0000000..793a39e
--- /dev/null
+++ b/docs/language-highlight.md
@@ -0,0 +1,11 @@
+# language highlight
+
+**docsify** uses [Prism](https://github.com/PrismJS/prism) to highlight code blocks in your pages. By default it only supports CSS, JavaScript and HTML. You can make **Prism** load additional languages:
+
+```html
+
+
+
+```
+
+?> Check the [component files](https://github.com/PrismJS/prism/tree/gh-pages/components) list for more options.
diff --git a/docs/markdown.md b/docs/markdown.md
new file mode 100644
index 0000000..c506e17
--- /dev/null
+++ b/docs/markdown.md
@@ -0,0 +1,56 @@
+# Markdown configuration
+
+**docsify** uses [marked](https://github.com/markedjs/marked) as its Markdown parser. You can customize how it renders your Markdown content to HTML by customizing `renderer`:
+
+```js
+window.$docsify = {
+ markdown: {
+ smartypants: true,
+ renderer: {
+ link: function() {
+ // ...
+ }
+ }
+ }
+}
+```
+
+?> Configuration Options Reference [marked documentation](https://marked.js.org/#/USING_ADVANCED.md)
+
+Even you can completely customize the parsing rules.
+
+```js
+window.$docsify = {
+ markdown: function(marked, renderer) {
+ // ...
+
+ return marked
+ }
+}
+```
+
+## Supports mermaid
+
+```js
+// Import mermaid
+//
+//
+
+var num = 0;
+mermaid.initialize({ startOnLoad: false });
+
+window.$docsify = {
+ markdown: {
+ renderer: {
+ code: function(code, lang) {
+ if (lang === "mermaid") {
+ return (
+ '' + mermaid.render('mermaid-svg-' + num++, code) + "
"
+ );
+ }
+ return this.origin.code.apply(this, arguments);
+ }
+ }
+ }
+}
+```
diff --git a/docs/more-pages.md b/docs/more-pages.md
new file mode 100644
index 0000000..46e7df8
--- /dev/null
+++ b/docs/more-pages.md
@@ -0,0 +1,125 @@
+# More pages
+
+If you need more pages, you can simply create more markdown files in your docsify directory. If you create a file named `guide.md`, then it is accessible via `/#/guide`.
+
+For example, the directory structure is as follows:
+
+```text
+.
+└── docs
+ ├── README.md
+ ├── guide.md
+ └── zh-cn
+ ├── README.md
+ └── guide.md
+```
+
+Matching routes
+
+```text
+docs/README.md => http://domain.com
+docs/guide.md => http://domain.com/guide
+docs/zh-cn/README.md => http://domain.com/zh-cn/
+docs/zh-cn/guide.md => http://domain.com/zh-cn/guide
+```
+
+## Sidebar
+
+In order to have sidebar, then you can create your own `_sidebar.md` (see [this documentation's sidebar](https://github.com/docsifyjs/docsify/blob/master/docs/_sidebar.md) for an example):
+
+First, you need to set `loadSidebar` to **true**. Details are available in the [configuration paragraph](configuration.md#loadsidebar).
+
+```html
+
+
+
+
+```
+
+Create the `_sidebar.md`:
+
+```markdown
+
+
+* [Home](/)
+* [Guide](guide.md)
+```
+
+You need to create a `.nojekyll` in `./docs` to prevent GitHub Pages from ignoring files that begin with an underscore.
+
+## Nested Sidebars
+
+You may want the sidebar to update with only navigation to reflect the current directory. This can be done by adding a `_sidebar.md` file to each folder.
+
+`_sidebar.md` is loaded from each level directory. If the current directory doesn't have `_sidebar.md`, it will fall back to the parent directory. If, for example, the current path is `/guide/quick-start`, the `_sidebar.md` will be loaded from `/guide/_sidebar.md`.
+
+You can specify `alias` to avoid unnecessary fallback.
+
+```html
+
+```
+
+!> 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.
+
+A custom sidebar can also automatically generate a table of contents by setting a `subMaxLevel`, compare [subMaxLevel configuration](configuration.md#submaxlevel).
+
+```html
+
+
+
+
+```
+
+## Ignoring Subheaders
+
+When `subMaxLevel` is set, each header is automatically added to the table of contents by default. If you want to ignore a specific header, add `{docsify-ignore}` to it.
+
+```markdown
+# Getting Started
+
+## Header {docsify-ignore}
+
+This header won't appear in the sidebar table of contents.
+```
+
+To ignore all headers on a specific page, you can use `{docsify-ignore-all}` on the first header of the page.
+
+```markdown
+# Getting Started {docsify-ignore-all}
+
+## Header
+
+This header won't appear in the sidebar table of contents.
+```
+
+Both `{docsify-ignore}` and `{docsify-ignore-all}` will not be rendered on the page when used.
diff --git a/docs/plugins.md b/docs/plugins.md
new file mode 100644
index 0000000..3706b89
--- /dev/null
+++ b/docs/plugins.md
@@ -0,0 +1,197 @@
+# List of Plugins
+
+## Full text search
+
+By default, the hyperlink on the current page is recognized and the content is saved in `localStorage`. You can also specify the path to the files.
+
+```html
+
+
+
+```
+
+## Google Analytics
+
+Install the plugin and configure the track id.
+
+```html
+
+
+
+```
+
+Configure by `data-ga`.
+
+```html
+
+
+```
+
+## emoji
+
+The default is to support parsing emoji. For example `:100:` will be parsed to :100:. But it is not precise because there is no matching non-emoji string. If you need to correctly parse the emoji string, you need install this plugin.
+
+```html
+
+```
+
+## External Script
+
+If the script on the page is an external one (imports a js file via `src` attribute), you'll need this plugin to make it work.
+
+```html
+
+```
+
+## Zoom image
+
+Medium's image zoom. Based on [medium-zoom](https://github.com/francoischalifour/medium-zoom).
+
+```html
+
+```
+
+Exclude the special image
+
+```markdown
+
+```
+
+## Edit on github
+
+Add `Edit on github` button on every pages. Provided by [@njleonzhang](https://github.com/njleonzhang), check [document](https://github.com/njleonzhang/docsify-edit-on-github)
+
+## Demo code with instant preview and jsfiddle integration
+
+With this plugin, sample code can be rendered on the page instantly, so that the readers can see the preview immediately.
+When readers expand the demo box, the source code and description are shown there. if they click the button `Try in Jsfiddle`,
+`jsfiddle.net` will be open with the code of this sample, which allow readers to revise the code and try on their own.
+
+[Vue](https://njleonzhang.github.io/docsify-demo-box-vue/) and [React](https://njleonzhang.github.io/docsify-demo-box-react/) are both supported.
+
+## Copy to Clipboard
+
+Add a simple `Click to copy` button to all preformatted code blocks to effortlessly allow users to copy example code from your docs. Provided by [@jperasmus](https://github.com/jperasmus)
+
+```html
+
+```
+
+See [here](https://github.com/jperasmus/docsify-copy-code/blob/master/README.md) for more details.
+
+## Disqus
+
+Disqus comments. https://disqus.com/
+
+```html
+
+
+```
+
+## Gitalk
+
+[Gitalk](https://github.com/gitalk/gitalk) is a modern comment component based on Github Issue and Preact.
+
+```html
+
+
+
+
+
+```
+
+## Pagination
+
+Pagination for docsify. By [@imyelo](https://github.com/imyelo)
+
+```html
+
+
+```
+
+## codefund
+
+a [plugin](https://github.com/njleonzhang/docsify-plugin-codefund) to make it easy to join up [codefund](https://codefund.io/)
+
+> codefund is formerly known as "codesponsor"
+
+```
+
+
+window.$docsify = {
+ plugins: [
+ DocsifyCodefund.create('xxxx-xxx-xxx') // change to your codefund id
+ ]
+}
+```
+
+## Tabs
+
+A docsify.js plugin for displaying tabbed content from markdown.
+
+- [Documentation & Demos](https://jhildenbiddle.github.io/docsify-tabs)
+
+Provided by [@jhildenbiddle](https://github.com/jhildenbiddle/docsify-tabs).
+
+## More plugins
+
+See [awesome-docsify](awesome?id=plugins)
diff --git a/docs/pwa.md b/docs/pwa.md
new file mode 100644
index 0000000..e8d1c74
--- /dev/null
+++ b/docs/pwa.md
@@ -0,0 +1,115 @@
+# Offline Mode
+
+[Progressive Web Apps](https://developers.google.com/web/progressive-web-apps/) (PWA) are experiences that combine the best of the web with the best of apps. We can enhance our website with service workers to work **offline** or on low-quality networks.
+
+It is also very easy to use it.
+
+## Create serviceWorker
+
+Create a `sw.js` file in your documents root directory and copy the following code:
+
+*sw.js*
+
+```js
+/* ===========================================================
+ * docsify sw.js
+ * ===========================================================
+ * Copyright 2016 @huxpro
+ * Licensed under Apache 2.0
+ * Register service worker.
+ * ========================================================== */
+
+const RUNTIME = 'docsify'
+const HOSTNAME_WHITELIST = [
+ self.location.hostname,
+ 'fonts.gstatic.com',
+ 'fonts.googleapis.com',
+ 'unpkg.com'
+]
+
+// The Util Function to hack URLs of intercepted requests
+const getFixedUrl = (req) => {
+ var now = Date.now()
+ var url = new URL(req.url)
+
+ // 1. fixed http URL
+ // Just keep syncing with location.protocol
+ // fetch(httpURL) belongs to active mixed content.
+ // And fetch(httpRequest) is not supported yet.
+ url.protocol = self.location.protocol
+
+ // 2. add query for caching-busting.
+ // Github Pages served with Cache-Control: max-age=600
+ // max-age on mutable content is error-prone, with SW life of bugs can even extend.
+ // Until cache mode of Fetch API landed, we have to workaround cache-busting with query string.
+ // Cache-Control-Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=453190
+ if (url.hostname === self.location.hostname) {
+ url.search += (url.search ? '&' : '?') + 'cache-bust=' + now
+ }
+ return url.href
+}
+
+/**
+ * @Lifecycle Activate
+ * New one activated when old isnt being used.
+ *
+ * waitUntil(): activating ====> activated
+ */
+self.addEventListener('activate', event => {
+ event.waitUntil(self.clients.claim())
+})
+
+/**
+ * @Functional Fetch
+ * All network requests are being intercepted here.
+ *
+ * void respondWith(Promise r)
+ */
+self.addEventListener('fetch', event => {
+ // Skip some of cross-origin requests, like those for Google Analytics.
+ if (HOSTNAME_WHITELIST.indexOf(new URL(event.request.url).hostname) > -1) {
+ // Stale-while-revalidate
+ // similar to HTTP's stale-while-revalidate: https://www.mnot.net/blog/2007/12/12/stale
+ // Upgrade from Jake's to Surma's: https://gist.github.com/surma/eb441223daaedf880801ad80006389f1
+ const cached = caches.match(event.request)
+ const fixedUrl = getFixedUrl(event.request)
+ const fetched = fetch(fixedUrl, { cache: 'no-store' })
+ const fetchedCopy = fetched.then(resp => resp.clone())
+
+ // Call respondWith() with whatever we get first.
+ // If the fetch fails (e.g disconnected), wait for the cache.
+ // If there’s nothing in cache, wait for the fetch.
+ // If neither yields a response, return offline pages.
+ event.respondWith(
+ Promise.race([fetched.catch(_ => cached), cached])
+ .then(resp => resp || fetched)
+ .catch(_ => { /* eat any errors */ })
+ )
+
+ // Update the cache with the version we fetched (only for ok status)
+ event.waitUntil(
+ Promise.all([fetchedCopy, caches.open(RUNTIME)])
+ .then(([response, cache]) => response.ok && cache.put(event.request, response))
+ .catch(_ => { /* eat any errors */ })
+ )
+ }
+})
+```
+
+## Register
+
+Now, register it in your `index.html`. It only works on some modern browsers, so we need to judge:
+
+*index.html*
+
+```html
+
+```
+
+## Enjoy it
+
+Release your website and start experiencing magical offline feature. :ghost: You can turn off Wi-Fi and refresh the current site to experience it.
diff --git a/docs/quickstart.md b/docs/quickstart.md
new file mode 100644
index 0000000..08666d2
--- /dev/null
+++ b/docs/quickstart.md
@@ -0,0 +1,94 @@
+# Quick start
+
+It is recommended to install `docsify-cli` globally, which helps initializing and previewing the website locally.
+
+```bash
+npm i docsify-cli -g
+```
+
+## Initialize
+
+If you want to write the documentation in the `./docs` subdirectory, you can use the `init` command.
+
+```bash
+docsify init ./docs
+```
+
+## Writing content
+
+After the `init` is complete, you can see the file list in the `./docs` subdirectory.
+
+* `index.html` as the entry file
+* `README.md` as the home page
+* `.nojekyll` prevents GitHub Pages from ignoring files that begin with an underscore
+
+You can easily update the documentation in `./docs/README.md`, of course you can add [more pages](more-pages.md).
+
+## Preview your site
+
+Run the local server with `docsify serve`. You can preview your site in your browser on `http://localhost:3000`.
+
+```bash
+docsify serve docs
+```
+
+?> For more use cases of `docsify-cli`, head over to the [docsify-cli documentation](https://github.com/docsifyjs/docsify-cli).
+
+## Manual initialization
+
+If you don't like `npm` or have trouble installing the tool, you can manually create `index.html`:
+
+```html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+If you installed python on your system, you can easily use it to run a static server to preview your site.
+
+```bash
+cd docs && python -m SimpleHTTPServer 3000
+```
+
+## Loading dialog
+
+If you want, you can show a loading dialog before docsify starts to render your documentation:
+
+```html
+
+
+ Please wait...
+```
+
+You should set the `data-app` attribute if you changed `el`:
+
+```html
+
+
+ Please wait...
+
+
+```
+
+Compare [el configuration](configuration.md#el).
diff --git a/docs/ssr.md b/docs/ssr.md
new file mode 100644
index 0000000..e9c435f
--- /dev/null
+++ b/docs/ssr.md
@@ -0,0 +1,124 @@
+# Server-Side Rendering
+
+See https://docsify.now.sh
+
+Repo in https://github.com/docsifyjs/docsify-ssr-demo
+
+## Why SSR?
+- Better SEO
+- Feeling cool
+
+## Quick start
+
+Install `now` and `docsify-cli` in your project.
+
+```bash
+npm i now docsify-cli -D
+```
+
+Edit `package.json`. If the documentation in `./docs` subdirectory.
+
+```json
+{
+ "name": "my-project",
+ "scripts": {
+ "start": "docsify start . -c ssr.config.js",
+ "deploy": "now -p"
+ },
+ "files": [
+ "docs"
+ ],
+ "docsify": {
+ "config": {
+ "basePath": "https://docsify.js.org/",
+ "loadSidebar": true,
+ "loadNavbar": true,
+ "coverpage": true,
+ "name": "docsify"
+ }
+ }
+}
+```
+
+!> The `basePath` just like webpack `publicPath`. We can use local or remote files.
+
+We can preview in the local to see if it works.
+
+```bash
+npm start
+
+# open http://localhost:4000
+```
+
+Publish it!
+
+```bash
+now -p
+```
+
+Now, You have a support for SSR the docs site.
+
+## Custom template
+
+You can provide a template for entire page's HTML. such as
+
+```html
+
+
+
+
+ docsify
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+The template should contain these comments for rendered app content.
+ - ``
+ - ``
+
+## Configuration
+
+You can configure it in a special config file, or `package.json`.
+
+```js
+module.exports = {
+ template: './ssr.html',
+ maxAge: 60 * 60 * 1000, // lru-cache config
+ config: {
+ // docsify config
+ }
+}
+```
+
+## Deploy for your VPS
+
+You can run `docsify start` directly on your Node server, or write your own server app with `docsify-server-renderer`.
+
+```js
+var Renderer = require('docsify-server-renderer')
+var readFileSync = require('fs').readFileSync
+
+// init
+var renderer = new Renderer({
+ template: readFileSync('./docs/index.template.html', 'utf-8'),
+ config: {
+ name: 'docsify',
+ repo: 'docsifyjs/docsify'
+ }
+})
+
+renderer.renderToString(url)
+ .then(html => {})
+ .catch(err => {})
+```
diff --git a/docs/themes.md b/docs/themes.md
new file mode 100644
index 0000000..1de9125
--- /dev/null
+++ b/docs/themes.md
@@ -0,0 +1,60 @@
+# Themes
+
+There are currently three themes available. Copy [Vue](//vuejs.org) and [buble](//buble.surge.sh) website custom theme and [@liril-net](https://github.com/liril-net) contribution to the theme of the black style.
+
+```html
+
+
+
+
+```
+
+!> Compressed files are available in `/lib/themes/`.
+
+```html
+
+
+
+
+
+
+```
+
+If you have any ideas or would like to develop a new theme, you are welcome to submit a [pull request](https://github.com/docsifyjs/docsify/pulls).
+
+#### Click to preview
+
+
+
+
+
+
+
+## Other themes
+
+- [docsify-themeable](https://jhildenbiddle.github.io/docsify-themeable/#/) A delightfully simple theme system for docsify.
diff --git a/docs/vue.md b/docs/vue.md
new file mode 100644
index 0000000..a1b5683
--- /dev/null
+++ b/docs/vue.md
@@ -0,0 +1,99 @@
+# Compatible with Vue
+
+You can write Vue components directly in the Markdown file, and it will be parsed. You can use this feature to write vue demo and documentation together.
+
+## Basic usage
+
+Load the Vue in `./index.html`.
+
+```html
+
+
+
+
+
+
+```
+
+Then you can immediately write Vue code at Markdown file. `new Vue({ el: '#main' })` script is executed by default to create instance.
+
+*README.md*
+
+````markdown
+# Vue guide
+
+`v-for` usage.
+
+```html
+
+```
+
+
+````
+
+You can manually initialize a Vue instance.
+
+*README.md*
+
+```markdown
+# Vue demo
+
+hello {{ msg }}
+
+
+```
+
+!> In a Markdown file, only the script within the first script tag is executed.
+
+## Combine Vuep to write playground
+
+[Vuep](https://github.com/QingWei-Li/vuep) is a component for rendering Vue components with live editor and preview. Supports Vue component spec and JSX.
+
+*index.html*
+
+```html
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+*README.md*
+```markdown
+# Vuep
+
+
+
+
+
+```
+
+?> Example Refer to the [Vuep documentation](https://qingwei-li.github.io/vuep/).
diff --git a/docs/write-a-plugin.md b/docs/write-a-plugin.md
new file mode 100644
index 0000000..baa894e
--- /dev/null
+++ b/docs/write-a-plugin.md
@@ -0,0 +1,111 @@
+# Write a plugin
+
+A plugin is simply a function that takes `hook` as an argument. The hook supports handling of asynchronous tasks.
+
+## Full configuration
+
+```js
+window.$docsify = {
+ plugins: [
+ function(hook, vm) {
+ hook.init(function() {
+ // Called when the script starts running, only trigger once, no arguments,
+ });
+
+ hook.beforeEach(function(content) {
+ // Invoked each time before parsing the Markdown file.
+ // ...
+ return content;
+ });
+
+ hook.afterEach(function(html, next) {
+ // Invoked each time after the Markdown file is parsed.
+ // beforeEach and afterEach support asynchronous。
+ // ...
+ // call `next(html)` when task is done.
+ next(html);
+ });
+
+ hook.doneEach(function() {
+ // Invoked each time after the data is fully loaded, no arguments,
+ // ...
+ });
+
+ hook.mounted(function() {
+ // Called after initial completion. Only trigger once, no arguments.
+ });
+
+ hook.ready(function() {
+ // Called after initial completion, no arguments.
+ });
+ }
+ ]
+};
+```
+
+!> You can get internal methods through `window.Docsify`. Get the current instance through the second argument.
+
+## Example
+
+#### footer
+
+Add footer component in each pages.
+
+```js
+window.$docsify = {
+ plugins: [
+ function(hook) {
+ var footer = [
+ ' ',
+ ''
+ ].join('');
+
+ hook.afterEach(function(html) {
+ return html + footer;
+ });
+ }
+ ]
+};
+```
+
+### Edit Button
+
+```js
+window.$docsify = {
+ plugins: [
+ function(hook, vm) {
+ hook.beforeEach(function(html) {
+ var url =
+ 'https://github.com/docsifyjs/docsify/blob/master/docs/' +
+ vm.route.file;
+ var editHtml = '[📝 EDIT DOCUMENT](' + url + ')\n';
+
+ return (
+ editHtml +
+ html +
+ '\n----\n' +
+ 'Last modified {docsify-updated} ' +
+ editHtml
+ );
+ });
+ }
+ ]
+};
+```
+
+## Tips
+
+### Get docsify version
+
+```
+console.log(window.Docsify.version)
+```
+
+Current version: loading
+
+
diff --git a/docs/zh-cn.md b/docs/zh-cn.md
deleted file mode 100644
index 7c1baa7..0000000
--- a/docs/zh-cn.md
+++ /dev/null
@@ -1,144 +0,0 @@
-# docsify
-
-> 无需构建快速生成文档页
-
-## 特性
-- 无需构建,写完 markdown 直接发布
-- 支持自定义主题
-- 容易使用并且轻量
-
-## 快速上手
-
-### 创建项目
-新建一个空项目,接着创建一个 `docs` 目录并进入到 docs 目录下
-```shell
-mkdir my-project && cd my-project
-mkdir docs && cd docs
-```
-
-### 创建入口文件
-创建一个 `404.html` 文件,内容为
-```html
-
-
-
-
-
-
-
-
-
-
-
-```
-
-新建 `README.md` 文件,作为主页面
-
-```
-# Title
-
-## balabala
-```
-
-### 部署!
-将项目 `push` 到 GitHub 仓库后到设置页面开启 **GitHub Pages** 功能,选择 `docs/` 选项
-
-
-## 命令行工具
-
-方便快速创建文档目录,会读取项目的 `package.json` 里的选项作为 docsify 的配置,支持本地预览。
-
-### 安装
-```shell
-npm i docsify-cli -g
-```
-
-### 初始化文档
-
-默认初始化在当前目录,推荐将文档放在 `docs` 目录下
-```shell
-docsify init docs
-```
-
-### 启动本地服务
-启动一个 server 方便预览,打开 http://localhost:3000
-```shell
-docsify serve docs
-```
-
-更多选项参考 [docsify-cli](https://github.com/QingWei-Li/docsify-cli)
-
-## 主题
-目前提供 vue.css 和 buble.css,直接修改 `404.html` 里的 cdn 地址即可
-```html
-
-
-```
-
-压缩版
-
-```html
-
-
-```
-
-## 更多功能
-
-### 多页面
-`README.md` 作为主页面,如果需要其他页面,直接在文档目录下创建对应的 `*.md` 文件,例如创建一个 `guide.md` 那么对应的路由就是 `/guide`。
-
-### 导航
-导航需要自己写在 `404.html` 文件里,效果参考本文档
-
-```html
-
- En
- 中文
-
-```
-
-### 配置参数
-
-#### repo
-参考本文档的右上角的 GitHub 图标,如果要开启的话,将 `404.html` 里的 script 改成
-
-```html
-
-```
-
-#### max-level
-目录最大展开层级,默认值为 6
-
-```html
-
-```
-
-#### el
-替换节点元素,默认为 `#app`
-```html
-
-```
-
-#### sidebar
-
-设置后 TOC 功能将不可用,适合导航较多的文档,`data-sidebar` 传入全局变量名。
-
-
-
-```html
-
-
-```
-
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..59e6911
--- /dev/null
+++ b/index.html
@@ -0,0 +1,84 @@
+
+
+
+
+
+ docsify
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lerna.json b/lerna.json
new file mode 100644
index 0000000..26fa22a
--- /dev/null
+++ b/lerna.json
@@ -0,0 +1,7 @@
+{
+ "lerna": "2.0.0-rc.5",
+ "packages": [
+ "packages/*"
+ ],
+ "version": "0.0.0"
+}
diff --git a/lib/docsify.js b/lib/docsify.js
deleted file mode 100644
index 38301bf..0000000
--- a/lib/docsify.js
+++ /dev/null
@@ -1,2340 +0,0 @@
-(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- (global.Docsify = factory());
-}(this, (function () { 'use strict';
-
-var ajax = function (url, options) {
- if ( options === void 0 ) options = {};
-
- var xhr = new XMLHttpRequest();
-
- xhr.open(options.method || 'get', url);
- xhr.send();
-
- return {
- then: function (cb) {
- xhr.addEventListener('load', cb);
- return this
- },
- catch: function (cb) {
- xhr.addEventListener('error', cb);
- return this
- }
- }
-};
-
-var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
-
-
-
-
-
-function createCommonjsModule(fn, module) {
- return module = { exports: {} }, fn(module, module.exports), module.exports;
-}
-
-var marked = createCommonjsModule(function (module, exports) {
-/**
- * marked - a markdown parser
- * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
- * https://github.com/chjj/marked
- */
-
-(function() {
-
-/**
- * Block-Level Grammar
- */
-
-var block = {
- newline: /^\n+/,
- code: /^( {4}[^\n]+\n*)+/,
- fences: noop,
- hr: /^( *[-*_]){3,} *(?:\n+|$)/,
- heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,
- nptable: noop,
- lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,
- blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,
- list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
- html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,
- def: /^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,
- table: noop,
- paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,
- text: /^[^\n]+/
-};
-
-block.bullet = /(?:[*+-]|\d+\.)/;
-block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;
-block.item = replace(block.item, 'gm')
- (/bull/g, block.bullet)
- ();
-
-block.list = replace(block.list)
- (/bull/g, block.bullet)
- ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')
- ('def', '\\n+(?=' + block.def.source + ')')
- ();
-
-block.blockquote = replace(block.blockquote)
- ('def', block.def)
- ();
-
-block._tag = '(?!(?:'
- + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'
- + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'
- + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b';
-
-block.html = replace(block.html)
- ('comment', //)
- ('closed', /<(tag)[\s\S]+?<\/\1>/)
- ('closing', /])*?>/)
- (/tag/g, block._tag)
- ();
-
-block.paragraph = replace(block.paragraph)
- ('hr', block.hr)
- ('heading', block.heading)
- ('lheading', block.lheading)
- ('blockquote', block.blockquote)
- ('tag', '<' + block._tag)
- ('def', block.def)
- ();
-
-/**
- * Normal Block Grammar
- */
-
-block.normal = merge({}, block);
-
-/**
- * GFM Block Grammar
- */
-
-block.gfm = merge({}, block.normal, {
- fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,
- paragraph: /^/,
- heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/
-});
-
-block.gfm.paragraph = replace(block.paragraph)
- ('(?!', '(?!'
- + block.gfm.fences.source.replace('\\1', '\\2') + '|'
- + block.list.source.replace('\\1', '\\3') + '|')
- ();
-
-/**
- * GFM + Tables Block Grammar
- */
-
-block.tables = merge({}, block.gfm, {
- nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,
- table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/
-});
-
-/**
- * Block Lexer
- */
-
-function Lexer(options) {
- this.tokens = [];
- this.tokens.links = {};
- this.options = options || marked.defaults;
- this.rules = block.normal;
-
- 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, bq) {
- var this$1 = this;
-
- var src = src.replace(/^ +$/gm, '')
- , next
- , loose
- , cap
- , bull
- , b
- , item
- , space
- , i
- , l;
-
- 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
- ? cap.replace(/\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))) {
- src = src.substring(cap[0].length);
-
- item = {
- type: 'table',
- header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
- align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
- cells: cap[3].replace(/\n$/, '').split('\n')
- };
-
- 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] = item.cells[i].split(/ *\| */);
- }
-
- 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;
- }
-
- // 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, true);
-
- 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];
-
- this$1.tokens.push({
- type: 'list_start',
- ordered: bull.length > 1
- });
-
- // Get each top-level item.
- cap = cap[0].match(this$1.rules.item);
-
- 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; }
- }
-
- this$1.tokens.push({
- type: loose
- ? 'loose_item_start'
- : 'list_item_start'
- });
-
- // Recurse.
- this$1.token(item, false, bq);
-
- this$1.tokens.push({
- type: 'list_item_end'
- });
- }
-
- 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 ((!bq && top) && (cap = this$1.rules.def.exec(src))) {
- src = src.substring(cap[0].length);
- this$1.tokens.links[cap[1].toLowerCase()] = {
- href: cap[2],
- title: cap[3]
- };
- continue;
- }
-
- // table (gfm)
- if (top && (cap = this$1.rules.table.exec(src))) {
- src = src.substring(cap[0].length);
-
- item = {
- type: 'table',
- header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
- align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
- cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n')
- };
-
- 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] = item.cells[i]
- .replace(/^ *\| *| *\| *$/g, '')
- .split(/ *\| */);
- }
-
- this$1.tokens.push(item);
-
- 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: /^<([^ >]+(@|:\/)[^ >]+)>/,
- url: noop,
- tag: /^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,
- link: /^!?\[(inside)\]\(href\)/,
- reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/,
- nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
- strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
- em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
- code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,
- br: /^ {2,}\n(?!\s*$)/,
- del: noop,
- text: /^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;
-
-inline.link = replace(inline.link)
- ('inside', inline._inside)
- ('href', inline._href)
- ();
-
-inline.reflink = replace(inline.reflink)
- ('inside', inline._inside)
- ();
-
-/**
- * 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)\*(?!\*)/
-});
-
-/**
- * GFM Inline Grammar
- */
-
-inline.gfm = merge({}, inline.normal, {
- escape: replace(inline.escape)('])', '~|])')(),
- url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,
- del: /^~~(?=\S)([\s\S]*?\S)~~/,
- text: replace(inline.text)
- (']|', '~]|')
- ('|', '|https?://|')
- ()
-});
-
-/**
- * GFM + Line Breaks Inline Grammar
- */
-
-inline.breaks = merge({}, inline.gfm, {
- br: replace(inline.br)('{2,}', '*')(),
- text: replace(inline.gfm.text)('{2,}', '*')()
-});
-
-/**
- * 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.gfm) {
- if (this.options.breaks) {
- this.rules = inline.breaks;
- } else {
- this.rules = inline.gfm;
- }
- } else if (this.options.pedantic) {
- this.rules = inline.pedantic;
- }
-}
-
-/**
- * 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
- , cap;
-
- 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 = cap[1].charAt(6) === ':'
- ? this$1.mangle(cap[1].substring(7))
- : this$1.mangle(cap[1]);
- href = this$1.mangle('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))) {
- src = src.substring(cap[0].length);
- text = escape(cap[1]);
- href = text;
- 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;
- }
- 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;
- out += this$1.outputLink(cap, {
- href: cap[2],
- title: cap[3]
- });
- 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[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[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], 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);
- 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;
-};
-
-/**
- * Compile Link
- */
-
-InlineLexer.prototype.outputLink = function(cap, link) {
- var href = escape(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 || {};
-}
-
-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))
- + '\n ';
- }
-
- return ''
- + (escaped ? code : escape(code, true))
- + '\n \n';
-};
-
-Renderer.prototype.blockquote = function(quote) {
- return '\n' + quote + ' \n';
-};
-
-Renderer.prototype.html = function(html) {
- return html;
-};
-
-Renderer.prototype.heading = function(text, level, raw) {
- return '\n';
-};
-
-Renderer.prototype.hr = function() {
- return this.options.xhtml ? ' \n' : ' \n';
-};
-
-Renderer.prototype.list = function(body, ordered) {
- var type = ordered ? 'ol' : 'ul';
- return '<' + type + '>\n' + body + '' + type + '>\n';
-};
-
-Renderer.prototype.listitem = function(text) {
- return '' + text + ' \n';
-};
-
-Renderer.prototype.paragraph = function(text) {
- return '' + text + '
\n';
-};
-
-Renderer.prototype.table = function(header, body) {
- return ' \n'
- + '\n'
- + header
- + ' \n'
- + '\n'
- + body
- + ' \n'
- + '
\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 + ' style="text-align:' + flags.align + '">'
- : '<' + type + '>';
- return tag + content + '' + type + '>\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 '';
- }
- if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0) {
- return '';
- }
- }
- var out = '' + text + ' ';
- return out;
-};
-
-Renderer.prototype.image = function(href, title, text) {
- var out = ' ' : '>';
- return out;
-};
-
-Renderer.prototype.text = function(text) {
- return text;
-};
-
-/**
- * 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, renderer) {
- var parser = new Parser(options, renderer);
- return parser.parse(src);
-};
-
-/**
- * Parse Loop
- */
-
-Parser.prototype.parse = function(src) {
- var this$1 = this;
-
- this.inline = new InlineLexer(src.links, this.options, this.renderer);
- 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,
- 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
- , flags
- , j;
-
- // header
- cell = '';
- for (i = 0; i < this.token.header.length; i++) {
- flags = { header: true, align: this$1.token.align[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': {
- var body = '';
-
- while (this.next().type !== 'blockquote_end') {
- body += this$1.tok();
- }
-
- return this.renderer.blockquote(body);
- }
- case 'list_start': {
- var body = ''
- , ordered = this.token.ordered;
-
- while (this.next().type !== 'list_end') {
- body += this$1.tok();
- }
-
- return this.renderer.list(body, ordered);
- }
- case 'list_item_start': {
- var body = '';
-
- while (this.next().type !== 'list_item_end') {
- body += this$1.token.type === 'text'
- ? this$1.parseText()
- : this$1.tok();
- }
-
- return this.renderer.listitem(body);
- }
- case 'loose_item_start': {
- var body = '';
-
- while (this.next().type !== 'list_item_end') {
- body += this$1.tok();
- }
-
- return this.renderer.listitem(body);
- }
- case 'html': {
- var html = !this.token.pre && !this.options.pedantic
- ? this.inline.output(this.token.text)
- : this.token.text;
- return this.renderer.html(html);
- }
- 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) {
- return html
- .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&')
- .replace(//g, '>')
- .replace(/"/g, '"')
- .replace(/'/g, ''');
-}
-
-function unescape(html) {
- // explicitly match decimal, hex, and named HTML entities
- return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, 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 replace(regex, opt) {
- regex = regex.source;
- opt = opt || '';
- return function self(name, val) {
- if (!name) { return new RegExp(regex, opt); }
- val = val.source || val;
- val = val.replace(/(^|[^\[])\^/g, '$1');
- regex = regex.replace(name, val);
- return self;
- };
-}
-
-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;
-}
-
-
-/**
- * Marked
- */
-
-function marked(src, opt, callback) {
- 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/chjj/marked.';
- if ((opt || marked.defaults).silent) {
- return 'An error occured:
'
- + escape(e.message + '', true)
- + ' ';
- }
- throw e;
- }
-}
-
-/**
- * Options
- */
-
-marked.options =
-marked.setOptions = function(opt) {
- merge(marked.defaults, opt);
- return marked;
-};
-
-marked.defaults = {
- gfm: true,
- tables: true,
- breaks: false,
- pedantic: false,
- sanitize: false,
- sanitizer: null,
- mangle: true,
- smartLists: false,
- silent: false,
- highlight: null,
- langPrefix: 'lang-',
- smartypants: false,
- headerPrefix: '',
- renderer: new Renderer,
- xhtml: false
-};
-
-/**
- * Expose
- */
-
-marked.Parser = Parser;
-marked.parser = Parser.parse;
-
-marked.Renderer = Renderer;
-
-marked.Lexer = Lexer;
-marked.lexer = Lexer.lex;
-
-marked.InlineLexer = InlineLexer;
-marked.inlineLexer = InlineLexer.output;
-
-marked.parse = marked;
-
-if (typeof module !== 'undefined' && typeof exports === 'object') {
- module.exports = marked;
-} else if (typeof define === 'function' && define.amd) {
- define(function() { return marked; });
-} else {
- this.marked = marked;
-}
-
-}).call(function() {
- return this || (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 = {
- 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!
- break tokenloop;
- }
-
- if (str instanceof Token) {
- continue;
- }
-
- pattern.lastIndex = 0;
-
- var match = pattern.exec(str),
- delNum = 1;
-
- // Greedy patterns can override/remove up to two previously matched tokens
- if (!match && greedy && i != strarr.length - 1) {
- // Reconstruct the original text using the next two tokens
- var nextToken = strarr[i + 1].matchedStr || strarr[i + 1],
- combStr = str + nextToken;
-
- if (i < strarr.length - 2) {
- combStr += strarr[i + 2].matchedStr || strarr[i + 2];
- }
-
- // Try the pattern again on the reconstructed text
- pattern.lastIndex = 0;
- match = pattern.exec(combStr);
- if (!match) {
- continue;
- }
-
- var from = match.index + (lookbehind ? match[1].length : 0);
- // To be a valid candidate, the new match has to start inside of str
- if (from >= str.length) {
- continue;
- }
- var to = match.index + match[0].length,
- len = str.length + nextToken.length;
-
- // Number of tokens to delete and replace with the new match
- delNum = 3;
-
- if (to <= len) {
- if (strarr[i + 1].greedy) {
- continue;
- }
- delNum = 2;
- combStr = combStr.slice(0, len);
- }
- str = combStr;
- }
-
- if (!match) {
- continue;
- }
-
- if(lookbehind) {
- lookbehindLength = match[1].length;
- }
-
- 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) {
- 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);
- }
- }
- }
-
- 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.matchedStr = matchedStr || null;
- 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 (env.type == 'comment') {
- env.attributes['spellcheck'] = 'true';
- }
-
- 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 = '';
-
- for (var name in env.attributes) {
- attributes += (attributes ? ' ' : '') + name + '="' + (env.attributes[name] || '') + '"';
- }
-
- return '<' + env.tag + ' class="' + env.classes.join(' ') + '" ' + attributes + '>' + env.content + '' + env.tag + '>';
-
-};
-
-if (!_self.document) {
- if (!_self.addEventListener) {
- // in Node.js
- return _self.Prism;
- }
- // 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 (document.addEventListener && !script.hasAttribute('data-manual')) {
- if(document.readyState !== "loading") {
- requestAnimationFrame(_.highlightAll, 0);
- }
- else {
- document.addEventListener('DOMContentLoaded', _.highlightAll);
- }
- }
-}
-
-return _self.Prism;
-
-})();
-
-if (typeof module !== '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': /<\?[\w\W]+?\?>/,
- 'doctype': //,
- 'cdata': //i,
- 'tag': {
- pattern: /<\/?(?!\d)[^\s>\/=.$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,
- inside: {
- 'tag': {
- pattern: /^<\/?[^\s>\/]+/i,
- inside: {
- 'punctuation': /^<\/?/,
- 'namespace': /^[^\s>\/:]+:/
- }
- },
- 'attr-value': {
- pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,
- inside: {
- 'punctuation': /[=>"']/
- }
- },
- 'punctuation': /\/?>/,
- 'attr-name': {
- pattern: /[^\s>\/]+/,
- inside: {
- 'namespace': /^[^\s>\/:]+:/
- }
- }
-
- }
- },
- 'entity': /?[\da-z]{1,8};/i
-};
-
-// 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': /\/\*[\w\W]*?\*\//,
- 'atrule': {
- pattern: /@[\w-]+?.*?(;|(?=\s*\{))/i,
- inside: {
- 'rule': /@[\w-]+/
- // See rest below
- }
- },
- 'url': /url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,
- 'selector': /[^\{\}\s][^\{\};]*?(?=\s*\{)/,
- 'string': /("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,
- 'property': /(\b|\B)[\w-]+(?=\s*:)/i,
- 'important': /\B!important\b/i,
- 'function': /[-a-z0-9]+(?=\()/i,
- 'punctuation': /[(){};:]/
-};
-
-Prism.languages.css['atrule'].inside.rest = Prism.util.clone(Prism.languages.css);
-
-if (Prism.languages.markup) {
- Prism.languages.insertBefore('markup', 'tag', {
- 'style': {
- pattern: /(`
+}
diff --git a/src/core/router/history/abstract.js b/src/core/router/history/abstract.js
new file mode 100644
index 0000000..2c0bd95
--- /dev/null
+++ b/src/core/router/history/abstract.js
@@ -0,0 +1,25 @@
+import {History} from './base'
+import {parseQuery} from '../util'
+
+export class AbstractHistory extends History {
+ constructor(config) {
+ super(config)
+ this.mode = 'abstract'
+ }
+
+ parse(path) {
+ let query = ''
+
+ const queryIndex = path.indexOf('?')
+ if (queryIndex >= 0) {
+ query = path.slice(queryIndex + 1)
+ path = path.slice(0, queryIndex)
+ }
+
+ return {
+ path,
+ file: this.getFile(path),
+ query: parseQuery(query)
+ }
+ }
+}
diff --git a/src/core/router/history/base.js b/src/core/router/history/base.js
new file mode 100644
index 0000000..7ea763d
--- /dev/null
+++ b/src/core/router/history/base.js
@@ -0,0 +1,86 @@
+import {
+ getPath,
+ isAbsolutePath,
+ stringifyQuery,
+ cleanPath,
+ replaceSlug,
+ resolvePath
+} from '../util'
+import {noop, merge} from '../../util/core'
+
+const cached = {}
+
+function getAlias(path, alias, last) {
+ const match = Object.keys(alias).filter(key => {
+ const re = cached[key] || (cached[key] = new RegExp(`^${key}$`))
+ return re.test(path) && path !== last
+ })[0]
+
+ return match ?
+ getAlias(path.replace(cached[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}`
+}
+
+export class History {
+ constructor(config) {
+ this.config = config
+ }
+
+ getBasePath() {
+ return this.config.basePath
+ }
+
+ getFile(path = this.getCurrentPath(), isRelative) {
+ const {config} = this
+ const base = this.getBasePath()
+ const 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
+ }
+
+ onchange(cb = noop) {
+ cb()
+ }
+
+ getCurrentPath() {}
+
+ normalize() {}
+
+ parse() {}
+
+ toURL(path, params, currentRoute) {
+ const local = currentRoute && path[0] === '#'
+ const 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) {
+ const idIndex = currentRoute.indexOf('?')
+ path =
+ (idIndex > 0 ? currentRoute.substring(0, idIndex) : currentRoute) + path
+ }
+
+ 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/src/core/router/history/hash.js b/src/core/router/history/hash.js
new file mode 100644
index 0000000..2674d5d
--- /dev/null
+++ b/src/core/router/history/hash.js
@@ -0,0 +1,76 @@
+import {History} from './base'
+import {noop} from '../../util/core'
+import {on} from '../../util/dom'
+import {parseQuery, cleanPath, replaceSlug} from '../util'
+
+function replaceHash(path) {
+ const i = location.href.indexOf('#')
+ location.replace(location.href.slice(0, i >= 0 ? i : 0) + '#' + path)
+}
+
+export class HashHistory extends History {
+ constructor(config) {
+ super(config)
+ this.mode = 'hash'
+ }
+
+ getBasePath() {
+ const path = window.location.pathname || ''
+ const base = this.config.basePath
+
+ return /^(\/|https?:)/g.test(base) ? base : cleanPath(path + '/' + base)
+ }
+
+ getCurrentPath() {
+ // We can't use location.hash here because it's not
+ // consistent across browsers - Firefox will pre-decode it!
+ const href = location.href
+ const index = href.indexOf('#')
+ return index === -1 ? '' : href.slice(index + 1)
+ }
+
+ onchange(cb = noop) {
+ on('hashchange', cb)
+ }
+
+ normalize() {
+ let 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 }
+ */
+ parse(path = location.href) {
+ let query = ''
+
+ const hashIndex = path.indexOf('#')
+ if (hashIndex >= 0) {
+ path = path.slice(hashIndex + 1)
+ }
+
+ const queryIndex = path.indexOf('?')
+ if (queryIndex >= 0) {
+ query = path.slice(queryIndex + 1)
+ path = path.slice(0, queryIndex)
+ }
+
+ return {
+ path,
+ file: this.getFile(path, true),
+ query: parseQuery(query)
+ }
+ }
+
+ toURL(path, params, currentRoute) {
+ return '#' + super.toURL(path, params, currentRoute)
+ }
+}
diff --git a/src/core/router/history/html5.js b/src/core/router/history/html5.js
new file mode 100644
index 0000000..04c5391
--- /dev/null
+++ b/src/core/router/history/html5.js
@@ -0,0 +1,65 @@
+import {History} from './base'
+import {noop} from '../../util/core'
+import {on} from '../../util/dom'
+import {parseQuery, getPath} from '../util'
+
+export class HTML5History extends History {
+ constructor(config) {
+ super(config)
+ this.mode = 'history'
+ }
+
+ getCurrentPath() {
+ const base = this.getBasePath()
+ let path = window.location.pathname
+
+ if (base && path.indexOf(base) === 0) {
+ path = path.slice(base.length)
+ }
+
+ return (path || '/') + window.location.search + window.location.hash
+ }
+
+ onchange(cb = noop) {
+ on('click', e => {
+ const el = e.target.tagName === 'A' ? e.target : e.target.parentNode
+
+ if (el.tagName === 'A' && !/_blank/.test(el.target)) {
+ e.preventDefault()
+ const 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 }
+ */
+ parse(path = location.href) {
+ let query = ''
+
+ const queryIndex = path.indexOf('?')
+ if (queryIndex >= 0) {
+ query = path.slice(queryIndex + 1)
+ path = path.slice(0, queryIndex)
+ }
+
+ const base = getPath(location.origin)
+ const baseIndex = path.indexOf(base)
+
+ if (baseIndex > -1) {
+ path = path.slice(baseIndex + base.length)
+ }
+
+ return {
+ path,
+ file: this.getFile(path),
+ query: parseQuery(query)
+ }
+ }
+}
diff --git a/src/core/router/index.js b/src/core/router/index.js
new file mode 100644
index 0000000..943fe6c
--- /dev/null
+++ b/src/core/router/index.js
@@ -0,0 +1,45 @@
+import {HashHistory} from './history/hash'
+import {HTML5History} from './history/html5'
+import {supportsPushState} from '../util/env'
+import * as dom from '../util/dom'
+
+export function routerMixin(proto) {
+ proto.route = {}
+}
+
+let lastRoute = {}
+
+function updateRender(vm) {
+ vm.router.normalize()
+ vm.route = vm.router.parse()
+ dom.body.setAttribute('data-page', vm.route.file)
+}
+
+export function initRouter(vm) {
+ const config = vm.config
+ const mode = config.routerMode || 'hash'
+ let router
+
+ if (mode === 'history' && supportsPushState) {
+ router = new HTML5History(config)
+ } else {
+ router = new HashHistory(config)
+ }
+
+ vm.router = router
+ updateRender(vm)
+ lastRoute = vm.route
+
+ router.onchange(_ => {
+ updateRender(vm)
+ vm._updateRender()
+
+ if (lastRoute.path === vm.route.path) {
+ vm.$resetEvents()
+ return
+ }
+
+ vm.$fetch()
+ lastRoute = vm.route
+ })
+}
diff --git a/src/core/router/util.js b/src/core/router/util.js
new file mode 100644
index 0000000..2ed88c5
--- /dev/null
+++ b/src/core/router/util.js
@@ -0,0 +1,76 @@
+import {cached} from '../util/core'
+
+const decode = decodeURIComponent
+const encode = encodeURIComponent
+
+export function parseQuery(query) {
+ const res = {}
+
+ query = query.trim().replace(/^(\?|#|&)/, '')
+
+ if (!query) {
+ return res
+ }
+
+ // Simple parse
+ query.split('&').forEach(function (param) {
+ const parts = param.replace(/\+/g, ' ').split('=')
+
+ res[parts[0]] = parts[1] && decode(parts[1])
+ })
+
+ return res
+}
+
+export function stringifyQuery(obj, ignores = []) {
+ const qs = []
+
+ for (const 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('&')}` : ''
+}
+
+export const isAbsolutePath = cached(path => {
+ return /(:|(\/{2}))/g.test(path)
+})
+
+export const getParentPath = cached(path => {
+ return /\/$/g.test(path) ?
+ path :
+ (path = path.match(/(\S*\/)[^/]+$/)) ? path[1] : ''
+})
+
+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('/'))
+}
+
+export const replaceSlug = cached(path => {
+ return path.replace('#', '?id=')
+})
diff --git a/src/core/util/core.js b/src/core/util/core.js
new file mode 100644
index 0000000..a94472d
--- /dev/null
+++ b/src/core/util/core.js
@@ -0,0 +1,58 @@
+/**
+ * Create a cached version of a pure function.
+ */
+export function cached(fn) {
+ const cache = Object.create(null)
+ return function (str) {
+ const key = isPrimitive(str) ? str : JSON.stringify(str)
+ const hit = cache[key]
+ return hit || (cache[key] = fn(str))
+ }
+}
+
+/**
+ * Hyphenate a camelCase string.
+ */
+export const hyphenate = cached(str => {
+ return str.replace(/([A-Z])/g, m => '-' + m.toLowerCase())
+})
+
+export const hasOwn = Object.prototype.hasOwnProperty
+
+/**
+ * Simple Object.assign polyfill
+ */
+export const merge =
+ Object.assign ||
+ function (to) {
+ for (let i = 1; i < arguments.length; i++) {
+ const from = Object(arguments[i])
+
+ for (const key in from) {
+ if (hasOwn.call(from, key)) {
+ to[key] = from[key]
+ }
+ }
+ }
+
+ return to
+ }
+
+/**
+ * Check if value is primitive
+ */
+export function isPrimitive(value) {
+ return typeof value === 'string' || typeof value === 'number'
+}
+
+/**
+ * Perform no operation.
+ */
+export function noop() {}
+
+/**
+ * Check if value is function
+ */
+export function isFn(obj) {
+ return typeof obj === 'function'
+}
diff --git a/src/core/util/dom.js b/src/core/util/dom.js
new file mode 100644
index 0000000..388927d
--- /dev/null
+++ b/src/core/util/dom.js
@@ -0,0 +1,92 @@
+import {isFn} from '../util/core'
+import {inBrowser} from './env'
+
+const cacheNode = {}
+
+/**
+ * Get Node
+ * @param {String|Element} el
+ * @param {Boolean} noCache
+ * @return {Element}
+ */
+export function getNode(el, 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
+}
+
+export const $ = inBrowser && document
+
+export const body = inBrowser && $.body
+
+export const head = inBrowser && $.head
+
+/**
+ * Find element
+ * @example
+ * find('nav') => document.querySelector('nav')
+ * find(nav, 'a') => nav.querySelector('a')
+ */
+export 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'))
+ */
+export function findAll(el, node) {
+ return [].slice.call(
+ node ? el.querySelectorAll(node) : $.querySelectorAll(el)
+ )
+}
+
+export function create(node, tpl) {
+ node = $.createElement(node)
+ if (tpl) {
+ node.innerHTML = tpl
+ }
+ return node
+}
+
+export function appendTo(target, el) {
+ return target.appendChild(el)
+}
+
+export function before(target, el) {
+ return target.insertBefore(el, target.children[0])
+}
+
+export function on(el, type, handler) {
+ isFn(type) ?
+ window.addEventListener(el, type) :
+ el.addEventListener(type, handler)
+}
+
+export 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')
+ */
+export function toggleClass(el, type, val) {
+ el && el.classList[val ? type : 'toggle'](val || type)
+}
+
+export function style(content) {
+ appendTo(head, create('style', content))
+}
diff --git a/src/core/util/env.js b/src/core/util/env.js
new file mode 100644
index 0000000..cd51635
--- /dev/null
+++ b/src/core/util/env.js
@@ -0,0 +1,21 @@
+export const inBrowser = !process.env.SSR
+
+export const isMobile = inBrowser && document.body.clientWidth <= 600
+
+/**
+ * @see https://github.com/MoOx/pjax/blob/master/lib/is-supported.js
+ */
+export const 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)/
+ )
+ )
+ })()
diff --git a/src/core/util/index.js b/src/core/util/index.js
new file mode 100644
index 0000000..eba6598
--- /dev/null
+++ b/src/core/util/index.js
@@ -0,0 +1,3 @@
+export * from './core'
+export * from './env'
+export * from '../router/util'
diff --git a/src/core/util/polyfill/css-vars.js b/src/core/util/polyfill/css-vars.js
new file mode 100644
index 0000000..fb3a80a
--- /dev/null
+++ b/src/core/util/polyfill/css-vars.js
@@ -0,0 +1,36 @@
+import * as dom from '../dom'
+import {get} from '../../fetch/ajax'
+
+function replaceVar(block, color) {
+ block.innerHTML = block.innerHTML.replace(
+ /var\(\s*--theme-color.*?\)/g,
+ color
+ )
+}
+
+export default function (color) {
+ // Variable support
+ if (window.CSS && window.CSS.supports && window.CSS.supports('(--v:red)')) {
+ return
+ }
+
+ const styleBlocks = dom.findAll('style:not(.inserted),link');
+ [].forEach.call(styleBlocks, block => {
+ if (block.nodeName === 'STYLE') {
+ replaceVar(block, color)
+ } else if (block.nodeName === 'LINK') {
+ const href = block.getAttribute('href')
+
+ if (!/\.css$/.test(href)) {
+ return
+ }
+
+ get(href).then(res => {
+ const style = dom.create('style', res)
+
+ dom.head.appendChild(style)
+ replaceVar(style, color)
+ })
+ }
+ })
+}
diff --git a/src/gen-toc.js b/src/gen-toc.js
deleted file mode 100644
index ee89e37..0000000
--- a/src/gen-toc.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * @link from https://github.com/killercup/grock/blob/5280ae63e16c5739e9233d9009bc235ed7d79a50/styles/solarized/assets/js/behavior.coffee#L54-L81
- */
-const tocToTree = function (toc, maxLevel) {
- const headlines = []
- const last = {}
-
- toc.forEach(headline => {
- const level = headline.level || 1
- const len = level - 1
-
- if (level > maxLevel) return
- if (last[len]) {
- last[len].children = last[len].children || []
- last[len].children.push(headline)
- } else {
- headlines.push(headline)
- }
- last[level] = headline
- })
-
- return headlines
-}
-
-const buildHeadlinesTree = function (tree, tpl = '') {
- if (!tree || !tree.length) return ''
-
- tree.forEach(node => {
- tpl += `${node.title} `
- if (node.children) {
- tpl += `${buildHeadlinesTree(node.children)} `
- }
- })
-
- return tpl
-}
-
-export default function (toc, opts) {
- var tree = Array.isArray(opts.sidebar)
- ? opts.sidebar
- : tocToTree(toc, opts['max-level'])
-
- return buildHeadlinesTree(tree, '')
-}
diff --git a/src/index.js b/src/index.js
deleted file mode 100644
index 76bc696..0000000
--- a/src/index.js
+++ /dev/null
@@ -1,81 +0,0 @@
-import ajax from './ajax'
-import render from './render'
-import bindEvent from './bind-event'
-
-const DEFAULT_OPTS = {
- el: '#app',
- repo: '',
- 'max-level': 6,
- sidebar: ''
-}
-
-const script = document.currentScript || [].slice.call(document.getElementsByTagName('script')).pop()
-
-if (script) {
- for (const prop in DEFAULT_OPTS) {
- DEFAULT_OPTS[prop] = script.getAttribute('data-' + prop) || DEFAULT_OPTS[prop]
- }
-}
-
-class Docsify {
- constructor (opts) {
- Docsify.installed = true
-
- this.opts = Object.assign({}, opts, DEFAULT_OPTS)
- this.replace = true
- this.dom = document.querySelector(this.opts.el)
- if (!this.dom) {
- this.dom = document.body
- this.replace = false
- }
- if (this.opts.sidebar) this.opts.sidebar = window[this.opts.sidebar]
-
- this.loc = document.location.pathname
- if (/\/$/.test(this.loc)) this.loc += 'README'
-
- this.load()
-
- const nav = document.querySelector('nav')
- if (nav) this.activeNav(nav)
- }
-
- load () {
- ajax(`${this.loc}.md`)
- .then(res => {
- const target = res.target
- if (target.status >= 400) {
- this.render('not found')
- } else {
- this.render(res.target.response)
- bindEvent(!!this.opts.sidebar)
- if (this.opts.sidebar) {
- this.activeNav(document.querySelector('aside.sidebar'), true)
- }
- }
- })
- .catch(_ => this.render('not found'))
- }
-
- render (content) {
- this.dom[this.replace ? 'outerHTML' : 'innerHTML'] = render(content, this.opts)
- }
-
- activeNav (elm, activeParentNode) {
- const host = document.location.origin + document.location.pathname
-
- ;[].slice.call(elm.querySelectorAll('a')).forEach(node => {
- if (node.href === host) {
- activeParentNode
- ? node.parentNode.setAttribute('class', 'active')
- : node.setAttribute('class', 'active')
- }
- })
- }
-}
-
-window.addEventListener('load', () => {
- if (Docsify.installed) return
- new Docsify()
-})
-
-export default Docsify
diff --git a/src/plugins/disqus.js b/src/plugins/disqus.js
new file mode 100644
index 0000000..dba7aef
--- /dev/null
+++ b/src/plugins/disqus.js
@@ -0,0 +1,51 @@
+const fixedPath = location.href.replace('/-/', '/#/')
+if (fixedPath !== location.href) {
+ location.href = fixedPath
+}
+
+function install(hook, vm) {
+ const dom = Docsify.dom
+ const disqus = vm.config.disqus
+ if (!disqus) {
+ throw Error('$docsify.disqus is required')
+ }
+
+ hook.init(_ => {
+ const script = dom.create('script')
+
+ script.async = true
+ script.src = `https://${disqus}.disqus.com/embed.js`
+ script.setAttribute('data-timestamp', Number(new Date()))
+ dom.appendTo(dom.body, script)
+ })
+
+ hook.mounted(_ => {
+ const div = dom.create('div')
+ div.id = 'disqus_thread'
+ const main = dom.getNode('#main')
+ div.style = `width: ${main.clientWidth}px; margin: 0 auto 20px;`
+ dom.appendTo(dom.find('.content'), div)
+
+ // eslint-disable-next-line
+ window.disqus_config = function() {
+ this.page.url = location.origin + '/-' + vm.route.path
+ this.page.identifier = vm.route.path
+ this.page.title = document.title
+ }
+ })
+
+ hook.doneEach(_ => {
+ if (typeof window.DISQUS !== 'undefined') {
+ window.DISQUS.reset({
+ reload: true,
+ config: function () {
+ this.page.url = location.origin + '/-' + vm.route.path
+ this.page.identifier = vm.route.path
+ this.page.title = document.title
+ }
+ })
+ }
+ })
+}
+
+$docsify.plugins = [].concat(install, $docsify.plugins)
diff --git a/src/plugins/emoji.js b/src/plugins/emoji.js
new file mode 100644
index 0000000..31f1059
--- /dev/null
+++ b/src/plugins/emoji.js
@@ -0,0 +1,900 @@
+const AllGithubEmoji = [
+ '+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'
+]
+
+// Emoji from All-Github-Emoji-Icons
+// https://github.com/scotch-io/All-Github-Emoji-Icons
+window.emojify = function (match, $1) {
+ return AllGithubEmoji.indexOf($1) === -1 ?
+ match :
+ ' '
+}
diff --git a/src/plugins/external-script.js b/src/plugins/external-script.js
new file mode 100644
index 0000000..2954030
--- /dev/null
+++ b/src/plugins/external-script.js
@@ -0,0 +1,25 @@
+function handleExternalScript() {
+ const container = Docsify.dom.getNode('#main')
+ const scripts = Docsify.dom.findAll(container, 'script')
+
+ for (let i = scripts.length; i--;) {
+ const script = scripts[i]
+
+ if (script && script.src) {
+ const newScript = document.createElement('script')
+
+ Array.prototype.slice.call(script.attributes).forEach(attribute => {
+ newScript[attribute.name] = attribute.value
+ })
+
+ script.parentNode.insertBefore(newScript, script)
+ script.parentNode.removeChild(script)
+ }
+ }
+}
+
+const install = function (hook) {
+ hook.doneEach(handleExternalScript)
+}
+
+window.$docsify.plugins = [].concat(install, window.$docsify.plugins)
diff --git a/src/plugins/front-matter/index.js b/src/plugins/front-matter/index.js
new file mode 100644
index 0000000..cb90ed9
--- /dev/null
+++ b/src/plugins/front-matter/index.js
@@ -0,0 +1,13 @@
+import parser from './parser'
+
+const install = function (hook, vm) {
+ hook.beforeEach(content => {
+ const {attributes, body} = parser(content)
+
+ vm.frontmatter = attributes
+
+ return body
+ })
+}
+
+$docsify.plugins = [].concat(install, $docsify.plugins)
diff --git a/src/plugins/front-matter/parser.js b/src/plugins/front-matter/parser.js
new file mode 100644
index 0000000..f0ae377
--- /dev/null
+++ b/src/plugins/front-matter/parser.js
@@ -0,0 +1,55 @@
+/**
+ * Fork https://github.com/egoist/docute/blob/master/src/utils/front-matter.js
+ */
+/* eslint-disable */
+import parser from './yaml'
+
+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 = parser(yaml) || {}
+ var body = string.replace(match[0], '')
+
+ return { attributes: attributes, body: body, frontmatter: yaml }
+}
+
+function test(string) {
+ string = string || ''
+
+ return regex.test(string)
+}
+
+export default extractor
diff --git a/src/plugins/front-matter/yaml.js b/src/plugins/front-matter/yaml.js
new file mode 100644
index 0000000..b947463
--- /dev/null
+++ b/src/plugins/front-matter/yaml.js
@@ -0,0 +1,466 @@
+/**
+ * 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 = [],
+ reference_blocks = [],
+ processing_time = 0,
+ regex = {
+ 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 to create an XMLHttpClient in a cross-browser manner
+function createXMLHTTPRequest() {
+ var xmlhttp
+
+ try {
+ // Mozilla / Safari / IE7
+ xmlhttp = new XMLHttpRequest()
+ } catch (e) {
+ // IE
+ var XMLHTTP_IDS = new Array(
+ 'MSXML2.XMLHTTP.5.0',
+ 'MSXML2.XMLHTTP.4.0',
+ 'MSXML2.XMLHTTP.3.0',
+ 'MSXML2.XMLHTTP',
+ 'Microsoft.XMLHTTP'
+ )
+ var success = false
+ for (var i = 0; i < XMLHTTP_IDS.length && !success; i++) {
+ try {
+ xmlhttp = new ActiveXObject(XMLHTTP_IDS[i])
+ success = true
+ } catch (e) {}
+ }
+ if (!success) {
+ throw new Error('Unable to create XMLHttpRequest.')
+ }
+ }
+
+ return xmlhttp
+}
+
+function parser(str) {
+ var regLevel = regex['regLevel']
+ var invalidLine = regex['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['trim'], ''))
+ curLevel = level
+ }
+
+ return result
+}
+
+function processValue(val) {
+ val = val.replace(regex['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['dashesString']))) {
+ return m[1]
+ } else if ((m = val.match(regex['quotesString']))) {
+ return m[1]
+ } else if ((m = val.match(regex['float']))) {
+ return parseFloat(m[0])
+ } else if ((m = val.match(regex['integer']))) {
+ return parseInt(m[0])
+ } else if (!isNaN((m = Date.parse(val)))) {
+ return new Date(m)
+ } else if ((m = val.match(regex['single_key_value']))) {
+ var res = {}
+ res[m[1]] = processValue(m[2])
+ return res
+ } else if ((m = val.match(regex['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['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['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['key']))) {
+ var key = m[1]
+
+ if (key[0] == '-') {
+ key = key.replace(regex['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['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['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(pre)
+ var res = semanticAnalysis(doc)
+ processing_time = new Date().getTime() - processing_time
+
+ return res
+}
+
+export default load
diff --git a/src/plugins/ga.js b/src/plugins/ga.js
new file mode 100644
index 0000000..2d6419b
--- /dev/null
+++ b/src/plugins/ga.js
@@ -0,0 +1,38 @@
+// From https://github.com/egoist/vue-ga/blob/master/src/index.js
+function appendScript() {
+ const script = document.createElement('script')
+ script.async = true
+ script.src = 'https://www.google-analytics.com/analytics.js'
+ document.body.appendChild(script)
+}
+
+function init(id) {
+ appendScript()
+ window.ga =
+ window.ga ||
+ function () {
+ (window.ga.q = window.ga.q || []).push(arguments)
+ }
+ window.ga.l = Number(new Date())
+ window.ga('create', id, 'auto')
+}
+
+function collect() {
+ if (!window.ga) {
+ init($docsify.ga)
+ }
+
+ window.ga('set', 'page', location.hash)
+ window.ga('send', 'pageview')
+}
+
+const install = function (hook) {
+ if (!$docsify.ga) {
+ console.error('[Docsify] ga is required.')
+ return
+ }
+
+ hook.beforeEach(collect)
+}
+
+$docsify.plugins = [].concat(install, $docsify.plugins)
diff --git a/src/plugins/gitalk.js b/src/plugins/gitalk.js
new file mode 100644
index 0000000..8ba9ace
--- /dev/null
+++ b/src/plugins/gitalk.js
@@ -0,0 +1,23 @@
+function install(hook) {
+ const dom = Docsify.dom
+
+ hook.mounted(_ => {
+ const div = dom.create('div')
+ div.id = 'gitalk-container'
+ const main = dom.getNode('#main')
+ div.style = `width: ${main.clientWidth}px; margin: 0 auto 20px;`
+ dom.appendTo(dom.find('.content'), div)
+ })
+
+ hook.doneEach(_ => {
+ const el = document.getElementById('gitalk-container')
+ while (el.hasChildNodes()) {
+ el.removeChild(el.firstChild)
+ }
+
+ // eslint-disable-next-line
+ gitalk.render('gitalk-container')
+ })
+}
+
+$docsify.plugins = [].concat(install, $docsify.plugins)
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)
diff --git a/src/plugins/search/component.js b/src/plugins/search/component.js
new file mode 100644
index 0000000..42b0d19
--- /dev/null
+++ b/src/plugins/search/component.js
@@ -0,0 +1,225 @@
+import {search} from './search'
+
+let NO_DATA_TEXT = ''
+let options
+
+function style() {
+ const code = `
+.sidebar {
+ padding-top: 0;
+}
+
+.search {
+ margin-bottom: 20px;
+ padding: 6px;
+ border-bottom: 1px solid #eee;
+}
+
+.search .input-wrap {
+ display: flex;
+ align-items: center;
+}
+
+.search .results-panel {
+ display: none;
+}
+
+.search .results-panel.show {
+ display: block;
+}
+
+.search input {
+ outline: none;
+ border: none;
+ width: 100%;
+ padding: 0 7px;
+ line-height: 36px;
+ font-size: 14px;
+}
+
+.search input::-webkit-search-decoration,
+.search input::-webkit-search-cancel-button,
+.search input {
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ appearance: none;
+}
+.search .clear-button {
+ width: 36px;
+ text-align: right;
+ display: none;
+}
+
+.search .clear-button.show {
+ display: block;
+}
+
+.search .clear-button svg {
+ transform: scale(.5);
+}
+
+.search h2 {
+ font-size: 17px;
+ margin: 10px 0;
+}
+
+.search a {
+ text-decoration: none;
+ color: inherit;
+}
+
+.search .matching-post {
+ border-bottom: 1px solid #eee;
+}
+
+.search .matching-post:last-child {
+ border-bottom: 0;
+}
+
+.search p {
+ font-size: 14px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+}
+
+.search p.empty {
+ text-align: center;
+}
+
+.app-name.hide, .sidebar-nav.hide {
+ display: none;
+}`
+
+ Docsify.dom.style(code)
+}
+
+function tpl(defaultValue = '') {
+ const html =
+ `
+
+ `
+ const el = Docsify.dom.create('div', html)
+ const aside = Docsify.dom.find('aside')
+
+ Docsify.dom.toggleClass(el, 'search')
+ Docsify.dom.before(aside, el)
+}
+
+function doSearch(value) {
+ const $search = Docsify.dom.find('div.search')
+ const $panel = Docsify.dom.find($search, '.results-panel')
+ const $clearBtn = Docsify.dom.find($search, '.clear-button')
+ const $sidebarNav = Docsify.dom.find('.sidebar-nav')
+ const $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
+ }
+ const matchs = search(value)
+
+ let html = ''
+ matchs.forEach(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() {
+ const $search = Docsify.dom.find('div.search')
+ const $input = Docsify.dom.find($search, 'input')
+ const $inputWrap = Docsify.dom.find($search, '.input-wrap')
+
+ let timeId
+ // Prevent to Fold sidebar
+ Docsify.dom.on(
+ $search,
+ 'click',
+ e => e.target.tagName !== 'A' && e.stopPropagation()
+ )
+ Docsify.dom.on($input, 'input', e => {
+ clearTimeout(timeId)
+ timeId = setTimeout(_ => doSearch(e.target.value.trim()), 100)
+ })
+ Docsify.dom.on($inputWrap, 'click', e => {
+ // Click input outside
+ if (e.target.tagName !== 'INPUT') {
+ $input.value = ''
+ doSearch()
+ }
+ })
+}
+
+function updatePlaceholder(text, path) {
+ const $input = Docsify.dom.getNode('.search input[type="search"]')
+
+ if (!$input) {
+ return
+ }
+ if (typeof text === 'string') {
+ $input.placeholder = text
+ } else {
+ const match = Object.keys(text).filter(key => path.indexOf(key) > -1)[0]
+ $input.placeholder = text[match]
+ }
+}
+
+function updateNoData(text, path) {
+ if (typeof text === 'string') {
+ NO_DATA_TEXT = text
+ } else {
+ const match = Object.keys(text).filter(key => path.indexOf(key) > -1)[0]
+ NO_DATA_TEXT = text[match]
+ }
+}
+
+function updateOptions(opts) {
+ options = opts
+}
+
+export function init(opts, vm) {
+ const keywords = vm.router.parse().query.s
+
+ updateOptions(opts)
+ style()
+ tpl(keywords)
+ bindEvents()
+ keywords && setTimeout(_ => doSearch(keywords), 500)
+}
+
+export function update(opts, vm) {
+ updateOptions(opts)
+ updatePlaceholder(opts.placeholder, vm.route.path)
+ updateNoData(opts.noData, vm.route.path)
+}
diff --git a/src/plugins/search/index.js b/src/plugins/search/index.js
new file mode 100644
index 0000000..bbd3af6
--- /dev/null
+++ b/src/plugins/search/index.js
@@ -0,0 +1,42 @@
+import {init as initComponet, update as updateComponent} from './component'
+import {init as initSearch} from './search'
+
+const CONFIG = {
+ placeholder: 'Type to search',
+ noData: 'No Results!',
+ paths: 'auto',
+ depth: 2,
+ maxAge: 86400000, // 1 day
+ hideOtherSidebarContent: false,
+ namespace: undefined
+}
+
+const install = function (hook, vm) {
+ const {util} = Docsify
+ const 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
+ }
+
+ const isAuto = CONFIG.paths === 'auto'
+
+ hook.mounted(_ => {
+ initComponet(CONFIG, vm)
+ !isAuto && initSearch(CONFIG, vm)
+ })
+ hook.doneEach(_ => {
+ updateComponent(CONFIG, vm)
+ isAuto && initSearch(CONFIG, vm)
+ })
+}
+
+$docsify.plugins = [].concat(install, $docsify.plugins)
diff --git a/src/plugins/search/search.js b/src/plugins/search/search.js
new file mode 100644
index 0000000..2c9febf
--- /dev/null
+++ b/src/plugins/search/search.js
@@ -0,0 +1,193 @@
+let INDEXS = {}
+
+const LOCAL_STORAGE = {
+ EXPIRE_KEY: 'docsify.search.expires',
+ INDEX_KEY: 'docsify.search.index'
+}
+
+function resolveExpireKey(namespace) {
+ return namespace ? `${LOCAL_STORAGE.EXPIRE_KEY}/${namespace}` : LOCAL_STORAGE.EXPIRE_KEY
+}
+function resolveIndexKey(namespace) {
+ return namespace ? `${LOCAL_STORAGE.INDEX_KEY}/${namespace}` : LOCAL_STORAGE.INDEX_KEY
+}
+
+function escapeHtml(string) {
+ const entityMap = {
+ '&': '&',
+ '<': '<',
+ '>': '>',
+ '"': '"',
+ '\'': ''',
+ '/': '/'
+ }
+
+ return String(string).replace(/[&<>"'/]/g, s => entityMap[s])
+}
+
+function getAllPaths(router) {
+ const paths = []
+
+ Docsify.dom.findAll('.sidebar-nav a:not(.section-link):not([data-nosearch])').forEach(node => {
+ const href = node.href
+ const originHref = node.getAttribute('href')
+ const 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))
+}
+
+export function genIndex(path, content = '', router, depth) {
+ const tokens = window.marked.lexer(content)
+ const slugify = window.Docsify.slugify
+ const index = {}
+ let slug
+
+ tokens.forEach(token => {
+ if (token.type === 'heading' && token.depth <= depth) {
+ slug = router.toURL(path, {id: slugify(token.text)})
+ index[slug] = {slug, title: token.text, body: ''}
+ } else {
+ if (!slug) {
+ return
+ }
+ if (!index[slug]) {
+ index[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}
+ */
+export function search(query) {
+ const matchingResults = []
+ let data = []
+ Object.keys(INDEXS).forEach(key => {
+ data = data.concat(Object.keys(INDEXS[key]).map(page => INDEXS[key][page]))
+ })
+
+ query = query.trim()
+ let keywords = query.split(/[\s\-,\\/]+/)
+ if (keywords.length !== 1) {
+ keywords = [].concat(query, keywords)
+ }
+
+ for (let i = 0; i < data.length; i++) {
+ const post = data[i]
+ 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) {
+ 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) : -1
+ indexContent = postContent ? postContent.search(regEx) : -1
+
+ if (indexTitle >= 0 || indexContent >= 0) {
+ matchesScore += indexTitle >= 0 ? 3 : indexContent >= 0 ? 2 : 0;
+ if (indexContent < 0) {
+ indexContent = 0
+ }
+
+ let start = 0
+ let end = 0
+
+ start = indexContent < 11 ? 0 : indexContent - 10
+ end = start === 0 ? 70 : indexContent + keyword.length + 60
+
+ if (end > postContent.length) {
+ end = postContent.length
+ }
+
+ const matchContent =
+ '...' +
+ escapeHtml(postContent)
+ .substring(start, end)
+ .replace(regEx, `${keyword} `) +
+ '...'
+
+ resultStr += matchContent
+ }
+ })
+
+ if (matchesScore > 0) {
+ const matchingPost = {
+ title: escapeHtml(postTitle),
+ content: postContent ? resultStr : '',
+ url: postUrl,
+ score: matchesScore
+ }
+
+ matchingResults.push(matchingPost)
+ }
+ }
+ }
+
+ return matchingResults.sort((r1, r2) => r2.score - r1.score);
+}
+
+export function init(config, vm) {
+ const isAuto = config.paths === 'auto'
+
+ const expireKey = resolveExpireKey(config.namespace)
+ const indexKey = resolveIndexKey(config.namespace)
+
+ const isExpired = localStorage.getItem(expireKey) < Date.now()
+
+ INDEXS = JSON.parse(localStorage.getItem(indexKey))
+
+ if (isExpired) {
+ INDEXS = {}
+ } else if (!isAuto) {
+ return
+ }
+
+ const paths = isAuto ? getAllPaths(vm.router) : config.paths
+ const len = paths.length
+ let count = 0
+
+ paths.forEach(path => {
+ if (INDEXS[path]) {
+ return count++
+ }
+
+ Docsify
+ .get(vm.router.getFile(path), false, vm.config.requestHeaders)
+ .then(result => {
+ INDEXS[path] = genIndex(path, result, vm.router, config.depth)
+ len === ++count && saveData(config.maxAge, expireKey, indexKey)
+ })
+ })
+}
diff --git a/src/plugins/zoom-image.js b/src/plugins/zoom-image.js
new file mode 100644
index 0000000..faf92e1
--- /dev/null
+++ b/src/plugins/zoom-image.js
@@ -0,0 +1,21 @@
+import mediumZoom from 'medium-zoom'
+
+const matchesSelector = Element.prototype.matches || Element.prototype.webkitMatchesSelector || Element.prototype.msMatchesSelector
+
+function install(hook) {
+ let zoom
+
+ hook.doneEach(_ => {
+ let elms = Array.apply(null, document.querySelectorAll('.markdown-section img:not(.emoji):not([data-no-zoom])'))
+
+ elms = elms.filter(elm => matchesSelector.call(elm, 'a img') === false)
+
+ if (zoom) {
+ zoom.detach()
+ }
+
+ zoom = mediumZoom(elms)
+ })
+}
+
+$docsify.plugins = [].concat(install, $docsify.plugins)
diff --git a/src/render.js b/src/render.js
deleted file mode 100644
index df4e4f9..0000000
--- a/src/render.js
+++ /dev/null
@@ -1,51 +0,0 @@
-import marked from 'marked'
-import Prism from 'prismjs'
-import genToc from './gen-toc'
-
-const cornerTpl = `
-
-
-
-
-
-
-
-`
-const toc = []
-const renderer = new marked.Renderer()
-
-/**
- * render anchor tag
- * @link https://github.com/chjj/marked#overriding-renderer-methods
- */
-renderer.heading = function (text, level) {
- const slug = text.replace(/<(?:.|\n)*?>/gm, '').toLowerCase().replace(/[\s\n\t]+/g, '-')
-
- toc.push({ level, slug: '#' + slug, title: text })
-
- return ` ${text} `
-}
-
-// highlight code
-renderer.code = function (code, lang = '') {
- const hl = Prism.highlight(code, Prism.languages[lang] || Prism.languages.markup)
-
- return ` ${hl} `
-}
-marked.setOptions({ renderer })
-
-export default function (content, opts = {}) {
- let corner = ''
-
- if (opts.repo) {
- const repo = /\/\//.test(opts.repo) ? opts.repo : ('https://github.com/' + opts.repo)
- corner = cornerTpl.replace(/{{repo}}/g, repo)
- }
-
- const section = ``
- const sidebar = ``
-
- return `${corner}${sidebar}${section} `
-}
diff --git a/src/themes/basic/_coverpage.styl b/src/themes/basic/_coverpage.styl
new file mode 100644
index 0000000..0014932
--- /dev/null
+++ b/src/themes/basic/_coverpage.styl
@@ -0,0 +1,95 @@
+section.cover
+ align-items center
+ background-position center center
+ background-repeat no-repeat
+ background-size cover
+ height 100vh
+ display none
+
+ &.show
+ display flex
+
+ &.has-mask .mask
+ background-color $color-bg
+ opacity 0.8
+ position absolute
+ top 0
+ height 100%
+ width 100%
+
+ .cover-main
+ flex 1
+ margin -20px 16px 0
+ text-align center
+ z-index 1
+
+ a
+ color inherit
+ text-decoration none
+
+ &:hover
+ text-decoration none
+
+ p
+ line-height 1.5rem
+ margin 1em 0
+
+ h1
+ color inherit
+ font-size 2.5rem
+ font-weight 300
+ margin 0.625rem 0 2.5rem
+ position relative
+ text-align center
+
+ a
+ display block
+
+ small
+ bottom -0.4375rem
+ font-size 1rem
+ position absolute
+
+ blockquote
+ font-size 1.5rem
+ text-align center
+
+ ul
+ line-height 1.8
+ list-style-type none
+ margin 1em auto
+ max-width 500px
+ padding 0
+
+ .cover-main > p:last-child a
+ border-color var(--theme-color, $color-primary)
+ border-radius 2rem
+ border-style solid
+ border-width 1px
+ box-sizing border-box
+ color var(--theme-color, $color-primary)
+ display inline-block
+ font-size 1.05rem
+ letter-spacing 0.1rem
+ margin 0.5rem 1rem
+ padding 0.75em 2rem
+ text-decoration none
+ transition all 0.15s ease
+
+ &:last-child
+ background-color var(--theme-color, $color-primary)
+ color #fff
+
+ &:hover
+ color inherit
+ opacity 0.8
+
+ &:hover
+ color inherit
+
+ blockquote > p > a
+ border-bottom 2px solid var(--theme-color, $color-primary)
+ transition color 0.3s
+
+ &:hover
+ color var(--theme-color, $color-primary)
diff --git a/src/themes/basic/_layout.styl b/src/themes/basic/_layout.styl
new file mode 100644
index 0000000..387fd79
--- /dev/null
+++ b/src/themes/basic/_layout.styl
@@ -0,0 +1,470 @@
+*
+ -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
+
+ [data-cloak], .app-nav, > nav
+ display none
+
+div#app
+ font-size 30px
+ font-weight lighter
+ margin 40vh auto
+ text-align center
+
+ &:empty::before
+ content 'Loading...'
+
+.emoji
+ height 1.2rem
+ vertical-align middle
+
+.progress
+ background-color var(--theme-color, $color-primary)
+ height 2px
+ left 0px
+ position fixed
+ right 0px
+ top 0px
+ transition width 0.2s, opacity 0.4s
+ width 0%
+ z-index 999999
+
+.search a:hover
+ color var(--theme-color, $color-primary)
+
+.search .search-keyword
+ color var(--theme-color, $color-primary)
+ font-style normal
+ font-weight bold
+
+html, body
+ height 100%
+
+body
+ -moz-osx-font-smoothing grayscale
+ -webkit-font-smoothing antialiased
+ color $color-text
+ 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 0.6
+
+kbd
+ border solid 1px #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 0.2em 0.25em 0
+ vertical-align middle
+
+/* navbar */
+.app-nav
+ margin 25px 60px 0 0
+ position absolute
+ right 0
+ text-align right
+ z-index 10
+
+ &.no-badge
+ margin-right 25px
+
+ p
+ margin 0
+
+ > a
+ margin 0 1rem
+ padding 5px 0
+
+ ul, li
+ display inline-block
+ list-style none
+ margin 0
+
+ a
+ color inherit
+ font-size 16px
+ text-decoration none
+ transition color 0.3s
+
+ &:hover
+ color var(--theme-color, $color-primary)
+
+ &.active
+ border-bottom 2px solid var(--theme-color, $color-primary)
+ color var(--theme-color, $color-primary)
+
+ /* navbar dropdown */
+ li
+ display inline-block
+ margin 0 1rem
+ padding 5px 0
+ position relative
+
+ 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
+
+ li
+ display block
+ font-size 14px
+ line-height 1rem
+ margin 0
+ margin 8px 14px
+ white-space nowrap
+
+ a
+ display block
+ font-size inherit
+ margin 0
+ padding 0
+
+ &.active
+ border-bottom 0
+
+ &:hover ul
+ display block
+
+/* github corner */
+.github-corner
+ border-bottom 0
+ position fixed
+ right 0
+ text-decoration none
+ top 0
+ z-index 1
+
+ &:hover .octo-arm
+ animation octocat-wave 560ms ease-in-out
+
+ svg
+ color $color-bg
+ fill var(--theme-color, $color-primary)
+ height 80px
+ width 80px
+
+/* main */
+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 0.3s
+
+ span
+ color $color-text
+
+ &:hover
+ text-decoration underline
+
+/* sidebar */
+.sidebar
+ border-right 1px solid rgba(0, 0, 0, 0.07)
+ overflow-y auto
+ padding 40px 0 0
+ position absolute
+ top 0
+ bottom 0
+ left 0
+ transition transform 250ms ease-out
+ width $sidebar-width
+ z-index 20
+
+ > h1
+ margin 0 auto 1rem
+ font-size 1.5rem
+ font-weight 300
+ text-align center
+
+ a
+ color inherit
+ text-decoration none
+
+ .app-nav
+ display block
+ position static
+
+ .sidebar-nav
+ line-height 2em
+ padding-bottom 40px
+
+ li.collapse
+ .app-sub-sidebar
+ display none
+
+ ul
+ margin 0 0 0 15px
+ padding 0
+
+ li > p
+ font-weight 700
+ margin 0
+
+ ul, ul li
+ list-style none
+
+ ul li a
+ border-bottom none
+ display block
+
+ ul li ul
+ padding-left 20px
+
+ &::-webkit-scrollbar
+ width 4px
+
+ &::-webkit-scrollbar-thumb
+ background transparent
+ border-radius 4px
+
+ &:hover::-webkit-scrollbar-thumb
+ background rgba(136, 136, 136, 0.4)
+
+ &:hover::-webkit-scrollbar-track
+ background rgba(136, 136, 136, 0.1)
+
+/* sidebar toggle */
+.sidebar-toggle
+ background-color transparent
+ background-color rgba($color-bg, 0.8)
+ border 0
+ outline none
+ padding 10px
+ position absolute
+ bottom 0
+ left 0
+ text-align center
+ transition opacity 0.3s
+ width $sidebar-width - 16px
+ z-index 30
+
+ .sidebar-toggle-button:hover
+ opacity 0.4
+
+ span
+ background-color var(--theme-color, $color-primary)
+ display block
+ margin-bottom 4px
+ width 16px
+ height 2px
+
+body.sticky
+ .sidebar, .sidebar-toggle
+ position fixed
+
+/* main content */
+.content
+ padding-top 60px
+ position absolute
+ top 0
+ right 0
+ bottom 0
+ left $sidebar-width
+ transition left 250ms ease
+
+/* markdown content found on pages */
+.markdown-section
+ margin 0 auto
+ max-width 800px
+ padding 30px 15px 40px 15px
+ position relative
+
+ > *
+ box-sizing border-box
+ font-size inherit
+
+ > :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
+ /* fix horizontal overflow on iOS Safari */
+ 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
+ border 1px solid #ddd
+ font-weight bold
+ padding 6px 13px
+
+.markdown-section td
+ border 1px solid #ddd
+ padding 6px 13px
+
+.markdown-section tr
+ border-top 1px solid #ccc
+
+ &:nth-child(2n)
+ background-color #f8f8f8
+
+.markdown-section p.tip
+ background-color #f8f8f8
+ 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
+
+ &:before
+ background-color #f66
+ border-radius 100%
+ color $color-bg
+ content '!'
+ font-family 'Dosis', 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif
+ font-size 14px
+ font-weight bold
+ left -12px
+ line-height 20px
+ position absolute
+ height 20px
+ width 20px
+ text-align center
+ top 14px
+
+ code
+ background-color #efefef
+
+ em
+ color $color-text
+
+.markdown-section p.warn
+ background rgba($color-primary, 0.1)
+ border-radius 2px
+ padding 1rem
+
+.markdown-section ul.task-list > li
+ list-style-type none
+
+body.close
+ .sidebar
+ transform translateX(- $sidebar-width)
+
+ .sidebar-toggle
+ width auto
+
+ .content
+ left 0
+
+@media print
+ .github-corner, .sidebar-toggle, .sidebar, .app-nav
+ display none
+
+@media screen and (max-width: 768px)
+ .github-corner, .sidebar-toggle, .sidebar
+ position fixed
+
+ .app-nav
+ margin-top 16px
+
+ .app-nav li ul
+ top 30px
+
+ main
+ height auto
+ overflow-x hidden
+
+ .sidebar
+ left - $sidebar-width
+ transition transform 250ms ease-out
+
+ .content
+ left 0
+ max-width 100vw
+ position static
+ padding-top 20px
+ transition transform 250ms ease
+
+ .app-nav, .github-corner
+ transition transform 250ms ease-out
+
+ .sidebar-toggle
+ background-color transparent
+ width auto
+ padding 30px 30px 10px 10px
+
+ body.close
+ .sidebar
+ transform translateX($sidebar-width)
+
+ .sidebar-toggle
+ background-color rgba($color-bg, 0.8)
+ transition 1s background-color
+ width $sidebar-width - 16px
+ padding 10px
+
+ .content
+ transform translateX($sidebar-width)
+
+ .app-nav, .github-corner
+ display none
+
+ .github-corner
+ &:hover .octo-arm
+ animation none
+
+ .octo-arm
+ animation octocat-wave 560ms ease-in-out
+
+@keyframes octocat-wave
+ 0%, 100%
+ transform rotate(0)
+
+ 20%, 60%
+ transform rotate(-25deg)
+
+ 40%, 80%
+ transform rotate(10deg)
diff --git a/src/themes/buble.styl b/src/themes/buble.styl
new file mode 100644
index 0000000..53fbc15
--- /dev/null
+++ b/src/themes/buble.styl
@@ -0,0 +1,173 @@
+@import url('https://fonts.googleapis.com/css?family=Inconsolata|Inconsolata-Bold')
+
+$color-primary = #0074d9
+$color-bg = #fff
+$color-text = #34495e
+$sidebar-width = 16rem
+
+@import 'basic/_layout'
+@import 'basic/_coverpage'
+
+/* sidebar */
+.sidebar
+ color #364149
+ background-color $color-bg
+
+ a
+ color #666
+ text-decoration none
+
+ li
+ list-style none
+ margin 0
+ padding 0.2em 0 0.2em 0
+
+ ul li ul
+ padding 0
+
+ li.active
+ a
+ color #333
+
+ background-color #eee
+
+.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, $color-primary)
+ font-weight 400
+
+.markdown-section p, .markdown-section ul, .markdown-section ol
+ line-height 1.6rem
+ margin 0 0 1em 0
+ word-spacing 0.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 0
+ padding 1rem 0 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 p, .markdown-section ul, .markdown-section ol
+ margin 1.2em 0
+
+.markdown-section ul, .markdown-section ol
+ padding-left 1.5rem
+
+.markdown-section li
+ line-height 1.5
+ margin 0
+
+.markdown-section blockquote
+ border-left 4px solid var(--theme-color, $color-primary)
+ 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
+ background-color #f9f9f9
+ border-radius 3px
+ font-family Inconsolata
+ padding 0.2em 0.4rem
+ white-space nowrap
+
+.markdown-section pre
+ background-color #f9f9f9
+ border-left 2px solid #eee
+ font-family Inconsolata
+ font-size 16px
+ margin 0 0 1em 0
+ padding 8px
+ padding 0 10px 12px 0
+ overflow auto
+ word-wrap normal
+ position relative
+
+/* code highlight */
+.token.cdata, .token.comment, .token.doctype, .token.prolog
+ color #93a1a1 /* base1 */
+
+.token.punctuation
+ color #586e75 /* base01 */
+
+.namespace
+ opacity 0.7
+
+.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted
+ color #268bd2 /* blue */
+
+.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.url, .token.inserted
+ color #2aa198 /* cyan */
+
+.token.entity
+ color #657b83 /* base00 */
+ background #eee8d5 /* base2 */
+
+.token.atrule, .token.attr-value, .token.keyword
+ color #a11 /* green */
+
+.token.function
+ color #b58900 /* yellow */
+
+.token.regex, .token.important, .token.variable
+ color #cb4b16 /* orange */
+
+.token.important, .token.bold
+ font-weight bold
+
+.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 0.8em 20px
+ position relative
+ white-space inherit
+
+.markdown-section code::after, .markdown-section code::before
+ letter-spacing 0.05rem
+
+code .token
+ -webkit-font-smoothing initial
+ -moz-osx-font-smoothing initial
+ min-height 1.5rem
diff --git a/src/themes/dark.styl b/src/themes/dark.styl
new file mode 100644
index 0000000..02ca630
--- /dev/null
+++ b/src/themes/dark.styl
@@ -0,0 +1,225 @@
+@import url('https://fonts.googleapis.com/css?family=Roboto+Mono|Source+Sans+Pro:300,400,600')
+
+$color-primary = #ea6f5a
+$color-bg = #3f3f3f
+$color-text = #c8c8c8
+$sidebar-width = 300px
+
+@import 'basic/_layout'
+@import 'basic/_coverpage'
+
+body
+ background-color $color-bg
+
+/* sidebar */
+.sidebar
+ background-color $color-bg
+ color #c8c8c8
+
+ li
+ margin 6px 15px 6px 0
+
+ ul li a
+ color #c8c8c8
+ font-size 14px
+ overflow hidden
+ text-decoration none
+ text-overflow ellipsis
+ white-space nowrap
+
+ &:hover
+ text-decoration underline
+
+ ul li ul
+ padding 0
+
+ ul li.active > a
+ color var(--theme-color, $color-primary)
+ font-weight 600
+
+/* markdown content found on pages */
+.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, $color-primary)
+ font-weight 600
+
+.markdown-section h1
+ font-size 2rem
+ margin 0 0 1rem
+
+.markdown-section h2
+ font-size 1.75rem
+ margin 45px 0 0.8rem
+
+.markdown-section h3
+ font-size 1.5rem
+ margin 40px 0 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, .markdown-section ul, .markdown-section ol
+ margin 1.2em 0
+
+.markdown-section p, .markdown-section ul, .markdown-section ol
+ line-height 1.6rem
+ word-spacing 0.05rem
+
+.markdown-section ul, .markdown-section ol
+ padding-left 1.5rem
+
+.markdown-section blockquote
+ border-left 4px solid var(--theme-color, $color-primary)
+ 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
+ background-color #282828
+ border-radius 2px
+ color #657b83
+ font-family 'Roboto Mono', Monaco, courier, monospace
+ font-size 0.8rem
+ margin 0 2px
+ padding 3px 5px
+ white-space pre-wrap
+
+.markdown-section pre
+ -moz-osx-font-smoothing initial
+ -webkit-font-smoothing initial
+ background-color #282828
+ font-family 'Roboto Mono', Monaco, courier, monospace
+ line-height 1.5rem
+ margin 1.2em 0
+ overflow auto
+ padding 0 1.4rem
+ position relative
+ word-wrap normal
+
+/* code highlight */
+.token.comment, .token.prolog, .token.doctype, .token.cdata
+ color #8e908c
+
+.token.namespace
+ opacity 0.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, $color-primary)
+
+.token.selector
+ color #6679cc
+
+.token.attr-name
+ color #2973b7
+
+.token.entity, .token.url, .language-css .token.string, .style .token.string
+ color #22a2c9
+
+.token.attr-value, .token.control, .token.directive, .token.unit
+ color var(--theme-color, $color-primary)
+
+.token.keyword
+ color #e96900
+
+.token.statement, .token.regex, .token.atrule
+ 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.important, .token.bold
+ font-weight bold
+
+.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 0.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 0.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 0.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
diff --git a/src/themes/dolphin.styl b/src/themes/dolphin.styl
new file mode 100644
index 0000000..f5ea286
--- /dev/null
+++ b/src/themes/dolphin.styl
@@ -0,0 +1,228 @@
+@import url('https://fonts.googleapis.com/css?family=Thasadith:400,400i,700')
+
+$color-primary = #00ffff
+$color-bg = #f0ffff
+$color-text = #34495e
+$sidebar-width = 300px
+
+@import 'basic/_layout'
+@import 'basic/_coverpage'
+
+body
+ background-color $color-bg
+
+/* sidebar */
+.sidebar
+ background-color $color-bg
+ color #364149
+
+ li
+ margin 6px 0 6px 0
+
+ ul li a
+ color #505d6b
+ font-size 14px
+ font-weight normal
+ overflow hidden
+ text-decoration none
+ text-overflow ellipsis
+ white-space nowrap
+
+ &:hover
+ text-decoration underline
+
+ ul li ul
+ padding 0
+
+ ul li.active > a
+ border-right 2px solid
+ color var(--theme-color, $color-primary)
+ font-weight 600
+
+.app-sub-sidebar
+ li
+ &::before
+ content '-'
+ padding-right 4px
+ float left
+
+/* markdown content found on pages */
+.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, $color-primary)
+ font-weight 600
+
+ &:hover
+ text-decoration underline
+
+.markdown-section h1
+ font-size 2rem
+ margin 0 0 1rem
+
+.markdown-section h2
+ font-size 1.75rem
+ margin 45px 0 0.8rem
+
+.markdown-section h3
+ font-size 1.5rem
+ margin 40px 0 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 p, .markdown-section ul, .markdown-section ol
+ line-height 1.6rem
+ word-spacing 0.05rem
+
+.markdown-section ul, .markdown-section ol
+ padding-left 1.5rem
+
+.markdown-section blockquote
+ border-left 4px solid var(--theme-color, $color-primary)
+ 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
+ background-color #f8f8f8
+ border-radius 2px
+ color #e96900
+ font-family 'Roboto Mono', Monaco, courier, monospace
+ font-size 0.8rem
+ margin 0 2px
+ padding 3px 5px
+ white-space pre-wrap
+
+.markdown-section pre
+ -moz-osx-font-smoothing initial
+ -webkit-font-smoothing initial
+ background-color #f8f8f8
+ font-family 'Roboto Mono', Monaco, courier, monospace
+ line-height 1.5rem
+ margin 1.2em 0
+ overflow auto
+ padding 0 1.4rem
+ position relative
+ word-wrap normal
+
+/* code highlight */
+.token.comment, .token.prolog, .token.doctype, .token.cdata
+ color #8e908c
+
+.token.namespace
+ opacity 0.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, $color-primary)
+
+.token.selector
+ color #6679cc
+
+.token.attr-name
+ color #2973b7
+
+.token.entity, .token.url, .language-css .token.string, .style .token.string
+ color #22a2c9
+
+.token.attr-value, .token.control, .token.directive, .token.unit
+ color var(--theme-color, $color-primary)
+
+.token.keyword, .token.function
+ color #e96900
+
+.token.statement, .token.regex, .token.atrule
+ 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.important, .token.bold
+ font-weight bold
+
+.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 0.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 0.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 0.6rem
+ font-weight 600
+ height 15px
+ line-height 15px
+ padding 5px 10px 0
+ position absolute
+ right 0
+ text-align right
+ top 0
diff --git a/src/themes/pure.styl b/src/themes/pure.styl
new file mode 100644
index 0000000..37d0b76
--- /dev/null
+++ b/src/themes/pure.styl
@@ -0,0 +1,7 @@
+$color-primary = #000
+$color-bg = #fff
+$color-text = #000
+$sidebar-width = 300px
+
+@import 'basic/_layout'
+@import 'basic/_coverpage'
diff --git a/src/themes/vue.styl b/src/themes/vue.styl
new file mode 100644
index 0000000..98c416e
--- /dev/null
+++ b/src/themes/vue.styl
@@ -0,0 +1,225 @@
+@import url('https://fonts.googleapis.com/css?family=Roboto+Mono|Source+Sans+Pro:300,400,600')
+
+$color-primary = #42b983
+$color-bg = #fff
+$color-text = #34495e
+$sidebar-width = 300px
+
+@import 'basic/_layout'
+@import 'basic/_coverpage'
+
+body
+ background-color $color-bg
+
+/* sidebar */
+.sidebar
+ background-color $color-bg
+ color #364149
+
+ li
+ margin 6px 0 6px 0
+
+ ul li a
+ color #505d6b
+ font-size 14px
+ font-weight normal
+ overflow hidden
+ text-decoration none
+ text-overflow ellipsis
+ white-space nowrap
+
+ &:hover
+ text-decoration underline
+
+ ul li ul
+ padding 0
+
+ ul li.active > a
+ border-right 2px solid
+ color var(--theme-color, $color-primary)
+ font-weight 600
+
+.app-sub-sidebar
+ li
+ &::before
+ content '-'
+ padding-right 4px
+ float left
+
+/* markdown content found on pages */
+.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, $color-primary)
+ font-weight 600
+
+.markdown-section h1
+ font-size 2rem
+ margin 0 0 1rem
+
+.markdown-section h2
+ font-size 1.75rem
+ margin 45px 0 0.8rem
+
+.markdown-section h3
+ font-size 1.5rem
+ margin 40px 0 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 p, .markdown-section ul, .markdown-section ol
+ line-height 1.6rem
+ word-spacing 0.05rem
+
+.markdown-section ul, .markdown-section ol
+ padding-left 1.5rem
+
+.markdown-section blockquote
+ border-left 4px solid var(--theme-color, $color-primary)
+ 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
+ background-color #f8f8f8
+ border-radius 2px
+ color #e96900
+ font-family 'Roboto Mono', Monaco, courier, monospace
+ font-size 0.8rem
+ margin 0 2px
+ padding 3px 5px
+ white-space pre-wrap
+
+.markdown-section pre
+ -moz-osx-font-smoothing initial
+ -webkit-font-smoothing initial
+ background-color #f8f8f8
+ font-family 'Roboto Mono', Monaco, courier, monospace
+ line-height 1.5rem
+ margin 1.2em 0
+ overflow auto
+ padding 0 1.4rem
+ position relative
+ word-wrap normal
+
+/* code highlight */
+.token.comment, .token.prolog, .token.doctype, .token.cdata
+ color #8e908c
+
+.token.namespace
+ opacity 0.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, $color-primary)
+
+.token.selector
+ color #6679cc
+
+.token.attr-name
+ color #2973b7
+
+.token.entity, .token.url, .language-css .token.string, .style .token.string
+ color #22a2c9
+
+.token.attr-value, .token.control, .token.directive, .token.unit
+ color var(--theme-color, $color-primary)
+
+.token.keyword, .token.function
+ color #e96900
+
+.token.statement, .token.regex, .token.atrule
+ 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.important, .token.bold
+ font-weight bold
+
+.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 0.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 0.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 0.6rem
+ font-weight 600
+ height 15px
+ line-height 15px
+ padding 5px 10px 0
+ position absolute
+ right 0
+ text-align right
+ top 0
diff --git a/test/_helper.js b/test/_helper.js
new file mode 100644
index 0000000..4b4abce
--- /dev/null
+++ b/test/_helper.js
@@ -0,0 +1,87 @@
+// 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')
+
+function ready(callback) {
+ const state = document.readyState
+
+ if (state === 'complete' || state === 'interactive') {
+ return setTimeout(callback, 0)
+ }
+
+ document.addEventListener('DOMContentLoaded', 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) => {
+ ready(() => {
+ const docsify = new Docsify()
+ // 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)
+ return resolve({
+ docsify: docsify,
+ dom: dom
+ })
+ }
+ }, 10)
+ })
+
+ })
+}
+module.exports.expectSameDom = function(actual, expected) {
+ const WHITESPACES_BETWEEN_TAGS = />(\s\s+)
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..7b2b253
--- /dev/null
+++ b/test/integration/render.js
@@ -0,0 +1,14 @@
+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)
+ // TODO: add some expectations
+ })
+
+})
diff --git a/test/integration/router.js b/test/integration/router.js
new file mode 100644
index 0000000..b87e802
--- /dev/null
+++ b/test/integration/router.js
@@ -0,0 +1,14 @@
+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'
+ // TODO: add some expectations
+ })
+
+})
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/render.js b/test/unit/render.js
new file mode 100644
index 0000000..25043cf
--- /dev/null
+++ b/test/unit/render.js
@@ -0,0 +1,89 @@
+const path = require('path')
+
+const {expect} = require('chai')
+
+const {init, expectSameDom} = require('../_helper')
+
+describe('render', function() {
+ it('important content (tips)', async function() {
+ 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() {
+ const {docsify, dom} = await init()
+ const output = docsify.compiler.compile(`
+- [x] Task 1
+- [ ] Task 2
+- [ ] Task 3`)
+ expect(output, ``)
+ })
+
+ it('as ordered task list', async function() {
+ const {docsify, dom} = await init()
+ const output = docsify.compiler.compile(`
+1. [ ] Task 1
+2. [x] Task 2`)
+ expectSameDom(output, `
+ Task 1
+ Task 2
+ `)
+ })
+
+ it('normal unordered', async function() {
+ const {docsify, dom} = await init()
+ const output = docsify.compiler.compile(`
+- [linktext](link)
+- just text`)
+ expectSameDom(output, ``)
+ })
+
+ it('unordered with custom start', async function() {
+ const {docsify, dom} = await init()
+ const output = docsify.compiler.compile(`
+1. first
+2. second
+
+text
+
+3. third`)
+ expectSameDom(output, `
+ first
+ second
+
+ text
+
+ third
+ `)
+ })
+
+ it('nested', async function() {
+ const {docsify, dom} = await init()
+ const output = docsify.compiler.compile(`
+- 1
+- 2
+ - 2 a
+ - 2 b
+- 3`)
+ expectSameDom(output, ``)
+ })
+ })
+
+})
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')
+ })
+})
diff --git a/themes/.gitkeep b/themes/.gitkeep
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/themes/.gitkeep
@@ -0,0 +1 @@
+
diff --git a/themes/buble.css b/themes/buble.css
deleted file mode 100644
index 02d326c..0000000
--- a/themes/buble.css
+++ /dev/null
@@ -1,405 +0,0 @@
-@import url('https://fonts.googleapis.com/css?family=Inconsolata|Inconsolata-Bold');
-
-* {
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- -webkit-overflow-scrolling: touch;
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
- -webkit-text-size-adjust: none;
- -webkit-touch-callout: none;
- -webkit-font-smoothing: antialiased;
-}
-
-/* navbar */
-nav {
- position: absolute;
- right: 0;
- left: 0;
- z-index: 10;
- margin: 25px 60px 0 0;
- text-align: right;
-}
-
-nav a {
- margin: 0 1em;
- padding: 5px 0;
- font-size: 16px;
- text-decoration: none;
- color: inherit;
- transition: color .3s;
-}
-
-nav a:hover {
- color: #0074D9;
-}
-
-nav a.active {
- color: #0074D9;
- border-bottom: 2px solid #0074D9;
-}
-
-/* github corner */
-.github-corner {
- position: absolute;
- top: 0;
- right: 0;
- z-index: 10;
-}
-
-.github-corner svg {
- color: #fff;
- fill: #0074D9;
- height: 80px;
- width: 80px;
-}
-
-.github-corner:hover .octo-arm {
- animation:octocat-wave 560ms ease-in-out;
-}
-
-@keyframes octocat-wave {
- 0%,100%{ transform: rotate(0); }
- 20%,60%{ transform: rotate(-25deg); }
- 40%,80%{ transform: rotate(10deg); }
-}
-
-@media (max-width: 500px) {
- .github-corner:hover .octo-arm {
- animation: none;
- }
- .github-corner .octo-arm {
- animation: octocat-wave 560ms ease-in-out;
- }
-}
-
-html, body {
- height: 100%;
-}
-
-body {
- -moz-osx-font-smoothing: grayscale;
- -webkit-font-smoothing: antialiased;
- background-color: #fff;
- color: #34495e;
- font-family: 'Source Sans Pro', arial, sans-serif;
- font-weight: 400px;
- font-size: 15px;
- letter-spacing: 0;
- margin: 0;
-}
-
-/* main */
-main {
- height: 100%;
- position: relative;
- width: 100%;
-}
-
-/* sidebar */
-.sidebar {
- background-color: #fff;
- border-right: 1px solid rgba(0,0,0,.07);
- bottom: 0;
- color: #364149;
- overflow-y: auto;
- position: absolute;
- top: 0;
- width: 14em;
- z-index: 1;
- padding-top: 40px;
-}
-
-.sidebar ul {
- margin: 0;
- padding: 0;
-}
-
-.sidebar ul, .sidebar ul li {
- list-style: none;
-}
-
-.sidebar a {
- color: #666;
- text-decoration: none;
-}
-
-.sidebar li {
- list-style: none;
- padding: 0.2em 0.2em 0.2em 1em;
- margin: 0;
-}
-
-.sidebar .active {
- background-color: #eee;
-}
-
-.sidebar .active a {
- color: #333;
-}
-
-/* main content */
-.content {
- bottom: 0;
- left: 14em;
- overflow-y: auto;
- position: absolute;
- right: 0;
- top: 0;
- overflow-x: hidden;
- padding-top: 20px;
-}
-
-@media screen and (max-width: 600px) {
- .sidebar {
- left: -14em;
- }
-
- .content {
- left: 0;
- }
-}
-
-/* markdown content found on pages */
-.markdown-section {
- position: relative;
- margin: 0 auto;
- max-width: 64em;
- padding: 20px 15px 40px 15px;
-}
-
-.markdown-section * {
- box-sizing: border-box;
- -webkit-box-sizing: border-box;
- font-size: inherit;
-}
-
-.markdown-section>:first-child {
- margin-top: 0!important;
-}
-
-.markdown-section h1,
-.markdown-section h2,
-.markdown-section h3,
-.markdown-section h4,
-.markdown-section strong {
- font-weight: 400;
- color: #333;
-}
-
-.markdown-section a {
- color: #0074D9;
- font-weight: 400;
-}
-
-.markdown-section p,
-.markdown-section ul,
-.markdown-section ol {
- word-spacing: 0.05em;
-}
-
-.markdown-section h1 {
- margin: 0 0 1em;
- font-size: 2em;
- font-weight: 500;
-}
-
-.markdown-section h2 {
- padding: 1rem 0 0 0;
- margin: 0 0 1rem 0;
- font-size: 1.8em;
- font-weight: 400;
-}
-
-.markdown-section h3 {
- margin: 52px 0 1.2em;
- font-size: 1.5em;
-}
-
-
-.markdown-section h4 {
- font-size: 1.25em;
-}
-
-.markdown-section h5 {
- font-size: 1em;
-}
-
-.markdown-section h6 {
- font-size: 1em;
- color: #777;
-}
-
-.markdown-section figure,
-.markdown-section p,
-.markdown-section ul,
-.markdown-section ol {
- margin: 1.2em 0;
-}
-
-.markdown-section p,
-.markdown-section ul,
-.markdown-section ol {
- margin: 0 0 1em 0;
- line-height: 1.5;
-}
-
-.markdown-section ul,
-.markdown-section ol {
- padding-left: 1.5em;
-}
-
-.markdown-section li {
- margin: 0;
- line-height: 1.5;
-}
-
-.markdown-section blockquote {
- color: #858585;
- border-left: 4px solid #0074D9;
- 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 {
- background-color: #f9f9f9;
- padding: 0.2em 0.4em;
- border-radius: 3px;
- white-space: pre;
- font-family: Inconsolata;
-}
-
-.markdown-section pre {
- background-color: #f9f9f9;
- border-left: 2px solid #eee;
- padding: 8px;
- margin: 0 0 1em 0;
- font-family: Inconsolata;
- padding: 12px 10px 12px 12px;
- font-size: 16px;
-}
-
-/* code highlight */
-.token.comment,
-.token.prolog,
-.token.doctype,
-.token.cdata {
- color: #93a1a1; /* base1 */
-}
-
-.token.punctuation {
- color: #586e75; /* base01 */
-}
-
-.namespace {
- opacity: .7;
-}
-
-.token.property,
-.token.tag,
-.token.boolean,
-.token.number,
-.token.constant,
-.token.symbol,
-.token.deleted {
- color: #268bd2; /* blue */
-}
-
-.token.selector,
-.token.attr-name,
-.token.string,
-.token.char,
-.token.builtin,
-.token.url,
-.token.inserted {
- color: #2aa198; /* cyan */
-}
-
-.token.entity {
- color: #657b83; /* base00 */
- background: #eee8d5; /* base2 */
-}
-
-.token.atrule,
-.token.attr-value,
-.token.keyword {
- color: #a11; /* green */
-}
-
-.token.function {
- color: #b58900; /* yellow */
-}
-
-.token.regex,
-.token.important,
-.token.variable {
- color: #cb4b16; /* orange */
-}
-
-.token.important,
-.token.bold {
- font-weight: bold;
-}
-.token.italic {
- font-style: italic;
-}
-
-.token.entity {
- cursor: help;
-}
-
-.markdown-section pre>code {
- display: block;
- font-family: Inconsolata;
- line-height: 1.2em;
- padding: 0;
-}
-
-.markdown-section code::after, .markdown-section code::before {
- letter-spacing: 0.05em;
-}
-
-code .token {
- min-height: 1.5em;
- -webkit-font-smoothing: initial;
- -moz-osx-font-smoothing: initial;
-}
-
-pre code {
- overflow-x: auto;
- position: relative;
- padding: 0;
- background-color: #f8f8f8;
- padding: 0.8em 0.8em 0.4em;
- line-height: 1.1em;
- border-radius: 2px;
-}
-
-.content img {
- max-width: 100%;
-}
-
-.content span.light {
- color: #7f8c8d;
-}
-
-.content span.info {
- display: inline-block;
- font-size: 0.85em;
- margin-left: 20px;
- vertical-align: middle;
- width: 280px;
-}
diff --git a/themes/pure.css b/themes/pure.css
deleted file mode 100644
index a2aa812..0000000
--- a/themes/pure.css
+++ /dev/null
@@ -1,152 +0,0 @@
-* {
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- -webkit-overflow-scrolling: touch;
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
- -webkit-text-size-adjust: none;
- -webkit-touch-callout: none;
- -webkit-font-smoothing: antialiased;
-}
-
-/* navbar */
-nav {
- position: absolute;
- right: 0;
- left: 0;
- z-index: 10;
- margin: 25px 60px 0 0;
- text-align: right;
-}
-
-nav a {
- margin: 0 1em;
- padding: 5px 0;
- font-size: 16px;
- text-decoration: none;
- color: inherit;
- transition: color .3s;
-}
-
-/* github corner */
-.github-corner {
- position: absolute;
- top: 0;
- right: 0;
- z-index: 10;
-}
-
-.github-corner svg {
- color: #fff;
- height: 80px;
- width: 80px;
-}
-
-.github-corner:hover .octo-arm {
- animation:octocat-wave 560ms ease-in-out;
-}
-
-@keyframes octocat-wave {
- 0%,100%{ transform: rotate(0); }
- 20%,60%{ transform: rotate(-25deg); }
- 40%,80%{ transform: rotate(10deg); }
-}
-
-@media (max-width: 500px) {
- .github-corner:hover .octo-arm {
- animation: none;
- }
- .github-corner .octo-arm {
- animation: octocat-wave 560ms ease-in-out;
- }
-}
-
-html, body {
- height: 100%;
-}
-
-body {
- -moz-osx-font-smoothing: grayscale;
- -webkit-font-smoothing: antialiased;
- font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
- font-size: 15px;
- letter-spacing: 0;
- margin: 0;
-}
-
-/* main */
-main {
- height: 100%;
- position: relative;
- width: 100%;
-}
-
-/* sidebar */
-.sidebar {
- border-right: 1px solid rgba(0,0,0,.07);
- bottom: 0;
- overflow-y: auto;
- position: absolute;
- top: 0;
- width: 300px;
- z-index: 1;
- padding-top: 40px;
-}
-
-.sidebar ul {
- margin: 0;
- padding: 0;
-}
-
-.sidebar ul, .sidebar ul li {
- list-style: none;
-}
-
-.sidebar ul li a {
- display: block;
- border-bottom: none;
-}
-
-.sidebar ul li ul {
- padding-left: 20px;
-}
-
-/* main content */
-.content {
- bottom: 0;
- left: 300px;
- overflow-y: auto;
- position: absolute;
- right: 0;
- top: 0;
- overflow-x: hidden;
- padding-top: 20px;
-}
-
-@media screen and (max-width: 600px) {
- .sidebar {
- left: -300px;
- }
-
- .content {
- left: 0;
- }
-}
-
-/* markdown content found on pages */
-.markdown-section {
- position: relative;
- margin: 0 auto;
- max-width: 800px;
- padding: 20px 15px 40px 15px;
-}
-
-.markdown-section * {
- box-sizing: border-box;
- -webkit-box-sizing: border-box;
- font-size: inherit;
-}
-
-.markdown-section>:first-child {
- margin-top: 0!important;
-}
diff --git a/themes/vue.css b/themes/vue.css
deleted file mode 100644
index ec8fa1a..0000000
--- a/themes/vue.css
+++ /dev/null
@@ -1,452 +0,0 @@
-@import url('https://fonts.googleapis.com/css?family=Roboto+Mono|Source+Sans+Pro:300,400,600');
-
-* {
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- -webkit-overflow-scrolling: touch;
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
- -webkit-text-size-adjust: none;
- -webkit-touch-callout: none;
- -webkit-font-smoothing: antialiased;
-}
-
-/* navbar */
-nav {
- position: absolute;
- right: 0;
- left: 0;
- z-index: 10;
- margin: 25px 60px 0 0;
- text-align: right;
-}
-
-nav a {
- margin: 0 1em;
- padding: 5px 0;
- font-size: 16px;
- text-decoration: none;
- color: inherit;
- transition: color .3s;
-}
-
-nav a:hover {
- color: #42b983;
-}
-
-nav a.active {
- color: #42b983;
- border-bottom: 2px solid #42b983;
-}
-
-/* github corner */
-.github-corner {
- position: absolute;
- top: 0;
- right: 0;
- z-index: 10;
-}
-
-.github-corner svg {
- color: #fff;
- fill: #42b983;
- height: 80px;
- width: 80px;
-}
-
-.github-corner:hover .octo-arm {
- animation:octocat-wave 560ms ease-in-out;
-}
-
-@keyframes octocat-wave {
- 0%,100%{ transform: rotate(0); }
- 20%,60%{ transform: rotate(-25deg); }
- 40%,80%{ transform: rotate(10deg); }
-}
-
-@media (max-width: 500px) {
- .github-corner:hover .octo-arm {
- animation: none;
- }
- .github-corner .octo-arm {
- animation: octocat-wave 560ms ease-in-out;
- }
-}
-
-html, body {
- height: 100%;
-}
-
-body {
- -moz-osx-font-smoothing: grayscale;
- -webkit-font-smoothing: antialiased;
- background-color: #fff;
- color: #34495e;
- font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
- font-size: 15px;
- letter-spacing: 0;
- margin: 0;
-}
-
-/* main */
-main {
- height: 100%;
- position: relative;
- width: 100%;
-}
-
-/* sidebar */
-.sidebar {
- background-color: #fff;
- border-right: 1px solid rgba(0,0,0,.07);
- bottom: 0;
- color: #364149;
- overflow-y: auto;
- position: absolute;
- top: 0;
- width: 300px;
- z-index: 1;
- padding-top: 40px;
-}
-
-.sidebar ul {
- margin: 0;
- padding: 0;
-}
-
-.sidebar ul, .sidebar ul li {
- list-style: none;
-}
-
-.sidebar ul li a {
- color: #7f8c8d;
- display: block;
- padding: 6px 15px;
- border-bottom: none;
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- text-decoration: none;
-}
-
-.sidebar ul li a:hover {
- text-decoration: underline;
-}
-
-.sidebar ul li.active>a {
- color: #42b983;
- font-weight: 500;
-}
-
-.sidebar ul li ul {
- padding-left: 20px;
-}
-
-/* main content */
-.content {
- bottom: 0;
- left: 300px;
- overflow-y: auto;
- position: absolute;
- right: 0;
- top: 0;
- overflow-x: hidden;
- padding-top: 20px;
-}
-
-@media screen and (max-width: 600px) {
- .sidebar {
- left: -300px;
- }
-
- .content {
- left: 0;
- }
-}
-
-/* markdown content found on pages */
-.markdown-section {
- position: relative;
- margin: 0 auto;
- max-width: 800px;
- padding: 20px 15px 40px 15px;
-}
-
-.markdown-section * {
- box-sizing: border-box;
- -webkit-box-sizing: border-box;
- font-size: inherit;
-}
-
-.markdown-section>:first-child {
- margin-top: 0!important;
-}
-
-.markdown-section h1,
-.markdown-section h2,
-.markdown-section h3,
-.markdown-section h4,
-.markdown-section strong {
- font-weight: 600;
- color: #2c3e50;
-}
-
-.markdown-section a {
- color: #42b983;
- font-weight: 600;
-}
-
-.markdown-section p,
-.markdown-section ul,
-.markdown-section ol {
- word-spacing: 0.05em;
-}
-
-.markdown-section h1 {
- margin: 0 0 1em;
- font-size: 2em;
-}
-
-.markdown-section h2 {
- font-size: 1.75em;
- margin: 45px 0 0.8em;
-}
-
-.markdown-section h3 {
- margin: 52px 0 1.2em;
- font-size: 1.5em;
-}
-
-
-.markdown-section h4 {
- font-size: 1.25em;
-}
-
-.markdown-section h5 {
- font-size: 1em;
-}
-
-.markdown-section h6 {
- font-size: 1em;
- color: #777;
-}
-
-.markdown-section figure,
-.markdown-section p,
-.markdown-section ul,
-.markdown-section ol {
- margin: 1.2em 0;
-}
-
-.markdown-section p,
-.markdown-section ul,
-.markdown-section ol {
- line-height: 1.6em;
-}
-
-.markdown-section ul,
-.markdown-section ol {
- padding-left: 1.5em;
-}
-
-.markdown-section blockquote {
- color: #858585;
- border-left: 4px solid #42b983;
- 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;
- margin: 0 2px;
- padding: 3px 5px;
- white-space: nowrap;
- font-size: 0.8em;
- font-family: 'Roboto Mono', Monaco, courier, monospace;
- background-color: #f8f8f8;
-}
-
-.markdown-section pre {
- -moz-osx-font-smoothing: initial;
- -webkit-font-smoothing: initial;
- background-color: #f8f8f8;
- font-family: 'Roboto Mono', Monaco, courier, monospace;
- line-height: 1.5em;
- margin: 1.2em 0;
- padding: 1.2em 1.4em;
- position: relative;
-}
-
-/* code highlight */
-.token.comment,
-.token.prolog,
-.token.doctype,
-.token.cdata {
- 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: #42b983;
-}
-
-.token.selector {
- color: #6679cc;
-}
-
-.token.attr-name {
- color: #2973b7;
-}
-
-.token.entity,
-.token.url,
-.language-css .token.string,
-.style .token.string {
- color: #22a2c9;
-}
-
-.token.attr-value,
-.token.control,
-.token.directive,
-.token.unit {
- color: #42b983;
-}
-
-.token.keyword {
- color: #e96900;
-}
-
-.token.statement,
-.token.regex,
-.token.atrule {
- 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.important,
-.token.bold {
- font-weight: bold;
-}
-
-.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: 0.8em;
- line-height: inherit;
- margin: 0 2px;
- padding: 3px 5px;
- white-space: inherit;
-}
-
-.markdown-section code::after, .markdown-section code::before {
- letter-spacing: 0.05em;
-}
-
-code .token {
- min-height: 1.5em;
- -webkit-font-smoothing: initial;
- -moz-osx-font-smoothing: initial;
-}
-
-pre code {
- overflow-x: auto;
- padding: 0;
- background-color: #f8f8f8;
- padding: 0.8em 0.8em 0.4em;
- line-height: 1.1em;
- border-radius: 2px;
-}
-
-pre::after {
- color: #ccc;
- content: attr(data-lang);
- font-size: 0.75em;
- font-weight: 600;
- height: 15px;
- line-height: 15px;
- padding: 5px 10px 0;
- position: absolute;
- right: 0;
- text-align: right;
- top: 0;
-}
-
-.content img {
- max-width: 100%;
-}
-
-.content span.light {
- color: #7f8c8d;
-}
-
-.content span.info {
- display: inline-block;
- font-size: 0.85em;
- margin-left: 20px;
- vertical-align: middle;
- width: 280px;
-}