Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b4098d338 | ||
|
|
d44a517a88 | ||
|
|
4419611238 | ||
|
|
0e54ea1177 | ||
|
|
a213f98cb0 | ||
|
|
07f6edc9ca | ||
|
|
e566e9c6e7 | ||
|
|
efbea24de7 | ||
|
|
4f486798df | ||
|
|
b3eced395a | ||
|
|
336908f721 | ||
|
|
45d0c3af80 | ||
|
|
7fb50b95f1 | ||
|
|
db97a1d22a | ||
|
|
157973c509 | ||
|
|
67a981b8d9 | ||
|
|
d60fb7da7b | ||
|
|
7d0c164bf5 | ||
|
|
5b77b0f628 | ||
|
|
8416275e25 | ||
|
|
808123bc30 | ||
|
|
daf54b9d36 | ||
|
|
eea41a1207 | ||
|
|
3cd03d480d | ||
|
|
9a90b9b927 | ||
|
|
75919f1235 | ||
|
|
b0b3de0a66 | ||
|
|
589a5732d3 | ||
|
|
b62b213435 | ||
|
|
a59328719b | ||
|
|
4a8f2c5bfa | ||
|
|
79f8211a45 | ||
|
|
68327c5c9a | ||
|
|
1622578045 | ||
|
|
c403318ac6 | ||
|
|
8bf4b06d3a | ||
|
|
378d7bb492 | ||
|
|
11762cbb73 | ||
|
|
8f496d84ce | ||
|
|
98525c4a2d | ||
|
|
e61410a757 | ||
|
|
745e5ffa54 | ||
|
|
8d5787eabe | ||
|
|
dd9e5f98e0 | ||
|
|
229a63c2e8 | ||
|
|
5b575441e9 | ||
|
|
0bd4f05034 | ||
|
|
cc3f30b582 | ||
|
|
64e460aaed | ||
|
|
52fcc6f081 | ||
|
|
3f53b7166e | ||
|
|
d9ec246508 | ||
|
|
7b871006e6 | ||
|
|
5a6289d504 | ||
|
|
a62b037bec | ||
|
|
d7d5c8f302 | ||
|
|
f5f15619f1 | ||
|
|
236c9a29b4 | ||
|
|
b95f8d2884 | ||
|
|
79a54b462b | ||
|
|
6b8773fbb0 | ||
|
|
8ea7e32e14 | ||
|
|
83f9b01852 | ||
|
|
8454889f63 | ||
|
|
77c3fc8bcd | ||
|
|
615205cfdb | ||
|
|
c6fde53f91 | ||
|
|
4769018e26 | ||
|
|
84384eeab3 | ||
|
|
1d3246a26f | ||
|
|
8ea4865c84 | ||
|
|
12d80f64c9 | ||
|
|
2fb5a1128e | ||
|
|
c78f2117e3 | ||
|
|
e8dc5229de | ||
|
|
7a838d1b24 | ||
|
|
f8f46108dd | ||
|
|
669f243a7a | ||
|
|
11bbd4cd27 | ||
|
|
76825a7b55 | ||
|
|
72763398c3 | ||
|
|
fd4a42c3b5 | ||
|
|
25e3cac66a | ||
|
|
6162eb234d | ||
|
|
cb3f4865e2 | ||
|
|
80d5ac061f | ||
|
|
0515b4d925 | ||
|
|
b95c254f81 | ||
|
|
5a75bf6cb6 | ||
|
|
2671d189fb | ||
|
|
6e6b4e1b66 | ||
|
|
676f84cffa | ||
|
|
7bdcadc7d7 | ||
|
|
5bd24fb83c | ||
|
|
76cc0f672b | ||
|
|
3f50381090 | ||
|
|
b847c20cab | ||
|
|
ce829b24d6 | ||
|
|
1ce53cf9ec | ||
|
|
bc1d8e4bda | ||
|
|
78f5564a30 | ||
|
|
6cc069cb9f |
@@ -2,4 +2,6 @@
|
|||||||
packages/docsify-server-renderer/build.js
|
packages/docsify-server-renderer/build.js
|
||||||
node_modules
|
node_modules
|
||||||
build
|
build
|
||||||
server.js
|
server.js
|
||||||
|
cypress
|
||||||
|
lib
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
{
|
{
|
||||||
"extends": "xo-space/browser",
|
"extends": "xo-space/browser",
|
||||||
"rules": {
|
"rules": {
|
||||||
"semi": [2, "never"],
|
"semi": [
|
||||||
|
2,
|
||||||
|
"never"
|
||||||
|
],
|
||||||
"no-return-assign": "off",
|
"no-return-assign": "off",
|
||||||
"no-unused-expressions": "off",
|
"no-unused-expressions": "off",
|
||||||
"no-new-func": "off",
|
"no-new-func": "off",
|
||||||
@@ -10,11 +13,22 @@
|
|||||||
"max-params": "off",
|
"max-params": "off",
|
||||||
"no-script-url": "off",
|
"no-script-url": "off",
|
||||||
"camelcase": "off",
|
"camelcase": "off",
|
||||||
"no-warning-comments": "off"
|
"object-curly-spacing": "off",
|
||||||
|
"no-warning-comments": "off",
|
||||||
|
"no-negated-condition": "off",
|
||||||
|
"eqeqeq": "warn",
|
||||||
|
"no-eq-null": "warn",
|
||||||
|
"max-statements-per-line": "warn"
|
||||||
},
|
},
|
||||||
"globals": {
|
"globals": {
|
||||||
"Docsify": true,
|
"Docsify": true,
|
||||||
"$docsify": true,
|
"$docsify": true,
|
||||||
"process": true
|
"process": true
|
||||||
|
},
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"amd": true,
|
||||||
|
"node": true,
|
||||||
|
"jest": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
open_collective: docsify
|
||||||
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Number of days of inactivity before an issue becomes stale
|
||||||
|
daysUntilStale: 60
|
||||||
|
# Number of days of inactivity before a stale issue is closed
|
||||||
|
daysUntilClose: 7
|
||||||
|
# Issues with these labels will never be considered stale
|
||||||
|
exemptLabels:
|
||||||
|
- pinned
|
||||||
|
- security
|
||||||
|
- On hold
|
||||||
|
# Label to use when marking an issue as stale
|
||||||
|
staleLabel: wontfix
|
||||||
|
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||||
|
markComment: >
|
||||||
|
This issue has been automatically marked as stale because it has not had
|
||||||
|
recent activity. It will be closed if no further activity occurs. Thank you
|
||||||
|
for your contributions.
|
||||||
|
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||||
|
closeComment: false
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
name: Testing the e2e test suites
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- develop
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- develop
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-16.04
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [10.x, 12.x, 13.x]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
- name: bootstrap
|
||||||
|
run: npm run bootstrap
|
||||||
|
- name: Build
|
||||||
|
run: npm run build
|
||||||
|
- name: linting
|
||||||
|
run: npm run lint
|
||||||
|
- name: end to end
|
||||||
|
run: npm run test:e2e
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
*.log
|
*.log
|
||||||
.DS_Store
|
.DS_Store
|
||||||
/themes/*
|
.idea
|
||||||
!.gitkeep
|
|
||||||
node_modules
|
node_modules
|
||||||
/lib/
|
themes/
|
||||||
.idea
|
lib/
|
||||||
|
cypress/integration/examples
|
||||||
|
cypress/fixtures/docs
|
||||||
|
|
||||||
|
# exceptions
|
||||||
|
!.gitkeep
|
||||||
@@ -1,3 +1,23 @@
|
|||||||
sudo: false
|
sudo: false
|
||||||
language: node_js
|
language: node_js
|
||||||
node_js: stable
|
node_js: stable
|
||||||
|
node_js:
|
||||||
|
- '10'
|
||||||
|
- '8'
|
||||||
|
- '12'
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
- develop
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- node_modules
|
||||||
|
before_install:
|
||||||
|
- npm update
|
||||||
|
install:
|
||||||
|
- npm install
|
||||||
|
script:
|
||||||
|
- npm run build
|
||||||
|
- npm run test:e2e
|
||||||
|
script:
|
||||||
|
- npm run lint
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{
|
{
|
||||||
"prettier.eslintIntegration": true
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
|
"editor.formatOnSave": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
## [4.10.2](https://github.com/docsifyjs/docsify/compare/v4.10.0...v4.10.2) (2019-12-16)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [4.10.0](https://github.com/docsifyjs/docsify/compare/v4.9.4...v4.10.0) (2019-12-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fixed security alert for chokidar(update dep) ([a62b037](https://github.com/docsifyjs/docsify/commit/a62b037becb36941c11c8eab6e4d83df8db85af3))
|
||||||
|
* npm audit issues ([#934](https://github.com/docsifyjs/docsify/issues/934)) ([615205c](https://github.com/docsifyjs/docsify/commit/615205cfdb7aea8f37a1ec5dd928105eeef56357))
|
||||||
|
* package security alerts ([f5f1561](https://github.com/docsifyjs/docsify/commit/f5f15619f1a239d6ce12a2f83ad8817352a3352b))
|
||||||
|
* security alerts of cssnano ([d7d5c8f](https://github.com/docsifyjs/docsify/commit/d7d5c8f302d7c18dbb32e982202a07b73badf6f6))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="4.9.4"></a>
|
||||||
|
## [4.9.4](https://github.com/docsifyjs/docsify/compare/v4.9.2...v4.9.4) (2019-05-05)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="4.9.2"></a>
|
<a name="4.9.2"></a>
|
||||||
## [4.9.2](https://github.com/docsifyjs/docsify/compare/v4.9.1...v4.9.2) (2019-04-21)
|
## [4.9.2](https://github.com/docsifyjs/docsify/compare/v4.9.1...v4.9.2) (2019-04-21)
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ Look at [this tutorial](https://docsify.js.org/#/quickstart)
|
|||||||
|
|
||||||
These projects are using docsify to generate their sites. Pull requests welcome :blush:
|
These projects are using docsify to generate their sites. Pull requests welcome :blush:
|
||||||
|
|
||||||
Move to [awesome-docsify](https://github.com/docsifyjs/awesome-docsify)
|
Move to [awesome-docsify](https://github.com/docsifyjs/awesome-docsify#showcase)
|
||||||
|
|
||||||
## Similar projects
|
## Similar projects
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ const rollup = require('rollup')
|
|||||||
const buble = require('rollup-plugin-buble')
|
const buble = require('rollup-plugin-buble')
|
||||||
const commonjs = require('rollup-plugin-commonjs')
|
const commonjs = require('rollup-plugin-commonjs')
|
||||||
const nodeResolve = require('rollup-plugin-node-resolve')
|
const nodeResolve = require('rollup-plugin-node-resolve')
|
||||||
const uglify = require('rollup-plugin-uglify')
|
const { uglify } = require('rollup-plugin-uglify')
|
||||||
const replace = require('rollup-plugin-replace')
|
const replace = require('rollup-plugin-replace')
|
||||||
const isProd = process.env.NODE_ENV === 'production'
|
const isProd = process.env.NODE_ENV === 'production'
|
||||||
const version = process.env.VERSION || require('../package.json').version
|
const version = process.env.VERSION || require('../package.json').version
|
||||||
@@ -55,6 +55,7 @@ const buildAllPlugin = function () {
|
|||||||
var plugins = [
|
var plugins = [
|
||||||
{name: 'search', input: 'search/index.js'},
|
{name: 'search', input: 'search/index.js'},
|
||||||
{name: 'ga', input: 'ga.js'},
|
{name: 'ga', input: 'ga.js'},
|
||||||
|
{name: 'matomo', input: 'matomo.js'},
|
||||||
{name: 'emoji', input: 'emoji.js'},
|
{name: 'emoji', input: 'emoji.js'},
|
||||||
{name: 'external-script', input: 'external-script.js'},
|
{name: 'external-script', input: 'external-script.js'},
|
||||||
{name: 'front-matter', input: 'front-matter/index.js'},
|
{name: 'front-matter', input: 'front-matter/index.js'},
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
const fs = require('fs')
|
||||||
|
const path = require('path')
|
||||||
|
const {spawn} = require('child_process')
|
||||||
|
|
||||||
|
const args = process.argv.slice(2)
|
||||||
|
fs.readdir(path.join(__dirname, '../src/themes'), (err, files) => {
|
||||||
|
if (err) {
|
||||||
|
console.log('err', err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
files.map(async (file) => {
|
||||||
|
if (/\.styl/g.test(file)) {
|
||||||
|
var stylusCMD;
|
||||||
|
const stylusBin = ['node_modules', 'stylus', 'bin', 'stylus'].join(path.sep)
|
||||||
|
var cmdargs = [
|
||||||
|
stylusBin,
|
||||||
|
`src/themes/${file}`,
|
||||||
|
'-u',
|
||||||
|
'autoprefixer-stylus'
|
||||||
|
]
|
||||||
|
cmdargs = cmdargs.concat(args)
|
||||||
|
|
||||||
|
stylusCMD = spawn('node', cmdargs, { shell: true })
|
||||||
|
|
||||||
|
stylusCMD.stdout.on('data', (data) => {
|
||||||
|
console.log(`[Stylus Build ] stdout: ${data}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
stylusCMD.stderr.on('data', (data) => {
|
||||||
|
console.error(`[Stylus Build ] stderr: ${data}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
stylusCMD.on('close', (code) => {
|
||||||
|
console.log(`[Stylus Build ] child process exited with code ${code}`);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -12,7 +12,9 @@ echo
|
|||||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||||
echo "Releasing $VERSION ..."
|
echo "Releasing $VERSION ..."
|
||||||
|
|
||||||
npm run test
|
# Removing test script as non - availibity of tests. Will Add it once tests are completed
|
||||||
|
|
||||||
|
# npm run test
|
||||||
|
|
||||||
# build
|
# build
|
||||||
VERSION=$VERSION npm run build
|
VERSION=$VERSION npm run build
|
||||||
@@ -29,7 +31,6 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|||||||
|
|
||||||
# commit
|
# commit
|
||||||
git add -A
|
git add -A
|
||||||
git add -f lib/ -A
|
|
||||||
git commit -m "[build] $VERSION $RELEASE_TAG"
|
git commit -m "[build] $VERSION $RELEASE_TAG"
|
||||||
npm --no-git-tag-version version $VERSION --message "[release] $VERSION $RELEASE_TAG"
|
npm --no-git-tag-version version $VERSION --message "[release] $VERSION $RELEASE_TAG"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"video": false
|
||||||
|
}
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<title>docsify-e2e-tests</title>
|
||||||
|
<link rel="icon" href="_media/favicon.ico" />
|
||||||
|
<meta
|
||||||
|
name="google-site-verification"
|
||||||
|
content="6t0LoIeFksrjF4c9sqUEsVXiQNxLp2hgoqo0KryT-sE"
|
||||||
|
/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||||
|
<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="lib/themes/vue.css" title="vue" />
|
||||||
|
<link rel="stylesheet" href="lib/themes/dark.css" title="dark" disabled />
|
||||||
|
<link rel="stylesheet" href="lib/themes/buble.css" title="buble" disabled />
|
||||||
|
<link rel="stylesheet" href="lib/themes/pure.css" title="pure" disabled />
|
||||||
|
<script src="//unpkg.com/docsify-plugin-codefund/index.js"></script>
|
||||||
|
<style>
|
||||||
|
nav.app-nav li ul {
|
||||||
|
min-width: 100px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="app">Loading Docsify e2e tests suite...</div>
|
||||||
|
<script>
|
||||||
|
window.$docsify = {
|
||||||
|
alias: {
|
||||||
|
'.*?/awesome':
|
||||||
|
'https://raw.githubusercontent.com/docsifyjs/awesome-docsify/master/README.md',
|
||||||
|
'.*?/changelog':
|
||||||
|
'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG.md',
|
||||||
|
'/.*/_navbar.md': '/_navbar.md',
|
||||||
|
'/zh-cn/(.*)':
|
||||||
|
'https://raw.githubusercontent.com/docsifyjs/docs-zh/master/$1',
|
||||||
|
'/de-de/(.*)':
|
||||||
|
'https://raw.githubusercontent.com/docsifyjs/docs-de/master/$1',
|
||||||
|
'/ru/(.*)':
|
||||||
|
'https://raw.githubusercontent.com/docsifyjs/docs-ru/master/$1',
|
||||||
|
'/es/(.*)':
|
||||||
|
'https://raw.githubusercontent.com/docsifyjs/docs-es/master/$1'
|
||||||
|
},
|
||||||
|
auto2top: true,
|
||||||
|
coverpage: true,
|
||||||
|
executeScript: true,
|
||||||
|
loadSidebar: true,
|
||||||
|
loadNavbar: true,
|
||||||
|
mergeNavbar: true,
|
||||||
|
maxLevel: 4,
|
||||||
|
subMaxLevel: 2,
|
||||||
|
ga: 'UA-106147152-1',
|
||||||
|
matomo: {
|
||||||
|
host: '//matomo.thunderwave.de',
|
||||||
|
id: 6
|
||||||
|
},
|
||||||
|
name: 'docsify',
|
||||||
|
search: {
|
||||||
|
noData: {
|
||||||
|
'/de-de/': 'Keine Ergebnisse!',
|
||||||
|
'/zh-cn/': '没有结果!',
|
||||||
|
'/': 'No results!'
|
||||||
|
},
|
||||||
|
paths: 'auto',
|
||||||
|
placeholder: {
|
||||||
|
'/de-de/': 'Suche',
|
||||||
|
'/zh-cn/': '搜索',
|
||||||
|
'/': 'Search'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
formatUpdated: '{MM}/{DD} {HH}:{mm}',
|
||||||
|
plugins: [
|
||||||
|
function(hook, vm) {
|
||||||
|
hook.beforeEach(function(html) {
|
||||||
|
if (/githubusercontent\.com/.test(vm.route.file)) {
|
||||||
|
url = vm.route.file
|
||||||
|
.replace('raw.githubusercontent.com', 'github.com')
|
||||||
|
.replace(/\/master/, '/blob/master')
|
||||||
|
} else {
|
||||||
|
url =
|
||||||
|
'https://github.com/docsifyjs/docsify/blob/master/docs/' +
|
||||||
|
vm.route.file
|
||||||
|
}
|
||||||
|
var editHtml = '[:memo: Edit Document](' + url + ')\n'
|
||||||
|
return (
|
||||||
|
editHtml +
|
||||||
|
html +
|
||||||
|
'\n\n----\n\n' +
|
||||||
|
'<a href="https://docsify.js.org" target="_blank" style="color: inherit; font-weight: normal; text-decoration: none;">Powered by docsify</a>'
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script src="lib/docsify.min.js"></script>
|
||||||
|
<script src="lib/plugins/search.min.js"></script>
|
||||||
|
<script src="lib/plugins/ga.min.js"></script>
|
||||||
|
<script src="lib/plugins/matomo.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>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
;((window.gitter = {}).chat = {}).options = {
|
||||||
|
room: 'docsifyjs/Lobby'
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script
|
||||||
|
src="https://sidecar.gitter.im/dist/sidecar.v1.js"
|
||||||
|
async
|
||||||
|
defer
|
||||||
|
></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,344 @@
|
|||||||
|
context('sidebar.configurations', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.visit('http://localhost:3000')
|
||||||
|
})
|
||||||
|
|
||||||
|
const quickStartIds = [
|
||||||
|
'initialize',
|
||||||
|
'writing-content',
|
||||||
|
'preview-your-site',
|
||||||
|
'manual-initialization',
|
||||||
|
'loading-dialog'
|
||||||
|
]
|
||||||
|
quickStartIds.forEach(id => {
|
||||||
|
it('go to #quickstart?id=' + id, () => {
|
||||||
|
cy.get(
|
||||||
|
'.sidebar-nav > :nth-child(1) > :nth-child(1) > ul > :nth-child(1) > a'
|
||||||
|
).click()
|
||||||
|
|
||||||
|
cy.get(`a.section-link[href='#/quickstart?id=${id}']`)
|
||||||
|
.click()
|
||||||
|
.then(() => {
|
||||||
|
cy.wait(500)
|
||||||
|
cy.matchImageSnapshot()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const configurationIds = [
|
||||||
|
'el',
|
||||||
|
'repo',
|
||||||
|
'maxlevel',
|
||||||
|
'loadnavbar',
|
||||||
|
'loadsidebar',
|
||||||
|
'submaxlevel',
|
||||||
|
'auto2top',
|
||||||
|
'homepage',
|
||||||
|
'basepath',
|
||||||
|
'relativepath',
|
||||||
|
'coverpage',
|
||||||
|
'logo',
|
||||||
|
'name',
|
||||||
|
'namelink',
|
||||||
|
'markdown',
|
||||||
|
'themecolor',
|
||||||
|
'alias',
|
||||||
|
'autoheader',
|
||||||
|
'executescript',
|
||||||
|
'noemoji',
|
||||||
|
'mergenavbar',
|
||||||
|
'formatupdated',
|
||||||
|
'externallinktarget',
|
||||||
|
'cornerexternallinktarget',
|
||||||
|
'externallinkrel',
|
||||||
|
'routermode',
|
||||||
|
'nocompilelinks',
|
||||||
|
'onlycover',
|
||||||
|
'requestheaders',
|
||||||
|
'ext',
|
||||||
|
'fallbacklanguages',
|
||||||
|
'notfoundpage'
|
||||||
|
]
|
||||||
|
configurationIds.forEach(id => {
|
||||||
|
it('go to #configuration?id=' + id, () => {
|
||||||
|
cy.get('[href="#/configuration"]').click()
|
||||||
|
|
||||||
|
cy.get(`a.section-link[href='#/configuration?id=${id}']`)
|
||||||
|
.click()
|
||||||
|
.then(() => {
|
||||||
|
cy.wait(500) // its more far from the cover
|
||||||
|
cy.matchImageSnapshot()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const morePagesIds = [
|
||||||
|
'sidebar',
|
||||||
|
'nested-sidebars',
|
||||||
|
'set-page-titles-from-sidebar-selection',
|
||||||
|
'table-of-contents',
|
||||||
|
'ignoring-subheaders'
|
||||||
|
]
|
||||||
|
morePagesIds.forEach(id => {
|
||||||
|
it('go to #more-pages?id=' + id, () => {
|
||||||
|
cy.get('[href="#/more-pages"]').click()
|
||||||
|
|
||||||
|
cy.get(`a.section-link[href='#/more-pages?id=${id}']`)
|
||||||
|
.click()
|
||||||
|
.then(() => {
|
||||||
|
cy.wait(500)
|
||||||
|
cy.matchImageSnapshot()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const customNavbarIds = [
|
||||||
|
'html',
|
||||||
|
'markdown',
|
||||||
|
'nesting',
|
||||||
|
'combining-custom-navbars-with-the-emoji-plugin'
|
||||||
|
]
|
||||||
|
customNavbarIds.forEach(id => {
|
||||||
|
it('go to #custom-navbar?id=' + id, () => {
|
||||||
|
cy.get('[href="#/custom-navbar"]').click()
|
||||||
|
|
||||||
|
cy.get(`a.section-link[href='#/custom-navbar?id=${id}']`)
|
||||||
|
.click()
|
||||||
|
.then(() => {
|
||||||
|
cy.wait(500)
|
||||||
|
cy.matchImageSnapshot()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const coverIds = [
|
||||||
|
'basic-usage',
|
||||||
|
'custom-background',
|
||||||
|
'coverpage-as-homepage',
|
||||||
|
'multiple-covers'
|
||||||
|
]
|
||||||
|
coverIds.forEach(id => {
|
||||||
|
it('go to #cover?id=' + id, () => {
|
||||||
|
cy.get('[href="#/cover"]').click()
|
||||||
|
|
||||||
|
cy.get(`a.section-link[href='#/cover?id=${id}']`)
|
||||||
|
.click()
|
||||||
|
.then(() => {
|
||||||
|
cy.wait(500)
|
||||||
|
cy.matchImageSnapshot()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const themesIds = ['other-themes']
|
||||||
|
themesIds.forEach(id => {
|
||||||
|
it('go to #themes?id=' + id, () => {
|
||||||
|
cy.get('[href="#/themes"]').click()
|
||||||
|
|
||||||
|
cy.get(`a.section-link[href='#/themes?id=${id}']`)
|
||||||
|
.click()
|
||||||
|
.then(() => {
|
||||||
|
cy.wait(500)
|
||||||
|
cy.matchImageSnapshot()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const pluginsIds = [
|
||||||
|
'full-text-search',
|
||||||
|
'google-analytics',
|
||||||
|
'emoji',
|
||||||
|
'external-script',
|
||||||
|
'zoom-image',
|
||||||
|
'edit-on-github',
|
||||||
|
'demo-code-with-instant-preview-and-jsfiddle-integration',
|
||||||
|
'copy-to-clipboard',
|
||||||
|
'disqus',
|
||||||
|
'gitalk',
|
||||||
|
'pagination',
|
||||||
|
'codefund',
|
||||||
|
'tabs',
|
||||||
|
'more-plugins'
|
||||||
|
]
|
||||||
|
pluginsIds.forEach(id => {
|
||||||
|
it('go to #plugins?id=' + id, () => {
|
||||||
|
cy.get('[href="#/plugins"]').click()
|
||||||
|
|
||||||
|
cy.get(`a.section-link[href='#/plugins?id=${id}']`)
|
||||||
|
.click()
|
||||||
|
.then(() => {
|
||||||
|
cy.wait(500)
|
||||||
|
cy.matchImageSnapshot()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const writeAPluginIds = ['full-configuration', 'example', 'tips']
|
||||||
|
writeAPluginIds.forEach(id => {
|
||||||
|
it('go to #write-a-plugin?id=' + id, () => {
|
||||||
|
cy.get('[href="#/write-a-plugin"]').click()
|
||||||
|
|
||||||
|
cy.get(`a.section-link[href='#/write-a-plugin?id=${id}']`)
|
||||||
|
.click()
|
||||||
|
.then(() => {
|
||||||
|
cy.wait(500)
|
||||||
|
cy.matchImageSnapshot()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const markdownIds = ['supports-mermaid']
|
||||||
|
markdownIds.forEach(id => {
|
||||||
|
it('go to #markdown?id=' + id, () => {
|
||||||
|
cy.get('[href="#/markdown"]').click()
|
||||||
|
|
||||||
|
cy.get(`a.section-link[href='#/markdown?id=${id}']`)
|
||||||
|
.click()
|
||||||
|
.then(() => {
|
||||||
|
cy.wait(500)
|
||||||
|
cy.matchImageSnapshot()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('go to #Language-highlight', () => {
|
||||||
|
cy.get('a[href="#/language-highlight"]')
|
||||||
|
.click()
|
||||||
|
.then(() => {
|
||||||
|
cy.wait(500)
|
||||||
|
cy.matchImageSnapshot()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// const deployIds = [
|
||||||
|
// 'github-pages',
|
||||||
|
// 'gitlab-pages',
|
||||||
|
// 'firebase-hosting',
|
||||||
|
// 'vps',
|
||||||
|
// 'netlify',
|
||||||
|
// 'zeit-now',
|
||||||
|
// 'aws-amplify'
|
||||||
|
// ]
|
||||||
|
// deployIds.forEach(id => {
|
||||||
|
// it('go to #deploy?id=' + id, () => {
|
||||||
|
// cy.get('[href="#/deploy"]').click()
|
||||||
|
|
||||||
|
// cy.get(`a.section-link[href='#/deploy?id=${id}']`)
|
||||||
|
// .click()
|
||||||
|
// .then(() => {
|
||||||
|
// cy.wait(500)
|
||||||
|
// cy.matchImageSnapshot()
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
|
||||||
|
const helpersIds = [
|
||||||
|
'important-content',
|
||||||
|
'general-tips',
|
||||||
|
'ignore-to-compile-link',
|
||||||
|
'set-target-attribute-for-link',
|
||||||
|
'disable-link',
|
||||||
|
'github-task-lists',
|
||||||
|
'image-resizing',
|
||||||
|
'customise-id-for-headings',
|
||||||
|
'markdown-in-html-tag'
|
||||||
|
]
|
||||||
|
helpersIds.forEach(id => {
|
||||||
|
it('go to #helpers?id=' + id, () => {
|
||||||
|
cy.get('[href="#/helpers"]').click()
|
||||||
|
|
||||||
|
cy.get(`a.section-link[href='#/helpers?id=${id}']`)
|
||||||
|
.click()
|
||||||
|
.then(() => {
|
||||||
|
cy.wait(500)
|
||||||
|
cy.matchImageSnapshot()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const vueIds = ['basic-usage', 'combine-vuep-to-write-playground']
|
||||||
|
vueIds.forEach(id => {
|
||||||
|
it('go to #vue?id=' + id, () => {
|
||||||
|
cy.get('[href="#/vue"]').click()
|
||||||
|
|
||||||
|
cy.get(`a.section-link[href='#/vue?id=${id}']`)
|
||||||
|
.click()
|
||||||
|
.then(() => {
|
||||||
|
cy.wait(500)
|
||||||
|
cy.matchImageSnapshot()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const cdnIds = [
|
||||||
|
'latest-version',
|
||||||
|
'specific-version',
|
||||||
|
'compressed-file',
|
||||||
|
'other-cdn'
|
||||||
|
]
|
||||||
|
cdnIds.forEach(id => {
|
||||||
|
it('go to #cdn?id=' + id, () => {
|
||||||
|
cy.get('[href="#/cdn"]').click()
|
||||||
|
|
||||||
|
cy.get(`a.section-link[href='#/cdn?id=${id}']`)
|
||||||
|
.click()
|
||||||
|
.then(() => {
|
||||||
|
cy.wait(500)
|
||||||
|
cy.matchImageSnapshot()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const pwaIds = ['create-serviceworker', 'register', 'enjoy-it']
|
||||||
|
pwaIds.forEach(id => {
|
||||||
|
it('go to #pwa?id=' + id, () => {
|
||||||
|
cy.get('[href="#/pwa"]').click()
|
||||||
|
|
||||||
|
cy.get(`a.section-link[href='#/pwa?id=${id}']`)
|
||||||
|
.click()
|
||||||
|
.then(() => {
|
||||||
|
cy.wait(500)
|
||||||
|
cy.matchImageSnapshot()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const ssrIds = [
|
||||||
|
'why-ssr',
|
||||||
|
'quick-start',
|
||||||
|
'custom-template',
|
||||||
|
'configuration',
|
||||||
|
'deploy-for-your-vps'
|
||||||
|
]
|
||||||
|
|
||||||
|
ssrIds.forEach(id => {
|
||||||
|
it('go to #ssr?id=' + id, () => {
|
||||||
|
cy.get('[href="#/ssr"]').click()
|
||||||
|
|
||||||
|
cy.get(`a.section-link[href='#/ssr?id=${id}']`)
|
||||||
|
.click()
|
||||||
|
.then(() => {
|
||||||
|
cy.wait(500)
|
||||||
|
cy.matchImageSnapshot()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
const embedFilesIds = [
|
||||||
|
'embedded-file-type',
|
||||||
|
'embedded-code-fragments',
|
||||||
|
'tag-attribute',
|
||||||
|
'the-code-block-highlight'
|
||||||
|
]
|
||||||
|
embedFilesIds.forEach(id => {
|
||||||
|
it('go to #embed-files?id=' + id, () => {
|
||||||
|
cy.get('[href="#/embed-files"]').click()
|
||||||
|
|
||||||
|
cy.get(`a.section-link[href='#/embed-files?id=${id}']`)
|
||||||
|
.click()
|
||||||
|
.then(() => {
|
||||||
|
cy.wait(500)
|
||||||
|
cy.matchImageSnapshot()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
const path = require('path')
|
||||||
|
const LiveServer = require('live-server')
|
||||||
|
|
||||||
|
const fixturePath = path.join(__dirname, './fixtures/docs')
|
||||||
|
const args = process.argv.slice(2)
|
||||||
|
console.log('[e2e tests] : args passed to live server', args)
|
||||||
|
const params = {
|
||||||
|
port: args[0] || 3000,
|
||||||
|
root: args[1] || fixturePath,
|
||||||
|
open: false
|
||||||
|
// NoBrowser: true
|
||||||
|
}
|
||||||
|
LiveServer.start(params)
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// ***********************************************************
|
||||||
|
// This example plugins/index.js can be used to load plugins
|
||||||
|
//
|
||||||
|
// You can change the location of this file or turn off loading
|
||||||
|
// the plugins file with the 'pluginsFile' configuration option.
|
||||||
|
//
|
||||||
|
// You can read more here:
|
||||||
|
// https://on.cypress.io/plugins-guide
|
||||||
|
// ***********************************************************
|
||||||
|
|
||||||
|
// This function is called when a project is opened or re-opened (e.g. due to
|
||||||
|
// the project's config changing)
|
||||||
|
const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin')
|
||||||
|
module.exports = (on, config) => {
|
||||||
|
// `on` is used to hook into various events Cypress emits
|
||||||
|
// `config` is the resolved Cypress config
|
||||||
|
addMatchImageSnapshotPlugin(on, config)
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
const copyDir = require('copy-dir')
|
||||||
|
const path = require('path')
|
||||||
|
const fs = require('fs')
|
||||||
|
const { spawn } = require('child_process')
|
||||||
|
|
||||||
|
const setup = async () => {
|
||||||
|
const PORT = process.env.PORT || 3000
|
||||||
|
global.__LIVESERVER__ = null
|
||||||
|
global.PORT = PORT
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IN this test suite, we are going to test our docs site with all the css,js linked to our local build packages
|
||||||
|
*
|
||||||
|
* 1.1 Copy ../docs --> ./fixtures/docs
|
||||||
|
* 1.2 copy lib,themes --> ./fixtures/
|
||||||
|
* 2. change the content of fixtures/docs/index.html to use all the links from our local build
|
||||||
|
* 3. now jest runner will run to test all the *.spec.js files
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
const shippedDirs = ['lib', 'themes']
|
||||||
|
|
||||||
|
// 1
|
||||||
|
const docsPath = path.join(process.cwd(), './docs')
|
||||||
|
const fixtureDocsPath = path.join(__dirname, './fixtures/docs')
|
||||||
|
|
||||||
|
// 1.1
|
||||||
|
console.log('[cypress test docs] Copying the docs --> cypress/fixtures/docs')
|
||||||
|
copyDir.sync(docsPath, fixtureDocsPath)
|
||||||
|
|
||||||
|
// 1.2
|
||||||
|
shippedDirs.forEach(dir => {
|
||||||
|
const fromPath = path.join(process.cwd(), dir)
|
||||||
|
const toPath = path.join(__dirname, `./fixtures/docs/${dir}`)
|
||||||
|
console.log(
|
||||||
|
`[cypress test docs] Copying ${dir} --> cypress/fixtures/docs/${dir}`
|
||||||
|
)
|
||||||
|
copyDir.sync(fromPath, toPath)
|
||||||
|
})
|
||||||
|
|
||||||
|
// 2
|
||||||
|
console.log(
|
||||||
|
'[cypress test docs] Replacing content the tpl/index.html --> cypress/fixtures/docs/index.html'
|
||||||
|
)
|
||||||
|
const indexHTMLtplPath = path.join(
|
||||||
|
__dirname,
|
||||||
|
'./fixtures/tpl/docs.index.html'
|
||||||
|
)
|
||||||
|
const fixtureIndexPath = path.join(__dirname, './fixtures/docs/index.html')
|
||||||
|
const data = fs.readFileSync(indexHTMLtplPath, 'utf8')
|
||||||
|
|
||||||
|
// 3
|
||||||
|
const fixturePath = path.join(__dirname, './fixtures/docs')
|
||||||
|
|
||||||
|
fs.writeFileSync(fixtureIndexPath, data, 'utf8')
|
||||||
|
const child = spawn('node', [
|
||||||
|
path.join(__dirname, './live.server.js'),
|
||||||
|
PORT,
|
||||||
|
fixturePath
|
||||||
|
])
|
||||||
|
child.on('exit', code => {
|
||||||
|
console.log(`Child process exited with code ${code}`)
|
||||||
|
})
|
||||||
|
child.stdout.on('data', data => {
|
||||||
|
console.log(`stdout: ${data}`)
|
||||||
|
})
|
||||||
|
child.stderr.on('data', data => {
|
||||||
|
console.log(`stderr: ${data}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
// LiveServer.start(params)
|
||||||
|
global.__LIVESERVER__ = child
|
||||||
|
}
|
||||||
|
|
||||||
|
setup()
|
||||||
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 87 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 57 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 77 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 108 KiB |
|
After Width: | Height: | Size: 107 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 102 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 120 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 124 KiB |
|
After Width: | Height: | Size: 94 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 91 KiB |
|
After Width: | Height: | Size: 103 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 104 KiB |
|
After Width: | Height: | Size: 92 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 76 KiB |