This is a CLI application that downloads Basecamp's excellent free Shape Up book and converts it into either:
- A single, self-contained HTML file
- An EPUB file suitable for e-readers
Features:
- Downloads and combines all chapters into a single file
- Preserves all images (base64-encoded in HTML version)
- Maintains internal navigation links between chapters
- Clean, minimal CSS styling optimized for readability
- Proper EPUB structure with table of contents and chapter hierarchy
- Validates EPUB output using epubcheck
The book is currently available in an HTML format (separate chapters) and a PDF document (single file). While the PDF version is convenient, it's not ideal for e-readers like Kindle due to:
- Poor PDF rendering on e-ink displays
- Inconsistent conversion results from PDF to epub/mobi
- Issues with ligatures (combined characters like "tf") in the PDF that break most conversion tools
This tool solves these issues by working directly with the HTML source, ensuring proper formatting and structure.
- Install Ruby (3.2.4)
- Install Bundler
- Install Java Development Kit (JDK) - required for epubcheck
brew install openjdk # On macOS - Install epubcheck for EPUB validation
brew install epubcheck # On macOS - Run
bundle install
The simplest way to generate the EPUB is to use the publish script:
bin/publishThis will:
- Download the book content
- Convert it to EPUB format
- Validate the EPUB
- Open the generated file (on macOS only)
The script will create:
dist/shape-up.html- A single HTML file with embedded imagesdist/shape_up.epub- A properly formatted EPUB file
If you need more control over the process, you can run the steps manually:
-
Download the HTML version:
bundle exec bin/shape_up_downloader download_single_html -
Convert to EPUB:
bundle exec bin/shape_up_downloader convert_to_epub -
Validate the EPUB:
bundle exec bin/shape_up_downloader validate_epub
Note: All files must be in the dist directory. The paths are relative to that directory.
This tool is provided for personal use to facilitate reading the freely available Shape Up book. Please respect Basecamp's copyright and do not distribute the generated files. Instead, share this tool so others can generate their own copies from the source material.
To run the test suite:
bundle exec rspecTo validate generated EPUB files:
bundle exec bin/shape_up_downloader validate_epubNote: EPUB validation requires epubcheck to be installed:
brew install epubcheck # On macOS