ansys.tools.meilisearch.templates#

PyMeilisearch templates subpackage.

Submodules#

Attributes#

DEFAULT_TEMPLATE

SPHINX_PYDATA_TEMPLATE

STOP_SPHINX_URLS

List of stop points when scraping URLs.

Functions#

render_template(→ str)

Render a docsearch Sphinx template for a URL.

Package Contents#

ansys.tools.meilisearch.templates.DEFAULT_TEMPLATE#
ansys.tools.meilisearch.templates.SPHINX_PYDATA_TEMPLATE#
ansys.tools.meilisearch.templates.STOP_SPHINX_URLS = ['_sources', '_downloads', '_static', '_images', '.doctree']#

List of stop points when scraping URLs.

ansys.tools.meilisearch.templates.render_template(template: str, urls: str | list[str], path_out: str, index_uid: str = None, stop_urls_default: str = None) str#

Render a docsearch Sphinx template for a URL.

Parameters:
templatestr or pathlib.Path

Path to the template file or the name of the template to use. If a name is specified, it must be a key in the TEMPLATES dictionary.

urlsstr, list[str]

One or more URLs to crawl. URLs must start with https://.

path_outstr

Path to write the rendered template to.

index_uidstr, default: None

Unique name for the custom index to use. This unique name is the URL without the https://. The default is None, in which case the unique name of the first URL specified for the urls parameter is used.

stop_urls_defaultstr or list[str], default: [‘_sources’, ‘_downloads’, ‘_static’, ‘_images’, ‘.doctree’]

A list of stop points when scraping URLs. If specified, crawling will stop when encountering any URL containing any of the strings in this list. The default is [‘_sources’, ‘_downloads’, ‘_static’, ‘_images’, ‘.doctree’].

Returns:
str

Unique name of the custom index that is used.

Raises:
FileNotFoundError

If the template file cannot be found.

ValueError

If any of the URLs specified for the urls parameter do not start with https://.