Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion layouts/shortcodes/agent-memory-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@

{{- /* ?v= is a hash of the file, so a reload never runs a stale cached copy. */ -}}
{{- $v := dict -}}
{{- range slice "css/context-retriever-demo.css" "css/agent-memory-demo.css" "js/agent-memory-demo.js" -}}
{{- range slice "css/context-retriever-demo.css" "css/agent-memory-demo.css" "js/demo-highlight.js" "js/agent-memory-demo.js" -}}
{{- $v = merge $v (dict . (substr (md5 (os.ReadFile (print "static/" .))) 0 10)) -}}
{{- end }}
<link rel="stylesheet" href="{{ "css/context-retriever-demo.css" | relURL }}?v={{ index $v "css/context-retriever-demo.css" }}">
<link rel="stylesheet" href="{{ "css/agent-memory-demo.css" | relURL }}?v={{ index $v "css/agent-memory-demo.css" }}">
<script defer src="{{ "js/demo-highlight.js" | relURL }}?v={{ index $v "js/demo-highlight.js" }}"></script>
<script defer src="{{ "js/agent-memory-demo.js" | relURL }}?v={{ index $v "js/agent-memory-demo.js" }}"></script>

<div class="rcr ram" data-ram>
Expand Down
1 change: 1 addition & 0 deletions layouts/shortcodes/context-retriever-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

{{- if not (.Page.Store.Get "rcrAssetsEmitted") -}}
<link rel="stylesheet" href="{{ "css/context-retriever-demo.css" | relURL }}">
<script defer src="{{ "js/demo-highlight.js" | relURL }}"></script>
<script defer src="{{ "js/context-retriever-demo.js" | relURL }}"></script>
{{- .Page.Store.Set "rcrAssetsEmitted" true -}}
{{- end -}}
Expand Down
3 changes: 2 additions & 1 deletion layouts/shortcodes/langcache-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@

{{- /* ?v= is a hash of the file, so a reload never runs a stale cached copy. */ -}}
{{- $v := dict -}}
{{- range slice "css/context-retriever-demo.css" "css/langcache-demo.css" "js/langcache-demo.js" -}}
{{- range slice "css/context-retriever-demo.css" "css/langcache-demo.css" "js/demo-highlight.js" "js/langcache-demo.js" -}}
{{- $v = merge $v (dict . (substr (md5 (os.ReadFile (print "static/" .))) 0 10)) -}}
{{- end }}
<link rel="stylesheet" href="{{ "css/context-retriever-demo.css" | relURL }}?v={{ index $v "css/context-retriever-demo.css" }}">
<link rel="stylesheet" href="{{ "css/langcache-demo.css" | relURL }}?v={{ index $v "css/langcache-demo.css" }}">
<script defer src="{{ "js/demo-highlight.js" | relURL }}?v={{ index $v "js/demo-highlight.js" }}"></script>
<script defer src="{{ "js/langcache-demo.js" | relURL }}?v={{ index $v "js/langcache-demo.js" }}"></script>

<div class="rcr rlc" data-rlc>
Expand Down
3 changes: 2 additions & 1 deletion layouts/shortcodes/rdi-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@

{{- /* ?v= is a hash of the file, so a reload never runs a stale cached copy. */ -}}
{{- $v := dict -}}
{{- range slice "css/context-retriever-demo.css" "css/rdi-demo.css" "js/rdi-demo.js" -}}
{{- range slice "css/context-retriever-demo.css" "css/rdi-demo.css" "js/demo-highlight.js" "js/rdi-demo.js" -}}
{{- $v = merge $v (dict . (substr (md5 (os.ReadFile (print "static/" .))) 0 10)) -}}
{{- end }}
<link rel="stylesheet" href="{{ "css/context-retriever-demo.css" | relURL }}?v={{ index $v "css/context-retriever-demo.css" }}">
<link rel="stylesheet" href="{{ "css/rdi-demo.css" | relURL }}?v={{ index $v "css/rdi-demo.css" }}">
<script defer src="{{ "js/demo-highlight.js" | relURL }}?v={{ index $v "js/demo-highlight.js" }}"></script>
<script defer src="{{ "js/rdi-demo.js" | relURL }}?v={{ index $v "js/rdi-demo.js" }}"></script>

