You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-136Lines changed: 4 additions & 136 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Lightweight [MkDocs](https://www.mkdocs.org/) plugin to display git authors of a
12
12
13
13
> Authors: Jane Doe, John Doe
14
14
15
-
The plugin only considers authors of the current lines in the page ('surviving code' using `git blame`).
15
+
See the [demo](https://timvink.github.io/mkdocs-git-authors-plugin/). The plugin only considers authors of the current lines in the page ('surviving code' using `git blame`).
16
16
17
17
Other MkDocs plugins that use information from git:
18
18
@@ -37,143 +37,11 @@ plugins:
37
37
38
38
> If you have no `plugins` entry in your config file yet, you'll likely also want to add the `search` plugin. MkDocs enables it by default if there is no `plugins` entry set.
39
39
40
-
## Usage
40
+
## Documentation
41
41
42
-
### In supported themes
42
+
See https://timvink.github.io/mkdocs-git-authors-plugin/
43
43
44
-
no supported themes *yet*.
45
-
46
-
### In markdown pages
47
-
48
-
You can use the following jinja tags to insert content into your markdown pages:
49
-
50
-
- ``{{ git_page_authors }}`` a summary of the authors of a page. Output wrapped in `<span class='git-page-authors'>`
51
-
- ``{{ git_site_authors }}`` a summary of all authors of all pages in your site. Output wrapped in `<span class='git-site-authors'>`
52
-
53
-
For example, adding ``{{ git_page_authors }}`` will insert:
[MkDocs](https://www.mkdocs.org/) offers possibilities to [customize an existing theme](https://www.mkdocs.org/user-guide/styling-your-docs/#customizing-a-theme).
67
-
68
-
As an example, if you use [mkdocs-material](https://github.com/squidfunk/mkdocs-material) you can implement git-authors by [overriding a template block](https://squidfunk.github.io/mkdocs-material/customization/#overriding-template-blocks):
69
-
70
-
1) Create a new file `main.html` in `docs/theme`:
71
-
72
-
```html
73
-
{% extends "base.html" %}
74
-
75
-
{% block disqus %}
76
-
<div class="md-source-date">
77
-
<small>
78
-
Authors: {{ git_page_authors }}
79
-
</small>
80
-
</div>
81
-
{% include "partials/integrations/disqus.html" %}
82
-
{% endblock %}
83
-
```
84
-
85
-
2) In `mkdocs.yml` make sure to specify the custom directory with the theme overrides:
86
-
87
-
```yml
88
-
theme:
89
-
name: material
90
-
custom_dir: docs/theme/
91
-
```
92
-
93
-
### In theme templates
94
-
95
-
To add more detailed git author information to your theme you can [customize a MkDocs theme](https://www.mkdocs.org/user-guide/styling-your-docs/#customizing-a-theme) or even [develop your own](https://www.mkdocs.org/user-guide/custom-themes/).
96
-
97
-
When enabling this plugin, you will have access to the jinja2 variable `git_info` which contains as dict with the following structure:
Very much open to contributions! Please read [CONTRIBUTING.md](CONTRIBUTING.md) before putting in any work.
47
+
Very much open to contributions! Please read [contributing guide](https://timvink.github.io/mkdocs-git-authors-plugin/contributing.html) before putting in any work.
Make sure your code *roughly* follows [PEP-8](https://www.python.org/dev/peps/pep-0008/) and keeps things consistent with the rest of the code. I recommended using [black](https://github.com/psf/black) to automatically format your code.
Lightweight MkDocs plugin to display git authors of a markdown page.
4
+
5
+
## Setup
6
+
7
+
Install the plugin using pip3:
8
+
9
+
```bash
10
+
pip3 install mkdocs-git-authors-plugin
11
+
```
12
+
13
+
Next, add the following lines to your `mkdocs.yml`:
14
+
15
+
```yml
16
+
plugins:
17
+
- search
18
+
- git-authors
19
+
```
20
+
21
+
> If you have no `plugins` entry in your config file yet, you'll likely also want to add the `search` plugin. MkDocs enables it by default if there is no `plugins` entry set.
[MkDocs](https://www.mkdocs.org/) offers possibilities to [customize an existing theme](https://www.mkdocs.org/user-guide/styling-your-docs/#customizing-a-theme).
28
+
29
+
As an example, if you use [mkdocs-material](https://github.com/squidfunk/mkdocs-material) you can implement git-authors by [overriding a template block](https://squidfunk.github.io/mkdocs-material/customization/#overriding-template-blocks):
30
+
31
+
1) Create a new file `main.html` in `docs/theme`:
32
+
33
+
```html
34
+
{% extends "base.html" %}
35
+
36
+
{% block disqus %}
37
+
<divclass="md-source-date">
38
+
<small>
39
+
Authors: {{ git_page_authors }}
40
+
</small>
41
+
</div>
42
+
{% include "partials/integrations/disqus.html" %}
43
+
{% endblock %}
44
+
```
45
+
46
+
2) In `mkdocs.yml` make sure to specify the custom directory with the theme overrides:
47
+
48
+
```yml
49
+
theme:
50
+
name: material
51
+
custom_dir: docs/theme/
52
+
```
53
+
54
+
## In theme templates
55
+
56
+
To add more detailed git author information to your theme you can [customize a MkDocs theme](https://www.mkdocs.org/user-guide/styling-your-docs/#customizing-a-theme) or even [develop your own](https://www.mkdocs.org/user-guide/custom-themes/).
57
+
58
+
When enabling this plugin, you will have access to the jinja2 variable `git_info` which contains as dict with the following structure:
0 commit comments