From 21e6067879d16ac8df9f704f2e7c50f58f9d8806 Mon Sep 17 00:00:00 2001 From: vnamdeo Date: Mon, 16 Dec 2024 14:32:44 +0530 Subject: [PATCH] added new pyworkbench cheatsheet to other scripts --- make.bat | 13 +++++++++++++ makefile | 11 ++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/make.bat b/make.bat index f3c4074..76e6fdc 100644 --- a/make.bat +++ b/make.bat @@ -16,6 +16,7 @@ if "%1" == "pydynamicreporting_cheat_sheet" goto pydynamicreporting_cheat_sheet if "%1" == "pyensight_cheat_sheet" goto pyensight_cheat_sheet if "%1" == "pydpf-post_cheat_sheet" goto pydpf-post_cheat_sheet if "%1" == "pymotorcad_cheat_sheet" goto pymotorcad_cheat_sheet +if "%1" == "pyworkbench_cheat_sheet" goto pyworkbench_cheat_sheet if "%1" == "clean" goto clean if "%1" == "help" goto help if "%1" == "" goto help @@ -119,6 +120,16 @@ exit /b 1) Echo "pdf generated!" goto end +:pyworkbench_cheat_sheet +set SCRIPT_PATH=cheat_sheets/pyworkbench_cheat_sheet/pyworkbench_script.py +CALL :run_script +pdflatex -output-directory=%BUILDDIR% cheat_sheets/pyworkbench_cheat_sheet/pyworkbench_cheat_sheet.tex --interaction=nonstopmode +if NOT EXIST %BUILDDIR%/pyworkbench_cheat_sheet.pdf( +Echo "no pdf generated!" +exit /b 1) +Echo "pdf generated!" +goto end + :all CALL :pymapdl_cheat_sheet CALL :pyaedt_API_cheat_sheet @@ -131,6 +142,7 @@ CALL :pydynamicreporting_cheat_sheet CALL :pyensight_cheat_sheet CALL :pydpf-post_cheat_sheet CALL :pymotorcad_cheat_sheet +CALL :pyworkbench_cheat_sheet goto end :run_script @@ -160,6 +172,7 @@ echo pymechanical_cheat_sheet: Build the pymechanical cheatsheet echo pydynamicreporting_cheat_sheet: Build the pydynamicreporting cheatsheet echo pyensight_cheat_sheet: Build the pydynamicreporting cheatsheet echo pymotorcad_cheat_sheat: Build the pymotorcad cheatsheet +echo pyworkbench_cheat_sheat: Build the pyworkbench cheatsheet :end popd \ No newline at end of file diff --git a/makefile b/makefile index 0538c07..588fedf 100644 --- a/makefile +++ b/makefile @@ -1,6 +1,6 @@ BUILD_DIR = _build -CHEATSHEETS=pymapdl_cheat_sheet pyfluent_cheat_sheet pyaedt_API_cheat_sheet pyedb_API_cheat_sheet pyprimemesh_cheat_sheet pydpf-core_cheat_sheet pymotorcad_cheat_sheet pymechanical_cheat_sheet pydynamicreporting_cheat_sheet pyensight_cheat_sheet pydpf-post_cheat_sheet +CHEATSHEETS=pymapdl_cheat_sheet pyfluent_cheat_sheet pyaedt_API_cheat_sheet pyedb_API_cheat_sheet pyprimemesh_cheat_sheet pydpf-core_cheat_sheet pymotorcad_cheat_sheet pymechanical_cheat_sheet pydynamicreporting_cheat_sheet pyensight_cheat_sheet pydpf-post_cheat_sheet pyworkbench_cheat_sheet .PHONY: all clean help @@ -60,14 +60,18 @@ pydpf-post_cheat_sheet: convert -density 150 -scene 1 $(BUILD_DIR)/pydpf-post_cheat_sheet.pdf $(BUILD_DIR)/pydpf-post_cheat_sheet.png (test -f $(BUILD_DIR)/pydpf-post_cheat_sheet.pdf && echo pdf exists) || exit 1 - - pymotorcad_cheat_sheet: make run_script SCRIPT_PATH='cheat_sheets/pymotorcad_cheat_sheet/pymotorcad_script.py' latexmk -f -pdf -use-make -outdir=$(BUILD_DIR) cheat_sheets/pymotorcad_cheat_sheet/pymotorcad_cheat_sheet.tex -interaction=nonstopmode || true convert -density 150 -scene 1 $(BUILD_DIR)/pymotorcad_cheat_sheet.pdf $(BUILD_DIR)/pymotorcad_cheat_sheet.png (test -f $(BUILD_DIR)/pymotorcad_cheat_sheet.pdf && echo pdf exists) || (echo "Failed to generate PDF" && exit 1) +pyworkbench_cheat_sheet: + make run_script SCRIPT_PATH='cheat_sheets/pyworkbench_cheat_sheet/pyworkbench_script.py' + latexmk -f -pdf -use-make -outdir=$(BUILD_DIR) cheat_sheets/pyworkbench_cheat_sheet/pyworkbench_cheat_sheet.tex -interaction=nonstopmode || true + convert -density 150 -scene 1 $(BUILD_DIR)/pyworkbench_cheat_sheet.pdf $(BUILD_DIR)/pyworkbench_cheat_sheet.png + (test -f $(BUILD_DIR)/pyworkbench_cheat_sheet.pdf && echo pdf exists) || (echo "Failed to generate PDF" && exit 1) + run_script: python3 scripts/generate_code_snippet.py $(SCRIPT_PATH) @@ -92,3 +96,4 @@ help: @echo " pydynamicreporting_cheat_sheet: Build the pydynamicreporting cheatsheet" @echo " pydpf-post_cheat_sheet: Build the pydpf-post cheatsheet" @echo " pymotorcad_cheat_sheet: Build the pymotorcad cheatsheet" + @echo " pyworkbench_cheat_sheet: Build the pyworkbench cheatsheet"