% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/create-qmd.R
\name{create_qmd}
\alias{create_qmd}
\title{Create a new Quarto document from a template}
\usage{
create_qmd(
  path = NULL,
  filename = "analysis.qmd",
  yaml_data = NULL,
  overwrite = FALSE
)
}
\arguments{
\item{path}{A string or \code{NULL}. Path to the directory where the document
will be created. If \code{NULL}, the user must supply a path explicitly.}

\item{filename}{A string. Name of the generated \code{.qmd} file. Defaults to
\code{"analysis.qmd"}.}

\item{yaml_data}{A string or \code{NULL}. Path to a YAML file containing
metadata to pre-populate the document header. If \code{NULL} (the default),
the template is copied as-is with placeholder prompts intact.}

\item{overwrite}{A logical. Whether to overwrite existing files. Defaults
to \code{FALSE}.}
}
\value{
Invisibly returns \code{path}.
}
\description{
Creates a new Quarto document in the specified directory, along with a
sample dataset and UW-Madison branded assets. Optionally pre-populates
the YAML header with user-supplied metadata.
}
\details{
\code{create_qmd()} performs the following steps:
\enumerate{
\item Validates that \code{path} exists.
\item Creates a \verb{data/} folder under \code{path} and copies \code{sample.csv} there.
\item Checks for \code{assets/styles.css} and \code{assets/header.html} - creates the
\verb{assets/} folder if needed and copies both from the package.
\item Copies the template \code{.qmd} to \code{path/filename}.
\item If \code{yaml_data} is provided, reads the YAML file and substitutes values
into the document header.
}

Note: \code{path} has no default value. Always supply an explicit path to avoid
writing files to unexpected locations. Use \code{tempdir()} for temporary output
during testing or exploration.
}
\examples{
\donttest{
# Create with placeholder YAML in a temp directory
create_qmd(path = tempdir())

# Create with a custom filename
create_qmd(path = tempdir(), filename = "report.qmd", overwrite = TRUE)

# Create with pre-populated YAML
yaml_file <- tempfile(fileext = ".yml")
writeLines("author:\n  - name: 'Your Name'", yaml_file)
create_qmd(path = tempdir(), yaml_data = yaml_file, overwrite = TRUE)
}
}
