chore: docs

This commit is contained in:
Zach Daniel 2024-02-04 10:42:01 -05:00
parent a25b3b787a
commit 62417088e3
5 changed files with 121 additions and 543 deletions

View file

@ -1,116 +0,0 @@
<!--
This file was generated by Spark. Do not edit it by hand.
-->
# DSL: AshAdmin.Api
An API extension to alter the behavior of an API in the admin UI.
## admin
Configure the admin dashboard for a given API.
### Options
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th colspan=2>Docs</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left">
<a id="admin-name" href="#admin-name">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
name
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">String.t</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
The name of the API in the dashboard. Will be derived if not set.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="admin-show?" href="#admin-show?">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
show?
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">boolean</code>
</td>
<td style="text-align: left">
<code class="inline">false</code>
</td>
<td style="text-align: left" colspan=2>
Whether or not this API and its resources should be included in the admin dashboard.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="admin-default_resource_page" href="#admin-default_resource_page">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
default_resource_page
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">:schema | :primary_read</code>
</td>
<td style="text-align: left">
<code class="inline">:schema</code>
</td>
<td style="text-align: left" colspan=2>
Set the default page for the resource to be the primary read action or the resource schema. Schema is the default for backwards compatibility, if a resource doesn't have a primary read action it will fallback to the schema view.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="admin-resource_group_labels" href="#admin-resource_group_labels">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
resource_group_labels
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">Keyword.t</code>
</td>
<td style="text-align: left">
<code class="inline">[]</code>
</td>
<td style="text-align: left" colspan=2>
Humanized names for each resource group to appear in the admin area. These will be used as labels in the top navigation dropdown. If a key for a group does not appear in this mapping, the label will not be rendered.
</td>
</tr>
</tbody>
</table>

View file

