From 2d08dd8a9c289bcdb6395e8bdf28b6b729946ab1 Mon Sep 17 00:00:00 2001 From: Justice Almanzar Date: Wed, 7 Dec 2022 09:33:40 -0500 Subject: Shiki settings preview (#297) --- src/plugins/shikiCodeblocks/index.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/plugins/shikiCodeblocks/index.ts') 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 + }, }, }, -- cgit