mirror of
https://github.com/JimLiu/baoyu-skills.git
synced 2026-07-10 21:21:30 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a7d6b5c69b | |||
| 6e18725906 | |||
| 7133d54f04 |
@@ -6,7 +6,7 @@
|
||||
},
|
||||
"metadata": {
|
||||
"description": "Skills shared by Baoyu for improving daily work efficiency",
|
||||
"version": "1.41.0"
|
||||
"version": "1.42.0"
|
||||
},
|
||||
"plugins": [
|
||||
{
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
|
||||
English | [中文](./CHANGELOG.zh.md)
|
||||
|
||||
## 1.42.0 - 2026-02-28
|
||||
|
||||
### Features
|
||||
- `baoyu-markdown-to-html`: consolidate heritage and warm into single modern theme, add per-theme color defaults (default→blue, grace→purple, simple→green, modern→orange)
|
||||
- `baoyu-post-to-wechat`: add default color preference support in EXTEND.md, add modern theme option to first-time setup
|
||||
|
||||
## 1.41.0 - 2026-02-28
|
||||
|
||||
### Features
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
|
||||
[English](./CHANGELOG.md) | 中文
|
||||
|
||||
## 1.42.0 - 2026-02-28
|
||||
|
||||
### 新功能
|
||||
- `baoyu-markdown-to-html`:合并 heritage 和 warm 为 modern 主题,新增主题默认颜色(default→蓝、grace→紫、simple→绿、modern→橙)
|
||||
- `baoyu-post-to-wechat`:EXTEND.md 新增默认颜色配置,首次设置增加 modern 主题和颜色选择
|
||||
|
||||
## 1.41.0 - 2026-02-28
|
||||
|
||||
### 新功能
|
||||
|
||||
@@ -92,8 +92,7 @@ test -f "$HOME/.baoyu-skills/baoyu-post-to-wechat/EXTEND.md" && grep -o 'default
|
||||
| `default` (Recommended) | 经典主题 - 传统排版,标题居中带底边,二级标题白字彩底 |
|
||||
| `grace` | 优雅主题 - 文字阴影,圆角卡片,精致引用块 |
|
||||
| `simple` | 简洁主题 - 现代极简风,不对称圆角,清爽留白 |
|
||||
| `heritage` | 传统主题 - 宋体排版,传统书法风格,默认红金配色 |
|
||||
| `warm` | 温暖主题 - 暖色调现代风,宽松行距,圆角装饰 |
|
||||
| `modern` | 现代主题 - 大圆角、药丸形标题、宽松行距(搭配 `--color red` 还原传统红金风格) |
|
||||
|
||||
### Step 2: Convert
|
||||
|
||||
@@ -115,7 +114,7 @@ npx -y bun ${SKILL_DIR}/scripts/main.ts <markdown_file> [options]
|
||||
|
||||
| Option | Description | Default |
|
||||
|--------|-------------|---------|
|
||||
| `--theme <name>` | Theme name (default, grace, simple, heritage, warm) | default |
|
||||
| `--theme <name>` | Theme name (default, grace, simple, modern) | default |
|
||||
| `--color <name\|hex>` | Primary color: preset name or hex value | theme default |
|
||||
| `--font-family <name>` | Font: sans, serif, serif-cjk, mono, or CSS value | theme default |
|
||||
| `--font-size <N>` | Font size: 14px, 15px, 16px, 17px, 18px | 16px |
|
||||
@@ -138,8 +137,8 @@ npx -y bun ${SKILL_DIR}/scripts/main.ts <markdown_file> [options]
|
||||
| black | #333333 | 石墨黑 |
|
||||
| gray | #A9A9A9 | 雾烟灰 |
|
||||
| pink | #FFB7C5 | 樱花粉 |
|
||||
| red | #A93226 | 中国红 (heritage default) |
|
||||
| orange | #D97757 | 暖橘 (warm default) |
|
||||
| red | #A93226 | 中国红 |
|
||||
| orange | #D97757 | 暖橘 (modern default) |
|
||||
|
||||
**Examples:**
|
||||
|
||||
@@ -151,7 +150,7 @@ npx -y bun ${SKILL_DIR}/scripts/main.ts article.md
|
||||
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --theme grace
|
||||
|
||||
# Theme with custom color
|
||||
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --theme heritage --color green
|
||||
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --theme modern --color red
|
||||
|
||||
# Keep the first heading in content
|
||||
npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --keep-title
|
||||
@@ -195,8 +194,7 @@ npx -y bun ${SKILL_DIR}/scripts/main.ts article.md --title "My Article"
|
||||
| `default` | 经典主题 - 传统排版,标题居中带底边,二级标题白字彩底 |
|
||||
| `grace` | 优雅主题 - 文字阴影,圆角卡片,精致引用块 (by @brzhang) |
|
||||
| `simple` | 简洁主题 - 现代极简风,不对称圆角,清爽留白 (by @okooo5km) |
|
||||
| `heritage` | 传统主题 - 宋体排版,传统书法风格,默认红金配色 |
|
||||
| `warm` | 温暖主题 - 暖色调现代风,宽松行距,圆角装饰 |
|
||||
| `modern` | 现代主题 - 大圆角、药丸形标题、宽松行距(搭配 `--color red` 还原传统红金风格) |
|
||||
|
||||
## Supported Markdown Features
|
||||
|
||||
|
||||
@@ -109,14 +109,16 @@ const DEFAULT_STYLE: StyleConfig = {
|
||||
};
|
||||
|
||||
const THEME_STYLE_DEFAULTS: Record<string, Partial<StyleConfig>> = {
|
||||
heritage: {
|
||||
primaryColor: COLOR_PRESETS.red,
|
||||
accentColor: "#D4AC0D",
|
||||
containerBg: "rgba(255, 251, 240, 1)",
|
||||
fontFamily: FONT_FAMILY_MAP["serif-cjk"],
|
||||
blockquoteBackground: "rgba(253, 237, 236, 1)",
|
||||
default: {
|
||||
primaryColor: COLOR_PRESETS.blue,
|
||||
},
|
||||
warm: {
|
||||
grace: {
|
||||
primaryColor: COLOR_PRESETS.purple,
|
||||
},
|
||||
simple: {
|
||||
primaryColor: COLOR_PRESETS.green,
|
||||
},
|
||||
modern: {
|
||||
primaryColor: COLOR_PRESETS.orange,
|
||||
accentColor: "#E4B1A0",
|
||||
containerBg: "rgba(250, 249, 245, 1)",
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
/**
|
||||
* MD 传统主题 (heritage)
|
||||
* 传统书法风格,宋体排版,默认红金配色
|
||||
*/
|
||||
|
||||
/* ==================== 容器样式覆盖 ==================== */
|
||||
section,
|
||||
container {
|
||||
font-family: var(--md-font-family);
|
||||
font-size: var(--md-font-size);
|
||||
line-height: 1.8;
|
||||
background-color: var(--md-container-bg);
|
||||
border: 4px solid var(--md-primary-color);
|
||||
border-radius: 12px;
|
||||
padding: 6px 12px;
|
||||
}
|
||||
|
||||
#output {
|
||||
font-family: var(--md-font-family);
|
||||
font-size: var(--md-font-size);
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
/* ==================== 一级标题 ==================== */
|
||||
h1 {
|
||||
display: table;
|
||||
padding: 0 1em;
|
||||
border-bottom: 2px solid var(--md-primary-color);
|
||||
margin: 30px auto 20px;
|
||||
color: var(--md-primary-color);
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* ==================== 二级标题 ==================== */
|
||||
h2 {
|
||||
display: block;
|
||||
width: fit-content;
|
||||
padding: 6px 20px;
|
||||
margin: 30px auto 20px;
|
||||
color: #FFFFFF;
|
||||
background-color: var(--md-primary-color);
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
border-radius: 8px;
|
||||
box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 6px;
|
||||
line-height: 1.6em;
|
||||
}
|
||||
|
||||
/* ==================== 三级标题 ==================== */
|
||||
h3 {
|
||||
padding-left: 8px;
|
||||
border-left: 3px solid var(--md-primary-color);
|
||||
margin: 20px 8px 10px 0;
|
||||
color: var(--md-primary-color);
|
||||
font-size: 17px;
|
||||
font-weight: normal;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
/* ==================== 四级标题 ==================== */
|
||||
h4 {
|
||||
margin: 10px 8px;
|
||||
color: var(--md-accent-color);
|
||||
font-size: 16px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
/* ==================== 五级标题 ==================== */
|
||||
h5 {
|
||||
margin: 10px 8px;
|
||||
color: #797D7F;
|
||||
font-size: 15px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
/* ==================== 六级标题 ==================== */
|
||||
h6 {
|
||||
margin: 10px 8px;
|
||||
color: #797D7F;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
/* ==================== 段落 ==================== */
|
||||
p {
|
||||
margin: 16px 0;
|
||||
letter-spacing: 0.5px;
|
||||
color: hsl(var(--foreground));
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
/* ==================== 引用块 ==================== */
|
||||
blockquote {
|
||||
font-style: normal;
|
||||
padding: 15px 12px;
|
||||
border-left: 2px solid color-mix(in srgb, var(--md-primary-color) 80%, transparent);
|
||||
border-radius: 4px;
|
||||
color: hsl(var(--foreground));
|
||||
background-color: var(--blockquote-background);
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
blockquote > p {
|
||||
color: hsl(var(--foreground));
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* ==================== 代码块 ==================== */
|
||||
pre.code__pre,
|
||||
.hljs.code__pre {
|
||||
font-size: 13px;
|
||||
border: 1px solid var(--md-accent-color);
|
||||
box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
/* ==================== 图片 ==================== */
|
||||
img {
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--md-accent-color);
|
||||
margin: 20px auto;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
/* ==================== 列表 ==================== */
|
||||
ol {
|
||||
padding-left: 1em;
|
||||
margin: 15px 0;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
padding-left: 0;
|
||||
margin: 15px 0;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
li {
|
||||
margin: 0.2em 0;
|
||||
color: hsl(var(--foreground));
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/* ==================== 分隔线 ==================== */
|
||||
hr {
|
||||
border-style: solid;
|
||||
border-width: 2px 0 0;
|
||||
border-color: var(--md-accent-color);
|
||||
margin: 40px 0;
|
||||
}
|
||||
|
||||
/* ==================== 强调 ==================== */
|
||||
strong {
|
||||
color: var(--md-primary-color);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* ==================== 标记高亮 ==================== */
|
||||
.markup-highlight {
|
||||
background-color: color-mix(in srgb, var(--md-primary-color) 15%, white);
|
||||
padding: 5px;
|
||||
color: var(--md-primary-color);
|
||||
}
|
||||
|
||||
.markup-underline {
|
||||
text-decoration: underline;
|
||||
text-decoration-color: var(--md-accent-color);
|
||||
}
|
||||
|
||||
/* ==================== 链接 ==================== */
|
||||
a {
|
||||
color: var(--md-primary-color);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* ==================== 表格 ==================== */
|
||||
th {
|
||||
background: color-mix(in srgb, var(--md-primary-color) 10%, transparent);
|
||||
}
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* MD 温暖主题 (warm)
|
||||
* 暖色调现代风,默认橙色主色,宽松行距
|
||||
* MD 现代主题 (modern)
|
||||
* 大圆角、药丸形标题、宽松行距、现代感
|
||||
*/
|
||||
|
||||
/* ==================== 容器样式覆盖 ==================== */
|
||||
@@ -48,7 +48,7 @@ test -f "$HOME/.baoyu-skills/baoyu-post-to-wechat/EXTEND.md" && echo "user"
|
||||
│ Not found │ Run first-time setup ([references/config/first-time-setup.md](references/config/first-time-setup.md)) → Save → Continue │
|
||||
└───────────┴───────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
**EXTEND.md Supports**: Default theme | Default publishing method (api/browser) | Default author | Default open-comment switch | Default fans-only-comment switch | Chrome profile path
|
||||
**EXTEND.md Supports**: Default theme | Default color | Default publishing method (api/browser) | Default author | Default open-comment switch | Default fans-only-comment switch | Chrome profile path
|
||||
|
||||
First-time setup: [references/config/first-time-setup.md](references/config/first-time-setup.md)
|
||||
|
||||
@@ -64,6 +64,7 @@ First-time setup: [references/config/first-time-setup.md](references/config/firs
|
||||
|
||||
```md
|
||||
default_theme: default
|
||||
default_color: blue
|
||||
default_publish_method: api
|
||||
default_author: 宝玉
|
||||
need_open_comment: 1
|
||||
@@ -71,6 +72,10 @@ only_fans_can_comment: 0
|
||||
chrome_profile_path: /path/to/chrome/profile
|
||||
```
|
||||
|
||||
**Theme options**: default, grace, simple, modern
|
||||
|
||||
**Color presets**: blue, green, vermilion, yellow, purple, sky, rose, olive, black, gray, pink, red, orange (or hex value)
|
||||
|
||||
**Value priority**:
|
||||
1. CLI arguments
|
||||
2. Frontmatter
|
||||
@@ -134,6 +139,8 @@ Check and load EXTEND.md settings (see Preferences section above).
|
||||
**CRITICAL**: If not found, complete first-time setup BEFORE any other steps or questions.
|
||||
|
||||
Resolve and store these defaults for later steps:
|
||||
- `default_theme` (default `default`)
|
||||
- `default_color` (omit if not set — theme default applies)
|
||||
- `default_author`
|
||||
- `need_open_comment` (default `1`)
|
||||
- `only_fans_can_comment` (default `0`)
|
||||
@@ -201,13 +208,18 @@ B) Continue - provide HTML file manually
|
||||
- EXTEND.md `default_theme` (loaded in Step 0)
|
||||
- Fallback: `default`
|
||||
|
||||
2. **Execute conversion** (using the discovered skill), **always pass `--theme`**:
|
||||
2. **Resolve color** (first match wins):
|
||||
- CLI `--color` argument
|
||||
- EXTEND.md `default_color` (loaded in Step 0)
|
||||
- Omit if not set (theme default applies)
|
||||
|
||||
3. **Execute conversion** (using the discovered skill), **always pass `--theme`**:
|
||||
|
||||
```bash
|
||||
npx -y bun ${MD_TO_HTML_SKILL_DIR}/scripts/main.ts <markdown_file> --theme <theme>
|
||||
npx -y bun ${MD_TO_HTML_SKILL_DIR}/scripts/main.ts <markdown_file> --theme <theme> [--color <color>]
|
||||
```
|
||||
|
||||
**CRITICAL**: Always include `--theme` parameter. Never omit it, even if using `default`.
|
||||
**CRITICAL**: Always include `--theme` parameter. Never omit it, even if using `default`. Only include `--color` if explicitly set by user or EXTEND.md.
|
||||
|
||||
3. **Parse JSON output** to get: `htmlPath`, `title`, `author`, `summary`, `contentImages`
|
||||
|
||||
@@ -307,7 +319,7 @@ WeChat Publishing Complete!
|
||||
|
||||
Input: [type] - [path]
|
||||
Method: API
|
||||
Theme: [theme name]
|
||||
Theme: [theme name] [color if set]
|
||||
|
||||
Article:
|
||||
• Title: [title]
|
||||
@@ -334,7 +346,7 @@ WeChat Publishing Complete!
|
||||
|
||||
Input: [type] - [path]
|
||||
Method: Browser
|
||||
Theme: [theme name]
|
||||
Theme: [theme name] [color if set]
|
||||
|
||||
Article:
|
||||
• Title: [title]
|
||||
|
||||
@@ -20,9 +20,9 @@ npx -y bun ./scripts/wechat-article.ts --markdown article.md --author "作者名
|
||||
| Parameter | Description |
|
||||
|-----------|-------------|
|
||||
| `--markdown <path>` | Markdown file to convert and post |
|
||||
| `--theme <name>` | Theme: default, grace, or simple |
|
||||
| `--theme <name>` | Theme: default, grace, simple, modern |
|
||||
| `--title <text>` | Override title (auto-extracted from markdown) |
|
||||
| `--author <name>` | Author name (default: 宝玉) |
|
||||
| `--author <name>` | Author name |
|
||||
| `--summary <text>` | Article summary |
|
||||
| `--html <path>` | Pre-rendered HTML file (alternative to markdown) |
|
||||
| `--profile <dir>` | Chrome profile directory |
|
||||
|
||||
@@ -49,14 +49,34 @@ header: "Theme"
|
||||
question: "Default theme for article conversion?"
|
||||
options:
|
||||
- label: "default (Recommended)"
|
||||
description: "Classic layout - centered title with border, white-on-color H2"
|
||||
description: "Classic layout - centered title with border, white-on-color H2 (default: blue)"
|
||||
- label: "grace"
|
||||
description: "Elegant - text shadows, rounded cards, refined blockquotes"
|
||||
description: "Elegant - text shadows, rounded cards, refined blockquotes (default: purple)"
|
||||
- label: "simple"
|
||||
description: "Minimal modern - asymmetric rounded corners, clean whitespace"
|
||||
description: "Minimal modern - asymmetric rounded corners, clean whitespace (default: green)"
|
||||
- label: "modern"
|
||||
description: "Large rounded corners, pill headings, spacious (default: orange)"
|
||||
```
|
||||
|
||||
### Question 2: Default Publishing Method
|
||||
### Question 2: Default Color
|
||||
|
||||
```yaml
|
||||
header: "Color"
|
||||
question: "Default color preset? (theme default if not set)"
|
||||
options:
|
||||
- label: "Theme default (Recommended)"
|
||||
description: "Use the theme's built-in default color"
|
||||
- label: "blue"
|
||||
description: "#0F4C81 经典蓝"
|
||||
- label: "red"
|
||||
description: "#A93226 中国红"
|
||||
- label: "green"
|
||||
description: "#009874 翡翠绿"
|
||||
```
|
||||
|
||||
Note: User can choose "Other" to type any preset name (vermilion, yellow, purple, sky, rose, olive, black, gray, pink, orange) or hex value.
|
||||
|
||||
### Question 3: Default Publishing Method
|
||||
|
||||
```yaml
|
||||
header: "Method"
|
||||
@@ -68,7 +88,7 @@ options:
|
||||
description: "Slow, requires Chrome and login session"
|
||||
```
|
||||
|
||||
### Question 3: Default Author
|
||||
### Question 4: Default Author
|
||||
|
||||
```yaml
|
||||
header: "Author"
|
||||
@@ -80,7 +100,7 @@ options:
|
||||
|
||||
Note: User will likely choose "Other" to type their author name.
|
||||
|
||||
### Question 4: Open Comments
|
||||
### Question 5: Open Comments
|
||||
|
||||
```yaml
|
||||
header: "Comments"
|
||||
@@ -92,7 +112,7 @@ options:
|
||||
description: "Disable comments by default"
|
||||
```
|
||||
|
||||
### Question 5: Fans-Only Comments
|
||||
### Question 6: Fans-Only Comments
|
||||
|
||||
```yaml
|
||||
header: "Fans only"
|
||||
@@ -104,7 +124,7 @@ options:
|
||||
description: "Only followers can comment"
|
||||
```
|
||||
|
||||
### Question 6: Save Location
|
||||
### Question 7: Save Location
|
||||
|
||||
```yaml
|
||||
header: "Save"
|
||||
@@ -133,7 +153,8 @@ options:
|
||||
## EXTEND.md Template
|
||||
|
||||
```md
|
||||
default_theme: [default/grace/simple]
|
||||
default_theme: [default/grace/simple/modern]
|
||||
default_color: [preset name, hex, or empty for theme default]
|
||||
default_publish_method: [api/browser]
|
||||
default_author: [author name or empty]
|
||||
need_open_comment: [1/0]
|
||||
|
||||
@@ -673,8 +673,8 @@ Options:
|
||||
--content <text> Article content (use with --image)
|
||||
--html <path> HTML file to paste (alternative to --content)
|
||||
--markdown <path> Markdown file to convert and post (recommended)
|
||||
--theme <name> Theme for markdown (default, grace, simple)
|
||||
--author <name> Author name (default: 宝玉)
|
||||
--theme <name> Theme for markdown (default, grace, simple, modern)
|
||||
--author <name> Author name
|
||||
--summary <text> Article summary
|
||||
--image <path> Content image, can repeat (only with --content)
|
||||
--submit Save as draft
|
||||
|
||||
Reference in New Issue
Block a user