From 04b67737342917af26eee6fcc933aa16e5795f70 Mon Sep 17 00:00:00 2001 From: 132ikl <132@ikl.sh> Date: Sat, 28 Dec 2024 14:55:54 -0500 Subject: [PATCH 1/2] Apply vitesse-dark theme only for ansi code blocks --- .vuepress/config.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.vuepress/config.js b/.vuepress/config.js index 0f851b89909..5927bc59264 100755 --- a/.vuepress/config.js +++ b/.vuepress/config.js @@ -192,8 +192,26 @@ export default defineUserConfig({ }, }), shikiPlugin({ - theme: 'dark-plus', + themes: { + dark: 'dark-plus', + vitessedark: 'vitesse-dark', // pre-load vitesse-dark for ansi code blocks + }, lineNumbers: 10, + transformers: [ + { + preprocess(code, options) { + if (options.lang == 'ansi') { + this.options.defaultColor = 'vitessedark'; + // this doesn't work at the top-level for some reason + this.options.colorReplacements = { + // make vitesse-dark background color the same as dark-plus + '#121212': '#1e1e1e', + }; + } + return code; + }, + }, + ], langs: [ 'csv', 'nushell', From c305cadc54bc2b8dad34cc2783dac3498264f0ba Mon Sep 17 00:00:00 2001 From: 132ikl <132@ikl.sh> Date: Sat, 28 Dec 2024 16:31:15 -0500 Subject: [PATCH 2/2] Switch to one-dark-pro --- .vuepress/config.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.vuepress/config.js b/.vuepress/config.js index 5927bc59264..dea01347048 100755 --- a/.vuepress/config.js +++ b/.vuepress/config.js @@ -194,18 +194,21 @@ export default defineUserConfig({ shikiPlugin({ themes: { dark: 'dark-plus', - vitessedark: 'vitesse-dark', // pre-load vitesse-dark for ansi code blocks + onedarkpro: 'one-dark-pro', // pre-load one-dark-pro for ansi code blocks }, lineNumbers: 10, transformers: [ + // use one-dark-pro theme for ansi code blocks { preprocess(code, options) { if (options.lang == 'ansi') { - this.options.defaultColor = 'vitessedark'; + this.options.defaultColor = 'onedarkpro'; // this doesn't work at the top-level for some reason this.options.colorReplacements = { - // make vitesse-dark background color the same as dark-plus - '#121212': '#1e1e1e', + // make one-dark-pro background color the same as dark-plus + '#282c34': '#1e1e1e', + // HACK: change color of comments, since nu-highlight can't highlight them + '#abb2bf': '#80858f', }; } return code;