mirror of
https://github.com/wahyd4/docsify.git
synced 2026-08-09 13:26:34 +10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
800c0c503a | ||
|
|
d5194b4f6b | ||
|
|
fa772cfa94 | ||
|
|
cc98f56cdd | ||
|
|
752f68e5f8 | ||
|
|
bde17e1f10 | ||
|
|
2db197f6dc | ||
|
|
e8b5b09f2c | ||
|
|
36bfc9d91d | ||
|
|
4ad96f3d12 | ||
|
|
1f04912a8f | ||
|
|
65f17b4753 | ||
|
|
b3419f3842 | ||
|
|
0bb7e18018 | ||
|
|
86583e19ab | ||
|
|
0bef31951c | ||
|
|
a2b8eae8c4 |
@@ -1,3 +1,39 @@
|
||||
<a name="4.4.1"></a>
|
||||
## [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))
|
||||
|
||||
|
||||
|
||||
<a name="4.4.0"></a>
|
||||
# [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))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.15"></a>
|
||||
## [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))
|
||||
|
||||
|
||||
|
||||
<a name="4.3.14"></a>
|
||||
## [4.3.14](https://github.com/QingWei-Li/docsify/compare/v4.3.13...v4.3.14) (2017-10-20)
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ Create an `index.html`.
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css">
|
||||
</head>
|
||||
@@ -83,6 +84,8 @@ These projects are using docsify to generate their sites. Pull requests welcome
|
||||
| [xTeko](https://docs.xteko.com/) | Addins framework for Pin 3.0 |
|
||||
| [vue2-datatable-component](https://github.com/OneWayTech/vue2-datatable) | The best Datatable for Vue.js 2.x which never sucks |
|
||||
| [Solidarity](https://infinitered.github.io/solidarity/) | Environment enforcer for your projects across machines. |
|
||||
| [rnback](https://rnback.com/) | Backend service for react-native applications. |
|
||||
| [IT-films](https://greybax.github.com/IT-films/) | A curated list of awesome movies, documentaries and TV series about hackers, geeks and IT in common, sorted by IMDB rating. |
|
||||
|
||||
## Similar projects
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<title>docsify</title>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<link rel="stylesheet" href="/themes/vue.css" title="vue">
|
||||
<link rel="stylesheet" href="/themes/dark.css" title="dark" disabled>
|
||||
<link rel="stylesheet" href="/themes/buble.css" title="buble" disabled>
|
||||
@@ -16,38 +16,38 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script>
|
||||
window.$docsify = {
|
||||
alias: {
|
||||
'.*?/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG',
|
||||
'/.*/_navbar.md': '/_navbar.md'
|
||||
},
|
||||
auto2top: true,
|
||||
basePath: '/docs/',
|
||||
executeScript: true,
|
||||
loadNavbar: true,
|
||||
loadSidebar: true,
|
||||
coverpage: true,
|
||||
name: 'docsify',
|
||||
subMaxLevel: 2,
|
||||
mergeNavbar: true,
|
||||
formatUpdated: '{MM}/{DD} {HH}:{mm}',
|
||||
plugins: [
|
||||
function(hook, vm) {
|
||||
hook.beforeEach(function (html) {
|
||||
var url = 'https://github.com/QingWei-Li/docsify/blob/master/' + vm.route.file
|
||||
var editHtml = '[:memo: Edit Document](' + url + ')\n'
|
||||
|
||||
return editHtml
|
||||
+ html
|
||||
+ '\n----\n'
|
||||
+ 'Last modified {docsify-updated} '
|
||||
+ editHtml
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
</script>
|
||||
<script src="/lib/docsify.js"></script>
|
||||
</body>
|
||||
<script>
|
||||
window.$docsify = {
|
||||
alias: {
|
||||
'.*?/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG',
|
||||
'/.*/_navbar.md': '/_navbar.md'
|
||||
},
|
||||
auto2top: true,
|
||||
basePath: '/docs/',
|
||||
executeScript: true,
|
||||
loadNavbar: true,
|
||||
loadSidebar: true,
|
||||
coverpage: true,
|
||||
name: 'docsify',
|
||||
subMaxLevel: 2,
|
||||
mergeNavbar: true,
|
||||
formatUpdated: '{MM}/{DD} {HH}:{mm}',
|
||||
plugins: [
|
||||
function(hook, vm) {
|
||||
hook.beforeEach(function (html) {
|
||||
var url = 'https://github.com/QingWei-Li/docsify/blob/master/' + vm.route.file
|
||||
var editHtml = '[:memo: Edit Document](' + url + ')\n'
|
||||
|
||||
return editHtml
|
||||
+ html
|
||||
+ '\n----\n'
|
||||
+ 'Last modified {docsify-updated} '
|
||||
+ editHtml
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
</script>
|
||||
<script src="/lib/docsify.js"></script>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||

|
||||
|
||||
# docsify <small>4.3.14</small>
|
||||
# docsify <small>4.4.1</small>
|
||||
|
||||
> A magical documentation site generator.
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ Wenn du `npm` nicht verwenden möchtest, oder Probleme bei der Installation des
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css">
|
||||
</head>
|
||||
|
||||
@@ -57,3 +57,8 @@ You will get `<a href="/demo/">link</a>`html. Do not worry, you can still set ti
|
||||
[link](/demo2 ":target=_self")
|
||||
```
|
||||
|
||||
## Disable link
|
||||
|
||||
```md
|
||||
[link](/demo ":disabled")
|
||||
```
|
||||
|
||||
+54
-54
@@ -20,59 +20,59 @@
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">Loading ...</div>
|
||||
</body>
|
||||
<script>
|
||||
window.$docsify = {
|
||||
alias: {
|
||||
'.*?/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG',
|
||||
'/.*/_navbar.md': '/_navbar.md'
|
||||
},
|
||||
auto2top: true,
|
||||
coverpage: true,
|
||||
executeScript: true,
|
||||
loadSidebar: true,
|
||||
loadNavbar: true,
|
||||
mergeNavbar: true,
|
||||
maxLevel: 4,
|
||||
subMaxLevel: 2,
|
||||
codesponsor: '7c9Ms7xRs-j_y_8abU03DA',
|
||||
ga: 'UA-106147152-1',
|
||||
name: 'docsify',
|
||||
search: {
|
||||
noData: {
|
||||
'/de-de/': 'Keine Ergebnisse!',
|
||||
'/zh-cn/': '没有结果!',
|
||||
'/': 'No results!'
|
||||
<script>
|
||||
window.$docsify = {
|
||||
alias: {
|
||||
'.*?/changelog': 'https://raw.githubusercontent.com/QingWei-Li/docsify/master/CHANGELOG',
|
||||
'/.*/_navbar.md': '/_navbar.md'
|
||||
},
|
||||
paths: 'auto',
|
||||
placeholder: {
|
||||
'/de-de/': 'Suche',
|
||||
'/zh-cn/': '搜索',
|
||||
'/': 'Search'
|
||||
}
|
||||
},
|
||||
formatUpdated: '{MM}/{DD} {HH}:{mm}',
|
||||
plugins: [
|
||||
function(hook, vm) {
|
||||
hook.beforeEach(function (html) {
|
||||
var url = 'https://github.com/QingWei-Li/docsify/blob/master/docs/' + vm.route.file
|
||||
var editHtml = '[:memo: Edit Document](' + url + ')\n'
|
||||
|
||||
return editHtml
|
||||
+ html
|
||||
+ '\n----\n'
|
||||
+ 'Last modified {docsify-updated} '
|
||||
+ editHtml
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
</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/docsify/lib/plugins/codesponsor.min.js"></script>
|
||||
<script src="//unpkg.com/docsify/lib/plugins/ga.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>
|
||||
auto2top: true,
|
||||
coverpage: true,
|
||||
executeScript: true,
|
||||
loadSidebar: true,
|
||||
loadNavbar: true,
|
||||
mergeNavbar: true,
|
||||
maxLevel: 4,
|
||||
subMaxLevel: 2,
|
||||
codesponsor: '7c9Ms7xRs-j_y_8abU03DA',
|
||||
ga: 'UA-106147152-1',
|
||||
name: 'docsify',
|
||||
search: {
|
||||
noData: {
|
||||
'/de-de/': 'Keine Ergebnisse!',
|
||||
'/zh-cn/': '没有结果!',
|
||||
'/': 'No results!'
|
||||
},
|
||||
paths: 'auto',
|
||||
placeholder: {
|
||||
'/de-de/': 'Suche',
|
||||
'/zh-cn/': '搜索',
|
||||
'/': 'Search'
|
||||
}
|
||||
},
|
||||
formatUpdated: '{MM}/{DD} {HH}:{mm}',
|
||||
plugins: [
|
||||
function(hook, vm) {
|
||||
hook.beforeEach(function (html) {
|
||||
var url = 'https://github.com/QingWei-Li/docsify/blob/master/docs/' + vm.route.file
|
||||
var editHtml = '[:memo: Edit Document](' + url + ')\n'
|
||||
|
||||
return editHtml
|
||||
+ html
|
||||
+ '\n----\n'
|
||||
+ 'Last modified {docsify-updated} '
|
||||
+ editHtml
|
||||
})
|
||||
}
|
||||
]
|
||||
}
|
||||
</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/docsify/lib/plugins/codesponsor.min.js"></script>
|
||||
<script src="//unpkg.com/docsify/lib/plugins/ga.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>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -97,6 +97,13 @@ Medium's Image Zoom. Based on [zoom-image](https://github.com/egoist/zoom-image)
|
||||
<script src="//unpkg.com/docsify/lib/plugins/zoom-image.min.js"></script>
|
||||
```
|
||||
|
||||
Exclude the special image
|
||||
|
||||
```markdown
|
||||

|
||||
```
|
||||
|
||||
|
||||
## Edit on github
|
||||
|
||||
Add `Edit on github` button on every pages. provided by 3rd party, check [document](https://github.com/njleonzhang/docsify-edit-on-github)
|
||||
|
||||
@@ -45,6 +45,7 @@ If you don't like `npm` or have trouble installing the tool, you can manually cr
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css">
|
||||
</head>
|
||||
|
||||
+2
-2
@@ -19,7 +19,7 @@ Then you can immediately write Vue code at Markdown file. `new Vue({ el: '#main'
|
||||
|
||||
*README.md*
|
||||
|
||||
```markdown
|
||||
````markdown
|
||||
# Vue guide
|
||||
|
||||
`v-for` usage.
|
||||
@@ -33,7 +33,7 @@ Then you can immediately write Vue code at Markdown file. `new Vue({ el: '#main'
|
||||
<ul>
|
||||
<li v-for="i in 10">{{ i }}</li>
|
||||
</ul>
|
||||
```
|
||||
````
|
||||
|
||||
You can manually initialize a Vue instance.
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ docsify serve docs
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css">
|
||||
</head>
|
||||
|
||||
+76
-30
@@ -2794,6 +2794,22 @@ var cleanPath = cached(function (path) {
|
||||
});
|
||||
|
||||
var cachedLinks = {};
|
||||
function getAndRemoveConfig (str) {
|
||||
if ( str === void 0 ) str = '';
|
||||
|
||||
var config = {};
|
||||
|
||||
if (str) {
|
||||
str = str
|
||||
.replace(/:([\w-]+)=?([\w-]+)?/g, function (m, key, value) {
|
||||
config[key] = value || true;
|
||||
return ''
|
||||
})
|
||||
.trim();
|
||||
}
|
||||
|
||||
return { str: str, config: config }
|
||||
}
|
||||
|
||||
var Compiler = function Compiler (config, router) {
|
||||
this.config = config;
|
||||
@@ -2810,9 +2826,11 @@ var Compiler = function Compiler (config, router) {
|
||||
if (isFn(mdConf)) {
|
||||
compile = mdConf(marked, renderer);
|
||||
} else {
|
||||
marked.setOptions(merge(mdConf, {
|
||||
renderer: merge(renderer, mdConf.renderer)
|
||||
}));
|
||||
marked.setOptions(
|
||||
merge(mdConf, {
|
||||
renderer: merge(renderer, mdConf.renderer)
|
||||
})
|
||||
);
|
||||
compile = marked;
|
||||
}
|
||||
|
||||
@@ -2881,33 +2899,47 @@ Compiler.prototype._initRenderer = function _initRenderer () {
|
||||
origin.code = renderer.code = function (code, lang) {
|
||||
if ( lang === void 0 ) lang = '';
|
||||
|
||||
var hl = prism.highlight(code, prism.languages[lang] || prism.languages.markup);
|
||||
var hl = prism.highlight(
|
||||
code,
|
||||
prism.languages[lang] || prism.languages.markup
|
||||
);
|
||||
|
||||
return ("<pre v-pre data-lang=\"" + lang + "\"><code class=\"lang-" + lang + "\">" + hl + "</code></pre>")
|
||||
};
|
||||
origin.link = renderer.link = function (href, title, text) {
|
||||
var blank = '';
|
||||
if ( title === void 0 ) title = '';
|
||||
|
||||
if (!/:|(\/{2})/.test(href) &&
|
||||
var attrs = '';
|
||||
|
||||
var ref = getAndRemoveConfig(title);
|
||||
var str = ref.str;
|
||||
var config = ref.config;
|
||||
title = str;
|
||||
|
||||
if (
|
||||
!/:|(\/{2})/.test(href) &&
|
||||
!_self.matchNotCompileLink(href) &&
|
||||
!/(\s?:ignore)(\s\S+)?$/.test(title)) {
|
||||
!config.ignore
|
||||
) {
|
||||
href = router.toURL(href, null, router.getCurrentPath());
|
||||
} else {
|
||||
blank = " target=\"" + linkTarget + "\"";
|
||||
title = title && title.replace(/:ignore/g, '').trim();
|
||||
attrs += " target=\"" + linkTarget + "\"";
|
||||
}
|
||||
|
||||
var target = title && title.match(/:target=\w+/);
|
||||
if (target) {
|
||||
target = target[0];
|
||||
title = title.replace(target, '');
|
||||
blank = ' ' + target.slice(1);
|
||||
if (config.target) {
|
||||
attrs += ' target=' + config.target;
|
||||
}
|
||||
|
||||
if (config.disabled) {
|
||||
attrs += ' disabled';
|
||||
href = 'javascript:void(0)';
|
||||
}
|
||||
|
||||
if (title) {
|
||||
title = " title=\"" + title + "\"";
|
||||
attrs += " title=\"" + title + "\"";
|
||||
}
|
||||
return ("<a href=\"" + href + "\"" + (title || '') + blank + ">" + text + "</a>")
|
||||
|
||||
return ("<a href=\"" + href + "\"" + attrs + ">" + text + "</a>")
|
||||
};
|
||||
origin.paragraph = renderer.paragraph = function (text) {
|
||||
if (/^!>/.test(text)) {
|
||||
@@ -2919,13 +2951,26 @@ Compiler.prototype._initRenderer = function _initRenderer () {
|
||||
};
|
||||
origin.image = renderer.image = function (href, title, text) {
|
||||
var url = href;
|
||||
var titleHTML = title ? (" title=\"" + title + "\"") : '';
|
||||
var attrs = '';
|
||||
|
||||
var ref = getAndRemoveConfig(title);
|
||||
var str = ref.str;
|
||||
var config = ref.config;
|
||||
title = str;
|
||||
|
||||
if (config['no-zoom']) {
|
||||
attrs += ' data-no-zoom';
|
||||
}
|
||||
|
||||
if (title) {
|
||||
attrs += " title=\"" + title + "\"";
|
||||
}
|
||||
|
||||
if (!isAbsolutePath(href)) {
|
||||
url = getPath(contentBase, href);
|
||||
}
|
||||
|
||||
return ("<img src=\"" + url + "\" data-origin=\"" + href + "\" alt=\"" + text + "\"" + titleHTML + ">")
|
||||
return ("<img src=\"" + url + "\"data-origin=\"" + href + "\" alt=\"" + text + "\"" + attrs + ">")
|
||||
};
|
||||
|
||||
renderer.origin = origin;
|
||||
@@ -2965,11 +3010,12 @@ Compiler.prototype.subSidebar = function subSidebar (level) {
|
||||
var cacheTree = ref.cacheTree;
|
||||
var toc = ref.toc;
|
||||
|
||||
toc[0] && toc[0].ignoreAllSubs && (this.toc = []);
|
||||
toc[0] && toc[0].ignoreAllSubs && toc.splice(0);
|
||||
toc[0] && toc[0].level === 1 && toc.shift();
|
||||
toc.forEach(function (node, i) {
|
||||
node.ignoreSubHeading && toc.splice(i, 1);
|
||||
});
|
||||
|
||||
for (var i = 0; i < toc.length; i++) {
|
||||
toc[i].ignoreSubHeading && toc.splice(i, 1) && i--;
|
||||
}
|
||||
|
||||
var tree$$1 = cacheTree[currentPath] || genTree(toc, level);
|
||||
|
||||
@@ -3182,7 +3228,7 @@ function scrollTo (el) {
|
||||
.begin();
|
||||
}
|
||||
|
||||
function highlight () {
|
||||
function highlight (path) {
|
||||
if (!enableScrollEvent) { return }
|
||||
var sidebar = getNode('.sidebar');
|
||||
var anchors = findAll('.anchor');
|
||||
@@ -3203,7 +3249,7 @@ function highlight () {
|
||||
}
|
||||
}
|
||||
if (!last) { return }
|
||||
var li = nav[last.getAttribute('data-id')];
|
||||
var li = nav[getNavKey(path, last.getAttribute('data-id'))];
|
||||
|
||||
if (!li || li === active) { return }
|
||||
|
||||
@@ -3246,17 +3292,17 @@ function scrollActiveSidebar (router) {
|
||||
if (href !== '/') {
|
||||
var ref = router.parse(href);
|
||||
var id = ref.query.id;
|
||||
var path = ref.path;
|
||||
if (id) { href = getNavKey(path, id); }
|
||||
var path$1 = ref.path;
|
||||
if (id) { href = getNavKey(path$1, id); }
|
||||
}
|
||||
|
||||
if (href) { nav[decodeURIComponent(href)] = li; }
|
||||
}
|
||||
|
||||
if (isMobile) { return }
|
||||
|
||||
off('scroll', highlight);
|
||||
on('scroll', highlight);
|
||||
var path = router.getCurrentPath();
|
||||
off('scroll', function () { return highlight(path); });
|
||||
on('scroll', function () { return highlight(path); });
|
||||
on(sidebar, 'mouseover', function () {
|
||||
hoverOver = true;
|
||||
});
|
||||
@@ -3990,7 +4036,7 @@ initGlobalAPI();
|
||||
/**
|
||||
* Version
|
||||
*/
|
||||
Docsify.version = '4.3.14';
|
||||
Docsify.version = '4.4.1';
|
||||
|
||||
/**
|
||||
* Run Docsify
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
+11
-288
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Generated
+6
-6
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify",
|
||||
"version": "4.3.14",
|
||||
"version": "4.4.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -4239,6 +4239,11 @@
|
||||
"integrity": "sha1-3oGf282E3M2PrlnGrreWFbnSZqw=",
|
||||
"dev": true
|
||||
},
|
||||
"medium-zoom": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/medium-zoom/-/medium-zoom-0.2.0.tgz",
|
||||
"integrity": "sha512-2595M4GDwjoyZVDtkw6JWY8JxkhZVumqPjvM8coyRcULPZpoij2bQJ1/syqtx4XiflaqTva0cAch1kzqk0ir9Q=="
|
||||
},
|
||||
"mem": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz",
|
||||
@@ -7192,11 +7197,6 @@
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"zoom-image": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/zoom-image/-/zoom-image-0.1.4.tgz",
|
||||
"integrity": "sha1-+q8KgFG7Zya+YM891qM17HPx6Wk="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify",
|
||||
"version": "4.3.14",
|
||||
"version": "4.4.1",
|
||||
"description": "A magical documentation generator.",
|
||||
"author": {
|
||||
"name": "qingwei-li",
|
||||
@@ -31,10 +31,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"marked": "^0.3.6",
|
||||
"medium-zoom": "^0.2.0",
|
||||
"prismjs": "^1.6.0",
|
||||
"tinydate": "^1.0.0",
|
||||
"tweezer.js": "^1.4.0",
|
||||
"zoom-image": "^0.1.4"
|
||||
"tweezer.js": "^1.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"conventional-changelog-cli": "^1.3.2",
|
||||
|
||||
+1
-1
@@ -37,5 +37,5 @@
|
||||
"integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ="
|
||||
}
|
||||
},
|
||||
"version": "4.3.14"
|
||||
"version": "4.4.1"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify-server-renderer",
|
||||
"version": "4.3.14",
|
||||
"version": "4.4.1",
|
||||
"description": "docsify server renderer",
|
||||
"author": {
|
||||
"name": "qingwei-li",
|
||||
|
||||
@@ -24,7 +24,7 @@ function scrollTo (el) {
|
||||
.begin()
|
||||
}
|
||||
|
||||
function highlight () {
|
||||
function highlight (path) {
|
||||
if (!enableScrollEvent) return
|
||||
const sidebar = dom.getNode('.sidebar')
|
||||
const anchors = dom.findAll('.anchor')
|
||||
@@ -45,7 +45,7 @@ function highlight () {
|
||||
}
|
||||
}
|
||||
if (!last) return
|
||||
const li = nav[last.getAttribute('data-id')]
|
||||
const li = nav[getNavKey(path, last.getAttribute('data-id'))]
|
||||
|
||||
if (!li || li === active) return
|
||||
|
||||
@@ -94,9 +94,9 @@ export function scrollActiveSidebar (router) {
|
||||
}
|
||||
|
||||
if (isMobile) return
|
||||
|
||||
dom.off('scroll', highlight)
|
||||
dom.on('scroll', highlight)
|
||||
const path = router.getCurrentPath()
|
||||
dom.off('scroll', () => highlight(path))
|
||||
dom.on('scroll', () => highlight(path))
|
||||
dom.on(sidebar, 'mouseover', () => {
|
||||
hoverOver = true
|
||||
})
|
||||
|
||||
+61
-23
@@ -8,6 +8,20 @@ import { isAbsolutePath, getPath } from '../router/util'
|
||||
import { isFn, merge, cached } from '../util/core'
|
||||
|
||||
const cachedLinks = {}
|
||||
function getAndRemoveConfig (str = '') {
|
||||
const config = {}
|
||||
|
||||
if (str) {
|
||||
str = str
|
||||
.replace(/:([\w-]+)=?([\w-]+)?/g, (m, key, value) => {
|
||||
config[key] = value || true
|
||||
return ''
|
||||
})
|
||||
.trim()
|
||||
}
|
||||
|
||||
return { str, config }
|
||||
}
|
||||
|
||||
export class Compiler {
|
||||
constructor (config, router) {
|
||||
@@ -25,9 +39,11 @@ export class Compiler {
|
||||
if (isFn(mdConf)) {
|
||||
compile = mdConf(marked, renderer)
|
||||
} else {
|
||||
marked.setOptions(merge(mdConf, {
|
||||
renderer: merge(renderer, mdConf.renderer)
|
||||
}))
|
||||
marked.setOptions(
|
||||
merge(mdConf, {
|
||||
renderer: merge(renderer, mdConf.renderer)
|
||||
})
|
||||
)
|
||||
compile = marked
|
||||
}
|
||||
|
||||
@@ -91,33 +107,43 @@ export class Compiler {
|
||||
}
|
||||
// highlight code
|
||||
origin.code = renderer.code = function (code, lang = '') {
|
||||
const hl = Prism.highlight(code, Prism.languages[lang] || Prism.languages.markup)
|
||||
const hl = Prism.highlight(
|
||||
code,
|
||||
Prism.languages[lang] || Prism.languages.markup
|
||||
)
|
||||
|
||||
return `<pre v-pre data-lang="${lang}"><code class="lang-${lang}">${hl}</code></pre>`
|
||||
}
|
||||
origin.link = renderer.link = function (href, title, text) {
|
||||
let blank = ''
|
||||
origin.link = renderer.link = function (href, title = '', text) {
|
||||
let attrs = ''
|
||||
|
||||
if (!/:|(\/{2})/.test(href) &&
|
||||
const { str, config } = getAndRemoveConfig(title)
|
||||
title = str
|
||||
|
||||
if (
|
||||
!/:|(\/{2})/.test(href) &&
|
||||
!_self.matchNotCompileLink(href) &&
|
||||
!/(\s?:ignore)(\s\S+)?$/.test(title)) {
|
||||
!config.ignore
|
||||
) {
|
||||
href = router.toURL(href, null, router.getCurrentPath())
|
||||
} else {
|
||||
blank = ` target="${linkTarget}"`
|
||||
title = title && title.replace(/:ignore/g, '').trim()
|
||||
attrs += ` target="${linkTarget}"`
|
||||
}
|
||||
|
||||
let target = title && title.match(/:target=\w+/)
|
||||
if (target) {
|
||||
target = target[0]
|
||||
title = title.replace(target, '')
|
||||
blank = ' ' + target.slice(1)
|
||||
if (config.target) {
|
||||
attrs += ' target=' + config.target
|
||||
}
|
||||
|
||||
if (config.disabled) {
|
||||
attrs += ' disabled'
|
||||
href = 'javascript:void(0)'
|
||||
}
|
||||
|
||||
if (title) {
|
||||
title = ` title="${title}"`
|
||||
attrs += ` title="${title}"`
|
||||
}
|
||||
return `<a href="${href}"${title || ''}${blank}>${text}</a>`
|
||||
|
||||
return `<a href="${href}"${attrs}>${text}</a>`
|
||||
}
|
||||
origin.paragraph = renderer.paragraph = function (text) {
|
||||
if (/^!>/.test(text)) {
|
||||
@@ -129,13 +155,24 @@ export class Compiler {
|
||||
}
|
||||
origin.image = renderer.image = function (href, title, text) {
|
||||
let url = href
|
||||
const titleHTML = title ? ` title="${title}"` : ''
|
||||
let attrs = ''
|
||||
|
||||
const { str, config } = getAndRemoveConfig(title)
|
||||
title = str
|
||||
|
||||
if (config['no-zoom']) {
|
||||
attrs += ' data-no-zoom'
|
||||
}
|
||||
|
||||
if (title) {
|
||||
attrs += ` title="${title}"`
|
||||
}
|
||||
|
||||
if (!isAbsolutePath(href)) {
|
||||
url = getPath(contentBase, href)
|
||||
}
|
||||
|
||||
return `<img src="${url}" data-origin="${href}" alt="${text}"${titleHTML}>`
|
||||
return `<img src="${url}"data-origin="${href}" alt="${text}"${attrs}>`
|
||||
}
|
||||
|
||||
renderer.origin = origin
|
||||
@@ -173,11 +210,12 @@ export class Compiler {
|
||||
const currentPath = this.router.getCurrentPath()
|
||||
const { cacheTree, toc } = this
|
||||
|
||||
toc[0] && toc[0].ignoreAllSubs && (this.toc = [])
|
||||
toc[0] && toc[0].ignoreAllSubs && toc.splice(0)
|
||||
toc[0] && toc[0].level === 1 && toc.shift()
|
||||
toc.forEach((node, i) => {
|
||||
node.ignoreSubHeading && toc.splice(i, 1)
|
||||
})
|
||||
|
||||
for (let i = 0; i < toc.length; i++) {
|
||||
toc[i].ignoreSubHeading && toc.splice(i, 1) && i--
|
||||
}
|
||||
|
||||
const tree = cacheTree[currentPath] || genTree(toc, level)
|
||||
|
||||
|
||||
@@ -1,22 +1,14 @@
|
||||
import zoom from 'zoom-image'
|
||||
import style from 'zoom-image/css/zoom-image.css'
|
||||
import mediumZoom from 'medium-zoom'
|
||||
|
||||
function install (hook) {
|
||||
const dom = Docsify.dom
|
||||
let destroys
|
||||
|
||||
// add style
|
||||
dom.appendTo(dom.head, dom.create('style', style))
|
||||
let zoom
|
||||
|
||||
hook.doneEach(_ => {
|
||||
const images = dom.findAll('img:not(.emoji)')
|
||||
|
||||
if (Array.isArray(destroys) && destroys.length) {
|
||||
destroys.forEach(o => o())
|
||||
destroys = []
|
||||
if (zoom) {
|
||||
zoom.detach()
|
||||
}
|
||||
|
||||
destroys = images.map(zoom)
|
||||
zoom = mediumZoom('img:not(.emoji):not([data-no-zoom])')
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -75,6 +75,11 @@ img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
a[disabled] {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
kbd {
|
||||
border: solid 1px #ccc;
|
||||
border-radius: 3px;
|
||||
@@ -207,6 +212,7 @@ main {
|
||||
display: block;
|
||||
position: relative;
|
||||
size: 100vw 100%;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.anchor {
|
||||
@@ -227,7 +233,7 @@ main {
|
||||
.sidebar {
|
||||
border-right: 1px solid rgba(0, 0, 0, 0.07);
|
||||
overflow-y: auto;
|
||||
padding: 40px 0;
|
||||
padding: 40px 0 0;
|
||||
position: absolute 0 * 0 0;
|
||||
transition: transform 250ms ease-out;
|
||||
width: $sidebar-width;
|
||||
@@ -252,6 +258,7 @@ main {
|
||||
|
||||
.sidebar-nav {
|
||||
line-height: 2em;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
ul {
|
||||
@@ -444,10 +451,7 @@ body.close {
|
||||
@media print {
|
||||
.github-corner,
|
||||
.sidebar-toggle,
|
||||
.sidebar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidebar,
|
||||
.app-nav {
|
||||
display: none;
|
||||
}
|
||||
|
||||
+2
-1
@@ -47,10 +47,11 @@ body {
|
||||
}
|
||||
|
||||
.app-sub-sidebar {
|
||||
.section-link {
|
||||
li {
|
||||
&::before {
|
||||
content: '-';
|
||||
padding-right: 4px;
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user