From 2767dac27e30456f88ffc1a809a13bad97ece900 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Sun, 24 Apr 2022 03:00:33 +0800 Subject: [PATCH 1/2] Show programming language in HTML footer --- .../formatter/html/templates/footer_template.eex | 6 +++++- test/ex_doc/formatter/html/templates_test.exs | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/ex_doc/formatter/html/templates/footer_template.eex b/lib/ex_doc/formatter/html/templates/footer_template.eex index 752668cdf..6e7cdf9be 100644 --- a/lib/ex_doc/formatter/html/templates/footer_template.eex +++ b/lib/ex_doc/formatter/html/templates/footer_template.eex @@ -21,7 +21,11 @@

Built using ExDoc (v<%= ExDoc.version() %>) for the - Elixir programming language + <%= if config.proglang == :erlang do %> + Erlang programming language + <% else %> + Elixir programming language + <% end %>

diff --git a/test/ex_doc/formatter/html/templates_test.exs b/test/ex_doc/formatter/html/templates_test.exs index 4df9df542..536c21954 100644 --- a/test/ex_doc/formatter/html/templates_test.exs +++ b/test/ex_doc/formatter/html/templates_test.exs @@ -246,6 +246,21 @@ defmodule ExDoc.Formatter.HTML.TemplatesTest do refute content =~ ~r{
  • Mix Tasks
  • } end + test "display built with footer by proglang option" do + content = Templates.footer_template(doc_config(proglang: :erlang), nil) + + assert content =~ + ~r{Erlang programming language} + + content = Templates.footer_template(doc_config(proglang: :elixir), nil) + + assert content =~ + ~r{Elixir programming language} + + 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()) From 8dd080f239a27be5e58b163c39acf8b3d29ba5a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 23 Apr 2022 21:07:09 +0200 Subject: [PATCH 2/2] Update lib/ex_doc/formatter/html/templates/footer_template.eex --- lib/ex_doc/formatter/html/templates/footer_template.eex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ex_doc/formatter/html/templates/footer_template.eex b/lib/ex_doc/formatter/html/templates/footer_template.eex index 6e7cdf9be..d3e9d856e 100644 --- a/lib/ex_doc/formatter/html/templates/footer_template.eex +++ b/lib/ex_doc/formatter/html/templates/footer_template.eex @@ -23,9 +23,9 @@ ExDoc (v<%= ExDoc.version() %>) for the <%= if config.proglang == :erlang do %> Erlang programming language - <% else %> - Elixir programming language - <% end %> + <% else %> + Elixir programming language + <% end %>