Skip to content

Commit 2072f82

Browse files
committed
Disable PDF generation by default
Support ENABLE_JUPYTER_NOTEBOOK_PDF_GENERATION environment variable.
1 parent 5afa7fa commit 2072f82

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

.github/workflows/code-structure-analysis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ jobs:
121121
shell: bash -el {0}
122122
env:
123123
NEO4J_INITIAL_PASSWORD: ${{ secrets.NEO4J_INITIAL_PASSWORD }}
124+
ENABLE_JUPYTER_NOTEBOOK_PDF_GENERATION: "true"
124125
run: |
125126
./../../scripts/analysis/analyze.sh
126127

COMMANDS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ If only the Jupyter reports are needed e.g. when the CSV reports had already bee
8383
./../../scripts/analysis/analyze.sh --report Jupyter
8484
```
8585
86-
#### Start an analysis without PDF generation
86+
#### Start an analysis with PDF generation
8787
88-
Generating a PDF from a Jupyter notebook using [nbconvert](https://nbconvert.readthedocs.io) might take a while or even fail due to a timeout error. Here is an example on how to skip PDF generation:
88+
Note: Generating a PDF from a Jupyter notebook using [nbconvert](https://nbconvert.readthedocs.io) takes some time and might even fail due to a timeout error.
8989
9090
```shell
91-
SKIP_JUPYTER_NOTEBOOK_PDF_GENERATION=true ./../../scripts/analysis/analyze.sh
91+
ENABLE_JUPYTER_NOTEBOOK_PDF_GENERATION=true ./../../scripts/analysis/analyze.sh
9292
```
9393
9494
#### Setup everything to explore the graph manually

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ The [Code Structure Analysis Pipeline](./.github/workflows/code-structure-analys
124124
- How can i trigger a full rescan of all artifacts?
125125
👉 Delete the file `artifactsChangeDetectionHash.txt` in the `artifacts` directory.
126126

127-
- How can PDF generation be skipped to speed up report generation and not depend on chromium?
128-
👉 Set environment variable `SKIP_JUPYTER_NOTEBOOK_PDF_GENERATION` to anything except an empty string. Example:
127+
- How can PDF generation for Jupyter Notebooks be enabled (depends on chromium, takes more time)?
128+
👉 Set environment variable `ENABLE_JUPYTER_NOTEBOOK_PDF_GENERATION` to anything except an empty string. Example:
129129

130130
```shell
131-
export SKIP_JUPYTER_NOTEBOOK_PDF_GENERATION="true"
131+
export ENABLE_JUPYTER_NOTEBOOK_PDF_GENERATION="true"
132132
```
133133

134-
👉 Or prepend your command with `SKIP_JUPYTER_NOTEBOOK_PDF_GENERATION="true"` like:
134+
👉 Alternatively prepend your command with `ENABLE_JUPYTER_NOTEBOOK_PDF_GENERATION="true"` like:
135135

136136
```shell
137-
SKIP_JUPYTER_NOTEBOOK_PDF_GENERATION=true ./../../scripts/analysis/analyze.sh
137+
ENABLE_JUPYTER_NOTEBOOK_PDF_GENERATION=true ./../../scripts/analysis/analyze.sh
138138
```

scripts/executeJupyterNotebook.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# Fail on any error ("-e" = exit on first error, "-o pipefail" exist on errors within piped commands)
2525
set -eo pipefail
2626

27-
SKIP_JUPYTER_NOTEBOOK_PDF_GENERATION=${SKIP_JUPYTER_NOTEBOOK_PDF_GENERATION:-""} # Skip PDF generation for Jupyter Notebooks if set to a non empty value e.g. "true"
27+
ENABLE_JUPYTER_NOTEBOOK_PDF_GENERATION=${ENABLE_JUPYTER_NOTEBOOK_PDF_GENERATION:-""} # Enable PDF generation for Jupyter Notebooks if set to any non empty value e.g. "true"
2828

2929
# Check if environment variable is set
3030
if [ -z "${NEO4J_INITIAL_PASSWORD}" ]; then
@@ -130,7 +130,7 @@ sed -E '/<style( scoped)?>/,/<\/style>/d' "${jupyter_notebook_markdown_file}" >
130130
mv -f "${jupyter_notebook_markdown_file}.nostyle" "${jupyter_notebook_markdown_file}"
131131

132132
# Convert the Jupyter Notebook to PDF
133-
if [ -z "${SKIP_JUPYTER_NOTEBOOK_PDF_GENERATION}" ]; then
133+
if [ -n "${ENABLE_JUPYTER_NOTEBOOK_PDF_GENERATION}" ]; then
134134
jupyter nbconvert --to webpdf --no-input --allow-chromium-download --disable-chromium-sandbox "$jupyter_notebook_output_file"
135135
fi
136136

0 commit comments

Comments
 (0)