Skip to content

Commit

Permalink
docs: add sphinx docsearch documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Apr 7, 2024
1 parent 0e36e4c commit f34bd8b
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 5 deletions.
Binary file added docs/_static/screenshots/docsearch-dark.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/screenshots/docsearch-light.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions docs/customisation/announcement.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ Here shows an example with ``announcement`` configuration.

.. container:: image-1

.. image:: /_static/screenshots/light-homepage.jpg
.. image:: /_static/screenshots/homepage-light.jpg
:class: light-only
:align: center

.. image:: /_static/screenshots/dark-homepage.jpg
.. image:: /_static/screenshots/homepage-dark.jpg
:class: dark-only
:align: center
48 changes: 48 additions & 0 deletions docs/extensions/docsearch.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
:description: Shibuya theme works well with Algolia sphinx docsearch extension.

.. _docsearch:

sphinx-docsearch
================

``sphinx-docsearch`` replaces Sphinx's built-in search with Algolia DocSearch.

**Documentation**: https://sphinx-docsearch.readthedocs.io/

Install
-------

.. code-block:: bash
pip install sphinx-docsearch
Then, add the extension to your ``conf.py``:

.. code-block:: python
:caption: conf.py
extensions = [
# ...
"sphinx_docsearch",
]
docsearch_app_id = "<DOCSEARCH_APP_ID>"
docsearch_api_key = "<DOCSEARCH_SEARCH_API_KEY>"
docsearch_index_name = "<DOCSEARCH_INDEX_NAME>"
Screenshots
-----------

``sphinx-docsearch`` looks great in both light and dark mode with Shibuya theme.

.. figure:: /_static/screenshots/docsearch-light.jpg
:class: rounded
:align: center

DocSearch modal in **light** mode.

.. figure:: /_static/screenshots/docsearch-dark.jpg
:class: rounded
:align: center

DocSearch modal in **dark** mode.
2 changes: 1 addition & 1 deletion docs/extensions/numpydoc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.. _numpydoc:

numpydoc
===========
========

Numpy's Sphinx extensions to power Numpy's docstring syntax.

Expand Down
4 changes: 2 additions & 2 deletions docs/extensions/sphinx-tabs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ Markup syntax
How it looks like
-----------------

.. image:: /_static/screenshots/light-sphinx-tabs.png
.. image:: /_static/screenshots/sphinx-tabs-light.png
:class: light-only
:align: center

.. image:: /_static/screenshots/dark-sphinx-tabs.png
.. image:: /_static/screenshots/sphinx-tabs-dark.png
:class: dark-only
:align: center
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Shibuya
extensions/nbsphinx
extensions/numpydoc
extensions/mermaid
extensions/docsearch

.. toctree::
:caption: Development
Expand Down

0 comments on commit f34bd8b

Please sign in to comment.