export to ebook format (epub)

442 views
Skip to first unread message

Paul Netsaver

unread,
May 24, 2018, 6:14:39 PM5/24/18
to TiddlyWiki
Hi 
how much would be difficult to export a selection of tiddlers in the epub open format?
Basically it is a collection of html files with a structure defined, some folder for resources and the whole packed in a zip file.
- tiddlers are already exported as html
- is not possible to save multiple files, ... but the epub file is just 1 file
- the structure could be defined in a TOC tiddler, referencing all the tiddler composing the ebook and how they are interconnected (it could be perhaps a JSON tiddler acting as a sitemap)
- other resources (e.g. image files) could be internal tiddlers
This would facilitate the diffusion of TW because one could read own TW content (and other user's) on the ebook reader or the smartphone.
Maybe the difficult passage is to create dynamically the structure... how to merge a lot of files in to a single zip file without first creating them physically on the disk?

Any comment about the feasibility is welcome...
Thanks and regards,
Netsaver Paul, 
Rome  IT



@TiddlyTweeter

unread,
May 24, 2018, 6:40:12 PM5/24/18
to TiddlyWiki
It's an interesting question.

IS TW already an e-book?

Export to common e-book formats would need be mainly via static HTML. You would lose much, most that TW does.

Using TW to help produce e-books in other formats would be possible, I think, quite easy. But I find it hard to see the incentive.

The question for me is this: How can I wrap a TW book in a universal wrapper?

Just thoughts
Josiah

@TiddlyTweeter

unread,
May 24, 2018, 7:00:23 PM5/24/18
to TiddlyWiki
I sort of suspect TiddlyDesktop could be refactored as TiddlyBook.


On Friday, 25 May 2018 00:14:39 UTC+2, Paul Netsaver wrote:

Jed Carty

unread,
May 24, 2018, 7:53:21 PM5/24/18
to TiddlyWiki
I think that making something to convert from tiddlywiki to epub format wouldn't be too terribly difficult. An epub is pretty much a zip file that contains a set of html files and some metadata so using the static html export for tiddlers would already do the rendering work.

I think that you would need to to use something like Bob that can run scripts from inside a wiki or a command line tool to create the epub file itself. There are some node modules that can be used to generate epub files so we wouldn't have to create that part.

The epub standards allow any valid html5 and css3. I have seen differing responses about if it supports embedded javascript. The reader used is probably the limiting factor for support there.

TonyM

unread,
May 24, 2018, 8:12:04 PM5/24/18
to TiddlyWiki
Josiah,

The incentive is very powerful for a sub-sector of users, when I was younger I wanted to be a cosmologist and science fiction writer.  An IT career happened instead. Only recently I started to think about writing again because I could build a universe, a solar system and a number of planets and document it in TiddlyWiki. To think that within that wiki the eventual content can be produced then published to a common reader format sounds great. We can do this to PDF with our browsers so what extra value is direct to epub offer? I imagine a richer index and more?

If however there are good PDF to epub converters I would not waste our time with another export format but add it to improving PDF outputs.

Regards
Tony

Greg Davis

unread,
May 24, 2018, 10:35:25 PM5/24/18
to tiddl...@googlegroups.com

Hi,
Kind of stopped pursing Epubs as got more into TiddlyWiki, but a few notes:

Epub3 features are not all backward compatible with epub2 devices / apps and there is a large numer of old epub2 devices / apps. Some may require NCX file.
EPUB 2 is XHTML 1.1, CSS 2, UTF-8 encoding
Most devices / apps support flowing text. Pictures may be on different screen than related text.  Fixed layout pages have limited support and complicated to produce.
Positioning for pictures or tables is easiest inline with text, not offset or other tricks. Tables limited width for readability and can break if too wide.
Not all recent devices / apps support all features, or support the same way.
A manifest and spine must identify all referenced files, their location, and reading order.
The mime type file must be the first one in the zip file.
Each chapter is typically a new HTML file.
Some vendors will require that they pass a validator like ebubcheck.
Epub files for Apple may have to be tweaked to Apple specs.
Not everyone uses Epub, don't forget Amazon which uses AZW3 or newer KF8.

Take a look at MobileRead Forums https://www.mobileread.com/forums/ particularly the Epub and Workshop forums.

Good luck,
Greg

Greg Davis

unread,
May 24, 2018, 10:44:58 PM5/24/18
to tiddl...@googlegroups.com
Tony

GO FOR IT ! !

Hey, I was IT. Life interrupted but I am trying to get back to the project I started a long time ago. First drafts and notes scattered all over. Wish I'd had TiddlyWiki back then to keep track of everything.

Best Wishes,
Greg
Sisters_universe_notebook_2018.jpg

Mark S.

unread,
May 24, 2018, 10:48:31 PM5/24/18
to TiddlyWiki
I guess we're all in the same boat. I've got one medium story finished, but wasn't sure where to submit it.

--


On Thursday, May 24, 2018 at 7:44:58 PM UTC-7, Greg Davis wrote:
Tony

GO FOR IT ! !

Hey, I was IT. Life interrupted but I am trying to get back to the project I started along time ago. First drafts and notes scattered all over. Wish I'd had TiddlyWiki back then to keep track of everything.

Mark S.

unread,
May 24, 2018, 10:49:44 PM5/24/18
to TiddlyWiki
You could use node to create a static version. Then import into Calibre. Edit/Clean up. Tweak meta-data.  Convert to epub.

That sounds like a lot of work, but it's a doable process with (mostly) known steps. I suspect it would be much faster than waiting for someone to write a plugin.

The exception would be if there was an existing convert-to-epub javascript program that could be rolled into TW.

-- Mark

Greg Davis

unread,
May 24, 2018, 11:02:14 PM5/24/18
to TiddlyWiki
Mark S.

Hi,
Well if it is Science Fiction there is always Baen official slush for publication  http://baen.com/

If you have not given it to a beta reader and/or editor. You can try the crit forums on Baen's Bar (have to register) the Slush Pile is for general critiques. Other critique forums are Baen's Universe Slush is for short stories and 1632 Slush is for stories in Eric Flint's Ring of Fire Universe. http://bar.baen.com/

Jeremy Ruston

unread,
May 25, 2018, 4:43:28 AM5/25/18
to tiddl...@googlegroups.com
I very much like the idea of an epub3 output format for TW5.

As others have noted, the epub3 format itself can be fairly simple (plus the general rule that it is always orders of magnitude easier to generate a particular format than it is to parse/accept that format). We already have a JSZip plugin that can handle the creation of a ZIP file from a bunch of individual files.

One aspect that particularly interests me is the production of redundant static pages to reproduce the functionality of a dynamic experience. For example, consider a table of a few columns of data that we’d like to publish such that the user can click on a column heading to sort by it. The usual approach would be a small JS plugin that rearranges the DOM when the column header is clicked. Instead, we could pre-generate static HTML representations of every combination of sorting for the table, and then construct links between them. So, if the initial rendering is ordered by first name, and the user clicks on the column for the second name, they would actually be navigating to a different rendering of the data sorted by second name.

I believe that this approach could go a long way: a sort of flipbook approach to user interface design.

Best wishes

Jeremy.



-- 
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/29761c36-7cb5-4aff-b629-7e740cee208c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark S.

unread,
May 25, 2018, 10:59:32 AM5/25/18
to TiddlyWiki
Is there code in the core already to make static pages? Or only in the node version?

Thanks!
-- Mark

Mat

unread,
May 25, 2018, 12:37:59 PM5/25/18
to TiddlyWiki
Mark S. wrote:
Is there code in the core already to make static pages? Or only in the node version?

C'mon Mark, you know there is. Tiddler toolbar > Export tiddler (static html)

<:-)

