View Source Bonfire.Common.Modularity.DeclareHelpers (Bonfire v0.9.10-classic-beta.156)

Helpers for declaring the existence of an extension (i.e., so it gets included in extension settings and nav).

Summary

Functions

Gets the OTP app name for a module

Declares an extension by setting up the module with the given name and options.

Generates a map representing a link with metadata for the extension with the given name, module, and options.

Functions

Gets the OTP app name for a module

Link to this macro

declare_extension(name, opts \\ [])

View Source (macro)

Declares an extension by setting up the module with the given name and options.

Examples

iex> defmodule MyExtension do
...>   import Bonfire.Common.Modularity.DeclareHelpers
...>   declare_extension("My Extension", readme: "MY_README.md")
...> end
Link to this function

generate_link(name, module, opts)

View Source

Generates a map representing a link with metadata for the extension with the given name, module, and options.

Examples

iex> Bonfire.Common.Modularity.DeclareHelpers.generate_link(:bonfire_common, Bonfire.Common, href: "/my_extension")
%{
  name: :bonfire_common,
  module: Bonfire.Common,
  app: :bonfire_common,
  href: "/my_extension",
  type: :link
}