Skip to content

Commit

Permalink
Docs corrections (#18)
Browse files Browse the repository at this point in the history
* Fix svelte and shell code highlighting

* Correct and update docs
  • Loading branch information
van100j committed Nov 5, 2023
1 parent 1914ee2 commit 75d57c6
Show file tree
Hide file tree
Showing 8 changed files with 405 additions and 24 deletions.
14 changes: 4 additions & 10 deletions apps/web/components/docs/Fence.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
import { Fragment, useEffect } from "react";
import { Highlight, Prism, themes } from "prism-react-renderer";

(typeof global !== "undefined" ? global : window).Prism = Prism;
import { Fragment } from "react";
import { Highlight, themes } from "prism-react-renderer";
import { Prism } from "./Prism";

export function Fence({ children, language }: any) {
useEffect(() => {
(async () => {
// @ts-ignore
await import("prism-svelte");
})();
}, []);
return (
<Highlight
code={children.trimEnd()}
language={language}
theme={themes.dracula}
prism={Prism}
>
{({ className, style, tokens, getTokenProps }) => (
<pre className={className} style={style}>
Expand Down

0 comments on commit 75d57c6

Please sign in to comment.