Skip to content

Commit

Permalink
fix: upgrade docsify
Browse files Browse the repository at this point in the history
  • Loading branch information
skyvow committed Apr 27, 2024
1 parent 1d86762 commit e3834d2
Show file tree
Hide file tree
Showing 14 changed files with 9,855 additions and 4,136 deletions.
13,881 changes: 9,752 additions & 4,129 deletions docs/_scripts/lib/docsify.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/_scripts/lib/docsify.min.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion docs/_scripts/lib/plugins/docsify-darklight-theme.min.css

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions docs/_scripts/lib/plugins/prism-json.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// https://www.json.org/json-en.html
Prism.languages.json = {
'property': {
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
lookbehind: true,
greedy: true
},
'string': {
pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
lookbehind: true,
greedy: true
},
'comment': {
pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
greedy: true
},
'number': /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
'punctuation': /[{}[\],]/,
'operator': /:/,
'boolean': /\b(?:false|true)\b/,
'null': {
pattern: /\bnull\b/,
alias: 'keyword'
}
};

Prism.languages.webmanifest = Prism.languages.json;
1 change: 1 addition & 0 deletions docs/_scripts/lib/plugins/prism-json.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 60 additions & 0 deletions docs/_scripts/lib/plugins/prism-typescript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
(function (Prism) {

Prism.languages.typescript = Prism.languages.extend('javascript', {
'class-name': {
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,
lookbehind: true,
greedy: true,
inside: null // see below
},
'builtin': /\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/,
});

// The keywords TypeScript adds to JavaScript
Prism.languages.typescript.keyword.push(
/\b(?:abstract|declare|is|keyof|readonly|require)\b/,
// keywords that have to be followed by an identifier
/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,
// This is for `import type *, {}`
/\btype\b(?=\s*(?:[\{*]|$))/
);

// doesn't work with TS because TS is too complex
delete Prism.languages.typescript['parameter'];
delete Prism.languages.typescript['literal-property'];

// a version of typescript specifically for highlighting types
var typeInside = Prism.languages.extend('typescript', {});
delete typeInside['class-name'];

Prism.languages.typescript['class-name'].inside = typeInside;

Prism.languages.insertBefore('typescript', 'function', {
'decorator': {
pattern: /@[$\w\xA0-\uFFFF]+/,
inside: {
'at': {
pattern: /^@/,
alias: 'operator'
},
'function': /^[\s\S]+/
}
},
'generic-function': {
// e.g. foo<T extends "bar" | "baz">( ...
pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,
greedy: true,
inside: {
'function': /^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,
'generic': {
pattern: /<[\s\S]+/, // everything after the first <
alias: 'class-name',
inside: typeInside
}
}
}
});

Prism.languages.ts = Prism.languages.typescript;

}(Prism));
1 change: 1 addition & 0 deletions docs/_scripts/lib/plugins/prism-typescript.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/_scripts/lib/plugins/prism.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/_scripts/lib/themes/buble.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/_scripts/lib/themes/dark.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/_scripts/lib/themes/pure.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/_scripts/lib/themes/vue.css

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@

<!-- Other Styles -->
<link rel="stylesheet" href="_scripts/lib/themes/vue.css" />
<link rel="stylesheet" href="_scripts/lib/plugins/prism.min.css">
<link
rel="stylesheet"
href="_scripts/lib/plugins/docsify-darklight-theme.min.css"
Expand Down Expand Up @@ -320,6 +321,8 @@
<script src="_scripts/lib/plugins/emoji.min.js"></script>
<script src="_scripts/lib/plugins/docsify-copy-code.min.js"></script>
<script src="_scripts/lib/plugins/progress.min.js"></script>
<script src="_scripts/lib/plugins/prism-typescript.min.js"></script>
<script src="_scripts/lib/plugins/prism-json.min.js"></script>
<script src="_scripts/lib/plugins/docsify-darklight-theme.min.js"></script>
<script src="_scripts/lib/plugins/gitalk.min.js"></script>
<script type="module" src="_scripts/modules/main.mjs"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/sw.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const version = 'wuxui_3.11.3_20240425_force'
const version = 'wuxui_3.11.3_20240427_force'
const __DEVELOPMENT__ = false
const __DEBUG__ = false
const offlineResources = [
Expand Down

0 comments on commit e3834d2

Please sign in to comment.