From f2f2baff2316a8dc86a0e4859eedd6dd1b9af0e8 Mon Sep 17 00:00:00 2001 From: aireilly Date: Tue, 12 Dec 2023 15:32:33 +0000 Subject: [PATCH] Adding en dash rule --- .vale/fixtures/RedHat/EnDashes/.vale.ini | 5 +++++ .vale/fixtures/RedHat/EnDashes/testinvalid.adoc | 2 ++ .vale/fixtures/RedHat/EnDashes/testvalid.adoc | 4 ++++ .vale/styles/RedHat/EnDashes.yml | 10 ++++++++++ modules/reference-guide/nav.adoc | 1 + modules/reference-guide/pages/endashes.adoc | 12 ++++++++++++ 6 files changed, 34 insertions(+) create mode 100644 .vale/fixtures/RedHat/EnDashes/.vale.ini create mode 100644 .vale/fixtures/RedHat/EnDashes/testinvalid.adoc create mode 100644 .vale/fixtures/RedHat/EnDashes/testvalid.adoc create mode 100644 .vale/styles/RedHat/EnDashes.yml create mode 100644 modules/reference-guide/pages/endashes.adoc diff --git a/.vale/fixtures/RedHat/EnDashes/.vale.ini b/.vale/fixtures/RedHat/EnDashes/.vale.ini new file mode 100644 index 000000000..ddc1e2b80 --- /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 000000000..ce5c42f4a --- /dev/null +++ b/.vale/fixtures/RedHat/EnDashes/testinvalid.adoc @@ -0,0 +1,2 @@ +11 - 12, 14 - 19 +September - December diff --git a/.vale/fixtures/RedHat/EnDashes/testvalid.adoc b/.vale/fixtures/RedHat/EnDashes/testvalid.adoc new file mode 100644 index 000000000..d9d66d356 --- /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 000000000..8a4367b39 --- /dev/null +++ b/.vale/styles/RedHat/EnDashes.yml @@ -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: – diff --git a/modules/reference-guide/nav.adoc b/modules/reference-guide/nav.adoc index 0e69a4bdb..29a4ab042 100644 --- a/modules/reference-guide/nav.adoc +++ b/modules/reference-guide/nav.adoc @@ -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[] diff --git a/modules/reference-guide/pages/endashes.adoc b/modules/reference-guide/pages/endashes.adoc new file mode 100644 index 000000000..b56041d01 --- /dev/null +++ b/modules/reference-guide/pages/endashes.adoc @@ -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]