Skip to content

Commit d8c9d14

Browse files
authored
docs: add links to README (#12)
1 parent 9388412 commit d8c9d14

File tree

6 files changed

+36
-37
lines changed

6 files changed

+36
-37
lines changed

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,45 @@ replaces Sphinx's built-in search with Algolia DocSearch.
55

66
## Before you begin
77

8-
[**Apply for DocSearch**](https://docsearch.algolia.com/apply). You'll get an email with your Algolia credentials.
8+
[**Apply for DocSearch**](https://docsearch.algolia.com/apply).
9+
You'll get an email with your Algolia credentials.
910

1011
This extension supports Python versions 3.8, 3.9, 3.10, and 3.11 and Sphinx versions 5 and later.
1112

1213
## Install
1314

14-
Install the `sphinx-docsearch` extension from PyPI:
15+
Install the `sphinx-docsearch` package:
1516

1617
```sh
1718
pip install sphinx-docsearch
1819
```
1920

2021
## Configure
2122

22-
1. Add `sphinx-docsearch` to your Sphinx configuration file `conf.py`:
23+
1. Add `sphinx-docsearch` to your Sphinx configuration:
2324

2425
```python
26+
# conf.py
2527
extensions += ["sphinx_docsearch"]
2628
```
2729

2830
1. Add your Algolia credentials to your Sphinx configuration:
2931

3032
```python
33+
# conf.py
3134
docsearch_app_id = "<DOCSEARCH_APP_ID>"
3235
docsearch_api_key = "<DOCSEARCH_SEARCH_API_KEY>"
3336
docsearch_index_name = "<DOCSEARCH_INDEX_NAME>"
3437
```
3538

36-
1. Optional: change configuration settings
39+
See also: [Configure DocSearch](https://sphinx-docsearch.readthedocs.io/en/latest/configuration.html).
3740

3841
## Customize
3942

40-
- Customize crawling (link to DocSearch or Crawler doc)
41-
- Add custom templates
42-
- Add custom CSS
43+
To change what the crawler should extract from your pages, see [Record Extractor](https://docsearch.algolia.com/docs/record-extractor).
44+
45+
You can add [custom templates](https://sphinx-docsearch.readthedocs.io/en/latest/customization.html#add-custom-templates),
46+
if your Sphinx HTML theme uses templates [not provided](https://sphinx-docsearch.readthedocs.io/en/latest/themes.html)
47+
by this extension.
48+
49+
You can customize the look of the DocSearch UI by [adding your own CSS](https://sphinx-docsearch.readthedocs.io/en/latest/customization.html#add-custom-css).

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# General configuration
1616
extensions = ["sphinx_docsearch", "myst_parser"]
17-
myst_enable_extensions = ["colon_fence"]
17+
myst_enable_extensions = ["colon_fence", "deflist"]
1818

1919
# DocSearch Sphinx extension
2020
docsearch_app_id = os.getenv("DOCSEARCH_APP_ID")

docs/configuration.md

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,41 @@ All configuration settings start with `docsearch_`.
66

77
You **must** add at least your credentials to make DocSearch work:
88

9-
- **`docsearch_app_id`**
10-
11-
Your Algolia application ID.
9+
**`docsearch_app_id`**
10+
: Your Algolia application ID.
1211
You can find it in the [Algolia dashboard](https://dashboard.algolia.com/account/api-keys)
1312

14-
- **`docsearch_api_key`**
15-
16-
Your Search API key.
13+
**`docsearch_api_key`**
14+
: Your Search API key.
1715
You can find it in the [Algolia dashboard](https://dashboard.algolia.com/account/api-keys).
1816

1917
:::{warning}
2018
Don't use your Write API key, which is used for crawling your content.
2119
:::
2220

23-
- **`docsearch_index_name`**
24-
25-
The Algolia index name for your documentation.
21+
**`docsearch_index_name`**
22+
: The Algolia index name for your documentation.
2623

2724
## Optional configuration
2825

2926
The Sphinx extension lets you configure these aspects of the DocSearch UI.
3027

31-
- **`docsearch_container`** (default `#docsearch`)
32-
33-
The ID of the HTML element where the search input is added.
28+
**`docsearch_container`** (default `#docsearch`)
29+
: The ID of the HTML element where the search input is added.
3430
By default, the DocSearch input is added to the HTML element with the ID `docsearch`.
3531
You can change this setting if you're using a different theme.
3632

37-
- **`docsearch_placeholder`** (default: `Search`):
38-
39-
The placeholder text for the search box.
40-
41-
- **`docsearch_initial_query`**:
42-
43-
A query for an initial search if you want to show search results as soon as the user opens the search menu.
44-
45-
- **`docsearch_search_parameters`**:
33+
**`docsearch_placeholder`** (default: `Search`)
34+
: The placeholder text for the search box.
4635

47-
Any Algolia search parameter you want to add.
36+
**`docsearch_initial_query`**
37+
: A query for an initial search if you want to show search results as soon as the user opens the search menu.
4838

49-
- **`docsearch_missing_results_url`**:
39+
**`docsearch_search_parameters`**
40+
: Any Algolia search parameter you want to add.
5041

51-
If specified, DocSearch adds a message to the "No results found" screen with the link to the URL you specified,
42+
**`docsearch_missing_results_url`**
43+
: If specified, DocSearch adds a message to the "No results found" screen with the link to the URL you specified,
5244
for users to report issues with missing search results.
5345
You can include the current search query as parameter ${query}. For example:
5446

docs/what.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
DocSearch is a program by Algolia for bringing fast and relevant search to every technical content for free.
44

55
With DocSearch, Algolia indexes your documentation with a crawler.
6-
The Algolia Crawler comes with a dashboard, where you can configure what is crawled and you can schedule periodic updates.
6+
The Algolia Crawler comes with a dashboard, where you can configure what's crawled and you can schedule periodic updates.
77
With your DocSearch credentials, you can access the Algolia dashboard,
88
where you can see analytics about your Search and change the ranking of your search results.
99

10-
DocSearch also comes with a UI component that you can add o your website.
10+
DocSearch also comes with a UI component that you can add to your website.
1111
This Sphinx extension automatically adds it to your Sphinx project.
1212

1313
:::{seealso}
@@ -27,7 +27,7 @@ To avoid having two different search interfaces on your website,
2727
this extension replaces the default search box provided by Sphinx.
2828
It overrides the built-in templates `searchbox.html` or `sidebar/search.html`.
2929
This makes the extension work with the [Furo](https://pradyunsg.me/furo/),
30-
[Read The Docs Sphinx Theme](https://sphinx-rtd-theme.readthedocs.io/en/stable/), and
30+
[Read The Docs](https://sphinx-rtd-theme.readthedocs.io/en/stable/), and
3131
[Alabaster](https://alabaster.readthedocs.io/en/latest/) themes by default.
3232

3333
For these themes, the extension also adds custom CSS to make the DocSearch search box fit the theme.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "sphinx-docsearch"
3-
version = "0.0.2"
3+
version = "0.0.3"
44
description = "A Sphinx extension for replacing the built-in search with Algolia DocSearch"
55
authors = ["Algolia"]
66
license = "MIT"

tests/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
def test_returns_version() -> None:
1313
"""It returns the correct version."""
14-
assert sphinx_docsearch.__version__ == "0.0.2"
14+
assert sphinx_docsearch.__version__ == "0.0.3"
1515

1616

1717
@pytest.mark.sphinx("html", confoverrides={"extensions": ["sphinx_docsearch"]})

0 commit comments

Comments
 (0)