Skip to content

Commit

Permalink
Added a CI step for generating documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
eriq-augustine committed Aug 6, 2024
1 parent 7d69e1f commit 8168362
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ jobs:
shell: bash
run: ./run_tests.py

- name: Generate Documentation
shell: bash
run: ./gen_docs.sh

deploy-docs:
needs: [main]
if: ${{ github.event_name == 'push' && github.repository_owner == 'linqs' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) }}
Expand Down
29 changes: 26 additions & 3 deletions gen_docs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
#!/bin/bash

readonly THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Create HTML documentation for the current code.

trap exit SIGINT
readonly THIS_DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd | xargs realpath)"

pdoc3 --config show_inherited_members=True --html --force pacai
function main() {
if [[ $# -gt 1 ]]; then
echo "USAGE: $0 [out dir]"
exit 1
fi

set -e
trap exit SIGINT

local outputDir="${THIS_DIR}/html"
if [[ $# -gt 0 ]]; then
outputDir=$1
fi

cd "${THIS_DIR}"

mkdir -p "${outputDir}"

pdoc3 --config show_inherited_members=True --html --force --output-dir "${outputDir}" pacai

return 0
}

[[ "${BASH_SOURCE[0]}" == "${0}" ]] && main "$@"

0 comments on commit 8168362

Please sign in to comment.