Skip to content

Commit 6db9cab

Browse files
authored
Fix docs: Move source_url to project (#2172)
1 parent e7abbae commit 6db9cab

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

lib/mix/tasks/docs.ex

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ defmodule Mix.Tasks.Docs do
187187
188188
* `:source_beam` - Path to the beam directory; default: mix's compile path.
189189
190+
* `:source_url` - The source URL fallback if `:source_url` is not given at the project
191+
configuration. See the following sections.
192+
190193
* `:source_ref` - The branch/commit/tag used for source link inference;
191194
default: "main".
192195
@@ -228,7 +231,7 @@ defmodule Mix.Tasks.Docs do
228231
both of them will allow ExDoc to link to specific version of the code for a function or module
229232
that matches the version of the docs. So if the docs have been generated for version 1.0.5 then
230233
clicking on the source link in the docs will take the browser to the source code for the 1.0.5
231-
version of the code instead of only the primary ref (e.g. `main`).
234+
version of the code instead of only the primary ref (for example, `main`).
232235
233236
A example setup looks like:
234237
@@ -237,16 +240,16 @@ defmodule Mix.Tasks.Docs do
237240
[
238241
...
239242
version: @version,
240-
docs: docs(),
241-
...
243+
source_url: "https://github.com/USER/PROJECT",
244+
docs: &docs/0
242245
]
243246
end
244247
245248
def docs do
246-
...
247-
source_ref: "v#{@version}",
248-
source_url: @source_url,
249-
...
249+
[
250+
...
251+
source_ref: "v#{@version}"
252+
]
250253
end
251254
252255
If you use `source_ref: "v#{@version}"` then when publishing a new version of your package you

0 commit comments

Comments
 (0)