Compare commits

..
24 Commits
Author SHA1 Message Date
qingwei.li 318189a13f [release] 4.1.6 2017-05-30 16:18:24 +08:00
qingwei.li 42795a0483 [build] 4.1.6 2017-05-30 16:18:23 +08:00
qingwei.li 6b9e0922cf fix(ssr): add debug 2017-05-30 16:16:36 +08:00
qingwei.li 8cb4189b96 update docs 2017-05-30 15:41:34 +08:00
qingwei.li 7eb6346075 [release] 4.1.5 2017-05-30 15:38:44 +08:00
qingwei.li 238e9633f9 [build] 4.1.5 2017-05-30 15:38:44 +08:00
qingwei.li 6db8c9e6c9 fix(ssr): missing package 2017-05-30 15:34:48 +08:00
qingwei.li e160bcaded [release] 4.1.4 2017-05-30 15:28:58 +08:00
qingwei.li 8cf69754b5 [build] 4.1.4 2017-05-30 15:28:58 +08:00
qingwei.li 79a83bc17d fix(ssr): file path 2017-05-30 15:27:04 +08:00
qingwei.li 81c87f7926 update readme 2017-05-30 14:01:06 +08:00
qingwei.li 67ec128315 [release] 4.1.3 2017-05-30 13:58:28 +08:00
qingwei.li 77657e3b64 [build] 4.1.3 2017-05-30 13:58:28 +08:00
qingwei.li 9825db47af fix: update babel config 2017-05-30 13:58:05 +08:00
qingwei.li 1a5593889e [release] 4.1.2 2017-05-30 13:38:44 +08:00
qingwei.li fc9cdf37c5 [build] 4.1.2 2017-05-30 13:38:44 +08:00
qingwei.li 80dba191d3 fix: update babel config 2017-05-30 13:38:20 +08:00
qingwei.li 5a0c37fcd3 [release] 4.1.1 2017-05-30 13:15:13 +08:00
qingwei.li 1462efedcd [build] 4.1.1 2017-05-30 13:15:13 +08:00
qingwei.li 4cb20a5f9d fix: build for ssr package 2017-05-30 13:13:41 +08:00
qingwei.li 490c8a19d3 docs(ssr): update sidebar 2017-05-30 12:55:09 +08:00
qingwei.li 4b838247ea change: update 2017-05-30 12:52:52 +08:00
qingwei.li b091f3f10d docs(ssr): update 2017-05-30 12:36:23 +08:00
qingwei.li 0e74e6c15e fix: remove history mode 2017-05-30 12:16:26 +08:00
15 changed files with 47 additions and 28 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
# Changelog
## 4.1.0 / 2017-05-30
## 4.1.0 / 2017-05-30 🎂 for me
* feat: Support server client renderer [See detail](//docsify.js.org/#/ssr)
+1
View File
@@ -27,6 +27,7 @@
- Multiple themes
- Useful plugin API
- Compatible with IE10+
- Support SSR
## Quick start
+7 -1
View File
@@ -1,4 +1,5 @@
var rollup = require('rollup')
var buble = require('rollup-plugin-buble')
var async = require('rollup-plugin-async')
var isProd = process.argv[process.argv.length - 1] !== '--dev'
@@ -6,7 +7,12 @@ rollup
.rollup({
entry: 'packages/docsify-server-renderer/index.js',
plugins: [
async()
async(),
buble({
transforms: {
generator: false
}
})
],
onwarn: function() {}
})
+1 -1
View File
@@ -18,6 +18,6 @@
- [Vue compatibility](vue.md)
- [CDN](cdn.md)
- [Offline Mode(PWA)](pwa.md)
- [(Server-client renderer(SSR)](ssr.md)
- [Server-client renderer(SSR)](ssr.md)
- [Changelog](changelog.md)
+6 -3
View File
@@ -15,13 +15,13 @@ npm i now -g
npm i docsify-cli -D
```
Edit `package.json`. If the documentation in `./docs` subdirectory.
Edit `package.json`. If the documentation in `./docs` subdirectory.
```json
{
"name": "my-project",
"scripts": {
"start": "docsify start docs"
"start": "docsify start ."
},
"files": [
"docs"
@@ -38,6 +38,9 @@ Edit `package.json`. If the documentation in `./docs` subdirectory.
}
```
Remove `index.html`
!> The `basePath` just like webpack `publicPath`. You should config it if your docs is in the subdirectory.
We can preview in the local to see if it works.
@@ -91,7 +94,7 @@ You can configure it in a special config file, or `package.json`.
```js
module.exports = {
tempate: './ssr.html',
template: './ssr.html',
config: {
// docsify config
}
+2 -4
View File
@@ -36,8 +36,6 @@
maxLevel: 4,
subMaxLevel: 2,
name: 'docsify',
// basePath: '/docs/',
routerMode: 'history',
search: {
noData: {
'/de-de/': 'Keine Ergebnisse!',
@@ -61,8 +59,8 @@
]
}
</script>
<script src="//unpkg.com/docsify@next/lib/docsify.min.js"></script>
<script src="//unpkg.com/docsify@next/lib/plugins/search.min.js"></script>
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-markdown.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>
+6 -6
View File
@@ -7,10 +7,10 @@
<meta name="keywords" content="doc,docs,documentation,gitbook,creator,generator,github,jekyll,github-pages">
<meta name="description" content="A magical documentation generator.">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="/themes/vue.css" title="vue">
<!-- <link rel="stylesheet" href="//unpkg.com/docsify@next/lib/themes/dark.css" title="dark" disabled> -->
<!-- <link rel="stylesheet" href="//unpkg.com/docsify@next/lib/themes/buble.css" title="buble" disabled> -->
<!-- <link rel="stylesheet" href="//unpkg.com/docsify@next/lib/themes/pure.css" title="pure" disabled> -->
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css" title="vue">
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/dark.css" title="dark" disabled>
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/buble.css" title="buble" disabled>
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/pure.css" title="pure" disabled>
<style>
nav.app-nav li ul {
min-width: 100px;
@@ -21,8 +21,8 @@
<!--inject-app-->
<!--inject-config-->
</body>
<script src="/lib/docsify.js"></script>
<!-- <script src="/lib/plugins/search.js"></script> -->
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-markdown.min.js"></script>
<script src="//unpkg.com/prismjs/components/prism-nginx.min.js"></script>
+4 -2
View File
@@ -21,7 +21,7 @@ Edit `package.json`. If the documentation in `./docs` subdirectory.
{
"name": "my-project",
"scripts": {
"start": "docsify start docs"
"start": "docsify start ."
},
"files": [
"docs"
@@ -38,6 +38,8 @@ Edit `package.json`. If the documentation in `./docs` subdirectory.
}
```
Remove `index.html`
!> The `basePath` just like webpack `publicPath`. You should config it if your docs is in the subdirectory.
We can preview in the local to see if it works.
@@ -91,7 +93,7 @@ You can configure it in a special config file, or `package.json`.
```js
module.exports = {
tempate: './ssr.html',
template: './ssr.html',
config: {
// docsify config
}
+6 -3
View File
@@ -15,13 +15,13 @@ npm i now -g
npm i docsify-cli -D
```
Edit `package.json`. If the documentation in `./docs` subdirectory.
2. Edit `package.json`. If the documentation in `./docs` subdirectory.
```json
{
"name": "my-project",
"scripts": {
"start": "docsify start docs"
"start": "docsify start ."
},
"files": [
"docs"
@@ -38,6 +38,9 @@ Edit `package.json`. If the documentation in `./docs` subdirectory.
}
```
Remove `index.html`
!> The `basePath` just like webpack `publicPath`. You should config it if your docs is in the subdirectory.
We can preview in the local to see if it works.
@@ -91,7 +94,7 @@ You can configure it in a special config file, or `package.json`.
```js
module.exports = {
tempate: './ssr.html',
template: './ssr.html',
config: {
// docsify config
}
+1 -1
View File
@@ -2741,7 +2741,7 @@ function getPath () {
}
var isAbsolutePath = cached(function (path) {
return /(:|(\/{2}))/.test(path)
return /(:|(\/{2}))/g.test(path)
});
var getParentPath = cached(function (path) {
+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.1.0",
"version": "4.1.6",
"description": "A magical documentation generator.",
"author": {
"name": "qingwei-li",
+5 -1
View File
@@ -5,6 +5,8 @@ import { Compiler } from '../../src/core/render/compiler'
import { isAbsolutePath } from '../../src/core/router/util'
import { readFileSync } from 'fs'
import { resolve, basename } from 'path'
import resolvePathname from 'resolve-pathname'
import debug from 'debug'
function cwd (...args) {
return resolve(process.cwd(), ...args)
@@ -111,10 +113,12 @@ export default class Renderer {
}
async _loadFile (filePath) {
debug('docsify')(`load > ${filePath}`)
let content
try {
if (isAbsolutePath(filePath)) {
const res = await fetch(filePath)
if (!res.ok) throw Error()
content = await res.text()
this.lock = 0
} else {
@@ -131,7 +135,7 @@ export default class Renderer {
const fileName = basename(filePath)
return await this._loadFile(cwd(filePath, '../..', fileName))
return await this._loadFile(resolvePathname(`../${fileName}`, filePath))
}
}
}
@@ -1,6 +1,6 @@
{
"name": "docsify-server-renderer",
"version": "4.1.0",
"version": "4.1.6",
"description": "docsify server renderer",
"author": {
"name": "qingwei-li",
@@ -15,6 +15,8 @@
"test": "echo 'hello'"
},
"dependencies": {
"node-fetch": "^1.7.0"
"debug": "^2.6.8",
"node-fetch": "^1.7.0",
"resolve-pathname": "^2.1.0"
}
}
+1 -1
View File
@@ -36,7 +36,7 @@ export function getPath (...args) {
}
export const isAbsolutePath = cached(path => {
return /(:|(\/{2}))/.test(path)
return /(:|(\/{2}))/g.test(path)
})
export const getParentPath = cached(path => {