<div class="rcr rdi" data-rdi>
Expand Down
3 changes: 2 additions & 1 deletion layouts/shortcodes/redisvl-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@

{{- /* ?v= is a hash of the file, so a reload never runs a stale cached copy. */ -}}
{{- $v := dict -}}
{{- range slice "css/context-retriever-demo.css" "css/redisvl-demo.css" "js/redisvl-demo.js" -}}
{{- range slice "css/context-retriever-demo.css" "css/redisvl-demo.css" "js/demo-highlight.js" "js/redisvl-demo.js" -}}
{{- $v = merge $v (dict . (substr (md5 (os.ReadFile (print "static/" .))) 0 10)) -}}
{{- end }}
<link rel="stylesheet" href="{{ "css/context-retriever-demo.css" | relURL }}?v={{ index $v "css/context-retriever-demo.css" }}">
<link rel="stylesheet" href="{{ "css/redisvl-demo.css" | relURL }}?v={{ index $v "css/redisvl-demo.css" }}">
<script defer src="{{ "js/demo-highlight.js" | relURL }}?v={{ index $v "js/demo-highlight.js" }}"></script>
<script defer src="{{ "js/redisvl-demo.js" | relURL }}?v={{ index $v "js/redisvl-demo.js" }}"></script>

<div class="rcr rvd" data-redisvl>
Expand Down
3 changes: 2 additions & 1 deletion layouts/shortcodes/search-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@

{{- /* ?v= is a hash of the file, so a reload never runs a stale cached copy. */ -}}
{{- $v := dict -}}
{{- range slice "css/context-retriever-demo.css" "css/search-demo.css" "css/search-index-demo.css" "js/search-demo.js" -}}
{{- range slice "css/context-retriever-demo.css" "css/search-demo.css" "css/search-index-demo.css" "js/demo-highlight.js" "js/search-demo.js" -}}
{{- $v = merge $v (dict . (substr (md5 (os.ReadFile (print "static/" .))) 0 10)) -}}
{{- end }}
<link rel="stylesheet" href="{{ "css/context-retriever-demo.css" | relURL }}?v={{ index $v "css/context-retriever-demo.css" }}">
<link rel="stylesheet" href="{{ "css/search-demo.css" | relURL }}?v={{ index $v "css/search-demo.css" }}">
<link rel="stylesheet" href="{{ "css/search-index-demo.css" | relURL }}?v={{ index $v "css/search-index-demo.css" }}">
<script defer src="{{ "js/demo-highlight.js" | relURL }}?v={{ index $v "js/demo-highlight.js" }}"></script>
<script defer src="{{ "js/search-demo.js" | relURL }}?v={{ index $v "js/search-demo.js" }}"></script>

<div class="rcr rsq rsi" data-search>
Expand Down
3 changes: 2 additions & 1 deletion layouts/shortcodes/search-index-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@

{{- /* ?v= is a hash of the file, so a reload never runs a stale cached copy. */ -}}
{{- $v := dict -}}
{{- range slice "css/context-retriever-demo.css" "css/search-demo.css" "css/search-index-demo.css" "js/search-index-demo.js" -}}
{{- range slice "css/context-retriever-demo.css" "css/search-demo.css" "css/search-index-demo.css" "js/demo-highlight.js" "js/search-index-demo.js" -}}
{{- $v = merge $v (dict . (substr (md5 (os.ReadFile (print "static/" .))) 0 10)) -}}
{{- end }}
<link rel="stylesheet" href="{{ "css/context-retriever-demo.css" | relURL }}?v={{ index $v "css/context-retriever-demo.css" }}">
<link rel="stylesheet" href="{{ "css/search-demo.css" | relURL }}?v={{ index $v "css/search-demo.css" }}">
<link rel="stylesheet" href="{{ "css/search-index-demo.css" | relURL }}?v={{ index $v "css/search-index-demo.css" }}">
<script defer src="{{ "js/demo-highlight.js" | relURL }}?v={{ index $v "js/demo-highlight.js" }}"></script>
<script defer src="{{ "js/search-index-demo.js" | relURL }}?v={{ index $v "js/search-index-demo.js" }}"></script>

