View Full Version : ePubHub, an open-source eBook assembly app for Windows


awx
02-22-2010, 03:55 PM
I'd like to introduce ePubHub, an open source program that I've been working on for several months. It is written in .Net but only runs on Windows. There is no Linux or Mac OS X support because the cross-platform .Net runtime Mono doesn't support Wpf.

Download the installer:
setup.exe (http://sourceforge.net/projects/epubhub/files/setup.exe/download)

To get started using ePubHub, right click on the eBook or Metadata icon and Add any of the available items from the menu.

My goal for ePubHub was for it to be an ePub assembly tool - the last part of an ebook workflow. I wanted it to be a very technical program, giving access to the fundamental parts of the ePub format while also working in a language that is familiar to books (chapters, paragraphs, etc.).

Here's a screenshot of the current development build:
http://img403.imageshack.us/img403/5008/epubhub20101227.png (http://img403.imageshack.us/i/epubhub20101227.png/)

This is a preview release that is far from complete. There are a number of limitations, including:

The Open/Save feature does not work (exporting to ePub works).
Only .jpg images are supported.
Audio not implemented yet.
A few of the eBook item types are not implemented and will appear to crash if you try to export them into an ePub file. Do not use the Notes, Sidebar or Endnote controls.
A few of the eBook items are rendered incorrectly and will cause the ePub file to be invalid. Do not use the Underline control.
The source code will throw unhandled exceptions in a few places (mostly when using the unimplemented controls such as Sidebar). These will appear to crash the program if you do not have a debugger installed. These issues are known and will be addressed in due course.


Note: Do not worry if you see an item whose icon is an image of an exclamation point inside a red circle. This does not indicate an error. It's simply a placeholder icon being used until a better icon can be found.

Source code is available at the Sourceforge website, on this page:
http://sourceforge.net/projects/epubhub/

Please give feedback on this preview release.

Thanks,
Art

charleski
02-22-2010, 08:57 PM
Looks interesting. Unfortunately, there isn't anything to download in the files section :(.

awx
02-22-2010, 09:46 PM
Looks interesting. Unfortunately, there isn't anything to download in the files section :(.

Read the 1st post again. Here's the link for the installer again:
http://epubhub.sourceforge.net/clickonce/publish.htm

charleski
02-23-2010, 05:09 AM
Read the 1st post again. Here's the link for the installer again:
http://epubhub.sourceforge.net/clickonce/publish.htm
ClickOnce doesn't work in FireFox (at least not with my security settings). Finally managed to get it to install with IE, but a simple downloadable installer would be simpler.

Is there any way to import xhtml that's already been prepared, or is that still in development? I managed to create a few empty pages and paragraphs, but that's about it. Are there any plans to allow touch-up editing on the content?

BTW, I see you allow <a> tags to have both an 'id' and 'name' attribute - this should be fixed, as the name attribute is deprecated on <a> tags in xhtml.

awx
02-23-2010, 01:13 PM
There is a ClickOnce extension for FireFox and a plugin for IE. If you have those disabled then you can download the ClickOnce setup.exe file:
http://epubhub.sourceforge.net/clickonce/setup.exe
This .exe is the same file that non-FF/IE users will receive when they go to the ClickOnce page.

BTW, once there is a release that could be deemed relatively stable and feature complete, I'll post a .zip in the Sourceforge file releases.

I changed the anchors to use id instead of name. You'll get an automatic update of the program after you've launched it twice. Thanks for pointing this out and please look for more errors like this.

The import feature is at the #2 spot on my to-do list. First is to add support for Css stylesheets, which I hope to complete or at least start today. Importing probably won't get started until next weekend.

Touch-up editing of imported text & html should work without any restrictions. There certainly needs to be better editing tools added to ePubHub.

JSWolf
02-25-2010, 03:53 PM
Too many hoops to jump through to get it downloaded. Sorry. I may try it once you have the downloading/install process fixed.

cbarnett
02-25-2010, 06:37 PM
I'm sorry too, but agree with JSWolf. I really don't like the download format either, but I'll be happy to try it when I can download and run a true install program though!

awx
02-25-2010, 09:24 PM
This setup.exe (http://epubhub.sourceforge.net/clickonce/setup.exe) won't work for you?

If it doesn't work, tell me what happens and I'll see what I can do.

blak4dr
02-27-2010, 04:25 AM
setup works well.

Still too early at this stage to give an elaborated opinion. Looks good though. But I agree hat importing chapter files already prepared would be a plus.

awx
02-27-2010, 12:29 PM
Thanks for the feedback on the setup.exe.

I'll start working on importing text/html today as that seems to be the most pressing requirement.

quillaja
02-27-2010, 11:55 PM
This looks like a cool project. I was considering writing something like this myself, but never really got to it. I'll be sure to check it out soon. Perhaps there's something I can help out with. =) (Though I'm only a hobbyist programmer.)

awx
03-03-2010, 02:01 AM
I've pushed out a new test version that implements a rudimentary Xhtml Import function. The file is currently not validated against any Xhtml dtd but it must be valid xml with the Xhtml default namespace (i.e. <html xmlns="http://www.w3.org/1999/xhtml">).

As always, the autoupdater will offer to download the newest version the 2nd time you launch it after the update is published.

Only a small subset of tags will be imported (div, span, p, h1-6, b, i, img). Any other tags and their contents will be ignored. All attributes (class, style, etc.) are currently ignored except on the img tag.

Imported img tags should also create an empty Image in the Images folder with the correct file name. But you would still have to import the corresponding .jpg file for this to be useful.

Please try importing a few of your Xhtml documents and let me know if they come through.

Right now all imported items are dumped in a generic page. There isn't any convenient way to move these in bulk to another page or chapter. I'll be working on that next.

@quillaja: thanks for checking this out. If you'd like to help, there are plently of programming and non-programming tasks that need to be done. Feel free to PM me through this board if you have time to help.

Toxaris
03-10-2010, 03:57 AM
Downloaded the version with the setup link you provided here. Still, I would have much more liked a downloadable version from sourceforge...

First impression is good for a first version. Could you please indicate if bug reports or feature requests could be best placed here or on sourceforge?

I have a few that came up before really testing:
1. Language metadata is currently restricted to English, German, French and Swedish. Since there are more languages ;), could you please either add them (for me personally dutch) or tell us how to add them ourselves?
2. Cover page, is this just an image or via svg?
3. import of an epub to make quick edits?
4. Save in-between work?

Perhaps some more will come up.

Since this is a nice tool (at least it looks like it), could someone make this thread a sticky?

astra
03-10-2010, 07:59 AM
How do you download the program?

Toxaris
03-10-2010, 01:41 PM
This setup.exe (http://epubhub.sourceforge.net/clickonce/setup.exe) won't work for you?

If it doesn't work, tell me what happens and I'll see what I can do.

The link is mentioned earlier in the thread.

awx
03-10-2010, 11:39 PM
Thanks for the feedback. I'm now working to improve the drag-and-drop feature to allow moving many items at once. It's about 80% done so hopefully a new version will be released a week from now.

I'd still really like to hear feedback on the Xhtml import feature. I'm especially curious if anyone has whitespace problems with the imported text (that is, either missing spaces or too many spaces. After getting drag-and-drop working, I'll start improving the import feature to support other tags and attributes.

I would have much more liked a downloadable version from sourceforge...
OK, I'll upload the setup.exe to the sourceforge servers. If that still won't make some people happy, then please speak up.

Could you please indicate if bug reports or feature requests could be best placed here or on sourceforge?
For the time being, please post bug reports here. An incomplete list of bugs that I know about can be viewed here:
Svn to-do list (http://epubhub.svn.sourceforge.net/viewvc/epubhub/trunk/To-Do%20List.txt?view=markup)

1. Language metadata is currently restricted to English, German, French and Swedish. Since there are more languages ;), could you please either add them (for me personally dutch) or tell us how to add them ourselves?
The languages are stored in an Xml file inside the exe with this format:
<language>
<code>fr</code>
<desc xml:lang="en-US">French</desc>
</language>
<language>
<code>en-UK</code>
<desc xml:lang="en-US">English (United Kingdom)</desc>
</language>
I could add the ability for users to add their own languages but it's probably easier if someone would just make a complete list and send it to me.

2. Cover page, is this just an image or via svg?
Right now it is just a jpg image. I have read Adobe's technote about creating svg cover pages and also posts on this forum where people say svg in epub isn't reliable. Regardless, svg should come when gif and png image formats are added.

3. import of an epub to make quick edits?
Now that an xhtml import framework is in place, it shouldn't be terribly difficult to do this.

4. Save in-between work?
Of course that is very important but it will be one of the last major pieces to be added. This is because I don't want to create the file format now only to be forced to change it once another feature is added.

Toxaris
03-11-2010, 05:08 AM
This *should* be the complete language list. Perhaps someone else could counter-check?

47725

Will see if I have time to test the xhtml import tonight. Will keep you posted.

awx
03-11-2010, 03:10 PM
That's great. The only problem is the description language attribute should be "en-US". Do you have any easy way to change those?

Toxaris
03-12-2010, 04:22 AM
I have added the new original version (a small typo) and a version with what I think you want.

To be honest, I don't understand why. Why should everything be <desc xml:lang="en-US">? Isn't the purpose to support different languages and typesets? In this way I think you are restricting several typographic possibilities in foreign languages. Or I just misinterpret the xml:lang...

47834
47835

awx
03-12-2010, 10:21 AM
You are misinterpreting this. The xml:lang describes what language the desc is written in. This allows multiple language descriptions to be added. Such as:

<language>
<code>sv</code>
<desc xml:lang="en-US">Swedish</desc>
<desc xml:lang="sv">Svenska</desc>
</language>

Toxaris
03-12-2010, 01:56 PM
Ok, so the second file is what you need, right?

awx
03-13-2010, 02:37 PM
Yes, and it's been imported and will appear in the next update. Thanks

JayCeeEll
03-15-2010, 11:51 AM
Have downloaded the source from SourceForge and I a couple of minor comments.


The solution asks for a password for the sorceforge certificate. Perhaps you should add a second solution so that the project compiles without the need for a certificate.
.user files are normally svn:ignore[d] (epubhub.csproj.user is in the repository)
The zipstorer class should be included as an external

awx
03-15-2010, 02:57 PM
OK, I've excluded the .user file.

You can simply create your own pfx file to overwrite the sourceforge one. Unless there is some pressing need, I'm not going to try to maintain two parallel solutions that differ only by this file. VS includes a button to automatically generate this file, doesn't it?

As for separating zipstorer, what is your reasoning behind this? I do not wish to for several reasons. I prefer a single exe file with no file dependencies if it is possible. And when VS 2010 ships, I will likely have to switch back to the C# Express version as I no longer have an MSDN subscription. If I remember correctly, in the Express editions it's easier to manage the solution with a single project for some reason (perhaps I'm making this up?).

JayCeeEll
03-15-2010, 03:25 PM
As for separating zipstorer, what is your reasoning behind this?

I don't mean as a seperate file, but the way most people seem to organise their projects is:

Trunk
Externals
Project
or
Trunk
Project
Externals
Where the svn property of the Externals folder would be "svn:external -rnnn https://zipstorer.svn.codeplex.com/svn zipstorer" (nnn is the version of the zipstorer codebase) This enables you to bring in a specific version of an external project, which is very useful when you want to regression test.

awx
03-15-2010, 03:49 PM
Wouldn't VS go nuts if a new version of the external project had a different file layout than the existing one?

JayCeeEll
03-15-2010, 04:13 PM
I think the point is moot, because I have just checked and the zipstorer project doesn't seem to support svn output. (It is probably OTT for 1 .cs file anyway.)

However, the reason for using a specific version (-rnnn) in the externals property is to ensure that no surprises occur. But when an external project has new features you want to use, you can just amend the revision number and then run all your unit test and integration tests against the new code, before consuming the new features.

MovieBird
03-15-2010, 04:50 PM
OK, I'll upload the setup.exe to the sourceforge servers. If that still won't make some people happy, then please speak up.

I'd be much happier with a portable installation, myself. :thumbsup:

awx
03-15-2010, 06:33 PM
I'd be much happier with a portable installation, myself. :thumbsup:
Understood. A zip file containing the ePubHub.exe app will come with the first release that could be considered "feature complete". It won't be an installer though, just the app.

MovieBird
03-15-2010, 08:13 PM
Understood. A zip file containing the ePubHub.exe app will come with the first release that could be considered "feature complete". It won't be an installer though, just the app.

Even better. Was only using installation in the sense that some portable apps use appdata for profile settings.

awx
03-15-2010, 10:05 PM
ePubHub stores a few small bits of window position data and last used directory info in appdata and that's not going to change.

jgray
03-16-2010, 01:44 AM
I just wanted to add my 2 cents. So far, I very much like what I see and anxiously await the addition of more features. Is it done yet? :)

awx
03-16-2010, 03:26 AM
Thanks for the kind words.

Not done yet :o but a new version was released tonight.

This is the first version that I was able to use to create a full ePub file. I imported an Xhtml document that was created by OCR from my Fujitsu ScanSnap scanner & Abbyy FineReader of a 400+ page book with nearly 40 chapters. The Parts & Chapters worked perfectly, giving my ePub a nice Table of Contents that worked perfectly on my Sony PRS-600.

New to this version:
* Bug fixes with sorting and some exceptions thrown during scrolling.
* More languages to choose from, courtesy of Toxaris.
* Multi-select drag-and-drop inside the Navigation tree.
* Multi-select delete for everything that supports deletion.
* Some big speedups when drag-and-dropping hundreds of items but still more are needed. It can get ridiculously slow dragging thousands of items. :o
* Added an "Insert Above" and "Insert Below" context menu.
* Content pane is now broken up into a tab control. The "Items" tab is non-functional at this point but is being planned to help make drag-n-drop easier.

The multi-select works as one would expect. Shift and Control clicking allows you to select multiple items in the Navigation tree. When dragging paragraphs, etc., be sure to only select items from the same parent/level.

jgray
03-16-2010, 04:41 AM
Hey, isn't it about time you had your own section, like the other epub authoring programs? (Big hint to moderators).

awx
03-16-2010, 03:23 PM
New version with some small changes released today. I believe all slowdowns with drag-n-drop are fixed. I've tested dragging nearly 10000 items and the time is just a couple of seconds.

Toxaris
03-17-2010, 04:37 AM
I like it more and more!:D

:thanks:

Toxaris
03-19-2010, 06:55 AM
Tried to import an XML file today and got an error (attached). The problem seems to be the HTML code &copy;. That code is not accepted, although it is valid.

Something else I noticed. Blockquotes not in paragraphs blocks will be ignored during import.

Will try more today, so perhaps more will follow.

Is it by design that I can add components, but not enter anything in it? If I add a paragraph for instance I cannot put text in it. I would assume that it was possible in the code preview or am I missing something? *nevermind, found this one myself*

Something more I noticed. I made some changes and tried 'Save to epub' once more. I wanted to overwrite the old. I got a message that my changes were lost and the program exited. Strange, I suspected a 'Do you want to overwrite?' popup. :D

I just keep editing... If I import and xhtml which contains images, an entry is added to the images part. I then can import the image. However, if the xhtml has an CSS entry in it, I do not see an entry in the Stylesheets tree. The link I used was:
<link href="css/standaard.css" type="text/css" charset="UTF-8" rel="stylesheet"/>

jgray
03-20-2010, 10:33 PM
New version with some small changes released today. I believe all slowdowns with drag-n-drop are fixed. I've tested dragging nearly 10000 items and the time is just a couple of seconds.

I have what I assume is the latest version (0.2.3.0). I even uninstalled the program and ran Setup again to download/install epubhub. However, I'm not seeing any way to drag/drop existing XHTML files into the program. In fact, I can't drag/drop any type of file into the program. I'm running Win7 x64.

All I want to do is to take existing XHTML chapters, images and a style sheet and have an epub created. I don't want additional markup added to my files. I can and have created an epub by hand with a text editor, but making the content.opf and toc.ncx is very tedious. This is what computers are for, isn't it? :)

JSWolf
03-20-2010, 10:37 PM
ePubHub stores a few small bits of window position data and last used directory info in appdata and that's not going to change.

Why not have it store an ini file with the settings in the same directory as the executable?

ATimson
03-20-2010, 11:56 PM
Why not have it store an ini file with the settings in the same directory as the executable?
Because we aren't running Windows Me anymore, and non-admin users don't (or at least shouldn't) have write access to the program directory. :p

awx
03-21-2010, 02:13 AM
I have what I assume is the latest version (0.2.3.0). I even uninstalled the program and ran Setup again to download/install epubhub. However, I'm not seeing any way to drag/drop existing XHTML files into the program. In fact, I can't drag/drop any type of file into the program. I'm running Win7 x64.

All I want to do is to take existing XHTML chapters, images and a style sheet and have an epub created. I don't want additional markup added to my files. I can and have created an epub by hand with a text editor, but making the content.opf and toc.ncx is very tedious. This is what computers are for, isn't it? :)
Go to the file menu and select "Import Xhtml...". A "Generic Page" with your data will hopefully get created. The file must be Xhtml, not html.

Expect an expanded import feature sometime in the next few days. I've already added more tags, including blockquote and pre. The standard attributes now get imported, such as id, class and style.

In order for character entities (&nbsp; and such) to import, you must have the Xhtml 1.1 dtd in your xhtml file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

awx
03-21-2010, 02:19 AM
Tried to import an XML file today and got an error (attached). The problem seems to be the HTML code &copy;. That code is not accepted, although it is valid.
You must add the html doctype with the Xhtml dtd for the importer to understand how the translate the character entities.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

Something else I noticed. Blockquotes not in paragraphs blocks will be ignored during import.
I've added these along with several other tags in the version to be released next week.

Is it by design that I can add components, but not enter anything in it? If I add a paragraph for instance I cannot put text in it. I would assume that it was possible in the code preview or am I missing something? *nevermind, found this one myself*
Inside the paragraph, you need to add a Text object.

Something more I noticed. I made some changes and tried 'Save to epub' once more. I wanted to overwrite the old. I got a message that my changes were lost and the program exited. Strange, I suspected a 'Do you want to overwrite?' popup. :D
That's weird, I have no idea what happened. If you can reproduce this then write down the exact steps I need to follow.

I just keep editing... If I import and xhtml which contains images, an entry is added to the images part. I then can import the image. However, if the xhtml has an CSS entry in it, I do not see an entry in the Stylesheets tree. The link I used was:
<link href="css/standaard.css" type="text/css" charset="UTF-8" rel="stylesheet"/>
I stopped implementing the Css support because people said the import feature was more important. It's only partially complete and I plan to start on it again in two weeks.

awx
03-21-2010, 02:22 AM
Why not have it store an ini file with the settings in the same directory as the executable?
I believe the .Net settings class can save to a different file but I'm not going to work on this now as there are too many other things that need completing.

The only settings that are stored are basic stuff about Window positioning and the last filepaths used.

jgray
03-21-2010, 05:03 AM
Go to the file menu and select "Import Xhtml...". A "Generic Page" with your data will hopefully get created. The file must be Xhtml, not html.

I know about importing an XHTML file one-at-a-time. With almost 90 files, this is not useable to me.

Since you mentioned drag-n-drop, my previous question was why can't I drag-n-drop files, since apparently you can.

Also, why do files that I do import only show as "Generic Page"? Why can't I change that to something else? For that matter, why do these imported pages need these labels in the first place?

I just want to import a bunch of prefectly valid XHTML files, a stylesheet and some images. Then, edit some metadata in your program, and it have generate the other necessary files and epub container. I really don't want or need to have my source files changed in any way.

awx
03-21-2010, 01:34 PM
I really don't want or need to have my source files changed in any way.
I think eCub works that way. You may want to check it out.

jgray
03-21-2010, 03:02 PM
I think eCub works that way. You may want to check it out.

That's one. Any response to my other questions?

Your program looks potentially useful. Since it's in alpha stage, I would think you would welcome feedback and questions, instead of telling me to go use some other program.

BTW, I did finally use eCub to generate my epub. However, eCub has it's own peculiarities. I was looking for a better tool and yours looked promising.

awx
03-21-2010, 05:19 PM
That's one. Any response to my other questions?

Your program looks potentially useful. Since it's in alpha stage, I would think you would welcome feedback and questions, instead of telling me to go use some other program.

BTW, I did finally use eCub to generate my epub. However, eCub has it's own peculiarities. I was looking for a better tool and yours looked promising.
I do welcome feedback but ePubHub will always make at least some small changes to your files. This will never change because everything you see inside of ePubHub is a custom object that might look and behave very similar to an Xhtml tag or document, but it is actually something different. Hopefully at some point additional renderers could be added for Rtf and possibly Mobipocket.

But if the files you import are valid Xhtml, most changes should be small.

As for importing into a Generic Page, that is probably what you want. The Generic Page object is the one document object in ePubHub that doesn't have any special content requirements and should render just what you've added.

I've changed the import feature to set the custom name the Generic Page to the filename of Xhtml document that is imported.

As for drag-n-drop, right now you can drag items within ePubHub. Dragging Windows' desktop icons and things from other programs requires a lot more code to be written. At this time, I can't focus on that. But I might change the import feature so that if you hold down the shift key, it would change from importing a single document to importing any ".xhtml" documents inside a chosen folder.

awx
03-21-2010, 05:26 PM
A new version was released which has made some small but important changes to the import Xhtml feature.

* The core 1.1 and 1.0 Xhtml Dtds are now embedded inside the application, preventing them from being downloaded from the w3 web site during import.
* The import feature takes the filename of the imported document and sets the title of the Generic Page with it.
* Common Xhtml attributes are now imported, including xml:lang, class, style, id and dir.
* The import feature now recognizes more tags but there are still many that are not working, such as <a /> (hyperlinks). I hope to improve these over the next few days.
* The <pre> tag is now properly (I hope) supported in ePubHub. It was incorrectly used as an inline element rather than a block level element.

awx
03-22-2010, 12:30 AM
New version released with a single new feature.

If you hold down the Shift key while selecting the "Import Xhtml File..." menu item, it will allow you to select a folder. All files with the ".xhtml" extension will be imported.

awx
04-09-2010, 03:53 AM
New version released, still with some rough edges.

New features include:
* Support for Opf Guide
* Support for Ncx Page List. Pages are created with the PageMarkers.
* Support for creating coverpage metadata (as recommended described here (http://blog.threepress.org/2009/11/20/best-practices-in-epub-cover-images/). Add a "Cover Image" in the metadata section and a "Cover Page" in the eBook section.
* Added support for almost every tag from Xhtml 1.1. ePubHub should be getting close to having no invalid Xhtml. I'd like to know if it is possible to incorrectly nest any incompatible tags, such as <b><p></p></b>.
* Error dialog instead of crashing. If the error is not "Not Implemented", it would be helpful if you posted the text here along with the steps to reproduce it.
* Otf fonts and mp3 files can be added but you can't really use them yet.

A few new problems are in this version:
* Editor for preformatted text does not allow returns.
* Some tags still missing a visual editor.

awx
04-13-2010, 01:49 AM
New version released, with these features:

* Css support. All stylesheets in the Stylesheet folder are referenced in every xhtml page.
* @font-face support, src value must be a font embedded into the ePub.
* <ins> & <del> tags now have an editor (though no support for rev date or reason just yet).
* In options dialog, you can configure the <q> tag to also emit curly quotes for readers (such as my Sony PRS-600) that don't render the <q> with quotes. Currently, the characters are fixed to English-style curly quotes and cannot be customized.

Screenshot of fontface editor with Css reference in body:
http://img16.imageshack.us/img16/163/epubhubfontface20100413.png (http://img16.imageshack.us/i/epubhubfontface20100413.png/)

The ePubHub source code is going to be moving to .Net 4.0 tomorrow and hopefully a version using 4.0 will be released soon if there are no problems.

awx
04-13-2010, 05:02 PM
New version released.

The only change is that this version is built with (and therefore requires) .Net 4.0 to be installed on the computer running ePubHub.

You will have to install .Net 4.0 yourself before you can run new versions of ePubHub.

.Net 4.0 Installer
http://www.microsoft.com/downloads/details.aspx?FamilyID=9cfb2d51-5ff4-4491-b0e5-b386f32c0992&displaylang=en

By virtue of updating, ePubHub gets a few benefits:
* icons in the Toolbox won't be blurry anymore
* gets some speedups redrawing icons
* Uses new Windows 7/Vista-style file open/save dialog boxes.

Valloric
04-13-2010, 06:31 PM
By virtue of updating, ePubHub gets a few benefits:
* icons in the Toolbar won't be blurry anymore
* gets some speedups redrawing icons
* Uses new Windows 7/Vista-style file open/save dialog boxes.

Isn't WPF 4.0 awesome? :)

And Microsoft finally made WPF text rendering snap to pixel boundaries (goodbye blurriness)... I guess it's time to start taking WPF seriously...

awx
04-13-2010, 08:03 PM
Another big improvement in Wpf 4.0 is that it respects the ClearType settings from Windows, which previous versions ignored.

Blurry fonts affected some computers more than others. For instance, looking at the screenshot from .Net 3.5 two posts above, it's hard to find much fault with the font rendering. That screenshot came from my laptop, where I did a pretty close comparison between 3.5 and 4.0. On that laptop there is almost no difference. However my desktop computer saw a big improvement in font legibility.

The icon improvements were actually in the Toolbox, not the toolbar as I originally wrote. ePubHub had been using a 3rd party icon class that did proper snap-to-pixel rendering of icons everywhere in the app but it wouldn't work in the toolbox. The new native snap-to-pixel rendering looks just as good and renders with a lot less overhead.

Valloric
04-14-2010, 07:24 AM
Another big improvement in Wpf 4.0 is that it respects the ClearType settings from Windows, which previous versions ignored.

Yeah, the native WPF text rendering stack did everything to preserve glyph outlines, even at the cost of readability. Now they've just added the GDI+ way of doing it, with text snapping to the pixel grid. And then ClearType can do it's job properly.

It's what I've been waiting for (and a great deal of other people, too). WPF was so awesome before (XAML FTW), but I could never justify using it because of the text rendering issues. It just makes me cringe. I still remember VS 2010 beta1 coming out and the uproar over the text editor now being effectively unusable. I personally uninstalled beta1 three minutes after seeing for myself just how horrible the text looked like.

But now I'll be switching from Windows Forms to WPF for my C# projects wherever possible.

awx
04-20-2010, 03:30 PM
New versions released with some minor bug fixes, including
* wrong paths for @font-face declarations in certain circumstances
* Image & @font-face objects would forget the items selected in Comboboxes in certain circumstances.

Css importing should be released later today.

Toxaris
04-21-2010, 04:36 AM
Great, will try the version with css import later then. Any news when a basic save option will be active? I really hate to enter everything again while testing.
:thanks:

awx
04-26-2010, 03:55 PM
It took a little longer than I anticipated but the Css import feature is done, with the following known limitations:
* @media directive is not supported and any rules inside of this will be ignored.
* Css comments are ignored during import.
* The Css rules are sorted in alphabetical order. This will change shortly to maintain their original order.

If your css file won't work with those limitations, you should not import it but instead create a "Stylesheet (External)". External stylesheets will copied directly from disk into the ePub without modification.

Great, will try the version with css import later then.
Please let me know if you have any problems while importing Css files. I've tested the import feature against somewhat complicated files without any parsing errors but it's likely there are situations that I didn't consider.

Any news when a basic save option will be active?
My plan was to implement complete error-checking before opening/saving but I agree that opening/saving would be more useful at this point.

I really hate to enter everything again while testing.
Hopefully you're importing most everything and only doing cleanup inside ePubHub. I'll be expanding the import feature to support creating book structure based on divs to speed things up. So if you import an xhtml file that looks like this, you will get an eBook with two chapters instead of a single generic page:

<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<div class="chapter">
<p>Blah blah blah</p>
</div>
<div class="chapter">
<p>Blah blah blah</p>
</div>
</body>
</html>

awx
04-27-2010, 09:27 PM
New version released, which includes improved import functionality and some bug fixes.

If you import an Xhtml file which:
* has a single div inside the body, and
* give that div the class "book-structure"
* and inside that div are only other divs (each representing a section of the epub)
then ePubHub will automatically try to create an appropriate book structure during the import. If the "book-structure" div is not used the import will place all content into a single generic page, just as before.

Valid classes include: chapter, part, part-intro-page, cover-page and title-page. divs with any other class (or none) will get put into a generic page.

Parts can only go one level deep (ie a part must be in the root of the book-structure and you can't nest a part inside anything else). Only chapters and part-intro-pages can go inside a part.

And even though your page content is inside a div, it will be imported into the root of an Xhtml page body so all tags must be valid in that context. So "<div class="chapter"><img ... /></div>" could't be imported because <body> can't contain the <img> tag. If you need this, wrap the image in another div or p.

<html xmlns="http://www.w3.org/1999/xhtml">
<body>

<div class="book-structure">

<div class="part" title="PART ONE">

<div class="chapter">
<p>Blah blah blah</p>
</div>

<div class="chapter">
<p>Blah blah blah</p>
</div>

</div>

</div>

</body>
</html>
The use of the "book-structure" div will be temporary requirement until a proper import dialog box is written.

DaleDe
04-28-2010, 01:02 AM
I am surprised you don't just support H1, H2, H3 for chapter breaks.

Dale

awx
04-28-2010, 03:09 AM
I am surprised you don't just support H1, H2, H3 for chapter breaks.

Dale

It's a bad fit for XHtml and ePub.

Valloric
04-28-2010, 07:31 AM
It's a bad fit for XHtml and ePub.

Please elaborate.

awx
04-28-2010, 09:51 AM
Divs are a good fit for dividing sections of an Xhtml document. Heading tags are a good fit for producing headings.

DaleDe
04-28-2010, 10:34 AM
It's a bad fit for XHtml and ePub.

Not according to the ePUB standard. These are accepted and encouraged methods of formatting and dividing data.

Valloric
04-28-2010, 11:35 AM
Divs are a good fit for dividing sections of an Xhtml document. Heading tags are a good fit for producing headings.

Not according to the ePUB standard. These are accepted and encouraged methods of formatting and dividing data.

I think we may have a misunderstanding here. Dale and I are saying that using a heading tag that signifies that the what follows after it is a new chapter is a good idea. All books have some sort of actual heading at the beginning of every chapter: a number, a chapter title, something in a larger, bolder font.

That's what the heading tags should be used for since that's what they were created for.

Even if you further separate chapters with div tags, you will still have such a heading text (in a heading element or not) at the beginning. So why not use that?

But your idea of wrapping every chapter in a special div... I have nothing against that. It adds more semantic information, so I say go for it.

awx
04-28-2010, 11:56 AM
Dale and I are saying that using a heading tag that signifies that the what follows after it is a new chapter is a good idea.
And that's what I'm saying is a bad idea and not a good fit. It's making assumptions about structure based on presentation. That method might work sometimes, even most of the time, but it's inherently flawed.

kovidgoyal
04-28-2010, 12:10 PM
And that's what I'm saying is a bad idea and not a good fit. It's making assumptions about structure based on presentation. That method might work sometimes, even most of the time, but it's inherently flawed.

Actually heading tags are semantic, not presentational. They don't imply a particular mode of presentation, unlike say the <b> and <i> tags. ANd given that they automatically support levels as opposed to divs I'd argue taht they are more semantic than divs

awx
04-28-2010, 12:44 PM
OK, but they still don't imply chapter breaks.

Jellby
04-28-2010, 02:11 PM
They imply the start of a chapter, or section, or subsection... The problem is there's nothing to imply the end of it (other than the start of the next). It's the same thing with the LaTeX \chapter, \section, etc. Using the <hX> tags when there is no part/chapter/section to start is misusing them.

Wrapping the whole chapter in a <div> can be useful, but in addition to using <h2> (say) for the heading, either inside or outside the <div>.

awx
04-28-2010, 03:18 PM
They imply the start of a chapter, or section, or subsection... The problem is there's nothing to imply the end of it (other than the start of the next).
Also the absence of them does not preclude a chapter start. They just aren't suitable for this purpose.

I agree that authors should use them at the top of pages where appropriate but that's really up to them.

DaleDe
04-28-2010, 03:22 PM
Also the absence of them does not preclude a chapter start. They just aren't suitable for this purpose.

I agree that authors should use them at the top of pages where appropriate but that's really up to them.

In 99% of the books I have read they do exactly that. They mark the beginning of a chapter and a chapter start is never presented without them. The ePUB standard expects them and CSS also works well with them. They are not just dressing for the top of the page. They are the structure for the ePUB format.

Dale

Valloric
04-28-2010, 04:11 PM
Wrapping the whole chapter in a <div> can be useful, but in addition to using <h2> (say) for the heading, either inside or outside the <div>.

Exactly.

awx
04-28-2010, 04:13 PM
The ePUB standard expects them and CSS also works well with them. They are not just dressing for the top of the page. They are the structure for the ePUB format.

I haven't seen anything that agrees with that. There is nothing in the Ncx or Opf files that in any way relates to the h tags.

DaleDe
04-28-2010, 06:16 PM
I haven't seen anything that agrees with that. There is nothing in the Ncx or Opf files that in any way relates to the h tags.

It is not in those documents because it is assumed knowledged based all the way back to 4.0 HTML Look at: http://www.w3.org/TR/1999/REC-html401-19991224/struct/global.html#h-7.5.5

where it says that: A heading element briefly describes the topic of the section it introduces. Heading information may be used by user agents, for example, to construct a table of contents for a document automatically.

That is pretty clear and it has never changed. You can do what you want, of course, but to say that something is not suitable when it is exactly what it is designed to do, seems like you think you have to redesign the whole thing from scratch.

Dale

awx
04-28-2010, 07:56 PM
where it says that: A heading element briefly describes the topic of the section it introduces. Heading information may be used by user agents, for example, to construct a table of contents for a document automatically.
You may want to scroll up just a bit in the document you linked to and read this:
"The DIV and SPAN elements, in conjunction with the id and class attributes, offer a generic mechanism for adding structure to documents."

Followed by:
"Suppose, for example, that we wanted to generate an HTML document based on a database of client information. Since HTML does not include elements that identify objects such as "client", "telephone number", "email address", etc., we use DIV and SPAN to achieve the desired structural and presentational effects."

This is definitely what I'm after.

kovidgoyal
04-28-2010, 07:58 PM
OK, but they still don't imply chapter breaks.

Neither do divs. In fact nothing in HTML implies a chapter break, since chapters are not a concept the HTML spec addresses. The question you need to be asking is what approach is going to be most compatible with with widely accepted practice as well as being reasonably robust.

EDIT: in the context of ePub widely accepted practice is to put each chapter in a separate HTML file.

awx
04-28-2010, 08:51 PM
Neither do divs. In fact nothing in HTML implies a chapter break, since chapters are not a concept the HTML spec addresses.
Exactly, which is why the import procedure specifies these interactions. If they were defined somewhere, I wouldn't have needed to specify them.

in the context of ePub widely accepted practice is to put each chapter in a separate HTML file.
I think you may have lost the jist of this discussion. ePubHub creates separate Xhtml files already.

The ePubHub import feature currently can import existing Xhtml files, which it stores in a separate "document" object which will get rendered during the ePub export function back into a separate Xhtml file. The existing ePubHub Xhtml import feature will also import several Xhtml files at once, again storing each into a separate "document" object.

In order to facilitate importing an entire book stored inside a single Xhtml file while maintaining it's structure, a specification for the use of divs to define chapters/parts/cover-pages was introduced.

By following this specification, a book stored as a single file will then be split into multiple "document" objects, which would be rendered as multiple Xhtml files in an ePub.


What DaleDe believes is that h tags can be used to define the structure of an entire book. Nothing in Html, Xhtml, ePub, Ncx, Opf, Daisy or any other standard that I have come across supports this belief. The ePub specification itself does not even use h tags for constructing the table of contents.

kovidgoyal
04-28-2010, 08:54 PM
In order to facilitate importing an entire book stored inside a single Xhtml file while maintaining it's structure, a specification for the use of divs to define chapters/parts/cover-pages was introduced.

By following this specification, a book stored as a single file will then be split into multiple "document" objects, which would be rendered as multiple Xhtml files in an ePub.

Why define a specification at all? Make it flexible enough to handle an arbitrary structure, via XPath. See how calibre does it for example.

awx
04-28-2010, 09:08 PM
Why define a specification at all? Make it flexible enough to handle an arbitrary structure, via XPath. See how calibre does it for example.
Please see the original post that started this discussion. It is stated that this is a temporary stop-gap until a proper Xhtml Import dialog where this can be configured is finished.

kovidgoyal
04-28-2010, 09:14 PM
Please see the original post that started this discussion. It is stated that this is a temporary stop-gap until a proper Xhtml Import dialog where this can be configured is finished.

Ah so your motivation for using divs is that it makes it trivial to code for, now I get it.

awx
04-28-2010, 09:18 PM
Ah so your motivation for using divs is that it makes it trivial to code for, now I get it.
That and it gives an unambiguous, standards-compliant means to specify an entire book in a single Xhtml file.

kovidgoyal
04-28-2010, 09:35 PM
That and it gives an unambiguous, standards-compliant means to specify an entire book in a single Xhtml file.

So do heading tags and they are going to be much more convenient for your end users. But hey, it's your project :)

awx
04-28-2010, 11:17 PM
So do heading tags and they are going to be much more convenient for your end users. But hey, it's your project :)
Thanks

DaleDe
04-29-2010, 11:08 AM
You may want to scroll up just a bit in the document you linked to and read this:
"The DIV and SPAN elements, in conjunction with the id and class attributes, offer a generic mechanism for adding structure to documents."

Followed by:
"Suppose, for example, that we wanted to generate an HTML document based on a database of client information. Since HTML does not include elements that identify objects such as "client", "telephone number", "email address", etc., we use DIV and SPAN to achieve the desired structural and presentational effects."

This is definitely what I'm after.

Sure, I can read that even when the font isn't huge. I understand using DIV and SPAN elements when needed for some things that cannot be done in the normal flow of things but to require them for this purpose is over the top IMHO.

Dale

awx
05-04-2010, 10:52 PM
A new version has been released. A list of errors is now shown on most objects, giving a short message about what is wrong. It is no longer permitted to export to ePub if any errors exist.

I've identified but not fixed a longstanding bug where seemingly random "NullReferenceExceptions" were being thrown during scrolling and deleting items. It has to do with the underlying Wpf sorting functionailty and how it interacts with the Navigation treeview.

awx
05-19-2010, 01:42 AM
New version released.

* Small bug fixes and performance improvements.
* Work has started on ePubHub's native file format, called .ephx. It's xml inside a zip and is listed in the Formats section of the UI.
* The native Wpf error checking is now used in some places in the UI. You will see a red outline around some fields which have missing or invalid data. The metadata section currently uses this.
* Additional rendering options for the Quotation <q> tag. It is now possible to specify if the <q> tag, quotation marks or both should be rendered. You can specify the characters used for primary quotes (top level) and secondary quotes (nested), such as curly quotes, double angled brackets, Swedish-style quotes and more.

awx
06-09-2010, 05:50 PM
A new version was released. A family emergency has prevented much work this week.

* New Image Page object added, for future support of comic books or any type of content where a single image is used as a page. It renders almost exactly like the existing Cover Page.
* Preliminary support for Ncx fallback chains, but not implemented in Gui yet. Initially this will be restricted to Jpg->Xhtml fallback chains. Fallbacks don't seem to be well supported on ADE/Sony Reader but perhaps if people use it the readers will support it in the future.
* New Audio object which currently renders as a link to an Mp3 file. Doesn't work in my Sony reader. Support for Ncx audio will be coming in the future.
* Open/Saving of native Ephx documents. This barely works so don't use it.
* More and improved icons.
* ClickOnce prerequisites set to .Net 4.0 Client. I had already done this but somehow the setting didn't take or was later lost.
* Improvements to Last used path/filename to better work with .Net 4.0.

awx
07-11-2010, 07:53 PM
New version released.
* I believe the long-standing exception that was thrown during scrolling is now fixed.
* Sorting has been improved for all items except stylesheets.
* Bug where exporting fonts, css, audio had the wrong default file extension is fixed.
* Bug fix for exception thrown while attempting to browse unavailable network shares.
* Css import will now try to load the Fontface fonts automatically if they are in the same directory as the Css file. Still only supports Otf files.
* During Xhtml import, a <div class="scene-split" /> will be changed into a native SceneSplit object. Any contents inside the div will be removed and the normal SceneSplit rendering will take over.

awx
08-01-2010, 03:16 PM
New version released with two minor features:
* GUI for documents (chapters, generic pages, etc.) has been cleaned up considerably.
* A "Show Errors" menu item added to the "Tools" menu. It simply collapses all items in the navigation pane except those with errors.

Edit: I wrote too soon about sorting improvements in the previous post. I must now revisit this again.

awx
09-14-2010, 04:30 PM
New version pushed out:
* Sorting problems should now be taken care of.
* Stylesheets are now properly sorted and support drag-and-drop editing.
* ePub filename constraints modified to more closely match the standard (upper and lowercase are now allowed but filenames are not case sensitive). Epubhub still restricts you to a-z with no accented characters allowed.

awx
10-15-2010, 02:50 AM
New version released.

Improved Pre support.
Improved Xhtml importer handling of whitespace.
Opf Spine Linear added.
Added drag and drop insertion adorner.
Added more icons.
Fixed problem importing consecutive special characters, such as &amp;.
Disabled note, sidebar controls. Still need to deal with Endnote and footnote.
Fixed problem with Xhtml import when several image tags had the same src url.
Some small performance improvements.
Removed span from Q tags when rendered as glyphs. May return as option.
Put in a hack to deal with exceptions thrown by ListCollectionView. Not sure if that will cause corruption in wpf internals.

I'm leaving for a holiday but when I return I plan to get a 1.0 release ready. 1.0 will include:

finishing up the saving/opening of Ephx format
improving the preview function.

After that, 1.1 should add:

ePub import
Adding support for other file types such as .gif, .ttf, etc.

awx
12-27-2010, 08:14 PM
New version released.

The Preview feature is much improved.
Images and css are displayed
Intra-book links should work.
Links to web pages are blocked, but potentially a css file could pull http background images in.
As before, IE is used for the preview so css support isn't great. Maybe IE9 will offer improved support sometime in the not-to-distant future.