Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Flo0807 committed Feb 3, 2024
1 parent 486b6ad commit a052c3f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
12 changes: 9 additions & 3 deletions assets/flagpack.eex
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@ defmodule Flagpack do

You may use the `Flagpack.flag/1` function and pass a flag name.

<Flagpack.flag name={:usa}/>
<Flagpack.flag name={:usa} />
<Flagpack.flag name={:usa} class="w-5 h-5" />
"""
use Phoenix.Component

attr :class, :string, default: nil, required: false, doc: "class to be added to the component"
attr :name, :atom, required: true, doc: "the name of the icon to be rendered"
attr :name, :atom, required: true, doc: "the name of the flag to be rendered"

@doc false
@doc """
Renders a flag by the given name.

## Examples
<Flagpack.flag name={:usa} />
<Flagpack.flag name={:usa} class="w-5 h-5" />
"""
def flag(assigns) do
apply(Flagpack, assigns.name, [assigns])
end
Expand Down
12 changes: 9 additions & 3 deletions lib/flagpack.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@ defmodule Flagpack do

You may use the `Flagpack.flag/1` function and pass a flag name.

<Flagpack.flag name={:usa}/>
<Flagpack.flag name={:usa} />
<Flagpack.flag name={:usa} class="w-5 h-5" />
"""
use Phoenix.Component

attr :class, :string, default: nil, required: false, doc: "class to be added to the component"
attr :name, :atom, required: true, doc: "the name of the icon to be rendered"
attr :name, :atom, required: true, doc: "the name of the flag to be rendered"

@doc false
@doc """
Renders a flag by the given name.

## Examples
<Flagpack.flag name={:usa} />
<Flagpack.flag name={:usa} class="w-5 h-5" />
"""
def flag(assigns) do
apply(Flagpack, assigns.name, [assigns])
end
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defmodule Flagpack.MixProject do
def project do
[
app: :flagpack,
version: "0.4.0",
version: "0.4.1",
elixir: "~> 1.16",
start_permanent: Mix.env() == :prod,
deps: deps(),
Expand Down

0 comments on commit a052c3f

Please sign in to comment.