開放源碼電子書與EPUB幕後排版

8,233 views

Published on

http://blog.lyhdev.com/2011/12/epub.html

Published in: Technology, Business
0 Comments
7 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
8,233
On SlideShare
0
From Embeds
0
Number of Embeds
3,635
Actions
Shares
0
Downloads
48
Comments
0
Likes
7
Embeds 0
No embeds

No notes for slide

開放源碼電子書與EPUB幕後排版

  1. 1. ePUB /
  2. 2. WhoLabStartupa Passionate Programmer lyhcode@gmail.com
  3. 3. Work e PLWeb , http://plweb.org/
  4. 4. Java , http://java.plweb.org/
  5. 5. Source Code
  6. 6. if (pci_read_config_byte(pdev, ET1310_PCI_EEPROM_STATUS, &eestatus)) { dev_err(&pdev->dev, "Could not read PCI config space for EEPROM Statusn"); return -EIO;}/* Determine if the error(s) we care about are present. If they are * present we need to fail. */if (eestatus & 0x4C) { int write_failed = 0; if (pdev->revision == 0x01) { int i; static const u8 eedata[4] = { 0xFE, 0x13, 0x10, 0xFF }; /* Re-write the first 4 bytes if we have an eeprom * present and the revision id is 1, this fixes the * corruption seen with 1310 B Silicon */ for (i = 0; i < 3; i++) if (eeprom_write(adapter, i, eedata[i]) < 0) write_failed = 1; } if (pdev->revision != 0x01 || write_failed) { dev_err(&pdev->dev, "Fatal EEPROM Status Error - 0x%04xn", eestatus); /* This error could mean that there was an error * reading the eeprom or that the eeprom doesnt exist. * We will treat each case the same and not try to * gather additional information that normally would * come from the eeprom, like MAC Address */ adapter->has_eeprom = 0; return -EIO; }
  7. 7. JavaJDKJar Java, http://java.com/
  8. 8. HTML5 CSS3 JavaScript Appcelerator Titanium Mobile AppAppcelerator Titanium, http://www.appcelerator.com/
  9. 9. Write once, run anywhere
  10. 10. $ make os=MACOSX$ make os=LINUX$ make os=WINDOWS$ make os=SOLARIS$ make deploy$ make money
  11. 11. SourceTree, http://www.sourcetreeapp.com/
  12. 12. <?xml version="1.0"?><package version="2.0" xmlns="http://www.idpf.org/2007/opf" unique-identifier="BookId"><metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf"> <dc:title>Pride and Prejudice</dc:title> <dc:language>en</dc:language> <dc:identifier id="BookId" opf:scheme="ISBN">123456789X</dc:identifier> <dc:creator opf:file-as="Austen, Jane" opf:role="aut">Jane Austen</dc:creator></metadata><manifest> <item id="chapter1" href="chapter1.xhtml" media-type="application/xhtml+xml"/> <item id="stylesheet" href="style.css" media-type="text/css"/> <item id="ch1-pic" href="ch1-pic.png" media-type="image/png"/> <item id="myfont" href="css/myfont.otf" media-type="application/x-font-opentype"/> <item id="ncx" href="book.ncx" media-type="application/x-dtbncx+xml"/></manifest><spine toc="ncx"> <itemref idref="chapter1" /></spine><guide> <reference type="loi" title="List Of Illustrations" href="appendix.html#figures" /></guide></package>
  13. 13. <body> <div class="chapter" title="Chapter&nbsp;1.&nbsp;What Is EPUB 3?"> <div class="titlepage"> <h1 class="title"><a id="what_is_epub_3_question"></a>What Is EPUB 3?</h1> </div> <div class="sect1" title="EPUB 3 in a Nutshell"> <div class="titlepage"> <h1 class="title"><a id="epub_3_in_a_nutshell"></a>EPUB 3 in a Nutshell</h1> </div> <p>So what exactly is an EPUB? If you follow electronic publishing at all, you’veundoubtedly run into the term, but you may have seen or heard it incorrectly being usedas a synonym for “ebook”&mdash;as a shorthand for talking about <spanclass="emphasis"><em>electronic</em></span> <span class="emphasis"><em>books</em></span>. Although the two terms share a common relation in electronic bookproduction, they aren’t interchangeable. EPUB, as we’re here to discover, is a <spanclass="emphasis"><em>format</em></span> for representing documents in electronicform. “Ebook,” on the other hand, is just an abstract term used to encompass anyelectronic representation of a book, and includes formats such as PDF, HTML, ASCIItext, Word, and a host of others, in addition to EPUB.</p> O’Reilly, What Is EPUB 3 ?, http://goo.gl/X51CK
  14. 14. Sigil, http://code.google.com/p/sigil/
  15. 15. ? ?eBooks TXT, EPUB, MOBI, PDF, CHM, ...
  16. 16. Write once, read anywhere
  17. 17. $ make type=EPUB$ make type=EPUB3$ make type=MOBI$ make type=KF8 $ make publish$ make type=PDF $ make money$ make type=HTML$ make type=CHM$ make type=TXT
  18. 18. v.s. <h1>What is EPUB?</h1> <p>The most widely accepted format for ebooks today is EPUB, which is developed and maintained by the IDPF. You can find the official specification ...Elizabeth Castro, EPUB Straight to the Point
  19. 19. <h1>What is EPUB?</h1> What is EPUB?(Heading) What is EPUB? What is EPUB?
  20. 20. What is EPUB?============The most widely accepted **format** for ebooks today isEPUB, which is developed and maintained by the IDPF.Ebook Formats---------------* epub* pdf* mobi* html WYSIWYG Plain Text
  21. 21. Chapter 1. What Is EPUB 3?======================EPUB 3 in a Nutshell-----------------------------So what exactly is an EPUB? If you follow electronicpublishing at all, youʼve undoubtedly run into the term, but youmay have seen or heard it incorrectly being used as asynonym for “ebook” -- as a shorthand for talking about**electronic books**. Although the two terms share a commonrelation in electronic book production, they arenʼtinterchangeable. Sigil
  22. 22. Chapter 1. What Is EPUB 3?======================EPUB 3 in a Nutshell-----------------------------So what exactly is an EPUB? If you follow electronicpublishing at all, youʼve undoubtedly run into the term, but youmay have seen or heard it incorrectly being used as asynonym for “ebook” -- as a shorthand for talking about**electronic books**. Although the two terms share a commonrelation in electronic book production, they arenʼtinterchangeable. ?
  23. 23. 19892010
  24. 24. Chapter 1. What Is EPUB 3?==========================EPUB 3 in a Nutshell--------------------So what exactly is an EPUB? If you follow electronicpublishing at all, you’ve undoubtedly run into the term,but you may have seen or heard it incorrectly being usedas a synonym for “ebook” -- as a shorthand for talkingabout **electronic books**. Although the two terms sharea common relation in electronic book production, theyaren’t interchangeable. Chapter 1. What Is EPUB 3? ====================== EPUB 3 in a Nutshell ----------------------------- So what exactly is an EPUB? If you follow electronic publishing at all, youʼve undoubtedly run into the term, but you may have seen or heard it incorrectly being used as a synonym for “ebook” -- as a shorthand for talking about **electronic books**. Although the two terms share a common relation in electronic book production, they arenʼt interchangeable.
  25. 25. MarkdownSyntax + SoftwareText-to-HTMLeasy-to-readeasy-to-write http://daringfireball.net/projects/markdown/
  26. 26. notepag.es
  27. 27. <h1> </h1>========== <h2> </h2>------------ Markdown http://markdown.tw/ , http://goo.gl/0pBEy
  28. 28. > <blockquote>>>> </blockquote> http://markdown.tw/ , http://ce.fhl.net/desert/
  29. 29. <p> </p> <ol> <li> </li>* <li> </li>* <li> </li>* <li> </li>* <li> </li> </ol> <p> </p> <ul>1. ! <li> </li>2. ! <li> </li>3. <li> </li>4. <li> </li>5. </ul> http://markdown.tw/
  30. 30. ** <p> <strong> </** * * *** strong> <em> </em> <strong> *** <em> </em></strong> </p> <p> </p> Markdown http://markdown.tw/ , http://goo.gl/0pBEy
  31. 31. ![Cover](/path/to/img.jpg)[Plurk](http://plurk.com/)
  32. 32. mouapp.com
  33. 33. Chapter 1. What Is EPUB 3? ======================Markdown EPUB 3 in a Nutshell ----------------------------- ? So what exactly is an EPUB? If you follow electronic publishing at all,eBooks TXT, EPUB, MOBI, PDF, CHM, ...
  34. 34. +
  35. 35. Pandoc a universal document converter pandoc -f markdown -t epub source.txt -o target.epubChapter 1. What Is EPUB 3?======================EPUB 3 in a Nutshell-----------------------------So what exactly is an EPUB? If youfollow electronic publishing at all, Pandoc, http://johnmacfarlane.net/pandoc/
  36. 36. Pandoc a universal document converterpandoc -f markdown -t epub source.txt -o target.epubpandoc -f markdown -t html source.txt -o target.htmlpandoc -f markdown -t latex source.txt -o target.texxelatex target.tex Pandoc, http://johnmacfarlane.net/pandoc/
  37. 37. ePUB Markdown
  38. 38. LeanpubPublish Early, Publish Often http://leanpub.com/
  39. 39. Book as a Service Service
  40. 40. ! plain t ! plain ext pla in text text plain t ext pla plain in text ! text plain text RSS plain text plain xttext ext te t n p l a i n ext plai t e x t plain t p l a i n in text pla ...ContinuousPublishing
  41. 41. ContpubContinuous Publishingcontpub.org
  42. 42. Contpub http://contpub.org/
  43. 43. Contpub http://contpub.org/
  44. 44. Contpub http://contpub.org/
  45. 45. Dont Reinvent The Wheel http://sphinx.pocoo.org/ http://docutils.sourceforge.net/rst.html http://www.latex-project.org/ http://xmlgraphics.apache.org/fop/ http://www.tug.org/texlive/
  46. 46. But... ? EPUB3?
  47. 47. Open source projectssphinx-cooksphinx-themesSimaQianCaiLun http://github.com/contpub
  48. 48. The End

×