Generate Your own epub book

TurnToJPG -->

###Using Wget to fetching the webpages wget could be used to fetch the webpages from a specified website, using following command could fetch all of the wiki related 1st layer pages from “awesome Wiki”

	$ wget -r -l 1

After wget finished, you will found the 1st layer webpatges under your directory. ###Decide which you want for generating the book There are some rubbish pages in downloaed pages, thus we have to write a script for fetching the valuable ones, my script is listed as following:

[Trusty@DashArch wget]$ pwd
[Trusty@DashArch wget]$ cd
[Trusty@DashArch]$ ls
doc  download  images  index.html  robots.txt  wiki
[Trusty@DashArch]$ cd wiki
[Trusty@DashArch wiki]$ cat
for file in `ls `
	#echo $file
	type=`file $file | awk {'print $2'}`
	#echo $type
	if [ "$type" = "HTML" ]
		#echo $file
		#echo $type
		echo "<a href=\"$file\">$file</a><br/>"

simply run, we will get the file list tables like following:

<a href="Automounting">Automounting</a><br/>
<a href="Autostart">Autostart</a><br/>
<a href="Autostart_with_consolekit">Autostart_with_consolekit</a><br/>
<a href="Autostop">Autostop</a><br/>
<a href="Awesome_3.0_to_3.1">Awesome_3.0_to_3.1</a><br/>

Add them into the html like:

     <h1>Table of Contents</h1>
     <p style="text-indent:0pt">
	<a href="Automounting">Automounting</a><br/>
	<a href="Autostart">Autostart</a><br/>
	<a href="XRandR_Screen_Table">XRandR_Screen_Table</a><br/>
	<a href="Xscreensaver">Xscreensaver</a><br/>

###Generate the ebook Use Calibre, click “Add Book”, navigate to your directory which contains “index.html”, choose it, and now you can do whatever you want to generate epub, mobi, or 6 inch pdf. Just enjoy your ebook!!!

	[Trusty@DashArch Awesome (5)]$ ls -l -h
	total 4.5M
	-rw-r--r-- 1 Trusty root 887K Nov 20 21:07 Awesome - Dash.epub
	-rw-r--r-- 1 Trusty root 511K Nov 20 21:19 Awesome -
	-rw-r--r-- 1 Trusty root 2.6M Nov 20 21:10 Awesome - Dash.pdf
	-rw-r--r-- 1 Trusty root 560K Nov 20 21:06 Awesome -
	-rw-r--r-- 1 Trusty root 1.1K Nov 20 21:18 metadata.opf

Depending on your settings, your generated ebook could be read on NOOK, Kindle, or other mobile equipment.