% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/crowd_output.R
\name{is_rendering}
\alias{is_rendering}
\title{Detect if Running in knitr/Quarto Rendering Context}
\usage{
is_rendering()
}
\value{
Logical. \code{TRUE} if rendering a document, \code{FALSE} otherwise.
}
\description{
Helper function to detect if code is running within a knitr/Quarto rendering
context. Useful for creating unified code that works in both interactive R
sessions and when rendering documents.
}
\details{
This function checks \code{getOption("knitr.in.progress")} which is set by knitr
during document rendering. This works for:
\itemize{
\item Quarto documents (all output formats: HTML, DOCX, PDF, etc.)
\item R Markdown documents
\item Any knitr-based rendering systems
}

Returns \code{FALSE} when running in:
\itemize{
\item Interactive R sessions (RStudio console, R terminal)
\item R scripts executed outside knitr
\item Shiny applications (unless explicitly using knitr)
}
}
\examples{
# Check if rendering a document
if (is_rendering()) {
  message("Rendering a document with knitr/Quarto")
} else {
  message("Running in regular R session")
}

# Use for conditional logic
plot_type <- if (is_rendering()) "cat_plot_html" else "cat_plot_docx"
}
\seealso{
\code{\link[=crowd_output]{crowd_output()}} for automatic context-aware output generation
}
