New sphinx theme, better navigation and release docs

This commit is contained in:
Luke Murphy
2019-11-03 16:38:39 +01:00
parent 4b47706883
commit 352a7d3697
10 changed files with 104 additions and 48 deletions

View File

@ -1,7 +1,7 @@
author = 'decentral1se'
copyright = '2019, decentral1se'
html_static_path = ['_static']
html_theme = 'alabaster'
html_theme = 'sphinx_rtd_theme'
master_doc = 'index'
project = 'merkle-tree-stream'
templates_path = ['_templates']

View File

@ -0,0 +1,24 @@
.. _example:
*******
Example
*******
.. code-block:: python
from hashlib import sha256
from merkle_tree_stream import MerkleTreeGenerator
def leaf(node, roots=None):
return sha256(node.data).digest()
def parent(first, second):
sha256 = hashlib.sha256()
sha256.update(first.data)
sha256.update(second.data)
return sha256.digest()
merkle = MerkleTreeGenerator(leaf=leaf, parent=parent)
merkle.write('hello')
merkle.write('hashed')
merkle.write('world')

View File

@ -1,12 +1,13 @@
.. include:: ../../README.rst
:end-before: _documentation
Table of Contents
*****************
:end-before: _documentation
.. toctree::
:maxdepth: 1
:hidden:
install
upgrade
example
modules-api
other-impls
contribute

View File

@ -3,6 +3,10 @@
Other Implementations
*********************
* https://github.com/mafintosh/merkle-tree-stream
* https://github.com/datrs/merkle-tree-stream
* https://github.com/datcxx/merkle-tree-stream
* `mafintosh/merkle-tree-stream`_
* `datrs/merkle-tree-stream`_
* `datcxx/merkle-tree-stream`_
.. _mafintosh/merkle-tree-stream: https://github.com/mafintosh/merkle-tree-stream
.. _datrs/merkle-tree-stream: https://github.com/datrs/merkle-tree-stream
.. _datcxx/merkle-tree-stream: https://github.com/datcxx/merkle-tree-stream

View File

@ -0,0 +1,7 @@
*******
Upgrade
*******
.. code-block:: bash
$ pip install --upgrade merkle-tree-stream