Documentation¶
This page provides guidelines for contributing to ICOS-FL’s documentation.
Documentation Structure¶
ICOS-FL’s documentation follows the Diátaxis framework, which organizes content into four categories:
Tutorials (Introduction): Learning-oriented content that helps new users get started
How-To Guides: Task-oriented guides for solving specific problems
Explanation: Understanding-oriented content that provides background and context
Reference: Information-oriented technical descriptions of the machinery
File Organization¶
The documentation is organized into these main sections:
docs/
├── source/
│ ├── _static/ # Static assets (images, CSS)
│ ├── _templates/ # Custom templates
│ ├── introduction/ # Getting started tutorials
│ ├── how_to/ # Task-based guides
│ ├── explanation/ # Concept explanations
│ ├── reference/ # API reference
│ ├── contributing/ # Contribution guidelines
│ ├── conf.py # Sphinx configuration
│ └── index.rst # Main index page
├── Makefile # Make commands for building docs
└── requirements.txt # Documentation dependencies
Writing Style¶
When writing documentation, follow these style guidelines:
Use present tense: Write “this function returns” rather than “this function will return”
Active voice: Use “ICOS-FL provides” instead of “is provided by ICOS-FL”
Second person: Address the reader as “you” rather than “the user”
Simple language: Avoid jargon and complex terms where possible
Concise: Be direct and to the point
Consistent terminology: Use the same terms throughout the documentation
reStructuredText Syntax¶
ICOS-FL documentation uses reStructuredText (reST) format. Here are some common syntax elements:
Headings¶
Use consistent heading levels:
=============
Section Title
=============
Subsection Title
---------------
Subsubsection Title
~~~~~~~~~~~~~~~~~~
Paragraph Title
""""""""""""""
Inline Formatting¶
Italic:
*italic*Bold:
**bold**Code:``code``Links:
`Link text <https://example.com>`_
Code Blocks¶
For code examples:
.. code-block:: python
def example_function():
"""This is an example function."""
return True
For console commands:
.. code-block:: bash
$ python -m build
Lists¶
Bulleted lists:
* Item 1
* Item 2
* Subitem 2.1
* Subitem 2.2
* Item 3
Numbered lists:
1. First item
2. Second item
3. Third item
Definition lists:
Term 1
Definition 1
Term 2
Definition 2
Images¶
.. figure:: ../../_static/images/architecture_overview.png
:alt: ICOS-FL Architecture Overview
:align: center
Caption text here
Tables¶
.. list-table::
:widths: 30 70
:header-rows: 1
* - Header 1
- Header 2
* - Cell 1
- Cell 2
* - Cell 3
- Cell 4
Notes and Warnings¶
.. note::
This is a note.
.. warning::
This is a warning.
.. tip::
This is a tip.
.. important::
This is important information.
Cross-References¶
To reference other parts of the documentation:
:doc:`/how_to/deployment/docker_setup`
:ref:`custom-models`
Building Documentation¶
To build the documentation locally:
Install documentation dependencies:
pip install -r docs/requirements.txt
Build HTML documentation:
cd docs make html
View the documentation:
Open
docs/build/html/index.htmlin your web browser.
Adding New Documentation¶
To add new documentation:
Create a new
.rstfile in the appropriate directoryAdd the file to the corresponding index (toctree)
Include proper headings, formatting, and cross-references
Build the documentation to verify it renders correctly
Submit a pull request with your changes
API Documentation¶
When documenting API components:
Ensure all public classes, methods, and functions have proper docstrings
Use Google-style docstrings for consistency
Include type information and parameter descriptions
Document exceptions that may be raised
Provide usage examples where appropriate
Example:
def fetch_data(timeout: int = 60) -> pd.DataFrame:
"""Fetch time series data from DataClay.
Args:
timeout: Maximum time to wait for data in seconds
Returns:
DataFrame containing the processed time series data
Raises:
TimeoutError: If no data is available within the timeout period
DataClayException: If there is an error connecting to DataClay
Example:
>>> fetcher = Fetcher()
>>> df = fetcher.fetch_data(timeout=30)
>>> print(df.shape)
(300, 4)
"""
Images and Diagrams¶
For adding images and diagrams:
Place image files in
docs/source/_static/images/Use clear, high-contrast images
Include alt text for accessibility
Add captions to explain the image contents
Optimize images for web (compress when possible)
Use SVG format for diagrams when available
Documentation Review Process¶
All documentation changes follow the same review process as code:
Create a PR with your documentation changes
Ensure documentation builds without warnings
Request review from relevant maintainers
Address feedback from reviews
Once approved, a maintainer will merge your PR