From afc563add7782efeeab2ca967ca85e7476c864f3 Mon Sep 17 00:00:00 2001 From: "joel@joellee.org" Date: Sun, 30 Oct 2022 16:09:44 +0100 Subject: [PATCH] feat: add docs --- docs/source/api/api.rst | 6 ++++ docs/source/api/client.rst | 9 ++++++ docs/source/api/index.rst | 14 ++++++++++ docs/source/conf.py | 14 +++++++--- docs/source/gotrue.rst | 53 ++++++++++++++++++++++++++++++++++++ docs/source/index.rst | 4 +-- docs/source/modules.rst | 7 +++++ docs/source/usage/admin.rst | 19 ------------- docs/source/usage/client.rst | 6 ---- 9 files changed, 101 insertions(+), 31 deletions(-) create mode 100644 docs/source/api/api.rst create mode 100644 docs/source/api/client.rst create mode 100644 docs/source/api/index.rst create mode 100644 docs/source/gotrue.rst create mode 100644 docs/source/modules.rst delete mode 100644 docs/source/usage/admin.rst delete mode 100644 docs/source/usage/client.rst diff --git a/docs/source/api/api.rst b/docs/source/api/api.rst new file mode 100644 index 00000000..6674c194 --- /dev/null +++ b/docs/source/api/api.rst @@ -0,0 +1,6 @@ +API +====== + +.. autoclass:: gotrue._async.api.AsyncGoTrueAPI + :inherited-members: + diff --git a/docs/source/api/client.rst b/docs/source/api/client.rst new file mode 100644 index 00000000..8ca9e744 --- /dev/null +++ b/docs/source/api/client.rst @@ -0,0 +1,9 @@ +Client +====== + +The entrypoint to the library is the Client class. To interact with the Gotrue API, you make an instance of this class. + + +.. autoclass:: gotrue.AsyncGoTrueClient + :members: + :inherited-members: diff --git a/docs/source/api/index.rst b/docs/source/api/index.rst new file mode 100644 index 00000000..00a4f835 --- /dev/null +++ b/docs/source/api/index.rst @@ -0,0 +1,14 @@ +API Reference +============= + +.. note:: + The library offers both synchronous and asynchronous clients. + Note that the synchronous and asynchronous classes all provide the exact same interface. + Only the async client and it's methods are documented here. + +.. toctree:: + :maxdepth: 2 + :caption: API Reference: + + Client + API diff --git a/docs/source/conf.py b/docs/source/conf.py index 7281ab77..78ccf251 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -17,15 +17,21 @@ # -- Project information ----------------------------------------------------- project = "gotrue" -copyright = "2021, Joel Lee" -author = "Joel Lee" +copyright = ( + "2022, Anand Krishna, Daniel Reinón García, Joel Lee, Leynier Gutiérrez González" +) +author = "Anand Krishna, Daniel Reinón García, Joel Lee, Leynier Gutiérrez González" # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = [] +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.napoleon", + "sphinx.ext.extlinks", +] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] @@ -33,7 +39,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = [] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] # -- Options for HTML output ------------------------------------------------- diff --git a/docs/source/gotrue.rst b/docs/source/gotrue.rst new file mode 100644 index 00000000..2efeaea4 --- /dev/null +++ b/docs/source/gotrue.rst @@ -0,0 +1,53 @@ +gotrue package +============== + +Submodules +---------- + +gotrue.constants module +----------------------- + +.. automodule:: gotrue.constants + :members: + :undoc-members: + :show-inheritance: + +gotrue.exceptions module +------------------------ + +.. automodule:: gotrue.exceptions + :members: + :undoc-members: + :show-inheritance: + +gotrue.helpers module +--------------------- + +.. automodule:: gotrue.helpers + :members: + :undoc-members: + :show-inheritance: + +gotrue.http\_clients module +--------------------------- + +.. automodule:: gotrue.http_clients + :members: + :undoc-members: + :show-inheritance: + +gotrue.types module +------------------- + +.. automodule:: gotrue.types + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: gotrue + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/index.rst b/docs/source/index.rst index f5a3aea0..3be6010c 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -11,8 +11,8 @@ Welcome to gotrue's documentation! :maxdepth: 2 :caption: Contents: - usage/client - usage/admin + API Reference + Examples diff --git a/docs/source/modules.rst b/docs/source/modules.rst new file mode 100644 index 00000000..8d733c93 --- /dev/null +++ b/docs/source/modules.rst @@ -0,0 +1,7 @@ +gotrue-py +========= + +.. toctree:: + :maxdepth: 4 + + gotrue diff --git a/docs/source/usage/admin.rst b/docs/source/usage/admin.rst deleted file mode 100644 index 48749464..00000000 --- a/docs/source/usage/admin.rst +++ /dev/null @@ -1,19 +0,0 @@ -############# -Admin Documentation -############# -This is supposed to be a paragraph - - -This is yet another paragraph - -* This is a bulleted list - - -This is a normal text paragraph. The next paragraph is a code sample:: - - It is not processed in any way, except - that the indentation is removed. - - It can span multiple lines. - -This is a normal text paragraph again. diff --git a/docs/source/usage/client.rst b/docs/source/usage/client.rst deleted file mode 100644 index 7bbb329a..00000000 --- a/docs/source/usage/client.rst +++ /dev/null @@ -1,6 +0,0 @@ -#################### -Client Documentation -#################### -.. py:function:: sign_up(credentials: description) - - Helps a user to sign up for an account on gotrue given credentials dictionary which contains username and password.