mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 05:23:03 +12:00
docs: work on docs + link structure
This commit is contained in:
parent
ae65d09373
commit
74a1a6c97c
5 changed files with 59 additions and 62 deletions
0
documentation/topics/attributes.md
Normal file
0
documentation/topics/attributes.md
Normal file
|
@ -1,2 +0,0 @@
|
||||||
# Overview
|
|
||||||
|
|
|
@ -78,57 +78,62 @@ defmodule Ash.DocIndex.AshDocIndex do
|
||||||
end
|
end
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
@spec code_modules :: %{String.t() => list(module)}
|
@spec code_modules :: [{String.t(), list(module)}]
|
||||||
def code_modules do
|
def code_modules do
|
||||||
%{
|
[
|
||||||
"Resources" => [
|
{"Resources",
|
||||||
Ash.Api,
|
[
|
||||||
Ash.Resource.Info,
|
Ash.Api,
|
||||||
Ash.Resource.Change,
|
Ash.Resource.Info,
|
||||||
Ash.Resource.Change.Builtins,
|
Ash.Resource.Change,
|
||||||
Ash.Calculation,
|
Ash.Resource.Change.Builtins,
|
||||||
Ash.Resource.Calculation.Builtins,
|
Ash.Calculation,
|
||||||
Ash.CodeInterface,
|
Ash.Resource.Calculation.Builtins,
|
||||||
Ash.Changeset,
|
Ash.CodeInterface,
|
||||||
Ash.Query
|
Ash.Changeset,
|
||||||
],
|
Ash.Query
|
||||||
"Utilities" => [
|
]},
|
||||||
Ash.Filter,
|
{"Utilities",
|
||||||
Ash.Sort
|
[
|
||||||
],
|
Ash.Filter,
|
||||||
"Errors" => [
|
Ash.Sort
|
||||||
Ash.Error
|
]},
|
||||||
],
|
{"Errors",
|
||||||
"Types" => [
|
[
|
||||||
Ash.Type,
|
Ash.Error
|
||||||
Ash.Type.Enum,
|
]},
|
||||||
Ash.Type.Atom,
|
{"Types",
|
||||||
Ash.Type.Binary,
|
[
|
||||||
Ash.Type.Boolean,
|
Ash.Type,
|
||||||
Ash.Type.CiString,
|
Ash.Type.Enum,
|
||||||
Ash.CiString,
|
Ash.Type.Atom,
|
||||||
Ash.Type.Date,
|
Ash.Type.Binary,
|
||||||
Ash.Type.Decimal,
|
Ash.Type.Boolean,
|
||||||
Ash.Type.DurationName,
|
Ash.Type.CiString,
|
||||||
Ash.Type.Float,
|
Ash.CiString,
|
||||||
Ash.Type.Function,
|
Ash.Type.Date,
|
||||||
Ash.Type.Integer,
|
Ash.Type.Decimal,
|
||||||
Ash.Type.Map,
|
Ash.Type.DurationName,
|
||||||
Ash.Type.NaiveDatetime,
|
Ash.Type.Float,
|
||||||
Ash.Type.String,
|
Ash.Type.Function,
|
||||||
Ash.Type.Term,
|
Ash.Type.Integer,
|
||||||
Ash.Type.Time,
|
Ash.Type.Map,
|
||||||
Ash.Type.UUID,
|
Ash.Type.NaiveDatetime,
|
||||||
Ash.Type.UrlEncodedBinary,
|
Ash.Type.String,
|
||||||
Ash.Type.UtcDatetime,
|
Ash.Type.Term,
|
||||||
Ash.Type.UtcDatetimeUsec
|
Ash.Type.Time,
|
||||||
],
|
Ash.Type.UUID,
|
||||||
"DSLs and Extensions" => [
|
Ash.Type.UrlEncodedBinary,
|
||||||
Ash.Dsl.Entity,
|
Ash.Type.UtcDatetime,
|
||||||
Ash.Dsl.Extension,
|
Ash.Type.UtcDatetimeUsec
|
||||||
Ash.Dsl.Section,
|
]},
|
||||||
ASh.Dsl.Transformer
|
{"DSLs and Extensions",
|
||||||
]
|
[
|
||||||
}
|
Ash.Dsl.Entity,
|
||||||
|
Ash.Dsl.Extension,
|
||||||
|
Ash.Dsl.Section,
|
||||||
|
ASh.Dsl.Transformer
|
||||||
|
]}
|
||||||
|
]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -21,7 +21,7 @@ defmodule Ash.DocIndex do
|
||||||
@callback extensions() :: list(extension())
|
@callback extensions() :: list(extension())
|
||||||
@callback for_library() :: String.t()
|
@callback for_library() :: String.t()
|
||||||
@callback guides() :: list(guide())
|
@callback guides() :: list(guide())
|
||||||
@callback code_modules() :: %{String.t() => list(module())}
|
@callback code_modules() :: [{String.t(), list(module())}]
|
||||||
|
|
||||||
defmacro __using__(opts) do
|
defmacro __using__(opts) do
|
||||||
quote bind_quoted: [guides_from: opts[:guides_from]] do
|
quote bind_quoted: [guides_from: opts[:guides_from]] do
|
||||||
|
|
|
@ -2,15 +2,9 @@ defmodule Ash.Resource.Dsl do
|
||||||
@attribute %Ash.Dsl.Entity{
|
@attribute %Ash.Dsl.Entity{
|
||||||
name: :attribute,
|
name: :attribute,
|
||||||
describe: """
|
describe: """
|
||||||
Declares an attribute on the resource
|
Declares an attribute on the resource.
|
||||||
|
|
||||||
For more information, see `{{link:ash:guide:attributes.md}}`
|
For more information, see {{link:ash:guide:topics/attributes.md}}
|
||||||
|
|
||||||
Type can be either a built in type (see `Ash.Type`) for more, or a module
|
|
||||||
implementing the `Ash.Type` behaviour.
|
|
||||||
|
|
||||||
*Strings are trimmed by default*. If you want to retain whitespace, use
|
|
||||||
`attribute :foo, :string, constraints: [trim?: false]`
|
|
||||||
""",
|
""",
|
||||||
examples: [
|
examples: [
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue