Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
7e0f865
Update "ESP" meaning in glossary as per https://github.com/nmfs-ost/a…
sbreitbart-NOAA Feb 10, 2026
64a0bd4
update cheatsheet to remove 'withr()' wrapper from add_a11y function …
sbreitbart-NOAA Feb 12, 2026
360c3fc
Update special characters in glossary (#425)
sbreitbart-NOAA Feb 12, 2026
946eeba
update affiliation with duplicate city for afsc seattle offices (#426)
Schiano-NOAA Feb 20, 2026
c265f76
Update preamble prompt (#430)
sbreitbart-NOAA Mar 4, 2026
c12a46d
Update SAFE template table structure from flextable to asar (#432)
sbreitbart-NOAA Mar 10, 2026
a8aca40
Update functions that relied on 'flextable' and convert to 'gt' (#429)
sbreitbart-NOAA Mar 27, 2026
fe422d1
Fix typo and update WORDLIST
sbreitbart-NOAA Mar 27, 2026
98c7845
Allow messages about tables when running create_template() (#431)
sbreitbart-NOAA Mar 27, 2026
1bf987e
add float package to in-header tex (#427)
Schiano-NOAA Mar 27, 2026
4640cc7
update documentation
sbreitbart-NOAA Mar 27, 2026
68702ea
Comment out tests that should pass once https://github.com/nmfs-ost/s…
sbreitbart-NOAA Mar 27, 2026
1d160de
change action so only comments when the PR is first opened (#435)
Schiano-NOAA Mar 27, 2026
87240cd
update version in pkg and cheatsheet
Schiano-NOAA Mar 27, 2026
2e96471
fix date in cheatsheet
Schiano-NOAA Mar 27, 2026
a952e3f
add workflows one pager as article for reference
Schiano-NOAA Mar 27, 2026
530bb32
move one pager to own icon
Schiano-NOAA Mar 27, 2026
70c2bf3
fix mistake in site yml
Schiano-NOAA Mar 27, 2026
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
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"packages": "qpdf"
},
"ghcr.io/rocker-org/devcontainer-features/r-packages:1": {
"packages": "usethis,pak,qpdf,cli,flextable,forstringr,fs,naniar,officer,pdftools,prodlim,svDialogs,tidyselect,tinytex",
"packages": "usethis,pak,qpdf,cli,gt,forstringr,fs,naniar,officer,pdftools,prodlim,svDialogs,tidyselect,tinytex",
"installSystemRequirements": true
},
// option to run rstudio. you can type rserver into the command line to
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/new-version-checklist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ name: new-version-checklist
on:
pull_request:
branches: [main]
types: [opened]
workflow_dispatch:
jobs:
new-version-checklist:
Expand Down
6 changes: 2 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: asar
Title: Build NOAA Stock Assessment Report
Version: 2.0.2
Version: 2.0.3
Authors@R: c(
person("Samantha", "Schiano", , "samantha.schiano@noaa.gov", role = c("aut", "cre"),
comment = c(ORCID = "0009-0003-3744-6428")),
Expand All @@ -25,12 +25,11 @@ Imports:
cli,
data.table,
dplyr,
flextable,
forstringr,
fs,
glue,
gt,
naniar,
officer,
purrr,
stats,
stringi,
Expand All @@ -42,7 +41,6 @@ Imports:
utils
Suggests:
ggplot2,
gt,
kableExtra,
knitr,
parallel,
Expand Down
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

export(ID_tbl_length_class)
export(ID_tbl_width_class)
export(add_accessibility)
export(add_alttext)
Expand All @@ -19,4 +20,5 @@ export(create_titlepage_tex)
export(create_yaml)
export(export_split_tbls)
export(format_quarto)
export(gt_split)
export(render_lg_table)
47 changes: 47 additions & 0 deletions R/ID_tbl_length_class.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#' Identify table length class
#'
#' @inheritParams render_lg_table
#'
#' @return The length class of a table: regular or long. The result
#' will determine whether the table can be rendered on a page
#' as-is, or if it needs to be split across multiple pages.
#' @export
#'
#' @examples
#' \dontrun{
#' ID_tbl_length_class(
#' plot_name = "indices.abundance_table.rda",
#' tables_dir = here::here()
#' )
#' }
ID_tbl_length_class <- function(
tables_dir,
plot_name
) {
tables_path <- fs::path(
tables_dir,
"tables",
paste0(plot_name, "_table.rda")
)

if (file.exists(tables_path)) {
load(tables_path)
table_rda <- rda
rm(rda)
gt_table <- table_rda$table

# Get table length in rows
table_length <- nrow(gt_table[["_data"]])

# determine table length class
if (table_length <= 38) {
length_class <- "regular" # fit on one landscape page (and, by default, portrait)
} else {
length_class <- "long" # divided across >1 landscape page
}
} else {
cli::cli_abort(message = "Table not found at {tables_path}")
}

length_class
}
11 changes: 8 additions & 3 deletions R/ID_tbl_width_class.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' be resized, rotated, and/or split across multiple pages.
#'
#' @return The width class of a table: regular, wide, or extra-wide. The result
#' will determine whether the table that can be rendered on a portrait page
#' will determine whether the table can be rendered on a portrait page
#' as-is, or if it needs to be resized, rotated, and/or split across multiple pages.
#' @export
#'
Expand All @@ -34,9 +34,14 @@ ID_tbl_width_class <- function(
load(tables_path)
table_rda <- rda
rm(rda)
table_width <- flextable::flextable_dim(table_rda$table)[["widths"]] |>
as.numeric()
gt_table <- table_rda$table

# Set each col to 1.5"
col_inches <- 1.5

# Calculate total table width in inches
table_width <- ncol(gt_table[["_data"]]) * col_inches

# determine table width class
if (table_width <= portrait_pg_width) {
width_class <- "regular"
Expand Down
4 changes: 4 additions & 0 deletions R/add_child.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ add_child <- function(x,
"#| warning: false", "\n",
"a <- knitr::knit_child(", "'", sec_num, "'", ", quiet = TRUE)", "\n",
"cat(a, sep = '\\n')", "\n",
# ifelse checks for the 'tables' label and injects the extra code/comment
ifelse(label[i] == "tables",
"# Force LaTeX to render all floating tables before moving to the next section\ncat('\\n\\\\clearpage\\n')\n",
""),
"```", "\n"
)
child <- paste(child, child_loop, sep = "\n {{< pagebreak >}} \n")
Expand Down
2 changes: 1 addition & 1 deletion R/asar-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ globvar <- c(
"row_rescale", "table_list", "read.csv", "All", "x", "Acronym", "Meaning",
"meaning_lower", "Definition", "n", "Label", "figures_doc_header",
"X", "len_bins", "area", "match_key", "uncertainty_label",
"word_count", "ac_short"
"word_count", "ac_short", "column_label"
)
if (getRversion() >= "2.15.1") utils::globalVariables(globvar)
Loading
Loading