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

Migrate Documentation from Docusaurus to Mintlify #210

Merged
merged 104 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
98a6a82
WIP
harishmohanraj Dec 12, 2024
a293334
Fix getting started
harishmohanraj Dec 12, 2024
15548b7
WIP: Fix mdx files
harishmohanraj Dec 13, 2024
7aa3caa
WIP: Fix autohen-studio and ecosystem mdx files
harishmohanraj Dec 13, 2024
bf20b62
Fix mdx files
harishmohanraj Dec 13, 2024
e7f3aee
Merge pull request #1 from harishmohanraj/mintlify-migration
harishmohanraj Dec 13, 2024
93225fb
Add workflow file to deploy mintlify docs
harishmohanraj Dec 13, 2024
94ccea7
Merge pull request #2 from harishmohanraj/add-ci-workflow
harishmohanraj Dec 13, 2024
7e05ef9
Merge branch 'ag2ai:main' into main
harishmohanraj Dec 13, 2024
86ea42f
Add home page and fix pre-commit errors
harishmohanraj Dec 16, 2024
3adcfc0
WIP: Add examples page
harishmohanraj Dec 16, 2024
c421ff0
WIP: Add examples page
harishmohanraj Dec 16, 2024
13ea6db
Add multi-select for result filtering in examples page
harishmohanraj Dec 16, 2024
4890bf1
Fix multiple event listener and initialization issues
harishmohanraj Dec 16, 2024
72321b3
Sync the selected tags from URL query param
harishmohanraj Dec 16, 2024
c2c9e0c
Add GitHub and Colab badges to items
harishmohanraj Dec 16, 2024
8effe1b
Add notebooks section
harishmohanraj Dec 16, 2024
8152a70
Merge pull request #3 from harishmohanraj/add-home-and-blog-pages
harishmohanraj Dec 16, 2024
4136ee2
Update mintlify deploy workflow file
harishmohanraj Dec 16, 2024
c85f14d
Merge pull request #4 from harishmohanraj/update-workflow
harishmohanraj Dec 16, 2024
f376791
WIP: Test workflow in feature branch
harishmohanraj Dec 17, 2024
193d82e
WIP: Test workflow in feature branch
harishmohanraj Dec 17, 2024
fd0a38b
WIP: Test workflow in feature branch
harishmohanraj Dec 17, 2024
b67a09b
Install quarto before processing the notebooks
harishmohanraj Dec 17, 2024
8aab2ac
Merge pull request #5 from harishmohanraj/fix-deploy-job
harishmohanraj Dec 17, 2024
dcf4092
Do not copy gitignore and other temp files to the docs directory
harishmohanraj Dec 17, 2024
6a3079b
Merge pull request #6 from harishmohanraj/fix-deploy-workflow
harishmohanraj Dec 17, 2024
570d260
Fix notebook parsing errors
harishmohanraj Dec 17, 2024
a951129
Merge pull request #7 from harishmohanraj/fix-parsing-errors
harishmohanraj Dec 17, 2024
bf9c7b7
Merge remote-tracking branch 'upstream/main'
harishmohanraj Dec 17, 2024
4e6ff30
Merge branch 'main' of github.com:harishmohanraj/ag2
harishmohanraj Dec 17, 2024
cd5e165
Fix for broken image issue in key features
harishmohanraj Dec 17, 2024
abd27a1
Merge pull request #8 from harishmohanraj/fix-broken-images
harishmohanraj Dec 17, 2024
93277a6
Remove images and select box from the application gallery page
harishmohanraj Dec 17, 2024
3a4cf2a
Merge pull request #9 from harishmohanraj/fix-app-gallery
harishmohanraj Dec 17, 2024
2b5c0da
Add blog pages
harishmohanraj Dec 17, 2024
9cf4ea7
Merge pull request #10 from harishmohanraj/add-blog-pages
harishmohanraj Dec 17, 2024
014f712
Update navigation
harishmohanraj Dec 18, 2024
58df5c6
Update images path
harishmohanraj Dec 18, 2024
f700791
Switch deploy branch to gh-pages
harishmohanraj Dec 18, 2024
448bff9
Merge pull request #11 from harishmohanraj/update-navigation
harishmohanraj Dec 18, 2024
cbbcdbf
Add script to generate the api reference docs
harishmohanraj Dec 18, 2024
49a8726
Add API reference to navigation
harishmohanraj Dec 18, 2024
6c50e15
Merge pull request #12 from harishmohanraj/add-api-docs
harishmohanraj Dec 18, 2024
87b9282
Sort the API reference navigation
harishmohanraj Dec 18, 2024
b0fa589
Merge pull request #13 from harishmohanraj/sort-api-reference
harishmohanraj Dec 18, 2024
a1acb3f
Delete docusaurus files
harishmohanraj Dec 18, 2024
7634338
Merge pull request #14 from harishmohanraj/delete-docusaurus-files
harishmohanraj Dec 18, 2024
de5b046
Revert "Delete docusaurus files"
harishmohanraj Dec 18, 2024
f0fbae8
Merge pull request #15 from harishmohanraj/revert-14-delete-docusauru…
harishmohanraj Dec 18, 2024
25d042d
Remove duplicate headers
harishmohanraj Dec 18, 2024
0154cd8
Merge pull request #16 from harishmohanraj/remove-duplicate-header
harishmohanraj Dec 18, 2024
2fae879
Fix duplicate headers
harishmohanraj Dec 18, 2024
59d20af
Merge pull request #17 from harishmohanraj/remove-duplicate-header-in…
harishmohanraj Dec 18, 2024
88f7563
Fix images path
harishmohanraj Dec 18, 2024
feb7fd6
Merge pull request #18 from harishmohanraj/fix-tutorial-images-syntax
harishmohanraj Dec 18, 2024
68c6002
Add og image tag
harishmohanraj Dec 18, 2024
4794db3
Merge pull request #19 from harishmohanraj/add-og-tags
harishmohanraj Dec 18, 2024
7e68fe3
Fix broken image path
harishmohanraj Dec 19, 2024
f32bf30
Merge pull request #20 from harishmohanraj/fix-broken-img
harishmohanraj Dec 19, 2024
8a6a0b9
Update existing deploy job
harishmohanraj Dec 19, 2024
e6928f9
Update dependency
harishmohanraj Dec 19, 2024
f9efe9a
Merge pull request #21 from harishmohanraj/update-workflow
harishmohanraj Dec 19, 2024
debf06f
Add debugging messages
harishmohanraj Dec 19, 2024
52026e4
Fix workflow
harishmohanraj Dec 19, 2024
fbe4838
Merge pull request #22 from harishmohanraj/fix-workflow
harishmohanraj Dec 19, 2024
c288101
Fixes
harishmohanraj Dec 19, 2024
326c4a0
Merge pull request #23 from harishmohanraj/fixes
harishmohanraj Dec 19, 2024
13b3968
WIP
harishmohanraj Dec 19, 2024
e254f33
Do not copy temp files to the deployment directory
harishmohanraj Dec 19, 2024
c0f812b
Fix deploy script
harishmohanraj Dec 19, 2024
6debb56
Merge pull request #24 from harishmohanraj/fix-deployment
harishmohanraj Dec 19, 2024
5e4bae1
WIP
harishmohanraj Dec 19, 2024
716694b
Update publish directory path
harishmohanraj Dec 19, 2024
127882e
Merge pull request #25 from harishmohanraj/update-workflow
harishmohanraj Dec 19, 2024
53f8c41
Fix publish dir path
harishmohanraj Dec 19, 2024
06b4d6c
Merge pull request #26 from harishmohanraj/update-workflow
harishmohanraj Dec 19, 2024
7086cc3
Polishing
harishmohanraj Dec 19, 2024
42d9691
Polishing
harishmohanraj Dec 19, 2024
34fed4e
Merge pull request #27 from harishmohanraj/polishing
harishmohanraj Dec 19, 2024
ee99c7c
Fix internal links
harishmohanraj Dec 19, 2024
b92342b
Merge pull request #28 from harishmohanraj/fix-internal-links
harishmohanraj Dec 19, 2024
eef23a6
Add cover image
harishmohanraj Dec 19, 2024
96a2efd
Merge pull request #29 from harishmohanraj/update-social-share-image
harishmohanraj Dec 19, 2024
e76e7d1
Use hosted social image
harishmohanraj Dec 19, 2024
3816c7b
Merge pull request #30 from harishmohanraj/use-hosted-social-img
harishmohanraj Dec 19, 2024
bb1756c
Merge branch 'ag2ai:main' into main
harishmohanraj Dec 19, 2024
eee1cbe
Test social image
harishmohanraj Dec 19, 2024
5016d1c
Merge pull request #31 from harishmohanraj/test-social-img
harishmohanraj Dec 19, 2024
550777b
Update social image
harishmohanraj Dec 19, 2024
d09057d
Merge pull request #32 from harishmohanraj/update-social-img
harishmohanraj Dec 19, 2024
0ef6f4a
Update social image
harishmohanraj Dec 19, 2024
5117ae3
remove og tag
harishmohanraj Dec 19, 2024
9749076
Merge pull request #33 from harishmohanraj/update-social-img
harishmohanraj Dec 19, 2024
31b07b9
Documentation edits made through Mintlify web editor
harishmohanraj Dec 19, 2024
3f3f7f6
Update workflows
harishmohanraj Dec 19, 2024
33f7b30
Merge pull request #34 from harishmohanraj/change-deploy-branch
harishmohanraj Dec 19, 2024
cfce458
Merge remote-tracking branch 'upstream/main' into fix-conflicts
harishmohanraj Dec 19, 2024
1af237a
Merge pull request #35 from harishmohanraj/fix-conflicts
harishmohanraj Dec 19, 2024
99c40e0
run all pre-commit checks
harishmohanraj Dec 19, 2024
7de1810
Fix conflicts
harishmohanraj Dec 19, 2024
87e56e1
Merge pull request #36 from harishmohanraj/polishing
harishmohanraj Dec 19, 2024
eea617b
Fix tests
harishmohanraj Dec 19, 2024
5a1646c
Merge pull request #37 from harishmohanraj/polishing
harishmohanraj Dec 19, 2024
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
119 changes: 119 additions & 0 deletions .github/workflows/deploy-website-mintlify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: mintlify docs

