From a7cb1baf5c447d1aebd31507c327ae08ee6c9aa6 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 10 Oct 2024 11:07:26 +0200 Subject: [PATCH 01/27] fix: add more components to the search indexing --- src/ansys_sphinx_theme/search/fuse_search.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index c7b35457..1f75649e 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -53,16 +53,20 @@ def build_sections(self): """Build sections from the document tree.""" for node in self.doc_tree.traverse(nodes.section): section_title = node[0].astext() - section_text = "\n".join( - n.astext() - for node_type in [nodes.paragraph, nodes.literal_block] - for n in node.traverse(node_type) - ) + # section_text = "\n".join( + # n.astext() + # for node_type in [nodes.paragraph, nodes.literal_block] + # for n in node.traverse(node_type) + # ) + # get all the text in the section + + text = "\n".join(node.astext() for node in node.traverse(nodes.Text)) + section_anchor_id = _title_to_anchor(section_title) self.sections.append( { "title": section_title, - "text": section_text, + "text": text, "anchor_id": section_anchor_id, } ) From b6b1abb3c8555f5297fe218c36b6b1e8dd0310fc Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Thu, 10 Oct 2024 09:08:55 +0000 Subject: [PATCH 02/27] chore: adding changelog file 541.fixed.md [dependabot-skip] --- doc/changelog.d/541.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/541.fixed.md diff --git a/doc/changelog.d/541.fixed.md b/doc/changelog.d/541.fixed.md new file mode 100644 index 00000000..95fbb5f6 --- /dev/null +++ b/doc/changelog.d/541.fixed.md @@ -0,0 +1 @@ +fix: add more components to the search indexing \ No newline at end of file From 488246e8696000027781cf9dd8f8d66077288fb5 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 10 Oct 2024 17:14:33 +0200 Subject: [PATCH 03/27] fix: add more elements --- src/ansys_sphinx_theme/search/fuse_search.py | 22 ++++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index 1f75649e..345f755b 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -53,20 +53,24 @@ def build_sections(self): """Build sections from the document tree.""" for node in self.doc_tree.traverse(nodes.section): section_title = node[0].astext() - # section_text = "\n".join( - # n.astext() - # for node_type in [nodes.paragraph, nodes.literal_block] - # for n in node.traverse(node_type) - # ) - # get all the text in the section - - text = "\n".join(node.astext() for node in node.traverse(nodes.Text)) + section_text = "\n".join( + n.astext() + for node_type in [ + nodes.paragraph, + nodes.literal_block, + nodes.literal, + nodes.list_item, + nodes.field_list, + nodes.compound, + ] + for n in node.traverse(node_type) + ) section_anchor_id = _title_to_anchor(section_title) self.sections.append( { "title": section_title, - "text": text, + "text": section_text, "anchor_id": section_anchor_id, } ) From 99de52338950f455178de6c7109a9074abfd5b1a Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Mon, 14 Oct 2024 11:10:06 +0200 Subject: [PATCH 04/27] fix: add block list --- src/ansys_sphinx_theme/search/fuse_search.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index 345f755b..cbd318ed 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -62,6 +62,7 @@ def build_sections(self): nodes.list_item, nodes.field_list, nodes.compound, + nodes.block_quote, ] for n in node.traverse(node_type) ) From 26c7e0310c3ed1d8825fa93bc50700b0f66cbbf0 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Tue, 15 Oct 2024 11:32:49 +0200 Subject: [PATCH 05/27] fix: initial test with group patterns --- doc/source/conf.py | 4 ++++ src/ansys_sphinx_theme/search/fuse_search.py | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index aded60f5..0cc72b07 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -70,6 +70,10 @@ "static_search": { "threshold": 0.5, "ignoreLocation": True, + "index_patterns": { + "examples/api/*": "ALL_NODES", + "examples/sphinx_examples/*": "TITLES + PARAGRAPHS", + }, }, } diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index cbd318ed..89e03853 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -45,6 +45,7 @@ def __init__(self, doc_name, app): self.doc_name = doc_name self.doc_path = f"{self.doc_name}.html" self.env = app.env + self.theme_options = app.config.html_theme_options.get("static_search", {}) self.doc_title = self.env.titles[self.doc_name].astext() self.doc_tree = self.env.get_doctree(self.doc_name) self.sections = [] @@ -135,6 +136,23 @@ def _title_to_anchor(title: str) -> str: return re.sub(r"[^\w\s-]", "", title.lower().strip().replace(" ", "-")) +def group_the_pages_with_pattern(app, all_docs): + """Group the pages with the pattern in the search index.""" + options = app.config.html_theme_options.get("static_search", {}) + pattern = options.get("index_pattern", {}) + new_pattern = {} + # group docs with pages with pattern + print(all_docs) + for filename, pattern in pattern.items(): + for doc in all_docs: + if doc.startswith(pattern): + if filename not in new_pattern: + new_pattern[filename] = pattern + new_pattern[filename].append(doc) + + return new_pattern + + def create_search_index(app, exception): """ Generate search index at the end of the Sphinx build process. @@ -151,6 +169,8 @@ def create_search_index(app, exception): search_index_list = [] + # get_pattern = group_the_pages_with_pattern(app, app.env.found_docs) + for document in app.env.found_docs: search_index = SearchIndex(document, app) search_index.build_sections() From 26741879f6510eff21f8fb898d490053ef5aca3c Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Wed, 16 Oct 2024 13:55:25 +0200 Subject: [PATCH 06/27] fix: group docs and pattern --- doc/source/conf.py | 7 ++-- src/ansys_sphinx_theme/search/fuse_search.py | 34 +++++++++++++------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 0090fe05..5c41e88a 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -73,8 +73,8 @@ "minMatchCharLength": 3, "ignoreLocation": True, "index_patterns": { - "examples/api/*": "ALL_NODES", - "examples/sphinx_examples/*": "TITLES + PARAGRAPHS", + "examples/api/": "ALL_NODES", + "examples/sphinx_examples/": "TITLES + PARAGRAPHS", }, }, } @@ -201,7 +201,8 @@ def extract_example_links( list List of example links. """ - g = Github() + token = os.getenv("GITHUB_TOKEN") + g = Github(token) repo = g.get_repo(repo_fullname) contents = repo.get_contents(path_relative_to_root) if not isinstance(contents, list): diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index 89e03853..ae97a5b8 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -27,11 +27,16 @@ from docutils import nodes +PARAGRAPHS = [nodes.paragraph] +TITLE = [nodes.title] +LITERAL = [nodes.literal, nodes.literal_block] +ALL_NODES = [nodes.raw] + class SearchIndex: """Generate a search index for a Sphinx document.""" - def __init__(self, doc_name, app): + def __init__(self, doc_name, app, pattern=None): """ Initialize the search index object. @@ -49,6 +54,7 @@ def __init__(self, doc_name, app): self.doc_title = self.env.titles[self.doc_name].astext() self.doc_tree = self.env.get_doctree(self.doc_name) self.sections = [] + self.pattern = pattern def build_sections(self): """Build sections from the document tree.""" @@ -139,17 +145,18 @@ def _title_to_anchor(title: str) -> str: def group_the_pages_with_pattern(app, all_docs): """Group the pages with the pattern in the search index.""" options = app.config.html_theme_options.get("static_search", {}) - pattern = options.get("index_pattern", {}) + patterns = options.get("index_patterns", {}) + new_pattern = {} - # group docs with pages with pattern - print(all_docs) - for filename, pattern in pattern.items(): - for doc in all_docs: - if doc.startswith(pattern): - if filename not in new_pattern: - new_pattern[filename] = pattern - new_pattern[filename].append(doc) + if not isinstance(patterns, dict): + raise ValueError("index_patterns must be a dictionary") + + for filename, pattern in patterns.items(): + files = [doc for doc in all_docs if doc.startswith(filename)] + new_pattern[pattern] = files + other_files = [doc for doc in all_docs if doc not in new_pattern] + new_pattern["TITLES + PARAGRAPHS"] = other_files return new_pattern @@ -169,7 +176,12 @@ def create_search_index(app, exception): search_index_list = [] - # get_pattern = group_the_pages_with_pattern(app, app.env.found_docs) + get_pattern = group_the_pages_with_pattern(app, app.env.found_docs) + for pattern, docs in get_pattern.items(): + for document in docs: + search_index = SearchIndex(document, app, pattern) + search_index.build_sections() + search_index_list.extend(search_index.indices) for document in app.env.found_docs: search_index = SearchIndex(document, app) From 7473d885ff91ffa28c0401d644c19851b8c1024f Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Wed, 16 Oct 2024 14:28:05 +0200 Subject: [PATCH 07/27] fix: add nodes --- doc/source/conf.py | 7 +++++-- src/ansys_sphinx_theme/__init__.py | 17 ++++++++++----- src/ansys_sphinx_theme/search/__init__.py | 17 +++++++++++++-- src/ansys_sphinx_theme/search/fuse_search.py | 22 +++++++++++++++----- 4 files changed, 49 insertions(+), 14 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 5c41e88a..df9c5563 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -11,6 +11,9 @@ from sphinx.builders.latex import LaTeXBuilder from ansys_sphinx_theme import ( + ALL_NODES, + PARAGRAPHS, + TITLE, __version__, ansys_favicon, ansys_logo_white, @@ -73,8 +76,8 @@ "minMatchCharLength": 3, "ignoreLocation": True, "index_patterns": { - "examples/api/": "ALL_NODES", - "examples/sphinx_examples/": "TITLES + PARAGRAPHS", + "examples/api/": ALL_NODES, + "examples/sphinx_examples/": TITLE + PARAGRAPHS, }, }, } diff --git a/src/ansys_sphinx_theme/__init__.py b/src/ansys_sphinx_theme/__init__.py index e1fc4288..2532d884 100644 --- a/src/ansys_sphinx_theme/__init__.py +++ b/src/ansys_sphinx_theme/__init__.py @@ -28,13 +28,20 @@ import subprocess from typing import Any, Dict -from docutils.nodes import document +from docutils import nodes from sphinx import addnodes from sphinx.application import Sphinx from ansys_sphinx_theme.extension.linkcode import DOMAIN_KEYS, sphinx_linkcode_resolve from ansys_sphinx_theme.latex import generate_404 # noqa: F401 -from ansys_sphinx_theme.search import create_search_index, update_search_config +from ansys_sphinx_theme.search import ( # noqa: F401 + ALL_NODES, + LITERAL, + PARAGRAPHS, + TITLE, + create_search_index, + update_search_config, +) try: import importlib.metadata as importlib_metadata @@ -170,7 +177,7 @@ def setup_default_html_theme_options(app): def fix_edit_html_page_context( - app: Sphinx, pagename: str, templatename: str, context: dict, doctree: document + app: Sphinx, pagename: str, templatename: str, context: dict, doctree: nodes.document ) -> None: """Add a function that Jinja can access for returning an "edit this page" link . @@ -271,7 +278,7 @@ def fix_edit_link_page(link: str) -> str: def update_footer_theme( - app: Sphinx, pagename: str, templatename: str, context: Dict[str, Any], doctree: document + app: Sphinx, pagename: str, templatename: str, context: Dict[str, Any], doctree: nodes.document ) -> None: """Update the version number of the Ansys Sphinx theme in the footer. @@ -401,7 +408,7 @@ def convert_pdf_to_png(pdf_path: pathlib.Path, output_dir: pathlib.Path, output_ def add_cheat_sheet( - app: Sphinx, pagename: str, templatename: str, context: Dict[str, Any], doctree: document + app: Sphinx, pagename: str, templatename: str, context: Dict[str, Any], doctree: nodes.document ) -> None: """Add a cheat sheet to the left navigation sidebar. diff --git a/src/ansys_sphinx_theme/search/__init__.py b/src/ansys_sphinx_theme/search/__init__.py index b2f756d3..bc6015f3 100644 --- a/src/ansys_sphinx_theme/search/__init__.py +++ b/src/ansys_sphinx_theme/search/__init__.py @@ -23,7 +23,13 @@ from sphinx.application import Sphinx -from ansys_sphinx_theme.search.fuse_search import create_search_index +from ansys_sphinx_theme.search.fuse_search import ( + ALL_NODES, + LITERAL, + PARAGRAPHS, + TITLE, + create_search_index, +) def update_search_config(app: Sphinx) -> None: @@ -40,4 +46,11 @@ def update_search_config(app: Sphinx) -> None: theme_static_options["limit"] = theme_static_options.get("limit", 10) -__all__ = ["create_search_index", "update_search_config"] +__all__ = [ + "create_search_index", + "update_search_config", + "LITERAL", + "PARAGRAPHS", + "TITLE", + "ALL_NODES", +] diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index ae97a5b8..8c2cda91 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -31,6 +31,16 @@ TITLE = [nodes.title] LITERAL = [nodes.literal, nodes.literal_block] ALL_NODES = [nodes.raw] +ALL_NODES_WITHOUT_RAW = [ + nodes.paragraph, + nodes.title, + nodes.literal_block, + nodes.literal, + nodes.list_item, + nodes.field_list, + nodes.compound, + nodes.block_quote, +] class SearchIndex: @@ -156,7 +166,7 @@ def group_the_pages_with_pattern(app, all_docs): new_pattern[pattern] = files other_files = [doc for doc in all_docs if doc not in new_pattern] - new_pattern["TITLES + PARAGRAPHS"] = other_files + new_pattern["other"] = other_files return new_pattern @@ -177,16 +187,18 @@ def create_search_index(app, exception): search_index_list = [] get_pattern = group_the_pages_with_pattern(app, app.env.found_docs) + print(get_pattern) + exit(1) for pattern, docs in get_pattern.items(): for document in docs: search_index = SearchIndex(document, app, pattern) search_index.build_sections() search_index_list.extend(search_index.indices) - for document in app.env.found_docs: - search_index = SearchIndex(document, app) - search_index.build_sections() - search_index_list.extend(search_index.indices) + # for document in app.env.found_docs: + # search_index = SearchIndex(document, app) + # search_index.build_sections() + # search_index_list.extend(search_index.indices) search_index_path = app.builder.outdir / "_static" / "search.json" with search_index_path.open("w", encoding="utf-8") as index_file: From ee4be553392800e8f10963247d9dcacc656f763a Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Wed, 16 Oct 2024 15:38:47 +0200 Subject: [PATCH 08/27] fix: add nodes as seral objects --- doc/source/conf.py | 5 ++-- src/ansys_sphinx_theme/search/fuse_search.py | 29 +++++++------------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index df9c5563..8972785b 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -11,7 +11,6 @@ from sphinx.builders.latex import LaTeXBuilder from ansys_sphinx_theme import ( - ALL_NODES, PARAGRAPHS, TITLE, __version__, @@ -76,8 +75,8 @@ "minMatchCharLength": 3, "ignoreLocation": True, "index_patterns": { - "examples/api/": ALL_NODES, - "examples/sphinx_examples/": TITLE + PARAGRAPHS, + "examples/api/": PARAGRAPHS, + "examples/sphinx_examples/": TITLE, }, }, } diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index 8c2cda91..09fdca61 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -27,11 +27,11 @@ from docutils import nodes -PARAGRAPHS = [nodes.paragraph] -TITLE = [nodes.title] -LITERAL = [nodes.literal, nodes.literal_block] -ALL_NODES = [nodes.raw] -ALL_NODES_WITHOUT_RAW = [ +PARAGRAPHS = nodes.paragraph +TITLE = nodes.title +LITERAL = nodes.literal +ALL_NODES = nodes.raw +ALL_NODES_WITHOUT_RAW = [ # type: ignore nodes.paragraph, nodes.title, nodes.literal_block, @@ -70,18 +70,10 @@ def build_sections(self): """Build sections from the document tree.""" for node in self.doc_tree.traverse(nodes.section): section_title = node[0].astext() + print(self.pattern) + section_text = "\n".join( - n.astext() - for node_type in [ - nodes.paragraph, - nodes.literal_block, - nodes.literal, - nodes.list_item, - nodes.field_list, - nodes.compound, - nodes.block_quote, - ] - for n in node.traverse(node_type) + n.astext() for node_type in self.pattern for n in node.traverse(node_type) ) section_anchor_id = _title_to_anchor(section_title) @@ -166,7 +158,7 @@ def group_the_pages_with_pattern(app, all_docs): new_pattern[pattern] = files other_files = [doc for doc in all_docs if doc not in new_pattern] - new_pattern["other"] = other_files + new_pattern["all_except_raw"] = other_files return new_pattern @@ -187,10 +179,9 @@ def create_search_index(app, exception): search_index_list = [] get_pattern = group_the_pages_with_pattern(app, app.env.found_docs) - print(get_pattern) - exit(1) for pattern, docs in get_pattern.items(): for document in docs: + # convert pattern to list search_index = SearchIndex(document, app, pattern) search_index.build_sections() search_index_list.extend(search_index.indices) From cf82f5c012f6f6f54ad2bbd846cf55dbea8aeef1 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 17 Oct 2024 09:22:48 +0200 Subject: [PATCH 09/27] fix: add config options --- doc/source/conf.py | 10 ++-- src/ansys_sphinx_theme/search/__init__.py | 1 + src/ansys_sphinx_theme/search/fuse_search.py | 55 +++++++++++++------- 3 files changed, 44 insertions(+), 22 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 8972785b..4a84bf7a 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -11,6 +11,7 @@ from sphinx.builders.latex import LaTeXBuilder from ansys_sphinx_theme import ( + ALL_NODES, PARAGRAPHS, TITLE, __version__, @@ -74,13 +75,14 @@ "limit": 7, "minMatchCharLength": 3, "ignoreLocation": True, - "index_patterns": { - "examples/api/": PARAGRAPHS, - "examples/sphinx_examples/": TITLE, - }, }, } +index_patterns = { + "examples/api/": ALL_NODES, + "examples/sphinx_examples/": TITLE + PARAGRAPHS, +} + nbsphinx_prolog = """ Download this example as a :download:`Jupyter notebook `. diff --git a/src/ansys_sphinx_theme/search/__init__.py b/src/ansys_sphinx_theme/search/__init__.py index bc6015f3..fb544934 100644 --- a/src/ansys_sphinx_theme/search/__init__.py +++ b/src/ansys_sphinx_theme/search/__init__.py @@ -44,6 +44,7 @@ def update_search_config(app: Sphinx) -> None: theme_static_options["keys"] = ["title", "text"] theme_static_options["threshold"] = theme_static_options.get("threshold", 0.5) theme_static_options["limit"] = theme_static_options.get("limit", 10) + app.add_config_value("index_patterns", {}, "html") __all__ = [ diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index 09fdca61..feeebcd8 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -27,10 +27,10 @@ from docutils import nodes -PARAGRAPHS = nodes.paragraph -TITLE = nodes.title -LITERAL = nodes.literal -ALL_NODES = nodes.raw +PARAGRAPHS = [nodes.paragraph] +TITLE = [nodes.title] +LITERAL = [nodes.literal] +ALL_NODES = [nodes.Text] ALL_NODES_WITHOUT_RAW = [ # type: ignore nodes.paragraph, nodes.title, @@ -146,8 +146,10 @@ def _title_to_anchor(title: str) -> str: def group_the_pages_with_pattern(app, all_docs): """Group the pages with the pattern in the search index.""" - options = app.config.html_theme_options.get("static_search", {}) - patterns = options.get("index_patterns", {}) + if getattr(app.env.config, "index_patterns"): + patterns = app.env.config.index_patterns + else: + patterns = {} new_pattern = {} if not isinstance(patterns, dict): @@ -162,6 +164,20 @@ def group_the_pages_with_pattern(app, all_docs): return new_pattern +def get_pattern_for_each_page(app, doc_name): + """Get the pattern for each page in the search index.""" + if getattr(app.env.config, "index_patterns"): + patterns = app.env.config.index_patterns + else: + patterns = {} + + for filename, pattern in patterns.items(): + if doc_name.startswith(filename): + return pattern + + return ALL_NODES_WITHOUT_RAW + + def create_search_index(app, exception): """ Generate search index at the end of the Sphinx build process. @@ -178,18 +194,21 @@ def create_search_index(app, exception): search_index_list = [] - get_pattern = group_the_pages_with_pattern(app, app.env.found_docs) - for pattern, docs in get_pattern.items(): - for document in docs: - # convert pattern to list - search_index = SearchIndex(document, app, pattern) - search_index.build_sections() - search_index_list.extend(search_index.indices) - - # for document in app.env.found_docs: - # search_index = SearchIndex(document, app) - # search_index.build_sections() - # search_index_list.extend(search_index.indices) + # get_pattern = group_the_pages_with_pattern(app, app.env.found_docs) + # print(get_pattern) + # exit(1) + # for pattern, docs in get_pattern.items(): + # for document in docs: + # # convert pattern to list + # search_index = SearchIndex(document, app, pattern) + # search_index.build_sections() + # search_index_list.extend(search_index.indices) + + for document in app.env.found_docs: + pattern = get_pattern_for_each_page(app, document) + search_index = SearchIndex(document, app, pattern) + search_index.build_sections() + search_index_list.extend(search_index.indices) search_index_path = app.builder.outdir / "_static" / "search.json" with search_index_path.open("w", encoding="utf-8") as index_file: From 2a2d382c0cd29127b2bab7aea6cf9aa62f10bf3e Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 17 Oct 2024 09:43:51 +0200 Subject: [PATCH 10/27] fix: cleanup the codes --- src/ansys_sphinx_theme/search/fuse_search.py | 33 -------------------- 1 file changed, 33 deletions(-) diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index feeebcd8..7e52e6f6 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -34,8 +34,6 @@ ALL_NODES_WITHOUT_RAW = [ # type: ignore nodes.paragraph, nodes.title, - nodes.literal_block, - nodes.literal, nodes.list_item, nodes.field_list, nodes.compound, @@ -70,7 +68,6 @@ def build_sections(self): """Build sections from the document tree.""" for node in self.doc_tree.traverse(nodes.section): section_title = node[0].astext() - print(self.pattern) section_text = "\n".join( n.astext() for node_type in self.pattern for n in node.traverse(node_type) @@ -144,26 +141,6 @@ def _title_to_anchor(title: str) -> str: return re.sub(r"[^\w\s-]", "", title.lower().strip().replace(" ", "-")) -def group_the_pages_with_pattern(app, all_docs): - """Group the pages with the pattern in the search index.""" - if getattr(app.env.config, "index_patterns"): - patterns = app.env.config.index_patterns - else: - patterns = {} - - new_pattern = {} - if not isinstance(patterns, dict): - raise ValueError("index_patterns must be a dictionary") - - for filename, pattern in patterns.items(): - files = [doc for doc in all_docs if doc.startswith(filename)] - new_pattern[pattern] = files - - other_files = [doc for doc in all_docs if doc not in new_pattern] - new_pattern["all_except_raw"] = other_files - return new_pattern - - def get_pattern_for_each_page(app, doc_name): """Get the pattern for each page in the search index.""" if getattr(app.env.config, "index_patterns"): @@ -194,16 +171,6 @@ def create_search_index(app, exception): search_index_list = [] - # get_pattern = group_the_pages_with_pattern(app, app.env.found_docs) - # print(get_pattern) - # exit(1) - # for pattern, docs in get_pattern.items(): - # for document in docs: - # # convert pattern to list - # search_index = SearchIndex(document, app, pattern) - # search_index.build_sections() - # search_index_list.extend(search_index.indices) - for document in app.env.found_docs: pattern = get_pattern_for_each_page(app, document) search_index = SearchIndex(document, app, pattern) From 908212f9b9ff899d38282d345340d22c73a31090 Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Thu, 17 Oct 2024 12:02:50 +0200 Subject: [PATCH 11/27] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jorge Martínez <28702884+jorgepiloto@users.noreply.github.com> --- src/ansys_sphinx_theme/search/fuse_search.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index 7e52e6f6..c2e9ae60 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -143,10 +143,7 @@ def _title_to_anchor(title: str) -> str: def get_pattern_for_each_page(app, doc_name): """Get the pattern for each page in the search index.""" - if getattr(app.env.config, "index_patterns"): - patterns = app.env.config.index_patterns - else: - patterns = {} + patterns = app.env.config.get("index_patterns", {}) for filename, pattern in patterns.items(): if doc_name.startswith(filename): From 95ae207ab6c791ac5672afd85ec05f855e1656e9 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 17 Oct 2024 12:48:11 +0200 Subject: [PATCH 12/27] fix: add all init --- src/ansys_sphinx_theme/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ansys_sphinx_theme/__init__.py b/src/ansys_sphinx_theme/__init__.py index 2532d884..87a316b3 100644 --- a/src/ansys_sphinx_theme/__init__.py +++ b/src/ansys_sphinx_theme/__init__.py @@ -33,10 +33,9 @@ from sphinx.application import Sphinx from ansys_sphinx_theme.extension.linkcode import DOMAIN_KEYS, sphinx_linkcode_resolve -from ansys_sphinx_theme.latex import generate_404 # noqa: F401 -from ansys_sphinx_theme.search import ( # noqa: F401 +from ansys_sphinx_theme.latex import generate_404 +from ansys_sphinx_theme.search import ( ALL_NODES, - LITERAL, PARAGRAPHS, TITLE, create_search_index, @@ -585,3 +584,6 @@ def setup(app: Sphinx) -> Dict: "parallel_read_safe": True, "parallel_write_safe": True, } + + +__all__ = ["__version__", "generate_404", "get_version_match", "TITLE", "PARAGRAPHS", "ALL_NODES"] From adcbb8a1ad8b7a66cc2c64edc14d709c743d2676 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 17 Oct 2024 13:04:40 +0200 Subject: [PATCH 13/27] fix: config values --- src/ansys_sphinx_theme/search/fuse_search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index c2e9ae60..4f263f50 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -143,7 +143,7 @@ def _title_to_anchor(title: str) -> str: def get_pattern_for_each_page(app, doc_name): """Get the pattern for each page in the search index.""" - patterns = app.env.config.get("index_patterns", {}) + patterns = app.env.config.index_patterns or {} for filename, pattern in patterns.items(): if doc_name.startswith(filename): From cf9e07822123a307368c16f852f945f3e3e1feac Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Tue, 22 Oct 2024 11:44:22 +0000 Subject: [PATCH 14/27] chore: adding changelog file 541.miscellaneous.md [dependabot-skip] --- doc/changelog.d/{541.fixed.md => 541.miscellaneous.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/changelog.d/{541.fixed.md => 541.miscellaneous.md} (100%) diff --git a/doc/changelog.d/541.fixed.md b/doc/changelog.d/541.miscellaneous.md similarity index 100% rename from doc/changelog.d/541.fixed.md rename to doc/changelog.d/541.miscellaneous.md From d3984a58b030b32aa8978ea16d2aceb025a75242 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Tue, 22 Oct 2024 13:52:55 +0200 Subject: [PATCH 15/27] fix: update the title name --- doc/source/conf.py | 4 ++-- src/ansys_sphinx_theme/__init__.py | 4 ++-- src/ansys_sphinx_theme/search/__init__.py | 4 ++-- src/ansys_sphinx_theme/search/fuse_search.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 931b2b45..5ef2cf16 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -13,7 +13,7 @@ from ansys_sphinx_theme import ( ALL_NODES, PARAGRAPHS, - TITLE, + TITLES, __version__, ansys_favicon, ansys_logo_white, @@ -71,7 +71,7 @@ index_patterns = { "examples/api/": ALL_NODES, - "examples/sphinx_examples/": TITLE + PARAGRAPHS, + "examples/sphinx_examples/": TITLES + PARAGRAPHS, } diff --git a/src/ansys_sphinx_theme/__init__.py b/src/ansys_sphinx_theme/__init__.py index 87a316b3..f6640713 100644 --- a/src/ansys_sphinx_theme/__init__.py +++ b/src/ansys_sphinx_theme/__init__.py @@ -37,7 +37,7 @@ from ansys_sphinx_theme.search import ( ALL_NODES, PARAGRAPHS, - TITLE, + TITLES, create_search_index, update_search_config, ) @@ -586,4 +586,4 @@ def setup(app: Sphinx) -> Dict: } -__all__ = ["__version__", "generate_404", "get_version_match", "TITLE", "PARAGRAPHS", "ALL_NODES"] +__all__ = ["__version__", "generate_404", "get_version_match", "TITLEs", "PARAGRAPHS", "ALL_NODES"] diff --git a/src/ansys_sphinx_theme/search/__init__.py b/src/ansys_sphinx_theme/search/__init__.py index 189080c2..4359f475 100644 --- a/src/ansys_sphinx_theme/search/__init__.py +++ b/src/ansys_sphinx_theme/search/__init__.py @@ -27,7 +27,7 @@ ALL_NODES, LITERAL, PARAGRAPHS, - TITLE, + TITLES, create_search_index, ) @@ -53,6 +53,6 @@ def update_search_config(app: Sphinx) -> None: "update_search_config", "LITERAL", "PARAGRAPHS", - "TITLE", + "TITLES", "ALL_NODES", ] diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index 4f263f50..1fece1fe 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -28,7 +28,7 @@ from docutils import nodes PARAGRAPHS = [nodes.paragraph] -TITLE = [nodes.title] +TITLES = [nodes.title] LITERAL = [nodes.literal] ALL_NODES = [nodes.Text] ALL_NODES_WITHOUT_RAW = [ # type: ignore From 59dc7a937ef9d138ca5b2ee735a224e0120800bd Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Tue, 22 Oct 2024 14:45:58 +0200 Subject: [PATCH 16/27] fix: update the default minimum patterns --- src/ansys_sphinx_theme/search/fuse_search.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index 1fece1fe..6f3ea1f0 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -31,14 +31,7 @@ TITLES = [nodes.title] LITERAL = [nodes.literal] ALL_NODES = [nodes.Text] -ALL_NODES_WITHOUT_RAW = [ # type: ignore - nodes.paragraph, - nodes.title, - nodes.list_item, - nodes.field_list, - nodes.compound, - nodes.block_quote, -] +DEFAULT_PATTERN = PARAGRAPHS + TITLES + LITERAL class SearchIndex: @@ -149,7 +142,7 @@ def get_pattern_for_each_page(app, doc_name): if doc_name.startswith(filename): return pattern - return ALL_NODES_WITHOUT_RAW + return DEFAULT_PATTERN def create_search_index(app, exception): From 3040dacaf4d506d92423bda793be6a68b855028d Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Tue, 22 Oct 2024 16:09:31 +0200 Subject: [PATCH 17/27] Update doc/source/conf.py --- doc/source/conf.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 5ef2cf16..90a0e31f 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -181,8 +181,7 @@ def extract_example_links( list List of example links. """ - token = os.getenv("GITHUB_TOKEN") - g = Github(token) + g = Github() repo = g.get_repo(repo_fullname) contents = repo.get_contents(path_relative_to_root) if not isinstance(contents, list): From f3b59bd187b5ffd2ebc81ad92ae67f7e2eb3fad2 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 24 Oct 2024 10:22:58 +0200 Subject: [PATCH 18/27] fix: add desc nodes --- src/ansys_sphinx_theme/search/fuse_search.py | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index 6f3ea1f0..f2a5766b 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -26,6 +26,7 @@ import re from docutils import nodes +from docutils.nodes import Element PARAGRAPHS = [nodes.paragraph] TITLES = [nodes.title] @@ -60,6 +61,15 @@ def __init__(self, doc_name, app, pattern=None): def build_sections(self): """Build sections from the document tree.""" for node in self.doc_tree.traverse(nodes.section): + subsections = list(node.traverse(nodes.section)) + if len(subsections) > 1: + # get only the first section + main_section = subsections[0] + # remove subsections from the main section + for n in main_section.traverse(nodes.section): + n.parent.remove(n) + node = main_section + section_title = node[0].astext() section_text = "\n".join( @@ -75,6 +85,19 @@ def build_sections(self): } ) + for n in node.traverse(Element): + if n.tagname == "desc": + section_title = n[0].astext() + section_anchor_id = _dec_title_to_anchor(section_title) + section_text = n.astext() + self.sections.append( + { + "title": section_title, + "text": section_text, + "anchor_id": section_anchor_id, + } + ) + def generate_breadcrumbs(self, section_title: str) -> str: """ Generate title breadcrumbs from the document structure. @@ -129,6 +152,12 @@ def indices(self): } +def _dec_title_to_anchor(title: str) -> str: + """Convert title to anchor for the description.""" + # remove () at the end + return re.sub(r"\(.*\)$", "", title) + + def _title_to_anchor(title: str) -> str: """Convert a title to a URL-friendly anchor identifier.""" return re.sub(r"[^\w\s-]", "", title.lower().strip().replace(" ", "-")) From 33f18a042156a1cd988bdca150becf53b211d399 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 24 Oct 2024 10:46:40 +0200 Subject: [PATCH 19/27] fix: add desc nodes with achor id --- src/ansys_sphinx_theme/search/fuse_search.py | 50 ++++++++++++-------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index 08c131f1..264a7acf 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -60,15 +60,16 @@ def __init__(self, doc_name, app, pattern=None): self.pattern = pattern def build_sections(self): - """Build sections from the document tree.""" + """Build sections from the document tree, handling subsections and descriptions.""" for node in self.doc_tree.traverse(nodes.section): subsections = list(node.traverse(nodes.section)) + if len(subsections) > 1: # get only the first section main_section = subsections[0] # remove subsections from the main section - for n in main_section.traverse(nodes.section): - n.parent.remove(n) + for subsection in main_section.traverse(nodes.section): + subsection.parent.remove(subsection) node = main_section section_title = node[0].astext() @@ -86,18 +87,31 @@ def build_sections(self): } ) - for n in node.traverse(Element): - if n.tagname == "desc": - section_title = n[0].astext() - section_anchor_id = _dec_title_to_anchor(section_title) - section_text = n.astext() - self.sections.append( - { - "title": section_title, - "text": section_text, - "anchor_id": section_anchor_id, - } - ) + self._process_desc_element(node) + + def _process_desc_element(self, node): + """Process `desc` element within a section.""" + for element in node.traverse(Element): + if element.tagname != "desc": + continue + + section_title = element[0].astext() + # id is the id tag of the desc element + section_anchor_id = element.attributes["ids"] + + if element.children: + for element_child in element.children: + if element_child.tagname != "desc_signature": + continue + section_anchor_id = element_child.attributes["ids"][0] + section_text = element.astext() + self.sections.append( + { + "title": section_title, + "text": section_text, + "anchor_id": section_anchor_id, + } + ) def generate_breadcrumbs(self, section_title: str) -> str: """ @@ -153,12 +167,6 @@ def indices(self): } -def _dec_title_to_anchor(title: str) -> str: - """Convert title to anchor for the description.""" - # remove () at the end - return re.sub(r"\(.*\)$", "", title) - - def _title_to_anchor(title: str) -> str: """Convert a title to a URL-friendly anchor identifier.""" return re.sub(r"[^\w\s-]", "", title.lower().strip().replace(" ", "-")) From 571dfbada9140bfde00bbe3478ef64a88e441b61 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 24 Oct 2024 10:55:42 +0200 Subject: [PATCH 20/27] fix: add proper title --- src/ansys_sphinx_theme/search/fuse_search.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index 264a7acf..7e3aff08 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -87,24 +87,23 @@ def build_sections(self): } ) - self._process_desc_element(node) + self._process_desc_element(node, section_title) - def _process_desc_element(self, node): + def _process_desc_element(self, node, title): """Process `desc` element within a section.""" for element in node.traverse(Element): if element.tagname != "desc": continue - section_title = element[0].astext() # id is the id tag of the desc element section_anchor_id = element.attributes["ids"] - if element.children: for element_child in element.children: if element_child.tagname != "desc_signature": continue section_anchor_id = element_child.attributes["ids"][0] section_text = element.astext() + section_title = f"{title} > {section_anchor_id}" self.sections.append( { "title": section_title, From 327dc74648621a31fa11f6c443d967dee396fa8f Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 24 Oct 2024 12:20:57 +0200 Subject: [PATCH 21/27] fix: ignore changelog from linkchcek --- doc/source/conf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index 90a0e31f..61f65616 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -142,6 +142,8 @@ rst_epilog += f.read() +linkcheck_exclude_documents = ["changelog"] + linkcheck_ignore = [ r"https://sphinxdocs.ansys.com/version/*", ] From 89081f394fe644e0055c455e5a34ebf6360883ac Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 24 Oct 2024 14:58:48 +0200 Subject: [PATCH 22/27] fix: anchor to title --- src/ansys_sphinx_theme/search/fuse_search.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ansys_sphinx_theme/search/fuse_search.py b/src/ansys_sphinx_theme/search/fuse_search.py index 7e3aff08..74c40f66 100644 --- a/src/ansys_sphinx_theme/search/fuse_search.py +++ b/src/ansys_sphinx_theme/search/fuse_search.py @@ -103,7 +103,7 @@ def _process_desc_element(self, node, title): continue section_anchor_id = element_child.attributes["ids"][0] section_text = element.astext() - section_title = f"{title} > {section_anchor_id}" + section_title = _desc_anchor_to_title(title, section_anchor_id) self.sections.append( { "title": section_title, @@ -166,6 +166,12 @@ def indices(self): } +def _desc_anchor_to_title(title, anchor): + """Convert a desc anchor to a title.""" + anchor_title = anchor.split(".")[-1] + return f"{title} > {anchor_title}" + + def _title_to_anchor(title: str) -> str: """Convert a title to a URL-friendly anchor identifier.""" return re.sub(r"[^\w\s-]", "", title.lower().strip().replace(" ", "-")) From 7042a2219e77612c9329c10d284f9ef2611159e7 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 24 Oct 2024 17:17:09 +0200 Subject: [PATCH 23/27] docs: add documentation for index patterns --- doc/source/user-guide/options.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/doc/source/user-guide/options.rst b/doc/source/user-guide/options.rst index 2fe8e646..b8a751c8 100644 --- a/doc/source/user-guide/options.rst +++ b/doc/source/user-guide/options.rst @@ -124,6 +124,23 @@ the ``delay`` key in the ``static_search`` dictionary with a value specifying the amount of milliseconds to wait before executing the search. A value of ``0`` disables the debounce function. +To customise the indexing of your documentation, you can use the ``index_patterns`` dictionary in the ``conf.py`` file. +This dictionary contains the paths to the directories you want to index and the type of nodes to index. +The type of nodes can be ``ALL_NODES``, ``TITLES`` or ``PARAGRAPHS``. +The default value is ``TITLES + PARAGRAPHS``. + +Here is an example of how to add the ``index_patterns`` dictionary to the `conf.py`` file: + +.. code-block:: python + + index_patterns = { + "api/": ALL_NODES, + "examples/": TITLES + PARAGRAPHS, + } + +The above example will index all nodes in the ``api/`` directory and only titles and paragraphs in the ``examples/`` directory. + + .. note:: All other options are available in the `Fuse.js documentation `_. From 7b8be929df6457d3569c886b15f0d5708b614398 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:18:02 +0000 Subject: [PATCH 24/27] chore: adding changelog file 541.documentation.md [dependabot-skip] --- doc/changelog.d/{541.miscellaneous.md => 541.documentation.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename doc/changelog.d/{541.miscellaneous.md => 541.documentation.md} (100%) diff --git a/doc/changelog.d/541.miscellaneous.md b/doc/changelog.d/541.documentation.md similarity index 100% rename from doc/changelog.d/541.miscellaneous.md rename to doc/changelog.d/541.documentation.md From 0b7f0552e99c991104464bd0b8ce81be34d60bb0 Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Fri, 25 Oct 2024 09:15:19 +0200 Subject: [PATCH 25/27] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jorge Martínez <28702884+jorgepiloto@users.noreply.github.com> --- doc/source/user-guide/options.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/user-guide/options.rst b/doc/source/user-guide/options.rst index b8a751c8..4b430b4f 100644 --- a/doc/source/user-guide/options.rst +++ b/doc/source/user-guide/options.rst @@ -138,7 +138,7 @@ Here is an example of how to add the ``index_patterns`` dictionary to the `conf. "examples/": TITLES + PARAGRAPHS, } -The above example will index all nodes in the ``api/`` directory and only titles and paragraphs in the ``examples/`` directory. +The above example indexes all nodes in the ``api/`` directory and only titles and paragraphs in the ``examples/`` directory. .. note:: From 0b19dab19c91f8b47cb70a04fad324a7b0ba1e79 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 25 Oct 2024 09:22:52 +0200 Subject: [PATCH 26/27] docs: remove linkchcek --- doc/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 61f65616..fa2b7004 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -142,7 +142,7 @@ rst_epilog += f.read() -linkcheck_exclude_documents = ["changelog"] +# linkcheck_exclude_documents = ["changelog"] linkcheck_ignore = [ r"https://sphinxdocs.ansys.com/version/*", From 290dcc04e601b2b77636b345aa1b7e1e41a19a8b Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Fri, 25 Oct 2024 09:37:00 +0200 Subject: [PATCH 27/27] Apply suggestions from code review --- doc/source/conf.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index fa2b7004..1e3f8c13 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -65,7 +65,6 @@ "threshold": 0.2, "limit": 7, "minMatchCharLength": 3, - "ignoreLocation": True, }, } @@ -142,8 +141,6 @@ rst_epilog += f.read() -# linkcheck_exclude_documents = ["changelog"] - linkcheck_ignore = [ r"https://sphinxdocs.ansys.com/version/*", ]