diff --git a/README.md b/README.md index a7e7172..ebb3d37 100644 --- a/README.md +++ b/README.md @@ -59,8 +59,10 @@ There is a default config: { mac_window_bar = true,-- (Optional) MacOS style title bar switch opacity = true, -- (Optional) The code snap has some opacity by default, set it to false for 100% opacity - watermark = "CodeSnap.nvim" -- (Optional) you can custom your own watermark, but if you don't like it, just set it to "" - preview_title = "CodeSnap.nvim" -- (Optional) preview page title + watermark = "CodeSnap.nvim", -- (Optional) you can custom your own watermark, but if you don't like it, just set it to "" + preview_title = "CodeSnap.nvim", -- (Optional) preview page title + editor_font_family = "CaskaydiaCove Nerd Font", -- (Optional) preview code font family + watermark_font_family = "Pacifico", -- (Optional) watermark font family } ``` diff --git a/lua/codesnap/static.lua b/lua/codesnap/static.lua index 4901a45..72b53de 100644 --- a/lua/codesnap/static.lua +++ b/lua/codesnap/static.lua @@ -6,6 +6,8 @@ return { opacity = true, watermark = "CodeSnap.nvim", preview_title = "CodeSnap.nvim", + editor_font_family = "CaskaydiaCove Nerd Font", + watermark_font_family = "Pacifico", auto_load = true, }, cwd = path_utils.back(path_utils.back(debug.getinfo(1, "S").source:sub(2):match("(.*[/\\])"))), diff --git a/snap-client/src/app.tsx b/snap-client/src/app.tsx index 828ec64..2c49f3d 100644 --- a/snap-client/src/app.tsx +++ b/snap-client/src/app.tsx @@ -84,9 +84,11 @@ function App() {
>(
- ({ children, watermark }, ref) => (
+ ({ children, watermark, watermarkFontFamily }, ref) => (
{children}
{watermark && (
-
+
{watermark}
)}
diff --git a/snap-client/src/hooks/use-config.ts b/snap-client/src/hooks/use-config.ts
index accb8c8..d544522 100644
--- a/snap-client/src/hooks/use-config.ts
+++ b/snap-client/src/hooks/use-config.ts
@@ -6,6 +6,8 @@ export interface Config {
watermark: string;
auto_load: boolean;
preview_title: string;
+ watermark_font_family: string;
+ editor_font_family: string;
}
const CONFIG_STORAGE_KEY = "CONFIG_STORAGE_KEY";
diff --git a/snap-client/src/input.css b/snap-client/src/input.css
index a704ceb..79cfbf5 100644
--- a/snap-client/src/input.css
+++ b/snap-client/src/input.css
@@ -22,10 +22,6 @@ html, body, #root {
box-shadow: 0 20px 68px rgba(0, 0, 0, 0.55);
}
- .code * {
- font-family: 'CaskaydiaCove Nerd Font';
- }
-
.pacifico-regular {
font-family: "Pacifico", cursive;
font-weight: 400;
diff --git a/snap-server/src/event_handler/config.rs b/snap-server/src/event_handler/config.rs
index 6e5c0fe..cbfbbf2 100644
--- a/snap-server/src/event_handler/config.rs
+++ b/snap-server/src/event_handler/config.rs
@@ -7,6 +7,8 @@ pub struct Config {
watermark: Option,
auto_load: bool,
preview_title: String,
+ watermark_font_family: String,
+ editor_font_family: String,
}
impl From<&str> for Config {