docs: update spark & ex_doc for better docs

This commit is contained in:
Zach Daniel 2023-09-26 23:29:50 -04:00
parent 6b087db923
commit fe8cfcb26c
3 changed files with 202 additions and 21 deletions

View file

@ -1,3 +1,6 @@
<!--
This file was generated by Spark. Do not edit it by hand.
-->
# DSL: AshStateMachine
Provides tools for defining and working with resource-backed state machines.
@ -15,13 +18,122 @@ Provides tools for defining and working with resource-backed state machines.
### Options
| Name | Type | Default | Docs |
| --- | --- | --- | --- |
| `initial_states`* | `list(atom)` | | The allowed starting states of this state machine. |
| `deprecated_states` | `list(atom)` | [] | A list of states that have been deprecated but are still valid. These will still be in the possible list of states, but `:*` will not include them. |
| `extra_states` | `list(atom)` | [] | A list of states that may be used by transitions to/from `:*`. See the docs on wildcards for more. |
| `state_attribute` | `atom` | :state | The attribute to store the state in. |
| `default_initial_state` | `atom` | | The default initial state |
<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="state_machine-initial_states" href="#state_machine-initial_states">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
initial_states
</span>
</a>
<sup style="color: red">*</sup>
</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 allowed starting states of this state machine.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="state_machine-deprecated_states" href="#state_machine-deprecated_states">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
deprecated_states
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">list(atom)</code>
</td>
<td style="text-align: left">
<code class="inline">[]</code>
</td>
<td style="text-align: left" colspan=2>
A list of states that have been deprecated but are still valid. These will still be in the possible list of states, but `:*` will not include them.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="state_machine-extra_states" href="#state_machine-extra_states">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
extra_states
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">list(atom)</code>
</td>
<td style="text-align: left">
<code class="inline">[]</code>
</td>
<td style="text-align: left" colspan=2>
A list of states that may be used by transitions to/from `:*`. See the docs on wildcards for more.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="state_machine-state_attribute" href="#state_machine-state_attribute">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
state_attribute
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">atom</code>
</td>
<td style="text-align: left">
<code class="inline">:state</code>
</td>
<td style="text-align: left" colspan=2>
The attribute to store the state in.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="state_machine-default_initial_state" href="#state_machine-default_initial_state">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
default_initial_state
</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 default initial state
</td>
</tr>
</tbody>
</table>
## state_machine.transitions
@ -60,15 +172,84 @@ transition action
### Arguments
| Name | Type | Default | Docs |
| --- | --- | --- | --- |
| `action`* | `atom` | | The corresponding action that is invoked for the transition. Use `:*` to allow any update action to perform this transition. |
### Options
| Name | Type | Default | Docs |
| --- | --- | --- | --- |
| `from`* | `list(atom) \| atom` | | The states in which this action may be called. If not specified, then any state is accepted. Use `:*` to refer to all states. |
| `to`* | `list(atom) \| atom` | | The states that this action may move to. If not specified, then any state is accepted. Use `:*` to refer to all states. |
<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="action-action" href="#action-action">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
action
</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 corresponding action that is invoked for the transition. Use `:*` to allow any update action to perform this transition.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="action-from" href="#action-from">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
from
</span>
</a>
<sup style="color: red">*</sup>
</td>
<td style="text-align: left">
<code class="inline">list(atom) | atom</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
The states in which this action may be called. If not specified, then any state is accepted. Use `:*` to refer to all states.
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="action-to" href="#action-to">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
to
</span>
</a>
<sup style="color: red">*</sup>
</td>
<td style="text-align: left">
<code class="inline">list(atom) | atom</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
The states that this action may move to. If not specified, then any state is accepted. Use `:*` to refer to all states.
</td>
</tr>
</tbody>
</table>

View file

