Compare commits

..
19 Commits
Author SHA1 Message Date
qingwei.li 642e7da7ee [release] 4.1.10 2017-06-02 17:57:56 +08:00
qingwei.li 75381cf046 [build] 4.1.10 2017-06-02 17:57:56 +08:00
qingwei.li 7e2e5a7c90 add changelog 2017-06-02 17:57:32 +08:00
qingwei.li 6d48ce1266 fix(hash): hash routing crashes when url has querystring 2017-06-02 17:56:38 +08:00
qingwei.li d286963da0 update readme 2017-06-02 17:41:13 +08:00
qingwei.li 8a4cedd962 replaced unpkg cdn with jsdelivr 2017-06-01 21:25:08 +08:00
Wei Wangandcinwell.li a3b7b66a76 Fix broken footer (#178) 2017-06-01 13:32:39 +08:00
qingwei.li 5a0d4b7897 docs(cdn): update jsdelivr cdn 2017-06-01 10:29:12 +08:00
Michelle Brierandcinwell.li fcfdb17b8d Add license scan badge (#176) 2017-06-01 07:44:19 +08:00
Michelle Brierandcinwell.li e4d2e7ec12 Add license report
Large report badge
2017-06-01 07:43:59 +08:00
qingwei.li ece00e6b3a [release] 4.1.9 2017-05-31 22:32:57 +08:00
qingwei.li 841829427b [build] 4.1.9 2017-05-31 22:32:30 +08:00
qingwei.li 56c7b9ae2d add changelog 2017-05-31 22:20:46 +08:00
qingwei.li db8400a6ac docs: add feature 2017-05-31 22:19:43 +08:00
qingwei.li 955d3d5988 fix(lifecycle): continue to handle data 2017-05-31 21:20:09 +08:00
qingwei.li d9b487e67b fix: can't render toc on first load 2017-05-31 20:42:29 +08:00
qingwei.li 91b66a5cac fix(render): broken name link, fixed #167 2017-05-31 20:35:59 +08:00
qingwei.li 90bba60367 add package-lock.json 2017-05-31 14:22:43 +08:00
qingwei.li d05c4f65a8 add lerna 2017-05-31 10:01:15 +08:00
26 changed files with 6117 additions and 78 deletions
+10
View File
@@ -1,5 +1,15 @@
# Changelog
4.1.10 / 2017-06-02
* fix(hash): hash routing crashes when url has querystring
4.1.9 / 2017-05-31
* fix(lifecycle): continue to handle data
* fix: can't render toc on first load, fixed #171
* fix(render): broken name link, fixed #167
## 4.1.8(since 4.1.1) / 2017-05-31
* fix(pure-css):add coverpage style, fixed #165
+6 -3
View File
@@ -12,6 +12,7 @@
<a href="https://travis-ci.org/QingWei-Li/docsify"><img alt="Travis Status" src="https://img.shields.io/travis/QingWei-Li/docsify/master.svg?style=flat-square"></a>
<a href="https://www.npmjs.com/package/docsify"><img alt="npm" src="https://img.shields.io/npm/v/docsify.svg?style=flat-square"></a>
<a href="https://github.com/QingWei-Li/donate"><img alt="donate" src="https://img.shields.io/badge/%24-donate-ff69b4.svg?style=flat-square"></a>
<a href="https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FQingWei-Li%2Fdocsify?ref=badge_shield" alt="FOSSA Status"><img src="https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FQingWei-Li%2Fdocsify.svg?type=shield"/></a>
</p>
## Links
@@ -40,12 +41,12 @@ Create an `index.html`.
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css">
</head>
<body>
<div id="app"></div>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
</body>
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
</html>
```
@@ -55,7 +56,7 @@ Modern browsers and Internet Explorer 10+.
## Showcase
These open-source projects are using docsify to generate their sites. Pull requests welcome :blush:
These projects are using docsify to generate their sites. Pull requests welcome :blush:
| Project | Description |
|---|---|
@@ -95,3 +96,5 @@ open http://localhost:3000
## License
MIT
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FQingWei-Li%2Fdocsify.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2FQingWei-Li%2Fdocsify?ref=badge_large)
+1
View File
@@ -17,6 +17,7 @@ See the [Quick start](quickstart.md) for more details.
* Useful plugin API
* Emoji support
* Compatible with IE10+
- Support SSR ([example](https://github.com/QingWei-Li/docsify-ssr-demo))
## Examples
+1 -1
View File
@@ -1,6 +1,6 @@
![logo](_media/icon.svg)
# docsify <small>4.1.8</small>
# docsify <small>4.1.10</small>
> A magical documentation site generator.
+1 -1
View File
@@ -45,6 +45,6 @@ Alternatively, use [compressed files](#compressed-files).
## Other CDN
- http://www.bootcdn.cn/docsify
- http://www.jsdelivr.com/projects/docsify
- https://cdn.jsdelivr.net/npm/docsify/
- https://cdnjs.com/libraries/docsify
+1
View File
@@ -17,6 +17,7 @@ Siehe [Schnellstart](de-de/quickstart.md) für weitere Informationen.
* praktische API für Erweiterungen
* Unterstützung für Emoji
* Kompatibel mit IE10+
- Support SSR ([example](https://github.com/QingWei-Li/docsify-ssr-demo))
## Beispiele
+1 -1
View File
@@ -45,5 +45,5 @@ Alternativ kannst du auch die [komprimierten Dateien](#komprimierte-dateien) ver
## Andere CDN
- http://www.bootcdn.cn/docsify
- http://www.jsdelivr.com/projects/docsify
- https://cdn.jsdelivr.net/npm/docsify/
- https://cdnjs.com/libraries/docsify
+9 -9
View File
@@ -7,10 +7,10 @@
<meta name="keywords" content="doc,docs,documentation,gitbook,creator,generator,github,jekyll,github-pages">
<meta name="description" content="A magical documentation generator.">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css" title="vue">
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/dark.css" title="dark" disabled>
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/buble.css" title="buble" disabled>
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/pure.css" title="pure" disabled>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css" title="vue">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/dark.css" title="dark" disabled>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/buble.css" title="buble" disabled>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/pure.css" title="pure" disabled>
<style>
nav.app-nav li ul {
min-width: 100px;
@@ -66,9 +66,9 @@
]
}
</script>
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-markdown.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/docsify.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-bash.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-markdown.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-nginx.min.js"></script>
</html>
+1
View File
@@ -18,6 +18,7 @@ docsify 是一个动态生成文档网站的工具。不同于 GitBook、Hexo
- 丰富的 API
- 支持 Emoji
- 兼容 IE10+
- 支持 SSR ([example](https://github.com/QingWei-Li/docsify-ssr-demo))
## 例子
+2 -2
View File
@@ -44,6 +44,6 @@ JS 的压缩文件是原有文件路径的基础上加 `.min`后缀
## 其他 CDN
- http://www.bootcdn.cn/docsify
- http://www.jsdelivr.com/projects/docsify
- http://www.bootcdn.cn/docsify (支持国内)
- https://cdn.jsdelivr.net/npm/docsify/ (国内外都支持)
- https://cdnjs.com/libraries/docsify
+1 -1
View File
@@ -8,4 +8,4 @@
<script src="//unpkg.com/prismjs/components/prism-php.js"></script>
```
?> 其他的语言高亮插件可以查看[Prims 仓库](https://github.com/PrismJS/prism/tree/gh-pages/components)。
?> 其他的语言高亮插件可以查看[Prims 仓库](https://github.com/PrismJS/prism/tree/gh-pages/components)。
+7
View File
@@ -0,0 +1,7 @@
{
"lerna": "2.0.0-rc.5",
"packages": [
"packages/*"
],
"version": "0.0.0"
}
+12 -13
View File
@@ -126,23 +126,22 @@ function initLifecycle (vm) {
function callHook (vm, hook, data, next) {
if ( next === void 0 ) next = noop;
var newData = data;
var queue = vm._hooks[hook];
var step = function (index) {
var hook = queue[index];
if (index >= queue.length) {
next(newData);
next(data);
} else {
if (typeof hook === 'function') {
if (hook.length === 2) {
hook(data, function (result) {
newData = result;
data = result;
step(index + 1);
});
} else {
var result = hook(data);
newData = result !== undefined ? result : newData;
data = result !== undefined ? result : data;
step(index + 1);
}
} else {
@@ -2797,8 +2796,8 @@ Compiler.prototype._initRenderer = function _initRenderer () {
var ref = this;
var linkTarget = ref.linkTarget;
var router = ref.router;
var toc = ref.toc;
var contentBase = ref.contentBase;
var _self = this;
/**
* render anchor tag
* @link https://github.com/chjj/marked#overriding-renderer-methods
@@ -2821,7 +2820,7 @@ Compiler.prototype._initRenderer = function _initRenderer () {
var slug = slugify(text);
var url = router.toURL(router.getCurrentPath(), { id: slug });
nextToc.slug = url;
toc.push(nextToc);
_self.toc.push(nextToc);
return ("<h" + level + " id=\"" + slug + "\"><a href=\"" + url + "\" data-id=\"" + slug + "\" class=\"anchor\"><span>" + text + "</span></a></h" + level + ">")
};
@@ -3288,6 +3287,7 @@ function initRender (vm) {
// Polyfll
cssVars(config.themeColor);
}
vm._updateRender();
toggleClass(body, 'ready');
}
@@ -3403,17 +3403,17 @@ var HashHistory = (function (History$$1) {
var query = '';
var hashIndex = path.indexOf('#');
if (hashIndex) {
path = path.slice(hashIndex + 1);
}
var queryIndex = path.indexOf('?');
if (queryIndex >= 0) {
query = path.slice(queryIndex + 1);
path = path.slice(0, queryIndex);
}
var hashIndex = path.indexOf('#');
if (hashIndex) {
path = path.slice(hashIndex + 1);
}
return {
path: path,
file: this.getFile(path),
@@ -3544,7 +3544,6 @@ function initRouter (vm) {
router.normalize();
lastRoute = vm.route = router.parse();
vm._updateRender();
router.onchange(function (_) {
router.normalize();
@@ -3744,7 +3743,7 @@ initGlobalAPI();
/**
* Version
*/
Docsify.version = '4.1.8';
Docsify.version = '4.1.10';
/**
* Run Docsify
+2 -2
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -498,6 +498,6 @@ var install = function (hook, vm) {
});
};
window.$docsify.plugins = [].concat(install, window.$docsify.plugins);
$docsify.plugins = [].concat(install, $docsify.plugins);
}());
+1 -1
View File
File diff suppressed because one or more lines are too long
+4933
View File
File diff suppressed because it is too large Load Diff
+3 -1
View File
@@ -1,6 +1,6 @@
{
"name": "docsify",
"version": "4.1.8",
"version": "4.1.10",
"description": "A magical documentation generator.",
"author": {
"name": "qingwei-li",
@@ -20,6 +20,7 @@
"themes"
],
"scripts": {
"bootstrap": "npm i && lerna bootstrap",
"build": "rm -rf lib themes && node build/build && mkdir lib/themes && mkdir themes && node build/build-css && npm run build:ssr && node build/build-cover",
"dev:build": "rm -rf lib themes && mkdir themes && node build/build --dev && node build/build-css --dev",
"dev": "node app & nodemon -w src -e js,css --exec 'npm run dev:build'",
@@ -39,6 +40,7 @@
"eslint": "^3.18.0",
"eslint-config-vue": "^2.0.2",
"eslint-plugin-vue": "^2.0.1",
"lerna": "^2.0.0-rc.5",
"nodemon": "^1.11.0",
"postcss": "^5.2.16",
"postcss-salad": "^1.0.8",
@@ -1,6 +1,6 @@
{
"name": "docsify-server-renderer",
"version": "4.1.8",
"version": "4.1.10",
"description": "docsify server renderer",
"author": {
"name": "qingwei-li",
+3 -4
View File
@@ -19,23 +19,22 @@ export function initLifecycle (vm) {
}
export function callHook (vm, hook, data, next = noop) {
let newData = data
const queue = vm._hooks[hook]
const step = function (index) {
const hook = queue[index]
if (index >= queue.length) {
next(newData)
next(data)
} else {
if (typeof hook === 'function') {
if (hook.length === 2) {
hook(data, result => {
newData = result
data = result
step(index + 1)
})
} else {
const result = hook(data)
newData = result !== undefined ? result : newData
data = result !== undefined ? result : data
step(index + 1)
}
} else {
+3 -2
View File
@@ -44,7 +44,8 @@ export class Compiler {
_initRenderer () {
const renderer = new marked.Renderer()
const { linkTarget, router, toc, contentBase } = this
const { linkTarget, router, contentBase } = this
const _self = this
/**
* render anchor tag
* @link https://github.com/chjj/marked#overriding-renderer-methods
@@ -67,7 +68,7 @@ export class Compiler {
const slug = slugify(text)
const url = router.toURL(router.getCurrentPath(), { id: slug })
nextToc.slug = url
toc.push(nextToc)
_self.toc.push(nextToc)
return `<h${level} id="${slug}"><a href="${url}" data-id="${slug}" class="anchor"><span>${text}</span></a></h${level}>`
}
+1
View File
@@ -208,5 +208,6 @@ export function initRender (vm) {
// Polyfll
cssVars(config.themeColor)
}
vm._updateRender()
dom.toggleClass(dom.body, 'ready')
}
+5 -5
View File
@@ -58,17 +58,17 @@ export class HashHistory extends History {
parse (path = location.href) {
let query = ''
const hashIndex = path.indexOf('#')
if (hashIndex) {
path = path.slice(hashIndex + 1)
}
const queryIndex = path.indexOf('?')
if (queryIndex >= 0) {
query = path.slice(queryIndex + 1)
path = path.slice(0, queryIndex)
}
const hashIndex = path.indexOf('#')
if (hashIndex) {
path = path.slice(hashIndex + 1)
}
return {
path,
file: this.getFile(path),
-1
View File
@@ -23,7 +23,6 @@ export function initRouter (vm) {
router.normalize()
lastRoute = vm.route = router.parse()
vm._updateRender()
router.onchange(_ => {
router.normalize()
+1 -1
View File
@@ -10,4 +10,4 @@ const install = function (hook, vm) {
})
}
window.$docsify.plugins = [].concat(install, window.$docsify.plugins)
$docsify.plugins = [].concat(install, $docsify.plugins)
+1110 -28
View File
File diff suppressed because it is too large Load Diff