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:
parent
fe8edc77c1
commit
849625fc83
3 changed files with 20 additions and 15 deletions
28
API.js
28
API.js
|
@ -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");
|
||||
|
|
|
@ -79,9 +79,8 @@
|
|||
var currentSection;
|
||||
var currentSectionIndex = 7;
|
||||
|
||||
var book = ePub("https://s3.amazonaws.com/moby-dick/OPS/package.opf");
|
||||
book.loaded.navigation.then(function(nav){
|
||||
var toc = nav.get();
|
||||
var book = ePub("../books/moby-dick/OPS/package.opf");
|
||||
book.loaded.navigation.then(function(toc){
|
||||
var $select = document.getElementById("toc"),
|
||||
docfrag = document.createDocumentFragment();
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ EPUBJS.Book.prototype.unpack = function(packageXml){
|
|||
book.navigation = new EPUBJS.Navigation(book.package, this.request);
|
||||
book.navigation.load().then(function(toc){
|
||||
book.toc = toc;
|
||||
book.loading.navigation.resolve(book.navigation);
|
||||
book.loading.navigation.resolve(book.toc);
|
||||
});
|
||||
|
||||
// //-- Set Global Layout setting based on metadata
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue