emmett-framework / emmett

The web framework for inventors
BSD 3-Clause "New" or "Revised" License
1.07k stars 71 forks source link

Make documentation more verbose #516

Open Charlton-A opened 1 week ago

Charlton-A commented 1 week ago

I've been tinkering with the framework, and while the learning curve has been minimal, one challenge I've faced is that the documentation is less verbose. However, this can be supplemented by looking at the implementation and tests to understand how to implement certain features.

For example, when testing routes with paths, my initial approach was to use f-strings to build the URL, but that didn't work. After checking out the Emmett test for auth https://github.com/emmett-framework/emmett/blob/master/tests/test_auth.py#L213, I followed the same approach shown there, which solved the issue.

Would it be a good idea to make the documentation a bit more versbose? Perhaps creating a 'testing-how-to.md' or 'orm-how-to-md' that includes snippets for implementing key features and highlights certain gotchas would be helpful. For instance, in the ORM, it's easy to assume that update and update_record are the same due to muscle memory from other ORMs. A quick reference guide like this could be useful for new developers.

gi0baro commented 1 week ago

Would it be a good idea to make the documentation a bit more versbose? Perhaps creating a 'testing-how-to.md' or 'orm-how-to-md' that includes snippets for implementing key features and highlights certain gotchas would be helpful.

Love the idea. Like a grab 'n go section per chapter.

After checking out the Emmett test for auth https://github.com/emmett-framework/emmett/blob/master/tests/test_auth.py#L213, I followed the same approach shown there, which solved the issue.

That sounds strange though, as there should be no difference between f"{whatever}" and "{}".format(whatever). Are you sure that was the actual issue? On the documentation topic I would rather add in the docs the ability to use url() when using the test client, for instance.

For instance, in the ORM, it's easy to assume that update and update_record are the same due to muscle memory from other ORMs. A quick reference guide like this could be useful for new developers.

I totally agree. To give you more context, whereas I'm generally happy on how docs looks today, I'd say there are 2 major things to consider with the documentation in Emmett:

So if you could make few contributions on that side it would be tremendously helpful: even just for the "fresh point of view" compared to mine. And I'm not asking for you to actually write documentation: if you can just capture, as a new developer, all the specific points you found out the documentation was not detailed enough – or completely missing – then I can use that list/notes to improve the docs in this sense :)

Charlton-A commented 1 week ago

I have tested both f"{whatever}" and "{}".format(whatever) for the route issue, and both worked as expected. I wasn't able to replicate the problem, so I believe it might have been related to how I defined the route. If the issue arises again, I'll create an issue to track it.

Regarding the documentation, I understand that you're maintaining several projects, and you might not have enough time to focus more on docs. I came across Emmett while researching Granian. I'd be happy to note specific points that could be suitable for a grab 'n go section. I also don't mind drafting the documentation once it's approved.

For example: