Skip to content

Commit

Permalink
Include an author list in the documentation
Browse files Browse the repository at this point in the history
The standard "author" variable is only used by default in some output
formats, like EPUB.

Authors are generated automatically from git history, with a .mailmap
file used to normalize commits from people's various usernames and email
addresses.
  • Loading branch information
tsibley committed May 6, 2019
1 parent d9bd433 commit be89e10
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Alli Black <black.alli@gmail.com>
Barney Potter <barney.potter.24@gmail.com>
Emma Hodcroft <emmahodcroft@gmail.com>
Emma Hodcroft <freezefire666@yahoo.com>
Gytis Dudas <gytisdudas@gmail.com>
James Hadfield <jameshadfield@users.noreply.github.com>
James Hadfield <jh22@sanger.ac.uk>
James Hadfield <jh22@sanger.ac.uk>
John Huddleston <huddlej@gmail.com>
Louise Moncla <lhmoncla@gmail.com>
Richard Neher <neher@login10.cluster.bc2.ch>
Richard Neher <neher@login11.cluster.bc2.ch>
Richard Neher <neher@login20.cluster.bc2.ch>
Richard Neher <richard.neher@tuebingen.mpg.de>
Richard Neher <richard.neher@tuebingen.mpg.de>
Richard Neher <richard.neher@unibas.ch>
Sarah Murata <sarah.d.murata@gmail.com>
Sidney Bell <sidneymb@uw.edu>
Sidney Bell <sidneymbell@users.noreply.github.com>
Thomas Sibley <tsibley@fredhutch.org>
Trevor Bedford <trevor@bedford.io>
Trevor Bedford <trvrb@trevorbedford.com>
4 changes: 4 additions & 0 deletions docs/authors.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Authors
=======

Augur includes contributions from |authors|.
33 changes: 32 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,34 @@
# -- Project information -----------------------------------------------------

from datetime import date
import subprocess

def git_authors():
result = subprocess.run(
["git", "shortlog", "--summary"],
stdout = subprocess.PIPE,
check = True)

names = [
line.strip().split("\t")[1]
for line in result.stdout.decode("utf-8").splitlines()
]

return names

This comment has been minimized.

Copy link
@tejasnagar06

tejasnagar06 Feb 11, 2024

#It shows the name of the authors

def prose_list(items):
if not items:
return ""
if len(items) == 1:
return items[0]
elif len(items) == 2:
return " and ".join(items)
else:
return ", ".join([*items[0:-1], "and " + items[-1]])

project = 'augur'
copyright = '2014–%d Trevor Bedford and Richard Neher' % (date.today().year)
author = 'James Hadfield, John Huddleston, Emma Hodcroft, Tom Sibley, Barney Potter, Trevor Bedford, Richard Neher'
author = prose_list(git_authors())


# -- General configuration ---------------------------------------------------
Expand All @@ -39,6 +63,13 @@
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# A string of reStructuredText that will be included at the end of every source
# file that is read. This is a possible place to add substitutions that should
# be available in every file.
rst_epilog = f"""
.. |authors| replace:: {author}
"""


# -- Options for HTML output -------------------------------------------------

Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Welcome to augur's documentation!
tutorials
commands
APIdoc
authors



Expand Down

0 comments on commit be89e10

Please sign in to comment.