|
| 1 | +# Agent Guide: NethSecurity Documentation |
| 2 | + |
| 3 | +This repository contains the source for the NethSecurity documentation, built using Sphinx and reStructuredText (RST). |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +- **Framework:** [Sphinx](https://www.sphinx-doc.org/) |
| 8 | +- **Markup Language:** [reStructuredText (RST)](https://docutils.sourceforge.io/rst.html) |
| 9 | +- **Primary Configuration:** `conf.py` |
| 10 | +- **Output Theme:** `sphinx_book_theme` |
| 11 | +- **Localization:** Managed via `gettext` and `weblate`, stored in `locale/` directory. |
| 12 | + |
| 13 | +## Core Directories and Files |
| 14 | + |
| 15 | +- `/`: Contains the main `.rst` chapters of the documentation. |
| 16 | +- `index.rst`: The master document that defines the documentation structure (Table of Contents). |
| 17 | +- `conf.py`: Sphinx configuration, including extensions, theme options, and custom build logic (like fetching the latest release version). |
| 18 | +- `_static/`: Custom CSS (`custom.css`), JS (`kapa.js`), and images/graphics. |
| 19 | +- `locale/`: Translation files (`.po`). |
| 20 | +- `Makefile`: Build automation. |
| 21 | +- `requirements.txt`: Python dependencies. |
| 22 | + |
| 23 | +## Key Workflows |
| 24 | + |
| 25 | +### 1. Building Documentation |
| 26 | +To build the HTML version locally: |
| 27 | +```bash |
| 28 | +# Setup virtual environment (if not done) |
| 29 | +python3 -m venv venv |
| 30 | +source venv/bin/activate |
| 31 | +pip install -r requirements.txt |
| 32 | + |
| 33 | +# Build |
| 34 | +make html |
| 35 | +``` |
| 36 | +Build output will be in `_build/html/`. |
| 37 | + |
| 38 | +After building, if any error or warning occurs, fix it. |
| 39 | + |
| 40 | +### 2. Adding a New Chapter |
| 41 | +1. Create a new `.rst` file in the root directory. |
| 42 | +2. Add the file name (without extension) to the `toctree` in `index.rst`. |
| 43 | +3. Follow the editing guidelines in `README.rst` (headers, cross-references, etc.). |
| 44 | + |
| 45 | +### 3. Localization |
| 46 | +- Source strings are extracted using `make gettext`. |
| 47 | +- Translations are updated via `sphinx-intl update -p _build/gettext -l <lang>`. |
| 48 | +- The `locale/it/LC_MESSAGES/` directory contains Italian translations. |
| 49 | +- Localization is automatically handled using a GitHub workflow, so do not translate |
| 50 | + anything when adding or modifying the doc |
| 51 | + |
| 52 | +## Editing Guidelines (RST) |
| 53 | + |
| 54 | +- **Titles:** Use `=` over and under for the main title. |
| 55 | +- **Section Headers:** |
| 56 | + - Level 1: `=` |
| 57 | + - Level 2: `-` |
| 58 | + - Level 3: `^` |
| 59 | + - Level 4: `~` |
| 60 | +- **Cross-references:** Use ".. _label_with_space-section:" before a header and ":ref:`label_with_space-section`" to link to it. |
| 61 | +- **Notes/Warnings:** Use ".. note::" or ".. warning::" blocks. |
| 62 | +- **UI Elements:** Use ":guilabel:`label`" for buttons and double backticks ``label`` for inline UI text. |
| 63 | + |
| 64 | +## CI/CD |
| 65 | +- Builds are automated via GitHub Actions (see `.github/workflows/`). |
| 66 | +- Translations are automatically updated after commits. |
| 67 | +- Stable and Dev release tables are dynamically generated during the build process (see `conf.py` logic). |
0 commit comments