mirror of
https://github.com/wahyd4/docsify.git
synced 2026-08-09 21:36:10 +10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ff8fb2c60 | ||
|
|
9b858fc4c4 | ||
|
|
3aef37a445 | ||
|
|
37daa7ef9c | ||
|
|
b0da9f23d3 |
@@ -1,4 +1,8 @@
|
||||
|
||||
# 3.4.2 / 2017-03-11
|
||||
|
||||
* feat(emojify): add no-emoji option
|
||||
|
||||
# 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)
|
||||
|
||||
@@ -295,3 +295,13 @@ window.$docsify = {
|
||||
```
|
||||
|
||||
Note that if you are running an external script, e.g. an embedded jsfiddle demo, make sure to include the [external-script](plugins?id=external-script) plugin.
|
||||
|
||||
## no-emoji
|
||||
|
||||
Disabled emoji parse.
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
noEmoji: true
|
||||
}
|
||||
```
|
||||
|
||||
+5
-1
@@ -61,6 +61,10 @@ You can manually initialize a Vue instance.
|
||||
*index.html*
|
||||
|
||||
```html
|
||||
<!-- inject css file -->
|
||||
<link rel="stylesheet" href="//unpkg.com/vuep/dist/vuep.css">
|
||||
|
||||
<!-- inject javascript file -->
|
||||
<script src="//unpkg.com/vue"></script>
|
||||
<script src="//unpkg.com/vuep"></script>
|
||||
<script src="//unpkg.com/docsify"></script>
|
||||
@@ -77,7 +81,7 @@ You can manually initialize a Vue instance.
|
||||
|
||||
<vuep template="#example"></vuep>
|
||||
|
||||
<script type="text/x-template" id="example">
|
||||
<script v-pre type="text/x-template" id="example">
|
||||
<template>
|
||||
<div>Hello, {{ name }}!</div>
|
||||
</template>
|
||||
|
||||
@@ -305,3 +305,13 @@ window.$docsify = {
|
||||
```
|
||||
|
||||
注意如果执行的是一个外链脚本,比如 jsfiddle 的内嵌 demo,请确保引入 [external-script](zh-cn/plugins?id=外链脚本-external-script) 插件。
|
||||
|
||||
## no-emoji
|
||||
|
||||
禁用 emoji 解析。
|
||||
|
||||
```js
|
||||
window.$docsify = {
|
||||
noEmoji: true
|
||||
}
|
||||
```
|
||||
|
||||
+26
-1
@@ -58,9 +58,18 @@
|
||||
*index.html*
|
||||
|
||||
```html
|
||||
<!-- inject css file -->
|
||||
<link rel="stylesheet" href="//unpkg.com/vuep/dist/vuep.css">
|
||||
|
||||
<!-- inject javascript file -->
|
||||
<script src="//unpkg.com/vue"></script>
|
||||
<script src="//unpkg.com/vuep"></script>
|
||||
<script src="//unpkg.com/docsify"></script>
|
||||
|
||||
<!-- or use the compressed files -->
|
||||
<script src="//unpkg.com/vue/dist/vue.min.js"></script>
|
||||
<script src="//unpkg.com/vuep/dist/vuep.min.js"></script>
|
||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||
```
|
||||
|
||||
*README.md*
|
||||
@@ -69,7 +78,7 @@
|
||||
|
||||
<vuep template="#example"></vuep>
|
||||
|
||||
<script type="text/x-template" id="example">
|
||||
<script v-pre type="text/x-template" id="example">
|
||||
<template>
|
||||
<div>Hello, {{ name }}!</div>
|
||||
</template>
|
||||
@@ -84,4 +93,20 @@
|
||||
</script>
|
||||
```
|
||||
|
||||
<vuep template="#example"></vuep>
|
||||
|
||||
<script v-pre type="text/x-template" id="example">
|
||||
<template>
|
||||
<div>Hello, {{ name }}!</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data: function () {
|
||||
return { name: 'Vue' }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
?> 具体效果参考 [Vuep 文档](https://qingwei-li.github.io/vuep/)。
|
||||
|
||||
+2
-1
@@ -75,6 +75,7 @@ var config = merge({
|
||||
nameLink: window.location.pathname,
|
||||
autoHeader: false,
|
||||
executeScript: null,
|
||||
noEmoji: false,
|
||||
ga: ''
|
||||
}, window.$docsify);
|
||||
|
||||
@@ -2938,7 +2939,7 @@ function replace (m, $1) {
|
||||
}
|
||||
|
||||
function emojify (text) {
|
||||
return text
|
||||
return $docsify.noEmoji ? text : text
|
||||
.replace(/<(pre|template|code)[^>]*?>[\s\S]+?<\/(pre|template|code)>/g, function (m) { return m.replace(/:/g, '__colon__'); })
|
||||
.replace(/:(\w+?):/ig, window.emojify || replace)
|
||||
.replace(/__colon__/g, ':')
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify",
|
||||
"version": "3.4.1",
|
||||
"version": "3.4.2",
|
||||
"description": "A magical documentation generator.",
|
||||
"main": "lib/docsify.js",
|
||||
"files": [
|
||||
|
||||
@@ -16,6 +16,7 @@ const config = merge({
|
||||
nameLink: window.location.pathname,
|
||||
autoHeader: false,
|
||||
executeScript: null,
|
||||
noEmoji: false,
|
||||
ga: ''
|
||||
}, window.$docsify)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ function replace (m, $1) {
|
||||
}
|
||||
|
||||
export function emojify (text) {
|
||||
return text
|
||||
return $docsify.noEmoji ? text : text
|
||||
.replace(/<(pre|template|code)[^>]*?>[\s\S]+?<\/(pre|template|code)>/g, m => m.replace(/:/g, '__colon__'))
|
||||
.replace(/:(\w+?):/ig, window.emojify || replace)
|
||||
.replace(/__colon__/g, ':')
|
||||
|
||||
Reference in New Issue
Block a user