From d70f777da4443d7e4c1b37a842e1c4d4f239f7fc Mon Sep 17 00:00:00 2001 From: Stijn Van Campenhout Date: Wed, 18 Sep 2019 21:45:56 +0200 Subject: [PATCH] Started working on the documentation --- docs/source/index.rst | 42 ++++++++++++++++++++++++++++++++++ docs/source/installation.rst | 11 +++++++++ docs/source/modules.rst | 2 ++ docs/source/quickstart.rst | 44 ++++++++++++++++++++++++++++++++++++ rmapi/__init__.py | 5 ++++ 5 files changed, 104 insertions(+) create mode 100644 docs/source/installation.rst create mode 100644 docs/source/quickstart.rst diff --git a/docs/source/index.rst b/docs/source/index.rst index 379c56f..fa578f0 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -6,6 +6,47 @@ Welcome to rmapi's documentation! ================================= +Some content + +.. toctree:: + :maxdepth: 2 + +API Support +~~~~~~~~~~~ + +| ☑️ list files and directories +| ☑️ download a specific file +| ☑️ create a directory +| ☑️ move / rename a file or directory +| ☑️ upload a file +| ❎ delete a file or directory +| ❎ shell +| ❎ annotiation exports + + + +Installation +~~~~~~~~~~~~ + +.. toctree:: + :maxdepth: 2 + + installation + + +Quick start +~~~~~~~~~~~ + +.. toctree:: + :maxdepth: 2 + + quickstart + + +API Documentation +~~~~~~~~~~~~~~~~~ + + .. toctree:: :maxdepth: 2 @@ -13,6 +54,7 @@ Welcome to rmapi's documentation! .. automodule:: rmapi + Indices and tables ================== diff --git a/docs/source/installation.rst b/docs/source/installation.rst new file mode 100644 index 0000000..4349080 --- /dev/null +++ b/docs/source/installation.rst @@ -0,0 +1,11 @@ +Pip +=== + +Like any other package, you can install rmapi using pip: + + +.. code-block:: bash + + pip install rmapi + + diff --git a/docs/source/modules.rst b/docs/source/modules.rst index 079745c..6296eb2 100644 --- a/docs/source/modules.rst +++ b/docs/source/modules.rst @@ -5,3 +5,5 @@ rmapipy :maxdepth: 4 rmapi + + diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst new file mode 100644 index 0000000..aba7a35 --- /dev/null +++ b/docs/source/quickstart.rst @@ -0,0 +1,44 @@ +quickstart +========== + +If you previously used the go package `rmapi`_ ,the keys for authorization +are re-used because we use the same storage location & format. + +If not, you'll need to register the client as a new device on `my remarkable`_. + + +.. _my remarkable: https://my.remarkable.com/connect/remarkable + +.. _rmapi: https://github.com/juruen/rmapi + + +Registering the API CLient +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Registering the device is easy. Go to `my remarkable`_ to register a new device +and use the code you see on the webpage + +.. code-block:: python + :linenos: + + + from rmapi.api import Client + + rmapi = Client() + # Shoud return False + rmapi.is_authenticated() + # This registers the client as a new device. The received device token is + # stored in the users directory in the file ~/.rmapi, the same as with the + # go rmapi client. + rmapi.register_device("fkgzzklrs") + # It's always a good idea to refresh the user token everytime you start + # a new session. + rmapi.refresh_token() + # Shoud return True + rmapi.is_authenticated() + +Working with items +~~~~~~~~~~~~~~~~~~ + +The remarkable fs structure is flat containing metadata objects. + diff --git a/rmapi/__init__.py b/rmapi/__init__.py index e69de29..9323ac7 100644 --- a/rmapi/__init__.py +++ b/rmapi/__init__.py @@ -0,0 +1,5 @@ +""" +.. note:: + This is an unofficial api client for the Remarkable Cloud. Use at your own + risk. +"""