<div class="rcr rsq rsi" data-search-index>
Expand Down
16 changes: 16 additions & 0 deletions static/css/context-retriever-demo.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,22 @@
.rcr-jn { color: #b35900; }
.rcr-jl { color: #c62828; }

/* Syntax highlighting from demo-highlight.js, in every demo's code blocks. The colors are Redis Insight's
Workbench colors, darkened where they're too light to read on a light background. */
.rcr .hl-cmd { color: #7547de; } /* a command or language keyword */
.rcr .hl-kw { color: #2c7d5d; } /* an option; Insight's #8cd7b9 */
.rcr .hl-key { color: #c724a1; } /* an index name or URL; Insight's #de47bb */
.rcr .hl-field { color: #b02c30; } /* an @field */
.rcr .hl-query { color: #4c68d5; } /* a query; Insight's #7b90e0 */
.rcr .hl-op { color: #167b80; } /* a query operator; Insight's #b9f0f3 */
.rcr .hl-fn { color: #7d53e0; } /* a function in a query; Insight's #9e7ee8 */
.rcr .hl-str { color: #a65b3c; } /* a string; Insight's dark #ce9178 */
.rcr .hl-num { color: #567844; } /* a number; Insight's dark #b5cea8, as its light #098658 matches the option green */
.rcr .hl-com { color: var(--rcr-faint); font-style: italic; }
.rcr .hl-faint { color: var(--rcr-faint); }
.rcr .hl-ok { color: #567844; font-weight: 600; }
.rcr .hl-err { color: var(--rcr-bad); }

/* ---- step 1: keys ---- */
.rcr-keylist { max-height: 420px; overflow: auto; padding: 6px; }
.rcr-group summary {
Expand Down
11 changes: 11 additions & 0 deletions static/css/iris-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,17 @@ body.iris-dark main .rcr .ram-type-episodic {
body.iris-dark main .rcr .rcr-jl {
color: #ff6b6b;
}
/* Syntax highlighting, in Redis Insight's dark Workbench colors. Its @field red is lightened to read on the dark code background. */
body.iris-dark main .rcr .hl-cmd { color: #c8b5f2; }
body.iris-dark main .rcr .hl-kw { color: #8cd7b9; }
body.iris-dark main .rcr .hl-key { color: #de47bb; }
body.iris-dark main .rcr .hl-field { color: #d65a5e; }
body.iris-dark main .rcr .hl-query { color: #7b90e0; }
body.iris-dark main .rcr .hl-op { color: #b9f0f3; }
body.iris-dark main .rcr .hl-fn { color: #9e7ee8; }
body.iris-dark main .rcr .hl-str { color: #ce9178; }
body.iris-dark main .rcr .hl-num,
body.iris-dark main .rcr .hl-ok { color: #b5cea8; }

/* The Iris overview demo is also .rcr. Its highlighter chips and reply parts keep
their pastel service colors, so the text on them stays dark. */
Expand Down
4 changes: 2 additions & 2 deletions static/js/agent-memory-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@
if (request) { body.appendChild(el("div", "rcr-lbl", "Request body")); body.appendChild(pre(request)); }
body.appendChild(el("div", "rcr-lbl", "Response"));
body.appendChild(pre(response));
body.appendChild(el("pre", "rcr-code rcr-code-sm", esc(curl(method, path, request))));
body.appendChild(el("pre", "rcr-code rcr-code-sm", window.DemoHL.shell(curl(method, path, request))));
}
function chatCard(defs, n, extra) {
var card = el("div", "rcr-card ram-chatcard");
Expand Down Expand Up @@ -1021,7 +1021,7 @@
body.appendChild(pre(response));
var cd = el("details", "rcr-curl");
cd.appendChild(el("summary", "", "Run this call yourself with curl"));
cd.appendChild(el("pre", "rcr-code rcr-code-sm", esc(curl(method, path, request))));
cd.appendChild(el("pre", "rcr-code rcr-code-sm", window.DemoHL.shell(curl(method, path, request))));
body.appendChild(cd);
d.appendChild(body);
return d;
Expand Down
11 changes: 8 additions & 3 deletions static/js/context-retriever-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@
renderTools(right);
var idx = el("details", "rcr-card rcr-behind");
idx.appendChild(el("summary", "", "Behind the scenes: the search indexes the service creates"));
idx.appendChild(el("pre", "rcr-code", esc(indexCommands(state.model, state.surface).join("\n\n") || "No indexed fields, so no index is created.")));
idx.appendChild(el("pre", "rcr-code", indexHtml()));
idx.appendChild(el("p", "rcr-note", "Tag fields use the <code>INDEXMISSING</code> option, so the database must run Redis 7.4 or later. " +
"Tag fields used for access control, which this demo doesn't include, also get <code>INDEXEMPTY</code>. The index names are illustrative."));
p.appendChild(idx);
Expand Down Expand Up @@ -678,7 +678,12 @@
var right = panels.model.querySelector(".rcr-tools");
if (right) { renderTools(right); right.classList.remove("rcr-flash"); void right.offsetWidth; right.classList.add("rcr-flash"); }
var beh = panels.model.querySelector(".rcr-behind pre");
if (beh) beh.textContent = indexCommands(state.model, state.surface).join("\n\n") || "No indexed fields, so no index is created.";
if (beh) beh.innerHTML = indexHtml();
}
/* The FT.CREATE commands behind the tools, highlighted, or why there are none. */
function indexHtml() {
var cmds = indexCommands(state.model, state.surface);
return cmds.length ? window.DemoHL.redis(cmds.join("\n\n")) : esc("No indexed fields, so no index is created.");
}

function entityCard(ent) {
Expand Down Expand Up @@ -909,7 +914,7 @@
body.appendChild(el("pre", "rcr-code rcr-code-sm", jsonHtml(failed ? res : c.result)));
var cd = el("details", "rcr-curl");
cd.appendChild(el("summary", "", "Run this call yourself with curl"));
cd.appendChild(el("pre", "rcr-code rcr-code-sm", esc(curlFor(c.name, c.args, c.id))));
cd.appendChild(el("pre", "rcr-code rcr-code-sm", window.DemoHL.shell(curlFor(c.name, c.args, c.id))));
body.appendChild(cd);
d.appendChild(body);
return d;
Expand Down
170 changes: 170 additions & 0 deletions static/js/demo-highlight.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
/* =========================================================================
Syntax highlighting for the scripted demos' code blocks
Dependency-free and shared: each demo's shortcode loads this before the
demo itself. Every function takes text exactly as a demo shows it and
returns it escaped, with spans the shared stylesheet colors. Redis commands
are colored the way Redis Insight's Workbench colors them, and the other
languages follow the same roles:
hl-cmd a command or language keyword, such as FT.SEARCH, curl, or import
hl-kw an option, such as SCHEMA or -H
hl-key an index name or URL
hl-field an @field
hl-query a query, quotes and all
hl-op a comparison or logical operator in a query; YAML list dashes
hl-fn a function in a query, such as ismissing
hl-str a string
hl-num a number
hl-com a comment
hl-faint framing that isn't the point: reply index numbers, (integer),
line continuations, and <placeholders>
Anything else, such as a key or a field name, stays plain, as in Insight.
The text itself never changes: strip the spans and it reads the same.
========================================================================= */
(function () {
"use strict";
if (window.DemoHL) return; // loaded twice: the first copy already defined everything

function esc(s) {
return String(s).replace(/[&<>"']/g, function (c) {
return { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }[c];
});
}
function span(cls, s) { return cls ? '<span class="' + cls + '">' + esc(s) + "</span>" : esc(s); }
var NUM = /^(-?\d+(\.\d+)?|[+-]inf)$/;
var UPPER = /^[A-Z][A-Z0-9_]*$/;

/* ---- Redis ---- */

/* One argument of a Redis command, by its role. `t` is the argument as you'd type it, quotes and all.
As in Insight, options are colored only in FT commands. */
function arg(argv, i, t) {
var a = argv[i], cmd = argv[0], ft = /^FT\./i.test(cmd), cls = "";
if (i === 0) cls = "hl-cmd";
else if (ft && i === 1) cls = "hl-key"; // the index
else if (ft && isQuery(cmd, i, argv[i - 1], t !== a)) return query(t);
else if (t !== a) cls = "hl-str";
else if (NUM.test(a)) cls = "hl-num";
else if (a.charAt(0) === "@") cls = "hl-field";
else if (ft && UPPER.test(a)) cls = "hl-kw";
return span(cls, t);
}
/* Whether an FT command's argument is a query: FT.SEARCH's and FT.AGGREGATE's, or the quoted expression after FILTER or APPLY. */
function isQuery(cmd, i, prev, quoted) {
return i === 2 && /^FT\.(SEARCH|AGGREGATE)$/i.test(cmd) || quoted && /^(FILTER|APPLY)$/i.test(prev);
}
/* A query, quotes and all. Insight colors it as one, with @fields, comparison and logical operators, and functions picked out,
and parentheses plain. */
function query(t) {
var re = /(@[A-Za-z_$][\w.$]*)|(==|!=|<=|>=|&&|\|\||[<>])|([A-Za-z_]\w*(?=\())|([()])/g, out = "", at = 0, m;
while ((m = re.exec(t))) {
if (m.index > at) out += span("hl-query", t.slice(at, m.index));
out += span(m[1] ? "hl-field" : m[2] ? "hl-op" : m[3] ? "hl-fn" : "", m[0]);
at = re.lastIndex;
}
return out + (at < t.length ? span("hl-query", t.slice(at)) : "");
}
/* A reply as redis-cli prints it: index numbers and (integer) faint, strings, integers, OK, and errors colored. */
function reply(text) {
return text.split("\n").map(function (ln) {
var m = ln.match(/^((?:\s*\d+\)\s)*)(.*)$/), idx = m[1], rest = m[2], body;
if (/^\(integer\) /.test(rest)) body = span("hl-faint", "(integer)") + " " + span("hl-num", rest.slice(10));
else if (/^\(error\) /.test(rest)) body = span("hl-err", rest);
else if (/^"/.test(rest)) body = span("hl-str", rest);
else if (/^\((nil|empty array)\)$/.test(rest)) body = span("hl-faint", rest);
else if (rest === "OK") body = span("hl-ok", rest);
else body = esc(rest);
return (idx ? span("hl-faint", idx) : "") + body;
}).join("\n");
}
/* Redis commands written out as text: one or more, separated by blank lines, with \ continuations and <placeholders>.
As in Insight, a query that starts a line of its own is colored as a plain string. */
function redis(text) {
var re = /(\s+)|(\\(?=\s|$))|("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')|(<[^>\n]*>)|([^\s"']+)|([\s\S])/g, m, out = "", n = 0, cmd = "", ft = false, prev = "", nl = false;
while ((m = re.exec(text))) {
if (m[1]) { if (/\n\s*\n/.test(m[1])) n = 0; nl = /\n/.test(m[1]); out += esc(m[1]); continue; }
if (m[2]) { out += span("hl-faint", m[2]); continue; }
if (m[6]) { out += esc(m[6]); continue; } // a quote with no closing quote, kept as it is
var t = m[0], cls = "";
if (n === 0) { cmd = t; ft = /^FT\./i.test(t); cls = "hl-cmd"; }
else if (m[4]) cls = "hl-faint";
else if (ft && n === 1) cls = "hl-key";
else if (ft && !nl && isQuery(cmd, n, prev, !!m[3])) { out += query(t); prev = t; n++; continue; }
else if (m[3]) cls = "hl-str";
else if (NUM.test(t)) cls = "hl-num";
else if (t.charAt(0) === "@") cls = "hl-field";
else if (ft && UPPER.test(t)) cls = "hl-kw";
out += span(cls, t);
prev = t;
nl = false;
n++;
}
return out;
}
Comment thread
cursor[bot] marked this conversation as resolved.

/* ---- Python ---- */

var PY_KW = /^(from|import|as|def|return|class|if|elif|else|for|while|in|not|and|or|is|with|try|except|finally|raise|lambda|yield|pass|None|True|False)$/;
/* Python: keywords, strings, numbers, and comments. */
function python(text) {
var re = /(#[^\n]*)|("""[\s\S]*?"""|'''[\s\S]*?'''|"(?:[^"\\\n]|\\.)*"|'(?:[^'\\\n]|\\.)*')|(\b\d+(?:\.\d+)?\b)|([A-Za-z_][\w]*)|([\s\S])/g, m, out = "";
while ((m = re.exec(text))) {
if (m[1]) out += span("hl-com", m[1]);
else if (m[2]) out += span("hl-str", m[2]);
else if (m[3]) out += span("hl-num", m[3]);
else if (m[4]) out += span(PY_KW.test(m[4]) ? "hl-cmd" : "", m[4]);
else out += esc(m[5]);
}
return out;
}

/* ---- YAML ---- */

/* One line of YAML: list dashes, the value after a key, and comments. */
function yaml(line) {
var m = line.match(/^(\s*)(- )?(?:([\w.$-]+)(:)(?=\s|$))?(\s*)(.*)$/), out = esc(m[1]);
if (m[2]) out += span("hl-op", m[2]);
if (m[3]) out += esc(m[3] + m[4]);
out += esc(m[5]);
var v = m[6], c = v.match(/^(.*?)(\s+#.*|^#.*)$/), com = "";
if (c) { v = c[1]; com = c[2]; }
if (v) out += span(/^["']/.test(v) ? "hl-str" : NUM.test(v) ? "hl-num" : /^(true|false|null|~)$/.test(v) ? "hl-cmd" : m[3] || m[2] ? "hl-str" : "", v);
if (com) out += span("hl-com", com);
return out;
}

/* ---- shell and SQL ---- */

/* A shell command such as curl: the command, its flags and methods, URLs, strings, and \ continuations. */
function shell(text) {
var re = /(\s+)|(\\(?=\n|$))|("(?:[^"\\]|\\.)*"|'(?:[^']|'\\'')*')|([^\s"']+)|([\s\S])/g, m, out = "", first = true;
while ((m = re.exec(text))) {
if (m[1]) { out += esc(m[1]); continue; }
if (m[2]) { out += span("hl-faint", m[2]); continue; }
if (m[5]) { out += esc(m[5]); continue; } // a quote with no closing quote, kept as it is
var t = m[0], cls;
if (m[3]) cls = /^["'](https?:|\$\w+\/)/.test(t) ? "hl-key" : "hl-str"; // a URL, including one that starts with a $VARIABLE
else if (first) cls = "hl-cmd";
else if (/^--?[A-Za-z]/.test(t)) cls = "hl-kw";
else if (/^(GET|POST|PUT|PATCH|DELETE)$/.test(t)) cls = "hl-kw";
else if (/^https?:/.test(t)) cls = "hl-key";
else cls = "";
first = false;
out += span(cls, t);
}
return out;
}
var SQL_KW = /^(INSERT|INTO|VALUES|UPDATE|SET|WHERE|DELETE|FROM|SELECT|AND|OR|NOT|NULL|AS|ON|JOIN|ORDER|BY|LIMIT|RETURNING|BEGIN|COMMIT|TRUE|FALSE)$/i;
/* SQL: keywords, strings, and numbers. */
function sql(text) {
var re = /('(?:[^']|'')*')|(\b\d+(?:\.\d+)?\b)|([A-Za-z_][\w]*)|([\s\S])/g, m, out = "";
while ((m = re.exec(text))) {
if (m[1]) out += span("hl-str", m[1]);
else if (m[2]) out += span("hl-num", m[2]);
else if (m[3]) out += span(SQL_KW.test(m[3]) ? "hl-cmd" : "", m[3]);
else out += esc(m[4]);
}
return out;
}

window.DemoHL = { esc: esc, arg: arg, query: query, reply: reply, redis: redis, python: python, yaml: yaml, shell: shell, sql: sql };
})();
Loading
Loading