Re: [CODE4LIB] An alternate presentation of Code4Lib Journal

2 views
Skip to first unread message

Jonathan Brinley

unread,
Dec 26, 2010, 7:21:27 AM12/26/10
to Code for Libraries, c4lj-d...@googlegroups.com
I'm not a big fan, but it does make me consider what it would take to
make an ePub version of each issue. Anyone have any
knowledge/experience related to HTML->ePub conversion?

Have a nice day,
Jonathan


On Fri, Dec 24, 2010 at 12:11 AM, Jonathan Rochkind <roch...@jhu.edu> wrote:
> I'm not sure, there are definitely some tricks there.
>
> But if you do come up with some CSS that works robustly (your rough cut demo is doing some odd things, cutting text off in the middle of paragraphs, putting scrollbars in the middle of the page, etc), we at the journal would probably be happy to incorporate it in the main site as an option, perhaps a link somewhere to toggle between a multi-narrow-column and single-column view. A bit of WordPress hacking involved there too perhaps to provide such CSS toggle functionality.
> ________________________________________
> From: Code for Libraries [CODE...@LISTSERV.ND.EDU] On Behalf Of Louis St-Amour [louiss...@GMAIL.COM]
> Sent: Thursday, December 23, 2010 10:23 PM
> To: CODE...@LISTSERV.ND.EDU
> Subject: [CODE4LIB] An alternate presentation of Code4Lib Journal
>
> Hey all,
>
> Having recently discovered Code4Lib Journal, I was fooling around with
> columns as ways of making articles more interesting to read, perhaps
> eventually on tablet devices:
>
> [image: AltPresentation.jpg]
>
> Works best in (and in fact only tested on) Google Chrome on an iMac, but you
> can try it out for yourself at http://lsta.me/code4lib/ ... all I've done is
> mirrored the journal site and added some styles to the bottom of the
> WordPress theme's CSS file. In theory you could apply such styles via a web
> browser extension or user stylesheet to the website itself, live. But I
> wouldn't recommend it without further testing and tweaks.
>
> My main goal was to see if columns improved the reading experience on an
> iPad, and the answer is definitely a "yes," because while I set the columns
> too small, you still get a sense of where you are overall and can see
> farther ahead with columns than when you zoom in on a single column webpage.
> The trouble with automatic columns, however, are defining when the automatic
> columns should break. So far, it's perhaps more trouble than it's worth in
> CSS, but with any luck that might change 10 years from now.
>
> It's funny how tablets in particular break our notions of page -- on
> tablets, we want essentially resizable and reflowing text columns but with
> fixed and pretty "page" layouts that we can navigate through. Consider
> magazines on the iPad -- sometimes we want the pretty text and images, but
> other times we want just text alone, or just images alone. And yet that
> means coming up with natural ways to zoom in on text and images without
> making the text unreadable or images blurry. It should be possible, but as
> far as I know, no one's done it right, yet. Either it's a Kindle-style text
> experience, or a magazine-style Image experience. I wonder who will mix the
> two together, first? Inkling almost gets it right with textbook content, but
> often feels like it's wasting space with its one-column infinite scroll
> approach. Which brings me back to my original point, I think columns and
> grids are crucial for helping people see more info at once.
>
> Anyone else have any thoughts on this? I was thinking about turning the
> Journal into an iPad/tablet app, given its Creative Commons license, but I
> now suspect given my interest in columns, that I'd be laying it out in
> InDesign first, like a real magazine, which might be too much work.
>
>
> Louis.
>

--
Jonathan M. Brinley

jonatha...@gmail.com
http://xplus3.net/

Louis St-Amour

unread,
Jan 4, 2011, 3:45:47 PM1/4/11
to Code4Lib Journal-discuss
After enough hints, I finally found this mailing list. ;-) What
follows is my original post from the main Code4Lib discussion list,
and some newer comments at the bottom.

-------------------------------------------

I've made epub versions (automatically) of issues 1 through 12. Right
after epub was first mentioned, I starting considering how I'd go
about converting the site to an epub package. Of course the holidays
intervened, but given it's Jan 2, I put some spare time towards it et
voila!

Download a first draft of the journal in epub here:
https://github.com/LouisStAmour/journal2epub/downloads

Site maintainers may be interested in the error logs. Look for lines
saying "referenced resource missing in package". Sometimes it's my
fault (e.g. an absolute image reference I missed in 3.epub) and
sometimes it's a typo (e.g. a link to drupal.org that actually points
to <a href= in an issue 12 reference). Before posting these epub files
live on the site, we should run through the logs to fix things,
perhaps hand-tweak and recompile the HTML as epub, make sure images
are sized correctly on non-iBooks readers (e.g. my Sony Reader),
perhaps add cover art, copyright & table of contents with abstracts.

