Skip to content

Commit df70429

Browse files
committed
don't filter number of content in what's new sidebar by default
1 parent ac9232a commit df70429

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

doc/source/user-guide/options.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ The dictionary contains the following keys:
323323
- ``no_of_headers``: Number of minor version sections to display in the what's new sidebar.
324324
By default, it is set to 3.
325325
- ``no_of_contents``: Number of what's new content to display under each minor version in the
326-
what's new sidebar. By default, it is set to 3.
326+
what's new sidebar. By default, it displays all dropdowns.
327327
- ``whatsnew_file``: Name of the YAML file containing what's new content. The YAML file should be
328328
in the ``doc/source`` directory.
329329
- ``changelog_file``: Name of the changelog file (RST) located in the ``doc/source`` directory.

src/ansys_sphinx_theme/__init__.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ def retrieve_whatsnew_input(app: Sphinx) -> tuple:
569569
no_of_headers = whatsnew_options.get("no_of_headers", 3)
570570
# Get the number of what's new content to display under each minor version in the sidebar.
571571
# By default, it's 3
572-
no_of_contents = whatsnew_options.get("no_of_contents", 3)
572+
no_of_contents = whatsnew_options.get("no_of_contents", None)
573573

574574
# Get the name of the whatsnew.yml file in doc/source. By default, it's "whatsnew"
575575
whatsnew_file = whatsnew_options.get("whatsnew_file", "whatsnew")
@@ -978,8 +978,9 @@ def extract_whatsnew(app, doctree, docname):
978978
# print("ids: ", ids)
979979

980980
# Filter the displayed children based on the number of content specified in the config
981-
if len(children) > whatsnew_config["no_of_contents"]:
982-
children = children[: whatsnew_config["no_of_contents"]]
981+
if whatsnew_config["no_of_contents"]:
982+
if len(children) > whatsnew_config["no_of_contents"]:
983+
children = children[: whatsnew_config["no_of_contents"]]
983984

984985
contents = {
985986
"title": f"{html_title} {version_title}",

0 commit comments

Comments
 (0)