This guide explains how to generate ebooks (EPUB, MOBI) from the "Le Club des Cinq et le Phare Abandonne" project.
-
Pandoc (required)
- Download: https://pandoc.org/installing.html
- Recommended version: 3.0 or higher
- Verify installation:
pandoc --version
-
PowerShell (included with Windows)
- Version 5.1 or higher
- Verify:
$PSVersionTable.PSVersion
-
powershell-yaml module (recommended)
Install-Module powershell-yaml -Scope CurrentUser
-
For MOBI/AZW3 (optional)
- Calibre: https://calibre-ebook.com/
- Provides
ebook-convertfor EPUB -> MOBI/AZW3 conversion
ebook/
├── config/
│ └── book.yaml <- Main configuration
├── assets/
│ ├── images/
│ │ ├── cover.jpg <- Cover image
│ │ └── headers/ <- Chapter header images
│ └── fonts/ <- Custom fonts (optional)
├── templates/
│ └── epub.css <- EPUB styles
├── build/ <- Generated files (gitignored)
└── build-ebook.ps1 <- Build script
cd "d:\code-workspace\Claude Book\ebook"
.\build-ebook.ps1.\build-ebook.ps1 -Verbose.\build-ebook.ps1 -Clean.\build-ebook.ps1 -DryRun| Property | Recommended Value |
|---|---|
| Dimensions | 1600 x 2400 pixels |
| Ratio | 2:3 (portrait) |
| Format | JPEG or PNG |
| Max size | 5 MB |
| Resolution | 300 DPI (for print) |
- Create or obtain a cover image
- Resize to recommended dimensions
- Save to
ebook/assets/images/cover.jpg - Verify that
book.yamlcontains:cover: enabled: true image: "assets/images/cover.jpg"
- GIMP (free): https://www.gimp.org/
- Canva (online): https://www.canva.com/
- Photoshop (paid)
- Text readable at thumbnail size (title visible at 100px wide)
- High contrast between text and background
- Avoid fine details that disappear at small sizes
- Test on different devices (Kindle, phone, tablet)
In book.yaml:
chapters:
header_images:
enabled: true
default: "" # Default image for all chapters
mapping:
chapitre-01: "assets/images/headers/chapitre-01.jpg"
chapitre-12: "assets/images/headers/climax.jpg"| Property | Recommended Value |
|---|---|
| Dimensions | 800 x 300 pixels |
| Ratio | Wide (landscape) |
| Format | JPEG |
| Size | < 500 KB per image |
ebook/assets/images/headers/
├── chapitre-01.jpg
├── chapitre-02.jpg
├── ...
└── chapitre-18.jpg
- Use evocative images matching chapter content
- Maintain visual consistency (same style, palette)
- Decorative images, not informative (accessibility)
- Test on e-ink readers (contrast is important)
The templates/epub.css file controls the book's appearance.
body {
font-family: "Palatino Linotype", Palatino, Georgia, serif;
}body {
line-height: 1.8; /* More space */
}h1 {
font-size: 2em;
font-style: italic;
border-bottom: 1px solid #333;
padding-bottom: 0.5em;
}hr::before {
content: "~ ~ ~"; /* Instead of * * * */
}- Generate the EPUB
- Open in Calibre (F7 to view HTML)
- Adjust the CSS
- Regenerate and retest
- Calibre installed
- EPUB generated first
- The script first generates the EPUB
- Then converts to MOBI via
ebook-convert
output:
formats:
mobi:
enabled: true- MOBI is an obsolete format (Amazon now recommends KF8/AZW3)
- Some CSS styles are not supported
- Large images may be compressed
In book.yaml, section metadata:
metadata:
title: "Le Club des Cinq et le Phare Abandonne"
subtitle: "Une aventure en Bretagne"
author: "Your Name"
language: "fr-FR"
publisher: "My Publishing House"
date: "2024"
rights: "All rights reserved"
isbn: "978-X-XXXX-XXXX-X"
description: |
A description of your book for catalogs
and e-readers.output:
filename: "my-book" # Will produce my-book.epubfront_matter:
include:
dedication: true
dedication_text: "To all adventure lovers"front_matter:
include:
epigraph: true
epigraph:
text: "Adventure is around the corner."
attribution: "Unknown Author"Solution: Install Pandoc and restart PowerShell
Link: https://pandoc.org/installing.html
Install-Module powershell-yaml -Scope CurrentUserThe script will still work with a default configuration.
Check:
1. The path in book.yaml (chapters.source_dir)
2. The file pattern (chapters.pattern)
3. That files exist in story/chapters/
Check:
1. The file exists in ebook/assets/images/
2. The path in book.yaml is correct
3. The extension is correct (.jpg vs .jpeg)
The EPUB will be generated without a cover if the image is missing.
1. Test in Calibre (more tolerant)
2. Check CSS for syntax errors
# Run as administrator:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Or run the script with:
powershell -ExecutionPolicy Bypass -File build-ebook.ps1- Proofread all chapters for typos
- Verify chapter title consistency
- Test on multiple devices/applications
- Exact title with correct spelling
- Correct author name
- Language defined (fr-FR)
- Description for catalogs
- High-quality cover
- All images optimized (size < 500 KB)
- Alt text for accessibility
- Pandoc Documentation: https://pandoc.org/MANUAL.html
- EPUB 3 Specification: https://www.w3.org/publishing/epub3/
- Kindle Publishing Guidelines: https://kdp.amazon.com/en_US/help/topic/G200645400
- Calibre: https://calibre-ebook.com/