From 3df45cc7bb2d94e7aff3f9ee1ac785886e98fca3 Mon Sep 17 00:00:00 2001 From: Dipin <26918585+dipinknair@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:00:49 -0500 Subject: [PATCH] MAINT: Cheat sheet (#871) Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> --- doc/changelog.d/871.documentation.md | 1 + doc/source/cheatsheet/cheat_sheet.qmd | 4 ++-- doc/source/conf.py | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 doc/changelog.d/871.documentation.md diff --git a/doc/changelog.d/871.documentation.md b/doc/changelog.d/871.documentation.md new file mode 100644 index 000000000..e52a61e40 --- /dev/null +++ b/doc/changelog.d/871.documentation.md @@ -0,0 +1 @@ +MAINT: Cheat sheet \ No newline at end of file diff --git a/doc/source/cheatsheet/cheat_sheet.qmd b/doc/source/cheatsheet/cheat_sheet.qmd index 4debf75c4..4927be8d7 100644 --- a/doc/source/cheatsheet/cheat_sheet.qmd +++ b/doc/source/cheatsheet/cheat_sheet.qmd @@ -1,7 +1,7 @@ --- title: PyMechanical cheat sheet format: cheat_sheet-pdf -version: 0.11.0 +version: main footer: PyMechanical footerlinks: - urls: 'https://mechanical.docs.pyansys.com/version/stable/' @@ -78,7 +78,7 @@ import ansys.mechanical.core as pymechanical # Connect locally mechanical = pymechanical.Mechanical(port=10000) # Or -# Connect remotely, specifying the IP address or hostname +# Connect remotely, to the IP address or hostname mechanical = pymechanical.Mechanical( "192.168.0.1", port=10000 ) diff --git a/doc/source/conf.py b/doc/source/conf.py index 9d901e235..a975ea93a 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -318,3 +318,17 @@ linkcheck_ignore.append( f"https://github.com/ansys/pymechanical/releases/tag/v{pymechanical.__version__}" ) + + +def replace_version_in_qmd(file_path, version): + """Update the version in cheatsheet.""" + with open(file_path, "r") as file: + content = file.read() + + content = content.replace("version: main", f"version: {version}") + + with open(file_path, "w") as file: + file.write(content) + + +replace_version_in_qmd("cheatsheet/cheat_sheet.qmd", version)