Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EASY] Update All Class Documentation #7

Open
Guhan-SenSam opened this issue Jan 9, 2024 · 0 comments
Open

[EASY] Update All Class Documentation #7

Guhan-SenSam opened this issue Jan 9, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@Guhan-SenSam
Copy link
Member

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
@Guhan-SenSam Guhan-SenSam added documentation Improvements or additions to documentation good first issue Good for newcomers labels Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant