1
Fork 0
mirror of https://github.com/diced/zipline.git synced 2025-04-11 23:31:17 -05:00

fix: syntax highlighting (#697)

This commit is contained in:
diced 2025-03-31 21:17:42 -07:00
parent 20a7f134ad
commit c44572920b
No known key found for this signature in database
GPG key ID: 436B2B0FA0DCA354
4 changed files with 207 additions and 27 deletions

View file

@ -102,6 +102,7 @@
"postcss-preset-mantine": "^1.17.0",
"postcss-simple-vars": "^7.0.1",
"prettier": "^3.5.2",
"sass": "^1.86.1",
"tsc-alias": "^1.8.10",
"tsup": "^8.3.6",
"tsx": "^4.19.3",

183
pnpm-lock.yaml generated
View file

@ -142,7 +142,7 @@ importers:
version: 1.4.5-lts.1
next:
specifier: ^15.2.4
version: 15.2.4(@babel/core@7.26.9)(@opentelemetry/api@1.7.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
version: 15.2.4(@babel/core@7.26.9)(@opentelemetry/api@1.7.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.86.1)
otplib:
specifier: ^12.0.1
version: 12.0.1
@ -249,6 +249,9 @@ importers:
prettier:
specifier: ^3.5.2
version: 3.5.2
sass:
specifier: ^1.86.1
version: 1.86.1
tsc-alias:
specifier: ^1.8.10
version: 1.8.10
@ -1324,6 +1327,88 @@ packages:
'@otplib/preset-v11@12.0.1':
resolution: {integrity: sha512-9hSetMI7ECqbFiKICrNa4w70deTUfArtwXykPUvSHWOdzOlfa9ajglu7mNCntlvxycTiOAXkQGwjQCzzDEMRMg==}
'@parcel/watcher-android-arm64@2.5.1':
resolution: {integrity: sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA==}
engines: {node: '>= 10.0.0'}
cpu: [arm64]
os: [android]
'@parcel/watcher-darwin-arm64@2.5.1':
resolution: {integrity: sha512-eAzPv5osDmZyBhou8PoF4i6RQXAfeKL9tjb3QzYuccXFMQU0ruIc/POh30ePnaOyD1UXdlKguHBmsTs53tVoPw==}
engines: {node: '>= 10.0.0'}
cpu: [arm64]
os: [darwin]
'@parcel/watcher-darwin-x64@2.5.1':
resolution: {integrity: sha512-1ZXDthrnNmwv10A0/3AJNZ9JGlzrF82i3gNQcWOzd7nJ8aj+ILyW1MTxVk35Db0u91oD5Nlk9MBiujMlwmeXZg==}
engines: {node: '>= 10.0.0'}
cpu: [x64]
os: [darwin]
'@parcel/watcher-freebsd-x64@2.5.1':
resolution: {integrity: sha512-SI4eljM7Flp9yPuKi8W0ird8TI/JK6CSxju3NojVI6BjHsTyK7zxA9urjVjEKJ5MBYC+bLmMcbAWlZ+rFkLpJQ==}
engines: {node: '>= 10.0.0'}
cpu: [x64]
os: [freebsd]
'@parcel/watcher-linux-arm-glibc@2.5.1':
resolution: {integrity: sha512-RCdZlEyTs8geyBkkcnPWvtXLY44BCeZKmGYRtSgtwwnHR4dxfHRG3gR99XdMEdQ7KeiDdasJwwvNSF5jKtDwdA==}
engines: {node: '>= 10.0.0'}
cpu: [arm]
os: [linux]
'@parcel/watcher-linux-arm-musl@2.5.1':
resolution: {integrity: sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==}
engines: {node: '>= 10.0.0'}
cpu: [arm]
os: [linux]
'@parcel/watcher-linux-arm64-glibc@2.5.1':
resolution: {integrity: sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==}
engines: {node: '>= 10.0.0'}
cpu: [arm64]
os: [linux]
'@parcel/watcher-linux-arm64-musl@2.5.1':
resolution: {integrity: sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==}
engines: {node: '>= 10.0.0'}
cpu: [arm64]
os: [linux]
'@parcel/watcher-linux-x64-glibc@2.5.1':
resolution: {integrity: sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==}
engines: {node: '>= 10.0.0'}
cpu: [x64]
os: [linux]
'@parcel/watcher-linux-x64-musl@2.5.1':
resolution: {integrity: sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==}
engines: {node: '>= 10.0.0'}
cpu: [x64]
os: [linux]
'@parcel/watcher-win32-arm64@2.5.1':
resolution: {integrity: sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==}
engines: {node: '>= 10.0.0'}
cpu: [arm64]
os: [win32]
'@parcel/watcher-win32-ia32@2.5.1':
resolution: {integrity: sha512-c2KkcVN+NJmuA7CGlaGD1qJh1cLfDnQsHjE89E60vUEMlqduHGCdCLJCID5geFVM0dOtA3ZiIO8BoEQmzQVfpQ==}
engines: {node: '>= 10.0.0'}
cpu: [ia32]
os: [win32]
'@parcel/watcher-win32-x64@2.5.1':
resolution: {integrity: sha512-9lHBdJITeNR++EvSQVUcaZoWupyHfXe1jZvGZ06O/5MflPcuPLtEphScIBL+AiCWBO46tDSHzWyD0uDmmZqsgA==}
engines: {node: '>= 10.0.0'}
cpu: [x64]
os: [win32]
'@parcel/watcher@2.5.1':
resolution: {integrity: sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==}
engines: {node: '>= 10.0.0'}
'@phc/format@1.0.0':
resolution: {integrity: sha512-m7X9U6BG2+J+R1lSOdCiITLLrxm+cWlNI3HUFA92oLO77ObGNzaKdh8pMLqdZcshtkKuV84olNNXDfMc4FezBQ==}
engines: {node: '>=10'}
@ -2406,6 +2491,11 @@ packages:
resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==}
engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16}
detect-libc@1.0.3:
resolution: {integrity: sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==}
engines: {node: '>=0.10'}
hasBin: true
detect-libc@2.0.3:
resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==}
engines: {node: '>=8'}
@ -2980,6 +3070,9 @@ packages:
resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}
engines: {node: '>= 4'}
immutable@5.1.1:
resolution: {integrity: sha512-3jatXi9ObIsPGr3N5hGw/vWWcTkq6hUYhpQz4k0wLC+owqWi/LiugIw9x0EdNZ2yGedKN/HzePiBvaJRXa0Ujg==}
import-fresh@3.3.1:
resolution: {integrity: sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==}
engines: {node: '>=6'}
@ -3562,6 +3655,9 @@ packages:
sass:
optional: true
node-addon-api@7.1.1:
resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==}
node-addon-api@8.3.0:
resolution: {integrity: sha512-8VOpLHFrOQlAH+qA0ZzuGRlALRA6/LVh8QJldbrC4DY0hXoMP0l4Acq8TzFC018HztWiRqyCEj2aTWY2UvnJUg==}
engines: {node: ^18 || ^20 || >= 21}
@ -4081,6 +4177,11 @@ packages:
safer-buffer@2.1.2:
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
sass@1.86.1:
resolution: {integrity: sha512-Yaok4XELL1L9Im/ZUClKu//D2OP1rOljKj0Gf34a+GzLbMveOzL7CfqYo+JUa5Xt1nhTCW+OcKp/FtR7/iqj1w==}
engines: {node: '>=14.0.0'}
hasBin: true
saxes@6.0.0:
resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==}
engines: {node: '>=v12.22.7'}
@ -6024,6 +6125,67 @@ snapshots:
'@otplib/plugin-crypto': 12.0.1
'@otplib/plugin-thirty-two': 12.0.1
'@parcel/watcher-android-arm64@2.5.1':
optional: true
'@parcel/watcher-darwin-arm64@2.5.1':
optional: true
'@parcel/watcher-darwin-x64@2.5.1':
optional: true
'@parcel/watcher-freebsd-x64@2.5.1':
optional: true
'@parcel/watcher-linux-arm-glibc@2.5.1':
optional: true
'@parcel/watcher-linux-arm-musl@2.5.1':
optional: true
'@parcel/watcher-linux-arm64-glibc@2.5.1':
optional: true
'@parcel/watcher-linux-arm64-musl@2.5.1':
optional: true
'@parcel/watcher-linux-x64-glibc@2.5.1':
optional: true
'@parcel/watcher-linux-x64-musl@2.5.1':
optional: true
'@parcel/watcher-win32-arm64@2.5.1':
optional: true
'@parcel/watcher-win32-ia32@2.5.1':
optional: true
'@parcel/watcher-win32-x64@2.5.1':
optional: true
'@parcel/watcher@2.5.1':
dependencies:
detect-libc: 1.0.3
is-glob: 4.0.3
micromatch: 4.0.8
node-addon-api: 7.1.1
optionalDependencies:
'@parcel/watcher-android-arm64': 2.5.1
'@parcel/watcher-darwin-arm64': 2.5.1
'@parcel/watcher-darwin-x64': 2.5.1
'@parcel/watcher-freebsd-x64': 2.5.1
'@parcel/watcher-linux-arm-glibc': 2.5.1
'@parcel/watcher-linux-arm-musl': 2.5.1
'@parcel/watcher-linux-arm64-glibc': 2.5.1
'@parcel/watcher-linux-arm64-musl': 2.5.1
'@parcel/watcher-linux-x64-glibc': 2.5.1
'@parcel/watcher-linux-x64-musl': 2.5.1
'@parcel/watcher-win32-arm64': 2.5.1
'@parcel/watcher-win32-ia32': 2.5.1
'@parcel/watcher-win32-x64': 2.5.1
optional: true
'@phc/format@1.0.0': {}
'@pkgjs/parseargs@0.11.0':
@ -7222,6 +7384,9 @@ snapshots:
destroy@1.2.0: {}
detect-libc@1.0.3:
optional: true
detect-libc@2.0.3: {}
detect-node-es@1.1.0: {}
@ -8060,6 +8225,8 @@ snapshots:
ignore@5.3.2: {}
immutable@5.1.1: {}
import-fresh@3.3.1:
dependencies:
parent-module: 1.0.1
@ -8824,7 +8991,7 @@ snapshots:
negotiator@0.6.3: {}
next@15.2.4(@babel/core@7.26.9)(@opentelemetry/api@1.7.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0):
next@15.2.4(@babel/core@7.26.9)(@opentelemetry/api@1.7.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)(sass@1.86.1):
dependencies:
'@next/env': 15.2.4
'@swc/counter': 0.1.3
@ -8845,11 +9012,15 @@ snapshots:
'@next/swc-win32-arm64-msvc': 15.2.4
'@next/swc-win32-x64-msvc': 15.2.4
'@opentelemetry/api': 1.7.0
sass: 1.86.1
sharp: 0.33.5
transitivePeerDependencies:
- '@babel/core'
- babel-plugin-macros
node-addon-api@7.1.1:
optional: true
node-addon-api@8.3.0: {}
node-gyp-build@4.8.4: {}
@ -9423,6 +9594,14 @@ snapshots:
safer-buffer@2.1.2: {}
sass@1.86.1:
dependencies:
chokidar: 4.0.3
immutable: 5.1.1
source-map-js: 1.2.1
optionalDependencies:
'@parcel/watcher': 2.5.1
saxes@6.0.0:
dependencies:
xmlchars: 2.2.0

