Skip to content

Commit f9b6ca1

Browse files
authored
Merge branch 'develop' into fix-non-asynchronous-embeds
2 parents 88345bd + f5ad3d2 commit f9b6ca1

25 files changed

+1871
-2080
lines changed

.github/FUNDING.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: npm # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
open-pull-requests-limit: 10
11+
schedule:
12+
interval: "weekly"
13+
- package-ecosystem: "github-actions"
14+
directory: "/"
15+
open-pull-requests-limit: 10
16+
schedule:
17+
interval: monthly

.github/workflows/test.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
matrix:
1414
node-version: ['lts/*']
1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
1717
- name: Setup Node.js ${{ matrix.node-version }}
18-
uses: actions/setup-node@v2
18+
uses: actions/setup-node@v3
1919
with:
2020
node-version: ${{ matrix.node-version }}
2121
cache: 'npm'
@@ -26,10 +26,7 @@ jobs:
2626
- name: Lint
2727
run: npm run lint
2828

29-
- name: Install dependencies [server-renderer]
30-
working-directory: ./packages/docsify-server-renderer
31-
run: npm ci --ignore-scripts
32-
- name: Build [server-renderer]
29+
- name: Verify dependencies [server-renderer]
3330
working-directory: ./packages/docsify-server-renderer
3431
run: npm ci --ignore-scripts
3532

@@ -41,9 +38,9 @@ jobs:
4138
node-version: ['lts/*']
4239
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
4340
steps:
44-
- uses: actions/checkout@v2
41+
- uses: actions/checkout@v3
4542
- name: Setup Node.js ${{ matrix.node-version }}
46-
uses: actions/setup-node@v2
43+
uses: actions/setup-node@v3
4744
with:
4845
node-version: ${{ matrix.node-version }}
4946
cache: 'npm'
@@ -62,9 +59,9 @@ jobs:
6259
matrix:
6360
node-version: ['lts/*']
6461
steps:
65-
- uses: actions/checkout@v2
62+
- uses: actions/checkout@v3
6663
- name: Setup Node.js ${{ matrix.node-version }}
67-
uses: actions/setup-node@v2
64+
uses: actions/setup-node@v3
6865
with:
6966
node-version: ${{ matrix.node-version }}
7067
cache: 'npm'
@@ -77,7 +74,7 @@ jobs:
7774
- name: E2E Tests (Playwright)
7875
run: npm run test:e2e
7976
- name: Store artifacts
80-
uses: actions/upload-artifact@v2
77+
uses: actions/upload-artifact@v3
8178
if: failure()
8279
with:
8380
name: ${{ matrix.os }}-${{ matrix.node-version }}-artifacts

docs/configuration.md

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -140,19 +140,6 @@ window.$docsify = {
140140
};
141141
```
142142

143-
## crossOriginLinks
144-
145-
- Type: `Array`
146-
147-
When `routerMode: 'history'`, you may face cross-origin issues. See [#1379](https://github.com/docsifyjs/docsify/issues/1379).
148-
In Markdown content, there is a simple way to solve it: see extends Markdown syntax `Cross-Origin link` in [helpers](helpers.md).
149-
150-
```js
151-
window.$docsify = {
152-
crossOriginLinks: ['https://example.com/cross-origin-link'],
153-
};
154-
```
155-
156143
## el
157144

158145
- Type: `String`
@@ -688,6 +675,7 @@ window.$docsify = {
688675
Define "virtual" routes that can provide content dynamically. A route is a map between the expected path, to either a string or a function. If the mapped value is a string, it is treated as markdown and parsed accordingly. If it is a function, it is expected to return markdown content.
689676

690677
A route function receives up to three parameters:
678+
691679
1. `route` - the path of the route that was requested (e.g. `/bar/baz`)
692680
2. `matched` - the [`RegExpMatchArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match) that was matched by the route (e.g. for `/bar/(.+)`, you get `['/bar/baz', 'baz']`)
693681
3. `next` - this is a callback that you may call when your route function is async
@@ -701,23 +689,23 @@ window.$docsify = {
701689
'/foo': '# Custom Markdown',
702690

703691
// RegEx match w/ synchronous function
704-
'/bar/(.*)': function(route, matched) {
692+
'/bar/(.*)': function (route, matched) {
705693
return '# Custom Markdown';
706694
},
707695

708696
// RegEx match w/ asynchronous function
709-
'/baz/(.*)': function(route, matched, next) {
710-
// Requires `fetch` polyfill for legacy browsers (https://github.github.io/fetch/)
697+
'/baz/(.*)': function (route, matched, next) {
698+
// Requires `fetch` polyfill for legacy browsers (https://github.github.io/fetch/)
711699
fetch('/api/users?id=12345')
712-
.then(function(response) {
700+
.then(function (response) {
713701
next('# Custom Markdown');
714702
})
715-
.catch(function(err) {
703+
.catch(function (err) {
716704
// Handle error...
717705
});
718-
}
719-
}
720-
}
706+
},
707+
},
708+
};
721709
```
722710

723711
Other than strings, route functions can return a falsy value (`null` \ `undefined`) to indicate that they ignore the current request:

docs/helpers.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,6 @@ You will get `<a href="/demo/">link</a>`html. Do not worry, you can still set th
6565
[link](/demo ':disabled')
6666
```
6767

68-
## Cross-Origin link
69-
70-
Only when you set both the `routerMode: 'history'` and `externalLinkTarget: '_self'`, you need to add this configuration for those Cross-Origin links.
71-
72-
```md
73-
[example.com](https://example.com/ ':crossorgin')
74-
```
75-
7668
## GitHub Task Lists
7769

7870
```md

docs/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@
4141
title="pure"
4242
disabled
4343
/>
44+
<link
45+
rel="stylesheet"
46+
href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/dolphin.css"
47+
title="dolphin"
48+
disabled
49+
/>
4450
<style>
4551
nav.app-nav li ul {
4652
min-width: 100px;

docs/more-pages.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,5 @@ This header won't appear in the sidebar table of contents.
135135
```
136136

137137
Both `<!-- {docsify-ignore} -->` and `<!-- {docsify-ignore-all} -->` will not be rendered on the page when used.
138+
139+
And the `{docsify-ignore}` and `{docsify-ignore-all}` can do the samething as well.

docs/themes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ There is a handful of themes available, both official and community-made. Copy [
88
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/buble.css" />
99
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/dark.css" />
1010
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/pure.css" />
11+
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/dolphin.css" />
1112
```
1213
<!-- prettier-ignore-end -->
1314

@@ -21,6 +22,7 @@ There is a handful of themes available, both official and community-made. Copy [
2122
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/buble.css" />
2223
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/dark.css" />
2324
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/pure.css" />
25+
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/lib/themes/dolphin.css" />
2426
```
2527
<!-- prettier-ignore-end -->
2628

@@ -33,6 +35,7 @@ If you have any ideas or would like to develop a new theme, you are welcome to s
3335
<a data-theme="buble">buble.css</a>
3436
<a data-theme="dark">dark.css</a>
3537
<a data-theme="pure">pure.css</a>
38+
<a data-theme="dolphin">dolphin.css</a>
3639
</div>
3740

3841
<style>

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<link rel="stylesheet" href="/themes/dark.css" title="dark" disabled />
1010
<link rel="stylesheet" href="/themes/buble.css" title="buble" disabled />
1111
<link rel="stylesheet" href="/themes/pure.css" title="pure" disabled />
12+
<link rel="stylesheet" href="/themes/dolphin.css" title="dolphin" disabled />
1213
<style>
1314
nav.app-nav li ul {
1415
min-width: 100px;

0 commit comments

Comments
 (0)