Skip to contents

This function creates a Quarto file based on defined template by copying the necessary template files into the _extensions directory and generating a new Quarto Markdown (.qmd) file.

Usage

create_from_template(file_name = NULL, template = "article")

Arguments

file_name

A character string specifying the name of the new Quarto Markdown file. If NULL, the function use "index" as the default file name.

template

A character string specifying the name of the extension. Default is "article", but can use also "prez"

Value

This function does not return a value. It performs file operations to set up the Quarto IOM story template in the current working directory.

Details

The function performs the following steps:

  • Checks if file_name is provided. If not, it will be index per default.

  • Verifies what template is selected.

  • Creates the _extensions directory if it does not exist.

  • Creates a subdirectory within _extensions for the specified extension.

  • Copies the extension files from the package's internal extdata directory to _extensions.

  • Checks if the extension files were successfully copied.

  • Creates a new Quarto Markdown file based on the template.

  • Opens the new file in the editor.

Examples

if (FALSE) { # \dontrun{
create_from_template(template = "prez")
create_from_template(template = "article")
} # }