diff --git a/lib/ash_hq_web/helpers.ex b/lib/ash_hq_web/helpers.ex index 9121192..305723e 100644 --- a/lib/ash_hq_web/helpers.ex +++ b/lib/ash_hq_web/helpers.ex @@ -28,4 +28,8 @@ defmodule AshHqWeb.Helpers do "https://github.com/#{library.repo_org}/#{library.name}/tree/v#{library_version.version}/#{file}" end end + + def source_link(%AshHq.Docs.Guide{route: route}, library, library_version) do + "https://github.com/#{library.repo_org}/#{library.name}/tree/v#{library_version.version}/documentation/#{route}.md" + end end diff --git a/lib/ash_hq_web/pages/docs.ex b/lib/ash_hq_web/pages/docs.ex index e5edddf..e824293 100644 --- a/lib/ash_hq_web/pages/docs.ex +++ b/lib/ash_hq_web/pages/docs.ex @@ -112,6 +112,12 @@ defmodule AshHqWeb.Pages.Docs do library_version={@library_version} /> {/if} + <.github_guide_link + :if={@guide} + guide={@guide} + library={@library} + library_version={@library_version} + /> <.docs doc_path={@doc_path} docs={@docs} /> {#if @extension && !@dsl && !@guide} {#case Enum.count_until(Stream.filter(@extension.dsls, &(&1.type == :section)), 2)} @@ -307,6 +313,26 @@ defmodule AshHqWeb.Pages.Docs do """ end + def github_guide_link(assigns) do + ~F""" + + """ + end + def docs(assigns) do ~F"""