@@ -164,23 +164,7 @@ defmodule Mix.Tasks.Docs do
164164 value is the path to redirect to. The extension is omitted in both cases, i.e `%{"old-readme" => "readme"}`.
165165 See the "Changing documentation over time" section below for more.
166166
167- * `:search` - A list of search engine configurations. Each search engine is a map with the following keys:
168-
169- * `:name` - The display name of the search engine (required)
170- * `:help` - A help text describing what the search engine does (required)
171- * `:url` - The optional search URL template, usually ending with `q=`
172- The default uses ExDoc built-in Lunr's search engine
173-
174- When multiple search engines are configured, a dropdown selector will appear next to the search bar
175- allowing users to choose which engine to use. For example:
176-
177- search: [
178- %{name: "FooBar", help: "Search on FooBar", url: "https://example.com/?q="},
179- %{name: "Local", help: "In-browser search"}
180- ]
181-
182- By default, the built-in Lunr's search engine is configured. If only one search engine
183- is configured, the dropdown selector will be hidden.
167+ * `:search` - A list of search engine configurations. See the "Search engines" section
184168
185169 * `:skip_undefined_reference_warnings_on` - ExDoc warns when it can't create a `Mod.fun/arity`
186170 reference in the current project docs (for example, because of a typo). This option controls when to
@@ -422,21 +406,36 @@ defmodule Mix.Tasks.Docs do
422406 Groups in the sidebar and main page body are ordered according to the following
423407 rules:
424408
425- * First, groups defined as `@moduledoc groups: [...]` in the given order.
426- * Then groups defined as keys in the `:groups_for_docs` configuration.
427- * Then default groups: Types, Callbacks and Functions.
428- * Finally, other groups returned by `:default_group_for_doc` by alphabetical
429- order.
409+ * First, groups defined as `@moduledoc groups: [...]` in the given order.
410+ * Then groups defined as keys in the `:groups_for_docs` configuration.
411+ * Then default groups: Types, Callbacks and Functions.
412+ * Finally, other groups returned by `:default_group_for_doc` by alphabetical order.
430413
431- ## Meta-tags configuration
414+ ## Search engines
432415
433- It is also possible to configure some of ExDoc behaviour using meta tags.
434- These meta tags can be inserted using `before_closing_head_tag`.
416+ ExDoc allows custom search engines via the `:search` key. Each search engine
417+ is a map with the following keys:
435418
436- * `exdoc:autocomplete` - when set to "off", it disables autocompletion.
419+ * `:name` - The display name of the search engine (required)
420+ * `:help` - A help text describing what the search engine does (required)
421+ * `:url` - The optional search URL template, usually ending with `q=`
422+ * `:packages` - An optional list of packages (or package-versions) to search on
423+ https://hexdocs.pm. For example: `[:plug, :phoenix, ecto: "3.0.0", ecto_sql: "3.0.0"]`.
424+ If no version is specified, it uses the package latest
437425
438- * `exdoc:autocomplete-limit` - Set to an integer to configure how many results
439- appear in the autocomplete dropdown. Defaults to 10.
426+ If none of `:url` or `:packages` are given, ExDoc will use its default search engine
427+ powered by Lunr.
428+
429+ When multiple search engines are configured, a dropdown selector will appear next to
430+ the search bar allowing users to choose which engine to use. For example:
431+
432+ search: [
433+ %{name: "FooBar", help: "Search on FooBar", url: "https://example.com/?q="},
434+ %{name: "Local", help: "In-browser search"}
435+ ]
436+
437+ If only one search engine is configured, the dropdown selector will be hidden.
438+ If no search engine is configured, only the built-in Lunr's is shown.
440439
441440 ## Nesting
442441
@@ -495,7 +494,7 @@ defmodule Mix.Tasks.Docs do
495494 * `:title` - The title of the extra page. If not provided, the title will be inferred from the extra name.
496495 * `:url` - The external url to link to from the sidebar.
497496
498- ### Customizing Search Data
497+ ### Customizing search data
499498
500499 It is possible to fully customize the way a given extra is indexed, both in autocomplete and in search.
501500 In most cases, this makes sense for _generated_ documentation. If `search_data` is provided, it completely
@@ -518,6 +517,16 @@ defmodule Mix.Tasks.Docs do
518517 mix cmd mix docs
519518
520519 See `mix help cmd` for more information.
520+
521+ ## Meta-tags configuration
522+
523+ It is also possible to configure some of ExDoc behaviour using meta tags.
524+ These meta tags can be inserted using `before_closing_head_tag`.
525+
526+ * `exdoc:autocomplete` - when set to "off", it disables autocompletion.
527+
528+ * `exdoc:autocomplete-limit` - Set to an integer to configure how many results
529+ appear in the autocomplete dropdown. Defaults to 10.
521530 """
522531
523532 @ switches [
0 commit comments