From 77bb1b0a820fd011124bcc446594fabaccf0e95c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arturo=20Filast=C3=B2?= Date: Fri, 5 Jul 2024 12:41:56 +0200 Subject: [PATCH 01/10] Start working on fixing image paths --- .gitignore | 1 + script/build_docs.sh | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index 596fd77d21..25e82d8014 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 6644ec450a..50d0a22200 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) @@ -78,6 +79,11 @@ slug: probe-engine/design/step-by-step --- EOF strip_title $BASE_PATH/dd-003-step-by-step.md >> $DOC_PATH +mkdir -p $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 +cp $BASE_PATH/img/git-probe-cli-netx-deps.png $DOCS_ROOT/img +sed -i 's+img/git-probe-cli-change-histogram.png+../../../assets/images-probe-engine/git-probe-cli-change-histogram.png+' $DOC_PATH +cp $BASE_PATH/img/git-probe-cli-change-histogram.png $DOCS_ROOT/img DOC_PATH=$DOCS_ROOT/04-design-minioonirunv2.md cat <$DOC_PATH From c4329735a7ba8885c9a945c46343e267d892e16d Mon Sep 17 00:00:00 2001 From: decfox Date: Fri, 5 Jul 2024 19:27:14 +0530 Subject: [PATCH 02/10] fix: shift images to assets --- .github/workflows/build_docs.yml | 1 + script/build_docs.sh | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 5d2bfe87df..d9610c85b2 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -26,6 +26,7 @@ jobs: run: | mkdir -p ooni-docs/src/content/docs/probe-engine/ cp -R dist/docs/* ooni-docs/src/content/docs/probe-engine/ + cp -R dist/docs/img/* ooni-docs/src/assets/ - name: Check for conflicting slugs run: | diff --git a/script/build_docs.sh b/script/build_docs.sh index 50d0a22200..c1b33e73d8 100755 --- a/script/build_docs.sh +++ b/script/build_docs.sh @@ -80,10 +80,9 @@ slug: probe-engine/design/step-by-step EOF strip_title $BASE_PATH/dd-003-step-by-step.md >> $DOC_PATH mkdir -p $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 -cp $BASE_PATH/img/git-probe-cli-netx-deps.png $DOCS_ROOT/img -sed -i 's+img/git-probe-cli-change-histogram.png+../../../assets/images-probe-engine/git-probe-cli-change-histogram.png+' $DOC_PATH -cp $BASE_PATH/img/git-probe-cli-change-histogram.png $DOCS_ROOT/img +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 From f67709c8eb3055e9a726d1ababbb96b5eba59064 Mon Sep 17 00:00:00 2001 From: decfox Date: Fri, 5 Jul 2024 19:33:45 +0530 Subject: [PATCH 03/10] fix: remove images from content --- .github/workflows/build_docs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index d9610c85b2..be186de87b 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -25,8 +25,9 @@ jobs: - name: Update docs run: | mkdir -p ooni-docs/src/content/docs/probe-engine/ - cp -R dist/docs/* ooni-docs/src/content/docs/probe-engine/ cp -R dist/docs/img/* ooni-docs/src/assets/ + rm -r dist/docs/img + cp -R dist/docs/* ooni-docs/src/content/docs/probe-engine/ - name: Check for conflicting slugs run: | From 08a4fe5b9f3044e671a27b0aa50ab4b7cdabd36f Mon Sep 17 00:00:00 2001 From: decfox Date: Fri, 5 Jul 2024 19:36:55 +0530 Subject: [PATCH 04/10] fix: update commit message to probe-engine --- .github/workflows/build_docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index be186de87b..9f073ca4b6 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -46,5 +46,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 From 7cd2dbcf0f49b92c35ce64a1db9daecc7bcf68e1 Mon Sep 17 00:00:00 2001 From: decfox Date: Fri, 5 Jul 2024 19:44:59 +0530 Subject: [PATCH 05/10] log moved assets --- .github/workflows/build_docs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 9f073ca4b6..ae68b7ad3d 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -38,6 +38,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' From 1dc235e15f881ee58dee77043820d088954f1d98 Mon Sep 17 00:00:00 2001 From: decfox Date: Fri, 5 Jul 2024 19:52:58 +0530 Subject: [PATCH 06/10] fix: sed for linux --- script/build_docs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/build_docs.sh b/script/build_docs.sh index c1b33e73d8..a884cb9fbd 100755 --- a/script/build_docs.sh +++ b/script/build_docs.sh @@ -81,8 +81,8 @@ EOF strip_title $BASE_PATH/dd-003-step-by-step.md >> $DOC_PATH mkdir -p $DOCS_ROOT/img 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 +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 From c5a39e2ef092b3e9b29b9a1d2b95cb623cffa4ae Mon Sep 17 00:00:00 2001 From: decfox Date: Fri, 5 Jul 2024 19:54:47 +0530 Subject: [PATCH 07/10] fix: netx doc reference --- script/build_docs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/build_docs.sh b/script/build_docs.sh index a884cb9fbd..9e4a54acd3 100755 --- a/script/build_docs.sh +++ b/script/build_docs.sh @@ -65,7 +65,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 From 597792032c68b8e782e3f8adb736c07d09a228bf Mon Sep 17 00:00:00 2001 From: decfox Date: Fri, 5 Jul 2024 20:07:24 +0530 Subject: [PATCH 08/10] feat: fix Readme and assets --- .github/workflows/build_docs.yml | 3 ++- script/build_docs.sh | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index ae68b7ad3d..f38a417dd3 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -25,7 +25,8 @@ jobs: - name: Update docs run: | mkdir -p ooni-docs/src/content/docs/probe-engine/ - cp -R dist/docs/img/* ooni-docs/src/assets/ + 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/ diff --git a/script/build_docs.sh b/script/build_docs.sh index 9e4a54acd3..aa15b4bca3 100755 --- a/script/build_docs.sh +++ b/script/build_docs.sh @@ -23,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' $DOC_PATH # design docs BASE_PATH=docs/design @@ -79,7 +82,6 @@ slug: probe-engine/design/step-by-step --- EOF strip_title $BASE_PATH/dd-003-step-by-step.md >> $DOC_PATH -mkdir -p $DOCS_ROOT/img 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 From 0a320fc0c6cc100e254f8982e8141482d8cd9dd7 Mon Sep 17 00:00:00 2001 From: decfox Date: Fri, 5 Jul 2024 20:09:41 +0530 Subject: [PATCH 09/10] fix: terminate sed replace --- script/build_docs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/build_docs.sh b/script/build_docs.sh index aa15b4bca3..696d01bd13 100755 --- a/script/build_docs.sh +++ b/script/build_docs.sh @@ -26,7 +26,7 @@ EOF 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' $DOC_PATH +sed -i 's+docs/logo.png+../../../assets/images-probe-engine/logo.png+' $DOC_PATH # design docs BASE_PATH=docs/design From d244e620c6306cf28e5f3984154dccfb508326b7 Mon Sep 17 00:00:00 2001 From: decfox Date: Fri, 5 Jul 2024 20:11:56 +0530 Subject: [PATCH 10/10] fix: add valid input for sed --- script/build_docs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/build_docs.sh b/script/build_docs.sh index 696d01bd13..739f5f8616 100755 --- a/script/build_docs.sh +++ b/script/build_docs.sh @@ -26,7 +26,7 @@ EOF 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+' $DOC_PATH +sed -i 's+docs/logo.png+../../../assets/images-probe-engine/logo.png+' $DOCS_ROOT/00-index.md # design docs BASE_PATH=docs/design