Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 03-16-2020, 07:05 PM   #1
pittendrigh
Connoisseur
pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.
 
Posts: 78
Karma: 1332336
Join Date: Mar 2011
Location: montana
Device: none
Comments? server-side book-like html?

A year or so ago I posted something about some experimental software that displays epub3 on an Apache web server. If you unzipped the epub in the DOCUMENT_ROOT
and edited one line of a config file the epub displayed on the server in book-like fashion.

I gave up on that project for various reasons. I got it to work with epub3 produced by Sigil and Jutoh but free sample epubs from github often broke. I also didn't like being dependent on a desktop editor like Sigil or Jutoh for making changes, always followed by scp copying.

So now, basically since the old people stay home virus scare from a week ago, I've rewritten last year's epub3 stuff as server-side php that displays simple web pages--enhanced by page sequencing with Next Page and Previous Page buttons, plus a slideshow and a gallery mode. It isn't in any way epub. It's web pages that act like a book./index.php?robopage=Flies/Library/Sandy-Pittendrigh/Dryflies/

Lots of stuff still missing, like javascript display:none button to collapse the TOC and then back again, and a cookie set mechanism so the codes remember the last page you visited, so if you come back next week you'll automatically jump back to where you were last time. Perhaps in a few more days.

This is a book about Montana Trout Flies, which probably isn't interesting to anyone here. But it is a good demo I think.


https://montana-riverboats.com/index...drigh/Dryflies

....the codes are on github.com but not pushed out to the master yet. It will be a few more days before I do that.

Last edited by pittendrigh; 03-16-2020 at 07:27 PM.
pittendrigh is offline   Reply With Quote
Old 03-16-2020, 09:29 PM   #2
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
It's a great idea.

For the various sites that offer books in epub, kindle, and web/html I get the impression that they made the web html first and I've always wondered if it wouldn't be easier or make more sense to start with epub. On the one hand it shouldn't make any difference which format is used for the starting point but when they start with web html they often add stuff that's nice for the web but a hindrance in an epub that'll be read on an e-ink device; background colors and whatnot, and that stuff ends up in the epub.
hobnail is offline   Reply With Quote
Old 03-16-2020, 09:41 PM   #3
pittendrigh
Connoisseur
pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.
 
Posts: 78
Karma: 1332336
Join Date: Mar 2011
Location: montana
Device: none
git clone https://github.com/pittendrigh/robopages


RE> "great idea" ........thank you. I've been selling passwords that grant access to online blueprints and boat building instructions since 2005. These codes are the current state of that 15 year evolution. Web pages that attempt to teach something complex NEED to look and act like a book. An online book needs some global navigation that never goes away, that appears on all pages no matter what (chapters, for instance, but perhaps other things too like links to a "contact me" form.

But a online book also needs locally dynamic navigation, that changes slightly for each new page. Or at least for each new chapter the user enters. These codes have all of that. They just need polishing.

I've been running my "display epub3" for boat building instructions (that I sell for $25) for a bit over a year now. I edit an epub3 on my desktop. scp it up. Unzip it and it displays. But I'm old and stubborn and I realize now I need to be able to edit directly, on the server. Perhaps in a test subdomain but I need it that way.

So I ditched the epub3 display and made the above. I've got some of it running on my website now. On a free page. It's too buggy to marry to what I sell just yet. But I like it.

I like the plain Jane HTML. The TOC has top-level "chapters" that always appear. Below that additional navigation appears dynamically depending upon which chapter you are currently viewing. There are slide shows and photo galleries if you want them. The slide shows depend on running perl and/or python scripts. There is an Admin GUI that maintains everything but this new code. Adding these new HTML book-like codes to the Admin GUI will happen eventually. I never use that Admin GUI but I do have one customer (who has a site running my software). So I made it for him.

There is also page sequencing. That depends on a text file initially generated by a python script. I can make manual changes to the page sequencing file with vi. If I then run tocit.py again I don't lose my manual changes. tocit.py is smart enough to maintain the previous sequencing, while doing its best to insert an new chapter sub-folders and/or pages in the right place in the (p2n) file. PageUrl to PageNumber hash file. The codes maintain a page to number hash, a page number to page url hash and a numerical array of Urls, which the codes use to keep the sequence order.

This is fun code for me but a long way from prime time. I just thought I'd ask for some feedback. I'll work on it (on and off) for the next few months. And then perhaps announce an alpha release.

Last edited by pittendrigh; 03-16-2020 at 09:51 PM.
pittendrigh is offline   Reply With Quote
Old 03-16-2020, 10:00 PM   #4
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
vi? perl? You're showing your age dude!
hobnail is offline   Reply With Quote
Old 03-16-2020, 10:03 PM   #5
pittendrigh
Connoisseur
pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.
 
Posts: 78
Karma: 1332336
Join Date: Mar 2011
Location: montana
Device: none
One final note. Eventually I'll write a (probably python) utility that recurses the book-like HTML pages and spits out an epub, suitable for downloading to a phone. At that point it would amount to an epub editor. You could spend a year or two gradually enhancing web pages (perhaps hidden behind a password barrier). Once happy with the result you would run the epub generator.

Epub3 is just a collection of *.xhtml pages with one or two XML config files. It is eminently scriptable.
pittendrigh is offline   Reply With Quote
Old 03-20-2020, 08:31 AM   #6
pittendrigh
Connoisseur
pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.
 
Posts: 78
Karma: 1332336
Join Date: Mar 2011
Location: montana
Device: none
Quote:
Originally Posted by hobnail View Post
vi? perl? You're showing your age dude!
Indeed. I'm sevnny one. I do all utilities in python now. Plan to put mod_python on my (virtual) dedicated server. So I can ditch php. For future stuff anyway.
pittendrigh is offline   Reply With Quote
Old 03-20-2020, 03:28 PM   #7
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by pittendrigh View Post
One final note. Eventually I'll write a (probably python) utility that recurses the book-like HTML pages and spits out an epub, suitable for downloading to a phone.
You might want to have a look at BeautifulSoup. It's an extremely easy to use universal Python html/xml parser library.
Sigil also comes with an epub helper library that can be used independently of Sigil (epub_utils.py). (It requires unipath.py and compatibility_utils.py).

Of course, the Calibre API also contains countless functions that you could re-use.
Doitsu is offline   Reply With Quote
Old 05-31-2020, 06:54 PM   #8
pittendrigh
Connoisseur
pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.pittendrigh ought to be getting tired of karma fortunes by now.
 
Posts: 78
Karma: 1332336
Join Date: Mar 2011
Location: montana
Device: none
This is an old thread. But I do have an update.

I started off displaying uncompressed epub3 on a website with PHP. I got it to work for output for Calibre (and Jutoh for that matter). But my codes didn't work for all epub3.

Epub3 Best Practices uncompressed didn't work because its XML made relative paths between *.xhtml pages and images differently than calibre. I didn't like being tied to a GUI to make new content too. Sometimes I like to ssh into a site and then just use a text editor.

So I made a plugin (to my system) that shows HTML pages as book pages.
Top level directories are chapters. Next Page and Prev Page buttons set a "last page read" cookie you you can come back a week later and jump to your last read page.

A collapsable table of contents provides random access to all parts of the book without resetting the "last read page" cookie. So you can jump around and look at diagrams, and then return to your last read page. Right now or days later.

An searchable index is still missing. But it's in the works. I'll use Apache Lucene. I've worked with Lucene on a Java Servlet Engine. So I kinda sorta know how it works.

This code is not ready for distribution yet. Maybe soon. I'm working on it. It will be on Github.

https://montana-riverboats.com/?robopage=Birds
pittendrigh is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Comments in Content Server Rellwood Server 0 01-19-2019 02:20 AM
Posible but at html comments Terisa de morgan Library Management 8 07-05-2016 07:22 AM
How to view comments on the bottom right hand side under the cover ? KWhytte Library Management 2 12-13-2012 10:13 AM
A program for converting HTML pages into EPUB on a server side Chang ePub 6 09-29-2012 10:59 AM
902 Comic book / PB902 side by side comparison Lester Burnham PocketBook 26 10-07-2011 03:35 AM


All times are GMT -4. The time now is 03:59 PM.


MobileRead.com is a privately owned, operated and funded community.