chore: update ex_doc and clean up docs

This commit is contained in:
Zach Daniel 2024-01-12 16:53:31 -05:00
parent 2e4de0d45b
commit 74f308510c
4 changed files with 62 additions and 208 deletions

View file

@ -1,149 +0,0 @@
<!--
This file was generated by Spark. Do not edit it by hand.
-->
# DSL: AshCsv.DataLayer
The data layer implementation for AshCsv
## csv
### Examples
```
csv do
file "priv/data/tags.csv"
create? true
header? true
separator '-'
columns [:id, :name]
end
```
### 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="csv-file" href="#csv-file">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
file
</span>
</a>
<sup style="color: red">*</sup>
</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 file to read the data from
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="csv-create?" href="#csv-create?">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
create?
</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 the file should be created if it does not exist (this will only happen on writes)
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="csv-header?" href="#csv-header?">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
header?
</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>
If the csv file has a header that should be skipped
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="csv-separator" href="#csv-separator">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
separator
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">`any`</code>
</td>
<td style="text-align: left">
<code class="inline">44</code>
</td>
<td style="text-align: left" colspan=2>
The separator to use, defaults to a comma. Pass in a character (not a string).
</td>
</tr>
<tr>
<td style="text-align: left">
<a id="csv-columns" href="#csv-columns">
<span style="font-family: Inconsolata, Menlo, Courier, monospace;">
columns
</span>
</a>
</td>
<td style="text-align: left">
<code class="inline">`any`</code>
</td>
<td style="text-align: left">
</td>
<td style="text-align: left" colspan=2>
The order that the attributes appear in the columns of the CSV
</td>
</tr>
</tbody>
</table>

View file

