Skip to main content

Mkdocs plugin to display git authors of a page

Project description

Actions Status PyPI - Python Version PyPI PyPI - Downloads codecov

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:

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:

John Doe, Jane Doe

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs-git-authors-plugin-0.1.tar.gz (5.2 kB view hashes)

Uploaded Source

Built Distribution

mkdocs_git_authors_plugin-0.1-py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page