HTML5_for_Publishers.pdf

(8163 KB) Pobierz
An Introduction
HTML5 for
Publishers
Sanders Kleinfeld
rs L
ve hM
Co at
so M
Al and
G
SV
HTML5 for Publishers
Sanders Kleinfeld
HTML5 for Publishers
by Sanders Kleinfeld
Copyright © 2011 O’Reilly Media. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are
also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/
institutional sales department: (800) 998-9938 or
corporate@oreilly.com.
Editor:
Kathleen Meyer
October 2011:
First Edition
Cover Designer:
Karen Montgomery
Interior Designer:
David Futato
Revision History for the First Edition:
2011-10-06
2011-10-18
2011-12-14
2012-01-17
2013-01-23
First release
Second release
Third release
Fourth release
Fifth release
See
http://oreilly.com/catalog/errata.csp?isbn=9781449314613
for release details.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly
Media, Inc.
HTML5 for Publishers,
the image of a meerkat, and related trade dress are trademarks of O’Reilly
Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark
claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and authors assume
no responsibility for errors or omissions, or for damages resulting from the use of the information contained
herein.
ISBN: 978-1-449-31461-3
[LSI]
Table of Contents
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
1. Canvas for Publishers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Drawing on your <canvas>
Canvas Graphing Calculator
Canvas Finger Painting
HTML5 Canvas, EPUB, and Ereader compatibility
Bibliography/Additional HTML5 Canvas Resources
1
5
12
18
20
24
29
31
33
34
38
39
40
41
43
44
48
53
53
57
2. Geolocation for Publishers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
A Geolocated Tale
HTML5 Geolocation, EPUB, and Ereader Compatibility
Bibliography/Additional Resources
3. <audio>/<video> for Publishers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
A Two-Minute Introduction to the <audio> and <video> Elements
An Audio-Enabled Glossary
An HTML5 Video About HTML5 Canvas
EPUB 3 Media Overlays
HTML5 Audio/Video Compatibility in the Browser and Ereaders
Bibliography/Additional Resources
4. MathML for Publishers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
A Fifteen-Minute Introduction to MathML
Presentation MathML
Putting It All Together: Constructing the Quadratic Formula in MathML
MathML Comes Alive: An Interactive Quadratic Equation Solver
Constructing the Equation Solver in HTML
Styling the Equation Solver with CSS
iii
Scripting the Equation Solver with JavaScript
MathML Browser and Ereader Compatibility
Bibliography/Additional MathML resources
A Ten-Minute Introduction to SVG
An SVG “Smiley”
An SVG Coloring Book
Constructing the Coloring Book HTML
Constructing the Coloring Book JavaScript
SVG, EPUB, and Ereader Compatibility
Bibliography/Additional SVG Resources
Alternatives to HTML5 and EPUB
HTML5 and Mobi
HTML5 and Ebook Apps
HTML5 and iBooks Author
Additional Resources
61
75
77
79
84
86
91
95
100
102
104
104
105
105
105
5. SVG for Publishers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
6. Embedding HTML5 in EPUB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
iv
|
Table of Contents
Zgłoś jeśli naruszono regulamin