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
|
// Need to split out rendering and book completely
|
||||||
// Something like
|
// Something like
|
||||||
var epub = ePub("moby-dick.epub");
|
var epub = ePub("moby-dick.epub");
|
||||||
var epub = ePub("s3path/ip/moby-dick.opf");
|
var epub = ePub("http://s3path/ip/moby-dick.opf");
|
||||||
|
// or
|
||||||
var rendition = ePub.Paginate(epub);
|
var epub = new EPUBJS.Book("http://s3path/ip/moby-dick.opf");
|
||||||
|
|
||||||
var rendition = ePub.Render.Paginated(book);
|
|
||||||
var rendition = ePub.Render.Scrolling(book);
|
|
||||||
|
|
||||||
ePub.renderer.register(EPUBJS.Paginate);
|
|
||||||
|
|
||||||
// Returns a Scroll Controller, Attachs to a document (or window?)
|
// Returns a Scroll Controller, Attachs to a document (or window?)
|
||||||
var epub = ePub("moby-dick.epub");
|
var epub = ePub("moby-dick.epub");
|
||||||
|
@ -69,9 +64,20 @@ book.navigation.get("chap1.html")
|
||||||
//-- When does the chapter content processing happen?
|
//-- When does the chapter content processing happen?
|
||||||
section.render()
|
section.render()
|
||||||
|
|
||||||
// Returns a new renderer
|
// Create a new renderer
|
||||||
var rendition = epub.renderer(book, type);
|
var rendition = ePub.Render(book, EPUBJS.Paginated, {options: true});
|
||||||
return new Renderer(book, type)
|
// 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
|
// Render to a div
|
||||||
rendition.attachTo("elementID");
|
rendition.attachTo("elementID");
|
||||||
|
|
|
@ -79,9 +79,8 @@
|
||||||
var currentSection;
|
var currentSection;
|
||||||
var currentSectionIndex = 7;
|
var currentSectionIndex = 7;
|
||||||
|
|
||||||
var book = ePub("https://s3.amazonaws.com/moby-dick/OPS/package.opf");
|
var book = ePub("../books/moby-dick/OPS/package.opf");
|
||||||
book.loaded.navigation.then(function(nav){
|
book.loaded.navigation.then(function(toc){
|
||||||
var toc = nav.get();
|
|
||||||
var $select = document.getElementById("toc"),
|
var $select = document.getElementById("toc"),
|
||||||
docfrag = document.createDocumentFragment();
|
docfrag = document.createDocumentFragment();
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ EPUBJS.Book.prototype.unpack = function(packageXml){
|
||||||
book.navigation = new EPUBJS.Navigation(book.package, this.request);
|
book.navigation = new EPUBJS.Navigation(book.package, this.request);
|
||||||
book.navigation.load().then(function(toc){
|
book.navigation.load().then(function(toc){
|
||||||
book.toc = toc;
|
book.toc = toc;
|
||||||
book.loading.navigation.resolve(book.navigation);
|
book.loading.navigation.resolve(book.toc);
|
||||||
});
|
});
|
||||||
|
|
||||||
// //-- Set Global Layout setting based on metadata
|
// //-- Set Global Layout setting based on metadata
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue