Today Was an Interesting Day

I wrote a manifesto because of a bunch of stuff that’s been building up. It’s still a bit disorganized and scattered, but hey. Over there on the left where I list my blog pages, I added a page on technology, my manifesto is there.

In other news, today I worked on a project I’ve been meaning to get to for some time, which is using the DocBook schema for my publishing process. Basically, DocBook is a framework that will take xml input and transform it into multiple formats: html, ePub, pdf, etc. One source file. Multiple versions.

Once I realized that WordPerfect X6 does a decent job publishing to xml, I knew I had to do this.

For those of you who work in Word, you should be able to do pretty much the same thing. I believe you can change .docx to .xml and you end up with Word’s xml.

Setting it up is not for the faint of heart, I’d say. If you understand html and xml, the steps are fairly straightforward. It wasn’t half as hard as I feared. The upshot is that in about 4 hours, I’d successfully installed the required applications and created a complete html5 version of my source document. About 20 minutes later I had an ePub.

Generating the ePub took 4 seconds.

This is worthy of repeating. I dropped my xml file into the input folder and 4 seconds after I told it to create my ePub, I had an ePub that opened in Sigil.

But I ended up with an ePub that opened in Sigil and that applied ALL my base css.

Next Steps

I didn’t spend any time on the parts that will prettify my ePub. But I did swap my own css stylesheet sheet for theirs, and it worked. My guess on how to make the cover show up was right on.

But here’s the thing. Even if I never do any better than this, I just cut my time to go from Final Word Processor version to ePub from about 5 hours to 4 seconds.

I’m guessing it would take me about 30 minutes to manually apply my special formatting to the ePub I generated. But I should be able to tweak the xslt and xml file to deal with this.

Take a look at the output below. It’s obvious that I can add my typical and customary front and back matter to my source file. And it’s equally obvious that when I create my final document, I could merge in the different files I need for vendors. But I may not have to do this. DocBook has functions that should do this for me.

The couple of errors are probably related to some html or css entities I didn’t remove from my xml. Easy enough to track down those errors.

The last one is easy, too. I didn’t copy the ePub validation jar file to my workspace. Trivial to fix.

Buildfile: /Users/clj/Documents/workspace/TheSpare.docbook.first/buildepubhtml.xml
[delete] Deleting directory /Users/clj/Documents/workspace/TheSpare.docbook.first/output
[mkdir] Created dir: /Users/clj/Documents/workspace/TheSpare.docbook.first/output
[mkdir] Created dir: /Users/clj/Documents/workspace/TheSpare.docbook.first/output/tmp
[copy] Copying 1 file to /Users/clj/Documents/workspace/TheSpare.docbook.first/output/tmp
[copy] Copying 1 file to /Users/clj/Documents/workspace/TheSpare.docbook.first/output/tmp/OEBPS/images
[xslt] Transforming into /Users/clj/Documents/workspace/TheSpare.docbook.first/output/tmp
[xslt] Processing /Users/clj/Documents/workspace/TheSpare.docbook.first/input/Jewel_TheSpare.xml to /Users/clj/Documents/workspace/TheSpare.docbook.first/output/tmp/Jewel_TheSpare.html
[xslt] Loading stylesheet /Users/clj/Documents/workspace/TheSpare.docbook.first/docbook-xsl/epub/docbook.xsl
[xslt] Writing OEBPS/bk01-toc.html for book
[xslt] Writing OEBPS/ch01.html for chapter
[xslt] Writing OEBPS/ch02.html for chapter
[xslt] Writing OEBPS/ch03.html for chapter
[xslt] Writing OEBPS/ch04.html for chapter
[xslt] Writing OEBPS/ch05.html for chapter
[xslt] Writing OEBPS/ch06.html for chapter
[xslt] Writing OEBPS/ch07.html for chapter
[xslt] Writing OEBPS/ch08.html for chapter
[xslt] Writing OEBPS/ch09.html for chapter
[xslt] Writing OEBPS/ch10.html for chapter
[xslt] Writing OEBPS/ch11.html for chapter
[xslt] Writing OEBPS/ch12.html for chapter
[xslt] Writing OEBPS/ch13.html for chapter
[xslt] Writing OEBPS/ch14.html for chapter
[xslt] Writing OEBPS/ch15.html for chapter
[xslt] Writing OEBPS/ch16.html for chapter
[xslt] Writing OEBPS/ch17.html for chapter
[xslt] Writing OEBPS/ch18.html for chapter
[xslt] Writing OEBPS/ch19.html for chapter
[xslt] Writing OEBPS/ch20.html for chapter
[xslt] Writing OEBPS/ch21.html for chapter
[xslt] Writing OEBPS/ch22.html for chapter
[xslt] Writing OEBPS/ch23.html for chapter
[xslt] Writing OEBPS/ch24.html for chapter
[xslt] Writing OEBPS/ch25.html for chapter
[xslt] Writing OEBPS/ch26.html for chapter
[xslt] Writing OEBPS/ch27.html for chapter
[xslt] Writing OEBPS/ch28.html for chapter
[xslt] Writing OEBPS/ch29.html for chapter
[xslt] Writing OEBPS/ch30.html for chapter
[xslt] Writing OEBPS/ch31.html for chapter
[xslt] Writing OEBPS/ch32.html for chapter
[xslt] Writing OEBPS/ch33.html for chapter
[xslt] Writing OEBPS/index.html for book
[xslt] Writing OEBPS/toc.ncx
[xslt] : Warning! Non-text output nodes are ignored when writing an attribute, comment, or PI
[xslt] /Users/clj/Documents/workspace/TheSpare.docbook.first/docbook-xsl/xhtml-1_1/inline.xsl:213: Warning! Cannot write an attribute node when no element start tag is open
[xslt] : Warning! Non-text output nodes are ignored when writing an attribute, comment, or PI
[xslt] /Users/clj/Documents/workspace/TheSpare.docbook.first/docbook-xsl/xhtml-1_1/inline.xsl:213: Warning! Cannot write an attribute node when no element start tag is open
[xslt] Writing OEBPS/content.opf
[xslt] Writing META-INF/container.xml
[copy] Copying 37 files to /Users/clj/Documents/workspace/TheSpare.docbook.first/output/tmp/OEBPS
[copy] Copying 1 file to /Users/clj/Documents/workspace/TheSpare.docbook.first/output/tmp/META-INF
[echo] Generating book.epub
[zip] Building zip: /Users/clj/Documents/workspace/TheSpare.docbook.first/output/temp.mimetype
[zip] Building zip: /Users/clj/Documents/workspace/TheSpare.docbook.first/output/
[zip] Building zip: /Users/clj/Documents/workspace/TheSpare.docbook.first/output/book.epub
[delete] Deleting directory /Users/clj/Documents/workspace/TheSpare.docbook.first/OEBPS
[delete] Deleting directory /Users/clj/Documents/workspace/TheSpare.docbook.first/META-INF
[java] Unable to access jarfile /Users/clj/Documents/workspace/TheSpare.docbook.first/lib/epubcheck/epubcheck-1.2.jar
[java] Java Result: 1
Total time: 4 seconds


Tags: ,

Warning: Use of undefined constant ‘alt_comment_login’ - assumed '‘alt_comment_login’' (this will throw an Error in a future version of PHP) in /home/carogwll/public_html/wordpress/wp-content/themes/cj-custom/comments.php on line 20

Comments are closed.