Docxir.HtmlBuilder (docxir v0.1.0)

View Source

Builds complete HTML documents with Tailwind CSS.

This module generates the HTML structure including the document head, Tailwind CSS CDN link, and styling for optimal display.

Summary

Functions

Creates a complete HTML document from body content.

Functions

build(body_html, opts \\ [])

@spec build(
  binary(),
  keyword()
) :: binary()

Creates a complete HTML document from body content.

Parameters

  • body_html - The HTML content for the body
  • opts - Keyword list of options
    • :title - Document title (default: "Document")
    • :lang - Language code (default: "zh-TW")

Returns

  • Complete HTML document as a string

Examples

iex> body = "<p>Hello World</p>"
iex> html = Docxir.HtmlBuilder.build(body, title: "Test Doc")
iex> html =~ "<title>Test Doc</title>"
true