2022-08-15 06:06:58 +12:00
|
|
|
defmodule Ash.DocIndex do
|
2022-03-28 07:32:33 +13:00
|
|
|
@moduledoc """
|
|
|
|
Some documentation about Ash.
|
|
|
|
"""
|
2022-03-27 17:49:41 +13:00
|
|
|
|
2022-08-15 06:06:58 +12:00
|
|
|
use Spark.DocIndex,
|
2022-07-11 08:06:22 +12:00
|
|
|
otp_app: :ash,
|
2022-04-05 06:55:05 +12:00
|
|
|
guides_from: [
|
|
|
|
"documentation/**/*.md"
|
|
|
|
]
|
2022-03-25 15:25:14 +13:00
|
|
|
|
2022-03-25 15:29:18 +13:00
|
|
|
@impl true
|
|
|
|
@spec for_library() :: String.t()
|
|
|
|
def for_library, do: "ash"
|
2022-03-25 15:25:14 +13:00
|
|
|
|
2022-08-15 06:06:58 +12:00
|
|
|
@overview Spark.DocIndex.read!(:ash, "documentation/topics/overview.md")
|
2022-06-06 06:42:03 +12:00
|
|
|
|
|
|
|
@impl true
|
2022-06-06 06:28:51 +12:00
|
|
|
def guides do
|
|
|
|
guides = Enum.reject(super(), &(&1.name == "Overview"))
|
|
|
|
|
|
|
|
[
|
|
|
|
%{
|
|
|
|
name: "Overview",
|
|
|
|
category: "Topics",
|
2022-06-06 06:42:03 +12:00
|
|
|
text: @overview,
|
2022-06-06 07:06:01 +12:00
|
|
|
route: "topics/overview.md"
|
2022-06-06 06:28:51 +12:00
|
|
|
}
|
|
|
|
| guides
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
2022-07-15 03:41:20 +12:00
|
|
|
@impl true
|
|
|
|
def default_guide, do: "Overview"
|
|
|
|
|
2022-03-25 15:25:14 +13:00
|
|
|
@impl true
|
2022-08-15 06:06:58 +12:00
|
|
|
@spec extensions() :: list(Spark.DocIndex.extension())
|
2022-03-25 15:25:14 +13:00
|
|
|
def extensions do
|
|
|
|
[
|
|
|
|
%{
|
|
|
|
module: Ash.Resource.Dsl,
|
|
|
|
name: "Resource",
|
|
|
|
target: "Ash.Resource",
|
2022-03-26 09:08:51 +13:00
|
|
|
type: "Resource",
|
2022-03-25 15:25:14 +13:00
|
|
|
default_for_target?: true
|
|
|
|
},
|
|
|
|
%{
|
|
|
|
module: Ash.Api.Dsl,
|
|
|
|
name: "Api",
|
|
|
|
target: "Ash.Api",
|
2022-03-26 09:08:51 +13:00
|
|
|
type: "Api",
|
2022-03-25 15:25:14 +13:00
|
|
|
default_for_target?: true
|
|
|
|
},
|
|
|
|
%{
|
|
|
|
module: Ash.DataLayer.Ets,
|
|
|
|
name: "Ets",
|
|
|
|
target: "Ash.Resource",
|
|
|
|
type: "DataLayer"
|
|
|
|
},
|
|
|
|
%{
|
|
|
|
module: Ash.DataLayer.Mnesia,
|
|
|
|
name: "Mnesia",
|
|
|
|
target: "Ash.Resource",
|
|
|
|
type: "DataLayer"
|
|
|
|
},
|
2022-05-18 08:34:14 +12:00
|
|
|
%{
|
|
|
|
module: Ash.Policy.Authorizer,
|
|
|
|
name: "Policy Authorizer",
|
|
|
|
target: "Ash.Resource",
|
|
|
|
type: "Authorizer"
|
|
|
|
},
|
2022-03-25 15:25:14 +13:00
|
|
|
%{
|
|
|
|
module: Ash.Flow.Dsl,
|
|
|
|
name: "Flow",
|
|
|
|
target: "Ash.Flow",
|
2022-03-26 09:08:51 +13:00
|
|
|
type: "Flow",
|
2022-03-25 15:25:14 +13:00
|
|
|
default_for_target?: true
|
|
|
|
},
|
|
|
|
%{
|
|
|
|
module: Ash.Notifier.PubSub,
|
|
|
|
name: "PubSub",
|
|
|
|
target: "Ash.Resource",
|
|
|
|
type: "Notifier"
|
|
|
|
},
|
|
|
|
%{
|
2022-03-25 15:38:30 +13:00
|
|
|
module: Ash.Registry.Dsl,
|
2022-03-25 15:25:14 +13:00
|
|
|
name: "Registry",
|
|
|
|
target: "Ash.Registry",
|
2022-03-26 09:08:51 +13:00
|
|
|
type: "Registry",
|
2022-03-25 15:25:14 +13:00
|
|
|
default_for_target?: true
|
|
|
|
},
|
|
|
|
%{
|
|
|
|
module: Ash.Registry.ResourceValidations,
|
|
|
|
name: "Resource Validations",
|
2022-03-26 09:08:51 +13:00
|
|
|
type: "Extension",
|
2022-03-25 15:25:14 +13:00
|
|
|
target: "Ash.Registry"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
end
|
2022-03-28 06:08:27 +13:00
|
|
|
|
2022-03-30 13:43:11 +13:00
|
|
|
@impl true
|
2022-06-06 05:05:10 +12:00
|
|
|
@spec code_modules :: [{String.t(), list(module)}]
|
2022-03-31 04:37:44 +13:00
|
|
|
def code_modules do
|
2022-06-06 05:05:10 +12:00
|
|
|
[
|
|
|
|
{"Resources",
|
|
|
|
[
|
|
|
|
Ash.Api,
|
|
|
|
Ash.Resource.Info,
|
|
|
|
Ash.Resource.Change,
|
|
|
|
Ash.Resource.Change.Builtins,
|
2022-07-11 08:06:22 +12:00
|
|
|
Ash.Resource.Validation,
|
|
|
|
Ash.Resource.Validation.Builtins,
|
2022-07-11 15:39:57 +12:00
|
|
|
Ash.Resource.Preparation,
|
|
|
|
Ash.Resource.Preparation.Builtins,
|
|
|
|
Ash.Filter.TemplateHelpers,
|
2022-06-06 05:05:10 +12:00
|
|
|
Ash.Calculation,
|
|
|
|
Ash.Resource.Calculation.Builtins,
|
|
|
|
Ash.CodeInterface,
|
|
|
|
Ash.Changeset,
|
|
|
|
Ash.Query
|
|
|
|
]},
|
|
|
|
{"Utilities",
|
|
|
|
[
|
|
|
|
Ash.Filter,
|
|
|
|
Ash.Sort
|
|
|
|
]},
|
|
|
|
{"Errors",
|
|
|
|
[
|
|
|
|
Ash.Error
|
|
|
|
]},
|
|
|
|
{"Types",
|
|
|
|
[
|
|
|
|
Ash.Type,
|
|
|
|
Ash.Type.Enum,
|
|
|
|
Ash.Type.Atom,
|
|
|
|
Ash.Type.Binary,
|
|
|
|
Ash.Type.Boolean,
|
|
|
|
Ash.Type.CiString,
|
|
|
|
Ash.CiString,
|
|
|
|
Ash.Type.Date,
|
|
|
|
Ash.Type.Decimal,
|
|
|
|
Ash.Type.DurationName,
|
|
|
|
Ash.Type.Float,
|
|
|
|
Ash.Type.Function,
|
|
|
|
Ash.Type.Integer,
|
|
|
|
Ash.Type.Map,
|
|
|
|
Ash.Type.NaiveDatetime,
|
|
|
|
Ash.Type.String,
|
|
|
|
Ash.Type.Term,
|
|
|
|
Ash.Type.Time,
|
|
|
|
Ash.Type.UUID,
|
|
|
|
Ash.Type.UrlEncodedBinary,
|
|
|
|
Ash.Type.UtcDatetime,
|
|
|
|
Ash.Type.UtcDatetimeUsec
|
|
|
|
]},
|
|
|
|
{"DSLs and Extensions",
|
|
|
|
[
|
2022-08-15 06:06:58 +12:00
|
|
|
Spark.Dsl.Entity,
|
|
|
|
Spark.Dsl.Extension,
|
|
|
|
Spark.Dsl.Section,
|
|
|
|
Spark.Dsl.Transformer
|
2022-06-08 07:04:42 +12:00
|
|
|
]},
|
|
|
|
{"Documentation",
|
|
|
|
[
|
2022-08-15 06:06:58 +12:00
|
|
|
Spark.DocIndex
|
2022-06-06 05:05:10 +12:00
|
|
|
]}
|
|
|
|
]
|
2022-03-30 13:43:11 +13:00
|
|
|
end
|
2022-03-25 15:25:14 +13:00
|
|
|
end
|