on:
pull_request:
branches: [main]
paths:
- "autogen/**"
- "website/**"
- ".github/workflows/deploy-website-mintlify.yml"
push:
branches: [main]
paths:
- "autogen/**"
- "website/**"
- ".github/workflows/deploy-website-mintlify.yml"
workflow_dispatch:
merge_group:
types: [checks_requested]
permissions:
contents: write
jobs:
checks:
if: github.event_name != 'push'
runs-on: ubuntu-latest
defaults:
run:
working-directory: website
steps:
- uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: setup python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pydoc-markdown pyyaml termcolor nbconvert
# Pin databind packages as version 4.5.0 is not compatible with pydoc-markdown.
pip install databind.core==4.4.2 databind.json==4.4.2

- 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: Prepare website content
run: |
# Create a temporary directory for filtered content
mkdir -p temp_website

# Copy files except .ipynb, node_modules, .quarto, .gitignore, and temp_website
find . -type f -not -path "*/node_modules/*" -not -path "*/.quarto/*" -not -path "./temp_website/*" -not -name "*.ipynb" -not -name ".gitignore" -exec cp --parents {} temp_website/ \;

mintlify-release:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
defaults:
run:
working-directory: website
steps:
- uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: setup python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pydoc-markdown pyyaml termcolor nbconvert
# Pin databind packages as version 4.5.0 is not compatible with pydoc-markdown.
pip install databind.core==4.4.2 databind.json==4.4.2

