From a98b5ea6fe8e8cc98a55e0fd793e6e8660ea31c1 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Thu, 30 Dec 2021 19:47:21 +0100 Subject: chore: add prismjs for syntax highlighting --- public/prism/prism-docker.min.js | 80 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 public/prism/prism-docker.min.js (limited to 'public/prism/prism-docker.min.js') 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])(?:)?|)'.replace( + //g, + function () { + return '\\\\[\r\n](?:\\s|\\\\[\r\n]|#.*(?!.))*(?![\\s#]|\\\\[\r\n])'; + } + ), + n = + '"(?:[^"\\\\\r\n]|\\\\(?:\r\n|[^]))*"|\'(?:[^\'\\\\\r\n]|\\\\(?:\r\n|[^]))*\'', + t = '--[\\w-]+=(?:|(?!["\'])(?:[^\\s\\\\]|\\\\.)+)'.replace( + //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(//g, function () { + return t; + }) + .replace(//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)?\\w+)(?:)*', '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)?HEALTHCHECK(?:)*)(?:CMD|NONE)\\b', + 'i' + ), + lookbehind: !0, + greedy: !0, + }, + { + pattern: a( + '(^(?:ONBUILD)?FROM(?:)*(?!--)[^ \t\\\\]+)AS', + 'i' + ), + lookbehind: !0, + greedy: !0, + }, + { pattern: a('(^ONBUILD)\\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); -- cgit v1.2.3