From 82b996933d3ce0cc698ec4a06214126acdfa4cc3 Mon Sep 17 00:00:00 2001 From: Simon Exner Date: Wed, 22 Nov 2023 19:02:32 +0100 Subject: [PATCH] improved gif handling --- .github/workflows/Documentation.yml | 2 +- .github/workflows/Example.yml | 21 +++++++++++++-------- examples/src/juliacon_2023.ipynb | 2 +- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 27016766..9dab43ed 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -41,7 +41,7 @@ jobs: # copy the examples from the examples branch (.md, .svg) and copy the readme in the docs folder run: | git fetch - git --work-tree=$WORK_TREE/.. checkout $SRC_BRANCH -- $SRC_FOLDER_PATH/*.md $SRC_FOLDER_PATH/*.svg + git --work-tree=$WORK_TREE/.. checkout $SRC_BRANCH -- $SRC_FOLDER_PATH/*.md $SRC_FOLDER_PATH/*.svg $SRC_FOLDER_PATH/*.gif mv $WORK_TREE/src/* $WORK_TREE rm -r $WORK_TREE/src cp ./README.md ./docs/src/index.md diff --git a/.github/workflows/Example.yml b/.github/workflows/Example.yml index 74b77f27..0f667bda 100644 --- a/.github/workflows/Example.yml +++ b/.github/workflows/Example.yml @@ -48,15 +48,20 @@ jobs: jupyter nbconvert --to script ${{ env.FILE }} jupyter nbconvert --to markdown ${{ env.FILE }} - - name: "Fix GIF" + - name: "Fix GIFs" run: | - if ("${{ matrix.file-name }}" -eq "juliacon_2023") - { - echo "starting the mess" - $env:Path += ";C:\Program Files\Git\usr\bin" - sed -i -E 's~()~\`\`\`@raw html\n\1\n\`\`\`~g' examples/src/${{ matrix.file-name }}.md - echo "mess finished" - } + echo "starting gif fixing" + echo $(ls) + echo $(ls examples/src) + echo $(ls examples/src/${{ matrix.file-name }}_files) + mv examples/src/gif_*.gif examples/src/${{ matrix.file-name }}_files + $env:Path += ";C:\Program Files\Git\usr\bin" + awk '{if($0~//) {sub(//,\"![gif](gif_\"++i\".gif)\")}}1' examples/src/${{ matrix.file-name }}.md > examples/src/tmp_${{ matrix.file-name }}.md + mv -Force examples/src/tmp_${{ matrix.file-name }}.md examples/src/${{ matrix.file-name }}.md + echo $(ls) + echo $(ls examples/src) + echo $(ls examples/src/${{ matrix.file-name }}_files) + echo "gifs should be fixed" - name: Archive examples artifacts if: success() && matrix.os == 'windows-latest' diff --git a/examples/src/juliacon_2023.ipynb b/examples/src/juliacon_2023.ipynb index 8848b441..0edfd070 100644 --- a/examples/src/juliacon_2023.ipynb +++ b/examples/src/juliacon_2023.ipynb @@ -909,7 +909,7 @@ "metadata": {}, "outputs": [], "source": [ - "plotEnhancements(neuralFMU, fmu, data; filename=joinpath(@__DIR__, \"NFMU_consumption.gif\"))" + "plotEnhancements(neuralFMU, fmu, data; filename=joinpath(@__DIR__, \"gif_1.gif\"))" ] }, {