Skip to content

Commit

Permalink
Merge pull request #2 from SandhyaKaliappan/polishing
Browse files Browse the repository at this point in the history
Update docs build and serve scripts
  • Loading branch information
SandhyaKaliappan authored Jan 2, 2025
2 parents 3ce24aa + 27b5b96 commit b8753d1
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 71 deletions.
24 changes: 6 additions & 18 deletions .github/workflows/deploy-website-mintlify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,9 @@ jobs:
- name: Install quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: Generate API documentation
run: |
python ./process_api_reference.py
working-directory: website

- name: Convert Jupyter notebooks to MDX
run: |
python ./process_notebooks.py render
working-directory: website
- name: Build documentation
run: ./scripts/docs_build.sh
working-directory: .

- name: Prepare website content
run: |
Expand Down Expand Up @@ -95,15 +89,9 @@ jobs:
- name: Install quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: Generate API documentation
run: |
python ./process_api_reference.py
working-directory: website

- name: Convert Jupyter notebooks to MDX
run: |
python ./process_notebooks.py render
working-directory: website
- name: Build documentation
run: ./scripts/docs_build.sh
working-directory: .

- name: Prepare website content
run: |
Expand Down
15 changes: 11 additions & 4 deletions scripts/docs_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
set -e
set -x

cd website &&
yarn install --frozen-lockfile --ignore-engines &&
pydoc-markdown &&
yarn build
# Function to build documentation
docs_build() {
cd website &&
python ./process_api_reference.py &&
python ./process_notebooks.py render
}

# Execute the function only if the script is run directly
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
docs_build
fi
17 changes: 13 additions & 4 deletions scripts/docs_serve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
set -e
set -x

cd website &&
yarn install --frozen-lockfile --ignore-engines &&
pydoc-markdown &&
yarn start
# Source the docs_build.sh script from the same directory
source "$(dirname "$0")/docs_build.sh"

# Run the docs_build function from docs_build.sh
docs_build

# Install npm packages
echo "Running npm install..."
npm install

# Add the command to serve the documentation
echo "Serving documentation..."
npm run mintlify:dev
12 changes: 2 additions & 10 deletions website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ pip install pydoc-markdown pyyaml termcolor nbclient
3. Finally, run the following commands to build and serve the documentation:

```console
cd website
python ./process_api_reference.py
python ./process_notebooks.py render
npm install
npm run mintlify:dev
./scripts/docs_serve.sh
```

The last command starts a local development server and opens up a browser window.
Expand All @@ -52,11 +48,7 @@ docker run -it -p 8081:3000 -v $(pwd):/home/autogen/ag2 ag2ai_dev_img bash
Once at the CLI in Docker run the following commands:

```console
cd website
python ./process_api_reference.py
python ./process_notebooks.py render
npm install
npm run mintlify:dev
./scripts/docs_serve.sh
```

Once done you should be able to access the documentation at `http://127.0.0.1:8081`
35 changes: 0 additions & 35 deletions website/build_website.sh

This file was deleted.

0 comments on commit b8753d1

Please sign in to comment.