视觉画布设计
canvas-design
基于设计原则创作静态视觉作品,用于海报与品牌图形。
em-dash-guide【文档与办公】Distinguishes hyphens, en-dashes, and em-dashes with typing shortcuts, style guide conventions, and concrete BAD vs GOOD examples for technical documentation.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: em-dash-guide description: Distinguishes hyphens, en-dashes, and em-dashes with typing shortcuts, style guide conventions, and concrete BAD vs GOOD examples for technical documentation. license: MIT compatibility: opencode metadata: version: "1.0.0" domain: writing triggers: em dash, en dash, hyphen, dash typography, how do i type dashes, long dash, range notation, compound modifier dash archetypes:
Selects the correct dash character (hyphen -, en-dash –, em-dash —) based on context and applies style guide conventions consistently across all written content. Misusing dashes is one of the most common typography errors in technical writing — it signals carelessness to readers and makes documentation harder to parse visually.
- for compound modifiers (open-source project, well-tested library)– for ranges (2024–2026, pages 15–30, A–Z index) and connections (React–Vue comparison)— for parenthetical breaks, appositives, or attribution with no spaces on either side-- as a substitute for an em-dash in published contentUse this skill when:
Avoid this skill for:
- regardless of typography rules (npm --version, git log --oneline)https://example.com/my-page)Identify the dash function in context — Determine what grammatical or logical role the dash serves: compound modifier, range, parenthetical break, or connection. Checkpoint: If the text connects two equal elements (A to B), it needs an en-dash. If it sets off a parenthetical thought, it needs an em-dash.
Select the correct character — Choose based on the function identified:
-––——Apply style guide spacing rules — Check which style guide governs the document:
word—word)word—word)word — word)Verify compound modifier hyphenation — For multi-word modifiers before a noun, use hyphens to link them:
state-of-the-art implementation)well-documented API)full-grown trees), omit after (the trees are full grown)Check for common substitutions — Replace ASCII workarounds with proper Unicode characters in final published content:
-- or -- → em-dash — (in prose only, not code)- - or - -→ em-dash—`–Compound modifiers before a noun require hyphens to prevent ambiguity. Without them, readers must pause to parse the meaning.
# ❌ BAD — Ambiguous compound modifier
The open source software development team uses well tested libraries.
# ✅ GOOD — Hyphens clarify relationships between words
The open-source software-development team uses well-tested libraries.
# ❌ BAD — Reader cannot tell what modifies what
She manages a small business analytics tool.
# ✅ GOOD — Hyphen shows "small-business" is a compound noun acting as modifier
She manages a small-business analytics tool.
Rule: When two or more words function as a single modifier before a noun, hyphenate them. Exception: do not hyphenate if the first word ends in -ly (e.g., clearly defined terms — no hyphen).
The en-dash represents a span or relationship between two equal elements. It is wider than a hyphen but narrower than an em-dash.
# ❌ BAD — Hyphens in place of en-dashes (ambiguous ranges)
The software supports versions 2.0-3.5 and the years 2024-2026.
Read pages 100-150 for the complete reference.
# ✅ GOOD — En-dashes clearly indicate ranges
The software supports versions 2.0–3.5 and the years 2024–2026.
Read pages 100–150 for the complete reference.
# ❌ BAD — Using "to" or "-" for connections between equal elements
The React to Vue comparison covers performance benchmarks.
This guide covers Windows - macOS - Linux.
# ✅ GOOD — En-dashes show equal-element relationships
The React–Vue comparison covers performance benchmarks.
This guide covers Windows–macOS–Linux.
Key en-dash patterns:
0–100, 2024–2026, $50–$75v2.0–v3.0, Node 18–20Monday–Friday, January–Marchproducer–consumer pattern, client–server architectureThe em-dash sets off a parenthetical thought more emphatically than commas or parentheses. It creates a dramatic pause that draws attention to the enclosed material.
# Example of em-dash usage in technical documentation prose:
"""
The configuration file — located at /etc/app/config.yaml — must be updated before deployment.
Note two key behaviors: the application reads this file at startup; it does not hot-reload
when the file changes. This is a deliberate design choice, not an oversight.
The lead architect explained — in the Q3 architecture review — that this constraint stems from
the underlying event loop implementation. See Section 4.2 for details.
"""
# ❌ BAD — Hyphen used as em-dash (ASCII substitution)
The config file - located at /etc/app/config.yaml - must be updated before deployment.
# ✅ GOOD — Proper em-dash with tight spacing (Chicago/IEEE style)
The config file—located at /etc/app/config.yaml—must be updated before deployment.
# ✅ GOOD — Spaced em-dash (AP Style convention)
The config file — located at /etc/app/config.yaml — must be updated before deployment.
Em-dash spacing by style guide:
| Style Guide | Spacing | Example |
|---|---|---|
| Chicago Manual of Style | None | word—word |
| IEEE / ACM | None | word—word |
| Google Developer Docs | None (em-dash preferred) | word—word |
| Microsoft Manual of Style | Non-breaking space | word em-dash word |
| AP Stylebook | Space on both sides | word — word |
| Wikipedia | Spaced en-dash or spaced em-dash | word — word |
Each operating system provides keyboard shortcuts for inserting proper Unicode dash characters. Using these eliminates the need to copy-paste from external sources.
# Linux (GNOME, Wayland/X11)
Em-dash: Ctrl+Shift+U then 2014 Enter → —
En-dash: Ctrl+Shift+U then 2013 Enter → –
Hyphen: - (standard key)
# macOS
Em-dash: Option + Shift + = (⌥⇧=) → —
En-dash: Option + - (⌥-) → –
Hyphen: - (standard key)
# Windows 10/11
Em-dash: Alt+0151 (numpad) → —
En-dash: Alt+0150 (numpad) → –
Alternative: Win+. or Win+, (emoji panel), then search "dash"
Alternative: MS Word auto-format (two hyphens -- become em-dash automatically)
# Vim/Neovim
Em-dash: Insert mode: Ctrl+V then u 2 0 1 4 Enter → —
En-dash: Insert mode: Ctrl+V then u 2 0 1 3 Enter → –
# VS Code (with extensions)
Install "Auto Replace" or "Typographer" extension to auto-convert -- to — on space.
The following table covers the most frequent dash-related errors encountered in technical documentation, along with their corrections.
# Mistake 1: Using hyphens for everything (most common)
❌ BAD: Check out our open-source tools for data-science from 2020-2024.
✅ GOOD: Check out our open-source tools for data science from 2020–2024.
# Mistake 2: Spaces around em-dashes without following AP Style
❌ BAD (inconsistent): The API — which uses OAuth 2.0 — supports three auth methods .
✅ GOOD (Chicago): The API—which uses OAuth 2.0—supports three auth methods.
# Mistake 3: En-dash used where hyphen is needed for compound modifier
❌ BAD: This is a state – of – the – art solution.
✅ GOOD: This is a state-of-the-art solution.
# Mistake 4: Missing hyphen in compound modifier creates ambiguity
❌ BAD: The manual covers self service account management features.
✅ GOOD: The manual covers self-service account management features.
# Mistake 5: Using double hyphens (--) in prose instead of em-dash
❌ BAD: The --experimental-- flag enables debugging mode.
✅ GOOD: The —experimental— flag enables debugging mode.
--, --)- to represent an en-dash or em-dash in published prose-- as an em-dash substitute in final documentation (acceptable only in code contexts)-ly (e.g., clearly defined, highly optimized)When auditing or writing documentation with this skill active, produce:
Authoritative documentation links for typography and dash usage conventions.
| Skill | Purpose |
|---|---|
technical-documentation | Broader documentation patterns and structure guidance |
style-guide | General technical writing style conventions beyond dashes |