iksnae / actual-intelligence

A practical, non-technical guide to using AI tools like ChatGPT in everyday life
MIT License
0 stars 0 forks source link

Refactor build scripts into modular components #44

Closed khaos-codi closed 3 months ago

khaos-codi commented 3 months ago

Refactor Build Scripts into Modular Components

This PR refactors the build scripts into smaller, more focused components to improve maintainability, debugging, and extensibility. Each script handles a specific aspect of the build process, making it easier to isolate and fix issues.

Script Organization

The scripts are organized to mirror the workflow phases:

  1. Setup Phase

    • setup.sh: Prepares the build environment
    • copy-images.sh: Copies images to build directory
  2. Build Phase

    • build.sh: Main entry point for the build process
    • build-language.sh: Builds a specific language version
    • combine-markdown.sh: Combines markdown files into a single document
  3. Format Generation

    • generate-pdf.sh: Creates PDF version
    • generate-epub.sh: Creates EPUB version
    • generate-mobi.sh: Creates MOBI (Kindle) version
    • generate-html.sh: Creates HTML version

New Features and Improvements

Migration Approach

The main build.sh in the root directory now simply forwards all arguments to the modular scripts, ensuring backward compatibility with existing workflows.

Testing

The scripts have been tested with both English and Spanish content, ensuring they produce the same output as the original monolithic script.