tag-taxonomy
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTag Taxonomy — Controlled Vocabulary for Wiki Tags
标签分类法——Wiki标签受控词汇表
You are enforcing consistent tagging across the wiki by normalizing tags to a controlled vocabulary.
你需要通过将标签规范化为受控词汇,在整个wiki中强制执行统一的标签规范。
Before You Start
开始之前
- Read to get
.envOBSIDIAN_VAULT_PATH - Read — this is the canonical tag list
$OBSIDIAN_VAULT_PATH/_meta/taxonomy.md - Read to understand the wiki's scope
index.md
- 读取获取
.envOBSIDIAN_VAULT_PATH - 读取——这是权威的标签列表
$OBSIDIAN_VAULT_PATH/_meta/taxonomy.md - 读取了解wiki的范围
index.md
The Taxonomy File
分类法文件
The canonical tag vocabulary lives at . It defines:
$OBSIDIAN_VAULT_PATH/_meta/taxonomy.md- Canonical tags — the tags that should be used
- Aliases — common alternatives that should be mapped to the canonical form
- Rules — max 5 tags per page, lowercase/hyphenated, prefer broad over narrow
- Migration guide — specific renames for known inconsistencies
Always read this file before tagging. It's the source of truth.
权威标签词汇表存放在,它定义了:
$OBSIDIAN_VAULT_PATH/_meta/taxonomy.md- 规范标签——应该使用的标签
- 别名——常见的替代标签,应该映射到规范形式
- 规则——每页最多5个标签,小写/用连字符连接,优先使用宽泛而非狭窄的标签
- 迁移指南——针对已知不一致问题的具体重命名规则
在打标签之前请务必阅读此文件,它是唯一可信来源。
Mode 1: Tag Audit
模式1:标签审计
When the user wants to see the current state of tags:
当用户想要查看标签的当前状态时:
Step 1: Scan all pages
步骤1:扫描所有页面
Glob: $VAULT_PATH/**/*.md (excluding _archives/, .obsidian/, _meta/)
Extract: tags field from YAML frontmatterGlob: $VAULT_PATH/**/*.md (excluding _archives/, .obsidian/, _meta/)
Extract: tags field from YAML frontmatterStep 2: Build a tag frequency table
步骤2:构建标签频率表
For each tag found, count how many pages use it. Flag:
- Unknown tags — not in the taxonomy's canonical list
- Alias tags — using an alias instead of the canonical form (e.g., instead of
nextjs)react - Over-tagged pages — pages with more than 5 tags
- Untagged pages — pages with no tags or empty tags field
对于找到的每个标签,统计有多少页面使用了它。标记以下问题:
- 未知标签——不在分类法的规范列表中的标签
- 别名标签——使用别名而非规范形式(例如 而非
nextjs)react - 标签过多的页面——标签超过5个的页面
- 未加标签的页面——没有标签或标签字段为空的页面
Step 3: Report
步骤3:报告
markdown
undefinedmarkdown
undefinedTag Audit Report
Tag Audit Report
Summary
Summary
- Total unique tags: 47
- Canonical tags used: 32
- Non-canonical tags found: 15
- Pages over tag limit (5): 3
- Untagged pages: 2
- Total unique tags: 47
- Canonical tags used: 32
- Non-canonical tags found: 15
- Pages over tag limit (5): 3
- Untagged pages: 2
Non-Canonical Tags Found
Non-Canonical Tags Found
| Current Tag | → Canonical | Pages Affected |
|---|---|---|
| | 4 |
| | 2 |
| | 1 |
| | 3 |
| Current Tag | → Canonical | Pages Affected |
|---|---|---|
| | 4 |
| | 2 |
| | 1 |
| | 3 |
Unknown Tags (not in taxonomy)
Unknown Tags (not in taxonomy)
| Tag | Pages | Recommendation |
|---|---|---|
| 1 | Add to taxonomy under Frameworks |
| 2 | Add to taxonomy under DevOps |
| Tag | Pages | Recommendation |
|---|---|---|
| 1 | Add to taxonomy under Frameworks |
| 2 | Add to taxonomy under DevOps |
Over-Tagged Pages
Over-Tagged Pages
| Page | Tag Count | Tags |
|---|---|---|
| 8 | ai, ml, founder, ... |
undefined| Page | Tag Count | Tags |
|---|---|---|
| 8 | ai, ml, founder, ... |
undefinedMode 2: Tag Normalization
模式2:标签规范化
When the user wants to fix the tags:
当用户想要修复标签时:
Step 1: Run audit (above)
步骤1:运行上述审计
Step 2: Apply fixes
步骤2:应用修复
For each page with non-canonical tags:
- Read the page
- Replace alias tags with their canonical form from the taxonomy
- If page has > 5 tags, suggest which to drop (keep the most specific/relevant ones)
- Write the updated frontmatter
Example:
yaml
undefined对于每个使用非规范标签的页面:
- 读取页面
- 将别名标签替换为分类法中对应的规范形式
- 如果页面标签超过5个,建议删除哪些标签(保留最具体/相关的标签)
- 写入更新后的frontmatter
示例:
yaml
undefinedBefore
Before
tags: [nextjs, ai, ml-engineer, windows98, creative-coding, game, 8-bit, portfolio]
tags: [nextjs, ai, ml-engineer, windows98, creative-coding, game, 8-bit, portfolio]
After
After
tags: [react, ai, ml, retro, generative-art]
undefinedtags: [react, ai, ml, retro, generative-art]
undefinedStep 3: Handle unknowns
步骤3:处理未知标签
For tags that aren't in the taxonomy and aren't aliases:
- If the tag is used on 2+ pages, suggest adding it to the taxonomy
- If the tag is used on 1 page, suggest replacing it with the closest canonical tag
- Ask the user before making changes to unknown tags
对于不在分类法中也不是别名的标签:
- 如果该标签在2个及以上页面使用,建议将其添加到分类法中
- 如果该标签仅在1个页面使用,建议用最接近的规范标签替换它
- 修改未知标签前请先询问用户
Step 4: Update taxonomy
步骤4:更新分类法
If new canonical tags were agreed upon, append them to in the correct section.
_meta/taxonomy.md如果双方同意添加新的规范标签,请将其追加到的对应部分。
_meta/taxonomy.mdMode 3: Tagging a New Page
模式3:为新页面打标签
When you're creating a wiki page and need to choose tags:
- Read
_meta/taxonomy.md - Select up to 5 tags that best describe the page:
- 1-2 domain tags (what subject area)
- 1 type tag (what kind of thing)
- 0-1 project tags (if project-specific)
- 0-1 additional descriptive tags
- Use only canonical tags — never aliases
- If no existing tag fits, check if it's worth adding to the taxonomy
当你创建wiki页面需要选择标签时:
- 阅读
_meta/taxonomy.md - 选择最多5个最能描述页面的标签:
- 1-2个领域标签(所属主题领域)
- 1个类型标签(内容类型)
- 0-1个项目标签(如果是特定项目相关的)
- 0-1个额外的描述性标签
- 仅使用规范标签——不要使用别名
- 如果没有合适的现有标签,检查是否值得添加到分类法中
Mode 4: Adding a New Tag
模式4:添加新标签
When the user wants to add a tag to the vocabulary:
- Check if an existing tag already covers the concept (suggest it if so)
- If genuinely new, determine which section it belongs in (Domain, Type, Project)
- Add it to with:
_meta/taxonomy.md- The canonical tag name
- What it's used for
- Any aliases to redirect
当用户想要向词汇表中添加标签时:
- 检查是否已有标签覆盖该概念(如果有则建议使用现有标签)
- 如果确实是新标签,确定它所属的类别(领域、类型、项目)
- 将其添加到中,包含:
_meta/taxonomy.md- 规范标签名称
- 用途说明
- 任何需要重定向的别名
After Any Tag Operation
任何标签操作完成后
Append to :
log.md- [TIMESTAMP] TAG_AUDIT tags_normalized=N unknown_tags=M pages_modified=POr for normalization:
- [TIMESTAMP] TAG_NORMALIZE tags_renamed=N pages_modified=M new_tags_added=P追加到:
log.md- [TIMESTAMP] TAG_AUDIT tags_normalized=N unknown_tags=M pages_modified=P如果是规范化操作则使用:
- [TIMESTAMP] TAG_NORMALIZE tags_renamed=N pages_modified=M new_tags_added=P