Compare commits

..
18 Commits
Author SHA1 Message Date
qingwei.li 2c277b8f79 -> v3.6.3 2017-04-25 12:41:29 +08:00
qingwei.li a5f6ccd1d1 bump: 3.6.3 2017-04-25 12:41:16 +08:00
qingwei.li 11c94b2149 changelog 3.6.3 2017-04-25 12:41:02 +08:00
qingwei.li 2653849a3e fix(external-script): script attrs 2017-04-25 12:39:58 +08:00
qingwei.li d7b0d1b949 docs: update cdn 2017-04-25 12:13:56 +08:00
Frances Coronelandcinwell.li 6911fb879b Add hire-me to showcase section 2017-04-21 08:14:22 +08:00
Kiko Beatsandcinwell.li 137a93c7b2 Add JS MythBusters to showcase (#148) 2017-04-17 20:32:38 +08:00
qingwei.li 5d5caa1f89 -> v3.6.2 2017-04-12 23:53:18 +08:00
qingwei.li 1dfd6cdcfe docs: add changelog 2017-04-12 23:53:11 +08:00
qingwei.li 91c6db2902 bump: 3.6.2 2017-04-12 23:52:25 +08:00
qingwei.li 94d6603c06 feat(external-script): detect more than one script dom, fixed #146 2017-04-12 23:51:16 +08:00
qingwei.li 920f624b5c -> v3.6.1 2017-04-12 23:46:46 +08:00
qingwei.li 8fb1350728 bump: 3.6.1 2017-04-12 23:46:46 +08:00
Mehdy Daraandcinwell.li c1df94662a GA: Send hash instead of complete href (#147)
On https://docsify.js.org/#/quickstart

send "#/quickstart" instead of "https://docsify.js.org/#/quickstart"
2017-04-12 23:45:58 +08:00
qingwei.li 9b7e5f5814 feat(event): Collapse the sidebar when click outside element in the small screen 2017-04-09 12:44:23 +08:00
qingwei.li 432bcfb54b -> v3.6.0 2017-04-09 12:12:32 +08:00
qingwei.li 4f98497284 bump: 3.6.0 2017-04-09 12:12:21 +08:00
cinwell.liandGitHub 9220523a40 feat(render): add mergeNavbar option, close #125, #124 (#145) 2017-04-09 12:10:37 +08:00
31 changed files with 191 additions and 99 deletions
+40 -21
View File
@@ -1,105 +1,124 @@
# 3.5.2/ 2017-04-05
# Changelog
## 3.6.3 / 2017-04-25
* fix(external-script): script attrs
## 3.6.2/ 2017-04-12
* feat(external-script): detect more than one script dom, fixed #146
* GA: Send hash instead of complete href (#147)
## 3.6.1 / 2017-04-09
* feat(event): Collapse the sidebar when click outside element in the small screen
## 3.6.0 / 2017-04-09
* feat(render): add mergeNavbar option, close ([#125](https://github.com/QingWei-Li/docsify/issues/125)
## 3.5.2/ 2017-04-05
* add optional current route param to toURL and use it to properly compose local anchor links
* fix code style by removing semicolons
* in toURL test for anchor links and if so prepend the currentPath to the generated path. fixes ([#142](https://github.com/QingWei-Li/docsify/issues/142))
# 3.5.1 / 2017-03-25
## 3.5.1 / 2017-03-25
* fix: .md file extension regex
# 3.5.0 / 2017-03-25
## 3.5.0 / 2017-03-25
* feat(route): auto remove .md extension
* fix: adjust display on small screens [@jrappen](https://github.com/jrappen)
* fix: navbar labels for German [@jrappen](https://github.com/jrappen)
# 3.4.4 / 2017-03-17
## 3.4.4 / 2017-03-17
* fix(search): fix input style
* fix search plugin match bug
# 3.4.3 / 2017-03-16
## 3.4.3 / 2017-03-16
* Add ability to ignore headers when generating toc ([#127](https://github.com/QingWei-Li/docsify/issues/127) [@christopherwk210](https://github.com/christopherwk210))
* fix external-script not inserting script at right place [@Leopoldthecoder](https://github.com/Leopoldthecoder)
* add German docs [@jrappen](https://github.com/jrappen)
# 3.4.2 / 2017-03-11
## 3.4.2 / 2017-03-11
* feat(emojify): add no-emoji option
# 3.4.1 / 2017-03-10
## 3.4.1 / 2017-03-10
* fix(dom): Disable the dom cache when vue is present, fixed [#119](https://github.com/QingWei-Li/docsify/issues/119)
* update english docs, [@jrappen](https://github.com/jrappen)
# 3.4.0 / 2017-03-09
## 3.4.0 / 2017-03-09
* feat(zoom-image): add plugin
# 3.3.0 / 2017-03-07
## 3.3.0 / 2017-03-07
* add front-matter plugin
* add external-script plugin, [@Leopoldthecoder](https://github.com/Leopoldthecoder)
* Fix nav showing while loading ([#112](https://github.com/QingWei-Li/docsify/issues/112))
# 3.2.0 / 2017-02-28
## 3.2.0 / 2017-02-28
* fix(render): Toc rendering error, fixed [#106](https://github.com/QingWei-Li/docsify/issues/106)
* feat(search): Localization for no data tip, close [#103](https://github.com/QingWei-Li/docsify/issues/103)
* fix(fetch): load sidebar and navbar for parent path, fixed [#100](https://github.com/QingWei-Li/docsify/issues/100)
* feat(render) nameLink for each route, fixed [#99](https://github.com/QingWei-Li/docsify/issues/99)
# 3.1.2 / 2017-02-27
## 3.1.2 / 2017-02-27
* fix(search): dont search nameLink, fixed [#102](https://github.com/QingWei-Li/docsify/issues/102)
# 3.1.1 / 2017-02-24
## 3.1.1 / 2017-02-24
* fix(search): dont search nameLink, fixed [#102](https://github.com/QingWei-Li/docsify/issues/102)
* fix(render): custom cover background image
* fix(tpl): extra character, fixed [#101](https://github.com/QingWei-Li/docsify/issues/101)
# 3.1.0 / 2017-02-22
## 3.1.0 / 2017-02-22
* fix(search): incorrect anchor link, fixed [#90](https://github.com/QingWei-Li/docsify/issues/90)
* feat(emoji): add emoji plugin
# 3.0.5 / 2017-02-21
## 3.0.5 / 2017-02-21
* feat(pwa): add sw.js
* fix(layout.css): loading style
* fix(event): highlight sidebar when clicked, fixed [#86](https://github.com/QingWei-Li/docsify/issues/86)
* fix(gen-tree): cache toc list, fixed [#88](https://github.com/QingWei-Li/docsify/issues/88)
# 3.0.4 / 2017-02-20
## 3.0.4 / 2017-02-20
* fix(render): execute script
* fix(render): disable rendering sub list when loadSidebar is false
# 3.0.3 / 2017-02-19
## 3.0.3 / 2017-02-19
* fixed look of links in blockquote
* fix(scroll) highlight bug
# 3.0.2 / 2017-02-19
## 3.0.2 / 2017-02-19
* fix(search): add lazy input
* fix(compiler): link
# 3.0.1 / 2017-02-19
## 3.0.1 / 2017-02-19
* fix(route): empty alias
# 3.0.0 / 2017-02-19
## 3.0.0 / 2017-02-19
#### Breaking change
##### Breaking change
* Not support IE9
* The route becomes: `/#/page?id=slug`. The previous route will be redirected
#### Features
##### Features
* Faster rendering
* Clearer source code
+2
View File
@@ -64,6 +64,8 @@ These open-source projects are using docsify to generate their sites. Pull reque
| [Vudash](http://vudash.github.io/vudash/) | Powerful, Flexible, Open Source dashboards for anything |
| [Trilogy](http://trilogy.js.org) | No-hassle SQLite with a Promise-based, document store style API. |
| [Mybatis-Plus](http://mp.baomidou.com/) | An enhanced toolkit of Mybatis to simplify development |
| [JS MythBusters](https://mythbusters.js.org) | An optimization handbook from a high level point of view. |
| [hire-me](https://fvcproductions.github.io/hire-me) | A path to getting an awesome tech gig. |
## Similar projects
+2 -1
View File
@@ -29,7 +29,8 @@
loadNavbar: true,
loadSidebar: true,
name: 'docsify',
subMaxLevel: 2
subMaxLevel: 2,
mergeNavbar: true
}
</script>
<script src="/lib/docsify.js"></script>
+1 -1
View File
@@ -1,6 +1,6 @@
![logo](_media/icon.svg)
# docsify <small>3.5</small>
# docsify <small>3.6</small>
> A magical documentation site generator.
+4 -4
View File
@@ -1,4 +1,4 @@
- :uk:
- [:cn: 中文](/zh-cn/)
- [:de: Deutsch](/de-de/)
- [:uk: English](/)
- Translations
- [:cn: 中文](/zh-cn/)
- [:de: Deutsch](/de-de/)
- [:uk: English](/)
+4 -1
View File
@@ -44,4 +44,7 @@ Alternatively, use [compressed files](#compressed-files).
## Other CDN
[jsDelivr](http://www.jsdelivr.com/projects/docsify) is available.
- http://www.bootcdn.cn/docsify
- http://www.jsdelivr.com/projects/docsify
- https://cdnjs.com/libraries/docsify
+10
View File
@@ -305,3 +305,13 @@ window.$docsify = {
noEmoji: true
}
```
## merge-navbar
Navbar will be merged with the sidebar on smaller screens.
```js
window.$docsify = {
mergeNavbar: true
}
```
-4
View File
@@ -1,4 +0,0 @@
- :de:
- [:cn: 中文](/zh-cn/)
- [:de: Deutsch](/de-de/)
- [:uk: English](/)
+3 -1
View File
@@ -44,4 +44,6 @@ Alternativ kannst du auch die [komprimierten Dateien](#komprimierte-dateien) ver
## Andere CDN
[jsDelivr](http://www.jsdelivr.com/projects/docsify) ist auch verfügbar.
- http://www.bootcdn.cn/docsify
- http://www.jsdelivr.com/projects/docsify
- https://cdnjs.com/libraries/docsify
+10
View File
@@ -305,3 +305,13 @@ window.$docsify = {
noEmoji: true
}
```
## merge-navbar
Navbar will be merged with the sidebar on smaller screens.
```js
window.$docsify = {
mergeNavbar: true
}
```
+1
View File
@@ -32,6 +32,7 @@
executeScript: true,
loadSidebar: true,
loadNavbar: true,
mergeNavbar: true,
maxLevel: 4,
name: 'docsify',
search: {
-4
View File
@@ -1,4 +0,0 @@
- :cn:
- [:cn: 中文](/zh-cn/)
- [:de: Deutsch](/de-de/)
- [:uk: English](/)
+3 -2
View File
@@ -44,5 +44,6 @@ JS 的压缩文件是原有文件路径的基础上加 `.min`后缀
## 其他 CDN
[jsDelivr](http://www.jsdelivr.com/projects/docsify) 也是可用的,具体用法参考其文档。
- http://www.bootcdn.cn/docsify
- http://www.jsdelivr.com/projects/docsify
- https://cdnjs.com/libraries/docsify
+11
View File
@@ -315,3 +315,14 @@ window.$docsify = {
noEmoji: true
}
```
## merge-navbar
小屏设备下合并导航栏到侧边栏。
```js
window.$docsify = {
mergeNavbar: true
}
```
+24 -13
View File
@@ -76,7 +76,8 @@ var config = merge({
autoHeader: false,
executeScript: null,
noEmoji: false,
ga: ''
ga: '',
mergeNavbar: false
}, window.$docsify);
var script = document.currentScript ||
@@ -415,17 +416,20 @@ var title = $.title;
* Toggle button
*/
function btn (el) {
var toggle = function () { return body.classList.toggle('close'); };
var toggle = function (_) { return body.classList.toggle('close'); };
el = getNode(el);
on(el, 'click', toggle);
on(el, 'click', function (e) {
e.stopPropagation();
toggle();
});
var sidebar = getNode('.sidebar');
on(sidebar, 'click', function () {
isMobile && toggle();
setTimeout(function () { return getAndActive(sidebar, true, true); }, 0);
});
isMobile && on(body, 'click', function (_) { return body.classList.contains('close') && toggle(); }
);
on(sidebar, 'click', function (_) { return setTimeout((function (_) { return getAndActive(sidebar, true, true); }, 0)); }
);
}
function sticky () {
@@ -3263,12 +3267,8 @@ function initRender (vm) {
var el = find(id);
var html = '';
var navAppendToTarget = body;
navEl.classList.add('app-nav');
if (!config.repo) {
navEl.classList.add('no-badge');
}
if (!el) {
el = create(id);
appendTo(body, el);
@@ -3283,8 +3283,19 @@ function initRender (vm) {
html += main(config);
// Render main app
vm._renderTo(el, html, true);
if (config.mergeNavbar && isMobile) {
navAppendToTarget = find('.sidebar');
} else {
navEl.classList.add('app-nav');
if (!config.repo) {
navEl.classList.add('no-badge');
}
}
// Add nav
before(body, navEl);
before(navAppendToTarget, navEl);
if (config.themeColor) {
$.head.innerHTML += theme(config.themeColor);
+2 -2
View File
File diff suppressed because one or more lines are too long
+13 -7
View File
@@ -4,15 +4,21 @@ this.D = this.D || {};
function handleExternalScript () {
var container = Docsify.dom.getNode('#main');
var script = Docsify.dom.find(container, 'script');
var scripts = Docsify.dom.findAll(container, 'script');
if (script && script.src) {
var newScript = document.createElement('script');['src', 'async', 'defer'].forEach(function (attribute) {
newScript[attribute] = script[attribute];
});
for (var i = scripts.length; i--;) {
var script = scripts[i];
script.parentNode.insertBefore(newScript, script);
script.parentNode.removeChild(script);
if (script && script.src) {
var newScript = document.createElement('script');
Array.prototype.slice.call(script.attributes).forEach(function (attribute) {
newScript[attribute.name] = attribute.value;
});
script.parentNode.insertBefore(newScript, script);
script.parentNode.removeChild(script);
}
}
}
+1 -1
View File
@@ -1 +1 @@
this.D=this.D||{},function(){"use strict";function i(){var i=Docsify.dom.getNode("#main"),n=Docsify.dom.find(i,"script");if(n&&n.src){var o=document.createElement("script");["src","async","defer"].forEach(function(i){o[i]=n[i]}),n.parentNode.insertBefore(o,n),n.parentNode.removeChild(n)}}var n=function(n){n.doneEach(i)};window.$docsify.plugins=[].concat(n,window.$docsify.plugins)}();
this.D=this.D||{},function(){"use strict";function e(){for(var e=Docsify.dom.getNode("#main"),i=Docsify.dom.findAll(e,"script"),o=i.length;o--;){var t=i[o];if(t&&t.src){var n=document.createElement("script");Array.prototype.slice.call(t.attributes).forEach(function(e){n[e.name]=e.value}),t.parentNode.insertBefore(n,t),t.parentNode.removeChild(t)}}}var i=function(i){i.doneEach(e)};window.$docsify.plugins=[].concat(i,window.$docsify.plugins)}();
+1 -1
View File
@@ -23,7 +23,7 @@ function init (id) {
function collect () {
init(window.$docsify.ga);
window.ga('set', 'page', location.href);
window.ga('set', 'page', location.hash);
window.ga('send', 'pageview');
}
+1 -1
View File
@@ -1 +1 @@
this.D=this.D||{},function(){"use strict";function n(){var n=document.createElement("script");n.async=!0,n.src="https://www.google-analytics.com/analytics.js",document.body.appendChild(n)}function o(o){window.ga||(n(),window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=Number(new Date),window.ga("create",o,"auto"))}function i(){o(window.$docsify.ga),window.ga("set","page",location.href),window.ga("send","pageview")}var w=function(n){return window.$docsify.ga?void n.beforeEach(i):void console.error("[Docsify] ga is required.")};window.$docsify.plugins=[].concat(w,window.$docsify.plugins)}();
this.D=this.D||{},function(){"use strict";function n(){var n=document.createElement("script");n.async=!0,n.src="https://www.google-analytics.com/analytics.js",document.body.appendChild(n)}function o(o){window.ga||(n(),window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=Number(new Date),window.ga("create",o,"auto"))}function i(){o(window.$docsify.ga),window.ga("set","page",location.hash),window.ga("send","pageview")}var w=function(n){return window.$docsify.ga?void n.beforeEach(i):void console.error("[Docsify] ga is required.")};window.$docsify.plugins=[].concat(w,window.$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": "3.5.2",
"version": "3.6.3",
"description": "A magical documentation generator.",
"author": {
"name": "qingwei-li",
+2 -1
View File
@@ -17,7 +17,8 @@ const config = merge({
autoHeader: false,
executeScript: null,
noEmoji: false,
ga: ''
ga: '',
mergeNavbar: false
}, window.$docsify)
const script = document.currentScript ||
+11 -6
View File
@@ -7,17 +7,22 @@ const title = dom.$.title
* Toggle button
*/
export function btn (el) {
const toggle = () => dom.body.classList.toggle('close')
const toggle = _ => dom.body.classList.toggle('close')
el = dom.getNode(el)
dom.on(el, 'click', toggle)
dom.on(el, 'click', e => {
e.stopPropagation()
toggle()
})
const sidebar = dom.getNode('.sidebar')
dom.on(sidebar, 'click', () => {
isMobile && toggle()
setTimeout(() => getAndActive(sidebar, true, true), 0)
})
isMobile && dom.on(dom.body, 'click', _ =>
dom.body.classList.contains('close') && toggle()
)
dom.on(sidebar, 'click', _ =>
setTimeout((_ => getAndActive(sidebar, true, true), 0))
)
}
export function sticky () {
+14 -6
View File
@@ -7,6 +7,7 @@ import { markdown, sidebar, subSidebar, cover } from './compiler'
import { callHook } from '../init/lifecycle'
import { getBasePath, getPath, isAbsolutePath } from '../route/util'
import { isPrimitive } from '../util/core'
import { isMobile } from '../util/env'
function executeScript () {
const script = dom.findAll('.markdown-section>script')
@@ -153,12 +154,8 @@ export function initRender (vm) {
let el = dom.find(id)
let html = ''
let navAppendToTarget = dom.body
navEl.classList.add('app-nav')
if (!config.repo) {
navEl.classList.add('no-badge')
}
if (!el) {
el = dom.create(id)
dom.appendTo(dom.body, el)
@@ -173,8 +170,19 @@ export function initRender (vm) {
html += tpl.main(config)
// Render main app
vm._renderTo(el, html, true)
if (config.mergeNavbar && isMobile) {
navAppendToTarget = dom.find('.sidebar')
} else {
navEl.classList.add('app-nav')
if (!config.repo) {
navEl.classList.add('no-badge')
}
}
// Add nav
dom.before(dom.body, navEl)
dom.before(navAppendToTarget, navEl)
if (config.themeColor) {
dom.$.head.innerHTML += tpl.theme(config.themeColor)
+12 -8
View File
@@ -1,16 +1,20 @@
function handleExternalScript () {
const container = Docsify.dom.getNode('#main')
const script = Docsify.dom.find(container, 'script')
const scripts = Docsify.dom.findAll(container, 'script')
if (script && script.src) {
const newScript = document.createElement('script')
for (let i = scripts.length; i--;) {
const script = scripts[i]
;['src', 'async', 'defer'].forEach(attribute => {
newScript[attribute] = script[attribute]
})
if (script && script.src) {
const newScript = document.createElement('script')
script.parentNode.insertBefore(newScript, script)
script.parentNode.removeChild(script)
Array.prototype.slice.call(script.attributes).forEach(attribute => {
newScript[attribute.name] = attribute.value
})
script.parentNode.insertBefore(newScript, script)
script.parentNode.removeChild(script)
}
}
}
+1 -1
View File
@@ -19,7 +19,7 @@ function init (id) {
function collect () {
init(window.$docsify.ga)
window.ga('set', 'page', location.href)
window.ga('set', 'page', location.hash)
window.ga('send', 'pageview')
}
+13 -8
View File
@@ -10,7 +10,7 @@
body:not(.ready) {
overflow: hidden;
[data-cloak], nav {
[data-cloak], .app-nav {
display: none;
}
}
@@ -83,7 +83,7 @@ kbd {
}
/* navbar */
nav.app-nav {
.app-nav {
left: 0;
margin: 25px 60px 0 0;
position: absolute;
@@ -238,6 +238,11 @@ main {
color: inherit;
text-decoration: none;
}
.app-nav {
display: block;
position: static;
}
}
ul {
@@ -325,7 +330,7 @@ body.sticky {
.markdown-section {
margin: 0 auto;
max-width: 800px;
padding: 20px 15px 40px 15px;
padding: 30px 15px 40px 15px;
position: relative;
> * {
@@ -430,7 +435,7 @@ body.close {
display: none;
}
nav {
.app-nav {
display: none;
}
}
@@ -440,11 +445,11 @@ body.close {
position: fixed;
}
nav {
.app-nav {
margin-top: 16px;
}
nav li ul {
.app-nav li ul {
top: 30px;
}
@@ -465,7 +470,7 @@ body.close {
transition: transform 250ms ease;
}
nav, .github-corner {
.app-nav, .github-corner {
transition: transform 250ms ease-out;
}
@@ -489,7 +494,7 @@ body.close {
transform: translateX($sidebar-width);
}
nav, .github-corner {
.app-nav, .github-corner {
display: none;
}
}