@ -0,0 +1,45 @@
<!--
This file was generated by Spark. Do not edit it by hand.
-->
# DSL: AshCsv.DataLayer
The data layer implementation for AshCsv
## csv
### Examples
```
csv do
file "priv/data/tags.csv"
create? true
header? true
separator '-'
columns [:id, :name]
end
```
### Options
| Name | Type | Default | Docs |
|------|------|---------|------|
| [`file`](#csv-file){: #csv-file .spark-required} | `String.t` | | The file to read the data from |
| [`create?`](#csv-create?){: #csv-create? } | `boolean` | `false` | Whether or not the file should be created if it does not exist (this will only happen on writes) |
| [`header?`](#csv-header?){: #csv-header? } | `boolean` | `false` | If the csv file has a header that should be skipped |
| [`separator`](#csv-separator){: #csv-separator } | `any` | `44` | The separator to use, defaults to a comma. Pass in a character (not a string). |
| [`columns`](#csv-columns){: #csv-columns } | `any` | | The order that the attributes appear in the columns of the CSV |
<style type="text/css">.spark-required::after { content: "*"; color: red !important; }</style>

68
mix.exs
View file

@ -29,50 +29,6 @@ defmodule AshCsv.MixProject do
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
defp extras() do
"documentation/**/*.{md,cheatmd,livemd}"
|> Path.wildcard()
|> Enum.map(fn path ->
title =
path
|> Path.basename(".md")
|> Path.basename(".livemd")
|> Path.basename(".cheatmd")
|> String.split(~r/[-_]/)
|> Enum.map_join(" ", &capitalize/1)
|> case do
"F A Q" ->
"FAQ"
other ->
other
end
{String.to_atom(path),
[
title: title
]}
end)
end
defp capitalize(string) do
string
|> String.split(" ")
|> Enum.map(fn string ->
[hd | tail] = String.graphemes(string)
String.capitalize(hd) <> Enum.join(tail)
end)
end
defp groups_for_extras() do
[
Tutorials: ~r'documentation/tutorials',
"How To": ~r'documentation/how_to',
Topics: ~r'documentation/topics',
DSLs: ~r'documentation/dsls'
]
end
defp docs do
[
main: "get-started-with-csv",
@ -92,19 +48,21 @@ defmodule AshCsv.MixProject do
"""
end
end,
spark: [
extensions: [
%{
module: AshCsv.DataLayer,
name: "AshCsv",
target: "Ash.Resource",
type: "DataLayer"
}
]
extras: [
"documentation/tutorials/get-started-with-csv.md",
"documentation/dsls/DSL:-AshCsv.DataLayer.md"
],
groups_for_extras: [
Tutorials: ~r'documentation/tutorials',
"How To": ~r'documentation/how_to',
Topics: ~r'documentation/topics',
DSLs: ~r'documentation/dsls'
],
extras: extras(),
groups_for_extras: groups_for_extras(),
groups_for_modules: [
AshCsv: [
AshCsv,
AshCsv.DataLayer
],
Introspection: [
AshCsv.DataLayer.Info
],

View file

@ -7,7 +7,7 @@
"csv": {:hex, :csv, "2.4.1", "50e32749953b6bf9818dbfed81cf1190e38cdf24f95891303108087486c5925e", [:mix], [{:parallel_stream, "~> 1.0.4", [hex: :parallel_stream, repo: "hexpm", optional: false]}], "hexpm", "54508938ac67e27966b10ef49606e3ad5995d665d7fc2688efb3eab1307c9079"},
"decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},
"dialyxir": {:hex, :dialyxir, "1.0.0", "6a1fa629f7881a9f5aaf3a78f094b2a51a0357c843871b8bc98824e7342d00a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "aeb06588145fac14ca08d8061a142d52753dbc2cf7f0d00fc1013f53f8654654"},
"earmark_parser": {:hex, :earmark_parser, "1.4.36", "487ea8ef9bdc659f085e6e654f3c3feea1d36ac3943edf9d2ef6c98de9174c13", [:mix], [], "hexpm", "a524e395634bdcf60a616efe77fd79561bec2e930d8b82745df06ab4e844400a"},
"earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"},
"ecto": {:hex, :ecto, "3.10.3", "eb2ae2eecd210b4eb8bece1217b297ad4ff824b4384c0e3fdd28aaf96edd6135", [: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", "44bec74e2364d491d70f7e42cd0d690922659d329f6465e89feb8a34e8cd3433"},
"elixir_make": {:hex, :elixir_make, "0.7.7", "7128c60c2476019ed978210c245badf08b03dbec4f24d05790ef791da11aa17c", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}], "hexpm", "5bc19fff950fad52bbe5f211b12db9ec82c6b34a9647da0c2224b8b8464c7e6c"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
@ -26,14 +26,14 @@
"makeup_erlang": {:hex, :makeup_erlang, "0.1.2", "ad87296a092a46e03b7e9b0be7631ddcf64c790fa68a9ef5323b6cbb36affc72", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f3f5a1ca93ce6e092d92b6d9c049bcda58a3b617a8d888f8e7231c85630e8108"},
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
"nimble_options": {:hex, :nimble_options, "1.0.2", "92098a74df0072ff37d0c12ace58574d26880e522c22801437151a159392270e", [:mix], [], "hexpm", "fd12a8db2021036ce12a309f26f564ec367373265b53e25403f0ee697380f1b8"},
"nimble_options": {:hex, :nimble_options, "1.1.0", "3b31a57ede9cb1502071fade751ab0c7b8dbe75a9a4c2b5bbb0943a690b63172", [:mix], [], "hexpm", "8bbbb3941af3ca9acc7835f5655ea062111c9c27bcac53e004460dfd19008a99"},
"nimble_parsec": {:hex, :nimble_parsec, "0.6.0", "32111b3bf39137144abd7ba1cce0914533b2d16ef35e8abc5ec8be6122944263", [:mix], [], "hexpm", "27eac315a94909d4dc68bc07a4a83e06c8379237c5ea528a9acff4ca1c873c52"},
"parallel_stream": {:hex, :parallel_stream, "1.0.6", "b967be2b23f0f6787fab7ed681b4c45a215a81481fb62b01a5b750fa8f30f76c", [:mix], [], "hexpm", "639b2e8749e11b87b9eb42f2ad325d161c170b39b288ac8d04c4f31f8f0823eb"},
"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.10.4", "44ba642da120d84fedb9e85473375084034330c8f15a992351dd164a82963103", [:mix], [], "hexpm", "fea62a94a4112de45ee9c9d076fd636fbbc10b7c7c2ea99a928e7c289b8498d1"},
"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"},
"sourceror": {:hex, :sourceror, "0.14.1", "c6fb848d55bd34362880da671debc56e77fd722fa13b4dcbeac89a8998fc8b09", [:mix], [], "hexpm", "8b488a219e4c4d7d9ff29d16346fd4a5858085ccdd010e509101e226bbfd8efc"},
"spark": {:hex, :spark, "1.1.54", "54dac39403a2960f738ba5d60678d20b30de7381fb51b787b6bcb6aeabb73d9d", [: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", "abc9a67cfb60a97d2f3c7e270fa968a2ace94f389e2741d406239d237ec6dbb1"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"},
"stream_data": {:hex, :stream_data, "0.6.0", "e87a9a79d7ec23d10ff83eb025141ef4915eeb09d4491f79e52f2562b73e5f47", [:mix], [], "hexpm", "b92b5031b650ca480ced047578f1d57ea6dd563f5b57464ad274718c9c29501c"},
"telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"},