Mat

unread,
May 25, 2018, 12:58:47 PM5/25/18
to TiddlyWiki
Jeremy Ruston wrote:
[...] pre-generate static HTML representations of every combination of sorting for the table, and then construct links between them. So, if the initial rendering is ordered by first name, and the user clicks on the column for the second name, they would actually be navigating to a different rendering of the data sorted by second name.

Redundant copies, covering every output case? Now that idea was unexpected.

Might CSS ordering be an option? https://www.w3schools.com/cssref/css3_pr_order.asp
 
<:-)

Mark S.

unread,
May 25, 2018, 1:07:08 PM5/25/18
to TiddlyWiki
The thing with redundant copies is, wouldn't the user have to use the back key? Or a "return" link? And how would you hide those redundant copies?

-- Mark

Paul Netsaver

unread,
May 25, 2018, 6:00:18 PM5/25/18
to TiddlyWiki
I think that this kind of dynamic simulation could offer some possibilities with a small number of combinations only.
By the way, imagine that in the rendered html containing tables one wants to use an external pure js pagination library.
I can see that Epub3 format can execute also scripts in JS subfolder.

Why is not technically possible to write JS code in some tiddler belonging to epub project and appending references to it in the final html pages? There's some design constraint?

e.g. create tiddler sort-table.js, adding sort capabilities to all tables with class 'sortable', add it to the project, then add also tiddler chapter1, containing a table with class 'sortable'. The sort-table.js tiddler should be published in the JS folder of the book and references to it (<script src="js/sortable.js"></script>) could be added (automatically? or via processing instruction in every tiddler?) to html tiddler(s).

In a similar concept: is it possible to create (system/common/shadow or whatever) tiddlers containing js code which is to be appended as script to some tiddler 'after its rendering to html', so to be executed by the browser when it's loading the final product 
e.g. if I tag a 'sort-table.js' tiddler with tiddler names 'hosts', 'addresses', etc. would mean that TW should append js reference to sort-table in #hosts and #addresses html subcode. This behavoiur (if possible!) coud be kept when developing an eventual ebook plugin.
What am I missing?

Thanks and regards,
Paul Netsaver,
Rome, IT

TonyM

unread,
May 25, 2018, 7:41:23 PM5/25/18
to TiddlyWiki
Jeremy,

You mention

One aspect that particularly interests me is the production of redundant static pages to reproduce the functionality of a dynamic experience. For example, consider a table of a few columns of data that we’d like to publish such that the user can click on a column heading to sort by it. The usual approach would be a small JS plugin that rearranges the DOM when the column header is clicked. Instead, we could pre-generate static HTML representations of every combination of sorting for the table, and then construct links between them. So, if the initial rendering is ordered by first name, and the user clicks on the column for the second name, they would actually be navigating to a different rendering of the data sorted by second name.

What you propose would be very helpful, however I was thinking it may be quicker and easier to hand the creation of the alternate static views to the user, but provide a way to "overlay them" in a dynamic design so that they appear in the static HTML output. This would possibly empower additional dynamic experience emulation.

I'm thinking for example a list field on a tiddler indicating the 3 tiddlers representing the different sort orders.
Even simply cloning the sort-able tiddler for each sorted result (change sort filter) and altering the headings to refer to each sort view, all we need is for the generation of static HTML to recognise these and only display the currently selected "view".

I suppose I am interested in generalising as much as possible any solution.

Regards
Tony

Jeremy Ruston

unread,
May 26, 2018, 6:19:18 AM5/26/18
to tiddl...@googlegroups.com
Hi Mark

The thing with redundant copies is, wouldn't the user have to use the back key? Or a "return" link? And how would you hide those redundant copies?

EPUB readers do not in my experience typically offer a “back” button, but rather navigation via the “spine” of the book (an ordered list of the HTML pages within it).

As far as I can tell, EPUBs may contain pages that are not included in the “spine” or the table of contents, and thus can only be navigated via hyperlinks.

Best wishes

Jeremy


-- Mark

On Friday, May 25, 2018 at 9:58:47 AM UTC-7, Mat wrote:
Jeremy Ruston wrote:
[...] pre-generate static HTML representations of every combination of sorting for the table, and then construct links between them. So, if the initial rendering is ordered by first name, and the user clicks on the column for the second name, they would actually be navigating to a different rendering of the data sorted by second name.

Redundant copies, covering every output case? Now that idea was unexpected.

Might CSS ordering be an option? https://www.w3schools.com/cssref/css3_pr_order.asp
 
<:-)

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Jeremy Ruston

unread,
May 26, 2018, 6:22:00 AM5/26/18
to tiddl...@googlegroups.com
Dear Paul

I can see that Epub3 format can execute also scripts in JS subfolder.

JavaScript support is inconsistent and limited on current readers, hence my interest in techniques to avoid dependence on it.

Why is not technically possible to write JS code in some tiddler belonging to epub project and appending references to it in the final html pages? There's some design constraint?

I don’t think there is any design constraint within TW5 there; is there a reason you thought there might be?

Best wishes

Jeremy

Jeremy Ruston

unread,
May 26, 2018, 6:24:04 AM5/26/18
to tiddl...@googlegroups.com
Hi Tony


What you propose would be very helpful, however I was thinking it may be quicker and easier to hand the creation of the alternate static views to the user, but provide a way to "overlay them" in a dynamic design so that they appear in the static HTML output. This would possibly empower additional dynamic experience emulation.

I'm thinking for example a list field on a tiddler indicating the 3 tiddlers representing the different sort orders.
Even simply cloning the sort-able tiddler for each sorted result (change sort filter) and altering the headings to refer to each sort view, all we need is for the generation of static HTML to recognise these and only display the currently selected "view".

I suppose I am interested in generalising as much as possible any solution.

I’m sure there are situations where users might want to be in explicit control, but I was mainly thinking of situations where the user would create an ordinary TW5 “app”, and then the system would deduce which static views would be needed in order to reproduce it.

Best wishes

Jeremy


Regards
Tony

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Mark S.

unread,
May 26, 2018, 9:04:59 AM5/26/18
to TiddlyWiki
Hi Jeremy,

Might be a difference between the Apple and the non-Apple world. As an early adopter, my old kindle has a back key. The Paperwhite has a back arrow that gets activated when the top of the screen is touched. The kindle on android can use the system "back" key to return from a visited link. I'll have to test if the same thing works on my favorite ereader app (FBreader).


Thanks!
Mark 

@TiddlyTweeter

unread,
May 26, 2018, 9:48:35 AM5/26/18
to TiddlyWiki
Ciao Jeremy

EPUB3 is a very interesting "standard" in its "lag" from the relentless drive-on of the web. Not least because, I think, for the good reason of longevity. E-pubs are not on the cutting edge. The thinking embracing a more "book-wise" sense of being in for the long-haul without too many surprises.

In my thinking is not so much about converting splendid TW to e-pubs -- but rather that TW could be a good, basic, CMS to assist creation of e-pubs.

The role of TW as "middle-man".

What I mean here is NOT just stellar TW get into e-book. Rather, more ordinary TW without too many bells and whistles actually resemble e-books most, I think.

Best wishes
Josiah

@TiddlyTweeter

unread,
May 26, 2018, 10:50:22 AM5/26/18
to tiddl...@googlegroups.com
Another thought about EPUBs--those that use public domain materials and have open licenses, of which there are a lot--is to deconstruct them into TW. The advantage of E-book is often a lot of care went into the logical design. So, in some ways, they can be better than raw Gutenberg et al as sources.

The other part is, of course, ability to edit freely once in TW. For some kinds of project, like studying Dickens in detail, you need to do a lot more than bookmark. TW has all that is needed.

ONE issue with TW does remain scalability. A biggish book can kinda work so long as you chunk it into substantial chunks. But most detailed commentary needs paragraph-level chunks. TW starts grinding to a halt on that for full length novels.

Just thoughts
Josiah

Mark S.

unread,
May 26, 2018, 12:29:00 PM5/26/18
to TiddlyWiki
Hi TT,

How would you annotate text?

In terms of size, a possibility is to externalize a text by chapter, half-chapter, whatever is appropriate in an iframe. Then pack the unique keywords into the tiddler so that it can be found in searches. So TW has the meta data and can display the text.

-- Mark


On Saturday, May 26, 2018 at 7:50:22 AM UTC-7, @TiddlyTweeter wrote:
Another thought about EPUBs--those that use public domain materials and have open licenses, of which there are a lot--is to deconstruct them into TW. The advantage of E-book is often a lot of care went into the logical design. So, in some ways, they can be better than raw Gutenberg et al as sources.

The other part is, of course, ability to edit freely once in TW. For some kinds of project, like studying Dickens in detail, you need to do a lot more than bookmark. TW has all that is needed.

ONE issue with TW does remain scalability. A biggish book can kinda work so long as you chunk it into substantial chunks. But most detailed commentary needs paragraph-level chunks. TW kind starts grinding to a halt on that for full length novels.

Just thoughts
Josiah

TonyM

unread,
May 26, 2018, 9:43:12 PM5/26/18
to TiddlyWiki
Josiah, Mark,

I thought of doing something similar for PDF files I may drop on a wiki, add subjects or keywords to fields in the PDF tiddler such that a search can find the tiddler (containing the PDF).

I have just built a subjects alternative tag field using GenTags.  And will test it soon.

Regards
Tony

Paul Netsaver

unread,
Jun 21, 2018, 7:54:09 AM6/21/18
to TiddlyWiki
Hi,
maybe it was a wrong impression, but my understanding was that javascript code, in addition to being avoided in html tiddlers, has to be executed before DOM creation, so cannot be propagated (or not resolved) up to the end of the chain, so to be executed by the browser after TW rendering.
That's because the final object has to be static HTML.
For instance I needed to add a couple of js libraries (one for table manipulation, one for chess game parsing) which usually in my html note collection I added directly to the script calls in the HTML head section. I tried to add this code to TW but I realized (that's where I could be wrong) that I had to write a plugin incorporating the libraries.
Otherwise I would not be able to add js call to external libraries directly in the tiddlers, or even via js macros.
So I was arguing that for eventual epub exporting, which would be based on static HTML, it were not possible to add js call section in order to have dynamic pages.
In last case one could think, by means of epub3 format, to use TW as dynamic site generator... am I wrong?
thanks and regards,

Netsaver, Rome (IT)
Reply all
Reply to author
Forward
0 new messages