Skip to content

Added Read The Docs & PyPi Status buttons to about.html #74

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
61 changes: 61 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

.env/
8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ Variables and feature toggles
``"account/repo"`` string - used to display a `Codecov`_
build status button in the sidebar. If ``true``, uses your
``github_(user|repo)`` settings; defaults to ``false.``
* ``rtd_button``: ``true``, ``false`` or ``github_repo`` string -- used to display a `ReadTheDocs`_
status button in the sidebar. If ``true``, uses your
``github_repo`` settings; defaults to ``false.``
* ``pypi_button``: ``true``, ``false`` or ``github_repo`` string -- used to display a `PyPi`_
status button in the sidebar. If ``true``, uses your
``github_repo`` settings; defaults to ``false.``
* ``gratipay_user``: Set to your `Gratipay <https://gratipay.com>`_ username
if you want a Gratipay 'Donate' section in your sidebar.

Expand Down Expand Up @@ -473,3 +479,5 @@ Changelog

.. _Codecov: https://codecov.io
.. _Sphinx: http://sphinx-doc.org
.. _ReadTheDocs: https://readthedocs.org/
.. _PyPi: https://pypi.python.org/pypi
2 changes: 1 addition & 1 deletion alabaster/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version_info__ = (0, 7, 7)
__version_info__ = (0, 7, 8)
__version__ = '.'.join(map(str, __version_info__))
32 changes: 32 additions & 0 deletions alabaster/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,35 @@ <h1 class="logo"><a href="{{ pathto(master_doc) }}">{{ project }}</a></h1>
</a>
</p>
{% endif %}

{% if theme_rtd_button|lower != 'false' %}
{% if theme_rtd_button|lower == 'true' %}
{% set path = theme_github_repo %}
{% else %}
{% set path = theme_rtd_button %}
{% endif %}
<p>
<a href="https://readthedocs.org/projects/{{ path }}/?badge=latest">
<img
alt="https://readthedocs.org/projects/{{ path }}/badge/?version=lastest"
src="https://readthedocs.org/projects/{{ path }}/badge/?version=lastest"
/>
</a>
</p>
{% endif %}

{% if theme_pypi_button|lower != 'false' %}
{% if theme_pypi_button|lower == 'true' %}
{% set path = theme_github_repo %}
{% else %}
{% set path = theme_pypi_button %}
{% endif %}
<p>
<a href="https://pypi.python.org/pypi/{{ path }}">
<img
alt="https://img.shields.io/pypi/v/{{ path }}.svg"
src="https://img.shields.io/pypi/v/{{ path }}.svg"
/>
</a>
</p>
{% endif %}
2 changes: 2 additions & 0 deletions alabaster/theme.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ github_type = watch
github_count = true
travis_button = false
codecov_button = false
rtd_button = false
pypi_button = false
gratipay_user =
gittip_user =
analytics_id =
Expand Down