HackMD
    • Sharing Link copied
    • /edit
    • View mode
      • Edit mode
      • View mode
      • Book mode
      • Slide mode
      Edit mode View mode Book mode Slide mode
    • Note Permission
    • Read
      • Only me
      • Signed-in users
      • Everyone
      Only me Signed-in users Everyone
    • Write
      • Only me
      • Signed-in users
      • Everyone
      Only me Signed-in users Everyone
    • More (Comment, Invitee)
    • Publishing
    • Commenting Enable
      Disabled Forbidden Owners Signed-in users Everyone
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Invitee
    • No invitee
    • Options
    • Versions
    • Transfer ownership
    • Delete this note
    • Template
    • Save as template
    • Insert from template
    • Export
    • Google Drive Export to Google Drive
    • Gist
    • Import
    • Google Drive Import from Google Drive
    • Gist
    • Clipboard
    • Download
    • Markdown
    • HTML
    • Raw HTML
Menu Sharing Help
Menu
Options
Versions Transfer ownership Delete this note
Export
Google Drive Export to Google Drive Gist
Import
Google Drive Import from Google Drive Gist Clipboard
Download
Markdown HTML Raw HTML
Back
Sharing
Sharing Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
More (Comment, Invitee)
Publishing
More (Comment, Invitee)
Commenting Enable
Disabled Forbidden Owners Signed-in users Everyone
Permission
Owners
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Invitee
No invitee
   owned this note    owned this note      
Published Linked with
Like BookmarkBookmarked
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
--- title: "如何製作一本epub3電子書" tags: hackpad --- # 如何製作一本epub3電子書 > [點此觀看原始內容](https://g0v.hackpad.tw/9zQsGYYU1TG) 這則教學使用「電電轉換器」製作電子書。 如果您手邊沒有原始檔案,可參考使用「黨產解密」一書。 [https://github.com/billy3321/decipher\_kmt\_property](https://github.com/billy3321/decipher_kmt_property) 首先,先將書籍圖片編輯好,內文放置到完整的markdown檔案中。 Markdown檔案的語法可參考此,其中「註釋」和「換頁」與一般markdown比較不一樣,要注意一下。 [http://conv.denshochan.com/tw/markdown](http://conv.denshochan.com/tw/markdown) Markdown檔案在此: [https://github.com/billy3321/decipher\_kmt\_property/blob/master/full.md](https://github.com/billy3321/decipher_kmt_property/blob/master/full.md) 電電轉換器設定檔: [https://github.com/billy3321/decipher\_kmt\_property/blob/master/ddconv.yml](https://github.com/billy3321/decipher_kmt_property/blob/master/ddconv.yml) 接著打開電電轉換器,網址: [http://conv.denshochan.com/tw/](http://conv.denshochan.com/tw/) 他左上角的「上傳」可以一次選取多個檔案,請一次把所有的檔案都選好:markdown檔案、所有圖片、電電轉換器設定檔、封面(請命名為cover.jpg)。輸入欄位的書本標題隨意,之後會被電電轉換器的設定覆蓋。 ![](https://g0vhackmd.blob.core.windows.net/g0v-hackmd-images/upload_c7207c3c0c2e2fb4be9a5db4f23b35ed) 選好後,請點選「轉換」按鈕,下載一個epub。 接著,請把epub解壓縮。 解壓縮後,進入「OEBPS」資料夾。 首先移除「toc.ncx」檔案。接著,修改「content.opf」檔案 把這幾行 ``` <item media-type="application/x-dtbncx+xml" href="toc.ncx" id="_toc.ncx" /> </manifest> <spine page-progression-direction="ltr" toc="_toc.ncx"> ``` 修改成這樣: ``` </manifest> <spine page-progression-direction="ltr"> ``` 然後把「style.css」修改為以下內容: ``` @charset "UTF-8"; /\ でんでんコンバーター縦書きデフォルト / @namespace "http://www.w3.org/1999/xhtml"; @namespace epub "http://www.idpf.org/2007/ops"; html { -epub-writing-mode: horizontal-tb; -webkit-writing-mode: horizontal-tb; writing-mode: horizontal-tb; } body { text-align: justify; text-justify: inter-ideograph; font-family: source, serif, sans-serif; vertical-align: baseline; word-wrap: break-word; } @font-face { font-family: source; src: url(shs.otf); } h1, h2, h3, h4, h5, h6 { font-family: serif, sans-serif; font-weight: normal; color: inherit; } h1 { font-size: 2em; text-align: center; margin-right: 0.625em; margin-left: 0.625em; } h2 { font-size: 1.8em; text-align: center; margin-right: 0.83333em; margin-left: 0.83333em; } h3 { font-size: 1.5em; text-align: center; margin-right: 1.11111em; margin-left: 1.11111em; } h4 { font-size: 1.25em; margin-right: 1.25em; margin-left: 1.25em; } h5 { font-size: 1.125em; margin-right: 1.42857em; margin-left: 1.42857em; } h6 { font-size: 1em; margin-right: 1.66667em; margin-left: 1.66667em; } p { margin-right: 1.25em; margin-left: 1.25em; line-height: 1.8; text-indent: 2em; } li p { text-indent: 0; } p, li, dt, dd { line-height: 1.8; } b, strong, dt, caption, figcaption, th { font-family: sans-serif, serif; } strong, blockquote { font-family: "HelveticaNeue-Medium", "STKaiTi-TC-Regular", "DFKai-SB"; } blockquote, ul, fieldset, form, ol, dl, menu { margin-right: 1.25em; margin-left: 1.25em; padding: 0; } blockquote blockquote, blockquote ol, blockquote ul, blockquote dl, ol blockquote, ol ol, ol ul, ol dl, ul blockquote, ul ol, ul ul, ul dl, dl blockquote, dl ol, dl ul, dl dl { margin-right: 0em; margin-left: 0em; } ol, ul, menu, dd { margin-top: 2em; } ol li ol { margin-top: 0em; margin-left: 2em; } ol li ul { margin-top: 0em; margin-left: 2em; } ul li ol { margin-top: 0em; margin-left: 2em; } ul li ul { margin-top: 0em; margin-left: 2em; } a { color: #0538b2; } a:hover { color: #b2058e; } a:active { color: #b27f05; } pre { white-space: pre-wrap; } img { width: auto; height: auto; max-width: 100%; max-height: 100%; } hr { margin-right: 1.25em; margin-left: 1.25em; } table { border-collapse: collapse; border-spacing: 0; } rt { font-family: serif, sans-serif; } .tcy { -epub-text-combine: horizontal; -webkit-text-combine: horizontal; text-combine-horizontal: all; } .sideways { -epub-text-orientation: sideways; } .upright { -epub-text-orientation: rotate-right; -epub-text-orientation: upright; -webkit-text-orientation: upright; -epub-text-combine: horizontal; -webkit-text-combine: horizontal; text-combine-horizontal: all; } .pagenum { color: gray; font-size: 0.8em; } .footnotes hr { margin-right: 1.25em; margin-left: 1.25em; } .footnotes ol { margin-top: 2em; } .footnotes li { font-size: 0.875em; } a.noteref { font-size: 0.75em; vertical-align: super; } navtoc, navlandmarks, navloi, navlot, navpage-list { margin-left: 2.5em; } navtoc ol, navlandmarks ol, navloi ol, navlot ol, navpage-list ol { margin-top: 1em; } table, tr, td, th{ border: 1px 666 solid; } tr:nth-child(even) { background-color: #f2f2f2; } .-epub-media-overlay-active { background-color: yellow; } h2 { margin-top: 0.66667em; } h3 { margin-top: 1.77778em; } h4 { margin-top: 3em; font-family: sans-serif, serif; } blockquote { margin-top: 1em; } p { margin: 0; } a { text-decoration: none; } u { text-decoration: overline; } @media print { h1 { page-break-before: always; } h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } ul, ol, dl { page-break-before: avoid; } } .pull-right { text-align: right; } ``` 要特別注意的是,其中有幾行是中文字型設定 ``` body { font-family: source, serif, sans-serif; } @font-face { font-family: source; src: url(shs.otf); } ``` 如果要加上字型設定,請把字體放入「OEBPS」資料夾,然後在「content.opf」檔案中的這裡: ``` <manifest> <item media-type="image/jpeg" href="cover.jpg" id="_cover.jpg" properties="cover-image" /> ``` 修改為這樣: ``` <manifest> <item media-type="application/otf" href="shs.otf" id="font" /> <item media-type="text/css" href="template.css" id="_template.css" /> ``` 這邊字體名稱設定是「shs.otf」,你可以改成自己喜歡的名稱。 而關於書本目錄的設定在「nav.xhtml」檔案,可以把不要的目錄層級設定\`display: hidden\` 修改完成後,把這整個epub重新封裝起來即可。可以用epub檢查程式試試看有沒有問題。 之後,這就是一個可用的epub檔案了!

Import from clipboard

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lost their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.


Upgrade

All
  • All
  • Team
No template.

Create a template


Upgrade

Delete template

Do you really want to delete this template?

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

Sign in via GitHub

New to HackMD? Sign up

Help

  • English
  • 中文
  • 日本語

Documents

Tutorials

Book Mode Tutorial

Slide Example

YAML Metadata

Resources

Releases

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions

Versions

Upgrade now

Version named by    

More Less
  • Edit
  • Delete

Note content is identical to the latest version.
Compare with
    Choose a version
    No search result
    Version not found

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.