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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file mkdocs-git-authors-plugin-0.1.tar.gz.

File metadata

  • Download URL: mkdocs-git-authors-plugin-0.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.0

File hashes

Hashes for mkdocs-git-authors-plugin-0.1.tar.gz
Algorithm Hash digest
SHA256 4d66e93b1442acac969ec53eaa010230ea93174601af34e47c33c41cd67645dc
MD5 d6ae271759198fab3cb7cfaaaa3968ab
BLAKE2b-256 d53204e767daf1a8446d62641bcb33b03a8cf65922179fc704ccad4b1e4dc0be

See more details on using hashes here.

File details

Details for the file mkdocs_git_authors_plugin-0.1-py3-none-any.whl.

File metadata

  • Download URL: mkdocs_git_authors_plugin-0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.0

File hashes

Hashes for mkdocs_git_authors_plugin-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 611b9b884d7829c04309d770bcd0dbbb944ac6e5c223f86438e74744399da91d
MD5 7aa2efab00408167ed06cd8b3491b549
BLAKE2b-256 d6ae4bafa3973090c106452b0da790721eff9c1824c64a623c0489c877f4ea88

See more details on using hashes here.

Supported by

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