Compare commits

...
7 Commits
Author SHA1 Message Date
qingwei.li 7c05d729b4 -> v0.4.1 2016-11-28 12:24:14 +08:00
qingwei.li 5953ef7739 bump 0.4.1 2016-11-28 12:23:43 +08:00
qingwei.li d556282471 add docsify.js.org
fix cdn
2016-11-28 12:22:47 +08:00
qingwei.li ec58149aad add catch ajax error 2016-11-28 12:17:57 +08:00
qingwei.li e15c53a6b8 fix site
remove cname

remove cdn

remove cdn
2016-11-28 12:14:24 +08:00
qingwei.li f450b118ee use docsify.js.org 2016-11-28 11:27:28 +08:00
qingwei.li 6ac7d4f66f Add changelog 2016-11-27 19:06:14 +08:00
7 changed files with 47 additions and 7 deletions
+33
View File
@@ -0,0 +1,33 @@
## 0.4.1
## Bug fixes
- catch ajax error
## 0.4.0
### Features
- Custom sidebar
### Bug fixes
- Fix undefined language
## 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
## 0.2.0
### Bug fixes
- Fix route
- Remove dynamic title
## 0.1.0
### Features
- Add buble.css
+1
View File
@@ -0,0 +1 @@
docsify.js.org
+6 -3
View File
@@ -13,7 +13,8 @@ var ajax = function (url, options) {
xhr.send();
return {
then: function (cb) { return xhr.addEventListener('load', cb); }
then: function (cb) { return xhr.addEventListener('load', cb); },
catch: function (cb) { return xhr.addEventListener('error', cb); }
}
};
@@ -2293,7 +2294,8 @@ var Docsify = function Docsify (opts) {
Docsify.prototype.load = function load () {
var this$1 = this;
ajax(((this.loc) + ".md")).then(function (res) {
ajax(((this.loc) + ".md"))
.then(function (res) {
var target = res.target;
if (target.status >= 400) {
this$1.render('not found');
@@ -2304,7 +2306,8 @@ Docsify.prototype.load = function load () {
this$1.activeNav(document.querySelector('aside.sidebar'), true);
}
}
});
})
.catch(function (_) { return this$1.render('not found'); });
};
Docsify.prototype.render = function render$1 (content) {
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "docsify",
"version": "0.4.0",
"version": "0.4.1",
"description": "A magical documentation generator.",
"main": "lib/docsify.js",
"files": [
+2 -1
View File
@@ -5,6 +5,7 @@ export default function (url, options = {}) {
xhr.send()
return {
then: cb => xhr.addEventListener('load', cb)
then: cb => xhr.addEventListener('load', cb),
catch: cb => xhr.addEventListener('error', cb)
}
}
+3 -1
View File
@@ -40,7 +40,8 @@ class Docsify {
}
load () {
ajax(`${this.loc}.md`).then(res => {
ajax(`${this.loc}.md`)
.then(res => {
const target = res.target
if (target.status >= 400) {
this.render('not found')
@@ -52,6 +53,7 @@ class Docsify {
}
}
})
.catch(_ => this.render('not found'))
}
render (content) {