Skip to content

Commit e566e9c

Browse files
authored
Merge branch 'develop' into prepare-script
2 parents efbea24 + 4f48679 commit e566e9c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+10484
-5781
lines changed

.eslintrc

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"extends": "xo-space/browser",
33
"rules": {
4-
"semi": [2, "never"],
4+
"semi": [
5+
2,
6+
"never"
7+
],
58
"no-return-assign": "off",
69
"no-unused-expressions": "off",
710
"no-new-func": "off",
@@ -10,11 +13,22 @@
1013
"max-params": "off",
1114
"no-script-url": "off",
1215
"camelcase": "off",
13-
"no-warning-comments": "off"
16+
"object-curly-spacing": "off",
17+
"no-warning-comments": "off",
18+
"no-negated-condition": "off",
19+
"eqeqeq": "warn",
20+
"no-eq-null": "warn",
21+
"max-statements-per-line": "warn"
1422
},
1523
"globals": {
1624
"Docsify": true,
1725
"$docsify": true,
1826
"process": true
27+
},
28+
"env": {
29+
"browser": true,
30+
"amd": true,
31+
"node": true,
32+
"jest": true
1933
}
20-
}
34+
}

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
open_collective: docsify
2+

.github/workflows/CI.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Testing the e2e test suites
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
pull_request:
9+
branches:
10+
- master
11+
- develop
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
node-version: [8.x, 10.x, 12.x]
19+
20+
steps:
21+
- uses: actions/checkout@v1
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
- name: bootstrap
27+
run: npm run bootstrap
28+
- name: Build
29+
run: npm run build
30+
- name: linting
31+
run: npm run lint
32+
- name: end to end
33+
run: npm run test:e2e

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
sudo: false
22
language: node_js
33
node_js: stable
4+
5+
script:
6+
- npm run lint

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"prettier.eslintIntegration": true
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.formatOnSave": true
34
}

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## [4.10.2](https://github.com/docsifyjs/docsify/compare/v4.10.0...v4.10.2) (2019-12-16)
2+
3+
4+
5+
# [4.10.0](https://github.com/docsifyjs/docsify/compare/v4.9.4...v4.10.0) (2019-12-16)
6+
7+
8+
### Bug Fixes
9+
10+
* fixed security alert for chokidar(update dep) ([a62b037](https://github.com/docsifyjs/docsify/commit/a62b037becb36941c11c8eab6e4d83df8db85af3))
11+
* npm audit issues ([#934](https://github.com/docsifyjs/docsify/issues/934)) ([615205c](https://github.com/docsifyjs/docsify/commit/615205cfdb7aea8f37a1ec5dd928105eeef56357))
12+
* package security alerts ([f5f1561](https://github.com/docsifyjs/docsify/commit/f5f15619f1a239d6ce12a2f83ad8817352a3352b))
13+
* security alerts of cssnano ([d7d5c8f](https://github.com/docsifyjs/docsify/commit/d7d5c8f302d7c18dbb32e982202a07b73badf6f6))
14+
15+
16+
117
<a name="4.9.4"></a>
218
## [4.9.4](https://github.com/docsifyjs/docsify/compare/v4.9.2...v4.9.4) (2019-05-05)
319

build/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const rollup = require('rollup')
22
const buble = require('rollup-plugin-buble')
33
const commonjs = require('rollup-plugin-commonjs')
44
const nodeResolve = require('rollup-plugin-node-resolve')
5-
const uglify = require('rollup-plugin-uglify')
5+
const { uglify } = require('rollup-plugin-uglify')
66
const replace = require('rollup-plugin-replace')
77
const isProd = process.env.NODE_ENV === 'production'
88
const version = process.env.VERSION || require('../package.json').version

build/css.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
const fs = require('fs')
2+
const path = require('path')
3+
const {spawn} = require('child_process')
4+
5+
const args = process.argv.slice(2)
6+
fs.readdir(path.join(__dirname, '../src/themes'), (err, files) => {
7+
if (err) {
8+
console.log('err', err)
9+
return
10+
}
11+
files.map(async (file) => {
12+
if (/\.styl/g.test(file)) {
13+
var stylusCMD;
14+
const stylusBin = ['node_modules', 'stylus', 'bin', 'stylus'].join(path.sep)
15+
var cmdargs = [
16+
stylusBin,
17+
`src/themes/${file}`,
18+
'-u',
19+
'autoprefixer-stylus'
20+
]
21+
cmdargs = cmdargs.concat(args)
22+
23+
stylusCMD = spawn('node', cmdargs, { shell: true })
24+
25+
stylusCMD.stdout.on('data', (data) => {
26+
console.log(`[Stylus Build ] stdout: ${data}`);
27+
});
28+
29+
stylusCMD.stderr.on('data', (data) => {
30+
console.error(`[Stylus Build ] stderr: ${data}`);
31+
});
32+
33+
stylusCMD.on('close', (code) => {
34+
console.log(`[Stylus Build ] child process exited with code ${code}`);
35+
});
36+
} else {
37+
return
38+
}
39+
40+
})
41+
})

build/release.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ echo
1212
if [[ $REPLY =~ ^[Yy]$ ]]; then
1313
echo "Releasing $VERSION ..."
1414

15-
npm run test
15+
# Removing test script as non - availibity of tests. Will Add it once tests are completed
16+
17+
# npm run test
1618

1719
# build
1820
VERSION=$VERSION npm run build

docs/_coverpage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![logo](_media/icon.svg)
22

3-
# docsify <small>4.9.4</small>
3+
# docsify <small>4.10.2</small>
44

55
> A magical documentation site generator.
66

docs/_media/example.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ const PORT = 8080
55

66
/// [demo]
77
const result = fetch(`${URL}:${PORT}`)
8-
.then(function(response) {
9-
return response.json();
8+
.then(function (response) {
9+
return response.json()
10+
})
11+
.then(function (myJson) {
12+
console.log(JSON.stringify(myJson))
1013
})
11-
.then(function(myJson) {
12-
console.log(JSON.stringify(myJson));
13-
});
1414
/// [demo]
1515

1616
result.then(console.log).catch(console.error)

docs/configuration.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,14 @@ window.$docsify = {
239239
};
240240
```
241241

242+
The name field can also contain custom HTML for easier customization:
243+
244+
```js
245+
window.$docsify = {
246+
name: '<span>docsify</span>'
247+
};
248+
```
249+
242250
## nameLink
243251

244252
- Type: `String`
@@ -397,14 +405,40 @@ window.$docsify = {
397405
- type: `String`
398406
- default: `_blank`
399407

400-
Target to open external links. Default `'_blank'` (new window/tab)
408+
Target to open external links inside the markdown. Default `'_blank'` (new window/tab)
401409

402410
```js
403411
window.$docsify = {
404412
externalLinkTarget: '_self' // default: '_blank'
405413
};
406414
```
407415

416+
## cornerExternalLinkTarget
417+
418+
- type:`String`
419+
- default:`_blank`
420+
421+
Target to open external link at the top right corner. Default `'_blank'` (new window/tab)
422+
423+
```js
424+
window.$docsify = {
425+
cornerExternalLinkTarget: '_self' // default: '_blank'
426+
};
427+
```
428+
429+
## externalLinkRel
430+
431+
- type: `String`
432+
- default: `noopener`
433+
434+
Default `'noopener'` (no opener) prevents the newly opened external page (when [externalLinkTarget](#externallinktarget) is `'_blank'`) from having the ability to control our page. No `rel` is set when its not `'_blank'`.
435+
436+
```js
437+
window.$docsify = {
438+
externalLinkTarget: '' // default: 'noopener'
439+
};
440+
```
441+
408442
## routerMode
409443

410444
- type: `String`
@@ -454,6 +488,18 @@ window.$docsify = {
454488
};
455489
```
456490

491+
Such as setting the cache
492+
493+
```js
494+
window.$docsify = {
495+
requestHeaders: {
496+
'cache-control': 'max-age=600'
497+
}
498+
};
499+
```
500+
501+
502+
457503
## ext
458504

459505
- type: `String`

docs/deploy.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,18 @@ server {
8282

8383
### HTML5 router
8484

85-
When using the HTML5 router, you need to set up redirect rules that redirect all requests to your `index.html`, it's pretty simple when you're using Netlify, populate a `\redirects` file in the docs directory and you're all set:
85+
When using the HTML5 router, you need to set up redirect rules that redirect all requests to your `index.html`, it's pretty simple when you're using Netlify, create a file named `_redirects` in the docs directory, add this snippet to the file and you're all set:
8686

8787
```sh
8888
/* /index.html 200
8989
```
9090

91+
## ZEIT Now
92+
93+
1. Install [Now CLI](https://zeit.co/download), `npm i -g now`
94+
2. Change directory to your docsify website, for example `cd docs`
95+
3. Deploy with a single command, `now`
96+
9197
## AWS Amplify
9298

9399
1. Set the routerMode in the Docsify project `index.html` to *history* mode.
@@ -122,10 +128,10 @@ frontend:
122128
123129
```
124130

125-
6. Add the following Redirect rules in their displayed order.
131+
6. Add the following Redirect rules in their displayed order. Note that the second record is a PNG image where you can change it with any image format you are using.
126132

127133
| Source address | Target address | Type |
128134
|----------------|----------------|---------------|
129135
| /<*>.md | /<*>.md | 200 (Rewrite) |
136+
| /<*>.png | /<*>.png | 200 (Rewrite) |
130137
| /<*> | /index.html | 200 (Rewrite) |
131-

docs/more-pages.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Matching routes
1818

1919
```text
2020
docs/README.md => http://domain.com
21-
docs/guide.md => http://domain.com/guide
22-
docs/zh-cn/README.md => http://domain.com/zh-cn/
23-
docs/zh-cn/guide.md => http://domain.com/zh-cn/guide
21+
docs/guide.md => http://domain.com/#/guide
22+
docs/zh-cn/README.md => http://domain.com/#/zh-cn/
23+
docs/zh-cn/guide.md => http://domain.com/#/zh-cn/guide
2424
```
2525

2626
## Sidebar

docs/themes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Themes
22

3-
There are currently three themes available. Copy [Vue](//vuejs.org) and [buble](//buble.surge.sh) website custom theme and [@liril-net](https://github.com/liril-net) contribution to the theme of the black style.
3+
There is a handful of themes available, both official and community-made. Copy [Vue](//vuejs.org) and [buble](//buble.surge.sh) website custom theme and [@liril-net](https://github.com/liril-net) contribution to the theme of the black style.
44

55
```html
66
<link rel="stylesheet" href="//unpkg.com/docsify/themes/vue.css">

0 commit comments

Comments
 (0)