@ -150,7 +150,7 @@ defmodule AshStateMachine.MixProject do
[
{:ash, "~> 2.7"},
{:spark, ">= 1.1.22"},
{:ex_doc, "~> 0.22", only: [:dev, :test], runtime: false},
{:ex_doc, github: "elixir-lang/ex_doc", only: [:dev, :test], runtime: false},
{:ex_check, "~> 0.12.0", only: [:dev, :test]},
{:credo, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:dialyxir, ">= 0.0.0", only: [:dev, :test], runtime: false},
@ -167,7 +167,7 @@ defmodule AshStateMachine.MixProject do
docs: [
"spark.cheat_sheets",
"docs",
"ash.replace_doc_links",
"spark.replace_doc_links",
"spark.cheat_sheets_in_search"
],
"spark.formatter": "spark.formatter --extensions AshStateMachine",

View file

@ -6,13 +6,13 @@
"credo": {:hex, :credo, "1.7.0", "6119bee47272e85995598ee04f2ebbed3e947678dee048d10b5feca139435f75", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "6839fcf63d1f0d1c0f450abc8564a57c43d644077ab96f2934563e68b8a769d7"},
"decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},
"dialyxir": {:hex, :dialyxir, "1.3.0", "fd1672f0922b7648ff9ce7b1b26fcf0ef56dda964a459892ad15f6b4410b5284", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "00b2a4bcd6aa8db9dcb0b38c1225b7277dca9bc370b6438715667071a304696f"},
"earmark_parser": {:hex, :earmark_parser, "1.4.35", "437773ca9384edf69830e26e9e7b2e0d22d2596c4a6b17094a3b29f01ea65bb8", [:mix], [], "hexpm", "8652ba3cb85608d0d7aa2d21b45c6fad4ddc9a1f9a1f1b30ca3a246f0acc33f6"},
"earmark_parser": {:hex, :earmark_parser, "1.4.36", "487ea8ef9bdc659f085e6e654f3c3feea1d36ac3943edf9d2ef6c98de9174c13", [:mix], [], "hexpm", "a524e395634bdcf60a616efe77fd79561bec2e930d8b82745df06ab4e844400a"},
"ecto": {:hex, :ecto, "3.10.1", "c6757101880e90acc6125b095853176a02da8f1afe056f91f1f90b80c9389822", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d2ac4255f1601bdf7ac74c0ed971102c6829dc158719b94bd30041bbad77f87a"},
"elixir_make": {:hex, :elixir_make, "0.7.6", "67716309dc5d43e16b5abbd00c01b8df6a0c2ab54a8f595468035a50189f9169", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}], "hexpm", "5a0569756b0f7873a77687800c164cca6dfc03a09418e6fcf853d78991f49940"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"ets": {:hex, :ets, "0.8.1", "8ff9bcda5682b98493f8878fc9dbd990e48d566cba8cce59f7c2a78130da29ea", [:mix], [], "hexpm", "6be41b50adb5bc5c43626f25ea2d0af1f4a242fb3fad8d53f0c67c20b78915cc"},
"ex_check": {:hex, :ex_check, "0.12.0", "c0e2919ecc06afeaf62c52d64f3d91bd4bc7dd8deaac5f84becb6278888c967a", [:mix], [], "hexpm", "cfafa8ef97c2596d45a1f19b5794cb5c7f700f25d164d3c9f8d7ec17ee67cf42"},
"ex_doc": {:hex, :ex_doc, "0.30.6", "5f8b54854b240a2b55c9734c4b1d0dd7bdd41f71a095d42a70445c03cf05a281", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "bd48f2ddacf4e482c727f9293d9498e0881597eae6ddc3d9562bd7923375109f"},
"ex_doc": {:git, "https://github.com/elixir-lang/ex_doc.git", "16a8f536d1a0868293a30d63bcff6510bf023de3", []},
"excoveralls": {:hex, :excoveralls, "0.13.4", "7b0baee01fe150ef81153e6ffc0fc68214737f54570dc257b3ca4da8e419b812", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "faae00b3eee35cdf0342c10b669a7c91f942728217d2a7c7f644b24d391e6190"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"git_cli": {:hex, :git_cli, "0.3.0", "a5422f9b95c99483385b976f5d43f7e8233283a47cda13533d7c16131cb14df5", [:mix], [], "hexpm", "78cb952f4c86a41f4d3511f1d3ecb28edb268e3a7df278de2faa1bd4672eaf9b"},
@ -30,8 +30,8 @@
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
"picosat_elixir": {:hex, :picosat_elixir, "0.2.3", "bf326d0f179fbb3b706bb2c15fbc367dacfa2517157d090fdfc32edae004c597", [:make, :mix], [{:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "f76c9db2dec9d2561ffaa9be35f65403d53e984e8cd99c832383b7ab78c16c66"},
"sobelow": {:hex, :sobelow, "0.12.2", "45f4d500e09f95fdb5a7b94c2838d6b26625828751d9f1127174055a78542cf5", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "2f0b617dce551db651145662b84c8da4f158e7abe049a76daaaae2282df01c5d"},
"sourceror": {:hex, :sourceror, "0.13.0", "c6ecc96ee3ae0e042e9082a9550a1989ea40182492dc29024a8d9d2b136e5014", [:mix], [], "hexpm", "d0a819491061cd26bfa4450d1c84301a410c19c1782a6577ce15853fc0e7e4e1"},
"spark": {:hex, :spark, "1.1.36", "a4cc1168fe94c24c90fbb3521921c4d3f9ec86642f84adc6da5ae62426189edd", [:mix], [{:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.5 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:sourceror, "~> 0.1", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "ce03b3167f85fdc4416c9c5cee4aac4cc0ca8715d115631b68669be5e2e890f7"},
"sourceror": {:hex, :sourceror, "0.14.0", "b6b8552d0240400d66b6f107c1bab7ac1726e998efc797f178b7b517e928e314", [:mix], [], "hexpm", "809c71270ad48092d40bbe251a133e49ae229433ce103f762a2373b7a10a8d8b"},
"spark": {:hex, :spark, "1.1.40", "b61438fece40eb0ffed7c4c9e5f1c2c817209902ed853b0008b7681b1994c29c", [:mix], [{:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.5 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:sourceror, "~> 0.1", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "40d0f803f1090249ef6a76cb2bf40466c57f4995326dc97996e0b8b4f365ad17"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"},
"stream_data": {:hex, :stream_data, "0.5.0", "b27641e58941685c75b353577dc602c9d2c12292dd84babf506c2033cd97893e", [:mix], [], "hexpm", "012bd2eec069ada4db3411f9115ccafa38540a3c78c4c0349f151fc761b9e271"},
"telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"},