Skip to content

Commit eb3fbe9

Browse files
committed
fix warnings
1 parent 857e316 commit eb3fbe9

File tree

10 files changed

+7
-34
lines changed

10 files changed

+7
-34
lines changed

lib/ex_doc/doc_ast.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ defmodule ExDoc.DocAST do
118118
fun.(ast, result)
119119
end
120120

121-
def to_markdown_string({tag, _attrs, inner, %{verbatim: true}} = ast, fun) do
121+
def to_markdown_string({_tag, _attrs, inner, %{verbatim: true}} = ast, fun) do
122122
result = Enum.join(inner, "")
123123
fun.(ast, result)
124124
end
125125

126-
def to_markdown_string({tag, _attrs, inner, _meta} = ast, fun) do
126+
def to_markdown_string({_tag, _attrs, inner, _meta} = ast, fun) do
127127
result = to_string(inner, fun)
128128
fun.(ast, result)
129129
end

lib/ex_doc/formatter.ex

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
defmodule ExDoc.Formatter do
22
@moduledoc false
33

4-
alias __MODULE__.{Assets, Templates, SearchData}
54
alias ExDoc.{Markdown, GroupMatcher, Utils}
65

7-
@main "api-reference"
8-
@assets_dir "assets"
9-
106
@doc """
117
Autolinks and renders all docs.
128
"""
@@ -63,7 +59,7 @@ defmodule ExDoc.Formatter do
6359
|> Enum.map(&elem(&1, 1))
6460
end
6561

66-
defp render_doc(%{doc: nil} = node, ext, _language, _autolink_opts, _opts),
62+
defp render_doc(%{doc: nil} = node, _ext, _language, _autolink_opts, _opts),
6763
do: node
6864

6965
defp render_doc(%{doc: doc} = node, ext, language, autolink_opts, opts) do
@@ -83,7 +79,7 @@ defmodule ExDoc.Formatter do
8379
mod_id <> "." <> id
8480
end
8581

86-
defp autolink_and_render(doc, ".md", language, autolink_opts, opts) do
82+
defp autolink_and_render(doc, ".md", language, autolink_opts, _opts) do
8783
doc
8884
|> language.autolink_doc(autolink_opts)
8985
|> ExDoc.DocAST.to_markdown_string()

lib/ex_doc/formatter/html.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ defmodule ExDoc.Formatter.HTML do
22
@moduledoc false
33

44
alias __MODULE__.{Assets, Templates, SearchData}
5-
alias ExDoc.{Formatter, Markdown, GroupMatcher, Utils}
5+
alias ExDoc.{Formatter, Utils}
66

77
@main "api-reference"
88
@assets_dir "assets"

lib/ex_doc/formatter/markdown.ex

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,6 @@ defmodule ExDoc.Formatter.MARKDOWN do
9292

9393
## Helpers
9494

95-
defp files_to_add(path) do
96-
Enum.reduce(Path.wildcard(Path.join(path, "**/*")), [], fn file, acc ->
97-
case File.read(file) do
98-
{:ok, bin} ->
99-
[{file |> Path.relative_to(path) |> String.to_charlist(), bin} | acc]
100-
101-
{:error, _} ->
102-
acc
103-
end
104-
end)
105-
end
106-
10795
defp generate_module_page(module_node, config) do
10896
content =
10997
Templates.module_page(config, module_node)

lib/ex_doc/formatter/markdown/templates.ex

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,9 @@ defmodule ExDoc.Formatter.MARKDOWN.Templates do
8585
|> elem(0)
8686
end
8787

88-
@class_regex ~r/<h[23].*?(\sclass="(?<class>[^"]+)")?.*?>/
89-
@class_separator " "
9088
defp link_heading(match, _tag, _title, "", _prefix), do: match
9189

92-
defp link_heading(match, tag, title, id, prefix) do
93-
section_header_class_name = "section-heading"
94-
90+
defp link_heading(_match, _tag, title, id, prefix) do
9591
# The Markdown syntax that we support for the admonition text
9692
# blocks is something like this:
9793
#

lib/ex_doc/formatter/markdown/templates/module_template.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<%= for {name, nodes} <- summary, do: summary_template(name, nodes) %>
1414
<% end %>
1515

16-
<%= for {name, nodes} <- summary, key = text_to_id(name) do %>
16+
<%= for {name, nodes} <- summary, _key = text_to_id(name) do %>
1717
## <%=h to_string(name) %>
1818
<%= for node <- nodes, do: detail_template(node, module) %>
1919
<% end %>

test/ex_doc/formatter/epub/templates_test.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
defmodule ExDoc.Formatter.EPUB.TemplatesTest do
22
use ExUnit.Case, async: true
33

4-
alias ExDoc.Formatter.HTML
54
alias ExDoc.Formatter.EPUB.Templates
65

76
defp source_url do

test/ex_doc/formatter/html/templates_test.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
defmodule ExDoc.Formatter.HTML.TemplatesTest do
22
use ExUnit.Case, async: true
33

4-
alias ExDoc.Formatter.HTML
54
alias ExDoc.Formatter.HTML.Templates
65

76
@moduletag :tmp_dir

test/ex_doc/formatter/markdown/templates_test.exs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
defmodule ExDoc.Formatter.MARKDOWN.TemplatesTest do
22
use ExUnit.Case, async: true
33

4-
alias ExDoc.Formatter.HTML
54
alias ExDoc.Formatter.MARKDOWN.Templates
65

76
defp source_url do

test/ex_doc/formatter/markdown_test.exs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
defmodule ExDoc.Formatter.MARKDOWNTest do
22
use ExUnit.Case, async: false
33

4-
import ExUnit.CaptureIO
5-
6-
alias ExDoc.Utils
7-
84
@moduletag :tmp_dir
95

106
@before_closing_body_tag_content_md "UNIQUE:<dont-escape>&copy;BEFORE-CLOSING-BODY-TAG-HTML</dont-escape>"

0 commit comments

Comments
 (0)