Skip to content

Commit 6224691

Browse files
committed
Renaming
1 parent 81b55ed commit 6224691

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

lib/ex_doc/formatter/epub/templates/extra_template.eex

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<%= head_template(config, node.title) %>
2-
<h1 id="content">
3-
<%=h node.title_content %>
4-
</h1>
2+
<h1 id="content"><%= ExDoc.DocAST.to_string(node.title_doc) %></h1>
53
<%= render_doc(node.doc) %>
64
<%= before_closing_body_tag(config, :epub) %>
75
</body>

lib/ex_doc/formatter/html.ex

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -424,16 +424,13 @@ defmodule ExDoc.Formatter.HTML do
424424
"file extension not recognized, allowed extension is either .cheatmd, .livemd, .md, .txt or no extension"
425425
end
426426

427-
{title_ast, ast} =
427+
{title_doc, title_text, ast} =
428428
case ExDoc.DocAST.extract_title(ast) do
429-
{:ok, title_ast, ast} -> {title_ast, ast}
430-
:error -> {nil, ast}
429+
{:ok, title_doc, ast} -> {title_doc, ExDoc.DocAST.text(title_doc), ast}
430+
:error -> {nil, nil, ast}
431431
end
432432

433-
title_text = title_ast && ExDoc.DocAST.text(title_ast)
434-
title_html = title_ast && ExDoc.DocAST.to_string(title_ast)
435433
title = input_options[:title] || title_text || filename_to_title(input)
436-
437434
group = GroupMatcher.match_extra(groups, input)
438435
source_path = source_file |> Path.relative_to(File.cwd!()) |> String.replace_leading("./", "")
439436
source_url = source_url_pattern.(source_path, 1)
@@ -449,7 +446,7 @@ defmodule ExDoc.Formatter.HTML do
449446
source_url: source_url,
450447
search_data: search_data,
451448
title: title,
452-
title_content: title_html || title
449+
title_doc: title_doc || title
453450
}
454451
end
455452

lib/ex_doc/formatter/html/templates/extra_template.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<div id="top-content">
55
<div class="heading-with-actions top-heading">
6-
<h1><%= node.title_content %></h1>
6+
<h1><%= ExDoc.DocAST.to_string(node.title_doc) %></h1>
77
<%= if node.type == :cheatmd do %>
88
<button onclick="window.print()" title="Print Cheatsheet" class="icon-action" rel="print">
99
<i class="ri-printer-line" aria-hidden="true"></i>

0 commit comments

Comments
 (0)