Skip to content

Commit ac295b1

Browse files
committed
Add producer to search_data.js
1 parent 9771c14 commit ac295b1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/ex_doc/formatter/html/search_data.ex

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ defmodule ExDoc.Formatter.HTML.SearchData do
1515

1616
data = %{
1717
items: items,
18-
content_type: content_type
18+
content_type: content_type,
19+
producer: %{
20+
name: "ex_doc",
21+
version: Application.spec(:ex_doc)[:vsn]
22+
}
1923
}
2024

2125
["searchData=" | ExDoc.Utils.to_json(data)]

test/ex_doc/formatter/html/search_data_test.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ defmodule ExDoc.Formatter.HTML.SearchDataTest do
2121
config = %ExDoc.Config{output: "#{c.tmp_dir}/doc"}
2222
data = search_data(modules, config)
2323
assert data["content_type"] == "text/markdown"
24+
assert data["producer"]["name"] == "ex_doc"
2425
[item1, item2] = data["items"]
2526

2627
assert item1["ref"] == "SearchFoo.html"

0 commit comments

Comments
 (0)