diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-30 19:47:21 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-30 19:47:21 +0100 |
| commit | a98b5ea6fe8e8cc98a55e0fd793e6e8660ea31c1 (patch) | |
| tree | 542810ab5aef99150db228bb54fd58303dcb31c7 /public/prism/prism-docker.min.js | |
| parent | ab355897a12b7bda1089a44de326d41455a0f7a3 (diff) | |
chore: add prismjs for syntax highlighting
Diffstat (limited to 'public/prism/prism-docker.min.js')
| -rw-r--r-- | public/prism/prism-docker.min.js | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/public/prism/prism-docker.min.js b/public/prism/prism-docker.min.js new file mode 100644 index 0000000..87e86ea --- /dev/null +++ b/public/prism/prism-docker.min.js @@ -0,0 +1,80 @@ +!(function (e) { + var r = '(?:[ \t]+(?![ \t])(?:<SP_BS>)?|<SP_BS>)'.replace( + /<SP_BS>/g, + function () { + return '\\\\[\r\n](?:\\s|\\\\[\r\n]|#.*(?!.))*(?![\\s#]|\\\\[\r\n])'; + } + ), + n = + '"(?:[^"\\\\\r\n]|\\\\(?:\r\n|[^]))*"|\'(?:[^\'\\\\\r\n]|\\\\(?:\r\n|[^]))*\'', + t = '--[\\w-]+=(?:<STR>|(?!["\'])(?:[^\\s\\\\]|\\\\.)+)'.replace( + /<STR>/g, + function () { + return n; + } + ), + o = { pattern: RegExp(n), greedy: !0 }, + i = { pattern: /(^[ \t]*)#.*/m, lookbehind: !0, greedy: !0 }; + function a(e, n) { + return ( + (e = e + .replace(/<OPT>/g, function () { + return t; + }) + .replace(/<SP>/g, function () { + return r; + })), + RegExp(e, n) + ); + } + (e.languages.docker = { + instruction: { + pattern: + /(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im, + lookbehind: !0, + greedy: !0, + inside: { + options: { + pattern: a('(^(?:ONBUILD<SP>)?\\w+<SP>)<OPT>(?:<SP><OPT>)*', 'i'), + lookbehind: !0, + greedy: !0, + inside: { + property: { pattern: /(^|\s)--[\w-]+/, lookbehind: !0 }, + string: [ + o, + { pattern: /(=)(?!["'])(?:[^\s\\]|\\.)+/, lookbehind: !0 }, + ], + operator: /\\$/m, + punctuation: /=/, + }, + }, + keyword: [ + { + pattern: a( + '(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\\b', + 'i' + ), + lookbehind: !0, + greedy: !0, + }, + { + pattern: a( + '(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \t\\\\]+<SP>)AS', + 'i' + ), + lookbehind: !0, + greedy: !0, + }, + { pattern: a('(^ONBUILD<SP>)\\w+', 'i'), lookbehind: !0, greedy: !0 }, + { pattern: /^\w+/, greedy: !0 }, + ], + comment: i, + string: o, + variable: /\$(?:\w+|\{[^{}"'\\]*\})/, + operator: /\\$/m, + }, + }, + comment: i, + }), + (e.languages.dockerfile = e.languages.docker); +})(Prism); |
