docs: work on docs + link structure

This commit is contained in:
Zach Daniel 2022-06-05 13:05:10 -04:00
parent ae65d09373
commit 74a1a6c97c
5 changed files with 59 additions and 62 deletions

View file

View file

@ -1,2 +0,0 @@
# Overview

View file

@ -78,57 +78,62 @@ defmodule Ash.DocIndex.AshDocIndex do
end
@impl true
@spec code_modules :: %{String.t() => list(module)}
@spec code_modules :: [{String.t(), list(module)}]
def code_modules do
%{
"Resources" => [
Ash.Api,
Ash.Resource.Info,
Ash.Resource.Change,
Ash.Resource.Change.Builtins,
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" => [
Ash.Dsl.Entity,
Ash.Dsl.Extension,
Ash.Dsl.Section,
ASh.Dsl.Transformer
]
}
[
{"Resources",
[
Ash.Api,
Ash.Resource.Info,
Ash.Resource.Change,
Ash.Resource.Change.Builtins,
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",
[
Ash.Dsl.Entity,
Ash.Dsl.Extension,
Ash.Dsl.Section,
ASh.Dsl.Transformer
]}
]
end
end

View file

@ -21,7 +21,7 @@ defmodule Ash.DocIndex do
@callback extensions() :: list(extension())
@callback for_library() :: String.t()
@callback guides() :: list(guide())
@callback code_modules() :: %{String.t() => list(module())}
@callback code_modules() :: [{String.t(), list(module())}]
defmacro __using__(opts) do
quote bind_quoted: [guides_from: opts[:guides_from]] do

View file

@ -2,15 +2,9 @@ defmodule Ash.Resource.Dsl do
@attribute %Ash.Dsl.Entity{
name: :attribute,
describe: """
Declares an attribute on the resource
Declares an attribute on the resource.
For more information, see `{{link:ash:guide: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]`
For more information, see {{link:ash:guide:topics/attributes.md}}
""",
examples: [
"""