Skip to content

Commit

Permalink
Merge branch 'develop' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Koooooo-7 authored Apr 19, 2023
2 parents c07322f + c5ec510 commit bb15ce8
Show file tree
Hide file tree
Showing 21 changed files with 1,832 additions and 2,054 deletions.
2 changes: 0 additions & 2 deletions .github/FUNDING.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: npm # See documentation for possible values
directory: "/" # Location of package manifests
open-pull-requests-limit: 10
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
open-pull-requests-limit: 10
schedule:
interval: monthly
19 changes: 8 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
matrix:
node-version: ['lts/*']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
Expand All @@ -26,10 +26,7 @@ jobs:
- name: Lint
run: npm run lint

- name: Install dependencies [server-renderer]
working-directory: ./packages/docsify-server-renderer
run: npm ci --ignore-scripts
- name: Build [server-renderer]
- name: Verify dependencies [server-renderer]
working-directory: ./packages/docsify-server-renderer
run: npm ci --ignore-scripts

Expand All @@ -41,9 +38,9 @@ jobs:
node-version: ['lts/*']
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
Expand All @@ -62,9 +59,9 @@ jobs:
matrix:
node-version: ['lts/*']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
Expand All @@ -77,7 +74,7 @@ jobs:
- name: E2E Tests (Playwright)
run: npm run test:e2e
- name: Store artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: failure()
with:
name: ${{ matrix.os }}-${{ matrix.node-version }}-artifacts
Expand Down
30 changes: 9 additions & 21 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,6 @@ window.$docsify = {
};
```

## crossOriginLinks

- Type: `Array`

When `routerMode: 'history'`, you may face cross-origin issues. See [#1379](https://github.com/docsifyjs/docsify/issues/1379).
In Markdown content, there is a simple way to solve it: see extends Markdown syntax `Cross-Origin link` in [helpers](helpers.md).

```js
window.$docsify = {
crossOriginLinks: ['https://example.com/cross-origin-link'],
};
```

## el

- Type: `String`
Expand Down Expand Up @@ -688,6 +675,7 @@ window.$docsify = {
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.

A route function receives up to three parameters:

1. `route` - the path of the route that was requested (e.g. `/bar/baz`)
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']`)
3. `next` - this is a callback that you may call when your route function is async
Expand All @@ -701,23 +689,23 @@ window.$docsify = {
'/foo': '# Custom Markdown',

// RegEx match w/ synchronous function
'/bar/(.*)': function(route, matched) {
'/bar/(.*)': function (route, matched) {
return '# Custom Markdown';
},

// RegEx match w/ asynchronous function
'/baz/(.*)': function(route, matched, next) {
// Requires `fetch` polyfill for legacy browsers (https://github.github.io/fetch/)
'/baz/(.*)': function (route, matched, next) {
// Requires `fetch` polyfill for legacy browsers (https://github.github.io/fetch/)
fetch('/api/users?id=12345')
.then(function(response) {
.then(function (response) {
next('# Custom Markdown');
})
.catch(function(err) {
.catch(function (err) {
// Handle error...
});
}
}
}
},
},
};
```

Other than strings, route functions can return a falsy value (`null` \ `undefined`) to indicate that they ignore the current request:
Expand Down
8 changes: 0 additions & 8 deletions docs/helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ You will get `<a href="/demo/">link</a>`html. Do not worry, you can still set th
[link](/demo ':disabled')
```

## Cross-Origin link

Only when you set both the `routerMode: 'history'` and `externalLinkTarget: '_self'`, you need to add this configuration for those Cross-Origin links.

```md
[example.com](https://example.com/ ':crossorgin')
```

## GitHub Task Lists

```md
Expand Down
6 changes: 6 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
title="pure"
disabled
/>
<link
rel="stylesheet"
href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/dolphin.css"
title="dolphin"
disabled
/>
<style>
nav.app-nav li ul {
min-width: 100px;
Expand Down
2 changes: 2 additions & 0 deletions docs/more-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,5 @@ This header won't appear in the sidebar table of contents.
```

Both `<!-- {docsify-ignore} -->` and `<!-- {docsify-ignore-all} -->` will not be rendered on the page when used.

And the `{docsify-ignore}` and `{docsify-ignore-all}` can do the samething as well.
3 changes: 3 additions & 0 deletions docs/themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ There is a handful of themes available, both official and community-made. Copy [
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/buble.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/dark.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/pure.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/dolphin.css" />
```
<!-- prettier-ignore-end -->

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

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

<style>
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<link rel="stylesheet" href="/themes/dark.css" title="dark" disabled />
<link rel="stylesheet" href="/themes/buble.css" title="buble" disabled />
<link rel="stylesheet" href="/themes/pure.css" title="pure" disabled />
<link rel="stylesheet" href="/themes/dolphin.css" title="dolphin" disabled />
<style>
nav.app-nav li ul {
min-width: 100px;
Expand Down
Loading

0 comments on commit bb15ce8

Please sign in to comment.