Skip to content

Commit

Permalink
[docs] Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cpjolicoeur committed May 16, 2023
1 parent fabdaa7 commit 4000a4d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/torch/component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ defmodule Torch.Component do
@moduledoc """
Provides Phoenix.Components for use in Torch views and layouts
"""
@moduledoc since: "5.0.0"

use Phoenix.Component

Expand Down
1 change: 1 addition & 0 deletions lib/torch/helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ defmodule Torch.Helpers do
iex> body_classes(%Plug.Conn{private: %{phoenix_action: :custom_action}})
"torch-custom-action"
"""
@doc since: "5.0.0"
@spec body_classes(Plug.Conn.t()) :: String.t()
def body_classes(conn) do
conn
Expand Down
1 change: 1 addition & 0 deletions lib/torch/views/flash_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ defmodule Torch.FlashView do
@moduledoc """
Contains functions for dealing with flash messages.
"""
@moduledoc deprecated: "This module will be fully removed in Torch 6.0"

use Phoenix.Component

Expand Down
2 changes: 2 additions & 0 deletions lib/torch/views/page_view.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
defmodule Torch.PageView do
@moduledoc deprecated: "This module will be fully removed in Torch 6.0"
@doc """
DEPRECATED: Use Torch.Helpers.body_classes/1 instead
Expand All @@ -12,6 +13,7 @@ defmodule Torch.PageView do
iex> body_classes(%Plug.Conn{private: %{phoenix_action: :custom_action}})
"torch-custom-action"
"""

@spec body_classes(Plug.Conn.t()) :: String.t()
@deprecated "Use Torch.Helpers.body_classes/1 instead"
def body_classes(conn), do: Torch.Helpers.body_classes(conn)
Expand Down
7 changes: 7 additions & 0 deletions lib/torch/views/pagination_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ defmodule Torch.PaginationView do
@doc """
Render Torch pagination links based on current page, sort, and filters
"""
@doc since: "5.0.0"

attr(:page_number, :integer, required: true)
attr(:page_size, :integer, required: true)
Expand Down Expand Up @@ -80,6 +81,8 @@ defmodule Torch.PaginationView do
...> page_link(a) |> Phoenix.HTML.Safe.to_iodata() |> IO.iodata_to_binary()
"<a href=\\"?page=14\\" class=\\"active\\">14</a>"
"""
@doc since: "5.0.0"

attr(:query_string, :string, default: "")
attr(:conn_params, :any, required: true)
attr(:page_number, :integer, required: true)
Expand Down Expand Up @@ -128,6 +131,8 @@ defmodule Torch.PaginationView do
""
"""
# NOTE: query_string param can contain sort info also (e.g. sort_field=name&sort_direction=asc)
@doc since: "5.0.0"

attr(:query_string, :string, default: "")
attr(:conn_params, :any, required: true)
attr(:page_number, :integer, required: true)
Expand Down Expand Up @@ -188,6 +193,8 @@ defmodule Torch.PaginationView do
...> next_link(a) |> Phoenix.HTML.Safe.to_iodata() |> IO.iodata_to_binary()
""
"""
@doc since: "5.0.0"

attr(:query_string, :string, default: "")
attr(:conn_params, :any, required: true)
attr(:page_number, :integer, required: true)
Expand Down

0 comments on commit 4000a4d

Please sign in to comment.