Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show programming language in HTML footer #1560

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/ex_doc/formatter/html/templates/footer_template.eex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
<p>
Built using
<a href="https://github.com/elixir-lang/ex_doc" title="ExDoc" target="_blank" rel="help noopener" translate="no">ExDoc</a> (v<%= ExDoc.version() %>) for the
<a href="https://elixir-lang.org" title="Elixir" target="_blank" translate="no">Elixir programming language</a>
<%= if config.proglang == :erlang do %>
<a href="https://erlang.org" title="Erlang" target="_blank" translate="no">Erlang programming language</a>
<% else %>
<a href="https://elixir-lang.org" title="Elixir" target="_blank" translate="no">Elixir programming language</a>
<% end %>
</p>
</footer>
</div>
Expand Down
15 changes: 15 additions & 0 deletions test/ex_doc/formatter/html/templates_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,21 @@ defmodule ExDoc.Formatter.HTML.TemplatesTest do
refute content =~ ~r{<li><a id="tasks-list-link" href="#full-list">Mix Tasks</a></li>}
end

test "display built with footer by proglang option" do
content = Templates.footer_template(doc_config(proglang: :erlang), nil)

assert content =~
~r{<a href="https://erlang.org" title="Erlang" target="_blank" translate="no">Erlang programming language</a>}

content = Templates.footer_template(doc_config(proglang: :elixir), nil)

assert content =~
~r{<a href="https://elixir-lang.org" title="Elixir" target="_blank" translate="no">Elixir programming language</a>}

assert Templates.footer_template(doc_config(proglang: :elixir), nil) ==
Templates.footer_template(doc_config(), nil)
end

test "outputs listing for the given nodes" do
names = [CompiledWithDocs, CompiledWithDocs.Nested]
nodes = ExDoc.Retriever.docs_from_modules(names, doc_config())
Expand Down