Skip to content

Commit

Permalink
Merge pull request #49 from harishmohanraj/fix-outdated-contributor-g…
Browse files Browse the repository at this point in the history
…uide

Update contributor guide
  • Loading branch information
harishmohanraj authored Dec 23, 2024
2 parents 90439cc + 14cf215 commit cb80bbf
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 43 deletions.
7 changes: 3 additions & 4 deletions .devcontainer/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ RUN sudo pip install --upgrade pip && \
# Install pre-commit hooks
RUN pre-commit install

# Setup Docusaurus and Yarn for the documentation website
RUN sudo npm install --global yarn
RUN sudo pip install pydoc-markdown
# Setup Mintlify for the documentation website
RUN sudo pip install pydoc-markdown pyyaml termcolor nbclient
RUN cd website
RUN yarn install --frozen-lockfile --ignore-engines
RUN npm install

RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \
wget -q https://github.com/quarto-dev/quarto-cli/releases/download/v1.5.23/quarto-1.5.23-linux-${arch}.tar.gz && \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-website-mintlify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pydoc-markdown pyyaml termcolor nbconvert
pip install pydoc-markdown pyyaml termcolor nbclient
# 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
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pydoc-markdown pyyaml termcolor nbconvert
pip install pydoc-markdown pyyaml termcolor nbclient
# 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
Expand Down
53 changes: 38 additions & 15 deletions website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,61 @@

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

## Prerequisites
## How to get a notebook rendered on the website

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)
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.

## Installation
## Build documentation locally

```console
pip install pydoc-markdown pyyaml termcolor nbconvert
```

### Install Quarto
1. To build and test documentation locally, first install [Node.js](https://nodejs.org/en/download/). For example,

`quarto` is used to render notebooks.
```bash
nvm install --lts
```

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

> Note: Ensure that your `quarto` version is `1.5.23` or higher.
```bash
pip install pydoc-markdown pyyaml termcolor nbclient
```

## Local Development
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.

Navigate to the `website` folder and run:
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
```

Run the following command at the root of your documentation (where mint.json is)
The last command starts a local development server and opens up a browser window.
Most changes are reflected live without having to restart the server.

## Build with Docker

To build and test documentation within a docker container, run the following commands from your project root directory:

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

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:

```bash
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
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
Once done you should be able to access the documentation at `http://127.0.0.1:8081`
2 changes: 1 addition & 1 deletion website/blog/2024-07-25-AgentOps/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors:
tags: [LLM,Agent,Observability,AutoGen,AgentOps]
---

# AgentOps, the Best Tool for AutoGen Agent Observability

<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%" }} />

## TL;DR
Expand Down
37 changes: 18 additions & 19 deletions website/docs/contributor-guide/documentation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,55 @@ See [here](https://github.com/ag2ai/ag2/blob/main/notebook/contributing.md#how-t

## Build documentation locally

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

```bash
nvm install --lts
```

Then, install `yarn` and other required packages:
Then, install the required packages by running the following commands:

```bash
npm install --global yarn
pip install pydoc-markdown pyyaml termcolor
pip install pydoc-markdown pyyaml termcolor nbclient
```

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.
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.

3\. Finally, run the following commands to build:
3. Finally, run the following commands to build and serve the documentation:

```console
cd website
yarn install --frozen-lockfile --ignore-engines
pydoc-markdown
python process_notebooks.py render
yarn start
python ./process_api_reference.py
python ./process_notebooks.py render
npm install
npm run mintlify:dev
```

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

## Build with Docker

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

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

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
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:

```bash
docker run -it -p 8081:3000 -v `pwd`/autogen-newcode:newstuff/ ag2ai_dev_img bash
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:

```bash
```console
cd website
yarn install --frozen-lockfile --ignore-engines
pydoc-markdown
python process_notebooks.py render
yarn start --host 0.0.0.0 --port 3000
python ./process_api_reference.py
python ./process_notebooks.py render
npm install
npm run mintlify:dev
```

Once done you should be able to access the documentation at `http://127.0.0.1:8081/autogen`
Once done you should be able to access the documentation at `http://127.0.0.1:8081`
Empty file modified website/process_api_reference.py
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions website/process_notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ def update_navigation_with_notebooks(website_dir: Path) -> None:
# Write back to mint.json
with open(mint_json_path, "w", encoding="utf-8") as f:
json.dump(mint_config, f, indent=2)
f.write("\n")

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

Expand Down
9 changes: 7 additions & 2 deletions website/snippets/data/NotebooksMetadata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1007,9 +1007,14 @@ export const notebooksMetadata = [
{
"title": "Cross-Framework LLM Tool Integration with AG2",
"link": "/notebooks/tools_interoperability",
"description": "",
"description": "Cross-Framework LLM Tool Integration with AG2",
"image": null,
"tags": [],
"tags": [
"tools",
"langchain",
"crewai",
"pydanticai"
],
"source": "/notebook/tools_interoperability.ipynb"
},
{
Expand Down

0 comments on commit cb80bbf

Please sign in to comment.