- 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: Prepare website content
run: |
# Create a temporary directory for filtered content
mkdir -p temp_website

# Copy files except .ipynb, node_modules, .quarto, .gitignore, and temp_website
find . -type f -not -path "*/node_modules/*" -not -path "*/.quarto/*" -not -path "./temp_website/*" -not -name "*.ipynb" -not -name ".gitignore" -exec cp --parents {} temp_website/ \;

- name: Deploy to Mintlify
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: mintlify-pages
publish_dir: ./website/temp_website
138 changes: 32 additions & 106 deletions .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
@@ -1,121 +1,47 @@
name: docs
name: Deploy Redirect Page

on:
pull_request:
branches: [main]
path:
- "autogen/*"
- "website/*"
- ".github/workflows/deploy-website.yml"
push:
branches: [main]
path:
- "autogen/*"
- "website/*"
paths:
- ".github/workflows/deploy-website.yml"
workflow_dispatch:
merge_group:
types: [checks_requested]
permissions:
contents: write
jobs:
checks:
if: github.event_name != 'push'
runs-on: ubuntu-latest
defaults:
run:
working-directory: website
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: setup python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: pydoc-markdown install
run: |
python -m pip install --upgrade pip
pip install pydoc-markdown pyyaml termcolor
# Pin databind packages as version 4.5.0 is not compatible with pydoc-markdown.
pip install databind.core==4.4.2 databind.json==4.4.2
- name: pydoc-markdown run
run: |
pydoc-markdown
- name: quarto install
working-directory: ${{ runner.temp }}
run: |
wget -q https://github.com/quarto-dev/quarto-cli/releases/download/v1.5.23/quarto-1.5.23-linux-amd64.tar.gz
tar -xzf quarto-1.5.23-linux-amd64.tar.gz
echo "$(pwd)/quarto-1.5.23/bin/" >> $GITHUB_PATH
- name: Process notebooks
run: |
python process_notebooks.py render
- name: Test Build
run: |
if [ -e yarn.lock ]; then
yarn install --frozen-lockfile --ignore-engines
yarn build
elif [ -e package-lock.json ]; then
npm ci
npm run build
else
npm i --legacy-peer-deps
npm run build
fi
gh-release:
if: github.event_name != 'pull_request'
deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: website
steps:
- uses: actions/checkout@v4
with:
lfs: true
- uses: actions/setup-node@v4
with:
node-version: 18.x
- name: setup python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: pydoc-markdown install
run: |
python -m pip install --upgrade pip
pip install pydoc-markdown pyyaml termcolor
# Pin databind packages as version 4.5.0 is not compatible with pydoc-markdown.
pip install databind.core==4.4.2 databind.json==4.4.2
- name: pydoc-markdown run
run: |
pydoc-markdown
- name: quarto install
working-directory: ${{ runner.temp }}
run: |
wget -q https://github.com/quarto-dev/quarto-cli/releases/download/v1.5.23/quarto-1.5.23-linux-amd64.tar.gz
tar -xzf quarto-1.5.23-linux-amd64.tar.gz
echo "$(pwd)/quarto-1.5.23/bin/" >> $GITHUB_PATH
- name: Process notebooks
run: |
python process_notebooks.py render
- name: Build website
run: |
if [ -e yarn.lock ]; then
yarn install --frozen-lockfile --ignore-engines
yarn build
elif [ -e package-lock.json ]; then
npm ci
npm run build
else
npm i --legacy-peer-deps
npm run build
fi
# Step 1: Check out the repository
- name: Checkout repository
uses: actions/checkout@v4

