All Projects → ridi → Reader.js

ridi / Reader.js

Licence: MIT license
Javascript library for RIDI EPUB Viewer

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Reader.js

Reader
高仿多看阅读器apk,支持PDF解析.文档支持搜索,高亮文字,墨迹等功能
Stars: ✭ 98 (+366.67%)
Mutual labels:  epub
bitcoin-development-with-go
[Work in Progress] A little book on Bitcoin Development with Go (golang)
Stars: ✭ 19 (-9.52%)
Mutual labels:  epub
epub3guide
台灣 EPUB3 制作指引
Stars: ✭ 95 (+352.38%)
Mutual labels:  epub
scopy
Python script for searching through your digital books and cataloguing them in an easy-to-share list of files.
Stars: ✭ 28 (+33.33%)
Mutual labels:  epub
calibre-kindle-comics
A calibre plugin that converts your comics into a readable format for kindle.
Stars: ✭ 32 (+52.38%)
Mutual labels:  epub
bash-pubkit
Book template and EPUB compiler
Stars: ✭ 27 (+28.57%)
Mutual labels:  epub
R2D2BC
https://d-i-t-a.github.io/R2D2BC/
Stars: ✭ 27 (+28.57%)
Mutual labels:  epub
fimfic2epub
📚 Chrome/Firefox extension & npm package for improved EPUB export on fimfiction.net
Stars: ✭ 17 (-19.05%)
Mutual labels:  epub
Wuxiaworld-2-eBook
This Python script will download chapters from novels availaible on wuxiaworld.com saves then into the .epub format
Stars: ✭ 90 (+328.57%)
Mutual labels:  epub
kaf-cli
把txt文本转成epub和mobi电子书的命令行工具(原TmdTextEpub)
Stars: ✭ 133 (+533.33%)
Mutual labels:  epub
novelsave
This is a tool to download and convert novels from popular sites to e-books.
Stars: ✭ 25 (+19.05%)
Mutual labels:  epub
infinite-electron
An Electron-based cross-platform desktop reader for free ebooks
Stars: ✭ 39 (+85.71%)
Mutual labels:  epub
wattpad-downloader
A website to convert and download Wattpad stories into e-book reader formats.
Stars: ✭ 55 (+161.9%)
Mutual labels:  epub
dslibris
An ebook reader for the Nintendo DS, DS Lite, and DSi.
Stars: ✭ 31 (+47.62%)
Mutual labels:  epub
read-offline
Read Offline allows you to download or print posts and pages. You can download the post as PDF, ePub and mobi
Stars: ✭ 28 (+33.33%)
Mutual labels:  epub
nuber
terminal epub reader with inline images
Stars: ✭ 73 (+247.62%)
Mutual labels:  epub
SDKLauncher-Android
Launcher app for Readium SDK on Android
Stars: ✭ 77 (+266.67%)
Mutual labels:  epub
SDKLauncher-OSX
A small OS X application to serve as a launcher/testbed for the Readium SDK on the Mac.
Stars: ✭ 21 (+0%)
Mutual labels:  epub
epub-parser
A powerful yet easy-to-use epub parser
Stars: ✭ 103 (+390.48%)
Mutual labels:  epub
InMangaKindle
Descarga manga en español en diferentes formatos (PNG, PDF, EPUB, MOBI)
Stars: ✭ 43 (+104.76%)
Mutual labels:  epub

Reader.js

Javascript library for RIDI EPUB Viewer written in ECMAScript 6

npm version

Install

$ yarn install @ridi/reader.js

Structure

└─┬ root
  ├── LICENSE
  ├── package.json
  ├── README.md
  ├─┬ android
  | └─ index.js
  ├─┬ ios
  | └─ index.js
  └─┬ web
    └─ index.js

Compatibility

  • iOS 8-12
  • Android 4-13 (API Level 14-33)
  • Chrome 30~89
  • Safari 9~11
  • IE 11

Usage

import { Reader, Context, Util } from '@ridi/reader.js/[android|ios|web]';

Terms

  • offset: 화면 내 위치를 나타내는 zero-based 오프셋 값, 페이지 보기의 경우 pageOffset, 스크롤 보기의 경우 scrollY 값을 의미
  • rect: 화면 내 범위를 나타내는 DOMRect를 변형한 MutableClientRect(x, y, width, height, top, left, right, bottom 값을 가지고 있음)
  • range: Range 객체
  • node location: (스파인 내) 위치를 나타내는 자체 포맷 (예: 31#0)
  • serialized range: (스파인 내) 범위를 나타내는 포맷, Rangy 라이브러리에서 제공하는 serialization format 사용 (예: 0/171:0,0/171:30)
  • anchor: HTML anchor 링크의 id 애트리뷰트 값

APIs

선택 영역 관리

  • 렌더링에는 관여하지 않고 선택 영역에 대한 관리만 담당

  • sel.startSelectionMode(x, y)

    • mousedown, touch 이벤트 등 발생 시 위 함수를 호출해 선택 모드로 진입
  • sel.expandUpperSelection(x, y) 또는 sel.expandLowerSelection(x, y)

    • 선택 방향에 따라 호출
    • 여기에서 upper, lower는 선택 영역 양 끝에 나타나는 핸들을 의미
  • sel.getSelectedRange()

    • 선택 영역을 range 로 반환

독서노트 저장/이동

  • sel.getSelectedSerializedRange()
    • 선택 영역을 serialized range 포맷으로 반환
  • getOffsetFromSerializedRange(serializedRange)
    • serialized rangeoffset 으로 변환

목차 이동

  • getOffsetFromAnchor(anchor)
    • anchor 의 위치를 offset 으로 변환

검색

  • searchText(keyword)
    • 검색 결과를 serialized range 포맷으로 반환
  • textAroundSearchResult(pre, post)
    • 검색 결과의 전/후 일부 문장을 포함해 반환
  • getPageOfSearchResult()
    • 검색 결과의 pageOffset 값을 반환
  • getRectsOfSearchResult()
    • 검색 결과의 rect 객체를 배열로 반환

링크

  • content.getLinkFromElement(el)
    • 특정 엘리먼트가 <a> 태그(이거나 그 부모가 <a> 태그)일 경우 그 정보(node, href, type)를 반환
    • type으로 epub:type 애트리뷰트의 값 반환 (예: 팝업 주석 링크일 경우 type: 'noteref')

이미지

  • content.reviseImage(imgEl, screenWidth, screenHeight)
    • 이미지 크기를 조정해 이미지가 페이지를 벗어나는 일이 없도록 함
    • 사용 후 페이지 계산 필요
  • content.getSvgElementFromPoint(x, y)
    • mouseup, touch 이벤트 등 발생 시 해당 포인트에 <svg> 태그 존재 여부 확인
    • <svg> 태그가 존재하는 경우 태그의 전체 내용을 문자열로 반환
  • content.getImagePathFromPoint(x, y)
    • mouseup, touch 이벤트 등 발생 시 해당 포인트에 <img> 태그 존재 여부 확인
    • <img> 태그가 존재하는 경우 src 애트리뷰트 값 반환

TTS

  • /common/tts/ 디렉토리 참조
  • node location 기반으로 구현됨

Development

Install

You can install it with the following command:

$ git clone [email protected]:ridi/Reader.js.git
$ yarn install --frozen-lockfile

Build

You can build it with the following command in Reader.js folder:

$ yarn [build|watch]

grunt-cli is required to build Reader.js

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].