mirror of
https://github.com/sst/opencode.git
synced 2025-08-29 01:14:06 +00:00
docs: share handle non bundled langs
This commit is contained in:
parent
8a3e581edc
commit
1af103d29e
2 changed files with 2 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
import { codeToHtml } from "shiki"
|
import { codeToHtml, bundledLanguages } from "shiki"
|
||||||
import { createResource, Suspense } from "solid-js"
|
import { createResource, Suspense } from "solid-js"
|
||||||
import { transformerNotationDiff } from "@shikijs/transformers"
|
import { transformerNotationDiff } from "@shikijs/transformers"
|
||||||
import style from "./content-code.module.css"
|
import style from "./content-code.module.css"
|
||||||
|
@ -15,7 +15,7 @@ export function ContentCode(props: Props) {
|
||||||
// TODO: For testing delays
|
// TODO: For testing delays
|
||||||
// await new Promise((resolve) => setTimeout(resolve, 3000))
|
// await new Promise((resolve) => setTimeout(resolve, 3000))
|
||||||
return (await codeToHtml(code || "", {
|
return (await codeToHtml(code || "", {
|
||||||
lang: lang || "text",
|
lang: lang && lang in bundledLanguages ? lang : "text",
|
||||||
themes: {
|
themes: {
|
||||||
light: "github-light",
|
light: "github-light",
|
||||||
dark: "github-dark",
|
dark: "github-dark",
|
||||||
|
|
|
@ -150,7 +150,6 @@
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: 0.375rem;
|
gap: 0.375rem;
|
||||||
padding-bottom: 1rem;
|
|
||||||
|
|
||||||
[data-slot="provider"] {
|
[data-slot="provider"] {
|
||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue