Mkdocs plugin to display git authors of a page
Project description
mkdocs-git-authors-plugin
MkDocs plugin to display git authors of a page. Only considers authors of the current lines in the page ('surviving code' using git blame).
Other MkDocs plugins that use information from git:
- mkdocs-git-committers-plugin for displaying authors' github user profiles
- mkdocs-git-revision-date-localized-plugin for displaying the last revision date
Setup
Install the plugin using pip:
pip install mkdocs-git-authors-plugin
Activate the plugin in mkdocs.yml:
plugins:
- git-authors
Usage
In supported themes
no supported themes yet
In markdown pages
You can use {{ git_authors_summary }} to insert a summary of the authors of a page.
Example output:
In theme templates
In theme template you will have access to the jinja2 variable git_authors, which contains a list of authors (as dicts), f.e.:
[{
'name' : 'John Doe',
'email' : 'abc@abc.com',
'last_datetime' : datetime.datetime(),
'lines' : 100,
'contribution' : '100.0%'
}]
An example of how to use in your templates:
{% if git_authors %}
{%- for author in git_authors -%}
<a href="{{ author.email }}" title="{{ author.name }}">
{{ author.name }}
</a>,
{%- endfor -%}
{% endif %}
Alternatively, you could use the simple {{ git_authors_summary }} to insert a summary of the authors.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters