Skip to content

Commit 2182919

Browse files
committed
Added contributors
1 parent 9325b3c commit 2182919

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

docs/index.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Welcome to VCE Algorithmics notes
22

3+
## Introduction
4+
35
!!! danger
46

57
This is a work in progress. Some information may be incorrect or outdated
@@ -19,12 +21,21 @@ Pull requests are welcome! Please see [the repository](https://github.com/mcloug
1921
For mobile viewers, please open the site menu in the top left to view pages and contents
2022

2123

22-
Quick Links:
24+
## Quick Links
2325

2426
- [Algorithms](algorithms.md)
2527
- [Computer Science](computer-science.md)
2628
- [Graphs](graphs.md)
2729

2830
!!! tip
2931

30-
Each page can easily be printed with <kbd>ctrl</kbd> / <kbd>cmd</kbd> + <kbd>p</kbd>
32+
Each page can easily be printed with <kbd>ctrl</kbd> / <kbd>cmd</kbd> + <kbd>p</kbd>
33+
34+
---
35+
36+
## Contributors
37+
38+
This could be you!
39+
40+
{{ contributors() | safe }}
41+

main.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Used for jinja-type macros
2+
3+
import requests
4+
5+
6+
def define_env(env):
7+
@env.macro
8+
def contributors(repo="mcloughlan/algo-notes"):
9+
USERS = requests.get(
10+
f"https://api.github.com/repos/{repo}/contributors").json()
11+
html = ""
12+
for u in USERS:
13+
html += f'<a href="https://github.com/{u["login"]}"><img src="https://github.com/{u["login"]}.png?size=50" alt="{u["login"]}" style="border-radius: 50%; margin: 5px;"></a>\n'
14+
return html

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ use_directory_urls: false
4040
plugins:
4141
- search
4242
- git-revision-date-localized
43+
- macros # For contribution icons
4344
extra:
4445
meta:
4546
description: "A complete set of VCE Algorithmics notes. Constantly revised since 2022"

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
mkdocs-material~=9.6.16
2-
mkdocs-git-revision-date-localized-plugin~=1.4.7
2+
mkdocs-git-revision-date-localized-plugin~=1.4.7
3+
mkdocs-macros-plugin~=1.3.7

0 commit comments

Comments
 (0)