Skip to content

Commit

Permalink
chore: strip leading digits
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Dec 27, 2023
1 parent 8225de1 commit 844f1ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 1 addition & 6 deletions lib/ash_hq/docs/resources/library/actions/import.ex
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ defmodule AshHq.Docs.Library.Actions.Import do
) do
AshHq.SqliteRepo.transaction(
fn ->
delete_except(
AshHq.Docs.load!(library, :latest_version_id).latest_version_id,
library.id
)

library_version =
AshHq.Docs.LibraryVersion.build!(
library.id,
Expand Down Expand Up @@ -112,7 +107,7 @@ defmodule AshHq.Docs.Library.Actions.Import do
|> Ash.Query.data_layer_query()
|> case do
{:ok, query} ->
AshHq.Repo.delete_all(query)
AshHq.SqliteRepo.delete_all(query)

other ->
raise "bad match #{inspect(other)}"
Expand Down
2 changes: 2 additions & 0 deletions priv/scripts/build_dsl_docs.exs
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,8 @@ defmodule Utils do
title =
file
|> Path.basename(".md")
# We want to keep permalinks, so we remove the sorting number
|> String.replace(~r/^\d+\-/, "")
|> String.split(~r/[-_]/)
|> Enum.map(&String.capitalize/1)
|> Enum.join(" ")
Expand Down

0 comments on commit 844f1ce

Please sign in to comment.