Skip to content

Commit

Permalink
fully document :source_url_pattern (#1086)
Browse files Browse the repository at this point in the history
  • Loading branch information
aseigo authored and José Valim committed Aug 29, 2019
1 parent 9714940 commit f45866c
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions lib/mix/tasks/docs.ex
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,26 @@ defmodule Mix.Tasks.Docs do
* `:source_ref` - The branch/commit/tag used for source link inference;
default: "master".
* `:source_url_pattern` - Public URL of the project. Derived from
project's `:source_url` and `:source_ref`. Example:
"https://github.com/USER/APP/blob/master/%{path}#L%{line}"
* `:source_url_pattern` - Public URL of the project for source links. This is derived
automatically from the project's `:source_url` and `:source_ref` when using one of
the supported public hosting services (currently GitHub, GitLab, or Bitbucket). If
you are using one of those services with their default public hostname, you do not
need to set this configuration.
However, if using a different solution, or self-hosting, you will need to set this
configuration variable to a pattern for source code links. The value must be a string
of the full URI to use for links with the following variables available for interpolation:
* `%{path}`: the path of a file in the repo
* `%{line}`: the line number in the file
For GitLab/GitHub:
https://mydomain.org/user_or_team/repo_name/blob/master/%{path}#L%{line}"
For Bitbucket:
https://mydomain.org/user_or_team/repo_name/src/master/%{path}#cl-%{line}
* `:output` - Output directory for the generated docs; default: "doc".
May be overridden by command line argument.
Expand Down

0 comments on commit f45866c

Please sign in to comment.