mirror of
https://github.com/wahyd4/docsify.git
synced 2026-08-10 13:56:12 +10:00
Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d355272461 | ||
|
|
af161cd3b4 | ||
|
|
5bcb016bee | ||
|
|
b38c2065e0 | ||
|
|
e5bab8d967 | ||
|
|
da3e2d7b18 | ||
|
|
b93a667f24 | ||
|
|
e8d850c9ba | ||
|
|
514a027991 | ||
|
|
314e2d9d39 | ||
|
|
a86de3d81a | ||
|
|
5f960102e7 |
@@ -20,21 +20,19 @@ about: Create a report to help us improve
|
|||||||
|
|
||||||
#### What is the expected behaviour
|
#### What is the expected behaviour
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
|
|
||||||
|
#### Other relevant information
|
||||||
|
|
||||||
|
<!-- (Update "[ ]" to "[x]" to check a box) -->
|
||||||
- [ ] Bug does still occur when all/other plugins are disabled?
|
- [ ] Bug does still occur when all/other plugins are disabled?
|
||||||
|
|
||||||
<!-- Please type in your environment -->
|
- Your OS:
|
||||||
Environment:
|
- Node.js version:
|
||||||
|
- npm/yarn version:
|
||||||
```
|
- Browser version:
|
||||||
operating system:
|
- Docsify version:
|
||||||
npm version:
|
- Docsify plugins:
|
||||||
nodejs version:
|
|
||||||
docsify version:
|
|
||||||
docsify plugins:
|
|
||||||
browser:
|
|
||||||
```
|
|
||||||
|
|
||||||
<!-- Love docsify? Please consider supporting our collective:
|
<!-- Love docsify? Please consider supporting our collective:
|
||||||
👉 https://opencollective.com/docsify/donate -->
|
👉 https://opencollective.com/docsify/donate -->
|
||||||
|
|||||||
@@ -1,3 +1,18 @@
|
|||||||
|
<a name="4.9.2"></a>
|
||||||
|
## [4.9.2](https://github.com/docsifyjs/docsify/compare/v4.9.1...v4.9.2) (2019-04-21)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* re-render gitalk when router changed ([11ea1f8](https://github.com/docsifyjs/docsify/commit/11ea1f8))
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* allows relative path, fixed [#590](https://github.com/docsifyjs/docsify/issues/590) ([31654f1](https://github.com/docsifyjs/docsify/commit/31654f1))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.9.1"></a>
|
<a name="4.9.1"></a>
|
||||||
## [4.9.1](https://github.com/docsifyjs/docsify/compare/v4.9.0...v4.9.1) (2019-02-21)
|
## [4.9.1](https://github.com/docsifyjs/docsify/compare/v4.9.0...v4.9.1) (2019-02-21)
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
## Links
|
## Links
|
||||||
|
|
||||||
|
- [`develop` branch preview](https://docsifyjs.netlify.com/)
|
||||||
- [Documentation](https://docsify.js.org)
|
- [Documentation](https://docsify.js.org)
|
||||||
- [CLI](https://github.com/docsifyjs/docsify-cli)
|
- [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)
|
- CDN: [UNPKG](https://unpkg.com/docsify/) | [jsDelivr](https://cdn.jsdelivr.net/npm/docsify/) | [cdnjs](https://cdnjs.com/libraries/docsify)
|
||||||
@@ -40,7 +41,7 @@
|
|||||||
- Smart full-text search plugin
|
- Smart full-text search plugin
|
||||||
- Multiple themes
|
- Multiple themes
|
||||||
- Useful plugin API
|
- Useful plugin API
|
||||||
- Compatible with IE10+
|
- Compatible with IE11
|
||||||
- Support SSR ([example](https://github.com/docsifyjs/docsify-ssr-demo))
|
- Support SSR ([example](https://github.com/docsifyjs/docsify-ssr-demo))
|
||||||
- Support embedded files
|
- Support embedded files
|
||||||
|
|
||||||
|
|||||||
Regular → Executable
+1
-1
@@ -16,7 +16,7 @@ See the [Quick start](quickstart.md) guide for more details.
|
|||||||
- Multiple themes
|
- Multiple themes
|
||||||
- Useful plugin API
|
- Useful plugin API
|
||||||
- Emoji support
|
- Emoji support
|
||||||
- Compatible with IE10+
|
- Compatible with IE11
|
||||||
- Support server-side rendering ([example](https://github.com/docsifyjs/docsify-ssr-demo))
|
- Support server-side rendering ([example](https://github.com/docsifyjs/docsify-ssr-demo))
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||

|

|
||||||
|
|
||||||
# docsify <small>4.9.1</small>
|
# docsify <small>4.9.2</small>
|
||||||
|
|
||||||
> A magical documentation site generator.
|
> A magical documentation site generator.
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,10 @@
|
|||||||
maxLevel: 4,
|
maxLevel: 4,
|
||||||
subMaxLevel: 2,
|
subMaxLevel: 2,
|
||||||
ga: 'UA-106147152-1',
|
ga: 'UA-106147152-1',
|
||||||
|
matomo: {
|
||||||
|
host: '//matomo.thunderwave.de',
|
||||||
|
id: 6
|
||||||
|
},
|
||||||
name: 'docsify',
|
name: 'docsify',
|
||||||
search: {
|
search: {
|
||||||
noData: {
|
noData: {
|
||||||
@@ -84,6 +88,7 @@
|
|||||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></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/search.min.js"></script>
|
||||||
<script src="//unpkg.com/docsify/lib/plugins/ga.min.js"></script>
|
<script src="//unpkg.com/docsify/lib/plugins/ga.min.js"></script>
|
||||||
|
<script src="//unpkg.com/docsify/lib/plugins/matomo.min.js"></script>
|
||||||
<script src="//unpkg.com/prismjs/components/prism-bash.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-markdown.min.js"></script>
|
||||||
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>
|
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>
|
||||||
|
|||||||
+28
-12
@@ -21,48 +21,64 @@
|
|||||||
<script>
|
<script>
|
||||||
window.$docsify = {
|
window.$docsify = {
|
||||||
alias: {
|
alias: {
|
||||||
'.*?/changelog': 'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG',
|
'.*?/awesome': 'https://raw.githubusercontent.com/docsifyjs/awesome-docsify/master/README.md',
|
||||||
|
'.*?/changelog': 'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG.md',
|
||||||
'/.*/_navbar.md': '/_navbar.md',
|
'/.*/_navbar.md': '/_navbar.md',
|
||||||
'/zh-cn/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-zh/master/$1',
|
'/zh-cn/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-zh/master/$1',
|
||||||
'/de-de/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-de/master/$1',
|
'/de-de/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-de/master/$1',
|
||||||
'/ru/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-ru/master/$1',
|
'/ru/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-ru/master/$1',
|
||||||
'/es/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1'
|
'/es/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1'
|
||||||
},
|
},
|
||||||
notFoundPage: '_404.html',
|
|
||||||
auto2top: true,
|
auto2top: true,
|
||||||
basePath: '/docs/',
|
basePath: '/docs/',
|
||||||
executeScript: true,
|
|
||||||
loadNavbar: true,
|
|
||||||
loadSidebar: true,
|
|
||||||
coverpage: true,
|
coverpage: true,
|
||||||
name: 'docsify',
|
executeScript: true,
|
||||||
subMaxLevel: 2,
|
loadSidebar: true,
|
||||||
|
loadNavbar: true,
|
||||||
mergeNavbar: true,
|
mergeNavbar: true,
|
||||||
|
maxLevel: 4,
|
||||||
|
subMaxLevel: 2,
|
||||||
|
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}',
|
formatUpdated: '{MM}/{DD} {HH}:{mm}',
|
||||||
plugins: [
|
plugins: [
|
||||||
function (hook, vm) {
|
function (hook, vm) {
|
||||||
hook.beforeEach(function (html) {
|
hook.beforeEach(function (html) {
|
||||||
var url
|
|
||||||
if (/githubusercontent\.com/.test(vm.route.file)) {
|
if (/githubusercontent\.com/.test(vm.route.file)) {
|
||||||
url = vm.route.file
|
url = vm.route.file
|
||||||
.replace('raw.githubusercontent.com', 'github.com')
|
.replace('raw.githubusercontent.com', 'github.com')
|
||||||
.replace(/\/master/, '/blob/master')
|
.replace(/\/master/, '/blob/master')
|
||||||
} else {
|
} else {
|
||||||
url = 'https://github.com/docsifyjs/docsify/blob/master/' + vm.route.file
|
url = 'https://github.com/docsifyjs/docsify/blob/master/docs/' + vm.route.file
|
||||||
}
|
}
|
||||||
var editHtml = '[:memo: Edit Document](' + url + ')\n'
|
var editHtml = '[:memo: Edit Document](' + url + ')\n'
|
||||||
|
|
||||||
return editHtml
|
return editHtml
|
||||||
+ html
|
+ html
|
||||||
+ '\n\n----\n\n'
|
+ '\n\n----\n\n'
|
||||||
+ 'Last modified {docsify-updated} '
|
+ '<a href="https://docsify.js.org" target="_blank" style="color: inherit; font-weight: normal; text-decoration: none;">Powered by docsify</a>'
|
||||||
+ editHtml
|
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script src="/lib/docsify.js"></script>
|
<script src="/lib/docsify.js"></script>
|
||||||
|
<script src="/lib/plugins/search.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>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+23
-3
@@ -85,7 +85,8 @@ function config () {
|
|||||||
formatUpdated: '',
|
formatUpdated: '',
|
||||||
externalLinkTarget: '_blank',
|
externalLinkTarget: '_blank',
|
||||||
routerMode: 'hash',
|
routerMode: 'hash',
|
||||||
noCompileLinks: []
|
noCompileLinks: [],
|
||||||
|
relativePath: false
|
||||||
},
|
},
|
||||||
window.$docsify
|
window.$docsify
|
||||||
);
|
);
|
||||||
@@ -3222,6 +3223,20 @@ var cleanPath = cached(function (path) {
|
|||||||
return path.replace(/^\/+/, '/').replace(/([^:])\/{2,}/g, '$1/')
|
return path.replace(/^\/+/, '/').replace(/([^:])\/{2,}/g, '$1/')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var resolvePath = cached(function (path) {
|
||||||
|
var segments = path.replace(/^\//, '').split('/');
|
||||||
|
var resolved = [];
|
||||||
|
for (var i = 0, len = segments.length; i < len; i++) {
|
||||||
|
var segment = segments[i];
|
||||||
|
if (segment === '..') {
|
||||||
|
resolved.pop();
|
||||||
|
} else if (segment !== '.') {
|
||||||
|
resolved.push(segment);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '/' + resolved.join('/')
|
||||||
|
});
|
||||||
|
|
||||||
function getPath() {
|
function getPath() {
|
||||||
var args = [], len = arguments.length;
|
var args = [], len = arguments.length;
|
||||||
while ( len-- ) args[ len ] = arguments[ len ];
|
while ( len-- ) args[ len ] = arguments[ len ];
|
||||||
@@ -4517,9 +4532,13 @@ History.prototype.toURL = function toURL (path, params, currentRoute) {
|
|||||||
if (local) {
|
if (local) {
|
||||||
var idIndex = currentRoute.indexOf('?');
|
var idIndex = currentRoute.indexOf('?');
|
||||||
path =
|
path =
|
||||||
(idIndex > 0 ? currentRoute.substr(0, idIndex) : currentRoute) + path;
|
(idIndex > 0 ? currentRoute.substring(0, idIndex) : currentRoute) + path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.config.relativePath && path.indexOf('/') !== 0) {
|
||||||
|
var currentDir = currentRoute.substring(0, currentRoute.lastIndexOf('/') + 1);
|
||||||
|
return cleanPath(resolvePath(currentDir + path))
|
||||||
|
}
|
||||||
return cleanPath('/' + path)
|
return cleanPath('/' + path)
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -5036,6 +5055,7 @@ var util = Object.freeze({
|
|||||||
isAbsolutePath: isAbsolutePath,
|
isAbsolutePath: isAbsolutePath,
|
||||||
getParentPath: getParentPath,
|
getParentPath: getParentPath,
|
||||||
cleanPath: cleanPath,
|
cleanPath: cleanPath,
|
||||||
|
resolvePath: resolvePath,
|
||||||
getPath: getPath,
|
getPath: getPath,
|
||||||
replaceSlug: replaceSlug
|
replaceSlug: replaceSlug
|
||||||
});
|
});
|
||||||
@@ -5046,7 +5066,7 @@ function initGlobalAPI () {
|
|||||||
dom: dom,
|
dom: dom,
|
||||||
get: get,
|
get: get,
|
||||||
slugify: slugify,
|
slugify: slugify,
|
||||||
version: '4.9.1'
|
version: '4.9.2'
|
||||||
};
|
};
|
||||||
window.DocsifyCompiler = Compiler;
|
window.DocsifyCompiler = Compiler;
|
||||||
window.marked = marked;
|
window.marked = marked;
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+10
-4
@@ -8,10 +8,16 @@ function install(hook) {
|
|||||||
var main = dom.getNode('#main');
|
var main = dom.getNode('#main');
|
||||||
div.style = "width: " + (main.clientWidth) + "px; margin: 0 auto 20px;";
|
div.style = "width: " + (main.clientWidth) + "px; margin: 0 auto 20px;";
|
||||||
dom.appendTo(dom.find('.content'), div);
|
dom.appendTo(dom.find('.content'), div);
|
||||||
var script = dom.create('script');
|
});
|
||||||
var content = "gitalk.render('gitalk-container')";
|
|
||||||
script.textContent = content;
|
hook.doneEach(function (_) {
|
||||||
dom.appendTo(dom.body, script);
|
var el = document.getElementById('gitalk-container');
|
||||||
|
while (el.hasChildNodes()) {
|
||||||
|
el.removeChild(el.firstChild);
|
||||||
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line
|
||||||
|
gitalk.render('gitalk-container');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
$docsify.plugins=[].concat(function(t){var a=Docsify.dom;t.mounted(function(t){var n=a.create("div");n.id="gitalk-container";var i=a.getNode("#main");n.style="width: "+i.clientWidth+"px; margin: 0 auto 20px;",a.appendTo(a.find(".content"),n);var e=a.create("script");e.textContent="gitalk.render('gitalk-container')",a.appendTo(a.body,e)})},$docsify.plugins);
|
$docsify.plugins=[].concat(function(i){var e=Docsify.dom;i.mounted(function(i){var n=e.create("div");n.id="gitalk-container";var t=e.getNode("#main");n.style="width: "+t.clientWidth+"px; margin: 0 auto 20px;",e.appendTo(e.find(".content"),n)}),i.doneEach(function(i){for(var n=document.getElementById("gitalk-container");n.hasChildNodes();)n.removeChild(n.firstChild);gitalk.render("gitalk-container")})},$docsify.plugins);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
+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
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "docsify",
|
"name": "docsify",
|
||||||
"version": "4.9.1",
|
"version": "4.9.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "docsify",
|
"name": "docsify",
|
||||||
"version": "4.9.1",
|
"version": "4.9.2",
|
||||||
"description": "A magical documentation generator.",
|
"description": "A magical documentation generator.",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "qingwei-li",
|
"name": "qingwei-li",
|
||||||
@@ -32,11 +32,11 @@
|
|||||||
"watch:css": "run-p 'css -- -o themes -w'",
|
"watch:css": "run-p 'css -- -o themes -w'",
|
||||||
"watch:js": "node build/build.js",
|
"watch:js": "node build/build.js",
|
||||||
"build:css:min": "mkdir lib/themes && run-p 'css -- -o lib/themes' && node build/mincss.js",
|
"build:css:min": "mkdir lib/themes && run-p 'css -- -o lib/themes' && node build/mincss.js",
|
||||||
"build:css": "mkdir themes && run-p 'css -- -o themes'",
|
"build:css": "mkdir -p themes && run-p 'css -- -o themes'",
|
||||||
"build:js": "cross-env NODE_ENV=production node build/build.js",
|
"build:js": "cross-env NODE_ENV=production node build/build.js",
|
||||||
"build:ssr": "node build/ssr.js",
|
"build:ssr": "node build/ssr.js",
|
||||||
"build:cover": "node build/cover.js",
|
"build:cover": "node build/cover.js",
|
||||||
"build": "rimraf lib themes && run-s build:js build:css build:css:min build:ssr build:cover",
|
"build": "rimraf lib themes/* && run-s build:js build:css build:css:min build:ssr build:cover",
|
||||||
"pub:next": "cross-env RELEASE_TAG=next sh build/release.sh",
|
"pub:next": "cross-env RELEASE_TAG=next sh build/release.sh",
|
||||||
"pub": "sh build/release.sh",
|
"pub": "sh build/release.sh",
|
||||||
"postinstall": "opencollective postinstall"
|
"postinstall": "opencollective postinstall"
|
||||||
|
|||||||
+1
-1
@@ -37,5 +37,5 @@
|
|||||||
"integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ="
|
"integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ="
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"version": "4.9.1"
|
"version": "4.9.2"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "docsify-server-renderer",
|
"name": "docsify-server-renderer",
|
||||||
"version": "4.9.1",
|
"version": "4.9.2",
|
||||||
"description": "docsify server renderer",
|
"description": "docsify server renderer",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "qingwei-li",
|
"name": "qingwei-li",
|
||||||
|
|||||||
@@ -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)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user