Tempo.Visualizer (Tempo v0.5.0)

Copy Markdown View Source

A web-based visualizer for ISO 8601 / ISO 8601-2 / IXDTF strings.

This module is a Plug.Router that can be mounted inside a Phoenix or Plug application, or run standalone during development via Tempo.Visualizer.Standalone.

What it does

Enter any ISO 8601, ISO 8601-2 (EDTF), or IXDTF string into the top input. The page renders a visual breakdown:

  • The input echoed in large monospace.

  • Each parsed component as its own box (year, month, day, hour, time zone, qualification, IXDTF suffix, …) with the canonical glyph above a short description.

  • A details card showing every field of the parsed %Tempo{} / %Tempo.Interval{} / %Tempo.Duration{} / %Tempo.Set{} struct.

All state lives in the URL — share a link, share a parse.

Mounting in Phoenix / Plug

forward "/visualize", Tempo.Visualizer

Running standalone

Tempo.Visualizer.Standalone.start(port: 4001)
# Visit http://localhost:4001

Optional dependencies

The visualizer requires both :plug and :bandit. Both are declared optional: true in Tempo's mix.exs:

{:plug, "~> 1.15"},
{:bandit, "~> 1.5"}

The module is compiled only when both are available at build time. The core parser has no such dependency and will compile without either in place.

Summary

Functions

Callback implementation for Plug.call/2.

Callback implementation for Plug.init/1.

Functions

call(conn, opts)

Callback implementation for Plug.call/2.

init(opts)

Callback implementation for Plug.init/1.