PhoenixIconify.Manifest (PhoenixIconify v0.2.0)

Copy Markdown View Source

Manages the icon manifest stored in priv/.

The manifest contains all discovered icons, cached between compilations.

Summary

Functions

Adds an icon to the runtime cache and optionally persists to disk.

Clears the cached icons.

Returns the number of icons in the manifest.

Gets icons from the manifest, loading from persistent storage on first use.

Returns the path to the manifest file for the given application.

Reads the manifest from disk.

Reloads icons from disk into persistent_term.

Writes the manifest to disk.

Functions

add_icon(name, icon, opts \\ [])

Adds an icon to the runtime cache and optionally persists to disk.

clear_cache()

Clears the cached icons.

count()

Returns the number of icons in the manifest.

get_icons()

Gets icons from the manifest, loading from persistent storage on first use.

manifest_path(app \\ nil)

Returns the path to the manifest file for the given application.

read(path \\ nil)

@spec read(Path.t() | nil) :: %{required(String.t()) => Iconify.Icon.t()}

Reads the manifest from disk.

Missing manifests are treated as empty. Invalid manifests raise.

reload()

Reloads icons from disk into persistent_term.

write(icons, path \\ nil)

@spec write(%{required(String.t()) => Iconify.Icon.t()}, Path.t() | nil) :: :ok

Writes the manifest to disk.