blob: 532906215334f1660a90617746ba2e91331930f1 (
plain)
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
|
# Catppuccin theme for cgit
This theme brings the Catppuccin color palette to cgit. It also makes some very
slight UI changes to cgit itself. The theme can be seen in action on this
website itself, and can be easily ported to other colorschemes too.
Syntax highlighting (with pygments) and markdown styling (with syntax
highlighting inside the code blocks) is also supported.
# Usage
## Website styling
Move `cgit.css` to `/usr/share/cgit/cgit.css` on your server. Also make sure
your `/etc/cgitrc` has this:
``` fish
css=/cgit.css
```
Uncomment one of the theme variants at the top of the `cgit.css` file, and
set `--accent-color` to your preferred accent color.
## Syntax highlighting
Install `catppuccin[pygments]` from pip (along with other dependencies as
defined in cgit's manual). Place `syntax-highlighting.py` at
`/usr/lib/cgit/filters/syntax-highlighting.py`
Find these lines in `syntax-highlighting.py`:
``` py
from catppuccin.extras.pygments import MochaStyle
# ...
formatter = HtmlFormatter(style=MochaStyle, nobackground=True)
```
And optionally replace `MochaStyle` with `LatteStyle`, `FrappeStyle` or
`MacchiatoStyle`
## Markdown styling
Move `md2html` to `/usr/lib/cgit/filters/html-converters/md2html` and optionally
edit these lines:
``` py
from catppuccin.extras.pygments import MochaStyle
# ...
sys.stdout.write(HtmlFormatter(style=MochaStyle).get_style_defs('.highlight'))
```
And replace `MochaStyle` with `LatteStyle`, `FrappeStyle` or `MacchiatoStyle`
|