-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from aryan-bhokare/main
Added guides for contributors.
- Loading branch information
Showing
4 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters