From 8b4265043f533ca6feb4b0a414e3a5bb5a9a0ea7 Mon Sep 17 00:00:00 2001 From: Kian-Meng Ang Date: Sun, 24 Apr 2022 04:24:15 +0800 Subject: [PATCH] Show programming language in HTML footer (#1560) --- .../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..d3e9d856e 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())