diff --git a/.vale/fixtures/RedHat/EnDashes/.vale.ini b/.vale/fixtures/RedHat/EnDashes/.vale.ini new file mode 100644 index 00000000..ddc1e2b8 --- /dev/null +++ b/.vale/fixtures/RedHat/EnDashes/.vale.ini @@ -0,0 +1,5 @@ +; Vale configuration file to test the `EnDashes` rule +StylesPath = ../../../styles +MinAlertLevel = suggestion +[*.adoc] +RedHat.EnDashes = YES diff --git a/.vale/fixtures/RedHat/EnDashes/testinvalid.adoc b/.vale/fixtures/RedHat/EnDashes/testinvalid.adoc new file mode 100644 index 00000000..bd787d1c --- /dev/null +++ b/.vale/fixtures/RedHat/EnDashes/testinvalid.adoc @@ -0,0 +1,3 @@ +50 - 100 px +50-100 px +50 – 100 px diff --git a/.vale/fixtures/RedHat/EnDashes/testvalid.adoc b/.vale/fixtures/RedHat/EnDashes/testvalid.adoc new file mode 100644 index 00000000..d9d66d35 --- /dev/null +++ b/.vale/fixtures/RedHat/EnDashes/testvalid.adoc @@ -0,0 +1,4 @@ +numbers 12–15 +pages 100–107 +X'41'–X'FE' +September–December diff --git a/.vale/styles/RedHat/EnDashes.yml b/.vale/styles/RedHat/EnDashes.yml new file mode 100644 index 00000000..bb2500a0 --- /dev/null +++ b/.vale/styles/RedHat/EnDashes.yml @@ -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 diff --git a/modules/reference-guide/nav.adoc b/modules/reference-guide/nav.adoc index 0ecdd044..a6380553 100644 --- a/modules/reference-guide/nav.adoc +++ b/modules/reference-guide/nav.adoc @@ -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[] diff --git a/modules/reference-guide/pages/endashes.adoc b/modules/reference-guide/pages/endashes.adoc new file mode 100644 index 00000000..ab0ae652 --- /dev/null +++ b/modules/reference-guide/pages/endashes.adoc @@ -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]