diff --git a/README.md b/README.md index 2930f71..de6198e 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ - Config file stored under user `$HOME/.config/gallery` -## 🚀 Installation +## Installation ### From GitLab @@ -64,7 +64,7 @@ gallery install-completion Then restart your shell or follow the printed instructions to activate it. -## 🖥️ CLI Usage +## CLI Usage The `gallery` command has four subcommands: `generate`, `config`, `tui`, and `install-completion`. @@ -134,7 +134,7 @@ python -m http.server 8000 -d /path/to/public_html Then open `http://localhost:8000/gallery/` in your browser. You can of course use any port you want to. -## 📸 Screenshots +## Screenshots ### Main Gallery View ![gallery_view](docs/images/main_gallery_view.png) @@ -149,7 +149,7 @@ Then open `http://localhost:8000/gallery/` in your browser. You can of course us -## 🖱️ TUI Usage +## TUI Usage The TUI is a terminal user interface built with [Textual](https://textual.textualize.io/). It lets you edit the configuration and trigger generation without leaving your terminal. @@ -217,75 +217,24 @@ formula: "$$E = mc^2$$" ## Shortcuts -| Button | Function | Keyboard Shortcut | -|--------|----------|-------------------| -| 🔍 Search | Real-time plot search | `Ctrl+K` | -| 📋 Recent | Recently viewed plots | `Ctrl+R` | -| ⚖️ Compare | Side-by-side comparison | `Ctrl+C` | -| ☀️ Theme | Toggle dark/light theme | `Ctrl+T` | - - -## 🛠️ Development Guide - -### Project Structure - -``` -gallery/ -├── api.py # generate() — primary public entry point -├── builder.py # build_gallery() recursive traversal; template/assets -├── cli.py # gallery CLI command (argparse + argcomplete) -├── tui.py # gallery tui (Textual TUI) -├── config/ -│ └── __init__.py # GalleryConfig, GallerySource, ConfigManager -├── utils/ -│ ├── metadata.py # YAML/JSON loading, inheritance, caching -│ ├── processing.py # PDF→PNG conversion; needs_update(); render_gallery_page() -│ ├── stats.py # Directory size/file count statistics -│ ├── backup.py # Backup functionality -│ └── datetime_utils.py # Date/time utilities for templates -├── templates/ -│ └── gallery.html # Single Jinja2 template for all pages -└── assets/ - ├── css/ # Modular CSS; main.css imports all via @import - └── js/ # Vanilla ES modules; GalleryApp orchestrates all managers -``` - -### Running Tests - -```bash -pytest tests/ -pytest tests/test_generate_gallery.py -v -pytest tests/test_generate_gallery.py::test_needs_update_missing_target -v -``` - -### Adding New Features - -#### CSS component -```css -/* gallery/assets/css/new-feature.css */ -.new-feature { } -``` -Add `@import url('./new-feature.css');` to `main.css`. - -#### JavaScript module -```javascript -// gallery/assets/js/new-feature.js -export class NewFeature { ... } -``` -Import in `gallery-app.js` and instantiate in `GalleryApp`. - +| Icon | Button | Function | Shortcut | +|------|---------|--------------------------|----------| +| 🔍 | Search | Real-time plot search | `Ctrl+K` | +| 📋 | Recent | Recently viewed plots | `Ctrl+R` | +| ⚖️ | Compare | Side-by-side comparison | `Ctrl+C` | +| ☀️ | Theme | Toggle dark/light theme | `Ctrl+T` | ## Troubleshooting ### Common Issues -| Issue | Solution | -|-------|----------| -| `gallery` command not found | Run `pip install -e .` from the repo root | +| Issue | (Potential) Solution | +|------------------------------------|----------| +| `gallery` command not found | Run `pip install -e .` from the repo root | | PDF conversion fails — no renderer | Install PyMuPDF: `pip install pymupdf` (or `apt-get install imagemagick` as fallback) | | PDF conversion fails — corrupt file | Verify the PDF opens in a viewer; try `pip install --upgrade pymupdf` | -| Permission denied on web dir | Check file permissions and web directory access | -| Metadata not showing | Check YAML syntax with `python -c "import yaml; yaml.safe_load(open('metadata.yaml'))"` | +| Permission denied on web dir | Check file permissions and web directory access | +| Metadata not showing | Check YAML syntax with `python -c "import yaml; yaml.safe_load(open('metadata.yaml'))"` | ### ImageMagick memory limits (fallback backend only) @@ -295,22 +244,14 @@ export MAGICK_MAP_LIMIT=2GB gallery generate --verbose ``` -### Debug / clean rebuild - -```bash -gallery generate --verbose -gallery generate --clean --verbose -``` - - ## License This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details. ## Disclaimer on the use of Artificial Intelligence -This project was made *entirely* using Claude Sonnet 4.0 and GPT 4.1. 100% of the code was AI generated and no human hand was involved other than prompting the Agent. I do not claim any part of this project as my own work. +This project was made *entirely* using Claude Sonnet 4.0 and GPT 4.1. 100% of the code was AI generated and no human hand was involved other than prompting the Agent. -## 🔗 Links +## Links - [Example Gallery](https://etpwww.etp.kit.edu/~kschmidt/gallery/index.html)