aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-23 16:13:56 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-23 16:13:56 +0200
commit36d87e27019fce743e63be87222e987510863e6f (patch)
treeb5cffac3c1aa417fa24da79a99b6da85828fceb3 /internal
parent90c8dfc6cc3ab4b6b78feec5f738beeb41fb9605 (diff)
downloadlectio-36d87e27019fce743e63be87222e987510863e6f.tar.gz
lectio-36d87e27019fce743e63be87222e987510863e6f.zip
web: remove deus_vult theme; add global monospace toggle (web_mono config + top-bar 'mono')
Diffstat (limited to 'internal')
-rw-r--r--internal/config/config.go2
-rw-r--r--internal/config/config.toml1
-rw-r--r--internal/config/config_test.go3
-rw-r--r--internal/web/render_test.go2
-rw-r--r--internal/web/server.go2
-rw-r--r--internal/web/static/base.css8
-rw-r--r--internal/web/static/themes/deus_vult.css49
-rw-r--r--internal/web/static/themes/memento_mori.css2
-rw-r--r--internal/web/templates/index.html5
9 files changed, 22 insertions, 52 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index c15b5a0..ebe687f 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -64,6 +64,7 @@ type Config struct {
WebTheme string `toml:"web_theme"`
WebPort int `toml:"web_port"`
WebDisplay string `toml:"web_display"`
+ WebMono bool `toml:"web_mono"`
Parts map[string]map[string]bool `toml:"parts"`
}
@@ -92,6 +93,7 @@ func Default() Config {
WebTheme: "transfiguration",
WebPort: 0,
WebDisplay: "horizontal",
+ WebMono: false,
Parts: nil,
}
}
diff --git a/internal/config/config.toml b/internal/config/config.toml
index cfcb85b..3a15de2 100644
--- a/internal/config/config.toml
+++ b/internal/config/config.toml
@@ -9,6 +9,7 @@ offline = false # true = never fetch; read only harvested sigla + ca
web_theme = "transfiguration" # built-in order/season theme or a user theme in ~/.config/lectio/themes/
web_port = 0 # lectio-web port; 0 = try 1099, then any free port
web_display = "horizontal" # lectio-web layout: "horizontal" (stacked), "vertical" (columns), "interlinear" (verse-by-verse)
+web_mono = false # lectio-web: monospace reading face for any theme (also a top-bar "mono" toggle)
# Which parts to show. Both tables are commented out -> every part is shown.
# Uncomment a table and set a part to false to hide it; parts you don't list
diff --git a/internal/config/config_test.go b/internal/config/config_test.go
index 9ca311b..d2f3203 100644
--- a/internal/config/config_test.go
+++ b/internal/config/config_test.go
@@ -38,6 +38,9 @@ func TestLoadOverride(t *testing.T) {
func TestWebDefaults(t *testing.T) {
def := Default()
+ if def.WebMono {
+ t.Errorf("WebMono default should be false")
+ }
if def.WebTheme != "transfiguration" {
t.Errorf("WebTheme default wrong: got %q, want %q", def.WebTheme, "transfiguration")
}
diff --git a/internal/web/render_test.go b/internal/web/render_test.go
index 126cb84..0e64168 100644
--- a/internal/web/render_test.go
+++ b/internal/web/render_test.go
@@ -21,7 +21,7 @@ func TestBuiltinThemes(t *testing.T) {
t.Setenv("XDG_CONFIG_HOME", t.TempDir()) // no user themes
for _, name := range []string{
"transfiguration", "desert_fathers", "benedictines", "franciscans",
- "memento_mori", "deus_vult", "dominicans", "advent", "nativity", "lent",
+ "memento_mori", "dominicans", "advent", "nativity", "lent",
"easter", "pentecost", "ordinary", "epiphany", "marian",
} {
if b, err := themeCSS(name); err != nil || len(b) == 0 {
diff --git a/internal/web/server.go b/internal/web/server.go
index 3fe1e4e..c7e645d 100644
--- a/internal/web/server.go
+++ b/internal/web/server.go
@@ -164,6 +164,7 @@ type indexData struct {
ThemeOpts []themeOpt
Theme string
Display string
+ Mono bool
Ref string
Lookup template.HTML
Reading template.HTML
@@ -224,6 +225,7 @@ func indexHandler(cfg config.Config) http.HandlerFunc {
ThemeOpts: themeOpts,
Theme: theme,
Display: display,
+ Mono: queryBool(r, "mono", cfg.WebMono),
Ref: ref,
Lookup: lookup,
Reading: reading,
diff --git a/internal/web/static/base.css b/internal/web/static/base.css
index 776c934..59c67aa 100644
--- a/internal/web/static/base.css
+++ b/internal/web/static/base.css
@@ -13,6 +13,7 @@
* (the ONE sanctioned type override; base.css still owns sizing/spacing). */
--font-reading: var(--theme-font, Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif);
--font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
+ --font-mono: ui-monospace, "Cascadia Code", "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
--measure: 42rem;
--space-1: 0.5rem;
--space-2: 1rem;
@@ -39,6 +40,13 @@ body {
color: var(--fg);
}
+/* Global monospace reading toggle (config web_mono / the "mono" top-bar
+ * checkbox): forces the reading face to mono over whatever the theme uses,
+ * for any theme. UI chrome (--font-ui) is untouched. */
+body.mono {
+ --font-reading: var(--font-mono);
+}
+
.page {
max-width: 64rem;
margin: 0 auto;
diff --git a/internal/web/static/themes/deus_vult.css b/internal/web/static/themes/deus_vult.css
deleted file mode 100644
index 2388fbe..0000000
--- a/internal/web/static/themes/deus_vult.css
+++ /dev/null
@@ -1,49 +0,0 @@
-/* deus_vult -- religious-order palette (crusader / Templar): plate-armor
- * grey field, steel, red cross. Colour only; see docs/THEMES.md.
- */
-:root {
- --bg: #bcc1c6; /* plate-armor grey */
- --fg: #20242a; /* dark steel */
- --muted: #5c636b; /* steel-grey */
- --accent: #a81b23; /* Templar cross red */
- --link: #3f4a55; /* dark steel-slate */
- --refrain: #8a1f27; /* deep red */
- --border: #9aa0a6; /* steel */
-}
-
-.heading {
- color: var(--accent);
-}
-
-.citation {
- color: var(--muted);
-}
-
-.vnum {
- color: var(--muted);
-}
-
-.refrain {
- color: var(--refrain);
-}
-
-a {
- color: var(--link);
-}
-
-a:hover,
-a:focus {
- color: var(--accent);
-}
-
-.controls,
-.version-label,
-.reading-section + .reading-section {
- border-color: var(--border);
-}
-
-.controls input,
-.controls select,
-.controls button {
- border-color: var(--border);
-}
diff --git a/internal/web/static/themes/memento_mori.css b/internal/web/static/themes/memento_mori.css
index d99911b..f6e5174 100644
--- a/internal/web/static/themes/memento_mori.css
+++ b/internal/web/static/themes/memento_mori.css
@@ -12,7 +12,7 @@
--border: #333330;
--error: #7a4a42; /* dried blood -- error/alert accent only */
/* the one non-colour override: a monospace reading face (see base.css). */
- --theme-font: ui-monospace, "Cascadia Code", "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
+ --theme-font: var(--font-mono);
}
.heading {
diff --git a/internal/web/templates/index.html b/internal/web/templates/index.html
index 03c0078..8c88779 100644
--- a/internal/web/templates/index.html
+++ b/internal/web/templates/index.html
@@ -21,7 +21,7 @@
<link id="theme" rel="stylesheet" href="/theme.css?name={{.Theme}}">
<script src="/static/htmx.min.js"></script>
</head>
-<body>
+<body{{if .Mono}} class="mono"{{end}}>
<div class="page">
<form id="controls" class="controls" hx-get="/readings" hx-target="#pane" hx-trigger="change">
@@ -69,6 +69,9 @@
</select>
</label>
+ <label class="mono-toggle"><input type="checkbox" {{if .Mono}}checked{{end}}
+ onchange="document.body.classList.toggle('mono', this.checked)"> mono</label>
+
<form id="lookup-form" class="controls" hx-get="/lookup" hx-target="#lookup-results" hx-include="#controls">
<input type="text" name="ref" placeholder="np. J 20:1" value="{{.Ref}}">
<button type="submit">szukaj</button>