Skip to content

Commit

Permalink
Start working on fixing image paths (#1635)
Browse files Browse the repository at this point in the history
This diff moves assets used in docs to `src/assets` in `ooni/docs` and
also replaces the doc references in markdown files to the appropriate
location.

---------

Co-authored-by: decfox <[email protected]>
Co-authored-by: decfox <[email protected]>
  • Loading branch information
3 people authored Jul 5, 2024
1 parent bb1017a commit e41f245
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand All @@ -44,5 +50,5 @@ jobs:
git config --global user.email "[email protected]"
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@
/probe-cli.cov
/tinyjafar
/tmp-*
/dist
11 changes: 9 additions & 2 deletions script/build_docs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set +ex
DOCS_ROOT=dist/docs/
REPO_NAME="ooni/probe-cli"
COMMIT_HASH=$(git rev-parse --short HEAD)
Expand All @@ -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
Expand Down Expand Up @@ -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 <<EOF>$DOC_PATH
Expand All @@ -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 <<EOF>$DOC_PATH
Expand Down

0 comments on commit e41f245

Please sign in to comment.