Upload
kyle-lin
View
7.663
Download
0
Embed Size (px)
DESCRIPTION
http://blog.lyhdev.com/2011/12/epub.html
Citation preview
淺談開放源碼電子書與 ePUB 幕後排版
林彥宏 / 思創軟體
Who
Lab 雲林科技大學 程式語言教學實驗室
Startup 思創軟體
a Passionate Programmer
原始碼Source Code
*/ if (pci_read_config_byte(pdev, ET1310_PCI_EEPROM_STATUS, &eestatus)) { dev_err(&pdev->dev, "Could not read PCI config space for EEPROM Status\n"); 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%04x\n", eestatus);
/* This error could mean that there was an error * reading the eeprom or that the eeprom doesn't 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; } }
軟體的原始碼
原始碼
編譯
軟體
HTML5CSS3
JavaScript
AppceleratorTitanium
MobileApp
圖片來源:Appcelerator Titanium, http://www.appcelerator.com/
Write once, run anywhere
軟體源碼:自動化$ make os=MACOSX
$ make os=LINUX
$ make os=WINDOWS
$ make os=SOLARIS
$ make deploy
$ make money
軟體源碼:版本控制
畫面擷取自軟體:SourceTree, http://www.sourcetreeapp.com/
<?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>
電子書的原始碼
<body> <div class="chapter" title="Chapter 1. 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’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 <span class="emphasis"><em>electronic</em></span> <span class="emphasis"><em>books</em></span>. Although the two terms share a common relation in electronic book production, they aren’t interchangeable. EPUB, as we’re here to discover, is a <span class="emphasis"><em>format</em></span> for representing documents in electronic form. “Ebook,” on the other hand, is just an abstract term used to encompass any electronic representation of a book, and includes formats such as PDF, HTML, ASCII text, Word, and a host of others, in addition to EPUB.</p>
電子書示範內容資料來源:O’Reilly, What Is EPUB 3 ?, http://goo.gl/X51CK
畫面來源:Sigil, http://code.google.com/p/sigil/
原始碼
編譯
電子書
?
?
eBooks
TXT, EPUB, MOBI, PDF, CHM, ...
Write once, read anywhere
$ make type=EPUB
$ make type=EPUB3
$ make type=MOBI
$ make type=KF8
$ make type=PDF
$ make type=HTML
$ make type=CHM
$ make type=TXT
電子書源碼:自動化
$ make publish
$ make money
電子書源碼:版本控制
我走了,
我揮揮手,
掰掰。
我走了,
正如我來;
我揮揮招手,
掰掰告別西天的雲彩。
輕輕的我走了,
正如我輕輕的來;
我輕輕的招手,
告作別西天的雲彩。
參考資料:徐志摩,再別康橋
排版 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
<h1>What is EPUB?</h1>What is EPUB?(Heading)
What is EPUB?What is EPUB?What is EPUB?What is EPUB?What is EPUB?
What is EPUB?============
The most widely accepted **format** for ebooks today is EPUB, which is developed and maintained by the IDPF.
Ebook Formats---------------
* epub* pdf* mobi* html
WYSIWYG Plain Text
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.
記事本
Sigil
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.
記事本
?
1989
2010
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.
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.
Markdown
Syntax + Software
Text-to-HTML
easy-to-read
easy-to-write
參考資料:http://daringfireball.net/projects/markdown/
notepag.es
語法:標題認識電子書==========
<h1>認識電子書</h1>
電子書的定義------------
<h2>電子書的定義</h2>
參考資料: Markdown 語法說明 http://markdown.tw/ , 電子書的定義 http://goo.gl/0pBEy
語法:引言
參考資料: http://markdown.tw/ , 荒漠甘泉 http://ce.fhl.net/desert/
> 因我們行事為人、> 是憑著信心、> 不是憑著眼見。> (哥林多後書)
<blockquote>因我們行事為人、是憑著信心、不是憑著眼見。(哥林多後書)</blockquote>
語法:清單
參考資料: http://markdown.tw/
便當:
* 排骨飯* 雞腿飯* 豬腳飯* 燒肉飯
新書排行榜
1. 賈伯斯傳!2. 華頓商學院最受歡迎的談判課!3. 洋蔥炒蛋到小英便當4. 吾命騎士5. 黑心房仲的告白
<p>訂便當:</p><ul><li>排骨飯</li><li>雞腿飯</li><li>豬腳飯</li><li>燒肉飯</li></ul>
<p>新書排行榜</p><ol><li>賈伯斯傳</li><li>華頓商學院最受歡迎的談判課</li><li>洋蔥炒蛋到小英便當</li><li>吾命騎士</li><li>黑心房仲的告白</li></ol>
語法:段落文字這是段落文字,包括**粗體**、*斜體*、***又粗又斜體***。
這是第二段落文字。
參考資料: Markdown 語法說明 http://markdown.tw/ , 電子書的定義 http://goo.gl/0pBEy
<p>這是段落文字,包括<strong>粗體</strong>、<em>斜體</em>、<strong><em>又粗又斜體</em></strong>。</p><p>這是第二段落文字。</p>
語法:其他
![Cover](/path/to/img.jpg)
[Plurk](http://plurk.com/)
圖片
超連結
mouapp.com
原始碼
編譯
電子書
?eBooks
TXT, EPUB, MOBI, PDF, CHM, ...
Chapter 1. What Is EPUB 3?======================
EPUB 3 in a Nutshell-----------------------------
So what exactly is an EPUB? If you follow electronic publishing at all,
Markdown
+
Pandoc a universal document converter
pandoc -f markdown -t epub source.txt -o target.epub
Chapter 1. What Is EPUB 3?======================
EPUB 3 in a Nutshell-----------------------------
So what exactly is an EPUB? If you follow electronic publishing at all,
Pandoc, http://johnmacfarlane.net/pandoc/
Pandoc a universal document converter
pandoc -f markdown -t epub source.txt -o target.epub
Pandoc, http://johnmacfarlane.net/pandoc/
pandoc -f markdown -t html source.txt -o target.html
pandoc -f markdown -t latex source.txt -o target.tex
xelatex target.tex
幕後排版========
作者----
* 打字* 標記* 打字* 標記
電腦----
* 睡覺* 睡覺* 唉唉叫
ePUB 幕後排版使用 Markdown
語法簡單、易讀易寫大量生產轉換其他格式讓電腦自己排版多人協作
Book as a Service
書原始碼
題庫
電子書
投影片
講義
多人協作
出版自動化
持續更新
Service
!
!!
plain text plain text plain text
plain text plain text plain text plain text
plain text plain text
plain text
plain tex
t plain te
xt
plain text p
lain text
ContinuousPublishing
新聞部落格
RSS日記筆記
...
Contpub
ContinuousPublishing
contpub.org
http://sphinx.pocoo.org/
Don't Reinvent The Wheel
http://docutils.sourceforge.net/rst.html
http://www.latex-project.org/http://www.tug.org/texlive/
http://xmlgraphics.apache.org/fop/
But...
中文支援?
EPUB3?
Open source projects
sphinx-cook
sphinx-themes
SimaQian
CaiLun
http://github.com/contpub
The End