sd_add_page {surveydown}R Documentation

Add a Page Template to the Current Document

Description

This function inserts a template for a surveydown page at the current cursor position in the active RStudio document. It provides a basic structure for a new page, including a title, content area, and a next button. If the function call exists in the document, it will be removed before inserting the template.

Usage

sd_add_page()

Details

IMPORTANT: This function should be run outside any division or R code chunk in your 'Quarto' document. Running it inside a division or code chunk may result in an incorrect page structure.

The function performs the following steps:

  1. Checks for and removes any existing sd_add_page() function call in the document.

  2. Inserts a template at the current cursor position.

The template includes:

Value

This function does not return a value. It modifies the active document as a side effect by inserting text and potentially removing a function call.

Examples

if (interactive()) {
  library(surveydown)

  # Insert a new page template
  sd_add_page()
}


[Package surveydown version 0.5.0 Index]