mirror of
https://github.com/wahyd4/docsify.git
synced 2026-08-10 05:48:18 +10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ed798cb92 |
@@ -7,7 +7,6 @@ about: Create a report to help us improve
|
|||||||
<!-- Please use English language -->
|
<!-- Please use English language -->
|
||||||
<!-- Before creating an issue please make sure you are using the latest version of Docsify. -->
|
<!-- Before creating an issue please make sure you are using the latest version of Docsify. -->
|
||||||
<!-- Please ask questions on StackOverflow: https://stackoverflow.com/questions/ask?tags=docsify -->
|
<!-- Please ask questions on StackOverflow: https://stackoverflow.com/questions/ask?tags=docsify -->
|
||||||
<!-- Please ask questions on gitter: https://gitter.im/docsifyjs/Lobby -->
|
|
||||||
|
|
||||||
## Bug Report
|
## Bug Report
|
||||||
|
|
||||||
@@ -37,9 +36,3 @@ about: Create a report to help us improve
|
|||||||
|
|
||||||
<!-- Love docsify? Please consider supporting our collective:
|
<!-- Love docsify? Please consider supporting our collective:
|
||||||
👉 https://opencollective.com/docsify/donate -->
|
👉 https://opencollective.com/docsify/donate -->
|
||||||
|
|
||||||
#### Please create a reproducible sandbox
|
|
||||||
|
|
||||||
[](https://codesandbox.io/s/307qqv236)
|
|
||||||
|
|
||||||
#### Mention the docsify version in which this bug was not present (if any)
|
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
name: Security Flow
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- develop
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- develop
|
||||||
|
jobs:
|
||||||
|
security:
|
||||||
|
runs-on: ubuntu-16.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
- name: Run Snyk to check for vulnerabilities
|
||||||
|
uses: snyk/actions/node@master
|
||||||
|
env:
|
||||||
|
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
|
||||||
-10
@@ -1,10 +0,0 @@
|
|||||||
tasks:
|
|
||||||
- command: gp await-port 3000 && sleep 3 && gp preview $(gp url 3000)
|
|
||||||
- init: npm install
|
|
||||||
command: npm run dev
|
|
||||||
ports:
|
|
||||||
- port: 3000
|
|
||||||
onOpen: ignore
|
|
||||||
vscode:
|
|
||||||
extensions:
|
|
||||||
- sysoev.language-stylus@1.11.0:xX39oruAJ5UQzTNVRdbBaQ==
|
|
||||||
@@ -1,80 +1,3 @@
|
|||||||
## [4.11.3](https://github.com/docsifyjs/docsify/compare/v4.11.2...v4.11.3) (2020-03-24)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* fix: digit issue with sidebar (complete REVERT to old method) ([154abf5](https://github.com/docsifyjs/docsify/commit/154abf59a6153e84b018fcdffa86892776d6da7d))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [4.11.2](https://github.com/docsifyjs/docsify/compare/v4.11.1...v4.11.2) (2020-03-09)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* fixed rendering of color in coverpage issue ([406670c](https://github.com/docsifyjs/docsify/commit/406670c3d619a627142900fd45019fb8ce00f60a))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [4.11.1](https://github.com/docsifyjs/docsify/compare/v4.11.0...v4.11.1) (2020-03-09)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [4.11.0](https://github.com/docsifyjs/docsify/compare/v4.10.2...v4.11.0) (2020-03-09)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* emojis in titles not working correctly and update ([#1016](https://github.com/docsifyjs/docsify/issues/1016)) ([b3d9b96](https://github.com/docsifyjs/docsify/commit/b3d9b966dfbb6f456c2c457da1d2a366e85d9190))
|
|
||||||
* searching table content ([6184e50](https://github.com/docsifyjs/docsify/commit/6184e502629932ca71fdd0a1b10150d118f5a7c8))
|
|
||||||
* stage modified files as part of pre-commit hook ([#985](https://github.com/docsifyjs/docsify/issues/985)) ([5b77b0f](https://github.com/docsifyjs/docsify/commit/5b77b0f628f056b7ebb6d0b617561d19964516a2))
|
|
||||||
* config initialization and coercion ([#861](https://github.com/docsifyjs/docsify/pull/861))
|
|
||||||
* strip indent when embedding code fragment ([#996](https://github.com/docsifyjs/docsify/pull/996))
|
|
||||||
* Ensure autoHeader dom result is similar to parsed H1 ([#811](https://github.com/docsifyjs/docsify/pull/811))
|
|
||||||
* upgrade docsify from 4.9.4 to 4.10.2 ([#1054](https://github.com/docsifyjs/docsify/issues/1054)) ([78290b2](https://github.com/docsifyjs/docsify/commit/78290b21038a3ae09c4c7438bd89b14ca4c02805))
|
|
||||||
* upgrade medium-zoom from 1.0.4 to 1.0.5 ([39ebd73](https://github.com/docsifyjs/docsify/commit/39ebd73021290439180878cae32e663b9e60e214))
|
|
||||||
* upgrade prismjs from 1.17.1 to 1.19.0 ([9981c43](https://github.com/docsifyjs/docsify/commit/9981c4361ad690d0ed32cf1fb5b48cc5b9f770bb))
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* configure pre-commit hook ([#983](https://github.com/docsifyjs/docsify/issues/983)) ([eea41a1](https://github.com/docsifyjs/docsify/commit/eea41a1207c46533ea9c6c59d82e2c94aa4dd70e))
|
|
||||||
* Add a prepare script. ([efbea24](https://github.com/docsifyjs/docsify/commit/efbea24de71f2287993b52ed1cef1a2dd6a53f81))
|
|
||||||
* added capability to add css class and id to images + links + refactoring ([#820](https://github.com/docsifyjs/docsify/issues/820)) ([724ac02](https://github.com/docsifyjs/docsify/commit/724ac024ddfc28e93d8b5dd909e722747286fa00))
|
|
||||||
* added dark mode to docs closes [#1031](https://github.com/docsifyjs/docsify/issues/1031) ([dc43d3c](https://github.com/docsifyjs/docsify/commit/dc43d3c512c2f04750e76176c25ece626ae7fe2a))
|
|
||||||
* new option `hideSidebar` ([#1026](https://github.com/docsifyjs/docsify/issues/1026)) ([b7547f1](https://github.com/docsifyjs/docsify/commit/b7547f151e928b3a0eb6a94b2af36023da4fa877))
|
|
||||||
* new option `topMargin` ([#1045](https://github.com/docsifyjs/docsify/pull/1045)) ([8faee03](https://github.com/docsifyjs/docsify/pull/1024/commits/b53ea1e304d3a2782b125c1d8711295d88faee03))
|
|
||||||
|
|
||||||
|
|
||||||
### Docs
|
|
||||||
|
|
||||||
* update docs for the `name` config option ([#992](https://github.com/docsifyjs/docsify/pull/992))
|
|
||||||
* about cache ([#854](https://github.com/docsifyjs/docsify/pull/854))
|
|
||||||
* removed FOSSA badge
|
|
||||||
* documented `__colon__` tip ([#1025](https://github.com/docsifyjs/docsify/pull/1025))
|
|
||||||
|
|
||||||
### Chore
|
|
||||||
|
|
||||||
* Migrate relative links to absolute in embedded markdown ([#867](https://github.com/docsifyjs/docsify/pull/867))
|
|
||||||
* smarter scroll behavior ([#744](https://github.com/docsifyjs/docsify/pull/744))
|
|
||||||
* improve basic layout style ([#884](https://github.com/docsifyjs/docsify/pull/884))
|
|
||||||
* There are currently {three=>four} themes available. ([#892](https://github.com/docsifyjs/docsify/pull/892))
|
|
||||||
* Added a redirect for images to show up in Amplify ([#918](https://github.com/docsifyjs/docsify/pull/918))
|
|
||||||
* removed the escaping of the name of sidebar ([#991](https://github.com/docsifyjs/docsify/pull/991))
|
|
||||||
* Eslint fixes for v4x ([#989](https://github.com/docsifyjs/docsify/pull/989))
|
|
||||||
* added github Actions for CI ([#1000](https://github.com/docsifyjs/docsify/pull/1000))
|
|
||||||
* Add a prepare script. ([#1010](https://github.com/docsifyjs/docsify/pull/1010))
|
|
||||||
* chore(GH-action): using ubuntu 16 and removed node 8 from CI
|
|
||||||
* chore: add config ([#1014](https://github.com/docsifyjs/docsify/pull/1014))
|
|
||||||
* chore(stale): added enhancement label to exemptlabels
|
|
||||||
* chore(stale): added bug label to exemptlabels
|
|
||||||
* .markdown-section max-width 800px to 80% ([#1017](https://github.com/docsifyjs/docsify/pull/1017))
|
|
||||||
* changed the CDN from unpkg to jsDelivr #1020 ([#1022](https://github.com/docsifyjs/docsify/pull/1022))
|
|
||||||
* migrate CI to github, refactore CI and npm scripts, linting fixes ([#1023](https://github.com/docsifyjs/docsify/pull/1023))
|
|
||||||
* chore(readme): added CI badges and fixed the logo issue
|
|
||||||
* added new linter config ([#1028](https://github.com/docsifyjs/docsify/pull/1028))
|
|
||||||
|
|
||||||
|
|
||||||
## [4.10.2](https://github.com/docsifyjs/docsify/compare/v4.10.0...v4.10.2) (2019-12-16)
|
## [4.10.2](https://github.com/docsifyjs/docsify/compare/v4.10.0...v4.10.2) (2019-12-16)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
<a href="https://www.npmjs.com/package/docsify"><img alt="npm" src="https://img.shields.io/npm/v/docsify.svg?style=flat-square"></a>
|
<a href="https://www.npmjs.com/package/docsify"><img alt="npm" src="https://img.shields.io/npm/v/docsify.svg?style=flat-square"></a>
|
||||||
<a href="https://github.com/QingWei-Li/donate"><img alt="donate" src="https://img.shields.io/badge/%24-donate-ff69b4.svg?style=flat-square"></a>
|
<a href="https://github.com/QingWei-Li/donate"><img alt="donate" src="https://img.shields.io/badge/%24-donate-ff69b4.svg?style=flat-square"></a>
|
||||||
<a href="https://gitter.im/docsifyjs/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link"><img alt="gitter" src="https://img.shields.io/gitter/room/docsifyjs/docsify.svg?style=flat-square"></a>
|
<a href="https://gitter.im/docsifyjs/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link"><img alt="gitter" src="https://img.shields.io/gitter/room/docsifyjs/docsify.svg?style=flat-square"></a>
|
||||||
<a href="https://gitpod.io/#https://github.com/docsifyjs/docsify"><img src="https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"></a>
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">Gold Sponsor via <a href="https://opencollective.com/docsify">Open Collective</a></p>
|
<p align="center">Gold Sponsor via <a href="https://opencollective.com/docsify">Open Collective</a></p>
|
||||||
@@ -70,18 +69,6 @@ Move to [awesome-docsify](https://github.com/docsifyjs/awesome-docsify#showcase)
|
|||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
### Online one-click setup for Contributing
|
|
||||||
|
|
||||||
You can use Gitpod(A free online VS Code-like IDE) for contributing. With single click it'll launch a workspace and automatically:
|
|
||||||
|
|
||||||
- clone the docsify repo.
|
|
||||||
- install the dependencies.
|
|
||||||
- start `npm run dev`.
|
|
||||||
|
|
||||||
So that you can start straight away.
|
|
||||||
|
|
||||||
[](https://gitpod.io/#https://github.com/docsifyjs/docsify)
|
|
||||||
|
|
||||||
- Fork it!
|
- Fork it!
|
||||||
- Create your feature branch: `git checkout -b my-new-feature`
|
- Create your feature branch: `git checkout -b my-new-feature`
|
||||||
- Commit your changes: `git commit -am 'Add some feature'`
|
- Commit your changes: `git commit -am 'Add some feature'`
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||

|

|
||||||
|
|
||||||
# docsify <small>4.11.3</small>
|
# docsify <small>4.10.2</small>
|
||||||
|
|
||||||
> A magical documentation site generator.
|
> A magical documentation site generator.
|
||||||
|
|
||||||
|
|||||||
@@ -575,16 +575,3 @@ window.$docsify = {
|
|||||||
```
|
```
|
||||||
|
|
||||||
> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.
|
> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.
|
||||||
|
|
||||||
## topMargin
|
|
||||||
|
|
||||||
- type: `Number`
|
|
||||||
- default: `0`
|
|
||||||
|
|
||||||
Adds a space on top when scrolling content page to reach the selected section. This is useful in case you have a _sticky-header_ layout and you want to align anchors to the end of your header.
|
|
||||||
|
|
||||||
```js
|
|
||||||
window.$docsify = {
|
|
||||||
topMargin: 90, // default: 0
|
|
||||||
};
|
|
||||||
```
|
|
||||||
+1
-8
@@ -14,9 +14,7 @@
|
|||||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/dark.css" title="dark" disabled>
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/dark.css" title="dark" disabled>
|
||||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/buble.css" title="buble" disabled>
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/buble.css" title="buble" disabled>
|
||||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/pure.css" title="pure" disabled>
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/pure.css" title="pure" disabled>
|
||||||
|
|
||||||
<script src="//cdn.jsdelivr.net/npm/docsify-plugin-codefund/index.js"></script>
|
<script src="//cdn.jsdelivr.net/npm/docsify-plugin-codefund/index.js"></script>
|
||||||
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify-dark-mode@0.6.1/dist/style.css"/>
|
|
||||||
<style>
|
<style>
|
||||||
nav.app-nav li ul {
|
nav.app-nav li ul {
|
||||||
min-width: 100px;
|
min-width: 100px;
|
||||||
@@ -64,11 +62,6 @@
|
|||||||
'/': 'Search'
|
'/': 'Search'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
darkMode: {
|
|
||||||
light: {
|
|
||||||
toggleBtnBg: '#42b983'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
formatUpdated: '{MM}/{DD} {HH}:{mm}',
|
formatUpdated: '{MM}/{DD} {HH}:{mm}',
|
||||||
plugins: [
|
plugins: [
|
||||||
function (hook, vm) {
|
function (hook, vm) {
|
||||||
@@ -99,7 +92,7 @@
|
|||||||
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-bash.min.js"></script>
|
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-bash.min.js"></script>
|
||||||
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-markdown.min.js"></script>
|
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-markdown.min.js"></script>
|
||||||
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-nginx.min.js"></script>
|
<script src="//cdn.jsdelivr.net/npm/prismjs/components/prism-nginx.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/docsify-dark-mode@0.6.1/dist/index.js"></script>
|
|
||||||
<script>
|
<script>
|
||||||
((window.gitter = {}).chat = {}).options = {
|
((window.gitter = {}).chat = {}).options = {
|
||||||
room: 'docsifyjs/Lobby'
|
room: 'docsifyjs/Lobby'
|
||||||
|
|||||||
Generated
+16
-10
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "docsify",
|
"name": "docsify",
|
||||||
"version": "4.11.3",
|
"version": "4.10.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -2943,9 +2943,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"clipboard": {
|
"clipboard": {
|
||||||
"version": "2.0.6",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.4.tgz",
|
||||||
"integrity": "sha512-g5zbiixBRk/wyKakSwCKd7vQXDjFnAMGHoEyBogG/bw9kTD9GvdAvaoRR1ALcEzt3pVKxZR0pViekPMIS0QyGg==",
|
"integrity": "sha512-Vw26VSLRpJfBofiVaFb/I8PVfdI1OxKcYShe6fm0sP/DtmiWQNCjhM/okTvdCo0G+lMMm1rMYbk4IK4x1X+kgQ==",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"good-listener": "^1.2.2",
|
"good-listener": "^1.2.2",
|
||||||
@@ -3606,6 +3606,12 @@
|
|||||||
"integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==",
|
"integrity": "sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"css.escape": {
|
||||||
|
"version": "1.5.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz",
|
||||||
|
"integrity": "sha1-QuJ9T6BK4y+TGktNQZH6nN3ul8s=",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"cssesc": {
|
"cssesc": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz",
|
||||||
@@ -8917,9 +8923,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"medium-zoom": {
|
"medium-zoom": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/medium-zoom/-/medium-zoom-1.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/medium-zoom/-/medium-zoom-1.0.4.tgz",
|
||||||
"integrity": "sha512-aLGa6WlTuFKWvH88bqTrY5ztJMN+D0hd8UX6BYc4YSoPayppzETjZUcdVcksgaoQEMg4cZSmXPg846fTp2rjRQ=="
|
"integrity": "sha512-BjE+00gQku3XQfgHDcqyYwQaBtFddzh6Lnj1RZOliqJ9HS0mh/P2IaqVJ25/j9EbnjAUf27mLeLZBRxnd00bfA=="
|
||||||
},
|
},
|
||||||
"mem": {
|
"mem": {
|
||||||
"version": "4.3.0",
|
"version": "4.3.0",
|
||||||
@@ -11202,9 +11208,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"prismjs": {
|
"prismjs": {
|
||||||
"version": "1.19.0",
|
"version": "1.17.1",
|
||||||
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.19.0.tgz",
|
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.17.1.tgz",
|
||||||
"integrity": "sha512-IVFtbW9mCWm9eOIaEkNyo2Vl4NnEifis2GQ7/MLRG5TQe6t+4Sj9J5QWI9i3v+SS43uZBlCAOn+zYTVYQcPXJw==",
|
"integrity": "sha512-PrEDJAFdUGbOP6xK/UsfkC5ghJsPJviKgnQOoxaDbBjwc8op68Quupwt1DeAFoG8GImPhiKXAvvsH7wDSLsu1Q==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"clipboard": "^2.0.0"
|
"clipboard": "^2.0.0"
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-3
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "docsify",
|
"name": "docsify",
|
||||||
"version": "4.11.3",
|
"version": "4.10.2",
|
||||||
"description": "A magical documentation generator.",
|
"description": "A magical documentation generator.",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "qingwei-li",
|
"name": "qingwei-li",
|
||||||
@@ -61,9 +61,9 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"marked": "^0.7.0",
|
"marked": "^0.7.0",
|
||||||
"medium-zoom": "^1.0.5",
|
"medium-zoom": "^1.0.4",
|
||||||
"opencollective-postinstall": "^2.0.2",
|
"opencollective-postinstall": "^2.0.2",
|
||||||
"prismjs": "^1.19.0",
|
"prismjs": "^1.15.0",
|
||||||
"strip-indent": "^3.0.0",
|
"strip-indent": "^3.0.0",
|
||||||
"tinydate": "^1.0.0",
|
"tinydate": "^1.0.0",
|
||||||
"tweezer.js": "^1.4.0"
|
"tweezer.js": "^1.4.0"
|
||||||
@@ -76,6 +76,7 @@
|
|||||||
"conventional-changelog-cli": "^2.0.25",
|
"conventional-changelog-cli": "^2.0.25",
|
||||||
"copy-dir": "^1.2.0",
|
"copy-dir": "^1.2.0",
|
||||||
"cross-env": "^6.0.3",
|
"cross-env": "^6.0.3",
|
||||||
|
"css.escape": "^1.5.1",
|
||||||
"cssnano": "^4.1.10",
|
"cssnano": "^4.1.10",
|
||||||
"cypress": "^3.8.1",
|
"cypress": "^3.8.1",
|
||||||
"cypress-image-snapshot": "^3.1.1",
|
"cypress-image-snapshot": "^3.1.1",
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { readFileSync } from 'fs';
|
import { readFileSync } from 'fs';
|
||||||
import { resolve, basename } from 'path';
|
import { resolve, basename } from 'path';
|
||||||
import resolvePathname from 'resolve-pathname';
|
|
||||||
import { AbstractHistory } from '../../src/core/router/history/abstract';
|
import { AbstractHistory } from '../../src/core/router/history/abstract';
|
||||||
import { Compiler } from '../../src/core/render/compiler';
|
import { Compiler } from '../../src/core/render/compiler';
|
||||||
import { isAbsolutePath } from '../../src/core/router/util';
|
import { isAbsolutePath } from '../../src/core/router/util';
|
||||||
import * as tpl from '../../src/core/render/tpl';
|
import * as tpl from '../../src/core/render/tpl';
|
||||||
import { prerenderEmbed } from '../../src/core/render/embed';
|
import { prerenderEmbed } from '../../src/core/render/embed';
|
||||||
import fetch from 'node-fetch';
|
import resolvePathname from 'resolve-pathname';
|
||||||
import debug from 'debug';
|
import debug from 'debug';
|
||||||
|
import fetch from 'node-fetch';
|
||||||
|
|
||||||
function cwd(...args) {
|
function cwd(...args) {
|
||||||
return resolve(process.cwd(), ...args);
|
return resolve(process.cwd(), ...args);
|
||||||
|
|||||||
+344
-34
@@ -1,13 +1,84 @@
|
|||||||
{
|
{
|
||||||
"name": "docsify-server-renderer",
|
"name": "docsify-server-renderer",
|
||||||
"version": "4.11.2",
|
"version": "4.10.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"ansi-escapes": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz",
|
||||||
|
"integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4="
|
||||||
|
},
|
||||||
|
"ansi-regex": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
||||||
|
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
|
||||||
|
},
|
||||||
|
"ansi-styles": {
|
||||||
|
"version": "2.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
|
||||||
|
"integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4="
|
||||||
|
},
|
||||||
|
"babel-polyfill": {
|
||||||
|
"version": "6.23.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.23.0.tgz",
|
||||||
|
"integrity": "sha1-g2TKYt+Or7gwSZ9pkXdGbDsDSZ0=",
|
||||||
|
"requires": {
|
||||||
|
"babel-runtime": "^6.22.0",
|
||||||
|
"core-js": "^2.4.0",
|
||||||
|
"regenerator-runtime": "^0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"babel-runtime": {
|
||||||
|
"version": "6.26.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
|
||||||
|
"integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
|
||||||
|
"requires": {
|
||||||
|
"core-js": "^2.4.0",
|
||||||
|
"regenerator-runtime": "^0.11.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"regenerator-runtime": {
|
||||||
|
"version": "0.11.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
|
||||||
|
"integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"chalk": {
|
||||||
|
"version": "1.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
|
||||||
|
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
|
||||||
|
"requires": {
|
||||||
|
"ansi-styles": "^2.2.1",
|
||||||
|
"escape-string-regexp": "^1.0.2",
|
||||||
|
"has-ansi": "^2.0.0",
|
||||||
|
"strip-ansi": "^3.0.0",
|
||||||
|
"supports-color": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"chardet": {
|
||||||
|
"version": "0.4.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz",
|
||||||
|
"integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I="
|
||||||
|
},
|
||||||
|
"cli-cursor": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
|
||||||
|
"integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=",
|
||||||
|
"requires": {
|
||||||
|
"restore-cursor": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"cli-width": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz",
|
||||||
|
"integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk="
|
||||||
|
},
|
||||||
"clipboard": {
|
"clipboard": {
|
||||||
"version": "2.0.6",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.4.tgz",
|
||||||
"integrity": "sha512-g5zbiixBRk/wyKakSwCKd7vQXDjFnAMGHoEyBogG/bw9kTD9GvdAvaoRR1ALcEzt3pVKxZR0pViekPMIS0QyGg==",
|
"integrity": "sha512-Vw26VSLRpJfBofiVaFb/I8PVfdI1OxKcYShe6fm0sP/DtmiWQNCjhM/okTvdCo0G+lMMm1rMYbk4IK4x1X+kgQ==",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"good-listener": "^1.2.2",
|
"good-listener": "^1.2.2",
|
||||||
@@ -15,6 +86,11 @@
|
|||||||
"tiny-emitter": "^2.0.0"
|
"tiny-emitter": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"core-js": {
|
||||||
|
"version": "2.6.9",
|
||||||
|
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz",
|
||||||
|
"integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A=="
|
||||||
|
},
|
||||||
"debug": {
|
"debug": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
||||||
@@ -30,19 +106,49 @@
|
|||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"docsify": {
|
"docsify": {
|
||||||
"version": "4.11.2",
|
"version": "4.9.4",
|
||||||
"resolved": "https://registry.npmjs.org/docsify/-/docsify-4.11.2.tgz",
|
"resolved": "https://registry.npmjs.org/docsify/-/docsify-4.9.4.tgz",
|
||||||
"integrity": "sha512-vQVg+ERdYgrlgLcwTX9FdjUn3xb7PSwaiYopIAmCLraHJCr1e0r8Uzi2vm6XEwTrSrdd6C5j3Eg+QctsOGA4Gg==",
|
"integrity": "sha512-Xtm6sfrNU7cqOViWMewDhscn0cySF60q2KTKok9OaPmzt6nRkTAIvYU4dj916IT21o/b336Or3vO2hsvmaQzxg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"marked": "^0.7.0",
|
"marked": "^0.5.1",
|
||||||
"medium-zoom": "^1.0.5",
|
"medium-zoom": "^0.4.0",
|
||||||
"opencollective-postinstall": "^2.0.2",
|
"opencollective": "^1.0.3",
|
||||||
"prismjs": "^1.19.0",
|
"prismjs": "^1.15.0",
|
||||||
"strip-indent": "^3.0.0",
|
|
||||||
"tinydate": "^1.0.0",
|
"tinydate": "^1.0.0",
|
||||||
"tweezer.js": "^1.4.0"
|
"tweezer.js": "^1.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"encoding": {
|
||||||
|
"version": "0.1.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz",
|
||||||
|
"integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=",
|
||||||
|
"requires": {
|
||||||
|
"iconv-lite": "~0.4.13"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"escape-string-regexp": {
|
||||||
|
"version": "1.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
||||||
|
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
|
||||||
|
},
|
||||||
|
"external-editor": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==",
|
||||||
|
"requires": {
|
||||||
|
"chardet": "^0.4.0",
|
||||||
|
"iconv-lite": "^0.4.17",
|
||||||
|
"tmp": "^0.0.33"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"figures": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=",
|
||||||
|
"requires": {
|
||||||
|
"escape-string-regexp": "^1.0.5"
|
||||||
|
}
|
||||||
|
},
|
||||||
"good-listener": {
|
"good-listener": {
|
||||||
"version": "1.2.2",
|
"version": "1.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz",
|
||||||
@@ -52,63 +158,259 @@
|
|||||||
"delegate": "^3.1.2"
|
"delegate": "^3.1.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"has-ansi": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
|
||||||
|
"requires": {
|
||||||
|
"ansi-regex": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"iconv-lite": {
|
||||||
|
"version": "0.4.24",
|
||||||
|
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||||
|
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
||||||
|
"requires": {
|
||||||
|
"safer-buffer": ">= 2.1.2 < 3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"inquirer": {
|
||||||
|
"version": "3.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.0.6.tgz",
|
||||||
|
"integrity": "sha1-4EqqnQW3o8ubD0B9BDdfBEcZA0c=",
|
||||||
|
"requires": {
|
||||||
|
"ansi-escapes": "^1.1.0",
|
||||||
|
"chalk": "^1.0.0",
|
||||||
|
"cli-cursor": "^2.1.0",
|
||||||
|
"cli-width": "^2.0.0",
|
||||||
|
"external-editor": "^2.0.1",
|
||||||
|
"figures": "^2.0.0",
|
||||||
|
"lodash": "^4.3.0",
|
||||||
|
"mute-stream": "0.0.7",
|
||||||
|
"run-async": "^2.2.0",
|
||||||
|
"rx": "^4.1.0",
|
||||||
|
"string-width": "^2.0.0",
|
||||||
|
"strip-ansi": "^3.0.0",
|
||||||
|
"through": "^2.3.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"is-fullwidth-code-point": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8="
|
||||||
|
},
|
||||||
|
"is-promise": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz",
|
||||||
|
"integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o="
|
||||||
|
},
|
||||||
|
"is-stream": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
||||||
|
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
|
||||||
|
},
|
||||||
|
"lodash": {
|
||||||
|
"version": "4.17.15",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
|
||||||
|
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
|
||||||
|
},
|
||||||
"marked": {
|
"marked": {
|
||||||
"version": "0.7.0",
|
"version": "0.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/marked/-/marked-0.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/marked/-/marked-0.5.2.tgz",
|
||||||
"integrity": "sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg=="
|
"integrity": "sha512-fdZvBa7/vSQIZCi4uuwo2N3q+7jJURpMVCcbaX0S1Mg65WZ5ilXvC67MviJAsdjqqgD+CEq4RKo5AYGgINkVAA=="
|
||||||
},
|
},
|
||||||
"medium-zoom": {
|
"medium-zoom": {
|
||||||
"version": "1.0.5",
|
"version": "0.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/medium-zoom/-/medium-zoom-1.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/medium-zoom/-/medium-zoom-0.4.0.tgz",
|
||||||
"integrity": "sha512-aLGa6WlTuFKWvH88bqTrY5ztJMN+D0hd8UX6BYc4YSoPayppzETjZUcdVcksgaoQEMg4cZSmXPg846fTp2rjRQ=="
|
"integrity": "sha512-0z7yMfd6I1BTCAa8QaR4cp5AqDkQD571GzhHIbbfefKEssGLSvs+4Xai/itOAncm4FBlF5gUoMQ22yW9/f8Sig=="
|
||||||
},
|
},
|
||||||
"min-indent": {
|
"mimic-fn": {
|
||||||
"version": "1.0.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
|
||||||
"integrity": "sha1-z8RcN+nsDY8KDsPdTvf3w6vjklY="
|
"integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ=="
|
||||||
|
},
|
||||||
|
"minimist": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
|
||||||
|
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
|
||||||
},
|
},
|
||||||
"ms": {
|
"ms": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
||||||
},
|
},
|
||||||
|
"mute-stream": {
|
||||||
|
"version": "0.0.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz",
|
||||||
|
"integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s="
|
||||||
|
},
|
||||||
"node-fetch": {
|
"node-fetch": {
|
||||||
"version": "2.6.0",
|
"version": "2.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
||||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
||||||
},
|
},
|
||||||
"opencollective-postinstall": {
|
"object-assign": {
|
||||||
"version": "2.0.2",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||||
"integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw=="
|
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
|
||||||
|
},
|
||||||
|
"onetime": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
|
||||||
|
"integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=",
|
||||||
|
"requires": {
|
||||||
|
"mimic-fn": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"opencollective": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/opencollective/-/opencollective-1.0.3.tgz",
|
||||||
|
"integrity": "sha1-ruY3K8KBRFg2kMPKja7PwSDdDvE=",
|
||||||
|
"requires": {
|
||||||
|
"babel-polyfill": "6.23.0",
|
||||||
|
"chalk": "1.1.3",
|
||||||
|
"inquirer": "3.0.6",
|
||||||
|
"minimist": "1.2.0",
|
||||||
|
"node-fetch": "1.6.3",
|
||||||
|
"opn": "4.0.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"node-fetch": {
|
||||||
|
"version": "1.6.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.6.3.tgz",
|
||||||
|
"integrity": "sha1-3CNO3WSJmC1Y6PDbT2lQKavNjAQ=",
|
||||||
|
"requires": {
|
||||||
|
"encoding": "^0.1.11",
|
||||||
|
"is-stream": "^1.0.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"opn": {
|
||||||
|
"version": "4.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz",
|
||||||
|
"integrity": "sha1-erwi5kTf9jsKltWrfyeQwPAavJU=",
|
||||||
|
"requires": {
|
||||||
|
"object-assign": "^4.0.1",
|
||||||
|
"pinkie-promise": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"os-tmpdir": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
|
||||||
|
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
|
||||||
|
},
|
||||||
|
"pinkie": {
|
||||||
|
"version": "2.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
|
||||||
|
"integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA="
|
||||||
|
},
|
||||||
|
"pinkie-promise": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
|
||||||
|
"integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
|
||||||
|
"requires": {
|
||||||
|
"pinkie": "^2.0.0"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"prismjs": {
|
"prismjs": {
|
||||||
"version": "1.19.0",
|
"version": "1.17.1",
|
||||||
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.19.0.tgz",
|
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.17.1.tgz",
|
||||||
"integrity": "sha512-IVFtbW9mCWm9eOIaEkNyo2Vl4NnEifis2GQ7/MLRG5TQe6t+4Sj9J5QWI9i3v+SS43uZBlCAOn+zYTVYQcPXJw==",
|
"integrity": "sha512-PrEDJAFdUGbOP6xK/UsfkC5ghJsPJviKgnQOoxaDbBjwc8op68Quupwt1DeAFoG8GImPhiKXAvvsH7wDSLsu1Q==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"clipboard": "^2.0.0"
|
"clipboard": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"regenerator-runtime": {
|
||||||
|
"version": "0.10.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz",
|
||||||
|
"integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg="
|
||||||
|
},
|
||||||
"resolve-pathname": {
|
"resolve-pathname": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
|
||||||
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
|
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
|
||||||
},
|
},
|
||||||
|
"restore-cursor": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=",
|
||||||
|
"requires": {
|
||||||
|
"onetime": "^2.0.0",
|
||||||
|
"signal-exit": "^3.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"run-async": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz",
|
||||||
|
"integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=",
|
||||||
|
"requires": {
|
||||||
|
"is-promise": "^2.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rx": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz",
|
||||||
|
"integrity": "sha1-pfE/957zt0D+MKqAP7CfmIBdR4I="
|
||||||
|
},
|
||||||
|
"safer-buffer": {
|
||||||
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||||
|
},
|
||||||
"select": {
|
"select": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
|
||||||
"integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=",
|
"integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"strip-indent": {
|
"signal-exit": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
||||||
"integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==",
|
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
|
||||||
|
},
|
||||||
|
"string-width": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
|
||||||
|
"integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"min-indent": "^1.0.0"
|
"is-fullwidth-code-point": "^2.0.0",
|
||||||
|
"strip-ansi": "^4.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
|
||||||
|
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg="
|
||||||
|
},
|
||||||
|
"strip-ansi": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
|
||||||
|
"integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
|
||||||
|
"requires": {
|
||||||
|
"ansi-regex": "^3.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"strip-ansi": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
|
||||||
|
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
|
||||||
|
"requires": {
|
||||||
|
"ansi-regex": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"supports-color": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc="
|
||||||
|
},
|
||||||
|
"through": {
|
||||||
|
"version": "2.3.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
|
||||||
|
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
|
||||||
|
},
|
||||||
"tiny-emitter": {
|
"tiny-emitter": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
|
||||||
@@ -120,6 +422,14 @@
|
|||||||
"resolved": "https://registry.npmjs.org/tinydate/-/tinydate-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/tinydate/-/tinydate-1.2.0.tgz",
|
||||||
"integrity": "sha512-3GwPk8VhDFnUZ2TrgkhXJs6hcMAIIw4x/xkz+ayK6dGoQmp2nUwKzBXK0WnMsqkh6vfUhpqQicQF3rbshfyJkg=="
|
"integrity": "sha512-3GwPk8VhDFnUZ2TrgkhXJs6hcMAIIw4x/xkz+ayK6dGoQmp2nUwKzBXK0WnMsqkh6vfUhpqQicQF3rbshfyJkg=="
|
||||||
},
|
},
|
||||||
|
"tmp": {
|
||||||
|
"version": "0.0.33",
|
||||||
|
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
|
||||||
|
"integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
|
||||||
|
"requires": {
|
||||||
|
"os-tmpdir": "~1.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"tweezer.js": {
|
"tweezer.js": {
|
||||||
"version": "1.5.0",
|
"version": "1.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/tweezer.js/-/tweezer.js-1.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/tweezer.js/-/tweezer.js-1.5.0.tgz",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "docsify-server-renderer",
|
"name": "docsify-server-renderer",
|
||||||
"version": "4.11.2",
|
"version": "4.10.2",
|
||||||
"description": "docsify server renderer",
|
"description": "docsify server renderer",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "qingwei-li",
|
"name": "qingwei-li",
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"debug": "^4.1.1",
|
"debug": "^4.1.1",
|
||||||
"docsify": "^4.11.2",
|
"docsify": "^4.8.0",
|
||||||
"node-fetch": "^2.6.0",
|
"node-fetch": "^2.6.0",
|
||||||
"resolve-pathname": "^3.0.0"
|
"resolve-pathname": "^3.0.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ export default function() {
|
|||||||
routerMode: 'hash',
|
routerMode: 'hash',
|
||||||
noCompileLinks: [],
|
noCompileLinks: [],
|
||||||
relativePath: false,
|
relativePath: false,
|
||||||
topMargin: 0,
|
|
||||||
},
|
},
|
||||||
window.$docsify
|
window.$docsify
|
||||||
);
|
);
|
||||||
|
|||||||
+3
-18
@@ -1,26 +1,11 @@
|
|||||||
import { isMobile } from '../util/env';
|
import { isMobile } from '../util/env';
|
||||||
import { body, on } from '../util/dom';
|
import { body, on } from '../util/dom';
|
||||||
import * as sidebar from './sidebar';
|
import * as sidebar from './sidebar';
|
||||||
import { scrollIntoView, scroll2Top } from './scroll';
|
import { scrollIntoView } from './scroll';
|
||||||
|
|
||||||
export function eventMixin(proto) {
|
export function eventMixin(proto) {
|
||||||
proto.$resetEvents = function(source) {
|
proto.$resetEvents = function() {
|
||||||
const { auto2top } = this.config;
|
scrollIntoView(this.route.path, this.route.query.id);
|
||||||
|
|
||||||
(() => {
|
|
||||||
// Rely on the browser's scroll auto-restoration when going back or forward
|
|
||||||
if (source === 'history') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Scroll to ID if specified
|
|
||||||
if (this.route.query.id) {
|
|
||||||
scrollIntoView(this.route.path, this.route.query.id);
|
|
||||||
}
|
|
||||||
// Scroll to top if a link was clicked and auto2top is enabled
|
|
||||||
if (source === 'navigate') {
|
|
||||||
auto2top && scroll2Top(auto2top);
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
if (this.config.loadNavbar) {
|
if (this.config.loadNavbar) {
|
||||||
sidebar.getAndActive(this.router, 'nav');
|
sidebar.getAndActive(this.router, 'nav');
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { isMobile } from '../util/env';
|
import { isMobile } from '../util/env';
|
||||||
import * as dom from '../util/dom';
|
import * as dom from '../util/dom';
|
||||||
import config from '../config';
|
|
||||||
import Tweezer from 'tweezer.js';
|
import Tweezer from 'tweezer.js';
|
||||||
|
import cssEscape from 'css.escape';
|
||||||
|
|
||||||
const nav = {};
|
const nav = {};
|
||||||
let hoverOver = false;
|
let hoverOver = false;
|
||||||
@@ -9,7 +9,7 @@ let scroller = null;
|
|||||||
let enableScrollEvent = true;
|
let enableScrollEvent = true;
|
||||||
let coverHeight = 0;
|
let coverHeight = 0;
|
||||||
|
|
||||||
function scrollTo(el, offset = 0) {
|
function scrollTo(el) {
|
||||||
if (scroller) {
|
if (scroller) {
|
||||||
scroller.stop();
|
scroller.stop();
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,7 @@ function scrollTo(el, offset = 0) {
|
|||||||
enableScrollEvent = false;
|
enableScrollEvent = false;
|
||||||
scroller = new Tweezer({
|
scroller = new Tweezer({
|
||||||
start: window.pageYOffset,
|
start: window.pageYOffset,
|
||||||
end: el.getBoundingClientRect().top + window.pageYOffset - offset,
|
end: el.getBoundingClientRect().top + window.pageYOffset,
|
||||||
duration: 500,
|
duration: 500,
|
||||||
})
|
})
|
||||||
.on('tick', v => window.scrollTo(0, v))
|
.on('tick', v => window.scrollTo(0, v))
|
||||||
@@ -142,9 +142,9 @@ export function scrollIntoView(path, id) {
|
|||||||
if (!id) {
|
if (!id) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const topMargin = config().topMargin;
|
|
||||||
const section = dom.find('#' + id);
|
const section = dom.find('#' + cssEscape(id));
|
||||||
section && scrollTo(section, topMargin);
|
section && scrollTo(section);
|
||||||
|
|
||||||
const li = nav[getNavKey(path, id)];
|
const li = nav[getNavKey(path, id)];
|
||||||
const sidebar = dom.getNode('.sidebar');
|
const sidebar = dom.getNode('.sidebar');
|
||||||
|
|||||||
@@ -148,10 +148,7 @@ export function fetchMixin(proto) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
proto.$fetch = function(
|
proto.$fetch = function(cb = noop) {
|
||||||
cb = noop,
|
|
||||||
$resetEvents = this.$resetEvents.bind(this)
|
|
||||||
) {
|
|
||||||
const done = () => {
|
const done = () => {
|
||||||
callHook(this, 'doneEach');
|
callHook(this, 'doneEach');
|
||||||
cb();
|
cb();
|
||||||
@@ -163,7 +160,7 @@ export function fetchMixin(proto) {
|
|||||||
done();
|
done();
|
||||||
} else {
|
} else {
|
||||||
this._fetch(() => {
|
this._fetch(() => {
|
||||||
$resetEvents();
|
this.$resetEvents();
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import * as dom from './util/dom';
|
|||||||
import { Compiler } from './render/compiler';
|
import { Compiler } from './render/compiler';
|
||||||
import { slugify } from './render/slugify';
|
import { slugify } from './render/slugify';
|
||||||
import { get } from './fetch/ajax';
|
import { get } from './fetch/ajax';
|
||||||
import prism from 'prismjs';
|
|
||||||
import marked from 'marked';
|
import marked from 'marked';
|
||||||
|
import prism from 'prismjs';
|
||||||
|
|
||||||
export default function() {
|
export default function() {
|
||||||
window.Docsify = {
|
window.Docsify = {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import { tree as treeTpl } from './tpl';
|
|||||||
import { genTree } from './gen-tree';
|
import { genTree } from './gen-tree';
|
||||||
import { slugify } from './slugify';
|
import { slugify } from './slugify';
|
||||||
import { emojify } from './emojify';
|
import { emojify } from './emojify';
|
||||||
import { getAndRemoveConfig } from './utils';
|
|
||||||
import { imageCompiler } from './compiler/image';
|
import { imageCompiler } from './compiler/image';
|
||||||
import { highlightCodeCompiler } from './compiler/code';
|
import { highlightCodeCompiler } from './compiler/code';
|
||||||
import { paragraphCompiler } from './compiler/paragraph';
|
import { paragraphCompiler } from './compiler/paragraph';
|
||||||
@@ -15,6 +14,27 @@ import marked from 'marked';
|
|||||||
|
|
||||||
const cachedLinks = {};
|
const cachedLinks = {};
|
||||||
|
|
||||||
|
export function getAndRemoveConfig(str = '') {
|
||||||
|
const config = {};
|
||||||
|
|
||||||
|
if (str) {
|
||||||
|
str = str
|
||||||
|
.replace(/^'/, '')
|
||||||
|
.replace(/'$/, '')
|
||||||
|
.replace(/(?:^|\s):([\w-]+:?)=?([\w-]+)?/g, (m, key, value) => {
|
||||||
|
if (key.indexOf(':') === -1) {
|
||||||
|
config[key] = (value && value.replace(/"/g, '')) || true;
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return m;
|
||||||
|
})
|
||||||
|
.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
return { str, config };
|
||||||
|
}
|
||||||
|
|
||||||
const compileMedia = {
|
const compileMedia = {
|
||||||
markdown(url) {
|
markdown(url) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { getAndRemoveConfig } from '../utils';
|
import { getAndRemoveConfig } from '../compiler';
|
||||||
import { slugify } from './slugify';
|
import { slugify } from './slugify';
|
||||||
|
|
||||||
export const headingCompiler = ({ renderer, router, _self }) =>
|
export const headingCompiler = ({ renderer, router, _self }) =>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { getAndRemoveConfig } from '../utils';
|
import { getAndRemoveConfig } from '../compiler';
|
||||||
import { isAbsolutePath, getPath, getParentPath } from '../../router/util';
|
import { isAbsolutePath, getPath, getParentPath } from '../../router/util';
|
||||||
|
|
||||||
export const imageCompiler = ({ renderer, contentBase, router }) =>
|
export const imageCompiler = ({ renderer, contentBase, router }) =>
|
||||||
@@ -38,11 +38,7 @@ export const imageCompiler = ({ renderer, contentBase, router }) =>
|
|||||||
url = getPath(contentBase, getParentPath(router.getCurrentPath()), href);
|
url = getPath(contentBase, getParentPath(router.getCurrentPath()), href);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attrs.length > 0) {
|
return `<img src="${url}" data-origin="${href}" alt="${text}" ${attrs.join(
|
||||||
return `<img src="${url}" data-origin="${href}" alt="${text}" ${attrs.join(
|
' '
|
||||||
' '
|
)} />`;
|
||||||
)} />`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return `<img src="${url}" data-origin="${href}" alt="${text}"${attrs}>`;
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { getAndRemoveConfig } from '../utils';
|
import { getAndRemoveConfig } from '../compiler';
|
||||||
import { isAbsolutePath } from '../../router/util';
|
import { isAbsolutePath } from '../../router/util';
|
||||||
|
|
||||||
export const linkCompiler = ({ renderer, router, linkTarget, compilerClass }) =>
|
export const linkCompiler = ({ renderer, router, linkTarget, compilerClass }) =>
|
||||||
@@ -19,10 +19,6 @@ export const linkCompiler = ({ renderer, router, linkTarget, compilerClass }) =>
|
|||||||
|
|
||||||
href = router.toURL(href, null, router.getCurrentPath());
|
href = router.toURL(href, null, router.getCurrentPath());
|
||||||
} else {
|
} else {
|
||||||
if (!isAbsolutePath(href) && href.startsWith('./')) {
|
|
||||||
href =
|
|
||||||
document.URL.replace(/\/(?!.*\/).*/, '/').replace('#/./', '') + href;
|
|
||||||
}
|
|
||||||
attrs.push(href.indexOf('mailto:') === 0 ? '' : `target="${linkTarget}"`);
|
attrs.push(href.indexOf('mailto:') === 0 ? '' : `target="${linkTarget}"`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,23 +19,6 @@ function walkFetchEmbed({ embedTokens, compile, fetch }, cb) {
|
|||||||
let embedToken;
|
let embedToken;
|
||||||
if (text) {
|
if (text) {
|
||||||
if (token.embed.type === 'markdown') {
|
if (token.embed.type === 'markdown') {
|
||||||
let path = token.embed.url.split('/');
|
|
||||||
path.pop();
|
|
||||||
path = path.join('/');
|
|
||||||
// Resolves relative links to absolute
|
|
||||||
text = text.replace(/\[([^[\]]+)\]\(([^)]+)\)/g, x => {
|
|
||||||
const linkBeginIndex = x.indexOf('(');
|
|
||||||
if (x.substring(linkBeginIndex).startsWith('(.')) {
|
|
||||||
return (
|
|
||||||
x.substring(0, linkBeginIndex) +
|
|
||||||
`(${window.location.protocol}//${window.location.host}${path}/` +
|
|
||||||
x.substring(linkBeginIndex + 1, x.length - 1) +
|
|
||||||
')'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return x;
|
|
||||||
});
|
|
||||||
|
|
||||||
embedToken = compile.lexer(text);
|
embedToken = compile.lexer(text);
|
||||||
} else if (token.embed.type === 'code') {
|
} else if (token.embed.type === 'code') {
|
||||||
if (token.embed.fragment) {
|
if (token.embed.fragment) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { getAndActive, sticky } from '../event/sidebar';
|
|||||||
import { getPath, isAbsolutePath } from '../router/util';
|
import { getPath, isAbsolutePath } from '../router/util';
|
||||||
import { isMobile, inBrowser } from '../util/env';
|
import { isMobile, inBrowser } from '../util/env';
|
||||||
import { isPrimitive } from '../util/core';
|
import { isPrimitive } from '../util/core';
|
||||||
import { scrollActiveSidebar } from '../event/scroll';
|
import { scrollActiveSidebar, scroll2Top } from '../event/scroll';
|
||||||
import { Compiler } from './compiler';
|
import { Compiler } from './compiler';
|
||||||
import * as tpl from './tpl';
|
import * as tpl from './tpl';
|
||||||
import { prerenderEmbed } from './embed';
|
import { prerenderEmbed } from './embed';
|
||||||
@@ -123,7 +123,7 @@ export function renderMixin(proto) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
proto._bindEventOnRendered = function(activeEl) {
|
proto._bindEventOnRendered = function(activeEl) {
|
||||||
const { autoHeader } = this.config;
|
const { autoHeader, auto2top } = this.config;
|
||||||
|
|
||||||
scrollActiveSidebar(this.router);
|
scrollActiveSidebar(this.router);
|
||||||
|
|
||||||
@@ -136,6 +136,8 @@ export function renderMixin(proto) {
|
|||||||
dom.before(main, wrapper.children[0]);
|
dom.before(main, wrapper.children[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto2top && scroll2Top(auto2top);
|
||||||
};
|
};
|
||||||
|
|
||||||
proto._renderNav = function(text) {
|
proto._renderNav = function(text) {
|
||||||
|
|||||||
@@ -18,8 +18,7 @@ export function slugify(str) {
|
|||||||
.replace(/<[^>\d]+>/g, '')
|
.replace(/<[^>\d]+>/g, '')
|
||||||
.replace(re, '')
|
.replace(re, '')
|
||||||
.replace(/\s/g, '-')
|
.replace(/\s/g, '-')
|
||||||
.replace(/-+/g, '-')
|
.replace(/-+/g, '-');
|
||||||
.replace(/^(\d)/, '_$1');
|
|
||||||
let count = cache[slug];
|
let count = cache[slug];
|
||||||
|
|
||||||
count = hasOwn.call(cache, slug) ? count + 1 : 0;
|
count = hasOwn.call(cache, slug) ? count + 1 : 0;
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
export function getAndRemoveConfig(str = '') {
|
|
||||||
const config = {};
|
|
||||||
|
|
||||||
if (str) {
|
|
||||||
str = str
|
|
||||||
.replace(/^'/, '')
|
|
||||||
.replace(/'$/, '')
|
|
||||||
.replace(/(?:^|\s):([\w-]+:?)=?([\w-]+)?/g, (m, key, value) => {
|
|
||||||
if (key.indexOf(':') === -1) {
|
|
||||||
config[key] = (value && value.replace(/"/g, '')) || true;
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
return m;
|
|
||||||
})
|
|
||||||
.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
return { str, config };
|
|
||||||
}
|
|
||||||
@@ -30,25 +30,7 @@ export class HashHistory extends History {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onchange(cb = noop) {
|
onchange(cb = noop) {
|
||||||
// The hashchange event does not tell us if it originated from
|
on('hashchange', cb);
|
||||||
// a clicked link or by moving back/forward in the history;
|
|
||||||
// therefore we set a `navigating` flag when a link is clicked
|
|
||||||
// to be able to tell these two scenarios apart
|
|
||||||
let navigating = false;
|
|
||||||
|
|
||||||
on('click', e => {
|
|
||||||
const el = e.target.tagName === 'A' ? e.target : e.target.parentNode;
|
|
||||||
|
|
||||||
if (el.tagName === 'A' && !/_blank/.test(el.target)) {
|
|
||||||
navigating = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
on('hashchange', e => {
|
|
||||||
const source = navigating ? 'navigate' : 'history';
|
|
||||||
navigating = false;
|
|
||||||
cb({ event: e, source });
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
normalize() {
|
normalize() {
|
||||||
|
|||||||
@@ -28,13 +28,11 @@ export class HTML5History extends History {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const url = el.href;
|
const url = el.href;
|
||||||
window.history.pushState({ key: url }, '', url);
|
window.history.pushState({ key: url }, '', url);
|
||||||
cb({ event: e, source: 'navigate' });
|
cb();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
on('popstate', e => {
|
on('popstate', cb);
|
||||||
cb({ event: e, source: 'history' });
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { supportsPushState } from '../util/env';
|
import { supportsPushState } from '../util/env';
|
||||||
import * as dom from '../util/dom';
|
import * as dom from '../util/dom';
|
||||||
import { noop } from '../util/core';
|
|
||||||
import { HashHistory } from './history/hash';
|
import { HashHistory } from './history/hash';
|
||||||
import { HTML5History } from './history/html5';
|
import { HTML5History } from './history/html5';
|
||||||
|
|
||||||
@@ -32,16 +31,16 @@ export function initRouter(vm) {
|
|||||||
lastRoute = vm.route;
|
lastRoute = vm.route;
|
||||||
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
router.onchange(params => {
|
router.onchange(_ => {
|
||||||
updateRender(vm);
|
updateRender(vm);
|
||||||
vm._updateRender();
|
vm._updateRender();
|
||||||
|
|
||||||
if (lastRoute.path === vm.route.path) {
|
if (lastRoute.path === vm.route.path) {
|
||||||
vm.$resetEvents(params.source);
|
vm.$resetEvents();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
vm.$fetch(noop, vm.$resetEvents.bind(vm, params.source));
|
vm.$fetch();
|
||||||
lastRoute = vm.route;
|
lastRoute = vm.route;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,7 +120,6 @@ li input[type='checkbox']
|
|||||||
margin 0 1rem
|
margin 0 1rem
|
||||||
padding 5px 0
|
padding 5px 0
|
||||||
position relative
|
position relative
|
||||||
cursor pointer
|
|
||||||
|
|
||||||
ul
|
ul
|
||||||
background-color #fff
|
background-color #fff
|
||||||
@@ -278,9 +277,8 @@ main.hidden
|
|||||||
transition opacity 0.3s
|
transition opacity 0.3s
|
||||||
width $sidebar-width - 16px
|
width $sidebar-width - 16px
|
||||||
z-index 30
|
z-index 30
|
||||||
cursor pointer
|
|
||||||
|
|
||||||
&:hover .sidebar-toggle-button
|
.sidebar-toggle-button:hover
|
||||||
opacity 0.4
|
opacity 0.4
|
||||||
|
|
||||||
span
|
span
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ text
|
|||||||
|
|
||||||
expectSameDom(
|
expectSameDom(
|
||||||
output,
|
output,
|
||||||
'<p><img src="http://imageUrl" data-origin="http://imageUrl" alt="alt text"></p>'
|
'<p><img src="http://imageUrl" data-origin="http://imageUrl" alt="alt text" /></p>'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user