% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/extract-link.R
\name{repl_urls}
\alias{repl_urls}
\alias{repl_urls.default}
\title{Extract shareable URLs from livelink objects}
\usage{
repl_urls(x, ...)

\method{repl_urls}{default}(x, ...)
}
\arguments{
\item{x}{A livelink object. Supported classes are \code{webr_link}, \code{webr_project},
\code{webr_exercise}, \code{webr_directory}, \code{webr_decoded}, \code{webr_decoded_batch},
\code{webr_preview}, \code{shinylive_link}, \code{shinylive_project}, \code{shinylive_directory},
\code{shinylive_decoded}, \code{shinylive_decoded_batch}, and \code{shinylive_preview}.}

\item{...}{Additional arguments passed to methods}
}
\value{
A character vector of URLs. Most objects yield a single URL; exercise
objects return a length-2 named vector (\code{exercise}, \code{solution}); directory
and batch objects return one URL per file.
}
\description{
Generic function to extract the shareable URL(s) from any livelink object,
covering both webR REPL and Shinylive results. Provides a clear way to get
just the URLs for sharing or further processing.
}
\examples{
# Single link
link <- webr_repl_link("plot(1:10)")
repl_urls(link)

# Exercise (returns named vector)
exercise <- webr_repl_exercise("# TODO", "plot(1:10)", "test")
repl_urls(exercise)

# Shinylive links work the same way
repl_urls(shinylive_r_link("library(shiny)"))

# Decoded files (returns the original URL)
decoded <- decode_webr_link(as.character(link))
repl_urls(decoded)

}
\seealso{
The \code{as.character()} methods (for example \code{\link[=as.character.webr_link]{as.character.webr_link()}}),
which \code{repl_urls()} delegates to.
}
