Skip to content

Commit 1c911cd

Browse files
committed
📝 docs: Fix "local" links and let them point to GitHub
1 parent 631200f commit 1c911cd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/ex_union/docs.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
defmodule ExUnion.Docs do
22
@moduledoc false
33

4+
@repo "https://github.com/sascha-wolf/ex_union/blob/main"
45
def massage_readme(path, for: module) do
56
path
67
|> File.read!()
@@ -23,6 +24,8 @@ defmodule ExUnion.Docs do
2324
|> String.replace(~r/\(#([^\)]+)\)/, "(#module-\\1)")
2425
# Adjust the code links to work on hexdocs.pm
2526
|> String.replace(~r/\[(.+?)\]\[code:.+?\]/, "\\1")
27+
# Adjust GitHub local links to work on hexdocs.pm
28+
|> String.replace(~r|\(./(.*?)\)|, "(#{@repo}/\\1)")
2629
# Replace TODO-style boxes from list items
2730
|> String.replace("- [ ]", "- ◻")
2831
|> String.replace("- [x]", "- ✔")

0 commit comments

Comments
 (0)