doctype: Render the <!DOCTYPE html> declaration

View source: R/tags.R

doctypeR Documentation

Render the ⁠<!DOCTYPE html>⁠ declaration

Description

Convenience wrapper around raw_html() that returns the HTML5 document-type declaration. Useful when building a full page.

Usage

doctype()

Value

A "hypertext.raw" object containing ⁠<!DOCTYPE html>⁠.

Examples

page <- tag_list(
  doctype(),
  tags$html(
    tags$head(tags$title("Home")),
    tags$body(tags$h1("Welcome"))
  )
)
render(page)

hypertext documentation built on April 18, 2026, 1:06 a.m.