好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁 > 知識庫 > GitBook 制作電子書詳細教程

GitBook 制作電子書詳細教程

熱門標簽:鶴崗400電話申請 怎么在百度地圖標注公司的位置 商機地圖標注 智能電銷機器人有用嗎 天津電話外呼系統排名 外呼電話系統怎么操作 百度地圖標注直線距離 德陽400電話申請 測繪地圖標注名稱

gitbook安裝:

 https://nodejs.org/#download 

下載node.js源代碼(點擊綠色的INSTALL),

解壓

./configure
make
make install 

成功執行后,npm就被安裝好了。

2. gitbook 安裝命令

npm install -g gitbook-cli


gitbook -V 

查看gitbook是否安裝成功。

ref

===

1. wanqingwong.com/gitbook-zh/index.html

gitbook使用

===========

1. 根據目錄生成圖書結構

1.1 README.md 與 SUMMARY編寫

README.md

這個文件相當于一本Gitbook的簡介。

$ mkdir test_gitbook
$ touch README.md

SUMMARY.md

這個文件是一本書的目錄結構,使用Markdown語法,

如我們這本書的SUMMARY.md:

$ touch SUMMARY.md
$ vim SUMMARY.md

輸入

* [簡介](README.md)
* [第一章](chapter1/README.md)
 - [第一節](chapter1/section1.md)
 - [第二節](chapter1/section2.md)
* [第二章](chapter2/README.md)
 - [第一節](chapter2/section1.md)
 - [第二節](chapter2/section2.md)
* [結束](end/README.md)

1.2 生成圖書結構

當這個目錄文件創建好之后,我們可以使用Gitbook

的命令行工具將這個目錄結構生成相應的目錄及文件:

$ gitbook init
$ tree . #查看建立的目錄和文件

├── chapter1
│   ├── README.md
│   ├── section1.md
│   └── section2.md
├── chapter2
│   ├── README.md
│   ├── section1.md
│   └── section2.md
├── end
│   └── README.md
├── README.md
└── SUMMARY.md

我們可以看到,gitbook給我們生成了與SUMMARY.md所
對應的目錄及文件。

每個目錄中,都有一個README.md文件,相當于一章的說明。

2. 生成圖書

2.1 輸出為靜態網站

你有兩種方式輸出一個靜態網站:

2.1.1 本地預覽時自動生成

當你在自己的電腦上編輯好圖書之后,你可以使用Gitbook
的命令行進行本地預覽:

$ gitbook serve .

然后瀏覽器中輸入:

 http://localhost:4000 

這樣就可以預覽生
成的以網頁形式組織的書籍。

這里你會發現,你在你的圖書項目的目錄中多了一個名為
_book的文件目錄,而這個目錄中的文件,即是生成的靜態
網站內容。

使用build參數生成到指定目錄

與直接預覽生成的靜態網站文件不一樣的是,使用這個命令,
你可以將內容輸入到你所想要的目錄中去:

$ mkdir /tmp/gitbook
$ gitbook build --output=/tmp/gitbook

2.2 輸出PDF

輸入為PDF文件,需要先使用NPM安裝上gitbook pdf:

$ sudo npm install gitbook-pdf -g

我在執行上面這條命令的時候出現了下面的錯誤:

***************************************************

Downloading http://cdn.bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-i686.tar.bz2
Saving to /usr/local/lib/node_modules/gitbook-pdf/node_modules/phantomjs/phantomjs/phantomjs-1.9.7-linux-i686.tar.bz2
Error: connect ETIMEDOUT
  at exports._errnoException (util.js:746:11)
  at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)
npm ERR! Linux 3.2.0-4-686-pae
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "gitbook-pdf" "-g"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE


npm ERR! phantomjs@1.9.7-5 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs@1.9.7-5 install script 'node install.js'.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!   node install.js
npm ERR! You can get their info via:
npm ERR!   npm owner ls phantomjs
npm ERR! There is likely additional logging output above.


npm ERR! Please include the following file with any support request:
npm ERR!   /home/wangxq/repository/phantomjs/npm-debug.log

***************************************************

 由錯誤報告內容的第一行可以知道,發生錯誤的原因是下載

 phantomjs發生了錯誤,因此我們需要手動下載和安裝。

 解決方法:[1]

$ git clone git://github.com/ariya/phantomjs.git
$ sudo apt-get install build-essential g++ flex bison gperf ruby perl \

 libsqlite3-dev libfontconfig1-dev libicu-dev libfreetype6 libssl-dev \

 libpng-dev libjpeg-dev python libx11-dev libxext-dev    #安裝編譯需要的工具和依賴
$ cd phantomjs
$ git checkout 1.9.7 #注意:這里的1.9.7是phantom的版本號,可以由錯誤報告的第一行找出 
$ ./build.sh --jobs 4
$ sudo cp bin/phantomjs /bin/
$ sudo npm install gitbook-pdf -g #重新進行安裝

 然后,使用下面的命令,要PDF文件,首先安裝依賴庫:

$ sudo apt-get install calibre 
$ gitbook -v 2.1.0 pdf .

 發生錯誤:

*****************************************************

info: start conversion to pdf ....ERROR


Error: Command failed: /bin/sh -c ebook-convert /tmp/tmp-29384ctltwbk/SUMMARY.html /tmp/tmp-29384ctltwbk/index.pdf --title="" --comments="這本書是gitbook的一個例子" --language="en" --book-producer="GitBook" --publisher="GitBook" --chapter="descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter ')]" --chapter-mark="pagebreak" --page-breaks-before="/" --level1-toc="descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-1 ')]" --level2-toc="descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-2 ')]" --level3-toc="descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-3 ')]" --no-chapters-in-toc --max-levels="1" --breadth-first --margin-left="62" --margin-right="62" --margin-top="56" --margin-bottom="56" --pdf-default-font-size="12" --pdf-mono-font-size="12" --paper-size="a4" --pdf-header-template="p class='header'>span>/span>/p>" --pdf-footer-template="p class='footer'>span>_SECTION_/span> span style='float:right;'>_PAGENUM_/span>/p>"
Usage: ebook-convert input_file output_file [options]


Convert an ebook from one format to another.


input_file is the input and output_file is the output. Both must be specified as the first two arguments to the command.


The output ebook format is guessed from the file extension of output_file. output_file can also be of the special format .EXT where EXT is the output file extension. In this case, the name of the output file is derived the name of the input file. Note that the filenames must not start with a hyphen. Finally, if output_file has no extension, then it is treated as a directory and an "open ebook" (OEB) consisting of HTML files is written to that directory. These files are the files that would normally have been passed to the output plugin.


After specifying the input and output file you can customize the conversion by specifying various options. The available options depend on the input and output file types. To get help on them specify the input and output file and then use the -h option.


For full documentation of the conversion system see
http://manual.calibre-ebook.com/conversion.html


Whenever you pass arguments to ebook-convert that have spaces in them, enclose the arguments in quotation marks.


ebook-convert: error: no such option: --pdf-default-font-size

*****************************************************

解決方法[2]

$ sudo -v  wget -nv -O- https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()"


$ gitbook -v 2.1.0 pdf . # 重新執行命令生成pdf,目標文件為book.pdf

ref

===

1. http://phantomjs.org/build.html
2. http://calibre-ebook.com/download_linux

問題

===

1. 如果輸入gitbook init命令,出現Installing version 2.1.0,

需要耐性等待安裝。

       以上就是我整理的gitbook的安裝與使用資料,謝謝大家支持!

您可能感興趣的文章:
  • Git 常用命令速查表(圖文+表格)
  • Git客戶端TortoiseGit(Windows系統)的使用方法
  • Git客戶端圖文詳解 如何安裝配置GitHub操作流程攻略
  • linux系統安裝git及git常用命令
  • 在 Shell 提示符中顯示 Git 分支名稱的方法
  • Git使用小坑 Out of memory錯誤的解決方法
  • git提交空目錄的方法
  • Git使用基礎篇(一些常用命令和原理)
  • Git 教程之查看提交歷史詳解
  • Git 詳細介紹查看、刪除、重命名遠程分支和tag

標簽:丹東 鎮江 優質小號 武漢 滁州 自貢 六盤水 百色

巨人網絡通訊聲明:本文標題《GitBook 制作電子書詳細教程》,本文關鍵詞  GitBook,制作,電子書,詳細,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《GitBook 制作電子書詳細教程》相關的同類信息!
  • 本頁收集關于GitBook 制作電子書詳細教程的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 爽?好紧?宝贝别夹大巴图片| 亚洲一片| 高H黄暴np辣H一女多男| 乱h高h公车| 精品亚洲AV高清一区二区| 男人扒开女人内裤亲里面| 一级做a爰片久久毛片无码电影 | 偷拍农民工嫖妓女BBBBB| 蜜桃色欲av久久无码精品| 九色在线观看视频| 疯了吧!这叫高冷校花? | 108亚洲天使潘春春在线| 98精品| 爽?好大?快?奶18禁麻豆| 扒开美女?狂揉?上门| 1000部拍拍拍1000部手机版| 日韩专区欧美| 高清电影免费在线观看| 寡妇狂叫受不了受不了| 亚洲色播永久网址大全| 性videostv特别另类极品| 动漫美女被虐吸奶| 中国bdsmhd| 91天天操| 小泽玛利娅AV无码无删减在线| 中文黑人寄宿ntr内裤遮不住| 国产精品久久成人网站水多多| 中文字幕亚洲精品| 日本最色网站| 高清一级毛片一本到免费观看 | 人间四月妙夺父心| 男女隐私下部视频| 696969大但人文艺术正道| 日韩xxxx做受欧美| 都市婬乱激情肉欲小说| 草莓视频app下载安装免费无限看-丝瓜安卓 | 大龟馒头慢挺进我的体内| 又硬又粗进去好爽A片看| 极品美女校花思卉激情阅读| 一级女人毛片| 精品婷婷伊人一区三区三 |