feat: unified watch server under org-garden

This commit is contained in:
Ignacio Ballesteros
2026-02-21 00:36:31 +01:00
parent 1076bf31ed
commit a4582230b5
21 changed files with 679 additions and 296 deletions

View File

@@ -0,0 +1,18 @@
defmodule OrgGarden.Resolvers.DOI do
@moduledoc """
Last-resort citation resolver — always succeeds.
If the citation key looks like a DOI (starts with "10."), returns a
`https://doi.org/...` link. Otherwise returns the key itself as a
plain label with no URL.
"""
@spec resolve(String.t()) :: {:ok, map()}
def resolve(key) do
if String.starts_with?(key, "10.") do
{:ok, %{label: key, url: "https://doi.org/#{key}"}}
else
{:ok, %{label: key, url: nil}}
end
end
end