Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs build and serve scripts #68

Merged
merged 6 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading