Skip to content

Commit 15c6b21

Browse files
fix: add version as params in cheatsheet (#521)
Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent 9f7b176 commit 15c6b21

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

doc/changelog.d/521.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fix: add version as params in cheatsheet

doc/source/user-guide/options.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ that contain these keys, in the order given:
169169
#. ``title``: Title of the cheat sheet to be displayed in the left navigation pane.
170170
#. ``pages``: List of names for the pages to include the cheat sheet on. If no value is provided,
171171
the cheat sheet is displayed only on the main ``index.html`` file.
172+
#. ``version``: Version of the cheat sheet. If no value is provided, the version is ``main`` by default.
172173

173174
Here is an example of how to add the ``cheatsheet`` dictionary to the `html_theme_options`` dictionary:
174175

@@ -178,6 +179,7 @@ Here is an example of how to add the ``cheatsheet`` dictionary to the `html_them
178179
{
179180
"cheatsheet": {
180181
"file": "<file name including the extension of the cheat sheet>",
182+
"version": "<version of the cheat sheet>",
181183
"pages": "<list of names for the pages to include the cheat sheet on>", # Optional
182184
},
183185
},
@@ -192,6 +194,7 @@ main ``index.rst`` file and the ``learning.rst`` file in its "Getting started" s
192194
{
193195
"cheatsheet": {
194196
"file": "getting_started/cheat_sheet.qmd",
197+
"version": f"{version}",
195198
"pages": ["index", "getting_started/learning"],
196199
},
197200
},

src/ansys_sphinx_theme/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@ def build_quarto_cheatsheet(app: Sphinx):
443443

444444
cheatsheet_file = cheatsheet_options.get("file", "")
445445
output_dir = "_static"
446+
version = cheatsheet_options.get("version", "main")
446447

447448
if not cheatsheet_file:
448449
return
@@ -475,6 +476,8 @@ def build_quarto_cheatsheet(app: Sphinx):
475476
"cheat_sheet-pdf",
476477
"--output-dir",
477478
output_dir_path,
479+
"-V",
480+
f"version={version}",
478481
],
479482
cwd=file_path,
480483
capture_output=True,

0 commit comments

Comments
 (0)