Skip to content

Commit

Permalink
Use text not numeral for table count (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-dray authored Dec 10, 2023
1 parent b04ca12 commit 748107b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Package: a11ytables
Title: Create Spreadsheet Publications Following Best Practice
Version: 0.2.0.9001
Version: 0.2.1
Authors@R: c(
person(given = "Crown Copyright", role = c("cph", "fnd")),
person(given = "Matt", family = "Dray", role = c("aut", "cre"), email = "mwdray@gmail.com"),
person(given = "Tim", family = "Taylor", role = "ctb"),
person(given = "Matt", family = "Kerlogue", role = "ctb")
person(given = "Matt", family = "Kerlogue", role = "ctb"),
person(given = "Crown Copyright", role = c("cph", "fnd"))
)
Description: Generate spreadsheet publications that follow best practice
guidance from the UK government's Analysis Function, with a focus on
Expand Down
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# a11ytables 0.2.0.9001
# a11ytables 0.2.1

* Hotfix: correct spelling error in installation instructions in README (#111).
* Bugfix: corrected spelling error in installation instructions in README (#111).
* Accessibility fix: display number of tables with text rather than a numeral (#109).

# a11ytables 0.2.0

Expand Down
17 changes: 16 additions & 1 deletion R/utils-workbook.R
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,24 @@

table_count <- nrow(content[content$tab_title == tab_title, ])

if (table_count < 10) {
table_count <- switch(
as.character(table_count),
"1" = "one",
"2" = "two",
"3" = "three",
"4" = "four",
"5" = "five",
"6" = "six",
"7" = "seven",
"8" = "eight",
"9" = "nine",
)
}

text <- paste(
"This worksheet contains", table_count,
ifelse(table_count == 1, "table.", "tables.")
ifelse(table_count == "one", "table.", "tables.")
)

openxlsx::writeData(
Expand Down
2 changes: 1 addition & 1 deletion man/a11ytables-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 748107b

Please sign in to comment.