| Title: | Facilitates the Creation of AAGI Quarto Documents |
|---|---|
| Description: | Assists in the creation of AAGI Quarto documents by providing a set of functions that generates the document structure and style. The package is designed to work with Quarto which is an open-source document format that supports R Markdown and Jupyter Notebooks. The package provides functions to create the document structure, add sections, figures, tables, and references. It also provides functions to download the AAGI document style, including logos, fonts, and colours. |
| Authors: | Javier A. Fernandez [aut, cre] (ORCID: <https://orcid.org/0000-0002-4862-2461>) |
| Maintainer: | Javier A. Fernandez <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.9.0 |
| Built: | 2026-06-08 10:35:27 UTC |
| Source: | https://github.com/AAGI-AUS/AAGIQuartoExtra |
Create a new AAGI project with the following structure:
aagi_project(path, ...)aagi_project(path, ...)
path |
Path to save the new project |
... |
Additional arguments |
A new directory with the name of the project
A _quarto.yml file with the title of the project
A index.qmd file with the title of the project
A references.bib file
A pyenv directory if python_venv is TRUE
A renv directory if with_renv is TRUE
A new AAGI project
This function checks if the Proxima Nova font is installed on the user's system. If the font is not installed, it provides instructions on how to set up the font for use in the Quarto project.
check_fonts()check_fonts()
This function checks if the Proxima Nova font is installed on the user's system.
check_proxima_nova_installed()check_proxima_nova_installed()
TRUE if the Proxima Nova font is installed, FALSE otherwise
Install bundled Quarto extensions into current working directory and create
new qmd using skeleton documents. This function extends a function written by
Thomas Mock: https://github.com/jthomasmock/octavo/blob/master/R/use_quarto_ext.R
and by Spencer Schien: https://spencerschien.info/post/r_for_nonprofits/quarto_template/.
This is equivalent to the quarto command quarto use with a --template flag.
create_aagi_ext( file_name = NULL, ext_name = "aagi-report", university = "AU", path = "." )create_aagi_ext( file_name = NULL, ext_name = "aagi-report", university = "AU", path = "." )
file_name |
Name of new qmd file and sub-directory to be created |
ext_name |
String indicating which extension to install |
university |
String indicating which university partner to use |
path |
Path to save new qmd file |
a message if extension was successfully copied over
This function displays instructions for setting up the Proxima Nova font for use in the Quarto project.
display_font_setup_instructions()display_font_setup_instructions()
This function downloads the Proxima Nova font files from the private AAGI repository and extracts them to the specified destination directory.
download_fonts( font_repo = "jafernandez01/font-resources", font_dir = "fonts/", dest_dir = "./_extensions/aagi-report", pat = Sys.getenv("GITHUB_PAT") )download_fonts( font_repo = "jafernandez01/font-resources", font_dir = "fonts/", dest_dir = "./_extensions/aagi-report", pat = Sys.getenv("GITHUB_PAT") )
font_repo |
The GitHub repository containing the font files |
font_dir |
The directory within the repository containing the font files |
dest_dir |
The destination directory to extract the font files |
pat |
The GitHub Personal Access Token (PAT) to access the private repository |
TRUE if the fonts are downloaded and extracted successfully, FALSE otherwise
This function installs a specified AAGI Quarto extension into the current working directory or updates an existing installation to the version included in the package. The extension will be installed to the '_extensions' folder in the current directory.
install_aagi_ext(ext_name = "aagi-report", force = FALSE)install_aagi_ext(ext_name = "aagi-report", force = FALSE)
ext_name |
String indicating which extension to install. Must be one of "aagi-report", "aagi-short-report", "aagi-presentation", or "all" to install/update all bundled extensions. |
force |
Logical indicating whether to force installation even if the extension already exists. Default is FALSE, which will prompt the user when an existing extension is found. |
Invisibly returns TRUE if the extension was installed or updated, FALSE otherwise.
## Not run: # Install the AAGI report extension install_aagi_ext("aagi-report") # Force update the AAGI short report extension install_aagi_ext("aagi-short-report", force = TRUE) ## End(Not run)## Not run: # Install the AAGI report extension install_aagi_ext("aagi-report") # Force update the AAGI short report extension install_aagi_ext("aagi-short-report", force = TRUE) ## End(Not run)
Create a new AAGI Quarto document. If the extension is not already
installed, it will be copied over to the _extensions folder in the
current working directory. This function extends a function written by
Thomas Mock: https://github.com/jthomasmock/octavo/blob/master/R/use_quarto_ext.R
and by Spencer Schien: https://spencerschien.info/post/r_for_nonprofits/quarto_template/
new_aagi_document( file_name = NULL, ext_name = "aagi-report", university = "UQ", update = FALSE )new_aagi_document( file_name = NULL, ext_name = "aagi-report", university = "UQ", update = FALSE )
file_name |
Name of new qmd file and sub-directory to be created |
ext_name |
String indicating which extension to install |
university |
String indicating which university partner to use |
update |
Logical indicating whether to update the extension if it already exists |
This function renames the index.qmd file to a new name based on the project name and output type.
It also updates the _quarto.yml file to specify the output type and directory for the project.
This function should be run in the root directory of a Quarto project and after the setup_folders() function.
setup_docs(output_type = "Report")setup_docs(output_type = "Report")
output_type |
Character. The type of output to be generated (e.g., "Report", "Slides", "Manuscript"). |
The function extracts the project name from the directory name and uses it to rename the index.qmd file.
The new file name format is 01_projectname_outputtype.qmd.
The _quarto.yml file is updated with the output type and directory for the project.
This function creates a standardized folder structure for a Quarto project. The structure includes folders for data, code, figures, documents, outputs, source files, and admin tasks.
setup_folders(project_path = ".")setup_folders(project_path = ".")
project_path |
Character. The root path of the Quarto project where the folders will be created. |
data: Contains the raw data files used in the project. These files should not be altered and are ideally read-only.
code: Contains the scripts or code files used to run the project.
figs: Contains plots, images, tables, or figures created and saved by your code. It should be possible to delete and regenerate this folder with the scripts in the project.
doc: Contains any manuscripts or interim summaries produced during the project.
output: Contains non-figure objects created by the scripts, such as processed data or logs.
src: Contains any files you may want to source() in your scripts, such as .R files containing helper functions.
admin: Contains administrative files related to the project (e.g., notes, project planning documents, and metadata).
Folder structure inspired by Kathryn Destasio's best practices for R projects: https://kdestasio.github.io/post/r_best_practices/
This function provides instructions to the user on how to create a GitHub Personal Access Token (PAT) and set it up for use in the current R session.
setup_github_pat()setup_github_pat()
TRUE if the GITHUB_PAT is successfully set up, FALSE otherwise