Compare commits

...
9 Commits
Author SHA1 Message Date
qingwei.li 168d8475d5 -> v2.0.3 2017-02-07 20:18:28 +08:00
qingwei.li 7ba434e61d bump: 2.0.3 2017-02-07 20:18:25 +08:00
qingwei.li 8cd386ae49 fix: css var polyfill 2017-02-07 20:17:54 +08:00
qingwei.li 8c7e4d7866 fix: rendering emojis 2017-02-07 20:17:12 +08:00
qingwei.li cbaee21ded fix: css var polyfill 2017-02-07 19:54:09 +08:00
qingwei.li 543cbbce81 -> v2.0.2 2017-02-05 14:50:09 +08:00
qingwei.li 72c34152d4 bump: 2.0.2 2017-02-05 14:50:04 +08:00
qingwei.li 44708554f7 fix: button style in cover page 2017-02-05 14:48:57 +08:00
qingwei.li 6e35f6481a docs: update api 2017-02-05 13:53:36 +08:00
13 changed files with 47 additions and 29 deletions
+10
View File
@@ -1,3 +1,13 @@
## 2.0.3
### Bug fixes
- fix: rendering emojis
- fix: css var polyfill
## 2.0.2
### Bug fixes
- fix button style in cover page.
## 2.0.1
### Bug fixes
- border style.
+2 -2
View File
@@ -381,7 +381,7 @@ window.$docsify = {
```
### basePath
### base-path
If your HTML entry file and the markdown files are in different directories, we can use:
@@ -430,7 +430,7 @@ window.$docsify = {
}
```
### nameLink
### name-link
Name link. The default value is `window.location.pathname`.
+1 -1
View File
@@ -1,6 +1,6 @@
![logo](_media/icon.svg)
# docsify <small>2.0.1</small>
# docsify <small>2.0.3</small>
> A magical documentation site generator.
+3 -3
View File
@@ -387,7 +387,7 @@ window.$docsify = {
}
```
### basePath
### base-path
指定加载文档的路径,如果你的 HTML 入口文件和文档是放在不同地方,你可以设置:
@@ -438,7 +438,7 @@ window.$docsify = {
}
```
### nameLink
### name-link
项目名链接,默认为 `window.location.pathname`
@@ -452,7 +452,7 @@ window.$docsify = {
}
```
### themeColor
### theme-color
自定义主题色。
+12 -8
View File
@@ -170,6 +170,7 @@ var merge = Object.assign || function (to) {
function emojify (text) {
return text
.replace(/<(pre|template)[^>]*?>([\s\S]+)<\/(pre|template)>/g, function (match) { return match.replace(/:/g, '__colon__'); })
.replace(/:(\w*?):/ig, '<img class="emoji" src="https://assets-cdn.github.com/images/icons/emoji/$1.png" alt="$1" />')
.replace(/__colon__/g, ':')
}
@@ -2509,14 +2510,17 @@ function cssVars () {
if (block.nodeName === 'STYLE') {
replaceVar(block);
} else if (block.nodeName === 'LINK') {
load(block.getAttribute('href'))
.then(function (res) {
var style = document.createElement('style');
var href = block.getAttribute('href');
style.innerHTML = res;
document.head.appendChild(style);
replaceVar(style);
});
if (!/\.css$/.test(href)) { return }
load(href).then(function (res) {
var style = document.createElement('style');
style.innerHTML = res;
document.head.appendChild(style);
replaceVar(style);
});
}
});
}
@@ -2557,7 +2561,7 @@ function init () {
var hl = prism.highlight(code, prism.languages[lang] || prism.languages.markup);
return ("<pre v-pre data-lang=\"" + lang + "\"><code class=\"lang-" + lang + "\">" + (hl.replace(/:/g, '__colon__')) + "</code></pre>")
return ("<pre v-pre data-lang=\"" + lang + "\"><code class=\"lang-" + lang + "\">" + hl + "</code></pre>")
};
renderer.link = function (href, title, text) {
if (!/:/.test(href)) {
+2 -2
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": "2.0.1",
"version": "2.0.3",
"description": "A magical documentation generator.",
"main": "lib/docsify.js",
"files": [
+10 -7
View File
@@ -14,14 +14,17 @@ export function cssVars () {
if (block.nodeName === 'STYLE') {
replaceVar(block)
} else if (block.nodeName === 'LINK') {
load(block.getAttribute('href'))
.then(res => {
const style = document.createElement('style')
const href = block.getAttribute('href')
style.innerHTML = res
document.head.appendChild(style)
replaceVar(style)
})
if (!/\.css$/.test(href)) return
load(href).then(res => {
const style = document.createElement('style')
style.innerHTML = res
document.head.appendChild(style)
replaceVar(style)
})
}
})
}
+1 -1
View File
@@ -39,7 +39,7 @@ export function init () {
renderer.code = function (code, lang = '') {
const hl = Prism.highlight(code, Prism.languages[lang] || Prism.languages.markup)
return `<pre v-pre data-lang="${lang}"><code class="lang-${lang}">${hl.replace(/:/g, '__colon__')}</code></pre>`
return `<pre v-pre data-lang="${lang}"><code class="lang-${lang}">${hl}</code></pre>`
}
renderer.link = function (href, title, text) {
if (!/:/.test(href)) {
+2 -2
View File
@@ -73,8 +73,8 @@ section.cover {
.cover-main p:last-child a {
border-radius: 2em;
border-width: 1px;
border-style: solid;
border-width: var(--theme-color, $color-primary);
border-style: solid;
border-color: var(--theme-color, $color-primary);
box-sizing: border-box;
color: var(--theme-color, $color-primary);
font-size: 1.05em;
+1
View File
@@ -160,6 +160,7 @@ export const merge = Object.assign || function (to) {
export function emojify (text) {
return text
.replace(/<(pre|template)[^>]*?>([\s\S]+)<\/(pre|template)>/g, match => match.replace(/:/g, '__colon__'))
.replace(/:(\w*?):/ig, '<img class="emoji" src="https://assets-cdn.github.com/images/icons/emoji/$1.png" alt="$1" />')
.replace(/__colon__/g, ':')
}