Skip to content

Upgrade dependencies, enhance web layout, and add CI for deployment#40

Merged
piti6 merged 16 commits intomainfrom
feature/kim/web-support
Apr 16, 2026
Merged

Upgrade dependencies, enhance web layout, and add CI for deployment#40
piti6 merged 16 commits intomainfrom
feature/kim/web-support

Conversation

@piti6
Copy link
Copy Markdown
Collaborator

@piti6 piti6 commented Apr 15, 2026

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:

  • Introduced a new, modern web layout in layout-web.html.erb with 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.
  • Completely redesigned and expanded the web stylesheet in style-web.css for 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]
  • Updated base styles in style.css for improved typography, headings, callouts, footnotes, and code/table appearance to match the new web layout. [1] [2] [3] [4]

Search Functionality:

  • Added a new script build-search-index.js to generate a search-index.json from built HTML files, enabling fast client-side full-text search in the web output.
  • Integrated the search box and result rendering into the new web layout, with real-time filtering and highlighted snippets. [1] [2]

Build and Deployment Automation:

  • Added build-web.sh to automate building both Japanese and English web outputs, generate search indices, and organize output directories for deployment.
  • Introduced a GitHub Actions workflow (deploy-web.yml) to automate building and deploying the web output to GitHub Pages on every push to main or manual trigger.

Dependency and Build Process Updates:

  • Updated the review gem to version 5.11.0 for improved compatibility and features.
  • Replaced deprecated yaml.safeLoad with yaml.load in Gruntfile.js for config parsing.
  • Updated YAML loading in the pandoc2review rake task to allow Date objects for config compatibility.

These changes collectively deliver a modern, user-friendly, and maintainable web output system with automated deployment and enhanced reader features.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread articles/layouts/layout-web.html.erb Outdated
Comment thread articles/layouts/layout-web.html.erb Outdated
Comment thread articles/layouts/layout-web.html.erb
Comment thread articles/layouts/layout-web.html.erb Outdated
Comment thread .github/workflows/deploy-web.yml Outdated
Comment thread build-search-index.js Outdated
Comment thread articles/layouts/layout-web.html.erb Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread articles/layouts/layout-web.html.erb
Comment thread articles/layouts/layout-web.html.erb
Comment thread Gemfile
@piti6 piti6 requested a review from Copilot April 15, 2026 09:59
@piti6 piti6 marked this pull request as ready for review April 15, 2026 09:59
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread build-search-index.js Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread build-search-index.js Outdated
Comment thread articles/layouts/layout-web.html.erb Outdated
Comment thread articles/layouts/layout-web.html.erb
Comment thread .github/workflows/deploy-web.yml
Comment thread .github/workflows/deploy-web.yml Outdated
Comment thread articles/lib/tasks/z01_pandoc2review.rake
Comment thread package.json
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread build-search-index.js
Comment on lines +20 to +21
const titleMatch = html.match(/<title>([^|]*)/);
const pageTitle = titleMatch ? titleMatch[1].trim() : file;
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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;

Copilot uses AI. Check for mistakes.
Comment thread package.json
"text": "grunt text",
"epub": "grunt epub",
"web": "grunt web",
"web": "bash build-web.sh",
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
"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);\"",

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@qua-iy qua-iy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

スタイルとかは信じます

Comment thread .github/workflows/deploy-web.yml Outdated
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nodeのバージョンが低いのが気になり(もうすぐEOL)

Comment thread Gemfile
source "https://rubygems.org"

gem 'review', '5.3.0'
gem 'review', '5.11.0'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このバージョンアップでPDF側は問題ない感じでしたっけ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一応チェックしましたが大丈夫そうでした

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(そもそもpdf側がdocker経由で5.1固定?な気がしてて

@piti6 piti6 requested a review from qua-iy April 15, 2026 12:10
piti6 and others added 13 commits April 16, 2026 10:23
- 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>
@piti6 piti6 force-pushed the feature/kim/web-support branch from d8ca99f to 5da2b86 Compare April 16, 2026 01:23
@piti6 piti6 force-pushed the feature/kim/web-support branch from 0649154 to 20a6e25 Compare April 16, 2026 05:30
@piti6 piti6 merged commit 9b76326 into main Apr 16, 2026
1 check passed
@piti6 piti6 deleted the feature/kim/web-support branch April 16, 2026 05:36
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.

Proposal for Web Support ReViewバージョンを5.3に統一したい

3 participants