1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-03 14:59:18 +02:00

API doc updates

This commit is contained in:
Fred Chasen 2014-07-24 11:33:27 -04:00
parent fe8edc77c1
commit 849625fc83
3 changed files with 20 additions and 15 deletions

28
API.js
View file

@ -10,14 +10,9 @@
// Need to split out rendering and book completely
// Something like
var epub = ePub("moby-dick.epub");
var epub = ePub("s3path/ip/moby-dick.opf");
var rendition = ePub.Paginate(epub);
var rendition = ePub.Render.Paginated(book);
var rendition = ePub.Render.Scrolling(book);
ePub.renderer.register(EPUBJS.Paginate);
var epub = ePub("http://s3path/ip/moby-dick.opf");
// or
var epub = new EPUBJS.Book("http://s3path/ip/moby-dick.opf");
// Returns a Scroll Controller, Attachs to a document (or window?)
var epub = ePub("moby-dick.epub");
@ -69,9 +64,20 @@ book.navigation.get("chap1.html")
//-- When does the chapter content processing happen?
section.render()
// Returns a new renderer
var rendition = epub.renderer(book, type);
return new Renderer(book, type)
// Create a new renderer
var rendition = ePub.Render(book, EPUBJS.Paginated, {options: true});
// is the same as
var rendition = new EPUBJS.Paginated(book, {options: true});
var rendition = ePub.Render(book); // Defaults
var rendition = ePub.Render(book, EPUBJS.Render.Paginated, options);
var rendition = ePub.Render.Paginated(book);
var rendition = ePub.Render.Scrolling(book);
rendition.render(book) // if not passed
ePub.renderer.register("Paginated", EPUBJS.Render.Paginated);
// Render to a div
rendition.attachTo("elementID");