Source code is mostly one file (it hasn't been refactored), under MIT
license (from Expat):
https://github.com/LouisStAmour/journal2epub/blob/master/journal2epub.rb

-------------------------------------------

As to XHTML fixes, partly the problem lies in the strict nature of
XHTML 1.1 -- it doesn't like <pre> tags having lang="" attributes,
etc. Somehow I'd also end up with nested <pre> tags. These things
might not easily be fixed as HTML, or even XHTML, is more forgiving
than XHTML 1.1. Some things, like target attributes on links, were
removed in XHTML because they were thought to be presentational, but
that mistake was corrected in HTML5 which restores the target
attribute to its rightful semantic place. Swapping the site to HTML5
is another discussion entirely.

There are, however, some typos easily corrected, as a quick grep
reveals. Ignoring the /media/ relative URLs, the list is as follows:

$ grep -Ri 'referenced resource missing' *.log | grep -iv '//media/'
12.log:ERROR: 12.epub/OEBPS/post-4578.xhtml(120): 'OEBPS/<a href=':
referenced resource missing in the package
12.log:ERROR: 12.epub/OEBPS/post-4642.xhtml(70): 'OEBPS/
libraries.ucsd.edu/m': referenced resource missing in the package
2.log:ERROR: 2.epub/OEBPS/post-47.xhtml(96): 'OEBPS/del.icio.us':
referenced resource missing in the package
4.log:ERROR: 4.epub/OEBPS/post-109.xhtml(36): 'OEBPS/h': referenced
resource missing in the package
6.log:ERROR: 6.epub/OEBPS/post-1218.xhtml(245): 'OEBPS/chrome://libx/
skin/article_linker.gif': referenced resource missing in the package
6.log:ERROR: 6.epub/OEBPS/post-1218.xhtml(249): 'OEBPS/chrome://libx/
skin/article_linker.gif': referenced resource missing in the package

To parse this out, the first number, e.g. 12.log, is the issue number.
The filename that follows then contains post-##.xhtml, where the ## is
the post ID in Wordpress. So the first line refers to a link like <a
href="<a href="> while the second refers to a missing http:// -- an
absolute link that was accidentally relative. If you haven't caught on
yet, the OEBPS/ part is automatically added to whatever was in the
link, and then epubcheck looks for a file of that name and reports an
error if not found. The last two, from issue 6, might have been honest
attempts at querying Firefox for whether libx is installed or not --
such attempts now fail and chrome URLs will not work in public pages
anymore, for security/privacy reasons.

Anyway, this script, and the resulting epubs could be improved
further, perhaps with a cover image for each issue, outputting HTML
table of contents with abstracts in addition to the ePub table of
contents, and perhaps further formatting of author names or issue
headings, maybe links to skip references and footnotes and move on to
the next article. Oh and of course I have to handle relative URLs for
media rather than just absolute ones. E.g. know how to download images
from a "/media/" URL. All these changes are easy enough to do if you'd
like to use the script in production. Without too much effort, a
similar script could produce PDF files from "printing" the HTML via
something like Safari, in an automated fashion, or perhaps use a
rendering engine like Prince. Sadly, both methods don't produce
accessible PDFs, and you'd probably get better results if you could
convert everything to LaTeX instead. Anthologize's TEI is new to me,
but might also be interesting to check out, long term.


Louis St-Amour
York University Digital Media BA student & Osgoode Hall Law School
student webmonkey
http://www.lsta.me/ or on Twitter, @4Lou

On Dec 26 2010, 7:21 am, Jonathan Brinley <jonathanbrin...@gmail.com>
wrote:
> I'm not a big fan, but it does make me consider what it would take to
> make an ePub version of each issue. Anyone have any
> knowledge/experience related to HTML->ePub conversion?
>
> Have a nice day,
> Jonathan
>
>
>
>
>
>
>
>
>
> On Fri, Dec 24, 2010 at 12:11 AM, Jonathan Rochkind <rochk...@jhu.edu> wrote:
> > I'm not sure, there are definitely some tricks there.
>
> > But if you do come up with some CSS that works robustly (your rough cut demo is doing some odd things, cutting text off in the middle of paragraphs, putting scrollbars in the middle of the page, etc), we at the journal would probably be happy to incorporate it in the main site as an option, perhaps a link somewhere to toggle between a multi-narrow-column and single-column view. A bit of WordPress hacking involved there too perhaps to provide such CSS toggle functionality.
> > ________________________________________
> > From: Code for Libraries [CODE4...@LISTSERV.ND.EDU] On Behalf Of Louis St-Amour [louisstam...@GMAIL.COM]
> > Sent: Thursday, December 23, 2010 10:23 PM
> > To: CODE4...@LISTSERV.ND.EDU
> > Subject: [CODE4LIB] An alternate presentation of Code4Lib Journal
>
> > Hey all,
>
> > Having recently discovered Code4Lib Journal, I was fooling around with
> > columns as ways of making articles more interesting to read, perhaps
> > eventually on tablet devices:
>
> > [image: AltPresentation.jpg]
>
> > Works best in (and in fact only tested on) Google Chrome on an iMac, but you
> > can try it out for yourself athttp://lsta.me/code4lib/... all I've done is
> jonathanbrin...@gmail.comhttp://xplus3.net/
Reply all
Reply to author
Forward
0 new messages