Skip to content

Commit

Permalink
added new pyworkbench cheatsheet to other scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
vnamdeo committed Dec 16, 2024
1 parent 8ab1872 commit 21e6067
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
13 changes: 13 additions & 0 deletions make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
11 changes: 8 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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)
Expand All @@ -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"

0 comments on commit 21e6067

Please sign in to comment.