mirror of
https://github.com/wahyd4/docsify.git
synced 2026-08-09 13:26:34 +10:00
Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d355272461 | ||
|
|
af161cd3b4 | ||
|
|
5bcb016bee | ||
|
|
b38c2065e0 | ||
|
|
e5bab8d967 | ||
|
|
da3e2d7b18 | ||
|
|
b93a667f24 | ||
|
|
e8d850c9ba | ||
|
|
514a027991 | ||
|
|
314e2d9d39 | ||
|
|
a86de3d81a | ||
|
|
5f960102e7 | ||
|
|
0bd5c8b020 | ||
|
|
044a5ec2b8 | ||
|
|
b15eccfac0 | ||
|
|
4e0298088b |
@@ -20,18 +20,19 @@ about: Create a report to help us improve
|
||||
|
||||
#### 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?
|
||||
|
||||
<!-- Please type in your environment -->
|
||||
Environment:
|
||||
|
||||
```
|
||||
docsify version:
|
||||
docsify plugins:
|
||||
browser:
|
||||
```
|
||||
- Your OS:
|
||||
- Node.js version:
|
||||
- npm/yarn version:
|
||||
- Browser version:
|
||||
- Docsify version:
|
||||
- Docsify plugins:
|
||||
|
||||
<!-- 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>
|
||||
## [4.9.1](https://github.com/docsifyjs/docsify/compare/v4.9.0...v4.9.1) (2019-02-21)
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
## Links
|
||||
|
||||
- [`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)
|
||||
@@ -40,7 +41,7 @@
|
||||
- Smart full-text search plugin
|
||||
- Multiple themes
|
||||
- Useful plugin API
|
||||
- Compatible with IE10+
|
||||
- Compatible with IE11
|
||||
- Support SSR ([example](https://github.com/docsifyjs/docsify-ssr-demo))
|
||||
- Support embedded files
|
||||
|
||||
|
||||
Regular → Executable
+1
-1
@@ -16,7 +16,7 @@ See the [Quick start](quickstart.md) guide for more details.
|
||||
- Multiple themes
|
||||
- Useful plugin API
|
||||
- Emoji support
|
||||
- Compatible with IE10+
|
||||
- Compatible with IE11
|
||||
- Support server-side rendering ([example](https://github.com/docsifyjs/docsify-ssr-demo))
|
||||
|
||||
## Examples
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||

|
||||
|
||||
# docsify <small>4.9.1</small>
|
||||
# docsify <small>4.9.2</small>
|
||||
|
||||
> A magical documentation site generator.
|
||||
|
||||
|
||||
@@ -44,6 +44,10 @@
|
||||
maxLevel: 4,
|
||||
subMaxLevel: 2,
|
||||
ga: 'UA-106147152-1',
|
||||
matomo: {
|
||||
host: '//matomo.thunderwave.de',
|
||||
id: 6
|
||||
},
|
||||
name: 'docsify',
|
||||
search: {
|
||||
noData: {
|
||||
@@ -84,6 +88,7 @@
|
||||
<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/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-markdown.min.js"></script>
|
||||
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>
|
||||
|
||||
+28
-12
@@ -21,48 +21,64 @@
|
||||
<script>
|
||||
window.$docsify = {
|
||||
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',
|
||||
'/zh-cn/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-zh/master/$1',
|
||||
'/de-de/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-de/master/$1',
|
||||
'/ru/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-ru/master/$1',
|
||||
'/es/(.*)': 'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1'
|
||||
},
|
||||
notFoundPage: '_404.html',
|
||||
auto2top: true,
|
||||
basePath: '/docs/',
|
||||
executeScript: true,
|
||||
loadNavbar: true,
|
||||
loadSidebar: true,
|
||||
coverpage: true,
|
||||
name: 'docsify',
|
||||
subMaxLevel: 2,
|
||||
executeScript: true,
|
||||
loadSidebar: true,
|
||||
loadNavbar: 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}',
|
||||
plugins: [
|
||||
function (hook, vm) {
|
||||
hook.beforeEach(function (html) {
|
||||
var url
|
||||
if (/githubusercontent\.com/.test(vm.route.file)) {
|
||||
url = vm.route.file
|
||||
.replace('raw.githubusercontent.com', 'github.com')
|
||||
.replace(/\/master/, '/blob/master')
|
||||
} 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'
|
||||
|
||||
return editHtml
|
||||
+ html
|
||||
+ '\n\n----\n\n'
|
||||
+ 'Last modified {docsify-updated} '
|
||||
+ editHtml
|
||||
+ '<a href="https://docsify.js.org" target="_blank" style="color: inherit; font-weight: normal; text-decoration: none;">Powered by docsify</a>'
|
||||
})
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
</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>
|
||||
|
||||
</html>
|
||||
|
||||
+23
-3
@@ -85,7 +85,8 @@ function config () {
|
||||
formatUpdated: '',
|
||||
externalLinkTarget: '_blank',
|
||||
routerMode: 'hash',
|
||||
noCompileLinks: []
|
||||
noCompileLinks: [],
|
||||
relativePath: false
|
||||
},
|
||||
window.$docsify
|
||||
);
|
||||
@@ -3222,6 +3223,20 @@ var cleanPath = cached(function (path) {
|
||||
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() {
|
||||
var args = [], len = arguments.length;
|
||||
while ( len-- ) args[ len ] = arguments[ len ];
|
||||
@@ -4517,9 +4532,13 @@ History.prototype.toURL = function toURL (path, params, currentRoute) {
|
||||
if (local) {
|
||||
var idIndex = currentRoute.indexOf('?');
|
||||
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)
|
||||
};
|
||||
|
||||
@@ -5036,6 +5055,7 @@ var util = Object.freeze({
|
||||
isAbsolutePath: isAbsolutePath,
|
||||
getParentPath: getParentPath,
|
||||
cleanPath: cleanPath,
|
||||
resolvePath: resolvePath,
|
||||
getPath: getPath,
|
||||
replaceSlug: replaceSlug
|
||||
});
|
||||
@@ -5046,7 +5066,7 @@ function initGlobalAPI () {
|
||||
dom: dom,
|
||||
get: get,
|
||||
slugify: slugify,
|
||||
version: '4.9.1'
|
||||
version: '4.9.2'
|
||||
};
|
||||
window.DocsifyCompiler = Compiler;
|
||||
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');
|
||||
div.style = "width: " + (main.clientWidth) + "px; margin: 0 auto 20px;";
|
||||
dom.appendTo(dom.find('.content'), div);
|
||||
var script = dom.create('script');
|
||||
var content = "gitalk.render('gitalk-container')";
|
||||
script.textContent = content;
|
||||
dom.appendTo(dom.body, script);
|
||||
});
|
||||
|
||||
hook.doneEach(function (_) {
|
||||
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",
|
||||
"version": "4.9.1",
|
||||
"version": "4.9.2",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify",
|
||||
"version": "4.9.1",
|
||||
"version": "4.9.2",
|
||||
"description": "A magical documentation generator.",
|
||||
"author": {
|
||||
"name": "qingwei-li",
|
||||
@@ -32,11 +32,11 @@
|
||||
"watch:css": "run-p 'css -- -o themes -w'",
|
||||
"watch:js": "node build/build.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:ssr": "node build/ssr.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": "sh build/release.sh",
|
||||
"postinstall": "opencollective postinstall"
|
||||
|
||||
+1
-1
@@ -37,5 +37,5 @@
|
||||
"integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ="
|
||||
}
|
||||
},
|
||||
"version": "4.9.1"
|
||||
"version": "4.9.2"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify-server-renderer",
|
||||
"version": "4.9.1",
|
||||
"version": "4.9.2",
|
||||
"description": "docsify server renderer",
|
||||
"author": {
|
||||
"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