Skip to content

Commit ecf305d

Browse files
Update contributor guide
1 parent 90439cc commit ecf305d

File tree

8 files changed

+69
-42
lines changed

8 files changed

+69
-42
lines changed

.devcontainer/dev/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ RUN sudo pip install --upgrade pip && \
3030
# Install pre-commit hooks
3131
RUN pre-commit install
3232

33-
# Setup Docusaurus and Yarn for the documentation website
34-
RUN sudo npm install --global yarn
35-
RUN sudo pip install pydoc-markdown
33+
# Setup Mintlify for the documentation website
34+
RUN sudo pip install pydoc-markdown pyyaml termcolor nbformat
3635
RUN cd website
37-
RUN yarn install --frozen-lockfile --ignore-engines
36+
RUN npm install
3837

3938
RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \
4039
wget -q https://github.com/quarto-dev/quarto-cli/releases/download/v1.5.23/quarto-1.5.23-linux-${arch}.tar.gz && \

.github/workflows/deploy-website-mintlify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
- name: Install Python dependencies
8787
run: |
8888
python -m pip install --upgrade pip
89-
pip install pydoc-markdown pyyaml termcolor nbconvert
89+
pip install pydoc-markdown pyyaml termcolor nbformat
9090
# Pin databind packages as version 4.5.0 is not compatible with pydoc-markdown.
9191
pip install databind.core==4.4.2 databind.json==4.4.2
9292

website/README.md

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,61 @@
22

