First pass at uniformed types, specs and docs

- spec public functions (skipping controllers, views, live views and
components)
- use types instead of explanations in docs
- remove redundant docs
- fix typos
This commit is contained in:
Claudio Ortolina
2026-03-06 08:33:11 +00:00
parent 99e30d5fdf
commit 7cf9b4e7f8
81 changed files with 652 additions and 300 deletions
+2
View File
@@ -12,6 +12,7 @@ defmodule MusicLibraryWeb.Markdown do
Double square brackets are converted to search links before the markdown is processed.
"""
@spec to_html(String.t() | nil) :: String.t()
def to_html(markdown_text) when is_binary(markdown_text) do
markdown_text
|> process_double_bracket_links()
@@ -41,6 +42,7 @@ defmodule MusicLibraryWeb.Markdown do
iex> MusicLibraryWeb.Markdown.process_double_bracket_links(~s|[[genre:"psychedelic rock"]]|)
~s|[psychedelic rock](/collection?query=genre%3A%22psychedelic+rock%22)|
"""
@spec process_double_bracket_links(String.t()) :: String.t()
def process_double_bracket_links(text) do
~r/\[\[([^\]]+)\]\]/
|> Regex.replace(text, fn _match, content ->