Skip to content

Commit

Permalink
Merge pull request #3 from openpermissions/rst
Browse files Browse the repository at this point in the history
Rst
  • Loading branch information
louisnayegon committed Apr 27, 2016
2 parents c8cbd84 + 5d88c03 commit 5ea97b6
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 108 deletions.
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ SERVICE_RELEASE = 0.4.0
# Directory to output python in source sphinx documentation
IN_SOURCE_DOC_DIR = $(BUILDDIR)/in_source

# Directory to output markdown converted docs to
# Directory to output rst converted docs to
SERVICE_DOC_DIR = $(BUILDDIR)/service/html

# Directory to find markdown docs
# Directory to find rst docs
DOC_DIR = $(SERVICEDIR)/documents

# Directory to find markdown docs
# Directory to find rst docs
SPHINX_DIR = $(SERVICEDIR)/docs

# Create list of target .html file names to be created based on all .md files found in the 'doc directory'
md_docs := $(patsubst $(DOC_DIR)/%.md,$(SERVICE_DOC_DIR)/%.html,$(wildcard $(DOC_DIR)/*.md)) \
# Create list of target .html file names to be created based on all .rst files found in the 'doc directory'
rst_docs := $(patsubst $(DOC_DIR)/%.rst,$(SERVICE_DOC_DIR)/%.html,$(wildcard $(DOC_DIR)/*.rst)) \
$(SERVICE_DOC_DIR)/README.html

clean:
Expand Down Expand Up @@ -91,29 +91,29 @@ html: sphinx


# Dependencies of .html document files created from files in the 'doc directory'
$(SERVICE_DOC_DIR)/%.html : $(DOC_DIR)/%.md
$(SERVICE_DOC_DIR)/%.html : $(DOC_DIR)/%.rst
mkdir -p $(dir $@)
grip $< --export $@
rst2html.py $< $@

# Dependenciy of .html document files created from README.md
$(SERVICE_DOC_DIR)/%.html : %.md
# Dependenciy of .html document files created from README.rst
$(SERVICE_DOC_DIR)/%.html : %.rst
mkdir -p $(dir $@)
grip $< --export $@
rst2html.py $< $@

# Create .html docs from all markdown files
md_docs: $(md_docs)
# Create .html docs from all rst files
rst_docs: $(rst_docs)
ifneq ($(wildcard $(DOC_DIR)),)
# Copy dependent files required to render the views, e.g. images
rsync \
--exclude '*.md' \
--exclude '*.rst' \
--exclude 'eap' \
--exclude 'drawio' \
-r \
$(DOC_DIR)/ $(SERVICE_DOC_DIR)
endif

# Create all docs
docs: html md_docs
docs: html rst_docs

behave:
cd tests/behave && behave features -v --junit --junit-directory reports
92 changes: 0 additions & 92 deletions README.md

This file was deleted.

112 changes: 112 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
The Open Permissions Platform - Identity Library
================================================

Table of Contents
=================

- `Introduction <#introduction>`__
- `Dependencies <#dependencies>`__
- `Running tests <#running-tests>`__
- `Installation <#installation>`__
- `Code Examples <#code-examples>`__
- `Documentation <#Documentation>`__

Introduction
============

This is a Python library used for creating unique **hub keys** used
within the Open Permissions Platform.

`Click here for the Open Permissions Platform home
page <http://www.openpermissions/>`__

Dependencies
============

This has been tested using

- Ubuntu 14.0.4
- Python 2.7.10

Running tests
=============

Setup
-----

Prior to running any test the python pip dependencies need to be
installed. Run the following command to do this

.. code:: bash
make requirements
Unit tests
----------

To run the unit tests run the following command

.. code:: bash
make test
Logs will be found at tests/unit/reports

Behave tests
------------

To run the behave tests run the following command

.. code:: bash
make behave
Logs will be found at tests/behave/reports

Documentation
-------------

To generate documentation, run the following command:

.. code:: bash
make docs
Installation
============

::

python setup.py install

Generate a hub key
------------------

Code
~~~~

.. code:: Python
from bass.hubkey import create_hub_key
hub_key = generate_hub_key(
resolver_id='copyrighthub.com',
hub_id='hub1',
repository_id='f8e3968eb99f48d6b9f84340efb64d47',
entity_type="asset"
)
print hub_key
Output
~~~~~~

.. code:: Console
https://copyrighthub.com/s1/hub1/f8e3968eb99f48d6b9f84340efb64d47/asset/79fa0ce2e082467cad24703dcfdf7317
Documentation
-------------

Additional code documentation can be found at
http://bass.readthedocs.org/en/stable/
2 changes: 1 addition & 1 deletion bass/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and limitations under the License.

__version__ = '1.0.4'
__version__ = '1.0.5'
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
git+https://github.com/CDECatapult/behave.git@v1.3.1
git+https://github.com/catapultbamboo/cloverpy.git@0.1
grip==3.2.0
pylint==1.3.0
pytest==2.5.2
pytest-cov==1.7.0
Expand Down

0 comments on commit 5ea97b6

Please sign in to comment.