New Sphinx theme and better docs

This commit is contained in:
Luke Murphy 2019-11-03 16:44:42 +01:00
parent 4254c262fe
commit 72b19a2919
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
11 changed files with 107 additions and 39 deletions

View File

@ -0,0 +1,17 @@
Hypercore_Crypto 0.0.1a2 (2019-11-03)
=====================================
Improved Documentation
---------------------
- New Sphinx theme.
- Add a changelog.
Hypercore_Crypto 0.0.1a1 (2019-10-05)
=====================================
Project Announcements
---------------------
- The first alpha development release is made!

View File

@ -33,8 +33,36 @@ Type check source
tox -e type
Release Process
---------------
Build the documentation
-----------------------
.. code-block:: bash
$ tox -e docs
$ tox -e docs-livereload
Make a new release
------------------
Ensure metadata for packaging is correct.
.. code-block:: bash
$ tox -e metadata-release
Generate the changelog with the next target version.
.. code-block:: bash
$ export VERSION=1.0.1 tox -e changelog
Make a new Git tag.
.. code-block:: bash
$ git tag -a 1.0.1
And finally, make a new release.
.. code-block:: bash

View File

@ -29,22 +29,11 @@ hypercore-crypto
Cryptography primitives for Hypercore
-------------------------------------
Cryptography primitives for `Hypercore`_ (WIP).
Cryptography primitives for Hypercore.
.. _Hypercore: https://hypercore.readthedocs.io
Part of the `Datpy`_ project.
.. _example:
Example
*******
.. code-block:: python
from hypercore_crypto import key_pair, sign, verify
public_key, secret_key = key_pair()
signature = sign(b'hello world', secret_key)
verify(message, signature, public_key)
.. _Datpy: https://datpy.decentral1.se/
.. _documentation:
@ -54,12 +43,3 @@ Documentation
* `hypercore-crypto.readthedocs.io`_
.. _hypercore-crypto.readthedocs.io: https://hypercore-crypto.readthedocs.io/
Mirroring
*********
* `hack.decentral1.se/datpy/hypercore-crypto`_
* `github.com/datpy/hypercore-crypto`_
.. _hack.decentral1.se/datpy/hypercore-crypto: https://hack.decentral1.se/datpy/hypercore-crypto
.. _github.com/datpy/hypercore-crypto: https://github.com/datpy/hypercore-crypto

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 = 'hypercore-crypto'
templates_path = ['_templates']

View File

@ -0,0 +1,13 @@
.. _example:
*******
Example
*******
.. code-block:: python
from hypercore_crypto import key_pair, sign, verify
public_key, secret_key = key_pair()
signature = sign(b'hello world', secret_key)
verify(message, signature, public_key)

View File

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

View File

@ -1,7 +1,11 @@
.. _other-implementations:
*********************
Other Implementations
*********************
* https://github.com/mafintosh/hypercore-crypto
* https://github.com/datcxx/hypercore-crypto
* `mafintosh/hypercore-crypto`_
* `datcxx/hypercore-crypto`_
.. _mafintosh/hypercore-crypto: https://github.com/mafintosh/hypercore-crypto
.. _datcxx/hypercore-crypto: https://github.com/datcxx/hypercore-crypto

View File

@ -0,0 +1,7 @@
*******
Upgrade
*******
.. code-block:: bash
$ pip install --upgrade hypercore-crypto

View File

@ -15,8 +15,8 @@ include = '\.pyi?$'
[tool.towncrier]
directory = 'changelog/'
filename = 'CHANGELOG.rst'
package = 'hypercore-crypto'
package_dir = 'hypercore-crypto'
package = 'hypercore_crypto'
package_dir = 'hypercore_crypto'
[[tool.towncrier.type]]
directory = 'removal'

View File

@ -58,6 +58,7 @@ warning-is-error = True
[options.extras_require]
docs =
sphinx
sphinx_rtd_theme
sphinx-autodoc-typehints >= 1.6.0, < 2.0
changelog =
towncrier <= 19.2.0, < 20.0

27
tox.ini
View File

@ -52,20 +52,37 @@ skipdist = True
extras = docs
commands = python -m setup build_sphinx
[testenv:docs-livereload]
description = invoke sphinx-autobuild to build and reload the documentation
commands = python -m sphinx_autobuild documentation/source documentation/build
deps = sphinx-autobuild>=0.7.1,<1.0
extras = docs
[testenv:changelog]
description = draft the changelog
description = draw up the new changelog
skipdist = True
extras = changelog
commands = towncrier --draft
passenv = VERSION
deps = towncrier
commands = towncrier --version={env:VERSION} {posargs}
[testenv:metadata-release]
description = validate the package metadata
deps = twine
commands = twine check {toxworkdir}/dist/*
commands =
rm -rf {toxworkdir}/dist
python -m setup sdist --dist-dir {toxworkdir}/dist bdist_wheel
python -m setup sdist --dist-dir {toxworkdir}/dist bdist_egg
twine check {toxworkdir}/dist/*
whitelist_externals =
rm
[testenv:release]
description = make a release
deps = {[testenv:metadata-release]deps}
commands =
python -m setup sdist bdist_wheel
rm -rf {toxworkdir}/dist
python -m setup sdist --dist-dir {toxworkdir}/dist bdist_wheel
python -m setup sdist --dist-dir {toxworkdir}/dist bdist_egg
twine upload {toxworkdir}/dist/*
whitelist_externals =
rm