flexiblepower / s2-python

Apache License 2.0
17 stars 2 forks source link

Setup documentation #13

Open victorgarcia98 opened 1 year ago

victorgarcia98 commented 1 year ago

In order to boost the adoption of this package, I suggest adding documentation.

In the past, I worked on the setup of a SPHINX documentation in TOX:

https://github.com/victorgarcia98/s2-ws-json-python/tree/main

And got it published in ReadTheDocs:

https://s2-ws-json-python.readthedocs.io/en/latest/_autosummary/s2wsjson.common.timer.html#module-s2wsjson.common.timer

lfse-slafleur commented 1 year ago

We should definitely generate some type of documentation. An idea I have is to reuse the documentation provided to pydantic. For example: https://github.com/flexiblepower/s2-ws-json-python/commit/f255934d19674f0fa93790ac1ccae388d3c4dfbd#diff-1402cdc5485e1b35c6fc47f25e172db57b4cfc4fab64fb6a2668ccdd1171f0f3R67

Every field currently already has a bunch of docs and it would be great if we could utilize them. How that exactly could work, I am unsure. I already checked pydantic and it does not seem to have a docs generator or something similar. Perhaps it does have it but I overlooked it.

Btw, what did you write the RST in your example? I saw docs for the json() and dict() functions but I cannot find the definitions.

victorgarcia98 commented 1 year ago

We should definitely generate some type of documentation. An idea I have is to reuse the documentation provided to pydantic. For example: f255934#diff-1402cdc5485e1b35c6fc47f25e172db57b4cfc4fab64fb6a2668ccdd1171f0f3R67

Good point!

After a quick search, I found this sphinx package that could be useful, I'll try to test it :smile:

Btw, what did you write the RST in your example? I saw docs for the json() and dict() functions but I cannot find the definitions.

I think it's also showing the docs of the inherited methods, in this case, from the ValidateValusMixin.