Compare commits

...
16 Commits
Author SHA1 Message Date
qingwei.li ea14d67164 chore: add changelog 4.6.10 2018-03-25 13:26:51 +08:00
qingwei.li 85e3c68158 [build] 4.6.10 2018-03-25 13:26:50 +08:00
qingwei.li 410efb2bc2 docs: fix contributors link, fixed #428 2018-03-19 11:22:19 +08:00
qingwei.li 1e99d7b514 Merge branch 'master' of github.com:QingWei-Li/docsify 2018-03-19 10:17:26 +08:00
qingwei.li e4e011c81f fix: async install config, fixed #425 2018-03-19 09:56:29 +08:00
qingwei.li 4cd0e5eb49 chore: add changelog 4.6.9 2018-03-10 11:17:07 +08:00
qingwei.li 531e483c31 [build] 4.6.9 2018-03-10 11:17:06 +08:00
qingwei.li 6a3d69ae1a fix: upgrade medium-zoom, fixed #417 2018-03-10 11:16:32 +08:00
qingwei.li ef1b42be23 chore: fix index.html 2018-03-07 17:54:50 +08:00
qingwei.li 54f45ecb0a chore: add changelog 4.6.8 2018-03-06 11:58:41 +08:00
qingwei.li 4c91fbc7cb [build] 4.6.8 2018-03-06 11:58:40 +08:00
qingwei.li bfd0d18e48 fix: resolve path of image and embed files, fixed #412 2018-03-06 11:57:48 +08:00
Stevenandcinwell.li 74ff68a40e Update url to markedjs (#410)
* Update markdown.md

* Update markdown.md

* Update markdown.md
2018-03-04 07:35:01 +08:00
qingwei.li e737a42f75 chore: add changelog 4.6.7 2018-03-03 23:29:17 +08:00
qingwei.li a850b29545 [build] 4.6.7 2018-03-03 23:29:16 +08:00
qingwei.li aeb692ed6b fix: layout css, fixed #409 2018-03-03 23:28:33 +08:00
29 changed files with 231 additions and 167 deletions
+40
View File
@@ -1,3 +1,43 @@
<a name="4.6.10"></a>
## [4.6.10](https://github.com/QingWei-Li/docsify/compare/v4.6.9...v4.6.10) (2018-03-25)
### Bug Fixes
* async install config, fixed [#425](https://github.com/QingWei-Li/docsify/issues/425) ([e4e011c](https://github.com/QingWei-Li/docsify/commit/e4e011c))
<a name="4.6.9"></a>
## [4.6.9](https://github.com/QingWei-Li/docsify/compare/v4.6.8...v4.6.9) (2018-03-10)
### Bug Fixes
* upgrade medium-zoom, fixed [#417](https://github.com/QingWei-Li/docsify/issues/417) ([6a3d69a](https://github.com/QingWei-Li/docsify/commit/6a3d69a))
<a name="4.6.8"></a>
## [4.6.8](https://github.com/QingWei-Li/docsify/compare/v4.6.7...v4.6.8) (2018-03-06)
### Bug Fixes
* resolve path of image and embed files, fixed [#412](https://github.com/QingWei-Li/docsify/issues/412) ([bfd0d18](https://github.com/QingWei-Li/docsify/commit/bfd0d18))
<a name="4.6.7"></a>
## [4.6.7](https://github.com/QingWei-Li/docsify/compare/v4.6.6...v4.6.7) (2018-03-03)
### Bug Fixes
* layout css, fixed [#409](https://github.com/QingWei-Li/docsify/issues/409) ([aeb692e](https://github.com/QingWei-Li/docsify/commit/aeb692e))
<a name="4.6.6"></a>
## [4.6.6](https://github.com/QingWei-Li/docsify/compare/v4.6.5...v4.6.6) (2018-03-03)
+1 -1
View File
@@ -97,7 +97,7 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
## Contributors
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
<a href="graphs/contributors"><img src="https://opencollective.com/docsify/contributors.svg?width=890" /></a>
<a href="https://github.com/QingWei-Li/docsify/graphs/contributors"><img src="https://opencollective.com/docsify/contributors.svg?width=890" /></a>
## License
+1 -1
View File
@@ -1,6 +1,6 @@
![logo](_media/icon.svg)
# docsify <small>4.6.6</small>
# docsify <small>4.6.10</small>
> A magical documentation site generator.
+1 -1
View File
@@ -68,7 +68,7 @@ Du kannst untergeordnete Listen erstellen, indem du untergeordnete Punkte einem
wird also wie folgt aussehen
![Nesting navbar](_images/nested-navbar.png 'Nesting navbar')
![Nesting navbar](../_images/nested-navbar.png 'Nesting navbar')
## Angepasste Navigationsleisten in Verbindung mit dem emoji Erweiterung
+1 -1
View File
@@ -12,7 +12,7 @@ Du kannst folgende drei Orte verwenden, um die Dokumentation für dein Github re
Es wird empfohlen, deine Dateien im `./docs` Unterordner im `master` branch deines repository zu speichern. Wechsle dann zu den Einstellungen deines repository und wähle `master branch /docs folder` als deine Github Pages Quelle.
![github pages](_images/deploy-github-pages.png)
![github pages](../_images/deploy-github-pages.png)
!> Du kannst die Dateien auch im Hauptverzeichnis speichern und dann `master branch` in den Einstellungen auswählen.
+7 -7
View File
@@ -6,14 +6,14 @@ You can embed these files as video, audio, iframes, or code blocks, and even Mar
For example, here embedded a Markdown file. You only need to do this:
```markdown
[filename](_media/example.md ':include')
[filename](../_media/example.md ':include')
```
Then the content of `example.md` will be displayed directly here
[filename](_media/example.md ':include')
[filename](../_media/example.md ':include')
You can check the original content for [example.md](_media/example.md ':ignore').
You can check the original content for [example.md](../_media/example.md ':ignore').
Normally, this will compiled into a link, but in docsify, if you add `:include` it will be embedded.
@@ -32,12 +32,12 @@ This is a supported embedding type:
Of course, you can force the specified. For example, you want to Markdown file as code block embedded.
```markdown
[filename](_media/example.md ':include :type=code')
[filename](../_media/example.md ':include :type=code')
```
You will get it
[filename](_media/example.md ':include :type=code')
[filename](../_media/example.md ':include :type=code')
## Tag attribute
@@ -56,11 +56,11 @@ Did you see it? You only need to write directly. You can check [MDN](https://dev
Embedding any type of source code file, you can specify the highlighted language or automatically identify.
```markdown
[](_media/example.html ':include :type=code text')
[](../_media/example.html ':include :type=code text')
```
⬇️
[](_media/example.html ':include :type=code text')
[](../_media/example.html ':include :type=code text')
?> How to set highlight? You can see [here](language-highlight.md).
+2 -2
View File
@@ -1,6 +1,6 @@
# Markdown Einstellungen
**docsify** verwendet [marked](https://github.com/chjj/marked), um Markdown umzuwandeln. Du kannst einstellen, wie es deine Markdown Seiten in HTML umwandelt, indem du `renderer` konfigurierst:
**docsify** verwendet [marked](https://github.com/markedjs/marked), um Markdown umzuwandeln. Du kannst einstellen, wie es deine Markdown Seiten in HTML umwandelt, indem du `renderer` konfigurierst:
```js
window.$docsify = {
@@ -15,7 +15,7 @@ window.$docsify = {
}
```
?> Für mögliche Einstellungen, siehe [marked Dokumentation](https://github.com/chjj/marked#options-1)
?> Für mögliche Einstellungen, siehe [marked Dokumentation](https://github.com/markedjs/marked#options-1)
Du kannst die Regeln auch beliebig anpassen.
+1 -1
View File
@@ -62,7 +62,7 @@
return editHtml
+ html
+ '\n----\n'
+ '\n\n----\n\n'
+ '<a href="https://docsify.js.org" target="_blank" style="color: inherit; font-weight: normal; text-decoration: none;">Powered by docsify</a>'
})
}
+1 -1
View File
@@ -61,4 +61,4 @@ _\_navbar.md_
效果图
![嵌套导航栏](_images/zh-cn/nested-navbar.png '嵌套导航栏')
![嵌套导航栏](../_images/zh-cn/nested-navbar.png '嵌套导航栏')
+1 -1
View File
@@ -11,7 +11,7 @@ GitHub Pages 支持从三个地方读取文件
我们推荐直接将文档放在 `docs/` 目录下,在设置页面开启 **GitHub Pages** 功能并选择 `master branch /docs folder` 选项。
![github pages](_images/deploy-github-pages.png)
![github pages](../_images/deploy-github-pages.png)
!> 可以将文档放在根目录下,然后选择 **master 分支** 作为文档目录。
+7 -7
View File
@@ -5,14 +5,14 @@ docsify 4.6 开始支持嵌入任何类型的文件到文档里。你可以将
这是一个嵌入 Markdown 文件的例子。
```markdown
[filename](_media/example.md ':include')
[filename](../_media/example.md ':include')
```
`example.md` 文件的内容将会直接显示在这里
[filename](_media/example.md ':include')
[filename](../_media/example.md ':include')
你可以查看 [example.md](_media/example.md ':ignore') 原始内容对比效果。
你可以查看 [example.md](../_media/example.md ':ignore') 原始内容对比效果。
通常情况下,这样的语法将会被当作链接处理。但是在 docsify 里,如果你添加一个 `:include` 选项,它就会被当作文件嵌入。
@@ -29,12 +29,12 @@ docsify 4.6 开始支持嵌入任何类型的文件到文档里。你可以将
当然,你也可以强制设置嵌入类型。例如你想将 Markdown 文件当作一个 `code block` 嵌入。
```markdown
[filename](_media/example.md ':include :type=code')
[filename](../_media/example.md ':include :type=code')
```
你将得到
[filename](_media/example.md ':include :type=code')
[filename](../_media/example.md ':include :type=code')
## 标签属性
@@ -53,11 +53,11 @@ docsify 4.6 开始支持嵌入任何类型的文件到文档里。你可以将
如果是嵌入一个代码块,你可以设置高亮的语言,或者让它自动识别。这里是手动设置高亮语言
```markdown
[](_media/example.html ':include :type=code text')
[](../_media/example.html ':include :type=code text')
```
⬇️
[](_media/example.html ':include :type=code text')
[](../_media/example.html ':include :type=code text')
?> 如何高亮代码?你可以查看[这份文档](language-highlight.md).
+2 -2
View File
@@ -1,6 +1,6 @@
# Markdown 配置
内置的 Markdown 解析器是 [marked](https://github.com/chjj/marked),可以修改它的配置。同时可以直接配置 `renderer`
内置的 Markdown 解析器是 [marked](https://github.com/markedjs/marked),可以修改它的配置。同时可以直接配置 `renderer`
```js
window.$docsify = {
@@ -15,7 +15,7 @@ window.$docsify = {
}
```
?> 完整配置参数参考 [marked 文档](https://github.com/chjj/marked#options-1)
?> 完整配置参数参考 [marked 文档](https://github.com/markedjs/marked#options-1)
当然也可以完全定制 Markdown 解析规则。
+1 -1
View File
@@ -43,7 +43,7 @@
return editHtml
+ html
+ '\n----\n'
+ '\n\n----\n\n'
+ 'Last modified {docsify-updated} '
+ editHtml
})
+68 -60
View File
@@ -60,70 +60,74 @@ function isFn(obj) {
return typeof obj === 'function'
}
var config = merge(
{
el: '#app',
repo: '',
maxLevel: 6,
subMaxLevel: 0,
loadSidebar: null,
loadNavbar: null,
homepage: 'README.md',
coverpage: '',
basePath: '',
auto2top: false,
name: '',
themeColor: '',
nameLink: window.location.pathname,
autoHeader: false,
executeScript: null,
noEmoji: false,
ga: '',
ext: '.md',
mergeNavbar: false,
formatUpdated: '',
externalLinkTarget: '_blank',
routerMode: 'hash',
noCompileLinks: []
},
window.$docsify
);
function config () {
var config = merge(
{
el: '#app',
repo: '',
maxLevel: 6,
subMaxLevel: 0,
loadSidebar: null,
loadNavbar: null,
homepage: 'README.md',
coverpage: '',
basePath: '',
auto2top: false,
name: '',
themeColor: '',
nameLink: window.location.pathname,
autoHeader: false,
executeScript: null,
noEmoji: false,
ga: '',
ext: '.md',
mergeNavbar: false,
formatUpdated: '',
externalLinkTarget: '_blank',
routerMode: 'hash',
noCompileLinks: []
},
window.$docsify
);
var script =
document.currentScript ||
[].slice
.call(document.getElementsByTagName('script'))
.filter(function (n) { return /docsify\./.test(n.src); })[0];
var script =
document.currentScript ||
[].slice
.call(document.getElementsByTagName('script'))
.filter(function (n) { return /docsify\./.test(n.src); })[0];
if (script) {
for (var prop in config) {
if (hasOwn.call(config, prop)) {
var val = script.getAttribute('data-' + hyphenate(prop));
if (script) {
for (var prop in config) {
if (hasOwn.call(config, prop)) {
var val = script.getAttribute('data-' + hyphenate(prop));
if (isPrimitive(val)) {
config[prop] = val === '' ? true : val;
if (isPrimitive(val)) {
config[prop] = val === '' ? true : val;
}
}
}
if (config.loadSidebar === true) {
config.loadSidebar = '_sidebar' + config.ext;
}
if (config.loadNavbar === true) {
config.loadNavbar = '_navbar' + config.ext;
}
if (config.coverpage === true) {
config.coverpage = '_coverpage' + config.ext;
}
if (config.repo === true) {
config.repo = '';
}
if (config.name === true) {
config.name = '';
}
}
if (config.loadSidebar === true) {
config.loadSidebar = '_sidebar' + config.ext;
}
if (config.loadNavbar === true) {
config.loadNavbar = '_navbar' + config.ext;
}
if (config.coverpage === true) {
config.coverpage = '_coverpage' + config.ext;
}
if (config.repo === true) {
config.repo = '';
}
if (config.name === true) {
config.name = '';
}
}
window.$docsify = config;
window.$docsify = config;
return config
}
function initLifecycle(vm) {
var hooks = [
@@ -3015,7 +3019,11 @@ Compiler.prototype.compileEmbed = function compileEmbed (href, title) {
if (config.include) {
if (!isAbsolutePath(href)) {
href = getPath(this.contentBase, href);
href = getPath(
this.contentBase,
getParentPath(this.router.getCurrentPath()),
href
);
}
var media;
@@ -3168,7 +3176,7 @@ Compiler.prototype._initRenderer = function _initRenderer () {
}
if (!isAbsolutePath(href)) {
url = getPath(contentBase, href);
url = getPath(contentBase, getParentPath(router.getCurrentPath()), href);
}
return ("<img src=\"" + url + "\"data-origin=\"" + href + "\" alt=\"" + text + "\"" + attrs + ">")
@@ -4490,7 +4498,7 @@ function initFetch(vm) {
function initMixin(proto) {
proto._init = function () {
var vm = this;
vm.config = config || {};
vm.config = config();
initLifecycle(vm); // Init hooks
initPlugin(vm); // Install plugins
@@ -4569,7 +4577,7 @@ initGlobalAPI();
/**
* Version
*/
Docsify.version = '4.6.6';
Docsify.version = '4.6.10';
/**
* Run Docsify
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "docsify",
"version": "4.6.6",
"version": "4.6.10",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -5019,9 +5019,9 @@
"dev": true
},
"medium-zoom": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/medium-zoom/-/medium-zoom-0.3.0.tgz",
"integrity": "sha512-26CJAykAcm1IYx2XjUB04dmZ7iRLtyTDKZSrm5kEqHJWVMo7pafUZEPcRGvYCNWW4f1utlEOzbtbaOvwNg7g1g=="
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/medium-zoom/-/medium-zoom-0.4.0.tgz",
"integrity": "sha512-0z7yMfd6I1BTCAa8QaR4cp5AqDkQD571GzhHIbbfefKEssGLSvs+4Xai/itOAncm4FBlF5gUoMQ22yW9/f8Sig=="
},
"mem": {
"version": "1.1.0",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "docsify",
"version": "4.6.6",
"version": "4.6.10",
"description": "A magical documentation generator.",
"author": {
"name": "qingwei-li",
@@ -42,7 +42,7 @@
},
"dependencies": {
"marked": "^0.3.12",
"medium-zoom": "^0.3.0",
"medium-zoom": "^0.4.0",
"opencollective": "^1.0.3",
"prismjs": "^1.9.0",
"tinydate": "^1.0.0",
+1 -1
View File
@@ -37,5 +37,5 @@
"integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ="
}
},
"version": "4.6.6"
"version": "4.6.10"
}
@@ -1,6 +1,6 @@
{
"name": "docsify-server-renderer",
"version": "4.6.6",
"version": "4.6.10",
"description": "docsify server renderer",
"author": {
"name": "qingwei-li",
+60 -58
View File
@@ -1,68 +1,70 @@
import {merge, hyphenate, isPrimitive, hasOwn} from './util/core'
const config = merge(
{
el: '#app',
repo: '',
maxLevel: 6,
subMaxLevel: 0,
loadSidebar: null,
loadNavbar: null,
homepage: 'README.md',
coverpage: '',
basePath: '',
auto2top: false,
name: '',
themeColor: '',
nameLink: window.location.pathname,
autoHeader: false,
executeScript: null,
noEmoji: false,
ga: '',
ext: '.md',
mergeNavbar: false,
formatUpdated: '',
externalLinkTarget: '_blank',
routerMode: 'hash',
noCompileLinks: []
},
window.$docsify
)
export default function () {
const config = merge(
{
el: '#app',
repo: '',
maxLevel: 6,
subMaxLevel: 0,
loadSidebar: null,
loadNavbar: null,
homepage: 'README.md',
coverpage: '',
basePath: '',
auto2top: false,
name: '',
themeColor: '',
nameLink: window.location.pathname,
autoHeader: false,
executeScript: null,
noEmoji: false,
ga: '',
ext: '.md',
mergeNavbar: false,
formatUpdated: '',
externalLinkTarget: '_blank',
routerMode: 'hash',
noCompileLinks: []
},
window.$docsify
)
const script =
document.currentScript ||
[].slice
.call(document.getElementsByTagName('script'))
.filter(n => /docsify\./.test(n.src))[0]
const script =
document.currentScript ||
[].slice
.call(document.getElementsByTagName('script'))
.filter(n => /docsify\./.test(n.src))[0]
if (script) {
for (const prop in config) {
if (hasOwn.call(config, prop)) {
const val = script.getAttribute('data-' + hyphenate(prop))
if (script) {
for (const prop in config) {
if (hasOwn.call(config, prop)) {
const val = script.getAttribute('data-' + hyphenate(prop))
if (isPrimitive(val)) {
config[prop] = val === '' ? true : val
if (isPrimitive(val)) {
config[prop] = val === '' ? true : val
}
}
}
if (config.loadSidebar === true) {
config.loadSidebar = '_sidebar' + config.ext
}
if (config.loadNavbar === true) {
config.loadNavbar = '_navbar' + config.ext
}
if (config.coverpage === true) {
config.coverpage = '_coverpage' + config.ext
}
if (config.repo === true) {
config.repo = ''
}
if (config.name === true) {
config.name = ''
}
}
if (config.loadSidebar === true) {
config.loadSidebar = '_sidebar' + config.ext
}
if (config.loadNavbar === true) {
config.loadNavbar = '_navbar' + config.ext
}
if (config.coverpage === true) {
config.coverpage = '_coverpage' + config.ext
}
if (config.repo === true) {
config.repo = ''
}
if (config.name === true) {
config.name = ''
}
window.$docsify = config
return config
}
window.$docsify = config
export default config
+1 -1
View File
@@ -9,7 +9,7 @@ import {isFn} from '../util/core'
export function initMixin(proto) {
proto._init = function () {
const vm = this
vm.config = config || {}
vm.config = config()
initLifecycle(vm) // Init hooks
initPlugin(vm) // Install plugins
+7 -3
View File
@@ -4,7 +4,7 @@ import {helper as helperTpl, tree as treeTpl} from './tpl'
import {genTree} from './gen-tree'
import {slugify} from './slugify'
import {emojify} from './emojify'
import {isAbsolutePath, getPath} from '../router/util'
import {isAbsolutePath, getPath, getParentPath} from '../router/util'
import {isFn, merge, cached, isPrimitive} from '../util/core'
const cachedLinks = {}
@@ -112,7 +112,11 @@ export class Compiler {
if (config.include) {
if (!isAbsolutePath(href)) {
href = getPath(process.env.SSR ? '' : this.contentBase, href)
href = getPath(
process.env.SSR ? '' : this.contentBase,
getParentPath(this.router.getCurrentPath()),
href
)
}
let media
@@ -254,7 +258,7 @@ export class Compiler {
}
if (!isAbsolutePath(href)) {
url = getPath(contentBase, href)
url = getPath(contentBase, getParentPath(router.getCurrentPath()), href)
}
return `<img src="${url}"data-origin="${href}" alt="${text}"${attrs}>`
+2 -2
View File
@@ -388,7 +388,7 @@ body.sticky
body.close
.sidebar
transform translateX(-$sidebar-width)
transform translateX(- $sidebar-width)
.sidebar-toggle
width auto
@@ -415,7 +415,7 @@ body.close
overflow-x hidden
.sidebar
left -$sidebar-width
left - $sidebar-width
transition transform 250ms ease-out
.content