How sakamachi-hideyuki/meteors works
Project type and purpose
• This is a static-site build repository for the Japanese mythology book “流星と昴の日本神話” by 坂町英之.
• Purpose: manage source HTML and image assets, run build scripts (Node.js + batch/PowerShell), generate the final site under docs/, and publish via GitHub Pages.
File structure
• Top-level:
• package.json / package-lock.json: Node.js dependencies and build entry points
• html/: site-generation scripts and modules
• images/: image-processing scripts and raw/processed image directories
• docs/: generated site output (chapters, TOC, assets, CSS)
• README.md: project description and hosting URL
• html/modules/: individual transform functions (render-header, link-pages, validate-links, etc.)
• images/*: per-figure and per-photo processing scripts (batch, MJS, PowerShell) plus raw assets
• docs/: final HTML pages grouped by chapter, site index, style.css, sitemap, etc.
Additional insights from README
• The repo automates image editing and HTML conversion for Web publishing (20th edition onward).
• Deployed to GitHub Pages at sakamachi-hideyuki.github.io/meteors/.
a. Main components
• Source Content
– Raw HTML templates (html/流星と昴の日本神話.htm)
– Raw image assets (images/*/src/*.zip, charts, PDFs)
• Build Engines
– Node.js scripts (html/build-html.mjs, html/modules/*.js)
– Batch/PowerShell wrappers (build-html.bat, word2html.ps1, images/*.bat, .mjs)
• Processors
– HTML transformer modules (render-*.js, split-pages.js, validate-*.js)
– Image pipelines (build-images-web, build-images-ebook, cover, fig-*, photo-*)
• Output
– Generated static site in docs/ (chapter pages, TOC, assets folder)
– Built image outputs in images/build/{web,ebook,png}
• Hosting
– GitHub Pages serves docs/ on each push
b. Relationships and interactions
• Source Content fed into Build Engines
• Build Engines orchestrate Processors
• Processors write to Output directories
• Output/docs deployed automatically by GitHub Pages
• Local CLI (npm scripts) invokes batch/MJS scripts in sequence
c. Architectural patterns & design principles
• Pipeline pattern: discrete transform modules chained to produce final HTML
• Convention-over-configuration: folder naming dictates processing (e.g., images/fig-*/)
• Modular design: each transform in html/modules is single-responsibility
• Separation of concerns: HTML build logic vs. image build logic vs. hosting config
d. Key technologies and libraries
• Node.js (package.json)
• Vanilla JavaScript modules for HTML processing
• Batch (.bat) and PowerShell (.ps1) scripts for cross-platform wrappers
• GitHub Pages for hosting
• Static file conventions (CSS, sitemap.xml)
Detail
• Processes (e.g., “split-pages.js breaks master HTML into chapter files”).
• Validation steps (validate-links, validate-summaries) to show quality gates.