Forum Feature requests

HTML5 support

carl johnson
I was playing with prince to see how its HTML5 support is, and I got the following result:

$ prince html5.html 
prince: html5.html:81: error: Tag header invalid
prince: html5.html:87: error: Tag section invalid
prince: html5.html:98: error: Tag section invalid
prince: html5.html:103: error: Tag aside invalid
prince: html5.html:106: error: Tag footer invalid


The actual PDF that prince made seemed fine though. So, it seems like a) those “errors” should be called warnings if they don’t cause the file to stop processing b) in any event, it would be nice if prince supported the new HTML5 tags without any errors or warnings.

Incidentally, I’m excited to start using the aside tag for prince footnotes. Right now, I’m using cite, which I know is completely wrong, but I couldn’t think of any more ‘semantic’ option. I could just use a span, I guess, but that’s no fun. ;-) Anyway, it’s a little bit ridiculous that HTML/CSS still don’t have a good option for footnotes baked in. It’s nice that prince is pushing things forward a little bit with “display: prince-column-footnote”.
mikeday
Right, the HTML parser that we are using needs updating! :)

By the way, the footnote values have moved to the float property instead of the display property, for consistency with the latest CSS specifications. However, we still support them on the display property as well, for backwards compatibility.
carl johnson
Thanks for the tip. I’ll check the docs.

Any timeline for when the parser can be updated? 7.1? 7.2?
mikeday
No timeline yet, we'll need to coordinate with the libxml project.
jon_sorenson
I just downloaded an eval copy of 8.1r5 today to see how Prince might work for our HTML->PDF needs. I'm seeing the same errors

prince: ../pre-report.html:483: error: Tag header invalid
prince: ../pre-report.html:529: error: Tag section invalid

etc...

I take it the parser hasn't been updated. It seems like we'll have to avoid styling on these elements (which we currently use) if we'd like to use PrinceXML?
mikeday
Actually those elements will still work, the old parser just complains about them.

We have written a new HTML5 parser, which you can enable by passing "-i html5" on the command-line, or setInputType("html5") if you are using a server wrapper. This new parser will be enabled by default in a future release of Prince.