Upgrade dependencies, enhance web layout, and add CI for deployment#40
Upgrade dependencies, enhance web layout, and add CI for deployment#40
Conversation
There was a problem hiding this comment.
Pull request overview
This PR modernizes the Re:VIEW “web” output to support a new sidebar-based layout with client-side search and language toggling, and adds a GitHub Actions workflow to build and deploy the generated site to GitHub Pages. It also updates build tooling/dependencies to support the new pipeline.
Changes:
- Added a new web build pipeline (
build-web.sh) that builds JP/EN outputs and generates a client-side search index (build-search-index.js). - Introduced a new web layout template (
layout-web.html.erb) and expanded styling for modern navigation/search (style-web.css) plus base style updates (style.css). - Added CI workflow to build and deploy the web output to GitHub Pages and upgraded Node/Ruby dependencies accordingly.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Switches npm run web to the new shell build script and pins tool versions. |
| package-lock.json | Updates lockfile to v3 and refreshes dependency tree to match pinned versions/overrides. |
| build-web.sh | Automates JP+EN web builds, search index generation, and final webroot assembly. |
| build-search-index.js | Generates search-index.json from built HTML to enable in-browser search. |
| articles/style.css | Updates base typography and formatting (headings, callouts, footnotes, code, tables, links). |
| articles/style-web.css | Major stylesheet redesign for sidebar layout, search results UI, TOC highlighting, responsive behavior. |
| articles/lib/tasks/z01_pandoc2review.rake | Adjusts YAML loading to permit Date values in config. |
| articles/layouts/layout-web.html.erb | Adds new web layout with sidebar TOC, language toggle, search UI, and client-side JS behaviors. |
| Gruntfile.js | Updates YAML parsing API (js-yaml) to match the upgraded dependency. |
| Gemfile | Upgrades review gem and adds nkf. |
| .gitignore | Ignores generated articles/webroot/ output directory. |
| .github/workflows/deploy-web.yml | Adds automated build+deploy to GitHub Pages for the generated web output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 13 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f2ff6a912
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 13 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const titleMatch = html.match(/<title>([^|]*)/); | ||
| const pageTitle = titleMatch ? titleMatch[1].trim() : file; |
There was a problem hiding this comment.
The <title> extraction regex /<title>([^|]*)/ is overly permissive: if the expected | separator is missing (or appears later than expected), the capture can run past </title> into the rest of the HTML. Consider matching up to </title> (and optionally splitting on |) so titles are reliably extracted regardless of formatting.
| const titleMatch = html.match(/<title>([^|]*)/); | |
| const pageTitle = titleMatch ? titleMatch[1].trim() : file; | |
| const titleMatch = html.match(/<title\b[^>]*>([\s\S]*?)<\/title>/i); | |
| const pageTitle = titleMatch ? titleMatch[1].split("|")[0].trim() : file; |
| "text": "grunt text", | ||
| "epub": "grunt epub", | ||
| "web": "grunt web", | ||
| "web": "bash build-web.sh", |
There was a problem hiding this comment.
npm run web now shells out to bash build-web.sh, which makes the web build non-portable on environments without Bash/coreutils (notably default Windows setups). If Windows support is desired, consider keeping a Node-based entry point (or documenting the requirement / providing a cross-platform alternative).
| "web": "bash build-web.sh", | |
| "web": "node -e \"const cp=require('child_process'); if (process.platform === 'win32') { console.error('The web build requires Bash to run build-web.sh. Please run this script from Git Bash, WSL, or another Unix-like shell environment.'); process.exit(1); } const result = cp.spawnSync('bash', ['build-web.sh'], { stdio: 'inherit' }); process.exit(result.status == null ? 1 : result.status);\"", |
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' |
There was a problem hiding this comment.
nodeのバージョンが低いのが気になり(もうすぐEOL)
| source "https://rubygems.org" | ||
|
|
||
| gem 'review', '5.3.0' | ||
| gem 'review', '5.11.0' |
There was a problem hiding this comment.
このバージョンアップでPDF側は問題ない感じでしたっけ?
There was a problem hiding this comment.
(そもそもpdf側がdocker経由で5.1固定?な気がしてて
- grunt 1.1.0 -> 1.6.1 (fixes critical: arbitrary code execution, path traversal) - grunt-cli 1.2.0 -> 1.5.0 (fixes moderate CVE) - grunt-contrib-clean 2.0.0 -> 2.0.1 - js-yaml 3.13.1 -> 4.1.1 (fixes prototype pollution, safeLoad -> load) - Pin all versions for stability (remove ^ ranges) - Add overrides for transitive deps: minimatch, brace-expansion, ansi-regex - Reduces vulnerabilities from 22 to 4 (remaining are unfixable lodash in grunt) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Re:VIEW 5.3.0 -> 5.11.0 for Ruby 4.0 compatibility - Add nkf gem (removed from Ruby stdlib in 3.4) - Add permitted_classes: [Date] to YAML.load_file for Psych security Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ation - Restyle web output with clean typography, sidebar, and responsive layout - Add book cover image and title to sidebar header - Add collapsible sub-section navigation (h2 headings) per chapter - Add client-side full-text search with pre-built JSON index - Scroll-based active section highlighting in sidebar - Custom layout-web.html.erb to override Re:VIEW default template Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Builds Re:VIEW web output and search index on push to main, then deploys to GitHub Pages via actions/deploy-pages. Requires Pages source set to 'GitHub Actions' in repo settings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Build output from review-webmaker should not be tracked in git. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add language toggle (日本語 / English) in sidebar - Build both JP and EN web outputs into webroot/ja/ and webroot/en/ - Root index.html redirects to Japanese version - Search index generated per language - Add build-web.sh to orchestrate multi-language build - Update npm web script and GitHub Actions workflow accordingly Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Change TOP and cover image links from index.html to ./ to avoid clean URL servers redirecting to the wrong directory level. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove nkf gem (only needed for Ruby 4.0, in stdlib for 3.3) - Add require 'date' for permitted_classes in YAML loading - Keep Re:VIEW 5.11.0 (needed for Ruby 3.1+ Psych compatibility) - Add .ruby-version for rbenv (3.3.10) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Escape @title in <title> tag to prevent XSS - Fix copyright using consistent @book.config source - Normalize currentPage for trailing slashes and directory URLs - Re-run search query after index finishes loading - Remove redundant bundle install step in CI (bundler-cache handles it) - Fix search index offset mismatch (slice from full html, not body) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Sort htmlFiles for deterministic search index output - Bound final section to book content, excluding script/footer - Add aria-label to search input for accessibility - Skip h2 headings without id in sub-section TOC generation - Use ruby-version-file in CI to match .ruby-version - Use npm ci for reproducible CI builds - Use YAML.safe_load_file instead of YAML.load_file - Update engines.node to >=16.0.0 (required by grunt 1.6.1) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Node 20 reaches EOL April 2026. Node 22 is the current active LTS. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d8ca99f to
5da2b86
Compare
0649154 to
20a6e25
Compare
closes #4
closes #38
This pull request introduces a comprehensive overhaul of the web output system, focusing on modernizing the web layout, improving usability (with features such as search and language toggling), and automating deployment to GitHub Pages. The changes span new build scripts, workflow automation, major HTML/CSS/JS enhancements, and dependency updates.
Web Output Modernization and Feature Enhancements:
layout-web.html.erbwith sidebar navigation, language toggle, integrated search box, dynamic TOC highlighting, and improved navigation between sections. JavaScript is added for TOC highlighting, search functionality, and language switching.style-web.cssfor a cleaner, more modern look, including responsive design, sidebar, search, language toggle, improved TOC, and better code/table/footnote formatting. [1] [2] [3] [4] [5]style.cssfor improved typography, headings, callouts, footnotes, and code/table appearance to match the new web layout. [1] [2] [3] [4]Search Functionality:
build-search-index.jsto generate asearch-index.jsonfrom built HTML files, enabling fast client-side full-text search in the web output.Build and Deployment Automation:
build-web.shto automate building both Japanese and English web outputs, generate search indices, and organize output directories for deployment.deploy-web.yml) to automate building and deploying the web output to GitHub Pages on every push tomainor manual trigger.Dependency and Build Process Updates:
reviewgem to version 5.11.0 for improved compatibility and features.yaml.safeLoadwithyaml.loadinGruntfile.jsfor config parsing.pandoc2reviewrake task to allowDateobjects for config compatibility.These changes collectively deliver a modern, user-friendly, and maintainable web output system with automated deployment and enhanced reader features.