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
Hashes for mkdocs-git-authors-plugin-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d66e93b1442acac969ec53eaa010230ea93174601af34e47c33c41cd67645dc |
|
MD5 | d6ae271759198fab3cb7cfaaaa3968ab |
|
BLAKE2b-256 | d53204e767daf1a8446d62641bcb33b03a8cf65922179fc704ccad4b1e4dc0be |
Hashes for mkdocs_git_authors_plugin-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 611b9b884d7829c04309d770bcd0dbbb944ac6e5c223f86438e74744399da91d |
|
MD5 | 7aa2efab00408167ed06cd8b3491b549 |
|
BLAKE2b-256 | d6ae4bafa3973090c106452b0da790721eff9c1824c64a623c0489c877f4ea88 |