Bootstrap5Components.Resource protocol (bootstrap5components v0.5.1)

View Source

A protocol to help represent resources in web applications using the components defined by Bootstrap5Components.

Summary

Types

t()

All the types that implement this protocol.

Functions

Render resource as HTML.

Render resource as plain text.

Path for the resource in a given web application.

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

as_html(resource)

@spec as_html(t()) :: String.t()

Render resource as HTML.

as_text(resource)

@spec as_text(t()) :: String.t()

Render resource as plain text.

path_for(resource)

@spec path_for(t()) :: String.t()

Path for the resource in a given web application.