Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.
docs: integrate native mdbook architecture and github pages deployment
Samir Hossainscb158ef1da4d
diff --git a/.githooks/pre-commit b/.githooks/pre-commitindex abffcdb..2c97a97 100755--- a/.githooks/pre-commit+++ b/.githooks/pre-commit@@ -13,7 +13,7 @@ NC='\033[0m'echo "${BLUE}⏳ Running MovieBox-Tui pre-commit checks...${NC}\n"-echo "${YELLOW}🦀 1/2 Checking Code Formatting (cargo fmt)...${NC}"+echo "${YELLOW}🦀 1/3 Checking Code Formatting (cargo fmt)...${NC}"if ! cargo fmt --check; thenecho "\n${RED}❌ Error: Code formatting failed!${NC}"echo "${RED}Please run 'cargo fmt' to automatically fix the formatting before committing.${NC}"@@ -21,13 +21,23 @@ if ! cargo fmt --check; thenfiecho "${GREEN}✅ Code formatting is perfect.${NC}\n"-echo "${YELLOW}🦀 2/2 Checking Linter Warnings (cargo clippy)...${NC}"+echo "${YELLOW}🦀 2/3 Checking Linter Warnings (cargo clippy)...${NC}"if ! cargo clippy --all-targets --locked -- -D warnings; thenecho "\n${RED}❌ Error: Clippy found warnings or errors in your code!${NC}"echo "${RED}Please fix the warnings above before committing.${NC}"exit 1fiecho "${GREEN}✅ No clippy warnings found.${NC}\n"+if command -v mdbook >/dev/null 2>&1; then+ echo "${YELLOW}📚 3/3 Checking Documentation Build (mdbook)...${NC}"+ cp CHANGELOG.md docs/changelog.md 2>/dev/null || true+ cp CONTRIBUTING.md docs/contributing.md 2>/dev/null || true+ if ! mdbook build >/dev/null 2>&1; then+ echo "\n${RED}❌ Error: mdBook build failed!${NC}"+ exit 1+ fi+ echo "${GREEN}✅ Documentation build passed.${NC}\n"+fiecho "${GREEN}🎉 All checks passed! Committing...${NC}"exit 0diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 5bb15f9..1c49b35 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -48,6 +48,14 @@ jobs:- run: cargo audit- name: Verify packagerun: cargo package --locked+ - name: Verify documentation build+ uses: taiki-e/install-action@v2+ with:+ tool: mdbook+ - name: Test mdBook build+ run: |+ cp CHANGELOG.md docs/changelog.md && cp CONTRIBUTING.md docs/contributing.md+ mdbook buildbuild-and-test:name: Build and test (${{ matrix.os }})diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.ymlnew file mode 100644index 0000000..3ca837b--- /dev/null+++ b/.github/workflows/pages.yml@@ -0,0 +1,51 @@+name: Deploy Documentation++on:+ push:+ branches: [main]+ paths:+ - 'docs/**'+ - 'CHANGELOG.md'+ - 'CONTRIBUTING.md'+ - 'README.md'+ - 'book.toml'+ - '.github/workflows/pages.yml'+ workflow_dispatch:++permissions:+ contents: read+ pages: write+ id-token: write++concurrency:+ group: pages+ cancel-in-progress: false++jobs:+ deploy:+ environment:+ name: github-pages+ url: ${{ steps.deployment.outputs.page_url }}+ runs-on: ubuntu-latest+ timeout-minutes: 10+ steps:+ - uses: actions/checkout@v7+ - name: Install mdbook+ uses: taiki-e/install-action@v2+ with:+ tool: mdbook+ - name: Prepare auxiliary doc links+ run: |+ cp CHANGELOG.md docs/changelog.md+ cp CONTRIBUTING.md docs/contributing.md+ - name: Build documentation book+ run: mdbook build+ - name: Setup Pages+ uses: actions/configure-pages@v5+ - name: Upload Pages artifact+ uses: actions/upload-pages-artifact@v3+ with:+ path: 'book'+ - name: Deploy to GitHub Pages+ id: deployment+ uses: actions/deploy-pages@v4diff --git a/.gitignore b/.gitignoreindex aaa767e..8944543 100644--- a/.gitignore+++ b/.gitignore@@ -18,4 +18,7 @@ Thumbs.db.LSOverridedebug_*.json*.log-dist/\ No newline at end of file+dist/+book/+docs/changelog.md+docs/contributing.md\ No newline at end of filediff --git a/CHANGELOG.md b/CHANGELOG.mdindex aa160ba..69e0d37 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,6 +2,16 @@## [Unreleased]+### Added+- **Native mdBook & GitHub Pages Documentation Architecture**:+ - Integrated `mdBook` documentation engine reading directly from canonical `docs/*.md` guides with zero duplicated markdown files and zero third-party web frameworks.+ - Added `docs/SUMMARY.md` defining table-of-contents chapter navigation across all guides, architecture diagrams, and operational workflows.+ - Added `docs/installation.md` detailing complete installation instructions for macOS (curl script and Homebrew tap), Linux, Windows (PowerShell), Android (Termux), Cargo, and source builds.+ - Formatted `docs/README.md` as the book's introductory landing page featuring core capabilities, prerequisites player matrix, and the live terminal demonstration video streamed from the GitHub CDN.+ - Added minimal root `book.toml` with `navy` dark theme, collapsible sidebar navigation, and client-side full-text search.+ - Added automated GitHub Actions deployment workflow (`.github/workflows/pages.yml`) publishing the documentation site to GitHub Pages on every push to `main`.+ - Added documentation build integrity validation step in CI hygiene pipeline (`.github/workflows/ci.yml`).+## [0.1.16] - 2026-09-05### Addeddiff --git a/Cargo.toml b/Cargo.tomlindex d5a1694..2442442 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -10,6 +10,8 @@ exclude = ["install.ps1","CONTRIBUTING.md",".gitignore",+ "book.toml",+ "book/",]version = "0.1.16"edition = "2024"diff --git a/README.md b/README.mdindex 7ccfcbb..02d0def 100644--- a/README.md+++ b/README.md@@ -99,7 +99,7 @@ moviebox-tui## Documentation-Comprehensive guides are available in the [`docs/`](docs/) directory:+Comprehensive guides are available online at [**mesamirh.github.io/MovieBox-Tui**](https://mesamirh.github.io/MovieBox-Tui/) or locally in the [`docs/`](docs/) directory:- [Controls & Shortcuts](docs/controls.md) — Complete keybindings, navigation, and slash commands- [Media Players](docs/players.md) — Player options, custom paths, and launch flagsdiff --git a/book.toml b/book.tomlnew file mode 100644index 0000000..9172ed9--- /dev/null+++ b/book.toml@@ -0,0 +1,16 @@+[book]+title = "MovieBox-TUI Documentation"+authors = ["Samir <mesamirh>"]+language = "en"+src = "docs"++[output.html]+default-theme = "navy"+preferred-dark-theme = "navy"+git-repository-url = "https://github.com/mesamirh/MovieBox-Tui"+edit-url-template = "https://github.com/mesamirh/MovieBox-Tui/edit/main/{path}"+site-url = "/MovieBox-Tui/"++[output.html.fold]+enable = true+level = 1diff --git a/docs/README.md b/docs/README.mdindex d27b511..06d1115 100644--- a/docs/README.md+++ b/docs/README.md@@ -1,32 +1,73 @@-# MovieBox-Tui Documentation--This folder documents the project so that anyone can understand how it-works without reading the whole codebase. The documents summarize the current module-layout, runtime behavior, and operational workflows in prose tied to the source tree.--## Index--| Document | What it covers | Status |-| -------------------------------------------- | ------------------------------------------------------------------------------- | ------- |-| [architecture.md](architecture.md) | Crate/module map, event loop, async model, data flow | current |-| [controls.md](controls.md) | Keyboard shortcuts, mouse controls, and slash commands | current |-| [modules.md](modules.md) | Crate/module tree with responsibilities | current |-| [providers.md](providers.md) | MovieBox, 4KHDHub, BDIX protocols, signing, resolvers, errors | current |-| [players.md](players.md) | Player detection, mpv/VLC/IINA/AndroidIntent, headers, subtitles, window sizing | current |-| [cache.md](cache.md) | Cache layout, namespaces, TTLs, atomic writes, purge | current |-| [logging.md](logging.md) | File logging, `MOVIEBOX_LOG`, rotation, sanitization, sharing logs | current |-| [tv-mode.md](tv-mode.md) | User-owned M3U playlists, manager, search, playback, config | current |-| [addons-mode.md](addons-mode.md) | Community HTTP addons, Addon Manager, streams aggregation, config | current |-| [config.md](config.md) | `config.json` fields and `MOVIEBOX_*` environment variables | current |-| [downloads.md](downloads.md) | Download engine: resume, ranges, segments, retry, cancel | current |-| [cross-platform.md](cross-platform.md) | OS support, terminal protocols, Termux, focus handling | current |-| [release-checklist.md](release-checklist.md) | Static gates plus required real-environment release verification | current |-| [testing.md](testing.md) | Test architecture, unit/integration tests, fixtures, and QA guidelines | current |-| [debugging.md](debugging.md) | Reproducing issues and what to include in GitHub reports | current |-| [known-issues.md](known-issues.md) | Known limitations and how they are tracked | current |--> Contribution guidance lives in the repository-root `CONTRIBUTING.md` (the canonical-> doc GitHub surfaces for PRs), not in this folder.--> Keep this index accurate: when a behavior change lands, update the matching doc in-> the same change and flip its status to current.+# Introduction++A fast, lightweight terminal client for streaming and downloading movies, TV shows, anime, and live TV — powered by your local media player.++<div align="center">+<video src="https://github.com/user-attachments/assets/60b5fab9-cf7a-4a59-9bbf-b2357c345091" controls autoplay loop muted playsinline width="100%"></video>+</div>++MovieBox-TUI replaces ad-heavy streaming websites and clunky browser players with a clean, keyboard-driven terminal interface. It scrapes stream links directly from multiple sources and launches playback in your native media player with hardware acceleration, audio track switching, and automatic subtitle synchronization.++## Features++- **Multi-Source Streaming**: Search and stream titles across MovieBox, 4KHDHub, BDIX mirrors, custom IPTV playlists, and community Stremio HTTP addons. Press `Ctrl+P` on the Details screen to switch providers in-place.+- **Hardware-Accelerated Playback**: Direct playback in `mpv`, `IINA` (macOS), or `VLC` with stream authentication headers forwarded automatically.+- **Automatic Subtitles**: Automatically searches, downloads, and syncs subtitles in your preferred language directly into your player.+- **Season Batch Downloads**: Download individual episodes or entire seasons with one keypress (`d`), with HTTP range resume support and clean folder structure (`Movies/` and `Series/`).+- **Interactive Settings Hub**: Configure your default media player, download folder, content modes, and themes inside an in-app visual modal via `/settings` (`Ctrl+S`).+- **Modes**: Switch instantly between standard Streaming, Live TV (`Ctrl+T`), and Addon Mode (`Ctrl+A`).+- **Ergonomics & Themes**: Full keyboard navigation (vim-style `j`/`k`, `/`, `Tab`) and mouse support (click, scroll, drag) with 6 built-in themes (Catppuccin, TokyoNight, Nord, Dracula, Gruvbox, Rosé Pine) and terminal theme autodetection.++## Prerequisites++MovieBox-TUI delegates video decoding to an external media player. Install at least one of the following:++| Player | Platform | Quick Install |+| :--- | :--- | :--- |+| **mpv** *(Recommended)* | Linux, macOS, Windows | `brew install mpv` / `sudo apt install mpv` / `winget install mpv` |+| **IINA** | macOS (Native GUI) | `brew install --cask iina` |+| **VLC** | Cross-platform | `brew install --cask vlc` / `sudo apt install vlc` / `winget install VideoLAN.VLC` |+| **Android Player** | Android (Termux) | `pkg install termux-tools` *(launches VLC or Nova)* |++---++## Documentation Directory Map++### Getting Started++| Guide | Description |+| :--- | :--- |+| [Installation](installation.md) | Platform installation instructions, package managers, and binary verification |+| [Keyboard & Controls](controls.md) | Complete keybindings, vim navigation, text editing, and slash commands |+| [Configuration Guide](config.md) | `config.json` schema, settings hub options, and environment variables |++### Features & Modes++| Guide | Description |+| :--- | :--- |+| [Content Providers](providers.md) | Built-in providers, scrapers, stream extractors, and authentication headers |+| [Hardware Players](players.md) | Media player detection, launch flags, stream headers, and watch tracking |+| [Batch Downloads](downloads.md) | Multi-segment download engine, range resume, and folder layout |+| [Stremio Addons](addons-mode.md) | Addon manifest installation, catalog browsing, and stream resolution |+| [Live TV & IPTV](tv-mode.md) | M3U playlist manager, channel parsing, and live stream playback |++### Architecture & Internals++| Guide | Description |+| :--- | :--- |+| [System Architecture](architecture.md) | Subsystem diagrams, async event loop, and task cancellation |+| [Module Breakdown](modules.md) | Crate structure, module responsibilities, and call boundaries |+| [Caching Strategy](cache.md) | Binary disk caching, TTL policies, and LRU memory management |+| [Logging System](logging.md) | File logging, log rotation, and tracing diagnostics |+| [Cross-Platform Operations](cross-platform.md) | Platform compatibility matrix across macOS, Linux, Windows, and Termux |++### Reference & Maintenance++| Guide | Description |+| :--- | :--- |+| [Testing Suite](testing.md) | Unit tests, integration tests, and verification gates |+| [Debugging Guide](debugging.md) | Troubleshooting common issues, terminal rendering, and player errors |+| [Release Checklist](release-checklist.md) | Pre-release validation, binary packaging, and deployment workflow |+| [Known Issues](known-issues.md) | Tracked limitations, terminal quirks, and workarounds |+| [Contributing Guide](contributing.md) | Contribution guidelines, code standards, and PR process |+| [Changelog](changelog.md) | Complete release history and unreleased changes |diff --git a/docs/SUMMARY.md b/docs/SUMMARY.mdnew file mode 100644index 0000000..bb590f9--- /dev/null+++ b/docs/SUMMARY.md@@ -0,0 +1,34 @@+# Summary++[Introduction](README.md)++# Getting Started++- [Installation](installation.md)+- [Keyboard & Controls](controls.md)+- [Configuration Guide](config.md)++# Features & Modes++- [Content Providers](providers.md)+- [Hardware Players](players.md)+- [Batch Downloads](downloads.md)+- [Stremio Addons](addons-mode.md)+- [Live TV & IPTV](tv-mode.md)++# Architecture & Internals++- [System Architecture](architecture.md)+- [Module Breakdown](modules.md)+- [Caching Strategy](cache.md)+- [Logging System](logging.md)+- [Cross-Platform Operations](cross-platform.md)++# Reference & Maintenance++- [Testing Suite](testing.md)+- [Debugging Guide](debugging.md)+- [Release Checklist](release-checklist.md)+- [Known Issues](known-issues.md)+- [Contributing Guide](contributing.md)+- [Changelog](changelog.md)diff --git a/docs/installation.md b/docs/installation.mdnew file mode 100644index 0000000..786451b--- /dev/null+++ b/docs/installation.md@@ -0,0 +1,78 @@+# Installation++MovieBox-TUI is available across macOS, Linux, Windows, and Android (Termux).++---++## macOS & Linux++Install via the automated script:++```bash+curl -fsSL https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/install.sh | bash+```++### macOS via Homebrew++```bash+brew tap mesamirh/moviebox-tui https://github.com/mesamirh/MovieBox-Tui+brew trust mesamirh/moviebox-tui+brew install moviebox-tui+```++---++## Windows++Install via PowerShell (run in Windows Terminal or PowerShell 5.1+):++```powershell+irm https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/install.ps1 | iex+```++---++## Android (Termux)++Install Termux tools, run the installer script, and grant storage permissions:++```bash+pkg update && pkg install termux-tools+curl -fsSL https://raw.githubusercontent.com/mesamirh/MovieBox-Tui/main/install.sh | bash+termux-setup-storage+```++---++## Cargo (Crates.io)++Install directly using Cargo:++```bash+cargo install moviebox-tui --locked+```++---++## Compile from Source++Clone the repository and build the release binary:++```bash+git clone https://github.com/mesamirh/MovieBox-Tui.git+cd MovieBox-Tui+cargo build --release --locked+```++The compiled binary will be located at `target/release/moviebox-tui`.++---++## Verify Release Integrity++All release assets include cryptographically signed SHA-256 checksums and GitHub provenance attestations:++```bash+sha256sum -c SHA256SUMS --ignore-missing+gh attestation verify <archive-file> -R mesamirh/MovieBox-Tui+```