Skip to content

[EASY] Update All Class Documentation #7

@Guhan-SenSam

Description

@Guhan-SenSam

Only the classes inside the backend module has been properly documented. The other classes inside the ui module and its submodules need to be documented.

This is a contribution that anyone can do with even minimal python knowledge. You need to read the code referencing various documentations of the used libraries and write documentation for the respective code block.

An example documentation block is

"""

    .. image:: https://raw.githubusercontent.com/Oxlac/MR.DM/main/docs/images/login-screen.png


    Welcome Screen/Login Screen Class. This screen contains methods that deal with adding new users and logging in existing users.
    When an user launches the program for the first time,this scren will display no accounts.
    """
def get_user(self, userid: str) -> Tuple[str, str, str, str]:
        """
        Gets the Instagram user from the database with the given userid.

        :param userid: The userid of the user to get

        :return: The user with the given userid
        """

        c = self.conn.cursor()
        c.execute("SELECT * FROM users WHERE userid=?", (userid,))
        return c.fetchone()

How to write Docs

MR.DM uses Sphinx AutoApi to generate documentation for all internal classes and functions. You can read more here.

In order for AutoApi to generate proper documentation it needs to know the datatypes of any function parameters, return values and class members. This can be done by using the python type hints definition. More info here

  1. Find something that hasn't been documented
  2. First check if you can define any types for the python code you want to document
  3. Write a description of what the function, class or class member does.
  4. See if your changes mirror the style of the rest of the docs by building the docs
cd docs
./make html
  1. You should see the main docs file inside the directory docs/_build/html/docs.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions