html_dsl/types/html/head

Types

Head is a type that represents the head of an HTML document

pub opaque type Head

Functions

pub fn charset(root: Head, set: String) -> Head

This creates a string that represents a meta charset

  • @param charset: the intended charset
  • @return: A Head
pub fn end(root: Head) -> Head

Ends a head context

  • @param root: The head to end
  • @returns: A Head
pub fn head() -> Head

Starts a head context

  • @returns: A Head
pub fn head_to_string(head: Head) -> String

This function converts a Head to a string

  • @param head: The head to convert
  • @returns: A string
pub fn link(
  root: Head,
  rel: String,
  href: String,
  attributes: Option(Attribute),
) -> Head

This creates a string that represents a link element

  • @param rel: The relationship of the link
  • @param href: The href of the link
  • @param attributes: The attributes of the link
  • @returns: A Head
pub fn meta(root: Head, name: String, content: String) -> Head

This creates a string that represents a meta element

  • @param name: The name of the meta
  • @param content: The content of the meta
  • @returns: A Head
pub fn resolve(head: Head) -> Result(String, String)

This function resolves a Head to a string or an error

  • @param head: The head to resolve
  • @returns: A Result
pub fn script(root: Head, src: String) -> Head

This creates a string that represents a script element

  • @param src: The source of the script
  • @returns: A Head
pub fn style(root: Head, src: String) -> Head

This creates a string that represents a special link element for stylesheets

  • @param src: The source of the stylesheet
  • @returns: A Head
pub fn title(root: Head, content: String) -> Head

This creates a string that represents a title element

  • @param content: The content of the title
  • @returns: A Head
Search Document