Skip to content

Commit

Permalink
Merge pull request #2 from aryan-bhokare/main
Browse files Browse the repository at this point in the history
Added guides for contributors.
  • Loading branch information
aryan-bhokare authored Aug 13, 2024
2 parents 7ad73d0 + 277958b commit bbb1c3a
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/Guide-docstrings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Implementing Docstrings in Python Code

When you write or modify Python code in the codebase, it's important to add or update the docstrings accordingly. If you wish to display these docstrings in the documentation, follow these steps.

Suppose the docstrings are located in the following path: `docs/Submodules/IntelOwl/api_app/analyzers_manager/classes`, and you want to show the description of a class, such as BaseAnalyzerMixin.

To include this in the documentation, use the following command:

```
:::docs.Submodules.IntelOwl.api_app.analyzers_manager.classes.BaseAnalyzerMixin
```

<div class="admonition warning">
<p class="admonition-title">Warning</p>
Make sure your path is correct and syntax is correct.
If you face any issues even path is correct then read the Submodules Guide.
</div>

This is how it would look in documentation:
:::docs.Submodules.IntelOwl.api_app.analyzers_manager.classes.BaseAnalyzerMixin
51 changes: 51 additions & 0 deletions docs/Guide-documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Setting Up the New Documentation Site Locally

To set up and run the documentation site on your local machine, please follow the steps below:

## 1. Create a Virtual Environment

To create a virtual environment named `venv` in your project directory, use the following command:

```bash
python3 -m venv venv
```

## 2. Activate the Virtual Environment

Activate the virtual environment to ensure that all dependencies are installed locally within your project directory.

On Linux/MacOS:

```
source venv/bin/activate
```

On Windows:

```
venv\Scripts\activate
```

## 3. Install Dependencies

To install all the necessary Python packages listed in requirements.txt, run:

```
pip install -r requirements.txt
```

## 4. Serve the Documentation Locally

Start a local development server to preview the documentation in your web browser. The server will automatically reload whenever you make changes to the documentation files.

```
mkdocs serve
```

## 5. Make Changes and Review

As you edit the documentation, you can view your changes in real-time through the local server. This step ensures everything looks as expected before deploying.

## 6. Push Changes to GitHub

Once you are satisfied with your changes, commit and push them to the GitHub repository. The documentation will be automatically deployed via GitHub Actions, making it live on the documentation site.
32 changes: 32 additions & 0 deletions docs/Submodules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Implementing Docstrings in IntelOwl Documentation

In the IntelOwl documentation site, we use Git submodules to manage multiple repositories as child repositories. This allows us to fetch updated code (including docstrings and API specs) automatically, reducing redundant work for developers.

## Current Submodules

There are four submodules under the IntelOwlProject:

1. IntelOwl
2. GreedyBear
3. pyintelowl
4. GoIntelOwl

These submodules are updated daily via a cron job to ensure the documentation remains current.

## Making Changes to Documentation

When you make changes to the IntelOwl codebase, it typically takes a day for the submodules to update automatically. However, if you need to test changes immediately, you can do the following:

## Add Custom Submodules for Testing:

Point the submodule in `.gitmodules` to your fork of the repository to check the updates instantly.

### Update Submodules:

After modifying `.gitmodules`, run the following command to fetch the latest changes:

```
git submodule update --remote --merge
```

This ensures that your documentation reflects the most recent code changes without waiting for the daily update.
4 changes: 4 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ nav:
- index: "pyintelowl/index.md"
- GoIntelOwl:
- index: "GoIntelOwl/index.md"
- Guides:
- Documentation guide: "Guide-documentation.md"
- Docstrings guide: "Guide-docstrings.md"
- Submodules: "Submodules.md"
plugins:
- search:
separator: '[\s\-,:!=\[\]()"`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])'
Expand Down

0 comments on commit bbb1c3a

Please sign in to comment.