Skip to content

Commit

Permalink
remove helper
Browse files Browse the repository at this point in the history
  • Loading branch information
milmazz committed Jan 24, 2024
1 parent f74a8bd commit e402d4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 0 additions & 6 deletions lib/ex_doc/formatter/epub/templates.ex
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,6 @@ defmodule ExDoc.Formatter.EPUB.Templates do
trim: true
)

defp get_node_info(nodes, mod_name) do
module_name = mod_name |> to_string() |> String.replace("Elixir.", "")

Map.fetch!(nodes, module_name)
end

EEx.function_from_file(
:defp,
:toc_item_template,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
<li><span><%= h to_string(title) %></span>
<ol>
<% end %>
<%= for module_name <- modules do %>
<% node = get_node_info(nodes, module_name) %>
<%= for node <- Enum.map(modules, fn module ->
module = module |> to_string() |> String.replace("Elixir.", "")
Map.fetch!(nodes, module)
end) do %>
<li><a href="<%= URI.encode node.id %>.xhtml"><%=h node.title %></a></li>
<% end %>
<%= if title do %>
Expand Down

0 comments on commit e402d4d

Please sign in to comment.