# Step 2: Create a fresh redirect HTML file
- name: Create redirect HTML
run: |
mkdir -p dist
cat > dist/index.html << 'EOF'
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=https://ag2ai.mintlify.app">
<script>window.location.href = "https://ag2ai.mintlify.app";</script>
<title>Page Redirection</title>
</head>
<body>
If you are not redirected automatically, follow this <a href="https://ag2ai.mintlify.app">link to the new documentation</a>.
</body>
</html>
EOF

# Step 3: Deploy to gh-pages branch
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./website/build
publish_dir: ./dist
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'Deploy redirect page'
5 changes: 4 additions & 1 deletion autogen/oai/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Install the `anthropic` package by running `pip install --upgrade anthropic`.
- https://docs.anthropic.com/en/docs/quickstart-guide

```python
import autogen

config_list = [
Expand All @@ -22,12 +23,14 @@
]

assistant = autogen.AssistantAgent("assistant", llm_config={"config_list": config_list})
```

Example usage for Anthropic Bedrock:

Install the `anthropic` package by running `pip install --upgrade anthropic`.
- https://docs.anthropic.com/en/docs/quickstart-guide

```python
import autogen

config_list = [
Expand All @@ -42,7 +45,7 @@
]

assistant = autogen.AssistantAgent("assistant", llm_config={"config_list": config_list})

```
"""

from __future__ import annotations
Expand Down
3 changes: 2 additions & 1 deletion autogen/oai/bedrock.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Install the `boto3` package by running `pip install --upgrade boto3`.
- https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html

```python
import autogen

config_list = [
Expand All @@ -25,7 +26,7 @@
]

assistant = autogen.AssistantAgent("assistant", llm_config={"config_list": config_list})

```
"""

