Skip to content

Latest commit

 

History

2,284 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

DITA Toolkit

Formerly known as R2D2BC. The GitHub repository (d-i-t-a/R2D2BC), the npm package (@d-i-t-a/reader), and the D2Reader class name are unchanged.

Introduction

DITA Toolkit is an implementation of the Readium v2 EPUB, PDF, and Audiobook reader for the web. It is built as a modular toolkit (rather than a full-featured app) so that applications can use it to handle publication-related functions while customizing their own design, user interface, and extensions.

Goals

  • Follow the Readium architecture specification for best interoperability
  • Allow maximum configurability via API methods, callbacks, code and style injection, and clear separation of functions
  • Modularity
  • Clarity of code and ease of maintenance
  • Speed
  • Accessibility
  • Free and open source

The project intentionally includes only a bare-bones demonstration user interface, and no sample content. Any implementer can add their own functionality and design without refactoring the whole project.

Features

  • EPUB Reflowable + Fixed Layout
  • PDF (via pdfjs-dist v5)
  • Audiobook (Readium Audiobook Profile)
  • RTL paginated + scroll (Arabic, Hebrew, RTL CJK)
  • CJK vertical (Japanese tategaki, vertical Chinese) and Mongolian vertical
  • ReadiumCSS v1 and v2 supported simultaneously
  • Direct EPUB / Blob / File opening (client-side parsing with font deobfuscation)
  • Reader Settings (font, size, spacing, colors, layout, margins)
  • Configurable Modules with Callbacks
  • Injectable Fonts, CSS, JavaScript
  • Text Selection with Injectable Context Menu
  • Bookmarks
  • Highlights (configurable colors)
  • Annotations
  • TTS — Text to Speech / Read Aloud
  • Media Overlays — Read Along (with click-to-advance)
  • Full-text Search
  • Content Protection
  • Definitions
  • Popup Footnotes
  • Page Breaks — Page Numbers in margin
  • Sample Read
  • Timeline
  • Consumption Tracking
  • Layers
  • Line Focus
  • History Navigation
  • Citations

Architecture

This project implements most components of the Readium Architecture:

  • Implements Locator
  • Implements UserSettings
  • Implements Webpub Manifest
  • Builds on @readium/shared for the model layer
  • Supports both ReadiumCSS v1.1.x and v2.0.x (v2 via @readium/css npm)
  • EpubNavigator for reflowable and fixed-layout publications
  • PDFNavigator (pdfjs-dist v5)
  • AudiobookNavigator for Readium Audiobook Profile publications

Origins

Here is the original proposal, initiated by Aferdita Muriqi to the Readium Weekly Eng Meeting - 05/22/2019

The project was originally named R2D2BC: R2 = Readium v2, D2 = DITA (AM Consulting LLC), B = Bokbasen, C = CAST. Development was supported by DITA, Bokbasen, and CAST.

Extensions and Implementations

DITA Toolkit (formerly R2D2BC) has been used in:

Get Started

npm install
npm run build && npm run examples

Then visit http://localhost:4444/. The landing page shows available publications and example viewers.

Framework Examples

Examples are included for React, Vue, Angular, Next.js, Remix, and Vanilla JS:

npm run example:react
npm run example:vue
npm run example:angular
npm run example:vanilla

See examples/README.md for full details.

Documentation

Contributing

Contributions are welcome. Please see CONTRIBUTING for detailed guidelines.

License

Apache-2.0. See LICENSE.

Supporters

About

No description or website provided.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

67 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages