ansys.tools.meilisearch.templates#
PyMeilisearch templates subpackage.
Submodules#
Attributes#
List of stop points when scraping URLs. |
Functions#
|
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:
- template
str
orpathlib.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.- urls
str
,list
[str
] One or more URLs to crawl. URLs must start with
https://
.- path_out
str
Path to write the rendered template to.
- index_uid
str
, default:None
Unique name for the custom index to use. This unique name is the URL without the
https://
. The default isNone
, in which case the unique name of the first URL specified for theurls
parameter is used.- stop_urls_default
str
orlist
[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’].
- template
- 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 withhttps://
.