Skip to content

Commit be8dcfc

Browse files
authored
Merge pull request #75 from afh/gnulib-css
Use GNU manual CSS for HTML texinfo documentation
2 parents de5e94b + 0fdbd1b commit be8dcfc

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
# Create print version of ledger manpage
103103
pdfroff -man -dpaper=letter -P-pletter $src/doc/ledger.1 > ledger.1.pdf
104104
# Patch web version of ledger manual to support dark mode
105-
sed -e 's@</style>@&<link rel="stylesheet" type="text/css" href="/stylesheets/doc.css">@' ledger3.html -i
105+
sed -e 's@</style>@&\n<link rel="stylesheet" type="text/css" href="https://www.gnu.org/software/gnulib/manual.css"><link rel="stylesheet" type="text/css" href="/stylesheets/doc.css">@' ledger3.html -i
106106
'';
107107

108108
postInstall = ''
@@ -129,7 +129,7 @@
129129
texi2pdf --batch ledger-mode.texi
130130
makeinfo --force --html --no-split ledger-mode.texi
131131
# Patch web version of ledger mode manual to support dark mode
132-
sed -e 's@</style>@&<link rel="stylesheet" type="text/css" href="/stylesheets/doc.css">@' ledger-mode.html -i
132+
sed -e 's@</style>@&\n<link rel="stylesheet" type="text/css" href="https://www.gnu.org/software/gnulib/manual.css"><link rel="stylesheet" type="text/css" href="/stylesheets/doc.css">@' ledger-mode.html -i
133133
runHook postBuild
134134
'';
135135

source/stylesheets/darkmode.css.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
--light-highlight-code-background-color:#eee;
55
--light-link-color:#00e;
66
--light-visited-color:#551a8b;
7+
--light-example-brightness:95%;
78

89
--dark-color:#fefefe;
910
--dark-background-color:#212121;
1011
--dark-highlight-code-background-color:#333;
1112
--dark-link-color:#2997ff;
1213
--dark-visited-color:#aa6fdf;
14+
--light-example-brightness:125%;
1315
}
1416

1517
@media (prefers-color-scheme: light) {
@@ -19,6 +21,7 @@
1921
--highlight-code-background-color:var(--light-highlight-code-background-color);
2022
--link-color:var(--light-link-color);
2123
--visited-color:var(--light-visited-color);
24+
--example-brightness:var(--light-example-brightness);
2225
}
2326
}
2427
@media (prefers-color-scheme: dark) {
@@ -28,6 +31,7 @@
2831
--highlight-code-background-color:var(--dark-highlight-code-background-color);
2932
--link-color:var(--dark-link-color);
3033
--visited-color:var(--dark-visited-color);
34+
--example-brightness:var(--dark-example-brightness);
3135
}
3236
}
3337

source/stylesheets/doc.css.scss

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
@import url("darkmode.css");
22

3-
body {
3+
body, html, div.example {
44
color:var(--color);
55
background:var(--background-color);
66
}
77

8-
:link {
9-
color:var(--link-color);
8+
h1, h2, h3, h4 {
9+
color:var(--color);
10+
}
11+
12+
div.example {
13+
filter:brightness(var(--exmaple-brightness));
1014
}
1115

12-
:visited {
13-
color:var(--visited-color);
16+
:link, a[href]:hover {
17+
color:var(--link-color) !important;
1418
}
1519

20+
a[href]:visited {
21+
color:var(--visited-color) !important;
22+
}

0 commit comments

Comments
 (0)