Skip to content

Commit bfdcc85

Browse files
committed
switch to highlightjs for syntax highlighting
1 parent c52b2ad commit bfdcc85

File tree

5 files changed

+117
-98
lines changed

5 files changed

+117
-98
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hljs.highlightAll()
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/* Comments, Prolog, Doctype, and Cdata */
2+
.hljs-comment,
3+
.hljs-prolog,
4+
.hljs-meta,
5+
.hljs-cdata {
6+
color: var(--tblr-gray-300);
7+
}
8+
9+
/* Punctuation */
10+
.hljs-template-variable,
11+
.hljs-punctuation {
12+
color: var(--tblr-gray-500);
13+
}
14+
15+
/* Namespace */
16+
.hljs-namespace {
17+
opacity: .7;
18+
}
19+
20+
/* Property and Tag */
21+
.hljs-property {
22+
color: #de5f8f;
23+
}
24+
25+
/* Number */
26+
.hljs-number {
27+
color: #ea9999;
28+
}
29+
30+
/* Boolean */
31+
.hljs-literal {
32+
color: #ae81ff;
33+
}
34+
35+
/* Selector, Attr-name, and String */
36+
.hljs-attr {
37+
color: #fcfce5;
38+
}
39+
40+
.hljs-name {
41+
color: #e4faf6;
42+
}
43+
.hljs-selector-tag,
44+
.hljs-string {
45+
color: #97e1a3;
46+
}
47+
48+
/* Operator, Entity, URL, CSS String, and Style String */
49+
.hljs-operator,
50+
.hljs-symbol,
51+
.hljs-link,
52+
.language-css .hljs-string,
53+
.style .hljs-string {
54+
color: #f8f8f2;
55+
}
56+
57+
/* At-rule and Attr-value */
58+
.hljs-tag,
59+
.hljs-keyword,
60+
.hljs-attribute-value {
61+
color: #e6db74;
62+
}
63+
64+
/* Keyword */
65+
.hljs-template-tag,
66+
.hljs-keyword {
67+
color: #95d1ff;
68+
}
69+
70+
/* Regex and Important */
71+
.hljs-regexp,
72+
.hljs-important {
73+
color: var(--tblr-yellow);
74+
}
75+
76+
/* Important */
77+
.hljs-important {
78+
font-weight: bold;
79+
}
80+
81+
/* Entity */
82+
.hljs-symbol {
83+
cursor: help;
84+
}
85+
86+
/* Token transition */
87+
.hljs {
88+
transition: .3s;
89+
}
90+
91+
/* Code selection */
92+
code::selection, code ::selection {
93+
background: var(--tblr-yellow);
94+
color: var(--tblr-gray-900);
95+
border-radius: .1em;
96+
}
97+
98+
code .hljs-keyword::selection, code .hljs-punctuation::selection {
99+
color: var(--tblr-gray-800);
100+
}
101+
102+
/* Pre code padding */
103+
pre code {
104+
padding: 0;
105+
}

examples/official-site/prism-tabler-theme.css

Lines changed: 0 additions & 92 deletions
This file was deleted.

examples/official-site/sqlpage/migrations/01_documentation.sql

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -912,9 +912,14 @@ You see the [page layouts demo](./examples/layouts.sql) for a live example of th
912912
"language": "en-US",
913913
"description": "Documentation for the SQLPage low-code web application framework.",
914914
"font": "Poppins",
915-
"javascript": ["https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-core.min.js",
916-
"https://cdn.jsdelivr.net/npm/prismjs@1/plugins/autoloader/prism-autoloader.min.js"],
917-
"css": "/prism-tabler-theme.css",
915+
"javascript": [
916+
"https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11/build/highlight.min.js",
917+
"https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11/build/languages/sql.min.js",
918+
"https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11/build/languages/handlebars.min.js",
919+
"https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11/build/languages/json.min.js",
920+
"/highlightjs-launch.js"
921+
],
922+
"css": "/highlightjs-tabler-theme.css",
918923
"footer": "Official [SQLPage](https://sql.ophir.dev) documentation"
919924
}]')),
920925
('shell', '

sqlpage/templates/debug.handlebars

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h2>Debug output</h2>
2-
<pre>{{stringify this}}</pre>
3-
{{#each_row}}
4-
<pre>{{stringify this}}</pre>
2+
<pre><code class="language-json">{{stringify this}}
3+
{{#each_row}}{{stringify this}}
54
{{/each_row}}
5+
</code></pre>

0 commit comments

Comments
 (0)