View file

@ -1,33 +1,33 @@
/* adapted from https://github.com/mantinedev/mantine/blob/master/packages/%40mantine/code-highlight/src/CodeHighlight.theme.module.css */
[data-mantine-color-scheme='light'] .theme {
--_color: var(--mantine-color-gray-7);
--_background: var(--mantine-color-gray-0);
--code-comment-color: var(--mantine-color-gray-6);
--code-keyword-color: var(--mantine-color-violet-8);
--code-tag-color: var(--mantine-color-red-9);
--code-literal-color: var(--mantine-color-blue-6);
--code-string-color: var(--mantine-color-blue-9);
--code-variable-color: var(--mantine-color-lime-9);
--code-class-color: var(--mantine-color-orange-9);
}
[data-mantine-color-scheme='dark'] .theme {
--_color: var(--mantine-color-dark-2);
--_background: var(--mantine-color-dark-7);
--code-comment-color: var(--mantine-color-dark-3);
--code-keyword-color: var(--mantine-color-violet-3);
--code-tag-color: var(--mantine-color-yellow-4);
--code-literal-color: var(--mantine-color-blue-4);
--code-string-color: var(--mantine-color-green-6);
--code-variable-color: var(--mantine-color-blue-2);
--code-class-color: var(--mantine-color-orange-5);
}
.theme {
color: var(--_color);
background: var(--_background);
@mixin light {
--_color: var(--mantine-color-gray-7);
--_background: var(--mantine-color-gray-0);
--code-comment-color: var(--mantine-color-gray-6);
--code-keyword-color: var(--mantine-color-violet-8);
--code-tag-color: var(--mantine-color-red-9);
--code-literal-color: var(--mantine-color-blue-6);
--code-string-color: var(--mantine-color-blue-9);
--code-variable-color: var(--mantine-color-lime-9);
--code-class-color: var(--mantine-color-orange-9);
}
@mixin dark {
--_color: var(--mantine-color-dark-2);
--_background: var(--mantine-color-dark-7);
--code-comment-color: var(--mantine-color-dark-3);
--code-keyword-color: var(--mantine-color-violet-3);
--code-tag-color: var(--mantine-color-yellow-4);
--code-literal-color: var(--mantine-color-blue-4);
--code-string-color: var(--mantine-color-green-6);
--code-variable-color: var(--mantine-color-blue-2);
--code-class-color: var(--mantine-color-orange-5);
}
.hljs-comment,
.hljs-quote {
font-style: italic;

View file

@ -15,7 +15,7 @@ import 'mantine-datatable/styles.css';
import '@/styles/global.css';
import '@/components/render/code/HighlightCode.theme.css';
import '@/components/render/code/HighlightCode.theme.scss';
const fetcher = async (url: RequestInfo | URL) => {
const res = await fetch(url);