diff --git a/.gitignore b/.gitignore index b8e8e97..5a0452f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,4 @@ node_modules/ .claude/settings.local.json .claude/statusline-command.sh docs/ -AGENTS.md CLAUDE.md diff --git a/CHANGELOG.md b/CHANGELOG.md index bfcad44..63f9966 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,13 @@ -# Changelog +# 更新日志 -## 1.0.0 (unreleased) +## 1.0.0(未发布) -- Initial release of Monokai Syntax -- Monokai Pro dark and light color palettes -- SCSS modular architecture with Vite build toolchain -- CodeMirror 6 syntax highlighting token colors -- Custom file tree icons (monokai-pro-icons font) -- Style Settings integration (5 filter themes, compact mode, monochrome icons, accent overrides) -- Graph view and Canvas plugin styles -- WCAG contrast ratio compliance +- Monokai Syntax 初始版本 +- Monokai Pro 深色与浅色调色板 +- SCSS 模块化架构 + Vite 构建工具链 +- CodeMirror 6 语法高亮 token 配色 +- 自定义文件树图标(monokai-pro-icons 字体) +- Style Settings 集成(5 种滤镜主题、紧凑模式、单色图标、强调色覆盖) +- 关系图谱与 Canvas 插件样式 +- WCAG 对比度合规 +- Callout 与块引用 Monokai Pro 风格重设计(语义色左竖线、代码符号图标) diff --git a/MonokaiSyntax.png b/MonokaiSyntax.png new file mode 100644 index 0000000..28bc44a Binary files /dev/null and b/MonokaiSyntax.png differ diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000..b7582a2 --- /dev/null +++ b/README.en.md @@ -0,0 +1,70 @@ +# Monokai Syntax + +[中文](./README.md) | [GitHub](https://github.com/Darkings/Obsidian-MonokaiSyntax) + +Monokai Syntax is a community theme for Obsidian that aims to reproduce the Monokai Pro dark and light visual language in knowledge management contexts. + +![Monokai Syntax](./MonokaiSyntax.png) + +## Next Version Plan + +- Polish project icons +- Refine project details +- Improve Style Settings plugin integration + +## Project Status + +Currently in early development stage. The foundational engineering scaffolding, Vite build pipeline, Stylelint checks, and test vault sync workflow are complete. + +## Install Dependencies + +```powershell +npm install +``` + +## Common Commands + +Lint SCSS: + +```powershell +npm run lint:css +``` + +Build the theme: + +```powershell +npm run build +``` + +Build and sync to test vault: + +```powershell +npm run build:vault # Default vault +npm run build:vault -- D:/your/Obsidian/Vault # Custom vault +``` + +## Local Testing + +Default test vault path: + +```text +C:\Users\Jie\iCloudDrive\iCloud~md~obsidian\SecondBrain +``` + +To use your own vault, append the path to the command: + +```powershell +npm run build:vault -- D:/your/Obsidian/Vault +``` + +The theme files will be synced to `.obsidian\themes\Monokai Syntax` under the target vault. + +You can then enable `Monokai Syntax` in Obsidian's Appearance settings. + +## Remote Resource Constraints + +The theme CSS must not load remote resources at runtime. Remote `@import`, remote font URLs, or remote image URLs are prohibited in the final theme CSS. Any fonts, icons, or image assets must be localized and their licenses verified. + +## License + +This project is licensed under the MIT License. See [LICENSE.md](./LICENSE.md) for details. diff --git a/README.md b/README.md index 183aaa1..7326b78 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,17 @@ # Monokai Syntax +[English](./README.en.md) | [GitHub](https://github.com/Darkings/Obsidian-MonokaiSyntax) + Monokai Syntax 是一个面向 Obsidian 的社区主题,目标是在知识管理场景中复现 Monokai Pro 的深色与浅色视觉语言。 +![Monokai Syntax](./MonokaiSyntax.png) + +## 下一版本规划 + +- 完善项目图标 +- 完善项目细节 +- 完善与 Style Settings 插件的联动 + ## 项目状态 当前项目处于早期开发阶段,已经完成基础工程化脚手架、Vite 构建、Stylelint 检查和测试 Vault 同步流程。 @@ -29,23 +39,26 @@ npm run build 构建并同步到测试 Vault: ```powershell -npm run build:vault +npm run build:vault # 默认 Vault +npm run build:vault -- D:/你的/Obsidian/Vault # 自定义 Vault ``` ## 本地测试 -本项目当前使用以下 Obsidian Vault 作为测试环境: +默认测试 Vault 路径: ```text C:\Users\Jie\iCloudDrive\iCloud~md~obsidian\SecondBrain ``` -运行 `npm run build:vault` 后,主题文件会同步到: +如需使用自己的 Vault,在命令后追加路径即可: -```text -C:\Users\Jie\iCloudDrive\iCloud~md~obsidian\SecondBrain\.obsidian\themes\Monokai Syntax +```powershell +npm run build:vault -- D:/你的/Obsidian/Vault ``` +运行后,主题文件会同步到对应 Vault 的 `.obsidian\themes\Monokai Syntax` 目录下。 + 之后可在 Obsidian 的外观设置中启用 `Monokai Syntax`。 ## 远程资源约束 diff --git a/package.json b/package.json index f2bc305..e99cc3d 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "qa:verify": "node scripts/verify-qa.js", "build:dev": "vite build --mode development", "sync:vault": "node scripts/sync-vault-theme.js", - "build:vault": "npm run build && npm run sync:vault", + "build:vault": "npm run build && node scripts/sync-vault-theme.js", "release:pack": "npm run verify:pip-editor && npm run verify:icons && npm run verify:graph && npm run verify:active-visual && npm run lint:css && npm run check:contrast && npm run build && npm run audit:css" }, "devDependencies": { diff --git a/scripts/sync-vault-theme.js b/scripts/sync-vault-theme.js index 336c44c..cc35451 100644 --- a/scripts/sync-vault-theme.js +++ b/scripts/sync-vault-theme.js @@ -2,9 +2,9 @@ import { copyFileSync, mkdirSync } from "node:fs"; import { resolve } from "node:path"; const rootDir = resolve(import.meta.dirname, ".."); -const vaultThemeDir = resolve( - "C:/Users/Jie/iCloudDrive/iCloud~md~obsidian/SecondBrain/.obsidian/themes/Monokai Syntax", -); +const defaultVaultRoot = "C:/Users/Jie/iCloudDrive/iCloud~md~obsidian/SecondBrain"; +const vaultRoot = process.argv[2] ?? defaultVaultRoot; +const vaultThemeDir = resolve(vaultRoot, ".obsidian/themes/Monokai Syntax"); mkdirSync(vaultThemeDir, { recursive: true });