Skip to content

doc: Remove PyMeilisearch section. #615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 1 addition & 73 deletions doc/source/how-to/documenting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -763,79 +763,7 @@ are changing. For more information, see :ref:`Branching model`.
As you are making changes in this branch, you want to periodically generate the
documentation locally so that you can test your changes before you create a
GitHub pull request. For more information, see :ref:`Build documentation`.

Use PyMeilisearch as a documentation search engine
--------------------------------------------------

PyMeilisearch is a Python client library that lets you use MeiliSearch, an open
source search engine, to provide fast and relevant documentation search capabilities.

To use PyMeilisearch as a search engine for multi-version documentation, perform
these steps.

#. Ensure that you are using `Ansys Sphinx Theme <Ansys_Sphinx_theme_repo_>`_ version 0.8
or later for building your library's documentation.

#. In the ``conf.py`` file in the ``doc/source`` directory, include these lines:

.. code-block:: python

import os

from ansys_sphinx_theme import convert_version_to_pymeilisearch


cname = os.getenv("DOCUMENTATION_CNAME", "<DEFAULT_CNAME>")
"""Canonical name (CNAME) of the webpage hosting the documentation."""

html_theme_options = {
"use_meilisearch": {
"api_key": os.getenv("MEILISEARCH_API_KEY", ""),
"index_uids": {
f"<your-index-name>{convert_version_to_pymeilisearch(__version__)}": "index name to display", # noqa: E501
},
},
...
}

#. In these lines, replace *<your-index-name>* with the name for your MeiliSearch index.

The ``convert_version_to_pymeilisearch`` function converts your library's version into
a format suitable for MeiliSearch indexing.

#. Enable documentation index deployment for development and stable versions using Ansys actions:

.. code-block:: yaml

jobs:
doc-deploy-index:
name: "Index the documentation and scrap using PyMeilisearch"
runs-on: ubuntu-latest
needs: doc-deploy
if: github.event_name == 'push'
steps:
- name: Scrape the stable documentation to PyMeilisearch
run: |
VERSION=$(python -c "from <your-package> import __version__; print('.'.join(__version__.split('.')[:2]))")
VERSION_MEILI=$(python -c "from <your-package> import __version__; print('-'.join(__version__.split('.')[:2]))")
echo "Calculated VERSION: $VERSION"
echo "Calculated VERSION_MEILI: $VERSION_MEILI"

- name: "Deploy the latest documentation index"
uses: ansys/actions/[email protected]
with:
cname: "<library>.docs.pyansys.com/version/$VERSION"
index-name: "<index-name>v$VERSION_MEILI"
host-url: "<meilisearch-host-url>"
api-key: ${{ secrets.MEILISEARCH_API_KEY }}

#. Replace *<your-package>*, *<your-index-name>*, and *<library>* with appropriate values
for your project.

The version of your package is automatically calculated and used for indexing, ensuring that
your documentation remains up to date. For more information, see the `PyMeilisearch`_ and
`Ansys Sphinx Theme <ansys-sphinx-theme-doc_>`_ documentation.


.. _SEO:

Optimize web searches
Expand Down