Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

43 add documentation link #47

Merged
merged 4 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ You can access with [LUCE API](https://documenter.getpostman.com/view/18666298/2
> Once logged in, you can get a token which is necessary for later operation
3. Step 3: upload data

## Document
You can access [LUCE document](https://maastrichtu-ids.github.io/DecentralizedHealthcareBackend/) for details.

## Tips

1. if you encounter the issue:
Expand All @@ -73,3 +76,6 @@ You can access with [LUCE API](https://documenter.getpostman.com/view/18666298/2
```

please deploy a LUCERegistry contract in `admin/deployRegistry/` endpoint.

## Development Manual
For how to maintain the documentation, please refer to: [Documentation mantaince](./docs/README.MD)
98 changes: 98 additions & 0 deletions docs/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
## Introduction

This guide provides instructions on how to generate and update the documentation for LUCE. We use Sphinx for documentation due to its compatibility with Python and Djando, and its ease of generating readable and organized HTML documentation.

## prerequisites

Before proceeding, ensure you have the following installed:

- Python
- Django
- Sphinx (Install via pip install sphinx)

## Initial Setup

1. Clone the Repository:

Ensure you have the latest version of the codebase.

```
git clone https://github.com/MaastrichtU-IDS/DecentralizedHealthcareBackend.git
cd DecentralizedHealthcareBackend
```

2. Install Sphinx (if not already installed):

```
pip install sphinx
```

3. Set Up Sphinx Directory:

```
sphinx-quickstart docs
```

This will create a docs directory with basic configuration files.

4. Configure Sphinx:

- Edit the `conf.py` file in the `docs/source` directory. Set the `sys.path` to include Django project's root directory, so Sphinx can find the modules
- Set Django settings modules in `conf.py`:

```
import os
import sys
import django

sys.path.insert(0, os.path.abspath('../../luce_vm/luce_django/luce'))

os.environ['DJANGO_SETTINGS_MODULE'] = 'lucehome.settings'
django.setup()
```

5. Create Documentation with Autodoc:

Sphinx can automatically generate documentation from your docstrings using the autodoc extension. Enable this in your `conf.py`:

```
extensions = ['sphinx.ext.autodoc']
```

6. add `modules` in `index.rst`:

```
================================

.. toctree::
:maxdepth: 2
:caption: Contents:

modules

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
```

## Generating Documentation

1. Automatic .rst File Generation

Use `sphinx-apidoc` to automatically generate `.rst` files from the codebase. Check `sphinx-apidoc --help` for more information

```
# Adjust paths as necessary
sphinx-apidoc -o ./source ../luce_vm/luce_django/luce/ ../**/migrations/* ../**/tests/* ../**/utils/* ../**/lucehome/* ../**/manage.py
```

2. Build the Documentation

Generate the Documentation

```
make html
```
Binary file modified docs/build/doctrees/accounts.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/blockchain.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/healthcare.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/modules.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/privacy.doctree
Binary file not shown.
9 changes: 0 additions & 9 deletions docs/build/html/_sources/accounts.rst.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
accounts package
================

Subpackages
-----------

.. toctree::
:maxdepth: 4

accounts.migrations
accounts.tests

Submodules
----------

Expand Down
9 changes: 0 additions & 9 deletions docs/build/html/_sources/blockchain.rst.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
blockchain package
==================

Subpackages
-----------

.. toctree::
:maxdepth: 4

blockchain.migrations
blockchain.tests

Submodules
----------

Expand Down
3 changes: 0 additions & 3 deletions docs/build/html/_sources/modules.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,4 @@ luce
accounts
blockchain
healthcare
lucehome
manage
privacy
utils
8 changes: 0 additions & 8 deletions docs/build/html/_sources/privacy.rst.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
privacy package
===============

Subpackages
-----------

.. toctree::
:maxdepth: 4

privacy.migrations

Submodules
----------

Expand Down
26 changes: 2 additions & 24 deletions docs/build/html/accounts.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<script src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="accounts.migrations package" href="accounts.migrations.html" />
<link rel="next" title="blockchain package" href="blockchain.html" />
<link rel="prev" title="luce" href="modules.html" />

<link rel="stylesheet" href="_static/custom.css" type="text/css" />
Expand All @@ -36,25 +36,6 @@

<section id="accounts-package">
<h1>accounts package<a class="headerlink" href="#accounts-package" title="Permalink to this heading">¶</a></h1>
<section id="subpackages">
<h2>Subpackages<a class="headerlink" href="#subpackages" title="Permalink to this heading">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="accounts.migrations.html">accounts.migrations package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="accounts.migrations.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="accounts.migrations.html#module-accounts.migrations.0001_initial">accounts.migrations.0001_initial module</a></li>
<li class="toctree-l2"><a class="reference internal" href="accounts.migrations.html#module-accounts.migrations">Module contents</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="accounts.tests.html">accounts.tests package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="accounts.tests.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="accounts.tests.html#module-accounts.tests.test_Registration">accounts.tests.test_Registration module</a></li>
<li class="toctree-l2"><a class="reference internal" href="accounts.tests.html#module-accounts.tests">Module contents</a></li>
</ul>
</li>
</ul>
</div>
</section>
<section id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this heading">¶</a></h2>
</section>
Expand Down Expand Up @@ -872,10 +853,7 @@ <h3>Navigation</h3>
<li class="toctree-l2 current"><a class="current reference internal" href="#">accounts package</a></li>
<li class="toctree-l2"><a class="reference internal" href="blockchain.html">blockchain package</a></li>
<li class="toctree-l2"><a class="reference internal" href="healthcare.html">healthcare package</a></li>
<li class="toctree-l2"><a class="reference internal" href="lucehome.html">lucehome package</a></li>
<li class="toctree-l2"><a class="reference internal" href="manage.html">manage module</a></li>
<li class="toctree-l2"><a class="reference internal" href="privacy.html">privacy package</a></li>
<li class="toctree-l2"><a class="reference internal" href="utils.html">utils package</a></li>
</ul>
</li>
</ul>
Expand All @@ -886,7 +864,7 @@ <h3>Related Topics</h3>
<li><a href="index.html">Documentation overview</a><ul>
<li><a href="modules.html">luce</a><ul>
<li>Previous: <a href="modules.html" title="previous chapter">luce</a></li>
<li>Next: <a href="accounts.migrations.html" title="next chapter">accounts.migrations package</a></li>
<li>Next: <a href="blockchain.html" title="next chapter">blockchain package</a></li>
</ul></li>
</ul></li>
</ul>
Expand Down
34 changes: 4 additions & 30 deletions docs/build/html/blockchain.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<script src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="blockchain.migrations package" href="blockchain.migrations.html" />
<link rel="prev" title="accounts.tests package" href="accounts.tests.html" />
<link rel="next" title="healthcare package" href="healthcare.html" />
<link rel="prev" title="accounts package" href="accounts.html" />

<link rel="stylesheet" href="_static/custom.css" type="text/css" />

Expand All @@ -36,29 +36,6 @@

<section id="blockchain-package">
<h1>blockchain package<a class="headerlink" href="#blockchain-package" title="Permalink to this heading">¶</a></h1>
<section id="subpackages">
<h2>Subpackages<a class="headerlink" href="#subpackages" title="Permalink to this heading">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="blockchain.migrations.html">blockchain.migrations package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="blockchain.migrations.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="blockchain.migrations.html#module-blockchain.migrations.0001_initial">blockchain.migrations.0001_initial module</a></li>
<li class="toctree-l2"><a class="reference internal" href="blockchain.migrations.html#module-blockchain.migrations.0002_consentcontract_research_purpose">blockchain.migrations.0002_consentcontract_research_purpose module</a></li>
<li class="toctree-l2"><a class="reference internal" href="blockchain.migrations.html#module-blockchain.migrations">Module contents</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="blockchain.tests.html">blockchain.tests package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="blockchain.tests.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="blockchain.tests.html#module-blockchain.tests.test_ConsentContract">blockchain.tests.test_ConsentContract module</a></li>
<li class="toctree-l2"><a class="reference internal" href="blockchain.tests.html#module-blockchain.tests.test_DataContract">blockchain.tests.test_DataContract module</a></li>
<li class="toctree-l2"><a class="reference internal" href="blockchain.tests.html#module-blockchain.tests.test_LuceRegistryContract">blockchain.tests.test_LuceRegistryContract module</a></li>
<li class="toctree-l2"><a class="reference internal" href="blockchain.tests.html#module-blockchain.tests.test_PlonkVerifierContract">blockchain.tests.test_PlonkVerifierContract module</a></li>
<li class="toctree-l2"><a class="reference internal" href="blockchain.tests.html#module-blockchain.tests">Module contents</a></li>
</ul>
</li>
</ul>
</div>
</section>
<section id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this heading">¶</a></h2>
</section>
Expand Down Expand Up @@ -1261,10 +1238,7 @@ <h3>Navigation</h3>
<li class="toctree-l2"><a class="reference internal" href="accounts.html">accounts package</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">blockchain package</a></li>
<li class="toctree-l2"><a class="reference internal" href="healthcare.html">healthcare package</a></li>
<li class="toctree-l2"><a class="reference internal" href="lucehome.html">lucehome package</a></li>
<li class="toctree-l2"><a class="reference internal" href="manage.html">manage module</a></li>
<li class="toctree-l2"><a class="reference internal" href="privacy.html">privacy package</a></li>
<li class="toctree-l2"><a class="reference internal" href="utils.html">utils package</a></li>
</ul>
</li>
</ul>
Expand All @@ -1274,8 +1248,8 @@ <h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li><a href="modules.html">luce</a><ul>
<li>Previous: <a href="accounts.tests.html" title="previous chapter">accounts.tests package</a></li>
<li>Next: <a href="blockchain.migrations.html" title="next chapter">blockchain.migrations package</a></li>
<li>Previous: <a href="accounts.html" title="previous chapter">accounts package</a></li>
<li>Next: <a href="healthcare.html" title="next chapter">healthcare package</a></li>
</ul></li>
</ul></li>
</ul>
Expand Down
Loading