From 20825f30008b3c0c4953e56e05011b4e244b5e2f Mon Sep 17 00:00:00 2001
From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
Date: Sun, 5 Nov 2023 11:33:26 +1100
Subject: [PATCH 01/39] Use remix vite plugin
---
app/components/CodeBlock.tsx | 4 +-
app/components/RootDocument.tsx | 2 +-
app/root.tsx | 25 +------------
app/utils/documents.server.ts | 5 ++-
remix.env.d.ts => env.d.ts | 2 +-
package.json | 10 +++--
pnpm-lock.yaml | 45 ++++++++++++++++++++++-
postcss.config.js => postcss.config.cjs | 0
remix.config.js | 9 -----
tailwind.config.js => tailwind.config.cjs | 0
tsconfig.json | 5 ++-
vite.config.ts | 7 ++++
12 files changed, 67 insertions(+), 47 deletions(-)
rename remix.env.d.ts => env.d.ts (50%)
rename postcss.config.js => postcss.config.cjs (100%)
delete mode 100644 remix.config.js
rename tailwind.config.js => tailwind.config.cjs (100%)
create mode 100644 vite.config.ts
diff --git a/app/components/CodeBlock.tsx b/app/components/CodeBlock.tsx
index bb3b4a00..7b71fd4c 100644
--- a/app/components/CodeBlock.tsx
+++ b/app/components/CodeBlock.tsx
@@ -5,8 +5,8 @@ import { Highlight, Prism } from 'prism-react-renderer'
import { svelteHighlighter } from '~/utils/svelteHighlighter'
// Add back additional language support after `prism-react` upgrade
;(typeof global !== 'undefined' ? global : window).Prism = Prism
-require('prismjs/components/prism-diff')
-require('prismjs/components/prism-bash')
+// require('prismjs/components/prism-diff')
+// require('prismjs/components/prism-bash')
// @ts-ignore Alias markup as vue highlight
Prism.languages.vue = Prism.languages.markup
diff --git a/app/components/RootDocument.tsx b/app/components/RootDocument.tsx
index 9f7c89d9..3a49ae11 100644
--- a/app/components/RootDocument.tsx
+++ b/app/components/RootDocument.tsx
@@ -66,8 +66,8 @@ export function RootDocument({
{children}
{
export const links: LinksFunction = () => {
return [
- { rel: 'stylesheet', href: styles },
- {
- rel: 'stylesheet',
- href: prismThemeLight,
- media: '(prefers-color-scheme: light)',
- },
- {
- rel: 'stylesheet',
- href: prismThemeDark,
- media: '(prefers-color-scheme: dark)',
- },
- {
- rel: 'stylesheet',
- href: docSearchStyles,
- },
- {
- rel: 'stylesheet',
- href: carbonStyles,
- },
{
rel: 'apple-touch-icon',
sizes: '180x180',
diff --git a/app/utils/documents.server.ts b/app/utils/documents.server.ts
index 2bc7b1c7..138ee890 100644
--- a/app/utils/documents.server.ts
+++ b/app/utils/documents.server.ts
@@ -1,5 +1,6 @@
import fsp from 'node:fs/promises'
import path from 'node:path'
+import { fileURLToPath } from 'node:url'
import { bundleMDX } from 'mdx-bundler'
import * as graymatter from 'gray-matter'
import { fetchCached } from '~/utils/cache.server'
@@ -48,8 +49,8 @@ async function fetchRemote(
* Return text content of file from local file system
*/
async function fetchFs(repo: string, filepath: string) {
- // const __dirname = fileURLToPath(new URL('.', import.meta.url))
- const localFilePath = path.resolve(__dirname, `../../${repo}`, filepath)
+ const __dirname = fileURLToPath(new URL('.', import.meta.url))
+ const localFilePath = path.resolve(__dirname, `../../../${repo}`, filepath)
const file = await fsp.readFile(localFilePath)
return file.toString()
}
diff --git a/remix.env.d.ts b/env.d.ts
similarity index 50%
rename from remix.env.d.ts
rename to env.d.ts
index dcf8c45e..78ed2345 100644
--- a/remix.env.d.ts
+++ b/env.d.ts
@@ -1,2 +1,2 @@
-///
///
+///
diff --git a/package.json b/package.json
index 4827ff53..758149c3 100644
--- a/package.json
+++ b/package.json
@@ -4,10 +4,10 @@
"sideEffects": false,
"repository": "https://github.com/TanStack/tanstack.com.git",
"packageManager": "pnpm@8.10.2",
- "type": "commonjs",
+ "type": "module",
"scripts": {
- "dev": "remix dev --manual",
- "build": "remix build",
+ "dev": "vite dev",
+ "build": "vite build && vite build --ssr",
"start": "remix-serve ./build/index.js",
"format": "prettier --plugin-search-dir . \"**/*.{md,js,jsx,cjs,ts,tsx,json}\" --write",
"lint": "eslint --ext .ts,.tsx ./app"
@@ -57,7 +57,9 @@
"npm-run-all": "^4.1.5",
"postcss": "^8.4.31",
"tailwindcss": "^3.3.5",
- "typescript": "^5.2.2"
+ "typescript": "^5.2.2",
+ "vite": "^4.5.0",
+ "vite-tsconfig-paths": "^4.2.1"
},
"engines": {
"node": ">=18.0.0"
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index ae84b0f0..3ddd829f 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -99,7 +99,7 @@ dependencies:
devDependencies:
'@remix-run/dev':
specifier: ^2.2.0
- version: 2.2.0(@remix-run/serve@2.2.0)(typescript@5.2.2)
+ version: 2.2.0(@remix-run/serve@2.2.0)(typescript@5.2.2)(vite@4.5.0)
'@remix-run/eslint-config':
specifier: ^2.2.0
version: 2.2.0(eslint@8.53.0)(react@18.2.0)(typescript@5.2.2)
@@ -136,6 +136,12 @@ devDependencies:
typescript:
specifier: ^5.2.2
version: 5.2.2
+ vite:
+ specifier: ^4.5.0
+ version: 4.5.0
+ vite-tsconfig-paths:
+ specifier: ^4.2.1
+ version: 4.2.1(typescript@5.2.2)(vite@4.5.0)
packages:
@@ -1656,7 +1662,7 @@ packages:
dev: true
optional: true
- /@remix-run/dev@2.2.0(@remix-run/serve@2.2.0)(typescript@5.2.2):
+ /@remix-run/dev@2.2.0(@remix-run/serve@2.2.0)(typescript@5.2.2)(vite@4.5.0):
resolution: {integrity: sha512-JtteMtYirQlj1Xf9FSLLjqO+owxlqJVsTESgVWdF+CR5kon2i12YjPnRx1xGtB4UGgU/yTZseMTPNhTKc5mwpQ==}
engines: {node: '>=18.0.0'}
hasBin: true
@@ -1729,6 +1735,7 @@ packages:
tsconfig-paths: 4.2.0
typescript: 5.2.2
undici: 5.27.2
+ vite: 4.5.0
ws: 7.5.9
transitivePeerDependencies:
- '@types/node'
@@ -4297,6 +4304,10 @@ packages:
slash: 3.0.0
dev: true
+ /globrex@0.1.2:
+ resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==}
+ dev: true
+
/gopd@1.0.1:
resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==}
dependencies:
@@ -7324,6 +7335,19 @@ packages:
/ts-interface-checker@0.1.13:
resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}
+ /tsconfck@2.1.2(typescript@5.2.2):
+ resolution: {integrity: sha512-ghqN1b0puy3MhhviwO2kGF8SeMDNhEbnKxjK7h6+fvY9JAxqvXi8y5NAHSQv687OVboS2uZIByzGd45/YxrRHg==}
+ engines: {node: ^14.13.1 || ^16 || >=18}
+ hasBin: true
+ peerDependencies:
+ typescript: ^4.3.5 || ^5.0.0
+ peerDependenciesMeta:
+ typescript:
+ optional: true
+ dependencies:
+ typescript: 5.2.2
+ dev: true
+
/tsconfig-paths@3.14.2:
resolution: {integrity: sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==}
dependencies:
@@ -7636,6 +7660,23 @@ packages:
- terser
dev: true
+ /vite-tsconfig-paths@4.2.1(typescript@5.2.2)(vite@4.5.0):
+ resolution: {integrity: sha512-GNUI6ZgPqT3oervkvzU+qtys83+75N/OuDaQl7HmOqFTb0pjZsuARrRipsyJhJ3enqV8beI1xhGbToR4o78nSQ==}
+ peerDependencies:
+ vite: '*'
+ peerDependenciesMeta:
+ vite:
+ optional: true
+ dependencies:
+ debug: 4.3.4
+ globrex: 0.1.2
+ tsconfck: 2.1.2(typescript@5.2.2)
+ vite: 4.5.0
+ transitivePeerDependencies:
+ - supports-color
+ - typescript
+ dev: true
+
/vite@4.5.0:
resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==}
engines: {node: ^14.18.0 || >=16.0.0}
diff --git a/postcss.config.js b/postcss.config.cjs
similarity index 100%
rename from postcss.config.js
rename to postcss.config.cjs
diff --git a/remix.config.js b/remix.config.js
deleted file mode 100644
index 1bf0d286..00000000
--- a/remix.config.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/** @type {import('@remix-run/dev').AppConfig} */
-module.exports = {
- ignoredRouteFiles: ['**/.*'],
- // appDirectory: "app",
- // assetsBuildDirectory: "public/build",
- // publicPath: "/build/",
- // serverBuildPath: "build/index.js",
- serverModuleFormat: 'cjs',
-}
diff --git a/tailwind.config.js b/tailwind.config.cjs
similarity index 100%
rename from tailwind.config.js
rename to tailwind.config.cjs
diff --git a/tsconfig.json b/tsconfig.json
index 09f05602..ad5ae055 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,11 +1,12 @@
{
- "include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
+ "include": ["env.d.ts", "**/*.ts", "**/*.tsx"],
"compilerOptions": {
"lib": ["DOM", "DOM.Iterable", "ES2022"],
"isolatedModules": true,
"esModuleInterop": true,
"jsx": "react-jsx",
- "moduleResolution": "node",
+ "module": "ESNext",
+ "moduleResolution": "Bundler",
"resolveJsonModule": true,
"target": "ES2022",
"strict": true,
diff --git a/vite.config.ts b/vite.config.ts
new file mode 100644
index 00000000..177dd59b
--- /dev/null
+++ b/vite.config.ts
@@ -0,0 +1,7 @@
+import { unstable_vitePlugin as remix } from "@remix-run/dev";
+import { defineConfig } from "vite";
+import tsconfigPaths from "vite-tsconfig-paths";
+
+export default defineConfig({
+ plugins: [remix(), tsconfigPaths()],
+});
From 003cdac6d25a0cfe404d75e126a905b89f33818b Mon Sep 17 00:00:00 2001
From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
Date: Sun, 5 Nov 2023 11:34:30 +1100
Subject: [PATCH 02/39] Run prettier
---
vite.config.ts | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/vite.config.ts b/vite.config.ts
index 177dd59b..8d62f693 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,7 +1,7 @@
-import { unstable_vitePlugin as remix } from "@remix-run/dev";
-import { defineConfig } from "vite";
-import tsconfigPaths from "vite-tsconfig-paths";
+import { unstable_vitePlugin as remix } from '@remix-run/dev'
+import { defineConfig } from 'vite'
+import tsconfigPaths from 'vite-tsconfig-paths'
export default defineConfig({
plugins: [remix(), tsconfigPaths()],
-});
+})
From 758593cd8e7bbd3f41082abaa81937b678eacb57 Mon Sep 17 00:00:00 2001
From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
Date: Sun, 5 Nov 2023 11:35:49 +1100
Subject: [PATCH 03/39] Fix missing stylesheets
---
app/root.tsx | 3 +++
1 file changed, 3 insertions(+)
diff --git a/app/root.tsx b/app/root.tsx
index 29fcf558..d5ee32b9 100644
--- a/app/root.tsx
+++ b/app/root.tsx
@@ -1,5 +1,8 @@
import { Outlet, isRouteErrorResponse, useRouteError } from '@remix-run/react'
+import '~/styles/app.css'
+import '~/styles/carbon.css'
import '~/styles/prismThemeDark.css'
+import '@docsearch/css/dist/style.css'
import { seo } from '~/utils/seo'
import { RootDocument } from '~/components/RootDocument'
import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary'
From 2065b980233e3ea0bab716b27b61ec4b24153a51 Mon Sep 17 00:00:00 2001
From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
Date: Sun, 5 Nov 2023 11:50:11 +1100
Subject: [PATCH 04/39] Add remark-shiki-twoslash
---
app/components/CodeBlock.tsx | 69 -----
app/components/Mdx.tsx | 12 -
app/root.tsx | 1 -
app/styles/app.css | 297 +++++++++++++++++++-
app/styles/prismThemeDark.css | 446 ------------------------------
app/styles/prismThemeLight.css | 434 -----------------------------
app/utils/documents.server.ts | 8 +-
app/utils/svelteHighlighter.js | 150 ----------
package.json | 9 +-
pnpm-lock.yaml | 482 ++++++++++++++++++++++-----------
10 files changed, 622 insertions(+), 1286 deletions(-)
delete mode 100644 app/components/CodeBlock.tsx
delete mode 100644 app/styles/prismThemeDark.css
delete mode 100644 app/styles/prismThemeLight.css
delete mode 100644 app/utils/svelteHighlighter.js
diff --git a/app/components/CodeBlock.tsx b/app/components/CodeBlock.tsx
deleted file mode 100644
index 7b71fd4c..00000000
--- a/app/components/CodeBlock.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
-import type { FC, HTMLAttributes, ReactElement } from 'react'
-import invariant from 'tiny-invariant'
-import type { Language } from 'prism-react-renderer'
-import { Highlight, Prism } from 'prism-react-renderer'
-import { svelteHighlighter } from '~/utils/svelteHighlighter'
-// Add back additional language support after `prism-react` upgrade
-;(typeof global !== 'undefined' ? global : window).Prism = Prism
-// require('prismjs/components/prism-diff')
-// require('prismjs/components/prism-bash')
-
-// @ts-ignore Alias markup as vue highlight
-Prism.languages.vue = Prism.languages.markup
-
-// Enable svelte syntax highlighter
-svelteHighlighter()
-
-function getLanguageFromClassName(className: string) {
- const match = className.match(/language-(\w+)/)
- return match ? match[1] : ''
-}
-
-function isLanguageSupported(lang: string): lang is Language {
- return lang in Prism.languages
-}
-
-export const CodeBlock: FC
> = ({ children }) => {
- invariant(!!children, 'children is required')
- const child = children as ReactElement
- const className = child.props?.className || ''
- const userLang = getLanguageFromClassName(className)
- const lang = isLanguageSupported(userLang) ? userLang : 'bash'
- const code = child.props.children || ''
- return (
-
-
- {({ className, tokens, getLineProps, getTokenProps }) => (
-
-
- {lang}
-
-
-
-
- {tokens.map((line, i) => (
-
- {line.map((token, key) => (
-
- ))}
-
- ))}
-
-
-
-
- )}
-
-
- )
-}
diff --git a/app/components/Mdx.tsx b/app/components/Mdx.tsx
index 1320b2e1..9da62504 100644
--- a/app/components/Mdx.tsx
+++ b/app/components/Mdx.tsx
@@ -1,6 +1,5 @@
import * as React from 'react'
import { getMDXComponent } from 'mdx-bundler/client'
-import { CodeBlock } from '~/components/CodeBlock'
import { MarkdownLink } from '~/components/MarkdownLink'
import type { MDXComponents } from 'mdx/types'
@@ -34,23 +33,12 @@ const makeHeading =
const markdownComponents = {
a: MarkdownLink,
- pre: CodeBlock,
h1: makeHeading('h1'),
h2: makeHeading('h2'),
h3: makeHeading('h3'),
h4: makeHeading('h4'),
h5: makeHeading('h5'),
h6: makeHeading('h6'),
- code: ({ className = '', ...props }: React.HTMLProps) => {
- return (
-
- )
- },
}
export function Mdx({
diff --git a/app/root.tsx b/app/root.tsx
index d5ee32b9..c3bd02c0 100644
--- a/app/root.tsx
+++ b/app/root.tsx
@@ -1,7 +1,6 @@
import { Outlet, isRouteErrorResponse, useRouteError } from '@remix-run/react'
import '~/styles/app.css'
import '~/styles/carbon.css'
-import '~/styles/prismThemeDark.css'
import '@docsearch/css/dist/style.css'
import { seo } from '~/utils/seo'
import { RootDocument } from '~/components/RootDocument'
diff --git a/app/styles/app.css b/app/styles/app.css
index 37fdd138..1c73b0af 100644
--- a/app/styles/app.css
+++ b/app/styles/app.css
@@ -141,7 +141,298 @@
@apply absolute bottom-0 right-0;
}
-code[class*="language-"] {
- white-space: pre-wrap;
- word-break: break-all;
+pre {
+ /* In theory shiki will overwrite these, but this is to make sure there are defaults regardless */
+ background-color: white;
+ color: black;
+
+ /* Give it some space to breathe */
+ padding: 12px;
+
+ /* All code samples get a grey border, twoslash ones get a different color */
+ border-left: 1px solid #999;
+ border-bottom: 1px solid #999;
+
+ margin-bottom: 3rem;
+
+ /* Important to allow the code to move horizontally; */
+ overflow-x: auto;
+ position: relative;
+}
+ pre.shiki {
+ overflow-x: auto;
+}
+ pre.shiki:hover .dim {
+ opacity: 1;
+}
+ pre.shiki div.dim {
+ opacity: 0.5;
+}
+ pre.shiki div.dim, pre.shiki div.highlight {
+ margin: 0;
+ padding: 0;
+}
+ pre.shiki div.highlight {
+ opacity: 1;
+ background-color: #f1f8ff;
+}
+ pre.shiki div.line {
+ min-height: 1rem;
+}
+
+/** Don't show the language identifiers */
+pre.shiki .language-id{
+ display: none;
+}
+
+/* Visually differentiates twoslash code samples */
+ pre.twoslash {
+ border-color: #719af4;
+}
+
+/** When you mouse over the pre, show the underlines */
+pre.twoslash:hover data-lsp {
+ border-color: #747474;
+}
+
+/** The tooltip-like which provides the LSP response */
+pre.twoslash data-lsp:hover::before {
+ content: attr(lsp);
+ position: absolute;
+ transform: translate(0, 1rem);
+
+ background-color: #3f3f3f;
+ color: #fff;
+ text-align: left;
+ padding: 5px 8px;
+ border-radius: 2px;
+ font-family: "JetBrains Mono", Menlo, Monaco, Consolas, Courier New, monospace;
+ font-size: 14px;
+ white-space: pre-wrap;
+ z-index: 100;
+}
+
+pre .code-container {
+ overflow: auto;
+}
+/* The try button */
+ pre .code-container > a {
+ position: absolute;
+ right: 8px;
+ bottom: 8px;
+ border-radius: 4px;
+ border: 1px solid #719af4;
+ padding: 0 8px;
+ color: #719af4;
+ text-decoration: none;
+ opacity: 0;
+ transition-timing-function: ease;
+ transition: opacity 0.3s;
+}
+/* Respect no animations */
+@media (prefers-reduced-motion: reduce) {
+ pre .code-container > a {
+ transition: none;
+ }
+}
+ pre .code-container > a:hover {
+ color: white;
+ background-color: #719af4;
+}
+ pre .code-container:hover a {
+ opacity: 1;
+}
+
+ pre code {
+ font-size: 15px;
+ font-family: "JetBrains Mono", Menlo, Monaco, Consolas, Courier New, monospace;;
+ white-space: pre;
+ -webkit-overflow-scrolling: touch;
+}
+ pre code a {
+ text-decoration: none;
+}
+ pre data-err {
+ /* Extracted from VS Code */
+ background: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%206%203'%20enable-background%3D'new%200%200%206%203'%20height%3D'3'%20width%3D'6'%3E%3Cg%20fill%3D'%23c94824'%3E%3Cpolygon%20points%3D'5.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0'%2F%3E%3Cpolygon%20points%3D'4%2C0%206%2C2%206%2C0.6%205.4%2C0'%2F%3E%3Cpolygon%20points%3D'0%2C2%201%2C3%202.4%2C3%200%2C0.6'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") repeat-x bottom left;
+ padding-bottom: 3px;
+}
+ pre .query {
+ margin-bottom: 10px;
+ color: #137998;
+ display: inline-block;
+}
+
+ /* In order to have the 'popped out' style design and to not break the layout
+ /* we need to place a fake and un-selectable copy of the error which _isn't_ broken out
+ /* behind the actual error message.
+
+ /* This sections keeps both of those two in in sync */
+
+ pre .error, pre .error-behind {
+ margin-left: -14px;
+ margin-top: 8px;
+ margin-bottom: 4px;
+ padding: 6px;
+ padding-left: 14px;
+ width: calc(100% - 20px);
+ white-space: pre-wrap;
+ display: block;
+}
+ pre .error {
+ position: absolute;
+ background-color: #fee;
+ border-left: 2px solid #bf1818;
+ /* Give the space to the error code */
+ display: flex;
+ align-items: center;
+ color: black;
+}
+ pre .error .code {
+ display: none;
+}
+ pre .error-behind {
+ user-select: none;
+ visibility: transparent;
+ color: #fee;
+}
+/* Queries */
+ pre .arrow {
+ /* Transparent background */
+ background-color: #eee;
+ position: relative;
+ top: -7px;
+ margin-left: 0.1rem;
+ /* Edges */
+ border-left: 1px solid #eee;
+ border-top: 1px solid #eee;
+ transform: translateY(25%) rotate(45deg);
+ /* Size */
+ height: 8px;
+ width: 8px;
+}
+ pre .popover {
+ margin-bottom: 10px;
+ background-color: #eee;
+ display: inline-block;
+ padding: 0 0.5rem 0.3rem;
+ margin-top: 10px;
+ border-radius: 3px;
+}
+/* Completion */
+ pre .inline-completions ul.dropdown {
+ display: inline-block;
+ position: absolute;
+ width: 240px;
+ background-color: gainsboro;
+ color: grey;
+ padding-top: 4px;
+ font-family: var(--code-font);
+ font-size: 0.8rem;
+ margin: 0;
+ padding: 0;
+ border-left: 4px solid #4b9edd;
+}
+ pre .inline-completions ul.dropdown::before {
+ background-color: #4b9edd;
+ width: 2px;
+ position: absolute;
+ top: -1.2rem;
+ left: -3px;
+ content: " ";
+}
+ pre .inline-completions ul.dropdown li {
+ overflow-x: hidden;
+ padding-left: 4px;
+ margin-bottom: 4px;
+}
+ pre .inline-completions ul.dropdown li.deprecated {
+ text-decoration: line-through;
+}
+ pre .inline-completions ul.dropdown li span.result-found {
+ color: #4b9edd;
+}
+ pre .inline-completions ul.dropdown li span.result {
+ width: 100px;
+ color: black;
+ display: inline-block;
+}
+ .dark-theme .markdown pre {
+ background-color: #d8d8d8;
+ border-color: #ddd;
+ filter: invert(98%) hue-rotate(180deg);
+}
+ data-lsp {
+ /* Ensures there's no 1px jump when the hover happens */
+ border-bottom: 1px dotted transparent;
+ /* Fades in unobtrusively */
+ transition-timing-function: ease;
+ transition: border-color 0.3s;
+}
+/* Respect people's wishes to not have animations */
+ @media (prefers-reduced-motion: reduce) {
+ data-lsp {
+ transition: none;
+ }
+}
+
+/** Annotations support, providing a tool for meta commentary */
+.tag-container {
+ position: relative;
+}
+.tag-container .twoslash-annotation {
+ position: absolute;
+ font-family: "JetBrains Mono", Menlo, Monaco, Consolas, Courier New, monospace;
+ right: -10px;
+ /** Default annotation text to 200px */
+ width: 200px;
+ color: #187abf;
+ background-color: #fcf3d9 bb;
+}
+.tag-container .twoslash-annotation p {
+ text-align: left;
+ font-size: 0.8rem;
+ line-height: 0.9rem;
+}
+.tag-container .twoslash-annotation svg {
+ float: left;
+ margin-left: -44px;
+}
+.tag-container .twoslash-annotation.left {
+ right: auto;
+ left: -200px;
+}
+.tag-container .twoslash-annotation.left svg {
+ float: right;
+ margin-right: -5px;
+}
+
+/** Support for showing console log/warn/errors inline */
+pre .logger {
+ display: flex;
+ align-items: center;
+ color: black;
+ padding: 6px;
+ padding-left: 8px;
+ width: calc(100% - 19px);
+ white-space: pre-wrap;
+}
+pre .logger svg {
+ margin-right: 9px;
+}
+pre .logger.error-log {
+ background-color: #fee;
+ border-left: 2px solid #bf1818;
+}
+pre .logger.warn-log {
+ background-color: #ffe;
+ border-left: 2px solid #eae662;
+}
+pre .logger.log-log {
+ background-color: #e9e9e9;
+ border-left: 2px solid #ababab;
+}
+pre .logger.log-log svg {
+ margin-left: 6px;
+ margin-right: 9px;
}
diff --git a/app/styles/prismThemeDark.css b/app/styles/prismThemeDark.css
deleted file mode 100644
index bbd1ccef..00000000
--- a/app/styles/prismThemeDark.css
+++ /dev/null
@@ -1,446 +0,0 @@
-/**
- * One Dark theme for prism.js
- * Based on Atom's One Dark theme: https://github.com/atom/atom/tree/master/packages/one-dark-syntax
- */
-
-/**
- * One Dark colours (accurate as of commit 8ae45ca on 6 Sep 2018)
- * From colors.less
- * --mono-1: hsl(220, 14%, 71%);
- * --mono-2: hsl(220, 9%, 55%);
- * --mono-3: hsl(220, 10%, 40%);
- * --hue-1: hsl(187, 47%, 55%);
- * --hue-2: hsl(207, 82%, 66%);
- * --hue-3: hsl(286, 60%, 67%);
- * --hue-4: hsl(95, 38%, 62%);
- * --hue-5: hsl(355, 65%, 65%);
- * --hue-5-2: hsl(5, 48%, 51%);
- * --hue-6: hsl(29, 54%, 61%);
- * --hue-6-2: hsl(39, 67%, 69%);
- * --syntax-fg: hsl(220, 14%, 71%);
- * --syntax-bg: hsl(220, 13%, 18%);
- * --syntax-gutter: hsl(220, 14%, 45%);
- * --syntax-guide: hsla(220, 14%, 71%, 0.15);
- * --syntax-accent: hsl(220, 100%, 66%);
- * From syntax-variables.less
- * --syntax-selection-color: hsl(220, 13%, 28%);
- * --syntax-gutter-background-color-selected: hsl(220, 13%, 26%);
- * --syntax-cursor-line: hsla(220, 100%, 80%, 0.04);
- */
-
-code[class*='language-'],
-pre[class*='language-'] {
- background: hsl(220, 29%, 14%);
- color: hsl(220, 14%, 71%);
- text-shadow: 0 1px rgba(0, 0, 0, 0.3);
- font-family: 'Fira Code', 'Fira Mono', Menlo, Consolas, 'DejaVu Sans Mono',
- monospace;
- direction: ltr;
- text-align: left;
- white-space: pre;
- word-spacing: normal;
- word-break: normal;
- line-height: 1.5;
- -moz-tab-size: 2;
- -o-tab-size: 2;
- tab-size: 2;
- -webkit-hyphens: none;
- -moz-hyphens: none;
- -ms-hyphens: none;
- hyphens: none;
-}
-
-/* Selection */
-code[class*='language-']::-moz-selection,
-code[class*='language-'] *::-moz-selection,
-pre[class*='language-'] *::-moz-selection {
- background: hsl(220, 13%, 28%);
- color: inherit;
- text-shadow: none;
-}
-
-code[class*='language-']::selection,
-code[class*='language-'] *::selection,
-pre[class*='language-'] *::selection {
- background: hsl(220, 13%, 28%);
- color: inherit;
- text-shadow: none;
-}
-
-/* Code blocks */
-pre[class*='language-'] {
- padding: 1em;
- /* margin: 0.5em 0; */
- overflow: auto;
- border-radius: 0.3em;
-}
-
-/* Inline code */
-:not(pre) > code[class*='language-'] {
- padding: 0.2em 0.3em;
- border-radius: 0.3em;
- white-space: normal;
-}
-
-/* Print */
-@media print {
- code[class*='language-'],
- pre[class*='language-'] {
- text-shadow: none;
- }
-}
-
-.token.comment,
-.token.prolog,
-.token.cdata {
- color: hsl(220, 10%, 40%);
-}
-
-.token.doctype,
-.token.punctuation,
-.token.entity {
- color: hsl(220, 14%, 71%);
-}
-
-.token.attr-name,
-.token.class-name,
-.token.boolean,
-.token.constant,
-.token.number,
-.token.atrule {
- color: hsl(29, 54%, 61%);
-}
-
-.token.keyword {
- color: hsl(286, 60%, 67%);
-}
-
-.token.property,
-.token.tag,
-.token.symbol,
-.token.deleted,
-.token.important {
- color: hsl(355, 65%, 65%);
-}
-
-.token.selector,
-.token.string,
-.token.char,
-.token.builtin,
-.token.inserted,
-.token.regex,
-.token.attr-value,
-.token.attr-value > .token.punctuation {
- color: hsl(95, 38%, 62%);
-}
-
-.token.variable,
-.token.operator,
-.token.function {
- color: hsl(207, 82%, 66%);
-}
-
-.token.url {
- color: hsl(187, 47%, 55%);
-}
-
-/* HTML overrides */
-.token.attr-value > .token.punctuation.attr-equals,
-.token.special-attr > .token.attr-value > .token.value.css {
- color: hsl(220, 14%, 71%);
-}
-
-/* CSS overrides */
-.language-css .token.selector {
- color: hsl(355, 65%, 65%);
-}
-
-.language-css .token.property {
- color: hsl(220, 14%, 71%);
-}
-
-.language-css .token.function,
-.language-css .token.url > .token.function {
- color: hsl(187, 47%, 55%);
-}
-
-.language-css .token.url > .token.string.url {
- color: hsl(95, 38%, 62%);
-}
-
-.language-css .token.important,
-.language-css .token.atrule .token.rule {
- color: hsl(286, 60%, 67%);
-}
-
-/* JS overrides */
-.language-javascript .token.operator {
- color: hsl(286, 60%, 67%);
-}
-
-.language-javascript
- .token.template-string
- > .token.interpolation
- > .token.interpolation-punctuation.punctuation {
- color: hsl(5, 48%, 51%);
-}
-
-/* JSON overrides */
-.language-json .token.operator {
- color: hsl(220, 14%, 71%);
-}
-
-.language-json .token.null.keyword {
- color: hsl(29, 54%, 61%);
-}
-
-/* MD overrides */
-.language-markdown .token.url,
-.language-markdown .token.url > .token.operator,
-.language-markdown .token.url-reference.url > .token.string {
- color: hsl(220, 14%, 71%);
-}
-
-.language-markdown .token.url > .token.content {
- color: hsl(207, 82%, 66%);
-}
-
-.language-markdown .token.url > .token.url,
-.language-markdown .token.url-reference.url {
- color: hsl(187, 47%, 55%);
-}
-
-.language-markdown .token.blockquote.punctuation,
-.language-markdown .token.hr.punctuation {
- color: hsl(220, 10%, 40%);
- font-style: italic;
-}
-
-.language-markdown .token.code-snippet {
- color: hsl(95, 38%, 62%);
-}
-
-.language-markdown .token.bold .token.content {
- color: hsl(29, 54%, 61%);
-}
-
-.language-markdown .token.italic .token.content {
- color: hsl(286, 60%, 67%);
-}
-
-.language-markdown .token.strike .token.content,
-.language-markdown .token.strike .token.punctuation,
-.language-markdown .token.list.punctuation,
-.language-markdown .token.title.important > .token.punctuation {
- color: hsl(355, 65%, 65%);
-}
-
-/* General */
-.token.bold {
- font-weight: bold;
-}
-
-.token.comment,
-.token.italic {
- font-style: italic;
-}
-
-.token.entity {
- cursor: help;
-}
-
-.token.namespace {
- opacity: 0.8;
-}
-
-/* Plugin overrides */
-/* Selectors should have higher specificity than those in the plugins' default stylesheets */
-
-/* Show Invisibles plugin overrides */
-.token.token.tab:not(:empty):before,
-.token.token.cr:before,
-.token.token.lf:before,
-.token.token.space:before {
- color: hsla(220, 14%, 71%, 0.15);
- text-shadow: none;
-}
-
-/* Toolbar plugin overrides */
-/* Space out all buttons and move them away from the right edge of the code block */
-div.code-toolbar > .toolbar.toolbar > .toolbar-item {
- margin-right: 0.4em;
-}
-
-/* Styling the buttons */
-div.code-toolbar > .toolbar.toolbar > .toolbar-item > button,
-div.code-toolbar > .toolbar.toolbar > .toolbar-item > a,
-div.code-toolbar > .toolbar.toolbar > .toolbar-item > span {
- background: hsl(220, 13%, 26%);
- color: hsl(220, 9%, 55%);
- padding: 0.1em 0.4em;
- border-radius: 0.3em;
-}
-
-div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover,
-div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus,
-div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover,
-div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus,
-div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover,
-div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus {
- background: hsl(220, 13%, 28%);
- color: hsl(220, 14%, 71%);
-}
-
-/* Line Highlight plugin overrides */
-/* The highlighted line itself */
-.line-highlight.line-highlight {
- background: hsla(220, 100%, 80%, 0.04);
-}
-
-/* Default line numbers in Line Highlight plugin */
-.line-highlight.line-highlight:before,
-.line-highlight.line-highlight[data-end]:after {
- background: hsl(220, 13%, 26%);
- color: hsl(220, 14%, 71%);
- padding: 0.1em 0.6em;
- border-radius: 0.3em;
- box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.2); /* same as Toolbar plugin default */
-}
-
-/* Hovering over a linkable line number (in the gutter area) */
-/* Requires Line Numbers plugin as well */
-pre[id].linkable-line-numbers.linkable-line-numbers
- span.line-numbers-rows
- > span:hover:before {
- background-color: hsla(220, 100%, 80%, 0.04);
-}
-
-/* Line Numbers and Command Line plugins overrides */
-/* Line separating gutter from coding area */
-.line-numbers.line-numbers .line-numbers-rows,
-.command-line .command-line-prompt {
- border-right-color: hsla(220, 14%, 71%, 0.15);
-}
-
-/* Stuff in the gutter */
-.line-numbers .line-numbers-rows > span:before,
-.command-line .command-line-prompt > span:before {
- color: hsl(220, 14%, 45%);
-}
-
-/* Match Braces plugin overrides */
-/* Note: Outline colour is inherited from the braces */
-.rainbow-braces .token.token.punctuation.brace-level-1,
-.rainbow-braces .token.token.punctuation.brace-level-5,
-.rainbow-braces .token.token.punctuation.brace-level-9 {
- color: hsl(355, 65%, 65%);
-}
-
-.rainbow-braces .token.token.punctuation.brace-level-2,
-.rainbow-braces .token.token.punctuation.brace-level-6,
-.rainbow-braces .token.token.punctuation.brace-level-10 {
- color: hsl(95, 38%, 62%);
-}
-
-.rainbow-braces .token.token.punctuation.brace-level-3,
-.rainbow-braces .token.token.punctuation.brace-level-7,
-.rainbow-braces .token.token.punctuation.brace-level-11 {
- color: hsl(207, 82%, 66%);
-}
-
-.rainbow-braces .token.token.punctuation.brace-level-4,
-.rainbow-braces .token.token.punctuation.brace-level-8,
-.rainbow-braces .token.token.punctuation.brace-level-12 {
- color: hsl(286, 60%, 67%);
-}
-
-/* Diff Highlight plugin overrides */
-/* Taken from https://github.com/atom/github/blob/master/styles/variables.less */
-pre.diff-highlight > code .token.token.deleted:not(.prefix),
-pre > code.diff-highlight .token.token.deleted:not(.prefix) {
- background-color: hsla(353, 100%, 66%, 0.15);
-}
-
-pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection,
-pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection,
-pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection,
-pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection {
- background-color: hsla(353, 95%, 66%, 0.25);
-}
-
-pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection,
-pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection,
-pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection,
-pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection {
- background-color: hsla(353, 95%, 66%, 0.25);
-}
-
-pre.diff-highlight > code .token.token.inserted:not(.prefix),
-pre > code.diff-highlight .token.token.inserted:not(.prefix) {
- background-color: hsla(137, 100%, 55%, 0.15);
-}
-
-pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection,
-pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection,
-pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection,
-pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection {
- background-color: hsla(135, 73%, 55%, 0.25);
-}
-
-pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection,
-pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection,
-pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection,
-pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection {
- background-color: hsla(135, 73%, 55%, 0.25);
-}
-
-/* Previewers plugin overrides */
-/* Based on https://github.com/atom-community/atom-ide-datatip/blob/master/styles/atom-ide-datatips.less and https://github.com/atom/atom/blob/master/packages/one-dark-ui */
-/* Border around popup */
-.prism-previewer.prism-previewer:before,
-.prism-previewer-gradient.prism-previewer-gradient div {
- border-color: hsl(224, 13%, 17%);
-}
-
-/* Angle and time should remain as circles and are hence not included */
-.prism-previewer-color.prism-previewer-color:before,
-.prism-previewer-gradient.prism-previewer-gradient div,
-.prism-previewer-easing.prism-previewer-easing:before {
- border-radius: 0.3em;
-}
-
-/* Triangles pointing to the code */
-.prism-previewer.prism-previewer:after {
- border-top-color: hsl(224, 13%, 17%);
-}
-
-.prism-previewer-flipped.prism-previewer-flipped.after {
- border-bottom-color: hsl(224, 13%, 17%);
-}
-
-/* Background colour within the popup */
-.prism-previewer-angle.prism-previewer-angle:before,
-.prism-previewer-time.prism-previewer-time:before,
-.prism-previewer-easing.prism-previewer-easing {
- background: hsl(219, 13%, 22%);
-}
-
-/* For angle, this is the positive area (eg. 90deg will display one quadrant in this colour) */
-/* For time, this is the alternate colour */
-.prism-previewer-angle.prism-previewer-angle circle,
-.prism-previewer-time.prism-previewer-time circle {
- stroke: hsl(220, 14%, 71%);
- stroke-opacity: 1;
-}
-
-/* Stroke colours of the handle, direction point, and vector itself */
-.prism-previewer-easing.prism-previewer-easing circle,
-.prism-previewer-easing.prism-previewer-easing path,
-.prism-previewer-easing.prism-previewer-easing line {
- stroke: hsl(220, 14%, 71%);
-}
-
-/* Fill colour of the handle */
-.prism-previewer-easing.prism-previewer-easing circle {
- fill: transparent;
-}
diff --git a/app/styles/prismThemeLight.css b/app/styles/prismThemeLight.css
deleted file mode 100644
index 80f49d21..00000000
--- a/app/styles/prismThemeLight.css
+++ /dev/null
@@ -1,434 +0,0 @@
-/**
- * One Light theme for prism.js
- * Based on Atom's One Light theme: https://github.com/atom/atom/tree/master/packages/one-light-syntax
- */
-
-/**
- * One Light colours (accurate as of commit eb064bf on 19 Feb 2021)
- * From colors.less
- * --mono-1: hsl(230, 8%, 24%);
- * --mono-2: hsl(230, 6%, 44%);
- * --mono-3: hsl(230, 4%, 64%)
- * --hue-1: hsl(198, 99%, 37%);
- * --hue-2: hsl(221, 87%, 60%);
- * --hue-3: hsl(301, 63%, 40%);
- * --hue-4: hsl(119, 34%, 47%);
- * --hue-5: hsl(5, 74%, 59%);
- * --hue-5-2: hsl(344, 84%, 43%);
- * --hue-6: hsl(35, 99%, 36%);
- * --hue-6-2: hsl(35, 99%, 40%);
- * --syntax-fg: hsl(230, 8%, 24%);
- * --syntax-bg: hsl(230, 1%, 98%);
- * --syntax-gutter: hsl(230, 1%, 62%);
- * --syntax-guide: hsla(230, 8%, 24%, 0.2);
- * --syntax-accent: hsl(230, 100%, 66%);
- * From syntax-variables.less
- * --syntax-selection-color: hsl(230, 1%, 90%);
- * --syntax-gutter-background-color-selected: hsl(230, 1%, 90%);
- * --syntax-cursor-line: hsla(230, 8%, 24%, 0.05);
- */
-
-code[class*='language-'],
-pre[class*='language-'] {
- background: #f4f7f9;
- color: hsl(230, 8%, 24%);
- font-family: 'Fira Code', 'Fira Mono', Menlo, Consolas, 'DejaVu Sans Mono',
- monospace;
- direction: ltr;
- text-align: left;
- white-space: pre;
- word-spacing: normal;
- word-break: normal;
- line-height: 1.5;
- -moz-tab-size: 2;
- -o-tab-size: 2;
- tab-size: 2;
- -webkit-hyphens: none;
- -moz-hyphens: none;
- -ms-hyphens: none;
- hyphens: none;
-}
-
-/* Selection */
-code[class*='language-']::-moz-selection,
-code[class*='language-'] *::-moz-selection,
-pre[class*='language-'] *::-moz-selection {
- background: hsl(230, 1%, 90%);
- color: inherit;
-}
-
-code[class*='language-']::selection,
-code[class*='language-'] *::selection,
-pre[class*='language-'] *::selection {
- background: hsl(230, 1%, 90%);
- color: inherit;
-}
-
-/* Code blocks */
-pre[class*='language-'] {
- padding: 1em;
- /* margin: 0.5em 0; */
- overflow: auto;
- border-radius: 0.3em;
-}
-
-/* Inline code */
-:not(pre) > code[class*='language-'] {
- padding: 0.2em 0.3em;
- border-radius: 0.3em;
- white-space: normal;
-}
-
-.token.comment,
-.token.prolog,
-.token.cdata {
- color: hsl(230, 4%, 64%);
-}
-
-.token.doctype,
-.token.punctuation,
-.token.entity {
- color: hsl(230, 8%, 24%);
-}
-
-.token.attr-name,
-.token.class-name,
-.token.boolean,
-.token.constant,
-.token.number,
-.token.atrule {
- color: hsl(35, 99%, 36%);
-}
-
-.token.keyword {
- color: hsl(301, 63%, 40%);
-}
-
-.token.property,
-.token.tag,
-.token.symbol,
-.token.deleted,
-.token.important {
- color: hsl(5, 74%, 59%);
-}
-
-.token.selector,
-.token.string,
-.token.char,
-.token.builtin,
-.token.inserted,
-.token.regex,
-.token.attr-value,
-.token.attr-value > .token.punctuation {
- color: hsl(119, 34%, 47%);
-}
-
-.token.variable,
-.token.operator,
-.token.function {
- color: hsl(221, 87%, 60%);
-}
-
-.token.url {
- color: hsl(198, 99%, 37%);
-}
-
-/* HTML overrides */
-.token.attr-value > .token.punctuation.attr-equals,
-.token.special-attr > .token.attr-value > .token.value.css {
- color: hsl(230, 8%, 24%);
-}
-
-/* CSS overrides */
-.language-css .token.selector {
- color: hsl(5, 74%, 59%);
-}
-
-.language-css .token.property {
- color: hsl(230, 8%, 24%);
-}
-
-.language-css .token.function,
-.language-css .token.url > .token.function {
- color: hsl(198, 99%, 37%);
-}
-
-.language-css .token.url > .token.string.url {
- color: hsl(119, 34%, 47%);
-}
-
-.language-css .token.important,
-.language-css .token.atrule .token.rule {
- color: hsl(301, 63%, 40%);
-}
-
-/* JS overrides */
-.language-javascript .token.operator {
- color: hsl(301, 63%, 40%);
-}
-
-.language-javascript
- .token.template-string
- > .token.interpolation
- > .token.interpolation-punctuation.punctuation {
- color: hsl(344, 84%, 43%);
-}
-
-/* JSON overrides */
-.language-json .token.operator {
- color: hsl(230, 8%, 24%);
-}
-
-.language-json .token.null.keyword {
- color: hsl(35, 99%, 36%);
-}
-
-/* MD overrides */
-.language-markdown .token.url,
-.language-markdown .token.url > .token.operator,
-.language-markdown .token.url-reference.url > .token.string {
- color: hsl(230, 8%, 24%);
-}
-
-.language-markdown .token.url > .token.content {
- color: hsl(221, 87%, 60%);
-}
-
-.language-markdown .token.url > .token.url,
-.language-markdown .token.url-reference.url {
- color: hsl(198, 99%, 37%);
-}
-
-.language-markdown .token.blockquote.punctuation,
-.language-markdown .token.hr.punctuation {
- color: hsl(230, 4%, 64%);
- font-style: italic;
-}
-
-.language-markdown .token.code-snippet {
- color: hsl(119, 34%, 47%);
-}
-
-.language-markdown .token.bold .token.content {
- color: hsl(35, 99%, 36%);
-}
-
-.language-markdown .token.italic .token.content {
- color: hsl(301, 63%, 40%);
-}
-
-.language-markdown .token.strike .token.content,
-.language-markdown .token.strike .token.punctuation,
-.language-markdown .token.list.punctuation,
-.language-markdown .token.title.important > .token.punctuation {
- color: hsl(5, 74%, 59%);
-}
-
-/* General */
-.token.bold {
- font-weight: bold;
-}
-
-.token.comment,
-.token.italic {
- font-style: italic;
-}
-
-.token.entity {
- cursor: help;
-}
-
-.token.namespace {
- opacity: 0.8;
-}
-
-/* Plugin overrides */
-/* Selectors should have higher specificity than those in the plugins' default stylesheets */
-
-/* Show Invisibles plugin overrides */
-.token.token.tab:not(:empty):before,
-.token.token.cr:before,
-.token.token.lf:before,
-.token.token.space:before {
- color: hsla(230, 8%, 24%, 0.2);
-}
-
-/* Toolbar plugin overrides */
-/* Space out all buttons and move them away from the right edge of the code block */
-div.code-toolbar > .toolbar.toolbar > .toolbar-item {
- margin-right: 0.4em;
-}
-
-/* Styling the buttons */
-div.code-toolbar > .toolbar.toolbar > .toolbar-item > button,
-div.code-toolbar > .toolbar.toolbar > .toolbar-item > a,
-div.code-toolbar > .toolbar.toolbar > .toolbar-item > span {
- background: hsl(230, 1%, 90%);
- color: hsl(230, 6%, 44%);
- padding: 0.1em 0.4em;
- border-radius: 0.3em;
-}
-
-div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover,
-div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus,
-div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover,
-div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus,
-div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover,
-div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus {
- background: hsl(230, 1%, 78%); /* custom: darken(--syntax-bg, 20%) */
- color: hsl(230, 8%, 24%);
-}
-
-/* Line Highlight plugin overrides */
-/* The highlighted line itself */
-.line-highlight.line-highlight {
- background: hsla(230, 8%, 24%, 0.05);
-}
-
-/* Default line numbers in Line Highlight plugin */
-.line-highlight.line-highlight:before,
-.line-highlight.line-highlight[data-end]:after {
- background: hsl(230, 1%, 90%);
- color: hsl(230, 8%, 24%);
- padding: 0.1em 0.6em;
- border-radius: 0.3em;
- box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.2); /* same as Toolbar plugin default */
-}
-
-/* Hovering over a linkable line number (in the gutter area) */
-/* Requires Line Numbers plugin as well */
-pre[id].linkable-line-numbers.linkable-line-numbers
- span.line-numbers-rows
- > span:hover:before {
- background-color: hsla(230, 8%, 24%, 0.05);
-}
-
-/* Line Numbers and Command Line plugins overrides */
-/* Line separating gutter from coding area */
-.line-numbers.line-numbers .line-numbers-rows,
-.command-line .command-line-prompt {
- border-right-color: hsla(230, 8%, 24%, 0.2);
-}
-
-/* Stuff in the gutter */
-.line-numbers .line-numbers-rows > span:before,
-.command-line .command-line-prompt > span:before {
- color: hsl(230, 1%, 62%);
-}
-
-/* Match Braces plugin overrides */
-/* Note: Outline colour is inherited from the braces */
-.rainbow-braces .token.token.punctuation.brace-level-1,
-.rainbow-braces .token.token.punctuation.brace-level-5,
-.rainbow-braces .token.token.punctuation.brace-level-9 {
- color: hsl(5, 74%, 59%);
-}
-
-.rainbow-braces .token.token.punctuation.brace-level-2,
-.rainbow-braces .token.token.punctuation.brace-level-6,
-.rainbow-braces .token.token.punctuation.brace-level-10 {
- color: hsl(119, 34%, 47%);
-}
-
-.rainbow-braces .token.token.punctuation.brace-level-3,
-.rainbow-braces .token.token.punctuation.brace-level-7,
-.rainbow-braces .token.token.punctuation.brace-level-11 {
- color: hsl(221, 87%, 60%);
-}
-
-.rainbow-braces .token.token.punctuation.brace-level-4,
-.rainbow-braces .token.token.punctuation.brace-level-8,
-.rainbow-braces .token.token.punctuation.brace-level-12 {
- color: hsl(301, 63%, 40%);
-}
-
-/* Diff Highlight plugin overrides */
-/* Taken from https://github.com/atom/github/blob/master/styles/variables.less */
-pre.diff-highlight > code .token.token.deleted:not(.prefix),
-pre > code.diff-highlight .token.token.deleted:not(.prefix) {
- background-color: hsla(353, 100%, 66%, 0.15);
-}
-
-pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection,
-pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection,
-pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection,
-pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection {
- background-color: hsla(353, 95%, 66%, 0.25);
-}
-
-pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection,
-pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection,
-pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection,
-pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection {
- background-color: hsla(353, 95%, 66%, 0.25);
-}
-
-pre.diff-highlight > code .token.token.inserted:not(.prefix),
-pre > code.diff-highlight .token.token.inserted:not(.prefix) {
- background-color: hsla(137, 100%, 55%, 0.15);
-}
-
-pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection,
-pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection,
-pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection,
-pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection {
- background-color: hsla(135, 73%, 55%, 0.25);
-}
-
-pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection,
-pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection,
-pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection,
-pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection {
- background-color: hsla(135, 73%, 55%, 0.25);
-}
-
-/* Previewers plugin overrides */
-/* Based on https://github.com/atom-community/atom-ide-datatip/blob/master/styles/atom-ide-datatips.less and https://github.com/atom/atom/blob/master/packages/one-light-ui */
-/* Border around popup */
-.prism-previewer.prism-previewer:before,
-.prism-previewer-gradient.prism-previewer-gradient div {
- border-color: hsl(0, 0, 95%);
-}
-
-/* Angle and time should remain as circles and are hence not included */
-.prism-previewer-color.prism-previewer-color:before,
-.prism-previewer-gradient.prism-previewer-gradient div,
-.prism-previewer-easing.prism-previewer-easing:before {
- border-radius: 0.3em;
-}
-
-/* Triangles pointing to the code */
-.prism-previewer.prism-previewer:after {
- border-top-color: hsl(0, 0, 95%);
-}
-
-.prism-previewer-flipped.prism-previewer-flipped.after {
- border-bottom-color: hsl(0, 0, 95%);
-}
-
-/* Background colour within the popup */
-.prism-previewer-angle.prism-previewer-angle:before,
-.prism-previewer-time.prism-previewer-time:before,
-.prism-previewer-easing.prism-previewer-easing {
- background: hsl(0, 0%, 100%);
-}
-
-/* For angle, this is the positive area (eg. 90deg will display one quadrant in this colour) */
-/* For time, this is the alternate colour */
-.prism-previewer-angle.prism-previewer-angle circle,
-.prism-previewer-time.prism-previewer-time circle {
- stroke: hsl(230, 8%, 24%);
- stroke-opacity: 1;
-}
-
-/* Stroke colours of the handle, direction point, and vector itself */
-.prism-previewer-easing.prism-previewer-easing circle,
-.prism-previewer-easing.prism-previewer-easing path,
-.prism-previewer-easing.prism-previewer-easing line {
- stroke: hsl(230, 8%, 24%);
-}
-
-/* Fill colour of the handle */
-.prism-previewer-easing.prism-previewer-easing circle {
- fill: transparent;
-}
diff --git a/app/utils/documents.server.ts b/app/utils/documents.server.ts
index 138ee890..5e54cef6 100644
--- a/app/utils/documents.server.ts
+++ b/app/utils/documents.server.ts
@@ -4,6 +4,9 @@ import { fileURLToPath } from 'node:url'
import { bundleMDX } from 'mdx-bundler'
import * as graymatter from 'gray-matter'
import { fetchCached } from '~/utils/cache.server'
+import remarkShikiTwoslash from "remark-shiki-twoslash"
+import rehypeRaw from 'rehype-raw'
+import { nodeTypes } from '@mdx-js/mdx'
type BundledMDX = Awaited>
@@ -202,8 +205,9 @@ export async function markdownToMdx(content: string) {
const mdx = await bundleMDX<{ title: string }>({
source: content,
mdxOptions: (options) => {
- options.remarkPlugins = [...(options.remarkPlugins ?? []), remarkGfm]
- options.rehypePlugins = [...(options.rehypePlugins ?? []), rehypeSlug]
+ options.remarkPlugins = [...(options.remarkPlugins ?? []), remarkGfm, [remarkShikiTwoslash, { theme: "dark-plus" }]]
+ // @ts-ignore
+ options.rehypePlugins = [...(options.rehypePlugins ?? []), rehypeSlug, [rehypeRaw, {passThrough: nodeTypes}]]
return options
},
})
diff --git a/app/utils/svelteHighlighter.js b/app/utils/svelteHighlighter.js
deleted file mode 100644
index 0a4c5cb9..00000000
--- a/app/utils/svelteHighlighter.js
+++ /dev/null
@@ -1,150 +0,0 @@
-// Original source: https://github.com/pngwn/prism-svelte
-
-import { Prism } from 'prism-react-renderer'
-
-export const svelteHighlighter = () => {
- const blocks = '(if|else if|await|then|catch|each|html|debug)'
-
- Prism.languages.svelte = Prism.languages.extend('markup', {
- each: {
- pattern: new RegExp(
- '{[#/]each' +
- '(?:(?:\\{(?:(?:\\{(?:[^{}])*\\})|(?:[^{}]))*\\})|(?:[^{}]))*}'
- ),
- inside: {
- 'language-javascript': [
- {
- pattern: /(as[\s\S]*)\([\s\S]*\)(?=\s*\})/,
- lookbehind: true,
- inside: Prism.languages['javascript'],
- },
- {
- pattern: /(as[\s]*)[\s\S]*(?=\s*)/,
- lookbehind: true,
- inside: Prism.languages['javascript'],
- },
- {
- pattern: /(#each[\s]*)[\s\S]*(?=as)/,
- lookbehind: true,
- inside: Prism.languages['javascript'],
- },
- ],
- keyword: /[#/]each|as/,
- punctuation: /{|}/,
- },
- },
- block: {
- pattern: new RegExp(
- '{[#:/@]/s' +
- blocks +
- '(?:(?:\\{(?:(?:\\{(?:[^{}])*\\})|(?:[^{}]))*\\})|(?:[^{}]))*}'
- ),
- inside: {
- punctuation: /^{|}$/,
- keyword: [new RegExp('[#:/@]' + blocks + '( )*'), /as/, /then/],
- 'language-javascript': {
- pattern: /[\s\S]*/,
- inside: Prism.languages['javascript'],
- },
- },
- },
- tag: {
- pattern:
- /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?:"[^"]*"|'[^']*'|{[\s\S]+?}(?=[\s/>])))|(?=[\s/>])))+)?\s*\/?>/i,
- greedy: true,
- inside: {
- tag: {
- pattern: /^<\/?[^\s>\/]+/i,
- inside: {
- punctuation: /^<\/?/,
- namespace: /^[^\s>\/:]+:/,
- },
- },
- 'language-javascript': {
- pattern:
- /\{(?:(?:\{(?:(?:\{(?:[^{}])*\})|(?:[^{}]))*\})|(?:[^{}]))*\}/,
- inside: Prism.languages['javascript'],
- },
- 'attr-value': {
- pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/i,
- inside: {
- punctuation: [
- /^=/,
- {
- pattern: /^(\s*)["']|["']$/,
- lookbehind: true,
- },
- ],
- 'language-javascript': {
- pattern: /{[\s\S]+}/,
- inside: Prism.languages['javascript'],
- },
- },
- },
- punctuation: /\/?>/,
- 'attr-name': {
- pattern: /[^\s>\/]+/,
- inside: {
- namespace: /^[^\s>\/:]+:/,
- },
- },
- },
- },
- 'language-javascript': {
- pattern: /\{(?:(?:\{(?:(?:\{(?:[^{}])*\})|(?:[^{}]))*\})|(?:[^{}]))*\}/,
- lookbehind: true,
- inside: Prism.languages['javascript'],
- },
- })
-
- Prism.languages.svelte['tag'].inside['attr-value'].inside['entity'] =
- Prism.languages.svelte['entity']
-
- Prism.hooks.add('wrap', (env) => {
- if (env.type === 'entity') {
- env.attributes['title'] = env.content.replace(/&/, '&')
- }
- })
-
- Object.defineProperty(Prism.languages.svelte.tag, 'addInlined', {
- value: function addInlined(tagName, lang) {
- const includedCdataInside = {}
- includedCdataInside['language-' + lang] = {
- pattern: /(^$)/i,
- lookbehind: true,
- inside: Prism.languages[lang],
- }
- includedCdataInside['cdata'] = /^$/i
-
- const inside = {
- 'included-cdata': {
- pattern: //i,
- inside: includedCdataInside,
- },
- }
- inside['language-' + lang] = {
- pattern: /[\s\S]+/,
- inside: Prism.languages[lang],
- }
-
- const def = {}
- def[tagName] = {
- pattern: RegExp(
- /(<__[\s\S]*?>)(?:\s*|[\s\S])*?(?=<\/__>)/.source.replace(
- /__/g,
- tagName
- ),
- 'i'
- ),
- lookbehind: true,
- greedy: true,
- inside,
- }
-
- Prism.languages.insertBefore('svelte', 'cdata', def)
- },
- })
-
- Prism.languages.svelte.tag.addInlined('style', 'css')
- Prism.languages.svelte.tag.addInlined('script', 'javascript')
-}
diff --git a/package.json b/package.json
index 758149c3..9d811925 100644
--- a/package.json
+++ b/package.json
@@ -16,6 +16,7 @@
"@docsearch/css": "^3.5.2",
"@docsearch/react": "^3.5.2",
"@headlessui/react": "1.7.17",
+ "@mdx-js/mdx": "^2.3.0",
"@octokit/graphql": "^7.0.2",
"@octokit/rest": "^20.0.2",
"@remix-run/node": "^2.2.0",
@@ -32,17 +33,16 @@
"isbot": "^3.7.0",
"lru-cache": "^7.13.1",
"mdx-bundler": "^9.2.1",
- "prism-react-renderer": "^2.1.0",
- "prismjs": "^1.29.0",
"qss": "^3.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.11.0",
+ "rehype-raw": "^7.0.0",
"rehype-slug": "^5.1.0",
"remark-gfm": "^3.0.1",
+ "remark-shiki-twoslash": "^3.1.3",
"remove-markdown": "^0.5.0",
- "tailwind-merge": "^1.14.0",
- "tiny-invariant": "^1.3.1"
+ "tailwind-merge": "^1.14.0"
},
"devDependencies": {
"@remix-run/dev": "^2.2.0",
@@ -54,7 +54,6 @@
"esbuild": "^0.19.5",
"eslint": "^8.53.0",
"eslint-plugin-unicorn": "^49.0.0",
- "npm-run-all": "^4.1.5",
"postcss": "^8.4.31",
"tailwindcss": "^3.3.5",
"typescript": "^5.2.2",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 3ddd829f..169b2fe4 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -14,6 +14,9 @@ dependencies:
'@headlessui/react':
specifier: 1.7.17
version: 1.7.17(react-dom@18.2.0)(react@18.2.0)
+ '@mdx-js/mdx':
+ specifier: ^2.3.0
+ version: 2.3.0
'@octokit/graphql':
specifier: ^7.0.2
version: 7.0.2
@@ -62,12 +65,6 @@ dependencies:
mdx-bundler:
specifier: ^9.2.1
version: 9.2.1(esbuild@0.19.5)
- prism-react-renderer:
- specifier: ^2.1.0
- version: 2.1.0(react@18.2.0)
- prismjs:
- specifier: ^1.29.0
- version: 1.29.0
qss:
specifier: ^3.0.0
version: 3.0.0
@@ -80,21 +77,24 @@ dependencies:
react-icons:
specifier: ^4.11.0
version: 4.11.0(react@18.2.0)
+ rehype-raw:
+ specifier: ^7.0.0
+ version: 7.0.0
rehype-slug:
specifier: ^5.1.0
version: 5.1.0
remark-gfm:
specifier: ^3.0.1
version: 3.0.1
+ remark-shiki-twoslash:
+ specifier: ^3.1.3
+ version: 3.1.3(typescript@5.2.2)
remove-markdown:
specifier: ^0.5.0
version: 0.5.0
tailwind-merge:
specifier: ^1.14.0
version: 1.14.0
- tiny-invariant:
- specifier: ^1.3.1
- version: 1.3.1
devDependencies:
'@remix-run/dev':
@@ -124,9 +124,6 @@ devDependencies:
eslint-plugin-unicorn:
specifier: ^49.0.0
version: 49.0.0(eslint@8.53.0)
- npm-run-all:
- specifier: ^4.1.5
- version: 4.1.5
postcss:
specifier: ^8.4.31
version: 8.4.31
@@ -1977,6 +1974,12 @@ packages:
dependencies:
'@types/unist': 2.0.9
+ /@types/hast@3.0.2:
+ resolution: {integrity: sha512-B5hZHgHsXvfCoO3xgNJvBnX7N8p86TqQeGKXcokW4XXi+qY4vxxPSFYofytvVmpFxzPv7oxDQzjg5Un5m2/xiw==}
+ dependencies:
+ '@types/unist': 3.0.1
+ dev: false
+
/@types/json-schema@7.0.14:
resolution: {integrity: sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==}
dev: true
@@ -1994,6 +1997,12 @@ packages:
dependencies:
'@types/unist': 2.0.9
+ /@types/mdast@4.0.2:
+ resolution: {integrity: sha512-tYR83EignvhYO9iU3kDg8V28M0jqyh9zzp5GV+EO+AYnyUl3P5ltkTeJuTiFZQFz670FSb3EwT/6LQdX+UdKfw==}
+ dependencies:
+ '@types/unist': 3.0.1
+ dev: false
+
/@types/mdx@2.0.9:
resolution: {integrity: sha512-OKMdj17y8Cs+k1r0XFyp59ChSOwf8ODGtMQ4mnpfz5eFDk1aO41yN3pSKGuvVzmWAkFp37seubY1tzOVpwfWwg==}
@@ -2014,10 +2023,6 @@ packages:
resolution: {integrity: sha512-ehPtgRgaULsFG8x0NeYJvmyH1hmlfsNLujHe9dQEia/7MAJYdzMSi19JtchUHjmBA6XC/75dK55mzZH+RyieSg==}
dev: true
- /@types/prismjs@1.26.2:
- resolution: {integrity: sha512-/r7Cp7iUIk7gts26mHXD66geUC+2Fo26TZYjQK6Nr4LDfi6lmdRmMqM0oPwfiMhUwoBAOFe8GstKi2pf6hZvwA==}
- dev: false
-
/@types/prop-types@15.7.9:
resolution: {integrity: sha512-n1yyPsugYNSmHgxDFjicaI2+gCNjsBck8UX9kuofAKlc0h1bL+20oSF72KeNaW2DUlesbEVCFgyV2dPGTiY42g==}
@@ -2052,6 +2057,10 @@ packages:
/@types/unist@2.0.9:
resolution: {integrity: sha512-zC0iXxAv1C1ERURduJueYzkzZ2zaGyc+P2c95hgkikHPr3z8EdUZOlgEQ5X0DRmwDZn+hekycQnoeiiRVrmilQ==}
+ /@types/unist@3.0.1:
+ resolution: {integrity: sha512-ue/hDUpPjC85m+PM9OQDMZr3LywT+CT6mPsQq8OJtCLiERkGRcQUFvu9XASF5XWqyZFXbf15lvb3JFJ4dRLWPg==}
+ dev: false
+
/@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.53.0)(typescript@5.2.2):
resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@@ -2182,9 +2191,34 @@ packages:
eslint-visitor-keys: 3.4.3
dev: true
+ /@typescript/twoslash@3.1.0:
+ resolution: {integrity: sha512-kTwMUQ8xtAZaC4wb2XuLkPqFVBj2dNBueMQ89NWEuw87k2nLBbuafeG5cob/QEr6YduxIdTVUjix0MtC7mPlmg==}
+ dependencies:
+ '@typescript/vfs': 1.3.5
+ debug: 4.3.4
+ lz-string: 1.5.0
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /@typescript/vfs@1.3.4:
+ resolution: {integrity: sha512-RbyJiaAGQPIcAGWFa3jAXSuAexU4BFiDRF1g3hy7LmRqfNpYlTQWGXjcrOaVZjJ8YkkpuwG0FcsYvtWQpd9igQ==}
+ dependencies:
+ debug: 4.3.4
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /@typescript/vfs@1.3.5:
+ resolution: {integrity: sha512-pI8Saqjupf9MfLw7w2+og+fmb0fZS0J6vsKXXrp4/PDXEFvntgzXmChCXC/KefZZS0YGS6AT8e0hGAJcTsdJlg==}
+ dependencies:
+ debug: 4.3.4
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
/@ungap/structured-clone@1.2.0:
resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
- dev: true
/@vanilla-extract/babel-plugin-debug-ids@1.0.3:
resolution: {integrity: sha512-vm4jYu1xhSa6ofQ9AhIpR3DkAp4c+eoR1Rpm8/TQI4DmWbmGbOjYRcqV0aWsfaIlNhN4kFuxFMKBNN9oG6iRzA==}
@@ -2831,11 +2865,6 @@ packages:
engines: {node: '>=0.8'}
dev: true
- /clsx@1.2.1:
- resolution: {integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==}
- engines: {node: '>=6'}
- dev: false
-
/color-convert@1.9.3:
resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==}
dependencies:
@@ -2931,17 +2960,6 @@ packages:
resolution: {integrity: sha512-pSB8OOROfimFc2bcN+H41DuzXYIod/JQ6SgF4pYXkRCm9f8uF1JAJ0vXPhenug6xkpt3Gv33mdypMXB49CJWRA==}
dev: false
- /cross-spawn@6.0.5:
- resolution: {integrity: sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==}
- engines: {node: '>=4.8'}
- dependencies:
- nice-try: 1.0.5
- path-key: 2.0.1
- semver: 5.7.2
- shebang-command: 1.2.0
- which: 1.3.1
- dev: true
-
/cross-spawn@7.0.3:
resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==}
engines: {node: '>= 8'}
@@ -3105,6 +3123,12 @@ packages:
resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==}
engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16}
+ /devlop@1.1.0:
+ resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==}
+ dependencies:
+ dequal: 2.0.3
+ dev: false
+
/didyoumean@1.2.2:
resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==}
@@ -3191,6 +3215,11 @@ packages:
tapable: 2.2.1
dev: true
+ /entities@4.5.0:
+ resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
+ engines: {node: '>=0.12'}
+ dev: false
+
/err-code@2.0.3:
resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==}
dev: true
@@ -4009,6 +4038,11 @@ packages:
dependencies:
format: 0.2.2
+ /fenceparser@1.1.1:
+ resolution: {integrity: sha512-VdkTsK7GWLT0VWMK5S5WTAPn61wJ98WPFwJiRHumhg4ESNUO/tnkU8bzzzc62o6Uk1SVhuZFLnakmDA4SGV7wA==}
+ engines: {node: '>=12'}
+ dev: false
+
/fetch-blob@3.2.0:
resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==}
engines: {node: ^12.20 || >= 14.13}
@@ -4382,6 +4416,19 @@ packages:
dependencies:
function-bind: 1.1.2
+ /hast-util-from-parse5@8.0.1:
+ resolution: {integrity: sha512-Er/Iixbc7IEa7r/XLtuG52zoqn/b3Xng/w6aZQ0xGVxzhw5xUFxcRqdPzP6yFi/4HBYRaifaI5fQ1RH8n0ZeOQ==}
+ dependencies:
+ '@types/hast': 3.0.2
+ '@types/unist': 3.0.1
+ devlop: 1.1.0
+ hastscript: 8.0.0
+ property-information: 6.4.0
+ vfile: 6.0.1
+ vfile-location: 5.0.2
+ web-namespaces: 2.0.1
+ dev: false
+
/hast-util-has-property@2.0.1:
resolution: {integrity: sha512-X2+RwZIMTMKpXUzlotatPzWj8bspCymtXH3cfG3iQKV+wPF53Vgaqxi/eLqGck0wKq1kS9nvoB1wchbCPEL8sg==}
dev: false
@@ -4392,6 +4439,30 @@ packages:
'@types/hast': 2.3.7
dev: false
+ /hast-util-parse-selector@4.0.0:
+ resolution: {integrity: sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==}
+ dependencies:
+ '@types/hast': 3.0.2
+ dev: false
+
+ /hast-util-raw@9.0.1:
+ resolution: {integrity: sha512-5m1gmba658Q+lO5uqL5YNGQWeh1MYWZbZmWrM5lncdcuiXuo5E2HT/CIOp0rLF8ksfSwiCVJ3twlgVRyTGThGA==}
+ dependencies:
+ '@types/hast': 3.0.2
+ '@types/unist': 3.0.1
+ '@ungap/structured-clone': 1.2.0
+ hast-util-from-parse5: 8.0.1
+ hast-util-to-parse5: 8.0.0
+ html-void-elements: 3.0.0
+ mdast-util-to-hast: 13.0.2
+ parse5: 7.1.2
+ unist-util-position: 5.0.0
+ unist-util-visit: 5.0.0
+ vfile: 6.0.1
+ web-namespaces: 2.0.1
+ zwitch: 2.0.4
+ dev: false
+
/hast-util-to-estree@2.3.3:
resolution: {integrity: sha512-ihhPIUPxN0v0w6M5+IiAZZrn0LH2uZomeWwhn7uP7avZC6TE7lIiEh2yBMPr5+zi1aUCXq6VoYRgs2Bw9xmycQ==}
dependencies:
@@ -4413,6 +4484,18 @@ packages:
transitivePeerDependencies:
- supports-color
+ /hast-util-to-parse5@8.0.0:
+ resolution: {integrity: sha512-3KKrV5ZVI8if87DVSi1vDeByYrkGzg4mEfeu4alwgmmIeARiBLKCZS2uw5Gb6nU9x9Yufyj3iudm6i7nl52PFw==}
+ dependencies:
+ '@types/hast': 3.0.2
+ comma-separated-tokens: 2.0.3
+ devlop: 1.1.0
+ property-information: 6.4.0
+ space-separated-tokens: 2.0.2
+ web-namespaces: 2.0.1
+ zwitch: 2.0.4
+ dev: false
+
/hast-util-to-string@2.0.0:
resolution: {integrity: sha512-02AQ3vLhuH3FisaMM+i/9sm4OXGSq1UhOOCpTLLQtHdL3tZt7qil69r8M8iDkZYyC0HCFylcYoP+8IO7ddta1A==}
dependencies:
@@ -4422,6 +4505,16 @@ packages:
/hast-util-whitespace@2.0.1:
resolution: {integrity: sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng==}
+ /hastscript@8.0.0:
+ resolution: {integrity: sha512-dMOtzCEd3ABUeSIISmrETiKuyydk1w0pa+gE/uormcTpSYuaNJPbX1NU3JLyscSLjwAQM8bWMhhIlnCqnRvDTw==}
+ dependencies:
+ '@types/hast': 3.0.2
+ comma-separated-tokens: 2.0.3
+ hast-util-parse-selector: 4.0.0
+ property-information: 6.4.0
+ space-separated-tokens: 2.0.2
+ dev: false
+
/hosted-git-info@2.8.9:
resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==}
dev: true
@@ -4433,6 +4526,10 @@ packages:
lru-cache: 7.18.3
dev: true
+ /html-void-elements@3.0.0:
+ resolution: {integrity: sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==}
+ dev: false
+
/http-errors@2.0.0:
resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==}
engines: {node: '>= 0.8'}
@@ -4839,10 +4936,6 @@ packages:
resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==}
dev: true
- /json-parse-better-errors@1.0.2:
- resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==}
- dev: true
-
/json-parse-even-better-errors@2.3.1:
resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==}
dev: true
@@ -4875,7 +4968,6 @@ packages:
/jsonc-parser@3.2.0:
resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==}
- dev: true
/jsonfile@6.1.0:
resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==}
@@ -4936,16 +5028,6 @@ packages:
/lines-and-columns@1.2.4:
resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}
- /load-json-file@4.0.0:
- resolution: {integrity: sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==}
- engines: {node: '>=4'}
- dependencies:
- graceful-fs: 4.2.11
- parse-json: 4.0.0
- pify: 3.0.0
- strip-bom: 3.0.0
- dev: true
-
/loader-utils@3.2.1:
resolution: {integrity: sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw==}
engines: {node: '>= 12.13.0'}
@@ -5034,7 +5116,6 @@ packages:
/lz-string@1.5.0:
resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==}
hasBin: true
- dev: true
/markdown-extensions@1.1.1:
resolution: {integrity: sha512-WWC0ZuMzCyDHYCasEGs4IPvLyTGftYwh6wIEOULOF0HXcqZlhwRzrK0w2VUlxWA98xnvb/jszw4ZSkJ6ADpM6Q==}
@@ -5210,6 +5291,19 @@ packages:
unist-util-position: 4.0.4
unist-util-visit: 4.1.2
+ /mdast-util-to-hast@13.0.2:
+ resolution: {integrity: sha512-U5I+500EOOw9e3ZrclN3Is3fRpw8c19SMyNZlZ2IS+7vLsNzb2Om11VpIVOR+/0137GhZsFEF6YiKD5+0Hr2Og==}
+ dependencies:
+ '@types/hast': 3.0.2
+ '@types/mdast': 4.0.2
+ '@ungap/structured-clone': 1.2.0
+ devlop: 1.1.0
+ micromark-util-sanitize-uri: 2.0.0
+ trim-lines: 3.0.1
+ unist-util-position: 5.0.0
+ unist-util-visit: 5.0.0
+ dev: false
+
/mdast-util-to-markdown@1.5.0:
resolution: {integrity: sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A==}
dependencies:
@@ -5257,11 +5351,6 @@ packages:
resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==}
engines: {node: '>= 0.6'}
- /memorystream@0.3.1:
- resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==}
- engines: {node: '>= 0.10.0'}
- dev: true
-
/merge-descriptors@1.0.1:
resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==}
@@ -5488,6 +5577,13 @@ packages:
micromark-util-symbol: 1.1.0
micromark-util-types: 1.1.0
+ /micromark-util-character@2.0.1:
+ resolution: {integrity: sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==}
+ dependencies:
+ micromark-util-symbol: 2.0.0
+ micromark-util-types: 2.0.0
+ dev: false
+
/micromark-util-chunked@1.1.0:
resolution: {integrity: sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ==}
dependencies:
@@ -5522,6 +5618,10 @@ packages:
/micromark-util-encode@1.1.0:
resolution: {integrity: sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw==}
+ /micromark-util-encode@2.0.0:
+ resolution: {integrity: sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==}
+ dev: false
+
/micromark-util-events-to-acorn@1.2.3:
resolution: {integrity: sha512-ij4X7Wuc4fED6UoLWkmo0xJQhsktfNh1J0m8g4PbIMPlx+ek/4YdW5mvbye8z/aZvAPUoxgXHrwVlXAPKMRp1w==}
dependencies:
@@ -5554,6 +5654,14 @@ packages:
micromark-util-encode: 1.1.0
micromark-util-symbol: 1.1.0
+ /micromark-util-sanitize-uri@2.0.0:
+ resolution: {integrity: sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==}
+ dependencies:
+ micromark-util-character: 2.0.1
+ micromark-util-encode: 2.0.0
+ micromark-util-symbol: 2.0.0
+ dev: false
+
/micromark-util-subtokenize@1.1.0:
resolution: {integrity: sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A==}
dependencies:
@@ -5565,9 +5673,17 @@ packages:
/micromark-util-symbol@1.1.0:
resolution: {integrity: sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==}
+ /micromark-util-symbol@2.0.0:
+ resolution: {integrity: sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==}
+ dev: false
+
/micromark-util-types@1.1.0:
resolution: {integrity: sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==}
+ /micromark-util-types@2.0.0:
+ resolution: {integrity: sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==}
+ dev: false
+
/micromark@3.2.0:
resolution: {integrity: sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==}
dependencies:
@@ -5757,10 +5873,6 @@ packages:
resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==}
engines: {node: '>= 0.6'}
- /nice-try@1.0.5:
- resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==}
- dev: true
-
/node-domexception@1.0.0:
resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==}
engines: {node: '>=10.5.0'}
@@ -5850,22 +5962,6 @@ packages:
semver: 7.5.4
dev: true
- /npm-run-all@4.1.5:
- resolution: {integrity: sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==}
- engines: {node: '>= 4'}
- hasBin: true
- dependencies:
- ansi-styles: 3.2.1
- chalk: 2.4.2
- cross-spawn: 6.0.5
- memorystream: 0.3.1
- minimatch: 3.1.2
- pidtree: 0.3.1
- read-pkg: 3.0.0
- shell-quote: 1.8.1
- string.prototype.padend: 3.1.5
- dev: true
-
/npm-run-path@4.0.1:
resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==}
engines: {node: '>=8'}
@@ -6072,14 +6168,6 @@ packages:
is-decimal: 2.0.1
is-hexadecimal: 2.0.1
- /parse-json@4.0.0:
- resolution: {integrity: sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==}
- engines: {node: '>=4'}
- dependencies:
- error-ex: 1.3.2
- json-parse-better-errors: 1.0.2
- dev: true
-
/parse-json@5.2.0:
resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==}
engines: {node: '>=8'}
@@ -6099,6 +6187,12 @@ packages:
resolution: {integrity: sha512-ck5zaMF0ydjGfejNMnlo5YU2oJ+pT+80Jb1y4ybanT27j+zbVP/jkYmCrUGsEln0Ox/hZmuvgy8Ra7AxbXP2Mw==}
dev: true
+ /parse5@7.1.2:
+ resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==}
+ dependencies:
+ entities: 4.5.0
+ dev: false
+
/parseurl@1.3.3:
resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==}
engines: {node: '>= 0.8'}
@@ -6112,11 +6206,6 @@ packages:
resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
engines: {node: '>=0.10.0'}
- /path-key@2.0.1:
- resolution: {integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==}
- engines: {node: '>=4'}
- dev: true
-
/path-key@3.1.1:
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
engines: {node: '>=8'}
@@ -6136,13 +6225,6 @@ packages:
/path-to-regexp@0.1.7:
resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==}
- /path-type@3.0.0:
- resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==}
- engines: {node: '>=4'}
- dependencies:
- pify: 3.0.0
- dev: true
-
/path-type@4.0.0:
resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
engines: {node: '>=8'}
@@ -6174,12 +6256,6 @@ packages:
resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
engines: {node: '>=8.6'}
- /pidtree@0.3.1:
- resolution: {integrity: sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==}
- engines: {node: '>=0.10'}
- hasBin: true
- dev: true
-
/pidtree@0.6.0:
resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==}
engines: {node: '>=0.10'}
@@ -6190,11 +6266,6 @@ packages:
resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==}
engines: {node: '>=0.10.0'}
- /pify@3.0.0:
- resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==}
- engines: {node: '>=4'}
- dev: true
-
/pirates@4.0.6:
resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==}
engines: {node: '>= 6'}
@@ -6376,21 +6447,6 @@ packages:
parse-ms: 2.1.0
dev: true
- /prism-react-renderer@2.1.0(react@18.2.0):
- resolution: {integrity: sha512-I5cvXHjA1PVGbGm1MsWCpvBCRrYyxEri0MC7/JbfIfYfcXAxHyO5PaUjs3A8H5GW6kJcLhTHxxMaOZZpRZD2iQ==}
- peerDependencies:
- react: '>=16.0.0'
- dependencies:
- '@types/prismjs': 1.26.2
- clsx: 1.2.1
- react: 18.2.0
- dev: false
-
- /prismjs@1.29.0:
- resolution: {integrity: sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==}
- engines: {node: '>=6'}
- dev: false
-
/proc-log@3.0.0:
resolution: {integrity: sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==}
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
@@ -6565,15 +6621,6 @@ packages:
type-fest: 0.8.1
dev: true
- /read-pkg@3.0.0:
- resolution: {integrity: sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==}
- engines: {node: '>=4'}
- dependencies:
- load-json-file: 4.0.0
- normalize-package-data: 2.5.0
- path-type: 3.0.0
- dev: true
-
/read-pkg@5.2.0:
resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==}
engines: {node: '>=8'}
@@ -6623,6 +6670,10 @@ packages:
which-builtin-type: 1.1.3
dev: true
+ /regenerator-runtime@0.13.11:
+ resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==}
+ dev: false
+
/regenerator-runtime@0.14.0:
resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==}
@@ -6652,6 +6703,14 @@ packages:
jsesc: 0.5.0
dev: true
+ /rehype-raw@7.0.0:
+ resolution: {integrity: sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==}
+ dependencies:
+ '@types/hast': 3.0.2
+ hast-util-raw: 9.0.1
+ vfile: 6.0.1
+ dev: false
+
/rehype-slug@5.1.0:
resolution: {integrity: sha512-Gf91dJoXneiorNEnn+Phx97CO7oRMrpi+6r155tTxzGuLtm+QrI4cTwCa9e1rtePdL4i9tSO58PeSS6HWfgsiw==}
dependencies:
@@ -6717,6 +6776,25 @@ packages:
mdast-util-to-hast: 12.3.0
unified: 10.1.2
+ /remark-shiki-twoslash@3.1.3(typescript@5.2.2):
+ resolution: {integrity: sha512-4e8OH3ySOCw5wUbDcPszokOKjKuebOqlP2WlySvC7ITBOq27BiGsFlq+FNWhxppZ+JzhTWah4gQrnMjX3KDbAQ==}
+ peerDependencies:
+ typescript: '>3'
+ dependencies:
+ '@types/unist': 2.0.9
+ '@typescript/twoslash': 3.1.0
+ '@typescript/vfs': 1.3.4
+ fenceparser: 1.1.1
+ regenerator-runtime: 0.13.11
+ shiki: 0.10.1
+ shiki-twoslash: 3.1.2(typescript@5.2.2)
+ tslib: 2.1.0
+ typescript: 5.2.2
+ unist-util-visit: 2.0.3
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
/remove-markdown@0.5.0:
resolution: {integrity: sha512-x917M80K97K5IN1L8lUvFehsfhR8cYjGQ/yAMRI9E7JIKivtl5Emo5iD13DhMr+VojzMCiYk8V2byNPwT/oapg==}
dev: false
@@ -6922,13 +7000,6 @@ packages:
/setprototypeof@1.2.0:
resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==}
- /shebang-command@1.2.0:
- resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==}
- engines: {node: '>=0.10.0'}
- dependencies:
- shebang-regex: 1.0.0
- dev: true
-
/shebang-command@2.0.0:
resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
engines: {node: '>=8'}
@@ -6936,19 +7007,32 @@ packages:
shebang-regex: 3.0.0
dev: true
- /shebang-regex@1.0.0:
- resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==}
- engines: {node: '>=0.10.0'}
- dev: true
-
/shebang-regex@3.0.0:
resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
engines: {node: '>=8'}
dev: true
- /shell-quote@1.8.1:
- resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==}
- dev: true
+ /shiki-twoslash@3.1.2(typescript@5.2.2):
+ resolution: {integrity: sha512-JBcRIIizi+exIA/OUhYkV6jtyeZco0ykCkIRd5sgwIt1Pm4pz+maoaRZpm6SkhPwvif4fCA7xOtJOykhpIV64Q==}
+ peerDependencies:
+ typescript: '>3'
+ dependencies:
+ '@typescript/twoslash': 3.1.0
+ '@typescript/vfs': 1.3.4
+ fenceparser: 1.1.1
+ shiki: 0.10.1
+ typescript: 5.2.2
+ transitivePeerDependencies:
+ - supports-color
+ dev: false
+
+ /shiki@0.10.1:
+ resolution: {integrity: sha512-VsY7QJVzU51j5o1+DguUd+6vmCmZ5v/6gYu4vyYAhzjuNQU6P/vmSy4uQaOhvje031qQMiW0d2BwgMH52vqMng==}
+ dependencies:
+ jsonc-parser: 3.2.0
+ vscode-oniguruma: 1.7.0
+ vscode-textmate: 5.2.0
+ dev: false
/side-channel@1.0.4:
resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==}
@@ -7079,15 +7163,6 @@ packages:
side-channel: 1.0.4
dev: true
- /string.prototype.padend@3.1.5:
- resolution: {integrity: sha512-DOB27b/2UTTD+4myKUFh+/fXWcu/UDyASIXfg+7VzoCNNGOfWvoyU/x5pvVHr++ztyt/oSYI1BcWBBG/hmlNjA==}
- engines: {node: '>= 0.4'}
- dependencies:
- call-bind: 1.0.5
- define-properties: 1.2.1
- es-abstract: 1.22.3
- dev: true
-
/string.prototype.trim@1.2.8:
resolution: {integrity: sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==}
engines: {node: '>= 0.4'}
@@ -7301,10 +7376,6 @@ packages:
xtend: 4.0.2
dev: true
- /tiny-invariant@1.3.1:
- resolution: {integrity: sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==}
- dev: false
-
/to-fast-properties@2.0.0:
resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==}
engines: {node: '>=4'}
@@ -7370,6 +7441,10 @@ packages:
resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
dev: true
+ /tslib@2.1.0:
+ resolution: {integrity: sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==}
+ dev: false
+
/tsutils@3.21.0(typescript@5.2.2):
resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}
engines: {node: '>= 6'}
@@ -7504,11 +7579,21 @@ packages:
/unist-util-generated@2.0.1:
resolution: {integrity: sha512-qF72kLmPxAw0oN2fwpWIqbXAVyEqUzDHMsbtPvOudIlUzXYFIeQIuxXQCRCFh22B7cixvU0MG7m3MW8FTq/S+A==}
+ /unist-util-is@4.1.0:
+ resolution: {integrity: sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==}
+ dev: false
+
/unist-util-is@5.2.1:
resolution: {integrity: sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==}
dependencies:
'@types/unist': 2.0.9
+ /unist-util-is@6.0.0:
+ resolution: {integrity: sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==}
+ dependencies:
+ '@types/unist': 3.0.1
+ dev: false
+
/unist-util-position-from-estree@1.1.2:
resolution: {integrity: sha512-poZa0eXpS+/XpoQwGwl79UUdea4ol2ZuCYguVaJS4qzIOMDzbqz8a3erUCOmubSZkaOuGamb3tX790iwOIROww==}
dependencies:
@@ -7519,6 +7604,12 @@ packages:
dependencies:
'@types/unist': 2.0.9
+ /unist-util-position@5.0.0:
+ resolution: {integrity: sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==}
+ dependencies:
+ '@types/unist': 3.0.1
+ dev: false
+
/unist-util-remove-position@4.0.2:
resolution: {integrity: sha512-TkBb0HABNmxzAcfLf4qsIbFbaPDvMO6wa3b3j4VcEzFVaw1LBKwnW4/sRJ/atSLSzoIg41JWEdnE7N6DIhGDGQ==}
dependencies:
@@ -7530,12 +7621,40 @@ packages:
dependencies:
'@types/unist': 2.0.9
+ /unist-util-stringify-position@4.0.0:
+ resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==}
+ dependencies:
+ '@types/unist': 3.0.1
+ dev: false
+
+ /unist-util-visit-parents@3.1.1:
+ resolution: {integrity: sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==}
+ dependencies:
+ '@types/unist': 2.0.9
+ unist-util-is: 4.1.0
+ dev: false
+
/unist-util-visit-parents@5.1.3:
resolution: {integrity: sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==}
dependencies:
'@types/unist': 2.0.9
unist-util-is: 5.2.1
+ /unist-util-visit-parents@6.0.1:
+ resolution: {integrity: sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==}
+ dependencies:
+ '@types/unist': 3.0.1
+ unist-util-is: 6.0.0
+ dev: false
+
+ /unist-util-visit@2.0.3:
+ resolution: {integrity: sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==}
+ dependencies:
+ '@types/unist': 2.0.9
+ unist-util-is: 4.1.0
+ unist-util-visit-parents: 3.1.1
+ dev: false
+
/unist-util-visit@4.1.2:
resolution: {integrity: sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==}
dependencies:
@@ -7543,6 +7662,14 @@ packages:
unist-util-is: 5.2.1
unist-util-visit-parents: 5.1.3
+ /unist-util-visit@5.0.0:
+ resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==}
+ dependencies:
+ '@types/unist': 3.0.1
+ unist-util-is: 6.0.0
+ unist-util-visit-parents: 6.0.1
+ dev: false
+
/universal-user-agent@6.0.0:
resolution: {integrity: sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==}
dev: false
@@ -7622,12 +7749,26 @@ packages:
resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==}
engines: {node: '>= 0.8'}
+ /vfile-location@5.0.2:
+ resolution: {integrity: sha512-NXPYyxyBSH7zB5U6+3uDdd6Nybz6o6/od9rk8bp9H8GR3L+cm/fC0uUTbqBmUTnMCUDslAGBOIKNfvvb+gGlDg==}
+ dependencies:
+ '@types/unist': 3.0.1
+ vfile: 6.0.1
+ dev: false
+
/vfile-message@3.1.4:
resolution: {integrity: sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==}
dependencies:
'@types/unist': 2.0.9
unist-util-stringify-position: 3.0.3
+ /vfile-message@4.0.2:
+ resolution: {integrity: sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==}
+ dependencies:
+ '@types/unist': 3.0.1
+ unist-util-stringify-position: 4.0.0
+ dev: false
+
/vfile@5.3.7:
resolution: {integrity: sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==}
dependencies:
@@ -7636,6 +7777,14 @@ packages:
unist-util-stringify-position: 3.0.3
vfile-message: 3.1.4
+ /vfile@6.0.1:
+ resolution: {integrity: sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==}
+ dependencies:
+ '@types/unist': 3.0.1
+ unist-util-stringify-position: 4.0.0
+ vfile-message: 4.0.2
+ dev: false
+
/vite-node@0.28.5:
resolution: {integrity: sha512-LmXb9saMGlrMZbXTvOveJKwMTBTNUH66c8rJnQ0ZPNX+myPEol64+szRzXtV5ORb0Hb/91yq+/D3oERoyAt6LA==}
engines: {node: '>=v14.16.0'}
@@ -7712,6 +7861,14 @@ packages:
fsevents: 2.3.3
dev: true
+ /vscode-oniguruma@1.7.0:
+ resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==}
+ dev: false
+
+ /vscode-textmate@5.2.0:
+ resolution: {integrity: sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==}
+ dev: false
+
/wcwidth@1.0.1:
resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==}
dependencies:
@@ -7725,6 +7882,10 @@ packages:
optionalDependencies:
'@zxing/text-encoding': 0.9.0
+ /web-namespaces@2.0.1:
+ resolution: {integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==}
+ dev: false
+
/web-streams-polyfill@3.2.1:
resolution: {integrity: sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==}
engines: {node: '>= 8'}
@@ -7785,13 +7946,6 @@ packages:
gopd: 1.0.1
has-tostringtag: 1.0.0
- /which@1.3.1:
- resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==}
- hasBin: true
- dependencies:
- isexe: 2.0.0
- dev: true
-
/which@2.0.2:
resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
engines: {node: '>= 8'}
From f9b584c77c18ff7ac016d4264c8202edfcb79224 Mon Sep 17 00:00:00 2001
From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
Date: Sun, 5 Nov 2023 12:12:45 +1100
Subject: [PATCH 05/39] Add language indicator to code blocks
---
app/components/CodeBlock.tsx | 33 +++++++++++++++++++++++++++++++++
app/components/Mdx.tsx | 2 ++
app/utils/documents.server.ts | 2 +-
package.json | 3 ++-
pnpm-lock.yaml | 7 +++++++
5 files changed, 45 insertions(+), 2 deletions(-)
create mode 100644 app/components/CodeBlock.tsx
diff --git a/app/components/CodeBlock.tsx b/app/components/CodeBlock.tsx
new file mode 100644
index 00000000..ba3c3d7c
--- /dev/null
+++ b/app/components/CodeBlock.tsx
@@ -0,0 +1,33 @@
+import type { FC, HTMLAttributes, ReactElement } from 'react'
+import invariant from 'tiny-invariant'
+
+function getLanguageFromChildren(children: any): string {
+ const language = children[0].props.children
+ return language ? language : ''
+}
+
+export const CodeBlock: FC> = (props) => {
+ const {children, ...rest} = props
+ invariant(!!children, 'children is required')
+ const userLang = getLanguageFromChildren(children)
+ return (
+
+ )
+}
diff --git a/app/components/Mdx.tsx b/app/components/Mdx.tsx
index 9da62504..6454ae0a 100644
--- a/app/components/Mdx.tsx
+++ b/app/components/Mdx.tsx
@@ -1,5 +1,6 @@
import * as React from 'react'
import { getMDXComponent } from 'mdx-bundler/client'
+import { CodeBlock } from '~/components/CodeBlock'
import { MarkdownLink } from '~/components/MarkdownLink'
import type { MDXComponents } from 'mdx/types'
@@ -39,6 +40,7 @@ const markdownComponents = {
h4: makeHeading('h4'),
h5: makeHeading('h5'),
h6: makeHeading('h6'),
+ pre: CodeBlock,
}
export function Mdx({
diff --git a/app/utils/documents.server.ts b/app/utils/documents.server.ts
index 5e54cef6..ba00e09e 100644
--- a/app/utils/documents.server.ts
+++ b/app/utils/documents.server.ts
@@ -205,7 +205,7 @@ export async function markdownToMdx(content: string) {
const mdx = await bundleMDX<{ title: string }>({
source: content,
mdxOptions: (options) => {
- options.remarkPlugins = [...(options.remarkPlugins ?? []), remarkGfm, [remarkShikiTwoslash, { theme: "dark-plus" }]]
+ options.remarkPlugins = [...(options.remarkPlugins ?? []), remarkGfm, [remarkShikiTwoslash, { theme: "github-dark" }]]
// @ts-ignore
options.rehypePlugins = [...(options.rehypePlugins ?? []), rehypeSlug, [rehypeRaw, {passThrough: nodeTypes}]]
return options
diff --git a/package.json b/package.json
index 9d811925..8b9c05cd 100644
--- a/package.json
+++ b/package.json
@@ -42,7 +42,8 @@
"remark-gfm": "^3.0.1",
"remark-shiki-twoslash": "^3.1.3",
"remove-markdown": "^0.5.0",
- "tailwind-merge": "^1.14.0"
+ "tailwind-merge": "^1.14.0",
+ "tiny-invariant": "^1.3.1"
},
"devDependencies": {
"@remix-run/dev": "^2.2.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 169b2fe4..2c473256 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -95,6 +95,9 @@ dependencies:
tailwind-merge:
specifier: ^1.14.0
version: 1.14.0
+ tiny-invariant:
+ specifier: ^1.3.1
+ version: 1.3.1
devDependencies:
'@remix-run/dev':
@@ -7376,6 +7379,10 @@ packages:
xtend: 4.0.2
dev: true
+ /tiny-invariant@1.3.1:
+ resolution: {integrity: sha512-AD5ih2NlSssTCwsMznbvwMZpJ1cbhkGd2uueNxzv2jDlEeZdU04JQfRnggJQ8DrcVBGjAsCKwFBbDlVNtEMlzw==}
+ dev: false
+
/to-fast-properties@2.0.0:
resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==}
engines: {node: '>=4'}
From d01225914838d4709e118d8b63c8029c70ea731a Mon Sep 17 00:00:00 2001
From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
Date: Sun, 5 Nov 2023 12:35:42 +1100
Subject: [PATCH 06/39] More CodeBlock style fixes
---
app/components/CodeBlock.tsx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/components/CodeBlock.tsx b/app/components/CodeBlock.tsx
index ba3c3d7c..0a777762 100644
--- a/app/components/CodeBlock.tsx
+++ b/app/components/CodeBlock.tsx
@@ -1,13 +1,13 @@
-import type { FC, HTMLAttributes, ReactElement } from 'react'
+import type { FC, HTMLAttributes } from 'react'
import invariant from 'tiny-invariant'
function getLanguageFromChildren(children: any): string {
- const language = children[0].props.children
+ const language = children[0]?.props?.children
return language ? language : ''
}
export const CodeBlock: FC> = (props) => {
- const {children, ...rest} = props
+ const {children, className, style} = props
invariant(!!children, 'children is required')
const userLang = getLanguageFromChildren(children)
return (
@@ -23,7 +23,7 @@ export const CodeBlock: FC> = (props) => {
className="rounded-md font-normal w-full border border-gray-200
dark:border-0"
>
-
+
{children}
From 93f309cb50891fe82ec4c2349fa81fb264181bf7 Mon Sep 17 00:00:00 2001
From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
Date: Sun, 5 Nov 2023 14:57:49 +1100
Subject: [PATCH 07/39] Light/dark themes for shiki
---
.prettierignore | 1 +
app/components/CodeBlock.tsx | 30 +--
app/styles/app.css | 439 ++++++++++++++++++----------------
app/utils/documents.server.ts | 15 +-
package.json | 2 +-
5 files changed, 255 insertions(+), 232 deletions(-)
diff --git a/.prettierignore b/.prettierignore
index a28d29e3..135325e9 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,2 +1,3 @@
**/api
+**/build
**/public
diff --git a/app/components/CodeBlock.tsx b/app/components/CodeBlock.tsx
index 0a777762..ddc68798 100644
--- a/app/components/CodeBlock.tsx
+++ b/app/components/CodeBlock.tsx
@@ -7,27 +7,27 @@ function getLanguageFromChildren(children: any): string {
}
export const CodeBlock: FC