@kg-ui/kg-ui-plus 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/es/KgCopilot/CopiContent/AnswerHead.vue.mjs +16 -0
- package/dist/es/KgCopilot/CopiContent/AnswerHead.vue2.mjs +4 -0
- package/dist/es/KgCopilot/CopiContent/UserHead.vue.mjs +26 -0
- package/dist/es/KgCopilot/CopiContent/UserHead.vue2.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue2.mjs +49 -0
- package/dist/es/KgCopilot/CopiFooter/components/NewTheme.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue2.mjs +94 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SelectPlugin.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue2.mjs +33 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/SpeechControl.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue2.mjs +140 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/Upload.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue2.mjs +131 -0
- package/dist/es/KgCopilot/CopiFooter/components/SearchInput/index.vue3.mjs +4 -0
- package/dist/es/KgCopilot/CopiFooter/index.vue.mjs +7 -0
- package/dist/es/KgCopilot/CopiFooter/index.vue2.mjs +21 -0
- package/dist/es/KgCopilot/CopiFooter/index.vue3.mjs +4 -0
- package/dist/es/KgCopilot/dialogue/index.vue.mjs +7 -0
- package/dist/es/KgCopilot/dialogue/index.vue2.mjs +131 -0
- package/dist/es/KgCopilot/dialogue/index.vue3.mjs +4 -0
- package/dist/es/KgCopilot/dialogue/mdInCode.mjs +56 -0
- package/dist/es/KgCopilot/dialogue/readMd.vue.mjs +7 -0
- package/dist/es/KgCopilot/dialogue/readMd.vue2.mjs +87 -0
- package/dist/es/KgCopilot/dialogue/readMd.vue3.mjs +4 -0
- package/dist/es/KgCopilot/index.vue.mjs +7 -0
- package/dist/es/KgCopilot/index.vue2.mjs +49 -0
- package/dist/es/KgCopilot/index.vue3.mjs +4 -0
- package/dist/es/_virtual/___vite-browser-external.mjs +6 -0
- package/dist/es/_virtual/__vite-browser-external.mjs +4 -0
- package/dist/es/_virtual/_commonjsHelpers.mjs +34 -0
- package/dist/es/_virtual/_plugin-vue_export-helper.mjs +10 -0
- package/dist/es/_virtual/index.mjs +13 -0
- package/dist/es/api/project.mjs +51 -0
- package/dist/es/directives/heighlight/index.mjs +69 -0
- package/dist/es/directives/index.mjs +4 -0
- package/dist/es/home/LFilter/FilterArea.vue.mjs +7 -0
- package/dist/es/home/LFilter/FilterArea.vue2.mjs +507 -0
- package/dist/es/home/LFilter/FilterArea.vue3.mjs +4 -0
- package/dist/es/home/LFilter/FilterHead.vue.mjs +129 -0
- package/dist/es/home/LFilter/FilterHead.vue2.mjs +4 -0
- package/dist/es/home/LFilter/FilterItem.vue.mjs +7 -0
- package/dist/es/home/LFilter/FilterItem.vue2.mjs +114 -0
- package/dist/es/home/LFilter/FilterItem.vue3.mjs +4 -0
- package/dist/es/home/LFilter/FilterItemIcon.vue.mjs +7 -0
- package/dist/es/home/LFilter/FilterItemIcon.vue2.mjs +171 -0
- package/dist/es/home/LFilter/FilterItemIcon.vue3.mjs +4 -0
- package/dist/es/home/LFilter/index.vue.mjs +17 -0
- package/dist/es/home/LFilter/index.vue2.mjs +4 -0
- package/dist/es/home/LProject/index.vue.mjs +7 -0
- package/dist/es/home/LProject/index.vue2.mjs +70 -0
- package/dist/es/home/LProject/index.vue3.mjs +4 -0
- package/dist/es/home/index.vue.mjs +7 -0
- package/dist/es/home/index.vue2.mjs +80 -0
- package/dist/es/home/index.vue3.mjs +4 -0
- package/dist/es/index.mjs +26 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/check.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/circle-plus.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/close.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/microphone.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/paperclip.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/promotion.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ep@1.2.7/node_modules/@iconify-icons/ep/upload.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/copy-simple.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/speaker-high-light.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/thumbs-down-thin.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/thumbs-up-thin.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ph@1.2.5/node_modules/@iconify-icons/ph/warning-bold.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/add-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/arrow-down-s-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/arrow-up-s-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/check-fill.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/download-line.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@iconify-icons_ri@1.2.3/node_modules/@iconify-icons/ri/more-2-fill.mjs +8 -0
- package/dist/es/node_modules/.pnpm/@pureadmin_utils@1.8.5_vue@3.2.45/node_modules/@pureadmin/utils/dist/index.mjs +70 -0
- package/dist/es/node_modules/.pnpm/call-bind@1.0.7/node_modules/call-bind/callBound.mjs +16 -0
- package/dist/es/node_modules/.pnpm/call-bind@1.0.7/node_modules/call-bind/index.mjs +36 -0
- package/dist/es/node_modules/.pnpm/define-data-property@1.1.4/node_modules/define-data-property/index.mjs +48 -0
- package/dist/es/node_modules/.pnpm/dompurify@3.0.10/node_modules/dompurify/dist/purify.es.mjs +949 -0
- package/dist/es/node_modules/.pnpm/es-define-property@1.0.0/node_modules/es-define-property/index.mjs +22 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/eval.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/index.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/range.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/ref.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/syntax.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/type.mjs +4 -0
- package/dist/es/node_modules/.pnpm/es-errors@1.3.0/node_modules/es-errors/uri.mjs +4 -0
- package/dist/es/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.mjs +72 -0
- package/dist/es/node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.mjs +6 -0
- package/dist/es/node_modules/.pnpm/get-intrinsic@1.2.4/node_modules/get-intrinsic/index.mjs +320 -0
- package/dist/es/node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.mjs +14 -0
- package/dist/es/node_modules/.pnpm/has-property-descriptors@1.0.2/node_modules/has-property-descriptors/index.mjs +19 -0
- package/dist/es/node_modules/.pnpm/has-proto@1.0.3/node_modules/has-proto/index.mjs +11 -0
- package/dist/es/node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/index.mjs +21 -0
- package/dist/es/node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.mjs +48 -0
- package/dist/es/node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.mjs +8 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/core.mjs +5 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/apache.mjs +91 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/bash.mjs +377 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/basic.mjs +221 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/c.mjs +280 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/css.mjs +732 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dart.mjs +247 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/django.mjs +47 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dns.mjs +71 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dos.mjs +160 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/dust.mjs +38 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/erlang.mjs +176 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/go.mjs +135 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/http.mjs +89 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/java.mjs +254 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/javascript.mjs +698 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/json.mjs +40 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/markdown.mjs +227 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/nginx.mjs +144 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/php.mjs +589 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/python.mjs +414 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/ruby.mjs +414 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/stylus.mjs +766 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/swift.mjs +832 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/typescript.mjs +788 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/es/languages/xml.mjs +227 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/lib/core.mjs +1580 -0
- package/dist/es/node_modules/.pnpm/highlight.js@11.9.0/node_modules/highlight.js/styles/paraiso-light.css.mjs +4 -0
- package/dist/es/node_modules/.pnpm/marked@12.0.1/node_modules/marked/lib/marked.esm.mjs +2045 -0
- package/dist/es/node_modules/.pnpm/object-inspect@1.13.1/node_modules/object-inspect/index.mjs +514 -0
- package/dist/es/node_modules/.pnpm/pinyin-match@1.2.4/node_modules/pinyin-match/es/main.mjs +124 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/formats.mjs +22 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/index.mjs +14 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/parse.mjs +199 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/stringify.mjs +262 -0
- package/dist/es/node_modules/.pnpm/qs@6.11.0/node_modules/qs/lib/utils.mjs +196 -0
- package/dist/es/node_modules/.pnpm/set-function-length@1.2.2/node_modules/set-function-length/index.mjs +54 -0
- package/dist/es/node_modules/.pnpm/side-channel@1.0.6/node_modules/side-channel/index.mjs +115 -0
- package/dist/es/store/index.mjs +8 -0
- package/dist/es/store/modules/copilot.mjs +111 -0
- package/dist/es/store/modules/filters.mjs +346 -0
- package/dist/es/store/modules/types.mjs +19 -0
- package/dist/es/style/index.scss.mjs +4 -0
- package/dist/es/style/tailwind.css.mjs +4 -0
- package/dist/es/style.css +1 -0
- package/dist/es/utils/home.mjs +129 -0
- package/dist/es/utils/http/index.mjs +90 -0
- package/dist/es/utils/message.mjs +42 -0
- package/package.json +23 -32
@@ -0,0 +1,40 @@
|
|
1
|
+
function json(hljs) {
|
2
|
+
const ATTRIBUTE = {
|
3
|
+
className: "attr",
|
4
|
+
begin: /"(\\.|[^\\"\r\n])*"(?=\s*:)/,
|
5
|
+
relevance: 1.01
|
6
|
+
};
|
7
|
+
const PUNCTUATION = {
|
8
|
+
match: /[{}[\],:]/,
|
9
|
+
className: "punctuation",
|
10
|
+
relevance: 0
|
11
|
+
};
|
12
|
+
const LITERALS = [
|
13
|
+
"true",
|
14
|
+
"false",
|
15
|
+
"null"
|
16
|
+
];
|
17
|
+
const LITERALS_MODE = {
|
18
|
+
scope: "literal",
|
19
|
+
beginKeywords: LITERALS.join(" ")
|
20
|
+
};
|
21
|
+
return {
|
22
|
+
name: "JSON",
|
23
|
+
keywords: {
|
24
|
+
literal: LITERALS
|
25
|
+
},
|
26
|
+
contains: [
|
27
|
+
ATTRIBUTE,
|
28
|
+
PUNCTUATION,
|
29
|
+
hljs.QUOTE_STRING_MODE,
|
30
|
+
LITERALS_MODE,
|
31
|
+
hljs.C_NUMBER_MODE,
|
32
|
+
hljs.C_LINE_COMMENT_MODE,
|
33
|
+
hljs.C_BLOCK_COMMENT_MODE
|
34
|
+
],
|
35
|
+
illegal: "\\S"
|
36
|
+
};
|
37
|
+
}
|
38
|
+
export {
|
39
|
+
json as default
|
40
|
+
};
|
@@ -0,0 +1,227 @@
|
|
1
|
+
function markdown(hljs) {
|
2
|
+
const regex = hljs.regex;
|
3
|
+
const INLINE_HTML = {
|
4
|
+
begin: /<\/?[A-Za-z_]/,
|
5
|
+
end: ">",
|
6
|
+
subLanguage: "xml",
|
7
|
+
relevance: 0
|
8
|
+
};
|
9
|
+
const HORIZONTAL_RULE = {
|
10
|
+
begin: "^[-\\*]{3,}",
|
11
|
+
end: "$"
|
12
|
+
};
|
13
|
+
const CODE = {
|
14
|
+
className: "code",
|
15
|
+
variants: [
|
16
|
+
// TODO: fix to allow these to work with sublanguage also
|
17
|
+
{ begin: "(`{3,})[^`](.|\\n)*?\\1`*[ ]*" },
|
18
|
+
{ begin: "(~{3,})[^~](.|\\n)*?\\1~*[ ]*" },
|
19
|
+
// needed to allow markdown as a sublanguage to work
|
20
|
+
{
|
21
|
+
begin: "```",
|
22
|
+
end: "```+[ ]*$"
|
23
|
+
},
|
24
|
+
{
|
25
|
+
begin: "~~~",
|
26
|
+
end: "~~~+[ ]*$"
|
27
|
+
},
|
28
|
+
{ begin: "`.+?`" },
|
29
|
+
{
|
30
|
+
begin: "(?=^( {4}|\\t))",
|
31
|
+
// use contains to gobble up multiple lines to allow the block to be whatever size
|
32
|
+
// but only have a single open/close tag vs one per line
|
33
|
+
contains: [
|
34
|
+
{
|
35
|
+
begin: "^( {4}|\\t)",
|
36
|
+
end: "(\\n)$"
|
37
|
+
}
|
38
|
+
],
|
39
|
+
relevance: 0
|
40
|
+
}
|
41
|
+
]
|
42
|
+
};
|
43
|
+
const LIST = {
|
44
|
+
className: "bullet",
|
45
|
+
begin: "^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",
|
46
|
+
end: "\\s+",
|
47
|
+
excludeEnd: true
|
48
|
+
};
|
49
|
+
const LINK_REFERENCE = {
|
50
|
+
begin: /^\[[^\n]+\]:/,
|
51
|
+
returnBegin: true,
|
52
|
+
contains: [
|
53
|
+
{
|
54
|
+
className: "symbol",
|
55
|
+
begin: /\[/,
|
56
|
+
end: /\]/,
|
57
|
+
excludeBegin: true,
|
58
|
+
excludeEnd: true
|
59
|
+
},
|
60
|
+
{
|
61
|
+
className: "link",
|
62
|
+
begin: /:\s*/,
|
63
|
+
end: /$/,
|
64
|
+
excludeBegin: true
|
65
|
+
}
|
66
|
+
]
|
67
|
+
};
|
68
|
+
const URL_SCHEME = /[A-Za-z][A-Za-z0-9+.-]*/;
|
69
|
+
const LINK = {
|
70
|
+
variants: [
|
71
|
+
// too much like nested array access in so many languages
|
72
|
+
// to have any real relevance
|
73
|
+
{
|
74
|
+
begin: /\[.+?\]\[.*?\]/,
|
75
|
+
relevance: 0
|
76
|
+
},
|
77
|
+
// popular internet URLs
|
78
|
+
{
|
79
|
+
begin: /\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,
|
80
|
+
relevance: 2
|
81
|
+
},
|
82
|
+
{
|
83
|
+
begin: regex.concat(/\[.+?\]\(/, URL_SCHEME, /:\/\/.*?\)/),
|
84
|
+
relevance: 2
|
85
|
+
},
|
86
|
+
// relative urls
|
87
|
+
{
|
88
|
+
begin: /\[.+?\]\([./?&#].*?\)/,
|
89
|
+
relevance: 1
|
90
|
+
},
|
91
|
+
// whatever else, lower relevance (might not be a link at all)
|
92
|
+
{
|
93
|
+
begin: /\[.*?\]\(.*?\)/,
|
94
|
+
relevance: 0
|
95
|
+
}
|
96
|
+
],
|
97
|
+
returnBegin: true,
|
98
|
+
contains: [
|
99
|
+
{
|
100
|
+
// empty strings for alt or link text
|
101
|
+
match: /\[(?=\])/
|
102
|
+
},
|
103
|
+
{
|
104
|
+
className: "string",
|
105
|
+
relevance: 0,
|
106
|
+
begin: "\\[",
|
107
|
+
end: "\\]",
|
108
|
+
excludeBegin: true,
|
109
|
+
returnEnd: true
|
110
|
+
},
|
111
|
+
{
|
112
|
+
className: "link",
|
113
|
+
relevance: 0,
|
114
|
+
begin: "\\]\\(",
|
115
|
+
end: "\\)",
|
116
|
+
excludeBegin: true,
|
117
|
+
excludeEnd: true
|
118
|
+
},
|
119
|
+
{
|
120
|
+
className: "symbol",
|
121
|
+
relevance: 0,
|
122
|
+
begin: "\\]\\[",
|
123
|
+
end: "\\]",
|
124
|
+
excludeBegin: true,
|
125
|
+
excludeEnd: true
|
126
|
+
}
|
127
|
+
]
|
128
|
+
};
|
129
|
+
const BOLD = {
|
130
|
+
className: "strong",
|
131
|
+
contains: [],
|
132
|
+
// defined later
|
133
|
+
variants: [
|
134
|
+
{
|
135
|
+
begin: /_{2}(?!\s)/,
|
136
|
+
end: /_{2}/
|
137
|
+
},
|
138
|
+
{
|
139
|
+
begin: /\*{2}(?!\s)/,
|
140
|
+
end: /\*{2}/
|
141
|
+
}
|
142
|
+
]
|
143
|
+
};
|
144
|
+
const ITALIC = {
|
145
|
+
className: "emphasis",
|
146
|
+
contains: [],
|
147
|
+
// defined later
|
148
|
+
variants: [
|
149
|
+
{
|
150
|
+
begin: /\*(?![*\s])/,
|
151
|
+
end: /\*/
|
152
|
+
},
|
153
|
+
{
|
154
|
+
begin: /_(?![_\s])/,
|
155
|
+
end: /_/,
|
156
|
+
relevance: 0
|
157
|
+
}
|
158
|
+
]
|
159
|
+
};
|
160
|
+
const BOLD_WITHOUT_ITALIC = hljs.inherit(BOLD, { contains: [] });
|
161
|
+
const ITALIC_WITHOUT_BOLD = hljs.inherit(ITALIC, { contains: [] });
|
162
|
+
BOLD.contains.push(ITALIC_WITHOUT_BOLD);
|
163
|
+
ITALIC.contains.push(BOLD_WITHOUT_ITALIC);
|
164
|
+
let CONTAINABLE = [
|
165
|
+
INLINE_HTML,
|
166
|
+
LINK
|
167
|
+
];
|
168
|
+
[
|
169
|
+
BOLD,
|
170
|
+
ITALIC,
|
171
|
+
BOLD_WITHOUT_ITALIC,
|
172
|
+
ITALIC_WITHOUT_BOLD
|
173
|
+
].forEach((m) => {
|
174
|
+
m.contains = m.contains.concat(CONTAINABLE);
|
175
|
+
});
|
176
|
+
CONTAINABLE = CONTAINABLE.concat(BOLD, ITALIC);
|
177
|
+
const HEADER = {
|
178
|
+
className: "section",
|
179
|
+
variants: [
|
180
|
+
{
|
181
|
+
begin: "^#{1,6}",
|
182
|
+
end: "$",
|
183
|
+
contains: CONTAINABLE
|
184
|
+
},
|
185
|
+
{
|
186
|
+
begin: "(?=^.+?\\n[=-]{2,}$)",
|
187
|
+
contains: [
|
188
|
+
{ begin: "^[=-]*$" },
|
189
|
+
{
|
190
|
+
begin: "^",
|
191
|
+
end: "\\n",
|
192
|
+
contains: CONTAINABLE
|
193
|
+
}
|
194
|
+
]
|
195
|
+
}
|
196
|
+
]
|
197
|
+
};
|
198
|
+
const BLOCKQUOTE = {
|
199
|
+
className: "quote",
|
200
|
+
begin: "^>\\s+",
|
201
|
+
contains: CONTAINABLE,
|
202
|
+
end: "$"
|
203
|
+
};
|
204
|
+
return {
|
205
|
+
name: "Markdown",
|
206
|
+
aliases: [
|
207
|
+
"md",
|
208
|
+
"mkdown",
|
209
|
+
"mkd"
|
210
|
+
],
|
211
|
+
contains: [
|
212
|
+
HEADER,
|
213
|
+
INLINE_HTML,
|
214
|
+
LIST,
|
215
|
+
BOLD,
|
216
|
+
ITALIC,
|
217
|
+
BLOCKQUOTE,
|
218
|
+
CODE,
|
219
|
+
HORIZONTAL_RULE,
|
220
|
+
LINK,
|
221
|
+
LINK_REFERENCE
|
222
|
+
]
|
223
|
+
};
|
224
|
+
}
|
225
|
+
export {
|
226
|
+
markdown as default
|
227
|
+
};
|
@@ -0,0 +1,144 @@
|
|
1
|
+
function nginx(hljs) {
|
2
|
+
const regex = hljs.regex;
|
3
|
+
const VAR = {
|
4
|
+
className: "variable",
|
5
|
+
variants: [
|
6
|
+
{ begin: /\$\d+/ },
|
7
|
+
{ begin: /\$\{\w+\}/ },
|
8
|
+
{ begin: regex.concat(/[$@]/, hljs.UNDERSCORE_IDENT_RE) }
|
9
|
+
]
|
10
|
+
};
|
11
|
+
const LITERALS = [
|
12
|
+
"on",
|
13
|
+
"off",
|
14
|
+
"yes",
|
15
|
+
"no",
|
16
|
+
"true",
|
17
|
+
"false",
|
18
|
+
"none",
|
19
|
+
"blocked",
|
20
|
+
"debug",
|
21
|
+
"info",
|
22
|
+
"notice",
|
23
|
+
"warn",
|
24
|
+
"error",
|
25
|
+
"crit",
|
26
|
+
"select",
|
27
|
+
"break",
|
28
|
+
"last",
|
29
|
+
"permanent",
|
30
|
+
"redirect",
|
31
|
+
"kqueue",
|
32
|
+
"rtsig",
|
33
|
+
"epoll",
|
34
|
+
"poll",
|
35
|
+
"/dev/poll"
|
36
|
+
];
|
37
|
+
const DEFAULT = {
|
38
|
+
endsWithParent: true,
|
39
|
+
keywords: {
|
40
|
+
$pattern: /[a-z_]{2,}|\/dev\/poll/,
|
41
|
+
literal: LITERALS
|
42
|
+
},
|
43
|
+
relevance: 0,
|
44
|
+
illegal: "=>",
|
45
|
+
contains: [
|
46
|
+
hljs.HASH_COMMENT_MODE,
|
47
|
+
{
|
48
|
+
className: "string",
|
49
|
+
contains: [
|
50
|
+
hljs.BACKSLASH_ESCAPE,
|
51
|
+
VAR
|
52
|
+
],
|
53
|
+
variants: [
|
54
|
+
{
|
55
|
+
begin: /"/,
|
56
|
+
end: /"/
|
57
|
+
},
|
58
|
+
{
|
59
|
+
begin: /'/,
|
60
|
+
end: /'/
|
61
|
+
}
|
62
|
+
]
|
63
|
+
},
|
64
|
+
// this swallows entire URLs to avoid detecting numbers within
|
65
|
+
{
|
66
|
+
begin: "([a-z]+):/",
|
67
|
+
end: "\\s",
|
68
|
+
endsWithParent: true,
|
69
|
+
excludeEnd: true,
|
70
|
+
contains: [VAR]
|
71
|
+
},
|
72
|
+
{
|
73
|
+
className: "regexp",
|
74
|
+
contains: [
|
75
|
+
hljs.BACKSLASH_ESCAPE,
|
76
|
+
VAR
|
77
|
+
],
|
78
|
+
variants: [
|
79
|
+
{
|
80
|
+
begin: "\\s\\^",
|
81
|
+
end: "\\s|\\{|;",
|
82
|
+
returnEnd: true
|
83
|
+
},
|
84
|
+
// regexp locations (~, ~*)
|
85
|
+
{
|
86
|
+
begin: "~\\*?\\s+",
|
87
|
+
end: "\\s|\\{|;",
|
88
|
+
returnEnd: true
|
89
|
+
},
|
90
|
+
// *.example.com
|
91
|
+
{ begin: "\\*(\\.[a-z\\-]+)+" },
|
92
|
+
// sub.example.*
|
93
|
+
{ begin: "([a-z\\-]+\\.)+\\*" }
|
94
|
+
]
|
95
|
+
},
|
96
|
+
// IP
|
97
|
+
{
|
98
|
+
className: "number",
|
99
|
+
begin: "\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"
|
100
|
+
},
|
101
|
+
// units
|
102
|
+
{
|
103
|
+
className: "number",
|
104
|
+
begin: "\\b\\d+[kKmMgGdshdwy]?\\b",
|
105
|
+
relevance: 0
|
106
|
+
},
|
107
|
+
VAR
|
108
|
+
]
|
109
|
+
};
|
110
|
+
return {
|
111
|
+
name: "Nginx config",
|
112
|
+
aliases: ["nginxconf"],
|
113
|
+
contains: [
|
114
|
+
hljs.HASH_COMMENT_MODE,
|
115
|
+
{
|
116
|
+
beginKeywords: "upstream location",
|
117
|
+
end: /;|\{/,
|
118
|
+
contains: DEFAULT.contains,
|
119
|
+
keywords: { section: "upstream location" }
|
120
|
+
},
|
121
|
+
{
|
122
|
+
className: "section",
|
123
|
+
begin: regex.concat(hljs.UNDERSCORE_IDENT_RE + regex.lookahead(/\s+\{/)),
|
124
|
+
relevance: 0
|
125
|
+
},
|
126
|
+
{
|
127
|
+
begin: regex.lookahead(hljs.UNDERSCORE_IDENT_RE + "\\s"),
|
128
|
+
end: ";|\\{",
|
129
|
+
contains: [
|
130
|
+
{
|
131
|
+
className: "attribute",
|
132
|
+
begin: hljs.UNDERSCORE_IDENT_RE,
|
133
|
+
starts: DEFAULT
|
134
|
+
}
|
135
|
+
],
|
136
|
+
relevance: 0
|
137
|
+
}
|
138
|
+
],
|
139
|
+
illegal: "[^\\s\\}\\{]"
|
140
|
+
};
|
141
|
+
}
|
142
|
+
export {
|
143
|
+
nginx as default
|
144
|
+
};
|