ghtml

ghtml - Gleam HTML Template Generator.

A preprocessor that converts .ghtml template files into Gleam modules with Lustre Element(msg) render functions.

Usage

gleam run -m ghtml              # Generate all
gleam run -m ghtml -- force     # Force regenerate
gleam run -m ghtml -- watch     # Watch mode
gleam run -m ghtml -- clean     # Remove orphans

Types

CLI options parsed from command-line arguments

pub type CliOptions {
  CliOptions(
    force: Bool,
    clean_only: Bool,
    watch: Bool,
    root: String,
  )
}

Constructors

  • CliOptions(
      force: Bool,
      clean_only: Bool,
      watch: Bool,
      root: String,
    )

Statistics about a generation run

pub type GenerationStats {
  GenerationStats(generated: Int, skipped: Int, errors: Int)
}

Constructors

  • GenerationStats(generated: Int, skipped: Int, errors: Int)

Values

pub fn generate_all(root: String, force: Bool) -> GenerationStats

Generate all templates in the given directory

pub fn main() -> Nil

Main entry point for the CLI

pub fn parse_options(args: List(String)) -> CliOptions

Parse command-line arguments into options

Search Document