From 0282159de68b42900fb825812aaa7c132517488e Mon Sep 17 00:00:00 2001 From: Guus Waals <_@guusw.nl> Date: Fri, 24 Oct 2025 19:50:16 +0800 Subject: [PATCH] Remove md guide --- posts/markdown-guide.md | 62 ------------------------------------- project_templates/.nvim.lua | 35 ++++++++++++++------- src/post_manager.rs | 2 ++ 3 files changed, 26 insertions(+), 73 deletions(-) delete mode 100644 posts/markdown-guide.md diff --git a/posts/markdown-guide.md b/posts/markdown-guide.md deleted file mode 100644 index c2bb5ed..0000000 --- a/posts/markdown-guide.md +++ /dev/null @@ -1,62 +0,0 @@ -# Markdown Guide - -This blog uses CommonMark for rendering markdown content. Here's a quick guide to the syntax. - -## Headers - -Use `#` for headers: - -```markdown -# H1 -## H2 -### H3 -``` - -## Emphasis - -- *Italic* with `*asterisks*` -- **Bold** with `**double asterisks**` -- ~~Strikethrough~~ with `~~tildes~~` - -## Links and Images - -Links: `[Link text](https://example.com)` - -Images: `![Alt text](image.jpg)` - -## Blockquotes - -> This is a blockquote. -> It can span multiple lines. - -## Code - -Inline `code` with backticks. - -Code blocks with triple backticks: - -```python -def hello(): - print("Hello, world!") -``` - -## Tables - -| Column 1 | Column 2 | Column 3 | -|----------|----------|----------| -| Data 1 | Data 2 | Data 3 | -| More | Data | Here | - -## Task Lists - -- [x] Completed task -- [ ] Incomplete task -- [ ] Another task - -## Horizontal Rule - -Use three or more hyphens: - ---- - -That's the basics of Markdown! diff --git a/project_templates/.nvim.lua b/project_templates/.nvim.lua index a942c38..bd63e54 100644 --- a/project_templates/.nvim.lua +++ b/project_templates/.nvim.lua @@ -1,8 +1,11 @@ +-- Prevent cargo compiler from being loaded +vim.g.current_compiler = 'custom' + -- Load persistent configuration from .workspace.lua local ws_file = "./.nvim.workspace.lua" local loaded, workspace = pcall(dofile, ws_file) if not loaded then - workspace = { args = { }, build_type = "debug", binary = "blog-server" } + workspace = { args = {}, build_type = "debug", binary = "blog-server" } end local build_folder @@ -16,27 +19,37 @@ local function updateBuildEnv() -- The run (F6) arguments vim.opt.makeprg = "cargo build" + vim.g.cargo_makeprg_params = 'build' if workspace.build_type == "release" then vim.opt.makeprg = vim.opt.makeprg .. " --release" + vim.g.cargo_makeprg_params = vim.g.cargo_makeprg_params .. " --release" end -- Rust compiler error format vim.opt.errorformat = { -- Main error/warning line with file:line:col format - '%E%>error%m,' .. -- Start of error block - '%W%>warning: %m,' .. -- Start of warning block - '%-G%>help: %m,' .. -- Ignore help lines - '%-G%>note: %m,' .. -- Ignore note lines - '%C%> --> %f:%l:%c,' .. -- Continuation: file location - '%Z%>%p^%m,' .. -- End: column pointer (^^^) - '%C%>%s%#|%.%#,' .. -- Continuation: context lines with | - '%C%>%s%#%m,' .. -- Continuation: other context - '%-G%.%#' -- Ignore everything else + '%E%>error%m,' .. -- Start of error block + '%W%>warning: %m,' .. -- Start of warning block + '%-G%>help: %m,' .. -- Ignore help lines + '%-G%>note: %m,' .. -- Ignore note lines + '%C%> --> %f:%l:%c,' .. -- Continuation: file location + '%Z%>%p^%m,' .. -- End: column pointer (^^^) + '%C%>%s%#|%.%#,' .. -- Continuation: context lines with | + '%C%>%s%#%m,' .. -- Continuation: other context + '%-G%.%#' -- Ignore everything else } end updateBuildEnv() +-- Prevent Vim's built-in rust ftplugin from loading the cargo compiler +vim.api.nvim_create_autocmd("FileType", { + pattern = "rust", + callback = function() + vim.b.current_compiler = 'custom' + end, +}) + local function writeWorkspace() -- A very minimal serializer for workspace configuration local s = { l = "", ls = {}, i = "" } @@ -107,7 +120,7 @@ vim.api.nvim_create_user_command("Args", function(a) updateArgs(a.fargs) end, { nargs = '*', desc = "Update run/debug arguments" }) if dap_ok then - local lldb_init = { } + local lldb_init = {} dap_configs = { { name = 'test all', diff --git a/src/post_manager.rs b/src/post_manager.rs index 9fa156a..f47759a 100644 --- a/src/post_manager.rs +++ b/src/post_manager.rs @@ -8,7 +8,9 @@ use std::path::PathBuf; #[derive(Debug, Clone)] pub struct Post { pub name: String, + #[allow(dead_code)] pub filename: String, + #[allow(dead_code)] pub markdown_content: String, pub html_content: String, pub created_at: DateTime,