Skip to content

Commit 6bc1088

Browse files
author
Peter Minten
committed
Fix not working links in overview
1 parent ed9ad6d commit 6bc1088

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

lib/ex_doc/html_formatter/templates/overview_entry_template.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<tr>
2-
<td class="summary_signature"><a href="#<%=h node.id %>"><%=h node.id %></a></td>
2+
<td class="summary_signature"><a href="<%=h node.id %>.html"><%=h node.id %></a></td>
33
<%= if node.moduledoc do %>
44
<td class="summary_synopsis"><%= to_html(synopsis(node.moduledoc)) %></td>
55
<% end %>

test/ex_doc/html_formatter/templates_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ defmodule ExDoc.HTMLFormatter.TemplatesTest do
135135
content = Templates.list_item_template(node)
136136
assert content =~ %r/<a class="toggle">/
137137
end
138-
138+
139139
## MODULES
140140

141141
test "module_page generates only the module name when there's no more info" do

test/ex_doc/html_formatter_test.exs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,14 @@ defmodule ExDoc.HTMLFormatterTest do
6565
content = File.read!("#{output_dir}/protocols_list.html")
6666
assert content =~ %r{<li>.*"CustomProtocol\.html".*CustomProtocol.*<\/li>}ms
6767
end
68+
69+
test "run generates the overview file" do
70+
HTMLFormatter.run(get_modules, doc_config)
71+
72+
assert File.regular?("#{output_dir}/overview.html")
73+
content = File.read!("#{output_dir}/overview.html")
74+
assert content =~ %r{<a href="CompiledWithDocs.html">CompiledWithDocs</a>}
75+
assert content =~ %r{<p>moduledoc</p>}
76+
assert content =~ %r{<a href="CompiledWithDocs.Nested.html">CompiledWithDocs.Nested</a>}
77+
end
6878
end

0 commit comments

Comments
 (0)