This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal-sdk.git

commit 250dcb8da1c189c34b8eda523830a616402fbc38
Author: Marcus Christie <[email protected]>
AuthorDate: Fri Jul 24 10:29:56 2020 -0400

    AIRAVATA-3342 Generate documentation for the SDK
---
 README.md                                  | 11 +++++++++++
 airavata_django_portal_sdk/user_storage.py |  3 +++
 docs/index.md                              | 26 ++++++++++++++++++++++++++
 mkdocs.yml                                 |  6 ++++++
 requirements-dev.txt                       |  2 ++
 5 files changed, 48 insertions(+)

diff --git a/README.md b/README.md
index eb3c4f6..5779cf1 100644
--- a/README.md
+++ b/README.md
@@ -9,3 +9,14 @@ pip install .
 ```
 django-admin makemigrations --settings=tests.test_settings 
airavata_django_portal_sdk
 ```
+
+## Documentation
+
+To generate the documentation,
+[create a virtual environment](https://docs.python.org/3/tutorial/venv.html) 
and
+then:
+
+```
+pip install -r requirements-dev.txt
+mkdocs serve
+```
diff --git a/airavata_django_portal_sdk/user_storage.py 
b/airavata_django_portal_sdk/user_storage.py
index 00fb079..a4a7b27 100644
--- a/airavata_django_portal_sdk/user_storage.py
+++ b/airavata_django_portal_sdk/user_storage.py
@@ -118,6 +118,7 @@ def exists(request, data_product):
 
 
 def dir_exists(request, path):
+    "Return True if path exists in user's data store."
     return _Datastore().dir_exists(request.user.username, path)
 
 
@@ -132,6 +133,7 @@ def user_file_exists(request, path):
 
 
 def delete_dir(request, path):
+    """Delete path in user's data store, if it exists."""
     return _Datastore().delete_dir(request.user.username, path)
 
 
@@ -151,6 +153,7 @@ def delete(request, data_product):
 
 
 def listdir(request, path):
+    """Return a tuple of two lists, one for directories, the second for 
files."""
     datastore = _Datastore()
     if datastore.dir_exists(request.user.username, path):
         directories, files = datastore.list_user_dir(request.user.username, 
path)
diff --git a/docs/index.md b/docs/index.md
new file mode 100644
index 0000000..370a221
--- /dev/null
+++ b/docs/index.md
@@ -0,0 +1,26 @@
+# Airavata Django Portal SDK
+
+The Airavata Django Portal SDK provides libraries that assist in developing
+custom Django app extensions to the
+[Airavata Django Portal](https://github.com/apache/airavata-django-portal).
+
+## API Documentation
+
+### module user_storage
+
+::: airavata_django_portal_sdk.user_storage.save
+    :docstring:
+::: airavata_django_portal_sdk.user_storage.save_input_file_upload
+    :docstring:
+::: airavata_django_portal_sdk.user_storage.open_file
+    :docstring:
+::: airavata_django_portal_sdk.user_storage.exists
+    :docstring:
+::: airavata_django_portal_sdk.user_storage.delete
+    :docstring:
+::: airavata_django_portal_sdk.user_storage.dir_exists
+    :docstring:
+::: airavata_django_portal_sdk.user_storage.delete_dir
+    :docstring:
+::: airavata_django_portal_sdk.user_storage.listdir
+    :docstring:
diff --git a/mkdocs.yml b/mkdocs.yml
new file mode 100644
index 0000000..f92ad01
--- /dev/null
+++ b/mkdocs.yml
@@ -0,0 +1,6 @@
+site_name: Airavata Django Portal SDK
+
+theme: readthedocs
+
+markdown_extensions:
+  - mkautodoc
diff --git a/requirements-dev.txt b/requirements-dev.txt
new file mode 100644
index 0000000..6c13042
--- /dev/null
+++ b/requirements-dev.txt
@@ -0,0 +1,2 @@
+mkdocs==1.1.2
+mkautodoc==0.1.0

Reply via email to