Skip to content

Commit

Permalink
Adding en dash rule
Browse files Browse the repository at this point in the history
  • Loading branch information
aireilly committed Dec 12, 2023
1 parent f3a77e4 commit f2f2baf
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 0 deletions.
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
2 changes: 2 additions & 0 deletions .vale/fixtures/RedHat/EnDashes/testinvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
11 - 12, 14 - 19
September - December
4 changes: 4 additions & 0 deletions .vale/fixtures/RedHat/EnDashes/testvalid.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
numbers 12–15
pages 100–107
X'41'–X'FE'
September–December
10 changes: 10 additions & 0 deletions .vale/styles/RedHat/EnDashes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
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, or inclusive numbers, letters, pages, dates, or codes. Do not use spaces before or after the en dash."
nonword: true
action:
name: replace
swap:
\s-\s:
1 change: 1 addition & 0 deletions modules/reference-guide/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* xref:definitions.adoc[]
* xref:donotuse.adoc[]
* xref:ellipses.adoc[]
* xref:endashes.adoc[]
* xref:headingpunctuation.adoc[]
* xref:headings.adoc[]
* xref:hyphens.adoc[]
Expand Down
12 changes: 12 additions & 0 deletions modules/reference-guide/pages/endashes.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
:navtitle: endashes
:keywords: reference, rule, endashes

= En Dashes

Use an en dash to show a range, or inclusive numbers, letters, pages, dates, or codes.
Do not use spaces before or after the en dash.

.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]

0 comments on commit f2f2baf

Please sign in to comment.