Skip to content

Commit d4ba65f

Browse files
authored
Replace adhoc docs "Notes" with admonition blocks (#4287)
See https://ex-doc.hexdocs.pm/readme.html#admonition-blocks.
1 parent b4b966c commit d4ba65f

4 files changed

Lines changed: 14 additions & 9 deletions

File tree

guides/server/security-model.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ the topic:
290290

291291
MyAppWeb.Endpoint.broadcast("users_socket:#{user.id}", "disconnect", %{})
292292

293-
> Note: If you use `mix phx.gen.auth` to generate your authentication system,
293+
> ### Note {: .info}
294+
> If you used `mix phx.gen.auth` to generate your authentication system,
294295
> lines to that effect are already present in the generated code. The generated
295296
> code uses a `user_token` instead of referring to the `user_id`.
296297

lib/phoenix_component.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,8 +2617,9 @@ defmodule Phoenix.Component do
26172617
26182618
Here we see the `:sort_param` and `:drop_param` options in action.
26192619
2620-
> Note: `on_replace: :delete` on the `has_many` and `embeds_many` is required
2621-
> when using these options.
2620+
> ### Note {: .info}
2621+
> When using these options, `on_replace: :delete` on the `has_many` and
2622+
> `embeds_many` is required.
26222623
26232624
When Ecto sees the specified sort or drop parameter from the form, it will sort
26242625
the children based on the order they appear in the form, add new children it hasn't

lib/phoenix_live_view.ex

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,8 @@ defmodule Phoenix.LiveView do
16041604
@doc """
16051605
Attaches the given `fun` by `name` for the lifecycle `stage` into `socket`.
16061606
1607-
> Note: This function is for server-side lifecycle callbacks.
1607+
> ### Note {: .info}
1608+
> This function is for server-side lifecycle callbacks.
16081609
> For client-side hooks, see the
16091610
> [JS Interop guide](js-interop.md#client-hooks-via-phx-hook).
16101611
@@ -1615,8 +1616,9 @@ defmodule Phoenix.LiveView do
16151616
lifecycle stages: `:handle_params`, `:handle_event`, `:handle_info`, `:handle_async`, and
16161617
`:after_render`. To attach a hook to the `:mount` stage, use `on_mount/1`.
16171618
1618-
> Note: only `:after_render`, `:handle_event` and `:handle_async` hooks are currently supported in
1619-
> LiveComponents.
1619+
> ### LiveComponents support {: .warning}
1620+
> In LiveComponents, only `:after_render`, `:handle_event` and `:handle_async`
1621+
> hooks are currently supported.
16201622
16211623
## Return Values
16221624
@@ -1785,7 +1787,8 @@ defmodule Phoenix.LiveView do
17851787
@doc """
17861788
Detaches a hook with the given `name` from the lifecycle `stage`.
17871789
1788-
> Note: This function is for server-side lifecycle callbacks.
1790+
> ### Note {: .info}
1791+
> This function is for server-side lifecycle callbacks.
17891792
> For client-side hooks, see the
17901793
> [JS Interop guide](js-interop.md#client-hooks-via-phx-hook).
17911794

lib/phoenix_live_view/js.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,8 +932,8 @@ defmodule Phoenix.LiveView.JS do
932932
> <.button phx-click={JS.dispatch("input:clear", to: "#my_input")}>...</.button>
933933
> ```
934934
>
935-
> Note: this uses `Phoenix.LiveView.ColocatedJS`, but you can also define the event listener directly inside
936-
> your `app.js` instead.
935+
> While the example above uses `Phoenix.LiveView.ColocatedJS`, you can also
936+
> define the event listener directly inside your `app.js` instead.
937937
"""
938938
def set_attribute({attr, val}), do: set_attribute(%JS{}, {attr, val}, [])
939939

0 commit comments

Comments
 (0)