docs: Sorting for hex documentation added (#810)

This commit is contained in:
Chakib Ouhajjou 2023-12-27 10:22:59 -05:00 committed by GitHub
parent 26160e446b
commit c7738255f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 16 additions and 9 deletions

View file

@ -16,7 +16,7 @@ if Mix.env() == :dev do
manage_mix_version?: true,
# Instructs the tool to manage the version in your README.md
# Pass in `true` to use `"README.md"` or a string to customize
manage_readme_version: ["README.md", "documentation/tutorials/get-started.md"],
manage_readme_version: ["README.md", "documentation/tutorials/1-get-started.md"],
version_tag_prefix: "v"
end

View file

@ -57,7 +57,7 @@ See `Ash.Changeset` for more information.
A packaged bundle of code that can be included in a resource to provide additional functionality. Built-in functionality such as the resource DSL itself is provided by an extension, and libraries like AshPostgres and AshAdmin also provide extensions that you can add to your resources with just one line of code.
See [Extending Resources](/documentation/tutorials/extending-resources.md) for more information.
See [Extending Resources](/documentation/tutorials/4-extending-resources.md) for more information.
## Filter

View file

@ -4,7 +4,7 @@
> #### HexDocs {: .tip}
>
> Hexdocs does not support multi-package search. To assist with this, we provide a mirror of this documentation at [ash-hq.org](https://ash-hq.org). Use Ctrl+K or Cmd+K to search all packages on that site. For the best way to use the hex documentation, see the [hexdocs guide](/documentation/tutorials/using-hexdocs.md).
> Hexdocs does not support multi-package search. To assist with this, we provide a mirror of this documentation at [ash-hq.org](https://ash-hq.org). Use Ctrl+K or Cmd+K to search all packages on that site. For the best way to use the hex documentation, see the [hexdocs guide](/documentation/tutorials/5-using-hexdocs.md).
<!--- ash-hq-hide-stop --> <!--- -->
@ -31,8 +31,8 @@ In this guide we will:
## Things you may want to read first
- [Install Elixir](https://elixir-lang.org/install.html)
- [Philosophy Guide](/documentation/tutorials/philosophy.md)
- [Using Hexdocs](/documentation/tutorials/using-hexdocs.md)
- [Philosophy Guide](/documentation/tutorials/2-philosophy.md)
- [Using Hexdocs](/documentation/tutorials/5-using-hexdocs.md)
## Requirements

15
mix.exs
View file

@ -35,14 +35,20 @@ defmodule Ash.MixProject do
end
defp extras do
# Sorting can be done adding numbers at the begining of filenames
"documentation/**/*.{md,livemd,cheatmd}"
|> Path.wildcard()
|> Enum.map(fn path ->
title =
html_filename =
path
|> Path.basename(".md")
|> Path.basename(".livemd")
|> Path.basename(".cheatmd")
# We want to keep permalinks, so we remove the sorting number
|> String.replace(~r/^\d+\-/, "")
title =
html_filename
|> String.split(~r/[-_]/)
|> Enum.map_join(" ", &capitalize/1)
|> case do
@ -55,6 +61,7 @@ defmodule Ash.MixProject do
{String.to_atom(path),
[
filename: html_filename,
title: title,
default: title == "Get Started"
]}
@ -73,9 +80,9 @@ defmodule Ash.MixProject do
defp groups_for_extras do
[
Tutorials: [
"documentation/tutorials/get-started.md",
"documentation/tutorials/philosophy.md",
"documentation/tutorials/why-ash.md",
"documentation/tutorials/1-get-started.md",
"documentation/tutorials/2-philosophy.md",
"documentation/tutorials/3-why-ash.md",
~r'documentation/tutorials'
],
"How To": ~r'documentation/how_to',