Skip to content

Commit 1589113

Browse files
committed
Make gallery render metrics in browser
1 parent f3cffa5 commit 1589113

4 files changed

Lines changed: 333 additions & 65 deletions

File tree

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Download a book from Project Gutenberg:
5757
uv run bookviz gutenberg 2701 --title moby-dick
5858
```
5959

60-
Generate a static gallery:
60+
Generate the GitHub Pages gallery:
6161

6262
```bash
6363
uv run bookviz gallery \
@@ -67,6 +67,10 @@ uv run bookviz gallery \
6767
--window-size 200
6868
```
6969

70+
The gallery is a static browser app. It publishes the book text files and lets
71+
the browser compute metrics, change window size, change window step, switch
72+
books, and redraw the visualization without regenerating images in CI.
73+
7074
## Metrics
7175

7276
Token metrics:
@@ -92,7 +96,6 @@ inside each window.
9296

9397
## GitHub Pages
9498

95-
The workflow at `.github/workflows/pages.yml` builds the gallery with `uv` and
96-
publishes the generated `site/` directory to GitHub Pages. Enable Pages in the
97-
repository settings and choose GitHub Actions as the source.
98-
99+
The workflow at `.github/workflows/pages.yml` builds the client-side gallery
100+
with `uv` and publishes the generated `site/` directory to GitHub Pages. Enable
101+
Pages in the repository settings and choose GitHub Actions as the source.

bookviz/cli.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def build_parser() -> argparse.ArgumentParser:
5555
gutenberg.add_argument("--force", action="store_true")
5656
gutenberg.set_defaults(func=cmd_gutenberg)
5757

58-
gallery = subparsers.add_parser("gallery", help="Generate a static HTML gallery.")
58+
gallery = subparsers.add_parser("gallery", help="Generate the static client-side gallery.")
5959
gallery.add_argument("--input", type=Path, default=Path("books"))
6060
gallery.add_argument("--output", type=Path, default=Path("site"))
6161
gallery.add_argument("--metrics", nargs="+", default=["word-freq", "lexical-diversity"])
@@ -157,4 +157,3 @@ def cmd_list(_args: argparse.Namespace) -> None:
157157

158158
if __name__ == "__main__":
159159
main()
160-

0 commit comments

Comments
 (0)