View Full Version : Display Code and animation

08-08-2012, 01:46 PM
I was looking for a code structure or way to actually display code in a epub. What tags do you use?? I was also curious about adding JavaScript or jQuery. I havent looked into animation within an epub but I would like to know a direction. Might give it a shot.

08-08-2012, 03:16 PM
It is a subset of xhtml, so I wonder what you mean with code.
Javascript and alike are not supported in ePUB 2. It is in version 3, but that is not widely supported.

08-08-2012, 03:47 PM
well if you are building a book on code and need to display code, for example here you would use bracket code bracket bracket / code bracket to display the code. I was trying to figure out what syntax for epub 3.0 that runs with HTML 5 and CSS 3.0 from what I've read that will allow you to display code instead of running the code. Hope this is better explaining.

08-09-2012, 05:56 AM
You have to do it yourself. Instead of < and >, you have to write &lt; and &gt;. For the background, alignment, monospace font, etc., use CSS as usual.

08-09-2012, 08:02 AM
Or you can just use images.

08-09-2012, 11:30 AM
Or you can just use images.

ya but that would possibly in the end make the book larger than needed. I would test out some ideas and post back.