Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Fix single-page example generation #1961

Merged
merged 6 commits into from
Jul 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions .github/workflows/website/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ runs:
shell: bash
run: |
set -ex
for example in $(find ./web/content-docs/examples/ -mindepth 1 -maxdepth 1 -type d -not -iname previous)
for example in $(find ./web/docs/examples/ -mindepth 1 -maxdepth 1 -type d -not -iname previous)
do
ci/scripts/meld-example -d ${example}
done
Expand All @@ -119,7 +119,15 @@ runs:
do
echo "Creating pdf for example \"${example}\"..."
cd ${example}/single/
pandoc --pdf-engine=xelatex -V 'mainfont:DejaVuSerif.ttf' -V 'sansfont:DejaVuSans.ttf' -V 'monofont:DejaVuSansMono.ttf' index.html -o ../${example}.pdf

# "Fix" image links
sed "s:/img:../../../static/img:g" index.html > index_pdf.html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mind went on quite a trip trying to parse this sed statement before it finally clicked that you were using the colon as the delimited and not the traditional slashes. Which was exactly the right call


pandoc --pdf-engine=xelatex -V 'mainfont:DejaVuSerif.ttf' -V 'sansfont:DejaVuSans.ttf' -V 'monofont:DejaVuSansMono.ttf' index_pdf.html -o ../${example}.pdf

# Tidy up
rm index_pdf.html

cd ../../
done

Expand Down Expand Up @@ -150,3 +158,9 @@ runs:
chmod 0600 ./serverKey ./serverId
rsync -avz --delete -e "ssh -o UserKnownHostsFile=./serverId -i ./serverKey -p ${SERVER_PORT} -l ${SERVER_USER}" web/public/ ${SERVER_IP}:${SERVER_MAIN_DIR}
rsync -avz --delete -e "ssh -o UserKnownHostsFile=./serverId -i ./serverKey -p ${SERVER_PORT} -l ${SERVER_USER}" web/public-docs/ ${SERVER_IP}:${SERVER_DOCS_DIR}/dev

- name: Upload Web Artifacts
uses: actions/upload-artifact@v4
with:
name: web-artifacts
path: ${{ github.workspace }}/web/public*