Skip to content

Commit

Permalink
Store proglang in searchdata
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Oct 21, 2024
1 parent 6151194 commit da56479
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ex_doc/formatter/html/search_data.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ defmodule ExDoc.Formatter.HTML.SearchData do
@moduledoc false
alias ExDoc.Utils

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

data = %{
items: items,
content_type: "text/markdown",
proglang: proglang,
producer: %{
name: "ex_doc",
version: to_string(Application.spec(:ex_doc)[:vsn])
Expand Down
1 change: 1 addition & 0 deletions test/ex_doc/formatter/html/search_data_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ defmodule ExDoc.Formatter.HTML.SearchDataTest do
config = %ExDoc.Config{output: "#{c.tmp_dir}/doc"}
data = search_data(modules, config)
assert data["content_type"] == "text/markdown"
assert data["proglang"] == "elixir"
assert data["producer"]["name"] == "ex_doc"
[item1, item2] = data["items"]

Expand Down

0 comments on commit da56479

Please sign in to comment.