Skip to content

Commit 84c948b

Browse files
committed
Remove CSS style blocks in Markdown reports
1 parent b8aafd4 commit 84c948b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/executeJupyterNotebook.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ echo "executeJupyterNotebook: jupyter_notebook_output_file_name=$jupyter_noteboo
6464
jupyter_notebook_output_file="./${jupyter_notebook_file_name}${JUPYTER_OUTPUT_FILE_POSTFIX}.${jupyter_notebook_file_extension}"
6565
echo "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+
6770
if [ ! -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,10 @@ jupyter nbconvert --to notebook \
114117
# Convert the Jupyter Notebook to Markdown
115118
jupyter nbconvert --to markdown --no-input "$jupyter_notebook_output_file" || exit 6
116119

120+
# Remove style blocks from Markdown file
121+
sed -E '/<style( scoped)?>/,/<\/style>/d' "${jupyter_notebook_markdown_file}" > "${jupyter_notebook_markdown_file}.nostyle"
122+
mv -f "${jupyter_notebook_markdown_file}.nostyle" "${jupyter_notebook_markdown_file}"
123+
117124
# Convert the Jupyter Notebook to PDF
118125
jupyter nbconvert --to webpdf --no-input --allow-chromium-download --disable-chromium-sandbox "$jupyter_notebook_output_file" || exit 7
119126

0 commit comments

Comments
 (0)