-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
60 lines (52 loc) · 4.3 KB
/
main.py
File metadata and controls
60 lines (52 loc) · 4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
def define_env(env):
@env.macro
def aur(package):
return f'<a href="https://aur.archlinux.org/packages/{package}" title="Arch User Repository Package" rel="noopener noreferrer" target="_blank"><code>{package}</code><small><sup>AUR</sup></small></a>'
@env.macro
def archpkg(package):
return f'<a href="https://archlinux.org/packages/?name={package}" title="Arch Repo Package" rel="noopener noreferrer" target="_blank"><code>{package}</code><small><sup>:material-arch:</sup></small></a>'
@env.macro
def ubpkg(package):
return f'<a href="https://packages.ubuntu.com/search?keywords={package}&searchon=names&suite=jammy§ion=all" title="Ubuntu 22.04 Package" rel="noopener noreferrer" target="_blank"><code>{package}</code><small><sup>:material-ubuntu:</sup></small></a>'
@env.macro
def debpkg(package):
return f'<a href="https://packages.debian.org/search?keywords={package}&searchon=names&suite=trixie§ion=all" title="Debian Testing Package" rel="noopener noreferrer" target="_blank"><code>{package}</code><small><sup>:material-debian:</sup></small></a>'
@env.macro
def fedorapkg(package):
return f'<a href="https://packages.fedoraproject.org/search?query={package}&releases=Fedora+39&start=0" title="Fedora 39 Package" rel="noopener noreferrer" target="_blank"><code>{package}</code><small><sup>:material-fedora:</sup></small></a>'
@env.macro
def track(file):
return f'<a href="https://git.blendos.co/blendOS/tracks/-/raw/main/{file}.yaml" title="Official Track" rel="noopener noreferrer" target="_blank"><code>{file}</code><small><sup>:material-file-code:</sup></small></a>'
@env.macro
def custom_track(impl, file):
return f'<a href="{impl}/{file}.yaml" rel="noopener noreferrer" target="_blank" title="Unofficial Track"><code>{file}</code><small><sup>:material-file-code:</sup></small></a>'
@env.macro
def reference(type, ref):
return f'<a href="/reference/{type}/{ref}" title="Reference Page"><code>{ref}</code></a>'
@env.macro
def inlinealert(color, icon, title, text):
return '<span class=' + color +'>**' + icon + '{ title=' + title + ' } ' + text + '**</span>'
@env.macro
def dockerhub(author, image):
return f'<a href="https://hub.docker.com/r/{author}/{image}" title="Docker Hub" rel="noopener noreferrer" target="_blank"><code>{author}/{image}</code><small><sup>:fontawesome-brands-docker:</sup></small></a>'
@env.macro
def ghcr(author, image):
return f'<a href="https://ghcr.io/{author}/{image}" title="Github Container Registry" rel="noopener noreferrer" target="_blank"><code>{author}/{image}</code><small><sup>:octicons-container-16:</sup></small></a>'
@env.macro
def quay(author, image):
return f'<a href="https://quay.io/{author}/{image}" title="Quay.io" rel="noopener noreferrer" target="_blank"><code>{author}/{image}</code><small><sup><span class="icon-link-misc">:misc-quay:</span></sup></small></a>'
@env.macro
def github(user, repo):
return f'<a href="https://github.com/{user}/{repo}" title="Github Repo" rel="noopener noreferrer" target="_blank"><code>{user}/{repo}</code><small><sup>:fontawesome-brands-github:</sup></small></a>'
@env.macro
def gitlab(user, repo, subgroup="", subgroup1=""):
return f'<a href="https://gitlab.com/{user}/{subgroup}/{subgroup1}/{repo}" title="Gitlab.com Repo" rel="noopener noreferrer" target="_blank"><code>{user}/{repo}</code><small><sup>:fontawesome-brands-gitlab:</sup></small></a>'
@env.macro
def codeberg(user, repo):
return f'<a href="https://codeberg.org/{user}/{repo}" title="Codeberg Repo" rel="noopener noreferrer" target="_blank"><code>{user}/{repo}</code><small><sup>:simple-codeberg:</sup></small></a>'
@env.macro
def blendgit(user, repo, subgroup="", subgroup1=""):
return f'<a href="https://git.blendos.co/{user}/{subgroup}/{subgroup1}/{repo}" title="blendOS Gitlab Repo" rel="noopener noreferrer" target="_blank"><code>{user}/{repo}</code><small><sup>:distro-blend:</sup></small></a>'
@env.macro
def sourcehut(user, repo):
return f'<a href="https://sr.ht/~{user}/{repo}" title="Sourcehut Repo" rel="noopener noreferrer" target="_blank"><code>~{user}/{repo}</code><small><sup>:simple-sourcehut:</sup></small></a>'