Skip to content

Search draft - #3

Merged
AlexMikhalev merged 12 commits into
mainfrom
search_draft
Sep 6, 2025
Merged

Search draft#3
AlexMikhalev merged 12 commits into
mainfrom
search_draft

Conversation

@AlexMikhalev

Copy link
Copy Markdown
Contributor

No description provided.

commit 443e4f4
Merge: 4659e0c 49d6bca
Author: Dr Alexander Mikhalev <alex@metacortex.engineer>
Date:   Wed Dec 4 08:44:10 2024 +0000

    Merge pull request #1 from terraphim/watcher_server

    Watcher server

commit 49d6bca
Author: AlexMikhalev <alex@metacortex.engineer>
Date:   Tue Dec 3 15:15:13 2024 +0000

    feat: watcher and serve commands added, ugly but working

commit b04f213
Author: AlexMikhalev <alex@metacortex.engineer>
Date:   Tue Dec 3 11:55:07 2024 +0000

    feat: watcher and serve commands added
Signed-off-by: AlexMikhalev <alex@metacortex.engineer>
Signed-off-by: AlexMikhalev <alex@metacortex.engineer>
Signed-off-by: Dr Alexander Mikhalev <alex@metacortex.engineer>
@AlexMikhalev
AlexMikhalev merged commit 72ed31d into main Sep 6, 2025
3 of 13 checks passed
AlexMikhalev added a commit that referenced this pull request Aug 8, 2026
- Contain redirect sources under build dir; escape and validate targets
- Honour --hostname via serve_book_on
- Reserve pre-existing heading IDs in slug collision map
- Surface 404 render/write failures; fix index content always |safe

Refs #3 #4 #5
AlexMikhalev added a commit that referenced this pull request Aug 8, 2026
Completes E1 and implements plan item C3, which the review had assumed was
already done.

Theme picker: themes.css defined all five themes and theme-switch.js
listened for [data-theme-set] clicks, but no template rendered such a
control, so only automatic prefers-color-scheme switching worked. The header
now carries a <details> picker — keyboard accessible with no script, closing
on select — and the root element exposes data-default-theme and
data-preferred-dark-theme, so `default-theme` and `preferred-dark-theme`
finally take effect. theme-switch.js marks the active entry with
aria-current. Browser-verified with agent-browser: selecting Coal sets
data-theme=coal, computed background becomes rgb(20,22,23), localStorage
persists it, and it survives navigation.

Unsupported-key warnings: nine keys parsed and did nothing in silence.
config::unsupported_keys_in inspects the parsed document rather than the
loaded BookConfig, because a filled default is indistinguishable from a
value the author typed — warning on defaults would fire for every book.
Messages distinguish "not implemented yet" (syntax-theme, additional-css/js,
fold, mathjax-support) from "no Pagefind equivalent" (the elasticlunr
scoring knobs) and "out of scope" (playground).

Three further defects found while wiring it up:

- main.rs had its own copy of the config loader, so the CLI got neither the
  defaults fill nor the new warnings, and the two copies had already drifted
  (only main's resolved book.toml from the book directory). Collapsed into
  config::load_config_from; main.rs delegates.
- index.html and print.html never linked themes.css, so they applied
  data-theme while showing unthemed colours. index.html also loaded neither
  theme-switch.js nor keyboard.js.
- The header GitHub link and the footer link rendered unconditionally,
  emitting href="" — a link to the page itself — when the URLs were unset.
  The header's edit link was guarded by the wrong key. Icon links also
  regained their aria-labels.

Refs #3, Refs #5

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant