Skip to content

Update documentation #68

@CoffeeStraw

Description

@CoffeeStraw

PyonFX documentation is starting to be a bit dated: inconsistent docstrings, poor explanations and lack of examples are an obstacle for new users.

Plan

  • For docstrings style/consistency: https://github.com/astral-sh/ruff;
  • Use Mkdoc (and Material for MkDoc as a theme) to generate the Static Site, instead of ReadTheDocs (which should be updated to point to GitHub);
    • Follow the Diátaxis documentation framework to organize docs into four main sections: Tutorials, Guides, Reference, Explanation;
    • The pages should have images/videos to showcase the features;
    • Add build & deploy through GitHub Actions.

Docstring style

Modern docstrings can now feature gifs/images in markdown. That would turn extremely helpful to let user visualize what a specific function does. We propose the following template for methods:

def function_name(param1: int, param2: str = "default") -> bool:
    """Short summary line explaining the function's purpose.

    ![Descriptive alt text](https://media.giphy.com/media/QHE5gWI0QjqF2/giphy.gif)

    Extended description explaining why and how the function should be used.
    Mention any important details, constraints, or side effects.
    If the function is complex, describe its approach or methodology here.

    Args:
        param1: Brief description of param1 and what it represents.
        param2: Brief description of param2, mention default value and its meaning.

    Returns:
        bool: Clear description of what is returned and in what cases.

    Examples:
        >>> function_name(42, "foobar")
        True

        >>> function_name(7)
        False

    Notes:
        Add any additional tips, caveats, or background information helpful to users.
        If applicable, mention where to find more information or limitations.

    See Also:
        List related functions or references here, e.g. `another_function`.
    """
    # Implementation goes here
    return True

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions