Duncan Tourolle f72c6015c6
All checks were successful
Python CI / test (push) Successful in 47s
more reorg
2025-11-07 19:14:37 +01:00
..
2025-11-05 22:38:28 +01:00

PyWebLayout Examples

This directory contains example scripts demonstrating the pyWebLayout library.

EbookReader Examples

The EbookReader provides a high-level, user-friendly API for building ebook reader applications.

Quick Start Example

simple_ereader_example.py - Simple example showing basic EbookReader usage:

python simple_ereader_example.py path/to/book.epub

This demonstrates:

  • Loading an EPUB file
  • Rendering pages to images
  • Basic navigation (next/previous page)
  • Saving positions
  • Chapter navigation
  • Font size adjustment

Comprehensive Demo

ereader_demo.py - Full feature demonstration:

python ereader_demo.py path/to/book.epub

This showcases all EbookReader features:

  • Page navigation (forward/backward)
  • Position save/load with bookmarks
  • Chapter navigation (by index or title)
  • Font size control
  • Line and block spacing adjustments
  • Reading progress tracking
  • Book information retrieval

Tip: You can use the test EPUB files in tests/data/ for testing:

python simple_ereader_example.py tests/data/test.epub
python ereader_demo.py tests/data/test.epub

Other Examples

HTML Rendering

These examples demonstrate rendering HTML content to multi-page layouts:

html_line_breaking_demo.py - Basic HTML line breaking demonstration html_multipage_simple.py - Simple single-page HTML rendering html_multipage_demo.py - Multi-page HTML layout html_multipage_demo_final.py - Complete multi-page HTML rendering with headers/footers

For detailed information about HTML rendering, see README_HTML_MULTIPAGE.md.

Documentation

  • README_EREADER.md - Detailed EbookReader API documentation
  • README_HTML_MULTIPAGE.md - HTML multi-page rendering guide
  • pyWebLayout/layout/README_EREADER_API.md - EbookReader API reference (in source)

Debug/Development Scripts

Low-level debug and rendering scripts have been moved to the scripts/ directory.