Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding En dash rule #699

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .vale/fixtures/RedHat/EnDashes/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; Vale configuration file to test the `EnDashes` rule
StylesPath = ../../../styles
MinAlertLevel = suggestion
[*.adoc]
RedHat.EnDashes = YES
3 changes: 3 additions & 0 deletions .vale/fixtures/RedHat/EnDashes/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
50 - 100 px
50-100 px
50 – 100 px
7 changes: 7 additions & 0 deletions .vale/fixtures/RedHat/EnDashes/testvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
numbers 12–15
pages 100–107
X'41'–X'FE'
September–December
ip-10-0-0-1.us-east-2.compute.internal
775898c3-ecc2-41a4-b98b-a4cd5ae56fd0
2023-09-22
11 changes: 11 additions & 0 deletions .vale/styles/RedHat/EnDashes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
extends: substitution
level: warning
link: https://redhat-documentation.github.io/vale-at-red-hat/docs/main/reference-guide/endashes/
message: "Use an en dash to show a range of numbers. Do not use a space before or after the en dash."
nonword: true
action:
name: replace
swap:
(\d+)\s?-\s?(\d+): $1–$2
(\d+)\s–\s(\d+): $1–$2
1 change: 1 addition & 0 deletions modules/reference-guide/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* xref:donotuseterms.adoc[]
* xref:ellipses.adoc[]
* xref:emdashes.adoc[]
* xref:endashes.adoc[]
* xref:headingpunctuation.adoc[]
* xref:headings.adoc[]
* xref:hyphens.adoc[]
Expand Down
18 changes: 18 additions & 0 deletions modules/reference-guide/pages/endashes.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
:navtitle: Endashes
:keywords: reference, rule, endashes

= En dashes

Use an link:https://www.compart.com/en/unicode/U+2013[En dash] (`–`) to show a range of numbers.
Do not use spaces before or after the En dash.

[NOTE]
====
An link:https://www.compart.com/en/unicode/U+2014[Em dash] (`-`) is not the same as an En dash.
The Em dash works like a comma, a colon, or parenthesis.
====

.Additional resources

* link:{ibmsg-url-print}[{ibmsg-print} - En dashes, p.48]
* link:{ibmsg-url}?topic=punctuation-dashes#showing-ranges-with-en-dashes[{ibmsg} - Showing ranges with en dashes]
Loading