diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 5d2bfe87d..f38a417dd 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -25,6 +25,9 @@ jobs: - name: Update docs run: | mkdir -p ooni-docs/src/content/docs/probe-engine/ + mkdir -p ooni-docs/src/assets/images-probe-engine/ + cp -R dist/docs/img/* ooni-docs/src/assets/images-probe-engine/ + rm -r dist/docs/img cp -R dist/docs/* ooni-docs/src/content/docs/probe-engine/ - name: Check for conflicting slugs @@ -36,6 +39,9 @@ jobs: - name: Print the lines of the generated docs run: wc -l ooni-docs/src/content/docs/probe-engine/* + - name: Print assets used in docs + run: ls ooni-docs/src/assets + - name: Commit changes # Only push the docs update when we are in master if: github.ref == 'refs/heads/master' @@ -44,5 +50,5 @@ jobs: git config --global user.email "github+backend@ooni.org" git config --global user.name "OONI Github Actions Bot" git add . - git commit -m "auto: update backend docs to ${{ steps.rev_parse.outputs.COMMIT_HASH }}" || echo "No changes to commit" + git commit -m "auto: update probe-engine docs to ${{ steps.rev_parse.outputs.COMMIT_HASH }}" || echo "No changes to commit" git push origin diff --git a/.gitignore b/.gitignore index 596fd77d2..25e82d801 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ /probe-cli.cov /tinyjafar /tmp-* +/dist diff --git a/script/build_docs.sh b/script/build_docs.sh index 6644ec450..739f5f861 100755 --- a/script/build_docs.sh +++ b/script/build_docs.sh @@ -1,4 +1,5 @@ #!/bin/bash +set +ex DOCS_ROOT=dist/docs/ REPO_NAME="ooni/probe-cli" COMMIT_HASH=$(git rev-parse --short HEAD) @@ -22,7 +23,10 @@ description: OONI Probe Engine documentation slug: probe-engine --- EOF -strip_title README.md >> $DOCS_ROOT/00-index.md +strip_title Readme.md >> $DOCS_ROOT/00-index.md +mkdir -p $DOCS_ROOT/img +cp docs/logo.png $DOCS_ROOT/img/ +sed -i 's+docs/logo.png+../../../assets/images-probe-engine/logo.png+' $DOCS_ROOT/00-index.md # design docs BASE_PATH=docs/design @@ -64,7 +68,7 @@ description: OONI netx package design documentation slug: probe-engine/design/netx --- EOF -strip_title $BASE_PATH/dd-02-netx.md >> $DOC_PATH +strip_title $BASE_PATH/dd-002-netx.md >> $DOC_PATH DOC_PATH=$DOCS_ROOT/03-design-step-by-step.md cat <$DOC_PATH @@ -78,6 +82,9 @@ slug: probe-engine/design/step-by-step --- EOF strip_title $BASE_PATH/dd-003-step-by-step.md >> $DOC_PATH +cp -R $BASE_PATH/img/* $DOCS_ROOT/img/ +sed -i 's+img/git-probe-cli-netx-deps.png+../../../assets/images-probe-engine/git-probe-cli-netx-deps.png+' $DOC_PATH +sed -i 's+img/git-probe-cli-change-histogram.png+../../../assets/images-probe-engine/git-probe-cli-change-histogram.png+' $DOC_PATH DOC_PATH=$DOCS_ROOT/04-design-minioonirunv2.md cat <$DOC_PATH