Skip to content

Commit d44545d

Browse files
garazdawiclaude
andcommitted
Include man formatter in default formatters list
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 449525d commit d44545d

5 files changed

Lines changed: 22 additions & 33 deletions

File tree

lib/ex_doc.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ defmodule ExDoc do
101101
against the complete module name (which includes the "Elixir." prefix for
102102
Elixir modules). If a module has `@moduledoc false`, then it is always excluded.
103103
104-
* `:formatters` - Formatter to use; default: ["html", "markdown", "epub"], options: "html", "markdown", "epub".
104+
* `:formatters` - Formatter to use; default: ["html", "markdown", "man", "epub"], options: "html", "markdown", "man", "epub".
105105
106106
* `:man` - Controls which modules get man pages. `:all` (default) generates for all modules,
107107
`:tasks` generates only for mix tasks (section 1), `false` skips module man pages entirely.

lib/ex_doc/cli.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ defmodule ExDoc.CLI do
111111
defp normalize_formatters(opts) do
112112
formatters =
113113
case Keyword.get_values(opts, :formatter) do
114-
[] -> opts[:formatters] || ["html", "markdown", "epub"]
114+
[] -> opts[:formatters] || ["html", "markdown", "man", "epub"]
115115
values -> values
116116
end
117117

lib/mix/tasks/docs.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ defmodule Mix.Tasks.Docs do
195195
defp normalize_formatters(options) do
196196
formatters =
197197
case Keyword.get_values(options, :formatter) do
198-
[] -> options[:formatters] || ["html", "markdown", "epub"]
198+
[] -> options[:formatters] || ["html", "markdown", "man", "epub"]
199199
values -> values
200200
end
201201

test/ex_doc/cli_test.exs

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,19 @@ defmodule ExDoc.CLITest do
2424
end
2525

2626
test "minimum command-line options" do
27-
{[html, epub, markdown], _io} = run(["ExDoc", "1.2.3", @ebin])
28-
29-
assert html ==
30-
{"ExDoc", "1.2.3", [@ebin],
31-
[
32-
formatters: ["html", "markdown", "epub"],
33-
apps: [:ex_doc]
34-
]}
35-
36-
assert epub ==
37-
{"ExDoc", "1.2.3", [@ebin],
38-
[
39-
formatters: ["html", "markdown", "epub"],
40-
apps: [:ex_doc]
41-
]}
42-
43-
assert markdown ==
44-
{"ExDoc", "1.2.3", [@ebin],
45-
[
46-
formatters: ["html", "markdown", "epub"],
47-
apps: [:ex_doc]
48-
]}
27+
{[html, epub, man, markdown], _io} = run(["ExDoc", "1.2.3", @ebin])
28+
29+
expected_config =
30+
{"ExDoc", "1.2.3", [@ebin],
31+
[
32+
formatters: ["html", "markdown", "man", "epub"],
33+
apps: [:ex_doc]
34+
]}
35+
36+
assert html == expected_config
37+
assert epub == expected_config
38+
assert man == expected_config
39+
assert markdown == expected_config
4940
end
5041

5142
test "formatter option" do
@@ -79,13 +70,11 @@ defmodule ExDoc.CLITest do
7970
end
8071

8172
test "multiple apps" do
82-
{[{"ExDoc", "1.2.3", _, html}, {"ExDoc", "1.2.3", _, epub}, {"ExDoc", "1.2.3", _, markdown}],
83-
_io} =
84-
run(["ExDoc", "1.2.3", @ebin, @ebin2])
73+
{results, _io} = run(["ExDoc", "1.2.3", @ebin, @ebin2])
8574

86-
assert [:ex_doc, :makeup] = Enum.sort(Keyword.get(html, :apps))
87-
assert [:ex_doc, :makeup] = Enum.sort(Keyword.get(epub, :apps))
88-
assert [:ex_doc, :makeup] = Enum.sort(Keyword.get(markdown, :apps))
75+
for {"ExDoc", "1.2.3", _, opts} <- results do
76+
assert [:ex_doc, :makeup] = Enum.sort(Keyword.get(opts, :apps))
77+
end
8978
end
9079

9180
test "arguments that are not aliased" do

test/mix/tasks/docs_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ defmodule Mix.Tasks.DocsTest do
3939
assert [
4040
{"ex_doc", "0.1.0", _,
4141
[
42-
formatters: ["html", "markdown", "epub"],
42+
formatters: ["html", "markdown", "man", "epub"],
4343
deps: _,
4444
apps: _,
4545
proglang: :elixir
@@ -250,7 +250,7 @@ defmodule Mix.Tasks.DocsTest do
250250
assert [
251251
{"ex_doc", "dev", _,
252252
[
253-
formatters: ["html", "markdown", "epub"],
253+
formatters: ["html", "markdown", "man", "epub"],
254254
deps: _,
255255
apps: [:ex_doc],
256256
warnings_as_errors: false,

0 commit comments

Comments
 (0)