From 9c5ea70774946e2286b2039ff2e94b5507639505 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Tue, 26 Sep 2023 08:56:36 -0400 Subject: [PATCH] docs: update/refresh docs --- documentation/topics/working-with-phoenix.md | 4 +++- mix.exs | 24 ++++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/documentation/topics/working-with-phoenix.md b/documentation/topics/working-with-phoenix.md index db25139..57953ab 100644 --- a/documentation/topics/working-with-phoenix.md +++ b/documentation/topics/working-with-phoenix.md @@ -4,6 +4,8 @@ The AshPhoenix plugin adds lots of helpers for working with Phoenix Liveview (an `{:ash_phoenix, "~> 1.2.18"}` +Check out the [getting started with phoenix guide](/documentation/tutorials/getting-started-with-ash-and-phoenix.md) for setup. + ## Whats in the box? - `AshPhoenix.Form` - A form data structure for using resource actions with phoenix forms @@ -12,4 +14,4 @@ The AshPhoenix plugin adds lots of helpers for working with Phoenix Liveview (an - `AshPhoenix.LiveView` - Helpers for querying data and integrating changes - `AshPhoenix.SubdomainPlug` - A plug to determine a tenant using subdomains for multitenancy - `AshPhoenix.FormData.Error` - A protocol to allow errors to be rendered in forms -- `Phoenix.HTML.Safe` implementations for `Ash.CiString` and `Ash.NotLoaded` \ No newline at end of file +- `Phoenix.HTML.Safe` implementations for `Ash.CiString` and `Ash.NotLoaded` diff --git a/mix.exs b/mix.exs index 62410d8..0f1f8fb 100644 --- a/mix.exs +++ b/mix.exs @@ -62,8 +62,7 @@ defmodule AshPhoenix.MixProject do path |> Path.basename(".md") |> String.split(~r/[-_]/) - |> Enum.map(&String.capitalize/1) - |> Enum.join(" ") + |> Enum.map_join(" ", &capitalize/1) |> case do "F A Q" -> "FAQ" @@ -79,6 +78,15 @@ defmodule AshPhoenix.MixProject do end) end + defp capitalize(string) do + string + |> String.split(" ") + |> Enum.map(fn string -> + [hd | tail] = String.graphemes(string) + String.capitalize(hd) <> Enum.join(tail) + end) + end + defp groups_for_extras do [ Tutorials: [ @@ -98,13 +106,19 @@ defmodule AshPhoenix.MixProject do groups_for_extras: groups_for_extras(), groups_for_modules: [ "Phoenix Helpers": [ + AshPhoenix.LiveView, + AshPhoenix.SubdomainPlug + ], + Forms: [ AshPhoenix.Form, AshPhoenix.Form.Auto, + AshPhoenix.Form.WrappedValue, + AshPhoenix.FormData.Error + ], + FilterForm: [ AshPhoenix.FilterForm, AshPhoenix.FilterForm.Predicate, - AshPhoenix.LiveView, - AshPhoenix.FormData.Error, - AshPhoenix.SubdomainPlug + AshPhoenix.FilterForm.Arguments ], Errors: [ AshPhoenix.Form.InvalidPath,