Skip to content

Commit da56479

Browse files
committed
Store proglang in searchdata
1 parent 6151194 commit da56479

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/ex_doc/formatter/html/search_data.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ defmodule ExDoc.Formatter.HTML.SearchData do
22
@moduledoc false
33
alias ExDoc.Utils
44

5-
def create(nodes, extras, _proglang) do
5+
def create(nodes, extras, proglang) do
66
items = Enum.flat_map(nodes, &module/1) ++ Enum.flat_map(extras, &extra/1)
77

88
data = %{
99
items: items,
1010
content_type: "text/markdown",
11+
proglang: proglang,
1112
producer: %{
1213
name: "ex_doc",
1314
version: to_string(Application.spec(:ex_doc)[:vsn])

test/ex_doc/formatter/html/search_data_test.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ defmodule ExDoc.Formatter.HTML.SearchDataTest do
2525
config = %ExDoc.Config{output: "#{c.tmp_dir}/doc"}
2626
data = search_data(modules, config)
2727
assert data["content_type"] == "text/markdown"
28+
assert data["proglang"] == "elixir"
2829
assert data["producer"]["name"] == "ex_doc"
2930
[item1, item2] = data["items"]
3031

0 commit comments

Comments
 (0)