@@ -8,13 +8,15 @@ defmodule Mix.Tasks.Docs do
8
8
9
9
## Command line options
10
10
11
- * `--output`, `-o` - Output directory for the generated
12
- docs, default: `"doc"`
13
- * `--formatter`, `-f` - Which formatters to use, "html" or
14
- "epub", default: "html" (may be given more than once)
15
11
* `--canonical`, `-n` - Indicate the preferred URL with
16
12
rel="canonical" link element, defaults to no canonical path
17
13
14
+ * `--formatter`, `-f` - Which formatters to use, "html" or
15
+ "epub", default: "html" (may be given more than once)
16
+
17
+ * `--output`, `-o` - Output directory for the generated
18
+ docs, default: `"doc"`
19
+
18
20
The command line options have higher precedence than the options
19
21
specified in your `mix.exs` file below.
20
22
@@ -45,53 +47,53 @@ defmodule Mix.Tasks.Docs do
45
47
be a keyword list or a function returning a keyword list that will
46
48
be lazily executed.
47
49
48
- * `:output` - Output directory for the generated docs; default: "doc".
49
- May be overridden by command line argument.
50
-
51
- * `:formatters` - Formatter to use; default: ["html"],
52
- options: "html", "epub".
50
+ * `:assets` - Path to a directory that will be copied as is to the "assets"
51
+ directory in the output path. Its entries may be referenced in your docs
52
+ under "assets/ASSET.EXTENSION"; defaults to no assets directory.
53
53
54
- * `:source_root ` - Path to the source code root directory;
55
- default: "." (current directory) .
54
+ * `:canonical ` - String that defines the preferred URL with the rel="canonical"
55
+ element; defaults to no canonical path .
56
56
57
- * `:source_beam` - Path to the beam directory; default: mix's compile path.
57
+ * `:deps` - A keyword list application names and their documentation URL.
58
+ ExDoc will by default include all dependencies and assume they are hosted on
59
+ HexDocs. This can be overridden by your own values. Example: `[plug: "https://myserver/plug/"]`
58
60
59
- * `:source_ref ` - The branch/commit/tag used for source link inference;
60
- default: "master".
61
+ * `:extra_section ` - String that defines the section title of the additional
62
+ Markdown pages; default: "PAGES". Example: "GUIDES"
61
63
62
- * `:source_url_pattern` - Public URL of the project. Derived from
63
- project's `:source_url` and `:source_ref`. Example:
64
- "https://github.com/USER/APP/blob/master/%{path}#L%{line}"
64
+ * `:extras` - List of keywords, each key must indicate the path to additional
65
+ Markdown pages, the value for each keyword (optional) gives you more control
66
+ about the PATH and the title of the output files; default: `[]`. Example:
67
+ `["README.md", "CONTRIBUTING.md": [filename: "contributing", title: "Contributing", group: "Join us!"]]`
65
68
66
- * `:main ` - Main page of the documentation. It may be a module or a
67
- generated page, like "Plug" or "api-reference"; default : "api-reference".
69
+ * `:filter_prefix ` - Include only modules that match the given prefix in
70
+ the generated documentation. Example : "MyApp.Core"
68
71
69
- * `:assets` - Path to a directory that will be copied as is to the "assets"
70
- directory in the output path. Its entries may be referenced in your docs
71
- under "assets/ASSET.EXTENSION"; defaults to no assets directory.
72
+ * `:formatters` - Formatter to use; default: ["html"],
73
+ options: "html", "epub".
72
74
73
75
* `:logo` - Path to the image logo of the project (only PNG or JPEG accepted)
74
76
The image size will be 64x64. When specified, the logo will be placed under
75
77
the "assets" directory in the output path under the name "logo" and the
76
78
appropriate extension.
77
79
78
- * `:extras` - List of keywords, each key must indicate the path to additional
79
- Markdown pages, the value for each keyword (optional) gives you more control
80
- about the PATH and the title of the output files; default: `[]`. Example:
81
- `["README.md", "CONTRIBUTING.md": [filename: "contributing", title: "Contributing", group: "Join us!"]]`
80
+ * `:main` - Main page of the documentation. It may be a module or a
81
+ generated page, like "Plug" or "api-reference"; default: "api-reference".
82
82
83
- * `:extra_section` - String that defines the section title of the additional
84
- Markdown pages; default: "PAGES". Example: "GUIDES"
83
+ * `:source_beam` - Path to the beam directory; default: mix's compile path.
85
84
86
- * `:deps` - A keyword list application names and their documentation URL.
87
- ExDoc will by default include all dependencies and assume they are hosted on
88
- HexDocs. This can be overridden by your own values. Example: `[plug: "https://myserver/plug/"]`
85
+ * `:source_ref` - The branch/commit/tag used for source link inference;
86
+ default: "master".
89
87
90
- * `:canonical ` - String that defines the preferred URL with the rel="canonical"
91
- element; defaults to no canonical path .
88
+ * `:source_root ` - Path to the source code root directory;
89
+ default: "." (current directory) .
92
90
93
- * `:filter_prefix` - Include only modules that match the given prefix in
94
- the generated documentation. Example: "MyApp.Core"
91
+ * `:source_url_pattern` - Public URL of the project. Derived from
92
+ project's `:source_url` and `:source_ref`. Example:
93
+ "https://github.com/USER/APP/blob/master/%{path}#L%{line}"
94
+
95
+ * `:output` - Output directory for the generated docs; default: "doc".
96
+ May be overridden by command line argument.
95
97
96
98
## Umbrella project
97
99
@@ -109,8 +111,8 @@ defmodule Mix.Tasks.Docs do
109
111
Mix.Task . run "compile"
110
112
111
113
{ cli_opts , args , _ } = OptionParser . parse ( args ,
112
- aliases: [ o : :output , n : :canonical , f : :formatter ] ,
113
- switches: [ output : :string , canonical : :string , formatter : :keep ] )
114
+ aliases: [ n : :canonical , f : :formatter , o : :output ] ,
115
+ switches: [ canonical : :string , formatter : :keep , output : :string ] )
114
116
115
117
if args != [ ] do
116
118
Mix . raise "Extraneous arguments on the command line"
0 commit comments