Compare commits

...
17 Commits
Author SHA1 Message Date
qingwei.li 572ab1afae chore: add changelog 4.5.5 2017-11-30 09:43:46 +08:00
qingwei.li d3dc8bcfb7 [build] 4.5.5 2017-11-30 09:43:44 +08:00
qingwei.li 0e693fcda2 chore: tweaks code 2017-11-30 09:43:25 +08:00
Leon Zhangandcinwell.li 041b33e967 fix: disqus plugin issue (#318)
* fix issue disqus plugin issue

fix #317, disqus plugin make page refresh continuously.

* Update disqus.js
2017-11-30 09:42:02 +08:00
qingwei.li b34a9375c3 chore: add changelog 4.5.4 2017-11-29 09:46:20 +08:00
qingwei.li a1d2a1f1e3 [build] 4.5.4 2017-11-29 09:46:18 +08:00
qingwei.li e43ded4ea7 fix(compiler): task lists style, fixed #215 2017-11-29 09:45:40 +08:00
Kamilandcinwell.li 88df107c70 Add vue-sticker in Showcase section (#313)
Add one more component, that use docsify
2017-11-28 09:48:38 +08:00
Jonas Zhangandcinwell.li bc3ef52bbe docs: Improve the translation (#312)
* docs:Improve the translation

docs:Improve the translation

* docs:Improve the translation

docs:Improve the translation

* Update configuration.md

* Update deploy.md

* Update helpers.md
2017-11-24 10:11:15 +08:00
ItsPugleandcinwell.li 9bed441a0c Update deploy.md (#311) 2017-11-24 00:09:36 +08:00
Jonas Zhangandcinwell.li af38fc70fd docs: translate zh-cn doc for more-pages.md (#310)
translate zh-cn doc for more-pages.md
2017-11-21 17:31:41 +08:00
qingwei.li 4f164e995e chore: add changelog 4.5.3 2017-11-11 10:15:17 +08:00
qingwei.li b77f46a8e3 [build] 4.5.3 2017-11-11 10:15:16 +08:00
spiritreeandcinwell.li 9208e64939 feat: add gitalk plugin (#306) 2017-11-09 20:53:07 +08:00
qingwei.li 405349102f chore: add changelog 4.5.2 2017-11-09 13:06:59 +08:00
qingwei.li 9d6595d04b [build] 4.5.2 2017-11-09 13:06:57 +08:00
cinwell.liandGitHub d486eef6cc feat: github task lists, close #215 (#305) 2017-11-09 13:06:23 +08:00
33 changed files with 242 additions and 41 deletions
+45
View File
@@ -1,3 +1,48 @@
<a name="4.5.5"></a>
## [4.5.5](https://github.com/QingWei-Li/docsify/compare/v4.5.4...v4.5.5) (2017-11-30)
### Bug Fixes
* disqus plugin issue ([#318](https://github.com/QingWei-Li/docsify/issues/318)) ([041b33e](https://github.com/QingWei-Li/docsify/commit/041b33e)), closes [#317](https://github.com/QingWei-Li/docsify/issues/317)
<a name="4.5.4"></a>
## [4.5.4](https://github.com/QingWei-Li/docsify/compare/v4.5.2...v4.5.4) (2017-11-29)
### Bug Fixes
* **compiler:** task lists style, fixed [#215](https://github.com/QingWei-Li/docsify/issues/215) ([e43ded4](https://github.com/QingWei-Li/docsify/commit/e43ded4))
### Features
* add gitalk plugin ([#306](https://github.com/QingWei-Li/docsify/issues/306)) ([9208e64](https://github.com/QingWei-Li/docsify/commit/9208e64))
<a name="4.5.3"></a>
## [4.5.3](https://github.com/QingWei-Li/docsify/compare/v4.5.2...v4.5.3) (2017-11-11)
### Features
* add gitalk plugin ([#306](https://github.com/QingWei-Li/docsify/issues/306)) ([9208e64](https://github.com/QingWei-Li/docsify/commit/9208e64))
<a name="4.5.2"></a>
## [4.5.2](https://github.com/QingWei-Li/docsify/compare/v4.5.1...v4.5.2) (2017-11-09)
### Features
* github task lists, close [#215](https://github.com/QingWei-Li/docsify/issues/215) ([#305](https://github.com/QingWei-Li/docsify/issues/305)) ([d486eef](https://github.com/QingWei-Li/docsify/commit/d486eef))
<a name="4.5.1"></a>
## [4.5.1](https://github.com/QingWei-Li/docsify/compare/v4.5.0...v4.5.1) (2017-11-07)
+1
View File
@@ -87,6 +87,7 @@ These projects are using docsify to generate their sites. Pull requests welcome
| [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. |
| [zooming](http://desmonding.me/zooming/docs) | Image zoom that makes sense. |
| [vue-sticker](https://kamilocean.github.io/vue-sticker/#/) | Vue component, that helps to make sticky effects |
## Similar projects
+2 -1
View File
@@ -49,7 +49,8 @@ var plugins = [
{ name: 'front-matter', entry: 'front-matter/index.js' },
{ name: 'zoom-image', entry: 'zoom-image.js' },
{ name: 'codesponsor', entry: 'codesponsor.js' },
{ name: 'disqus', entry: 'disqus.js' }
{ name: 'disqus', entry: 'disqus.js' },
{ name: 'gitalk', entry: 'gitalk.js' }
]
plugins.forEach(item => {
+1 -1
View File
@@ -1,6 +1,6 @@
![logo](_media/icon.svg)
# docsify <small>4.5.1</small>
# docsify <small>4.5.5</small>
> A magical documentation site generator.
+20
View File
@@ -56,3 +56,23 @@ You will get `<a href="/demo/">link</a>`html. Do not worry, you can still set ti
[link](/demo ":target=_blank")
[link](/demo2 ":target=_self")
```
## Github Task Lists
```md
* [ ] foo
* bar
* [x] baz
* [] bam
* [ ] bim
* [ ] lim
```
* [ ] foo
* bar
* [x] baz
* [] bam
* [ ] bim
* [ ] lim
+1
View File
@@ -15,6 +15,7 @@ It is recommended that you save your files to the `./docs` subfolder of the `mas
![github pages](_images/deploy-github-pages.png)
!> You can also save files in the root directory and select `master branch`.
!> You'll need to place a `.nojekyll` file in the deploy location (such as `/docs` or the gh-pages branch
## GitLab Pages
+20
View File
@@ -62,3 +62,23 @@ You will get `<a href="/demo/">link</a>`html. Do not worry, you can still set ti
```md
[link](/demo ":disabled")
```
## Github Task Lists
```md
* [ ] foo
* bar
* [x] baz
* [] bam
* [ ] bim
* [ ] lim
```
* [ ] foo
* bar
* [x] baz
* [] bam
* [ ] bim
* [ ] lim
+22
View File
@@ -161,3 +161,25 @@ Disqus comments. https://disqus.com/
</script>
<script src="//unpkg.com/docsify/lib/plugins/disqus.min.js"></script>
```
## Gitalk
Gitalk is a modern comment component based on Github Issue and Preact. https://github.com/gitalk/gitalk
```html
<link rel="stylesheet" href="//unpkg.com/gitalk/dist/gitalk.css">
<script src="//unpkg.com/docsify/lib/plugins/gitalk.min.js"></script>
<script src="//unpkg.com/gitalk/dist/gitalk.min.js"></script>
<script>
const gitalk = new Gitalk({
clientID: 'Github Application Client ID',
clientSecret: 'Github Application Client Secret',
repo: 'Github repo',
owner: 'Github repo owner',
admin: ['Github repo collaborators, only these guys can initialize github issues'],
// facebook-like distraction free mode
distractionFreeMode: false
})
</script>
```
+4 -4
View File
@@ -329,7 +329,7 @@ window.$docsify = {
## format-updated
我们可以显示文档更新日期通过 **{docsify-updated<span>}</span>** 变量. 并且格式化日期通过 `formatUpdated`.
我们可以显示文档更新日期通过 **{docsify-updated<span>}</span>** 变量. 并且格式化日期通过 `formatUpdated`
参考 https://github.com/lukeed/tinydate#patterns
```js
window.$docsify = {
@@ -345,7 +345,7 @@ window.$docsify = {
## external-link-target
Currently it defaults to _blank, would be nice if configurable:
当前默认为 _blank, 配置一下就可以:
```js
window.$docsify = {
@@ -356,10 +356,10 @@ window.$docsify = {
## noCompileLinks
- type: `Array`
- 类型: `Array`
Sometimes we do not want docsify to handle our links. See [#203](https://github.com/QingWei-Li/docsify/issues/203)
有时我们不希望 docsify 处理我们的链接。 参考 [#203](https://github.com/QingWei-Li/docsify/issues/203)
```js
+3 -3
View File
@@ -18,9 +18,9 @@ GitHub Pages 支持从三个地方读取文件
## GitLab Pages
If you are deploying your master branch, include `.gitlab-ci.yml` with the following script:
如果你正在部署你的主分支, 在 `.gitlab-ci.yml` 中包含以下脚本:
?> The `.public` workaround is so `cp` doesn't also copy `public/` to itself in an infinite loop.
?> `.public` 的解决方法是这样的,`cp` 不会无限循环的将 `public/` 复制到自身。
``` YAML
pages:
@@ -36,7 +36,7 @@ pages:
- master
```
!> You can replace script with `- cp -r docs/. public`, if `./docs` is your Docsify subfolder.
!> 你可以用 `- cp -r docs/. public` 替换脚本, 如果 `./docs` 是你的 docsify 子文件夹。
## VPS
+26 -6
View File
@@ -25,23 +25,23 @@ docsify 扩展了一些 Markdown 语法,可以让文档更易读。
?> *TODO* 完善示例
## Ignore to compile link
## 忽略编译链接
Some time we will put some other relative path to the link, you have to need to tell docsify you don't need to compile this link. For example
有时候我们会把其他一些相对路径放到链接上,你必须告诉 docsify 你不需要编译这个链接。 例如:
```md
[link](/demo/)
```
It will be compiled to `<a href="/#/demo/">link</a>` and will be loaded `/demo/README.md`. Maybe you want to jump to `/demo/index.html`.
它将被编译为 `<a href="/#/demo/">link</a>` 并将加载 `/demo/README.md`. 可能你想跳转到 `/demo/index.html`
Now you can do that
现在你可以做到这一点
```md
[link](/demo/ ":ignore")
```
You will get `<a href="/demo/">link</a>`html. Do not worry, you can still set title for link.
即将会得到 `<a href="/demo/">link</a>` html 代码。不要担心,你仍然可以为链接设置标题。
```md
[link](/demo/ ":ignore title")
@@ -50,9 +50,29 @@ You will get `<a href="/demo/">link</a>`html. Do not worry, you can still set ti
```
## Set target attribute for link
## 设置链接的 target 属性
```md
[link](/demo ":target=_blank")
[link](/demo2 ":target=_self")
```
## Github 任务列表
```md
* [ ] foo
* bar
* [x] baz
* [] bam
* [ ] bim
* [ ] lim
```
* [ ] foo
* bar
* [x] baz
* [] bam
* [ ] bim
* [ ] lim
+1 -1
View File
@@ -30,7 +30,7 @@ window.$docsify = {
```
## Supports mermaid
## 支持 mermaid
```js
// Import mermaid
+6 -6
View File
@@ -63,25 +63,25 @@ docs/zh-cn/guide.md => http://domain.com/zh-cn/guide
<script src="//unpkg.com/docsify"></script>
```
## Ignoring Subheaders
## 忽略副标题
When `subMaxLevel` is set, each header is automatically added to the table of contents by default. If you want to ignore a specific header, add `{docsify-ignore}` to it.
当设置了 `subMaxLevel` 时,默认情况下每个标题都会自动添加到目录中。如果你想忽略特定的标题,可以给它添加 `{docsify-ignore}`
```markdown
# Getting Started
## Header {docsify-ignore}
This header won't appear in the sidebar table of contents.
该标题不会出现在侧边栏的目录中。
```
To ignore all headers on a specific page, you can use `{docsify-ignore-all}` on the first header of the page.
要忽略特定页面上的所有标题,你可以在页面的第一个标题上使用 `{docsify-ignore-all}`
```markdown
# Getting Started {docsify-ignore-all}
## Header
This header won't appear in the sidebar table of contents.
该标题不会出现在侧边栏的目录中。
```
Both `{docsify-ignore}` and `{docsify-ignore-all}` will not be rendered on the page when used.
在使用时, `{docsify-ignore}` `{docsify-ignore-all}` 都不会在页面上呈现。
+3 -3
View File
@@ -100,14 +100,14 @@ Medium's 风格的图片缩放插件. 基于 [medium-zoom](https://github.com/fr
## Edit on github
## 在 Github 上编辑
Add `Edit on github` button on every pages. provided by 3rd party, check [document](https://github.com/njleonzhang/docsify-edit-on-github)
在每一页上添加 `Edit on github` 按钮. 由第三方库提供, 查看 [document](https://github.com/njleonzhang/docsify-edit-on-github)
## CodeSponsor
See https://codesponsor.io
参考 https://codesponsor.io
```html
+10 -1
View File
@@ -2976,6 +2976,15 @@ Compiler.prototype._initRenderer = function _initRenderer () {
return ("<img src=\"" + url + "\"data-origin=\"" + href + "\" alt=\"" + text + "\"" + attrs + ">")
};
var CHECKED_RE = /^\[([ x])\] +/;
origin.listitem = renderer.listitem = function (text) {
var checked = CHECKED_RE.exec(text);
if (checked) {
text = text.replace(CHECKED_RE, ("<input type=\"checkbox\" " + (checked[1] === 'x' ? 'checked' : '') + " />"));
}
return ("<li" + (checked ? " class=\"task-list-item\"" : '') + ">" + text + "</li>\n")
};
renderer.origin = origin;
return renderer
@@ -4054,7 +4063,7 @@ initGlobalAPI();
/**
* Version
*/
Docsify.version = '4.5.1';
Docsify.version = '4.5.5';
/**
* Run Docsify
+1 -1
View File
File diff suppressed because one or more lines are too long
+4 -1
View File
@@ -1,7 +1,10 @@
(function () {
'use strict';
location.href = location.href.replace('/-/', '/#/');
var fixedPath = location.href.replace('/-/', '/#/');
if (fixedPath !== location.href) {
location.href = fixedPath;
}
function install (hook, vm) {
var dom = Docsify.dom;
+1 -1
View File
@@ -1 +1 @@
!function(){"use strict";function i(i,t){var e=Docsify.dom,o=t.config.disqus;if(!o)throw Error("$docsify.disqus is required");i.init(function(i){var t=e.create("script");t.async=!0,t.src="https://"+o+".disqus.com/embed.js",t.setAttribute("data-timestamp",+new Date),e.appendTo(e.body,t)}),i.mounted(function(i){var o=e.create("div");o.id="disqus_thread";var n=e.getNode("#main");o.style="width: "+n.clientWidth+"px; margin: 0 auto 20px;",e.appendTo(e.find(".content"),o),window.disqus_config=function(){this.page.url=location.origin+"/-"+t.route.path,this.page.identifier=t.route.path,this.page.title=document.title}}),i.doneEach(function(i){void 0!==window.DISQUS&&window.DISQUS.reset({reload:!0,config:function(){this.page.url=location.origin+"/-"+t.route.path,this.page.identifier=t.route.path,this.page.title=document.title}})})}location.href=location.href.replace("/-/","/#/"),$docsify.plugins=[].concat(i,$docsify.plugins)}();
!function(){"use strict";function i(i,t){var e=Docsify.dom,o=t.config.disqus;if(!o)throw Error("$docsify.disqus is required");i.init(function(i){var t=e.create("script");t.async=!0,t.src="https://"+o+".disqus.com/embed.js",t.setAttribute("data-timestamp",+new Date),e.appendTo(e.body,t)}),i.mounted(function(i){var o=e.create("div");o.id="disqus_thread";var n=e.getNode("#main");o.style="width: "+n.clientWidth+"px; margin: 0 auto 20px;",e.appendTo(e.find(".content"),o),window.disqus_config=function(){this.page.url=location.origin+"/-"+t.route.path,this.page.identifier=t.route.path,this.page.title=document.title}}),i.doneEach(function(i){void 0!==window.DISQUS&&window.DISQUS.reset({reload:!0,config:function(){this.page.url=location.origin+"/-"+t.route.path,this.page.identifier=t.route.path,this.page.title=document.title}})})}var t=location.href.replace("/-/","/#/");t!==location.href&&(location.href=t),$docsify.plugins=[].concat(i,$docsify.plugins)}();
+22
View File
@@ -0,0 +1,22 @@
(function () {
'use strict';
function install (hook, vm) {
var dom = Docsify.dom;
hook.mounted(function (_) {
var div = dom.create('div');
div.id = 'gitalk-container';
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);
});
}
$docsify.plugins = [].concat(install, $docsify.plugins);
}());
+1
View File
@@ -0,0 +1 @@
!function(){"use strict";function t(t,n){var i=Docsify.dom;t.mounted(function(t){var n=i.create("div");n.id="gitalk-container";var e=i.getNode("#main");n.style="width: "+e.clientWidth+"px; margin: 0 auto 20px;",i.appendTo(i.find(".content"),n);var o=i.create("script");o.textContent="gitalk.render('gitalk-container')",i.appendTo(i.body,o)})}$docsify.plugins=[].concat(t,$docsify.plugins)}();
+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
@@ -1,6 +1,6 @@
{
"name": "docsify",
"version": "4.5.1",
"version": "4.5.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "docsify",
"version": "4.5.1",
"version": "4.5.5",
"description": "A magical documentation generator.",
"author": {
"name": "qingwei-li",
+1 -1
View File
@@ -37,5 +37,5 @@
"integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ="
}
},
"version": "4.5.1"
"version": "4.5.5"
}
@@ -1,6 +1,6 @@
{
"name": "docsify-server-renderer",
"version": "4.5.1",
"version": "4.5.5",
"description": "docsify server renderer",
"author": {
"name": "qingwei-li",
+9
View File
@@ -175,6 +175,15 @@ export class Compiler {
return `<img src="${url}"data-origin="${href}" alt="${text}"${attrs}>`
}
const CHECKED_RE = /^\[([ x])\] +/
origin.listitem = renderer.listitem = function (text) {
const checked = CHECKED_RE.exec(text)
if (checked) {
text = text.replace(CHECKED_RE, `<input type="checkbox" ${checked[1] === 'x' ? 'checked' : ''} />`)
}
return `<li${checked ? ` class="task-list-item"` : ''}>${text}</li>\n`
}
renderer.origin = origin
return renderer
+4 -1
View File
@@ -1,4 +1,7 @@
location.href = location.href.replace('/-/', '/#/')
const fixedPath = location.href.replace('/-/', '/#/')
if (fixedPath !== location.href) {
location.href = fixedPath
}
function install (hook, vm) {
const dom = Docsify.dom
+17
View File
@@ -0,0 +1,17 @@
function install (hook, vm) {
const dom = Docsify.dom
hook.mounted(_ => {
const div = dom.create('div')
div.id = 'gitalk-container'
const main = dom.getNode('#main')
div.style = `width: ${main.clientWidth}px; margin: 0 auto 20px;`
dom.appendTo(dom.find('.content'), div)
const script = dom.create('script')
const content = `gitalk.render('gitalk-container')`
script.textContent = content
dom.appendTo(dom.body, script)
})
}
$docsify.plugins = [].concat(install, $docsify.plugins)
+9
View File
@@ -91,6 +91,15 @@ kbd {
vertical-align: middle;
}
.task-list-item {
list-style-type: none;
}
li input[type=checkbox] {
margin: 0 0.2em 0.25em -1.6em;
vertical-align: middle;
}
/* navbar */
.app-nav {
left: 0;
+1 -3
View File
@@ -100,9 +100,7 @@ body {
}
.markdown-section figure,
.markdown-section p,
.markdown-section ul,
.markdown-section ol {
.markdown-section p {
margin: 1.2em 0;
}