From 1d3b26d1c78cecf37d76169d051731d262697151 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Thu, 18 Aug 2022 14:15:41 -0400 Subject: [PATCH] WIP on docs --- mix.exs | 121 ++++++++++++++++++++----------------------------------- mix.lock | 2 +- 2 files changed, 45 insertions(+), 78 deletions(-) diff --git a/mix.exs b/mix.exs index 17ef5fa0..407c34df 100644 --- a/mix.exs +++ b/mix.exs @@ -29,78 +29,55 @@ defmodule Ash.MixProject do ] end + defp extras() do + "priv/documentation/**/*.md" + |> Path.wildcard() + |> Enum.map(fn path -> + title = + path + |> Path.basename(".md") + |> String.split(~r/[-_]/) + |> Enum.map(&String.capitalize/1) + |> Enum.join(" ") + |> case do + "F A Q" -> + "FAQ" + + other -> + other + end + + {String.to_atom(path), + [ + title: title + ]} + end) + end + + defp groups_for_extras() do + "priv/documentation/*" + |> Path.wildcard() + |> Enum.map(fn folder -> + name = + folder + |> Path.basename() + |> String.split(~r/[-_]/) + |> Enum.map(&String.capitalize/1) + |> Enum.join(" ") + + {name, folder |> Path.join("**") |> Path.wildcard()} + end) + end + defp docs do # The main page in the docs [ - main: "readme", + main: "quick-start", source_ref: "v#{@version}", logo: "logos/small-logo.png", extra_section: "GUIDES", - extras: [ - "README.md": [], - "old_documentation/introduction/getting_started.md": [ - title: "Getting Started" - ], - "old_documentation/introduction/getting_started_phx.md": [ - title: "Getting Started With Phoenix" - ], - "old_documentation/topics/expressions.md": [ - title: "Expressions" - ], - "old_documentation/topics/managing_relationships.md": [ - title: "Managing Relationships" - ], - "old_documentation/topics/resources_without_a_data_layer.md": [ - title: "Resources without a Data Layer" - ], - "old_documentation/topics/authorization.md": [ - title: "Authorization" - ], - "old_documentation/topics/identities.md": [ - title: "Identities" - ], - "old_documentation/topics/pagination.md": [ - title: "Pagination" - ], - "old_documentation/topics/validation.md": [ - title: "Validation" - ], - "old_documentation/topics/notifiers.md": [ - title: "Notifiers" - ], - "old_documentation/topics/error_handling.md": [ - title: "Error Handling" - ], - "old_documentation/topics/aggregates.md": [ - title: "Aggregates" - ], - "old_documentation/topics/calculations.md": [ - title: "Calculations" - ], - "old_documentation/topics/embedded_resources.md": [ - title: "Embedded Resources" - ], - "old_documentation/topics/multitenancy.md": [ - title: "Multitenancy" - ], - "old_documentation/topics/compile_times.md": [ - title: "Compile Times" - ], - "priv/documentation/topics/policies.md": [ - title: "Policies" - ], - "priv/documentation/topics/overview.md": [ - title: "Overview" - ], - "priv/documentation/topics/development-utilities.md": [ - title: "Dev Utilities" - ] - ], - groups_for_extras: [ - Introduction: Path.wildcard("old_documentation/introduction/*.md"), - Topics: - Path.wildcard("old_documentation/topics/*") ++ Path.wildcard("documentation/topics/*") - ], + extras: extras(), + groups_for_extras: groups_for_extras(), groups_for_modules: [ entrypoint: [ Ash, @@ -133,15 +110,6 @@ defmodule Ash.MixProject do authorizer: ~r/Ash.Authorizer/, pagination: ~r/Ash.Page/, notifications: ~r/Ash.Notifier/, - extension: [ - Spark.Dsl.Entity, - Spark.Dsl.Extension, - Spark.Dsl.Section, - Spark.Dsl.Transformer - ], - "dsl tooling": [ - Spark.Dsl - ], "resource dsl transformers": ~r/Ash.Resource.Transformers/, "api dsl transformers": ~r/Ash.Api.Transformers/, "filter operators": ~r/Ash.Query.Operator/, @@ -174,8 +142,7 @@ defmodule Ash.MixProject do Ash.NotLoaded, Ash.Query.Aggregate, Ash.Query.Type, - Ash.SatSolver, - Spark.OptionsHelpers + Ash.SatSolver ], comparable: ~r/Comparable/ ] diff --git a/mix.lock b/mix.lock index b0987e13..bb7d13e6 100644 --- a/mix.lock +++ b/mix.lock @@ -36,7 +36,7 @@ "providers": {:hex, :providers, "1.8.1", "70b4197869514344a8a60e2b2a4ef41ca03def43cfb1712ecf076a0f3c62f083", [:rebar3], [{:getopt, "1.0.1", [hex: :getopt, repo: "hexpm", optional: false]}], "hexpm", "e45745ade9c476a9a469ea0840e418ab19360dc44f01a233304e118a44486ba0"}, "sobelow": {:hex, :sobelow, "0.11.1", "23438964486f8112b41e743bbfd402da3e5b296fdc9eacab29914b79c48916dd", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "9897363a7eff96f4809304a90aad819e2ad5e5d24db547af502885146746a53c"}, "sourceror": {:hex, :sourceror, "0.11.2", "549ce48be666421ac60cfb7f59c8752e0d393baa0b14d06271d3f6a8c1b027ab", [:mix], [], "hexpm", "9ab659118896a36be6eec68ff7b0674cba372fc8e210b1e9dc8cf2b55bb70dfb"}, - "spark": {:hex, :spark, "0.1.9", "1747d495d11d27986ed09933a9464039610dacb8bf419272f0ebd5e48ee4254b", [:mix], [{:libgraph, "~> 0.13.3", [hex: :libgraph, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:sourceror, "~> 0.1", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "5509769d9dbb4920b33da6ad5f38e877f8cbd32ff680f60addae30009476151d"}, + "spark": {:hex, :spark, "0.1.11", "7415e7775d4cc9ed898bf082e60cfa2bdebd71a690c09b5f92b6f8f05d6be992", [:mix], [{:libgraph, "~> 0.13.3", [hex: :libgraph, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:sourceror, "~> 0.1", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "1c4df53d53f952a8f6cb7876b6499032870f0eceb8ef55e48aa0b3bc61a5eba0"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"}, "stream_data": {:hex, :stream_data, "0.5.0", "b27641e58941685c75b353577dc602c9d2c12292dd84babf506c2033cd97893e", [:mix], [], "hexpm", "012bd2eec069ada4db3411f9115ccafa38540a3c78c4c0349f151fc761b9e271"}, "telemetry": {:hex, :telemetry, "1.1.0", "a589817034a27eab11144ad24d5c0f9fab1f58173274b1e9bae7074af9cbee51", [:rebar3], [], "hexpm", "b727b2a1f75614774cff2d7565b64d0dfa5bd52ba517f16543e6fc7efcc0df48"},