From fab635f2dae6672c075e2e5de0711895acd62920 Mon Sep 17 00:00:00 2001
From: Martin Larralde <martin.larralde@embl.de>
Date: Fri, 22 Jul 2022 11:04:33 +0200
Subject: [PATCH] Add links and documentation to install the package with
 `conda`

---
 README.md             | 12 +++++++++++-
 docs/install.rst      | 22 +++++++++++-----------
 pyfastani/__init__.py | 13 +++++++++++++
 3 files changed, 35 insertions(+), 12 deletions(-)

diff --git a/README.md b/README.md
index e18f28a..3e00bbe 100644
--- a/README.md
+++ b/README.md
@@ -6,11 +6,15 @@
 [![Coverage](https://img.shields.io/codecov/c/gh/althonos/pyfastani/branch/main.svg?style=flat-square&maxAge=3600)](https://codecov.io/gh/althonos/pyfastani/)
 [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square&maxAge=2678400)](https://choosealicense.com/licenses/mit/)
 [![PyPI](https://img.shields.io/pypi/v/pyfastani.svg?style=flat-square&maxAge=3600)](https://pypi.org/project/pyfastani)
+[![Bioconda](https://img.shields.io/conda/vn/bioconda/pyfastani?style=flat-square&maxAge=3600&logo=anaconda)](https://anaconda.org/bioconda/pyfastani)
+[![AUR](https://img.shields.io/aur/version/python-pyfastani?logo=archlinux&style=flat-square&maxAge=3600)](https://aur.archlinux.org/packages/python-pyfastani)
 [![Wheel](https://img.shields.io/pypi/wheel/pyfastani.svg?style=flat-square&maxAge=3600)](https://pypi.org/project/pyfastani/#files)
 [![Python Versions](https://img.shields.io/pypi/pyversions/pyfastani.svg?style=flat-square&maxAge=600)](https://pypi.org/project/pyfastani/#files)
 [![Python Implementations](https://img.shields.io/pypi/implementation/pyfastani.svg?style=flat-square&maxAge=600&label=impl)](https://pypi.org/project/pyfastani/#files)
 [![Source](https://img.shields.io/badge/source-GitHub-303030.svg?maxAge=2678400&style=flat-square)](https://github.com/althonos/pyfastani/)
-[![GitHub issues](https://img.shields.io/github/issues/althonos/pyfastani.svg?style=flat-square&maxAge=600)](https://github.com/althonos/pyfastani/issues)
+[![Mirror](https://img.shields.io/badge/mirror-EMBL-009f4d?style=flat-square&maxAge=2678400)](https://git.embl.de/larralde/pyfastani/)
+[![Issues](https://img.shields.io/github/issues/althonos/pyfastani.svg?style=flat-square&maxAge=600)](https://github.com/althonos/pyfastani/issues)
+[![Docs](https://img.shields.io/readthedocs/pyfastani/latest?style=flat-square&maxAge=600)](https://pyfastani.readthedocs.io)
 [![Changelog](https://img.shields.io/badge/keep%20a-changelog-8A0707.svg?maxAge=2678400&style=flat-square)](https://github.com/althonos/pyfastani/blob/master/CHANGELOG.md)
 [![Downloads](https://img.shields.io/badge/dynamic/json?style=flat-square&color=303f9f&maxAge=86400&label=downloads&query=%24.total_downloads&url=https%3A%2F%2Fapi.pepy.tech%2Fapi%2Fprojects%2Fpyfastani)](https://pepy.tech/project/pyfastani)
 [![DOI](https://img.shields.io/badge/doi-10.5281%2Fzenodo.4940237-purple?style=flat-square&maxAge=86400)](https://doi.org/10.5281/zenodo.4940237)
@@ -58,6 +62,12 @@ In the event you have to compile the package from source, all the required
 libraries are vendored in the source distribution, so you'll only need a
 C/C++ compiler.
 
+Otherwise, PyFastANI is also available as a [Bioconda](https://pyfastani.github.io/)
+package:
+```console
+$ conda install -c bioconda pyfastani
+```
+
 ## 💡 Example
 
 The following snippets show how to compute the ANI between two genomes,
diff --git a/docs/install.rst b/docs/install.rst
index df5aacb..0398cad 100644
--- a/docs/install.rst
+++ b/docs/install.rst
@@ -22,17 +22,17 @@ one is available, or from source after compiling the Cython code :
    $ pip install --user pyfastani
 
 
-.. Conda
-.. ^^^^^
-..
-.. `pyfastani` is also available as a `recipe <https://anaconda.org/bioconda/pyfastani>`_
-.. in the `bioconda <https://bioconda.github.io/>`_ channel. To install, simply
-.. use the ``conda`` installer:
-..
-.. .. code:: console
-..
-..    $ conda install -c bioconda pyfastani
-..
+Conda
+^^^^^
+
+`pyfastani` is also available as a `recipe <https://anaconda.org/bioconda/pyfastani>`_
+in the `bioconda <https://bioconda.github.io/>`_ channel. To install, simply
+use the ``conda`` installer:
+
+.. code:: console
+
+   $ conda install -c bioconda pyfastani
+
 
 Arch User Repository
 ^^^^^^^^^^^^^^^^^^^^
diff --git a/pyfastani/__init__.py b/pyfastani/__init__.py
index 6525c57..b397a4e 100644
--- a/pyfastani/__init__.py
+++ b/pyfastani/__init__.py
@@ -25,3 +25,16 @@ __all__ = [
     "Position",
     "MAX_KMER_SIZE"
 ]
+
+# Small addition to the docstring: we want to show a link redirecting to the
+# rendered version of the documentation, but this can only work when Python
+# is running with docstrings enabled
+if __doc__ is not None:
+    __doc__ += """See Also:
+    An online rendered version of the documentation for this version
+    of the library on
+    `Read The Docs <https://pytrimal.readthedocs.io/en/v{}/>`_.
+
+    """.format(
+        __version__
+    )
-- 
GitLab