pglet / pglet-python

Python client for Pglet - build real-time interactive web apps in Python
MIT License
18 stars 7 forks source link

Documentation, Reformatting and Style #52

Open MrHemlock opened 2 years ago

MrHemlock commented 2 years ago

Cleaning Up

The pyglet-python repo is fully functional. However, there are are many places where it lacks documentation and type-hinting. There are also spots here and there that have some anti-patterns; x == None as an example.

The Reason

Cleaning up the library would make it much easier to use and make it more approachable for new users. Using the libraries in IDEs and Code Editors will benefit from the type-hinting, helping coders to catch their mistakes before they become a problem. Eliminating anti-patterns help make modern, Pythonic code, making it more readable and easy to debug.

The Plan

The current plan for tackling these things is a file by file approach. This will keep the review process more manageable and adaptable as the main branch changes and adds new features and files. Ideally, these changes in style and documentation should go hand in hand with new files, encouraging the modern practices this project aims to make.

We plan on using the Sphinx style docstrings. This will make for a consistent and robust documentation style, and also allows for the auto-generation of documentation pages. This goes hand in hand with the type-hinting. Both the coders and the IDE/code editors will benefit from these additions, making it much easier to see what a given method or object needs in the moment.

We also are looking into moving away from the setup.py style which is slowly being deprecated in favor of more modern practices. This is still ongoing as an idea.

We will be using (at least from the standpoint of development and this particular project) PDM, which allows for easy and consistent development and release environments without the need for a venv (unlike Poetry and pipenv).

FeodorFitsner commented 2 years ago

...wondering if it would be possible to generate .md files for use with Docusaurus.

shenanigansd commented 2 years ago

Yes, it's possible - There are a couple of Sphinx extensions that can generate Markdown