diff options
author | Justice Almanzar <superdash993@gmail.com> | 2022-12-07 09:33:40 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-07 15:33:40 +0100 |
commit | 2d08dd8a9c289bcdb6395e8bdf28b6b729946ab1 (patch) | |
tree | b15d5c06c3dd881bca64d7eee72a9da0c83e503f /src/plugins/shikiCodeblocks/index.ts | |
parent | 49b45d82624c3c53aa2a0a4f8bd9957fed75abdd (diff) | |
download | Vencord-2d08dd8a9c289bcdb6395e8bdf28b6b729946ab1.tar.gz Vencord-2d08dd8a9c289bcdb6395e8bdf28b6b729946ab1.tar.bz2 Vencord-2d08dd8a9c289bcdb6395e8bdf28b6b729946ab1.zip |
Shiki settings preview (#297)
Diffstat (limited to 'src/plugins/shikiCodeblocks/index.ts')
-rw-r--r-- | src/plugins/shikiCodeblocks/index.ts | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/plugins/shikiCodeblocks/index.ts b/src/plugins/shikiCodeblocks/index.ts index a8be92a..fd6b04b 100644 --- a/src/plugins/shikiCodeblocks/index.ts +++ b/src/plugins/shikiCodeblocks/index.ts @@ -21,6 +21,7 @@ import { parseUrl } from "@utils/misc"; import { wordsFromPascal, wordsToTitle } from "@utils/text"; import definePlugin, { OptionType } from "@utils/types"; +import previewExampleText from "~fileContent/previewExample.tsx"; import cssText from "~fileContent/style.css"; import { Settings } from "../../Vencord"; @@ -59,6 +60,12 @@ export default definePlugin({ shiki.destroy(); clearStyles(); }, + settingsAboutComponent: ({ tempSettings }) => createHighlighter({ + lang: "tsx", + content: previewExampleText, + isPreview: true, + tempSettings, + }), options: { theme: { type: OptionType.SELECT, @@ -137,7 +144,10 @@ export default definePlugin({ description: "Background opacity", markers: [0, 20, 40, 60, 80, 100], default: 100, - stickToMarkers: false, + componentProps: { + stickToMarkers: false, + onValueRender: null, // Defaults to percentage + }, }, }, |