Skip to content

Commit 1e4fe86

Browse files
committed
clarify examples
1 parent 76fc484 commit 1e4fe86

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,36 @@ no supported themes *yet*
3636
3737
### In markdown pages
3838
39-
You can use ``{{ git_authors_summary }}`` to insert a summary of the authors of a page.
39+
You can use ``{{ git_authors_summary }}`` to insert a summary of the authors of a page. Authors are sorted by their name and have a `mailto:` link with their email.
4040

41-
Example output:
41+
An example output:
4242

43-
> [John Doe](mailto:#), [Jane Doe](mailto:#)
43+
```html
44+
<span class='git-authors'><a href='mailto:[email protected]'>Jane Doe</a><a href='mailto:[email protected]'>John Doe</a></span>
45+
```
46+
47+
Which renders as:
48+
49+
> [Jane Doe](mailto:#), [John Doe](mailto:#)
4450

4551
### In theme templates
4652

47-
In theme template you will have access to the jinja2 variable `git_authors`, which contains a list of authors (as dicts), f.e.:
53+
In theme templates you will have access to the jinja2 variable `git_authors`, which contains a list of authors dicts, like the following example:
4854

4955
```python
5056
[{
57+
'name' : 'Jane Doe',
58+
'email' : '[email protected]',
59+
'last_datetime' : datetime.datetime(),
60+
'lines' : 200,
61+
'contribution' : '40.0%'
62+
},
63+
{
5164
'name' : 'John Doe',
52-
'email' : 'abc@abc.com',
65+
'email' : 'john@abc.com',
5366
'last_datetime' : datetime.datetime(),
54-
'lines' : 100,
55-
'contribution' : '100.0%'
67+
'lines' : 300,
68+
'contribution' : '60.0%'
5669
}]
5770
```
5871

@@ -68,4 +81,4 @@ An example of how to use in your templates:
6881
{% endif %}
6982
```
7083

71-
Alternatively, you could use the simple ``{{ git_authors_summary }}`` to insert a summary of the authors.
84+
Alternatively, you could use the simple preformatted ``{{ git_authors_summary }}`` to insert a summary of the authors.

0 commit comments

Comments
 (0)