33
This website is built using [Mintlify](https://mintlify.com/docs/quickstart), a modern website generator.
44

5-
## Prerequisites
5+
## How to get a notebook rendered on the website
66

7-
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)
7+
See [here](https://github.com/ag2ai/ag2/blob/main/notebook/contributing.md#how-to-get-a-notebook-displayed-on-the-website) for instructions on how to get a notebook in the `notebook` directory rendered on the website.
88

9-
## Installation
9+
## Build documentation locally
1010

11-
```console
12-
pip install pydoc-markdown pyyaml termcolor nbconvert
13-
```
14-
15-
### Install Quarto
11+
1. To build and test documentation locally, first install [Node.js](https://nodejs.org/en/download/). For example,
1612

17-
`quarto` is used to render notebooks.
13+
```bash
14+
nvm install --lts
15+
```
1816

19-
Install it [here](https://github.com/quarto-dev/quarto-cli/releases).
17+
Then, install the required packages by running the following commands:
2018

21-
> Note: Ensure that your `quarto` version is `1.5.23` or higher.
19+
```bash
20+
pip install pydoc-markdown pyyaml termcolor nbformat
21+
```
2222

23-
## Local Development
23+
2. You also need to install quarto. Please click on the `Pre-release` tab from [this website](https://quarto.org/docs/download/) to download the latest version of `quarto` and install it. Ensure that the `quarto` version is `1.5.23` or higher.
2424

25-
Navigate to the `website` folder and run:
25+
3. Finally, run the following commands to build and serve the documentation:
2626

2727
```console
28+
cd website
2829
python ./process_api_reference.py
2930
python ./process_notebooks.py render
3031
npm install
32+
npm run mintlify:dev
3133
```
3234

33-
Run the following command at the root of your documentation (where mint.json is)
35+
The last command starts a local development server and opens up a browser window.
36+
Most changes are reflected live without having to restart the server.
37+
38+
## Build with Docker
39+
40+
To build and test documentation within a docker container, run the following commands from your project root directory:
41+
42+
```bash
43+
docker build -f .devcontainer/dev/Dockerfile -t ag2ai_dev_img https://github.com/ag2ai/ag2.git#main
44+
```
45+
46+
Then start the container like so, this will log you in and ensure that Docker port 3000 is mapped to port 8081 on your local machine:
47+
48+
```bash
49+
docker run -it -p 8081:3000 -v $(pwd):/home/autogen/ag2 ag2ai_dev_img bash
50+
```
51+
52+
Once at the CLI in Docker run the following commands:
3453

3554
```console
55+
cd website
56+
python ./process_api_reference.py
57+
python ./process_notebooks.py render
58+
npm install
3659
npm run mintlify:dev
3760
```
3861

39-
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
62+
Once done you should be able to access the documentation at `http://127.0.0.1:8081`

website/blog/2024-07-25-AgentOps/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors:
66
tags: [LLM,Agent,Observability,AutoGen,AgentOps]
77
---
88

9-
# AgentOps, the Best Tool for AutoGen Agent Observability
9+
1010
<img src="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/external/autogen/autogen-integration.png?raw=true" alt="AgentOps and AutoGen" style={{ maxWidth: "50%" }} />
1111

1212
## TL;DR

website/docs/contributor-guide/documentation.mdx

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,56 +8,55 @@ See [here](https://github.com/ag2ai/ag2/blob/main/notebook/contributing.md#how-t
88

99
## Build documentation locally
1010

11-
1\. To build and test documentation locally, first install [Node.js](https://nodejs.org/en/download/). For example,
11+
1. To build and test documentation locally, first install [Node.js](https://nodejs.org/en/download/). For example,
1212

1313
```bash
1414
nvm install --lts
1515
```
1616

17-
Then, install `yarn` and other required packages:
17+
Then, install the required packages by running the following commands:
1818

1919
```bash
20-
npm install --global yarn
21-
pip install pydoc-markdown pyyaml termcolor
20+
pip install pydoc-markdown pyyaml termcolor nbformat
2221
```
2322

24-
2\. You also need to install quarto. Please click on the `Pre-release` tab from [this website](https://quarto.org/docs/download/) to download the latest version of `quarto` and install it. Ensure that the `quarto` version is `1.5.23` or higher.
23+
2. You also need to install quarto. Please click on the `Pre-release` tab from [this website](https://quarto.org/docs/download/) to download the latest version of `quarto` and install it. Ensure that the `quarto` version is `1.5.23` or higher.
2524

26-
3\. Finally, run the following commands to build:
25+
3. Finally, run the following commands to build and serve the documentation:
2726

2827
```console
2928
cd website
30-
yarn install --frozen-lockfile --ignore-engines
31-
pydoc-markdown
32-
python process_notebooks.py render
33-
yarn start
29+
python ./process_api_reference.py
30+
python ./process_notebooks.py render
31+
npm install
32+
npm run mintlify:dev
3433
```
3534

3635
The last command starts a local development server and opens up a browser window.
3736
Most changes are reflected live without having to restart the server.
3837

3938
## Build with Docker
4039

41-
To build and test documentation within a docker container. Use the Dockerfile in the `dev` folder as described above to build your image:
40+
To build and test documentation within a docker container, run the following commands from your project root directory:
4241

4342
```bash
4443
docker build -f .devcontainer/dev/Dockerfile -t ag2ai_dev_img https://github.com/ag2ai/ag2.git#main
4544
```
4645

47-
Then start the container like so, this will log you in and ensure that Docker port 3000 is mapped to port 8081 on your local machine
46+
Then start the container like so, this will log you in and ensure that Docker port 3000 is mapped to port 8081 on your local machine:
4847

4948
```bash
50-
docker run -it -p 8081:3000 -v `pwd`/autogen-newcode:newstuff/ ag2ai_dev_img bash
49+
docker run -it -p 8081:3000 -v $(pwd):/home/autogen/ag2 ag2ai_dev_img bash
5150
```
5251

5352
Once at the CLI in Docker run the following commands:
5453

55-
```bash
54+
```console
5655
cd website
57-
yarn install --frozen-lockfile --ignore-engines
58-
pydoc-markdown
59-
python process_notebooks.py render
60-
yarn start --host 0.0.0.0 --port 3000
56+
python ./process_api_reference.py
57+
python ./process_notebooks.py render
58+
npm install
59+
npm run mintlify:dev
6160
```
6261

63-
Once done you should be able to access the documentation at `http://127.0.0.1:8081/autogen`
62+
Once done you should be able to access the documentation at `http://127.0.0.1:8081`

website/process_api_reference.py

100644100755
File mode changed.

website/process_notebooks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ def update_navigation_with_notebooks(website_dir: Path) -> None:
582582
# Write back to mint.json
583583
with open(mint_json_path, "w", encoding="utf-8") as f:
584584
json.dump(mint_config, f, indent=2)
585+
f.write("\n")
585586

586587
print(f"Updated navigation in {mint_json_path}")
587588

website/snippets/data/NotebooksMetadata.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,9 +1007,14 @@ export const notebooksMetadata = [
10071007
{
10081008
"title": "Cross-Framework LLM Tool Integration with AG2",
10091009
"link": "/notebooks/tools_interoperability",
1010-
"description": "",
1010+
"description": "Cross-Framework LLM Tool Integration with AG2",
10111011
"image": null,
1012-
"tags": [],
1012+
"tags": [
1013+
"tools",
1014+
"langchain",
1015+
"crewai",
1016+
"pydanticai"
1017+
],
10131018
"source": "/notebook/tools_interoperability.ipynb"
10141019
},
10151020
{

0 commit comments

Comments
 (0)