Skip to content

Commit 2d38391

Browse files
committed
Add badges.
1 parent 47c2218 commit 2d38391

4 files changed

Lines changed: 47 additions & 2 deletions

File tree

‎README.rst‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
python-dev-tips, `Slides <https://docs.google.com/presentation/d/1BnezhwUy22DiF72wss8GU_YIMfhjortz-uILdIFGuoM/edit?usp=sharing>`__
33
******************************************************************************************************************************************
44

5+
.. image:: https://readthedocs.org/projects/python-dev-tips/badge/?version=latest
6+
:target: http://python-dev-tips.readthedocs.io/en/latest/
7+
:alt: Documentation Status
8+
9+
10+
.. image:: https://github.com/ebezzam/python-dev-tips/actions/workflows/python.yml/badge.svg
11+
:target: https://github.com/ebezzam/python-dev-tips/blob/main/.github/workflows/python.yml
12+
:alt: Unit tests and formatting
13+
514
Tutorial first given at ENS Ulm (January 2023) on how to develop a Python package. There is a slight focus on scientific computing, but the general principles apply to any Python project.
615

716
.. contents:: **Table of Contents**
@@ -129,6 +138,7 @@ On `GitHub <https://github.com/ebezzam/python-dev-tips/tags>`__ create a new rel
129138
TODO
130139
====
131140

141+
- change documentation links to main branch
132142
- joblib example in profile
133143
- github page
134144
- point out features in scripts: object-oriented, asserts, tqdm, type hints

‎docs/source/badges.rst‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Badges
2+
======
3+
4+
Adding badges to your GitHub repository and documentation amounts to simply adding an image.
5+
6+
For example, in a `reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html>`__ file:
7+
8+
.. code:: rst
9+
10+
.. image:: https://readthedocs.org/projects/python-dev-tips/badge/?version=latest
11+
:target: http://python-dev-tips.readthedocs.io/en/latest/
12+
:alt: Documentation Status
13+
14+
which when rendered will make the following badge:
15+
16+
.. image:: https://readthedocs.org/projects/python-dev-tips/badge/?version=latest
17+
:target: http://python-dev-tips.readthedocs.io/en/latest/
18+
:alt: Documentation Status
19+
20+
You can also create `badges from GitHub Actions <https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/adding-a-workflow-status-badge>`__.
21+
22+
.. code:: rst
23+
24+
.. image:: https://github.com/ebezzam/python-dev-tips/actions/workflows/python.yml/badge.svg
25+
:target: https://github.com/ebezzam/python-dev-tips/blob/main/.github/workflows/python.yml
26+
:alt: Unit tests and formatting
27+
28+
.. image:: https://github.com/ebezzam/python-dev-tips/actions/workflows/python.yml/badge.svg
29+
:target: https://github.com/ebezzam/python-dev-tips/blob/main/.github/workflows/python.yml
30+
:alt: Unit tests and formatting
31+
32+
Finally, you can use `Badgen <https://badgen.net/>`__ to create custom badges.
33+

‎docs/source/documentation.rst‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Documentation
22
=============
33

4-
We will be using a `Sphinx <https://www.sphinx-doc.org/en/master/>`__ to generate documentation from
4+
We will be using `Sphinx <https://www.sphinx-doc.org/en/master/>`__ to generate documentation from
55
docstrings that are written within code. Docstrings are long-form
66
comments beneath class and functions declaration that typically describe:
77

@@ -148,6 +148,7 @@ To publish on RTD:
148148

149149
#. Make an account: https://readthedocs.org/accounts/signup/
150150
#. Import a project from the `dashboard <https://readthedocs.org/dashboard/>`__. There are two ways to do this: (1) linking your GitHub account and selecting one of your **public** repositories, or (2) importing the project manually. When linking to GitHub, the documentation is re-built whenever there are changes to the selected branch.
151+
#. Check your project page for the build status.
151152

152-
You can (optionally) define a `.readthedocs.yaml <>`__
153+
You can (optionally) define a `.readthedocs.yaml <https://github.com/ebezzam/python-dev-tips/blob/feat/docs/.readthedocs.yaml>`__
153154
file to ensure a build environment as close as possible to your local machine.

‎docs/source/index.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Contents
1616
.. toctree::
1717

1818
documentation
19+
badges
1920

2021
.. toctree::
2122
:caption: Code

0 commit comments

Comments
 (0)