@ -0,0 +1,32 @@
<!--
This file was generated by Spark. Do not edit it by hand.
-->
# DSL: AshAdmin.Api
An API extension to alter the behavior of an API in the admin UI.
## admin
Configure the admin dashboard for a given API.
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`name`](#admin-name){: #admin-name } | `String.t` | | The name of the API in the dashboard. Will be derived if not set. |
| [`show?`](#admin-show?){: #admin-show? } | `boolean` | `false` | Whether or not this API and its resources should be included in the admin dashboard. |
| [`default_resource_page`](#admin-default_resource_page){: #admin-default_resource_page } | `:schema \| :primary_read` | `:schema` | Set the default page for the resource to be the primary read action or the resource schema. Schema is the default for backwards compatibility, if a resource doesn't have a primary read action it will fallback to the schema view. |
| [`resource_group_labels`](#admin-resource_group_labels){: #admin-resource_group_labels } | `keyword` | `[]` | Humanized names for each resource group to appear in the admin area. These will be used as labels in the top navigation dropdown. If a key for a group does not appear in this mapping, the label will not be rendered. |
<style type="text/css">.spark-required::after { content: "*"; color: red !important; }</style>

View file

@ -1,425 +0,0 @@
<!--
This file was generated by Spark. Do not edit it by hand.
-->
# DSL: AshAdmin.Resource
An API extension to alter the behaviour of a resource in the admin UI.
## admin
Configure the admin dashboard for a given resource.
### Nested DSLs
* [form](#admin-form)
* field
### Options
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th colspan=2>Docs</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left">
<a id="admin-name" href="#admin-name">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
name
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">String.t</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
The proper name to use when this resource appears in the admin interface.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="admin-actor?" href="#admin-actor?">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
actor?
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">boolean</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
Whether or not this resource can be used as the actor for requests.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="admin-show_action" href="#admin-show_action">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
show_action
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">atom</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
The action to use when linking to the resource/viewing a single record. Defaults to the primary read action.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="admin-read_actions" href="#admin-read_actions">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
read_actions
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">list(atom)</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
A list of read actions that can be used to show resource details. By default, all actions are included.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="admin-create_actions" href="#admin-create_actions">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
create_actions
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">list(atom)</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
A list of create actions that can create records. By default, all actions are included.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="admin-update_actions" href="#admin-update_actions">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
update_actions
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">list(atom)</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
A list of update actions that can be used to update records. By default, all actions are included.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="admin-destroy_actions" href="#admin-destroy_actions">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
destroy_actions
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">list(atom)</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
A list of destroy actions that can be used to destroy records. By default, all actions are included.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="admin-polymorphic_tables" href="#admin-polymorphic_tables">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
polymorphic_tables
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">list(String.t)</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
For resources that use ash_postgres' polymorphism capabilities, you can provide a list of tables that should be available to
select. These will be added to the list of derivable tables based on scanning all APIs and resources provided to ash_admin.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="admin-polymorphic_actions" href="#admin-polymorphic_actions">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
polymorphic_actions
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">list(atom)</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
For resources that use ash_postgres' polymorphism capabilities, you can provide a list of actions that should require a table to be set.
If this is not set, then *all* actions will require tables.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="admin-table_columns" href="#admin-table_columns">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
table_columns
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">list(atom)</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
The list of attributes to render on the table view.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="admin-format_fields" href="#admin-format_fields">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
format_fields
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">list(`any`)</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
The list of fields and their formats.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="admin-relationship_display_fields" href="#admin-relationship_display_fields">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
relationship_display_fields
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">list(atom)</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
The list of attributes to render when it's shown as a relationship on a datatable
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="admin-resource_group" href="#admin-resource_group">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
resource_group
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">atom</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
The group in the top resource dropdown that the resource appears in.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="admin-show_sensitive_fields" href="#admin-show_sensitive_fields">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
show_sensitive_fields
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">list(atom)</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
The list of fields that should not be redacted in the admin UI even if they are marked as sensitive.
</td>
</tr>
</tbody>
</table>
## admin.form
Configure the appearance of fields in admin forms.
### Nested DSLs
* [field](#admin-form-field)
## admin.form.field
```elixir
field name
```
Declare non-default behavior for a specific attribute.
### Arguments
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th colspan=2>Docs</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left">
<a id="admin-form-field-name" href="#admin-form-field-name">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
name
</span>
</a>
<sup style="color: red">*</sup>
</td>
<td style="text-align: left">
<code class="inline">atom</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
The name of the field to be modified
</td>
</tr>
</tbody>
</table>
### Options
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th colspan=2>Docs</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left">
<a id="admin-form-field-type" href="#admin-form-field-type">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
type
</span>
</a>
<sup style="color: red">*</sup>
</td>
<td style="text-align: left">
<code class="inline">:default | :long_text | :short_text | :markdown</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
The type of the value in the form. Use `default` if you are just specifying field order
</td>
</tr>
</tbody>
</table>
### Introspection
Target: `AshAdmin.Resource.Field`

View file

@ -0,0 +1,87 @@
<!--
This file was generated by Spark. Do not edit it by hand.
-->
# DSL: AshAdmin.Resource
An API extension to alter the behaviour of a resource in the admin UI.
## admin
Configure the admin dashboard for a given resource.
### Nested DSLs
* [form](#admin-form)
* field
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`name`](#admin-name){: #admin-name } | `String.t` | | The proper name to use when this resource appears in the admin interface. |
| [`actor?`](#admin-actor?){: #admin-actor? } | `boolean` | | Whether or not this resource can be used as the actor for requests. |
| [`show_action`](#admin-show_action){: #admin-show_action } | `atom` | | The action to use when linking to the resource/viewing a single record. Defaults to the primary read action. |
| [`read_actions`](#admin-read_actions){: #admin-read_actions } | `list(atom)` | | A list of read actions that can be used to show resource details. By default, all actions are included. |
| [`create_actions`](#admin-create_actions){: #admin-create_actions } | `list(atom)` | | A list of create actions that can create records. By default, all actions are included. |
| [`update_actions`](#admin-update_actions){: #admin-update_actions } | `list(atom)` | | A list of update actions that can be used to update records. By default, all actions are included. |
| [`destroy_actions`](#admin-destroy_actions){: #admin-destroy_actions } | `list(atom)` | | A list of destroy actions that can be used to destroy records. By default, all actions are included. |
| [`polymorphic_tables`](#admin-polymorphic_tables){: #admin-polymorphic_tables } | `list(String.t)` | | For resources that use ash_postgres' polymorphism capabilities, you can provide a list of tables that should be available to select. These will be added to the list of derivable tables based on scanning all APIs and resources provided to ash_admin. |
| [`polymorphic_actions`](#admin-polymorphic_actions){: #admin-polymorphic_actions } | `list(atom)` | | For resources that use ash_postgres' polymorphism capabilities, you can provide a list of actions that should require a table to be set. If this is not set, then *all* actions will require tables. |
| [`table_columns`](#admin-table_columns){: #admin-table_columns } | `list(atom)` | | The list of attributes to render on the table view. |
| [`format_fields`](#admin-format_fields){: #admin-format_fields } | `list(any)` | | The list of fields and their formats. |
| [`relationship_display_fields`](#admin-relationship_display_fields){: #admin-relationship_display_fields } | `list(atom)` | | The list of attributes to render when it's shown as a relationship on a datatable |
| [`resource_group`](#admin-resource_group){: #admin-resource_group } | `atom` | | The group in the top resource dropdown that the resource appears in. |
| [`show_sensitive_fields`](#admin-show_sensitive_fields){: #admin-show_sensitive_fields } | `list(atom)` | | The list of fields that should not be redacted in the admin UI even if they are marked as sensitive. |
## admin.form
Configure the appearance of fields in admin forms.
### Nested DSLs
* [field](#admin-form-field)
## admin.form.field
```elixir
field name
```
Declare non-default behavior for a specific attribute.
### Arguments
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`name`](#admin-form-field-name){: #admin-form-field-name .spark-required} | `atom` | | The name of the field to be modified |
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`type`](#admin-form-field-type){: #admin-form-field-type .spark-required} | `:default \| :long_text \| :short_text \| :markdown` | | The type of the value in the form. Use `default` if you are just specifying field order |
### Introspection
Target: `AshAdmin.Resource.Field`
<style type="text/css">.spark-required::after { content: "*"; color: red !important; }</style>

View file

@ -61,8 +61,8 @@ defmodule AshAdmin.MixProject do
logo: "logos/small-logo.png", logo: "logos/small-logo.png",
extras: [ extras: [
"README.md", "README.md",
"documentation/dsls/DSL:-AshAdmin.Api.cheatmd", "documentation/dsls/DSL:-AshAdmin.Api.md",
"documentation/dsls/DSL:-AshAdmin.Resource.cheatmd" "documentation/dsls/DSL:-AshAdmin.Resource.md"
], ],
groups_for_extras: [ groups_for_extras: [
Tutorials: ~r'documentation/tutorials', Tutorials: ~r'documentation/tutorials',