from __future__ import annotations
Expand Down
1 change: 1 addition & 0 deletions autogen/retrieve_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"yaml",
"yml",
"pdf",
"mdx",
]
UNSTRUCTURED_FORMATS = [
"doc",
Expand Down
2 changes: 1 addition & 1 deletion notebook/agentchat_custom_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@
],
"metadata": {
"front_matter": {
"description": "Define and laod a custom model",
"description": "Define and load a custom model",
"tags": [
"integration",
"custom model"
Expand Down
2 changes: 1 addition & 1 deletion test/test_retrieve_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def test_retrieve_utils(self):
dir_path="./website/docs",
client=client,
collection_name="autogen-docs",
custom_text_types=["txt", "md", "rtf", "rst"],
custom_text_types=["txt", "md", "rtf", "rst", "mdx"],
get_or_create=True,
)
results = query_vector_db(
Expand Down
2 changes: 1 addition & 1 deletion website/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package-lock.json
.docusaurus
.cache-loader
docs/reference
/docs/notebooks
/notebooks

docs/tutorial/*.mdx
docs/tutorial/**/*.png
Expand Down
19 changes: 9 additions & 10 deletions website/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
# Website

This website is built using [Docusaurus 3](https://docusaurus.io/), a modern static website generator.
This website is built using [Mintlify](https://mintlify.com/docs/quickstart), a modern website generator.

## Prerequisites

To build and test documentation locally, begin by downloading and installing [Node.js](https://nodejs.org/en/download/), and then installing [Yarn](https://classic.yarnpkg.com/en/).
On Windows, you can install via the npm package manager (npm) which comes bundled with Node.js:

```console
npm install --global yarn
```
To build and test documentation locally, begin by downloading and installing [Node.js](https://nodejs.org/en/download/) and [Mintlify CLI](https://www.npmjs.com/package/mintlify)

## Installation

```console
pip install pydoc-markdown pyyaml colored
cd website
yarn install
```

### Install Quarto
Expand All @@ -34,7 +27,13 @@ Navigate to the `website` folder and run:
```console
pydoc-markdown
python ./process_notebooks.py render
yarn start
npm install
```

Run the following command at the root of your documentation (where mint.json is)

```console
npm run mintlify:dev
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
Loading
Loading