File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,9 @@ echo "executeJupyterNotebook: jupyter_notebook_output_file_name=$jupyter_noteboo
6464jupyter_notebook_output_file=" ./${jupyter_notebook_file_name}${JUPYTER_OUTPUT_FILE_POSTFIX} .${jupyter_notebook_file_extension} "
6565echo " executeJupyterNotebook: jupyter_notebook_output_file=$jupyter_notebook_output_file "
6666
67+ jupyter_notebook_markdown_file=" ./${jupyter_notebook_file_name}${JUPYTER_OUTPUT_FILE_POSTFIX} .md"
68+ echo " executeJupyterNotebook: jupyter_notebook_markdown_file=$jupyter_notebook_markdown_file "
69+
6770if [ ! -f " ${jupyter_notebook_file_path} /.env" ] ; then
6871 echo " executeJupyterNotebook: Creating file ${jupyter_notebook_file_path} .env ..."
6972 echo " NEO4J_INITIAL_PASSWORD=${NEO4J_INITIAL_PASSWORD} " > " ${jupyter_notebook_file_path} /.env"
@@ -114,6 +117,12 @@ jupyter nbconvert --to notebook \
114117# Convert the Jupyter Notebook to Markdown
115118jupyter nbconvert --to markdown --no-input " $jupyter_notebook_output_file " || exit 6
116119
120+ # Remove style blocks from Markdown file
121+ # The inplace option -i of sed doesn't seem to work at least on Mac in this case.
122+ # Therefore the temporary file ".nostyle" is created and then moved to overwrite the original markdown file.
123+ sed -E ' /<style( scoped)?>/,/<\/style>/d' " ${jupyter_notebook_markdown_file} " > " ${jupyter_notebook_markdown_file} .nostyle"
124+ mv -f " ${jupyter_notebook_markdown_file} .nostyle" " ${jupyter_notebook_markdown_file} "
125+
117126# Convert the Jupyter Notebook to PDF
118127jupyter nbconvert --to webpdf --no-input --allow-chromium-download --disable-chromium-sandbox " $jupyter_notebook_output_file " || exit 7
119128
You can’t perform that action at this time.
0 commit comments