This commit is contained in:
Kovid Goyal 2008-02-25 04:18:30 +00:00
parent c16132eba6
commit 2ad3dcda4d
18 changed files with 216 additions and 36 deletions

View File

@ -4,6 +4,7 @@ ASSISTANT=${QTDIR}/bin/assistant_new
LD_LIBRARY_PATH=${QTDIR}/lib
all : clean
python preprocess.py
LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ${QCG} libprs500.qhcp && \
LD_LIBRARY_PATH=${LD_LIBRARY_PATH} ${ASSISTANT} -collectionFile libprs500.qhc &

View File

@ -27,4 +27,10 @@ font-family: monospace;
.action {
font-family: monospace;
font-weight: bold;
}
.footer {
font-size: x-small;
color: lightgray;
text-align: right;
}

View File

@ -46,7 +46,10 @@
<li><a href="#view">View</a></li>
</ul>
<h3 class="subsectionHeading" id="add_books">Add books</h3>
<h3 class="subsectionHeading" id="add_books">
<img style="vertical-align: middle" src="images/add_books.png" alt="Add books" />
Add books
</h3>
<p>
The <span class="action">Add books</span> action has three variations, accessed by the
arrow next to the button.
@ -84,7 +87,8 @@
To add a new format to an existing book, use the <a href="#edit_meta_information">Edit meta information</a> action.
</p>
<h3 class="subsectionHeading" id="remove_books">Remove books</h3>
<h3 class="subsectionHeading" id="remove_books"><img style="vertical-align: middle" src="images/remove_books.png" alt="Remove books" />
Remove books </h3>
<p>
The <span class="action">Remove books</span> action deletes books permanently, so use it with care.
It is <i>context sensitive</i>,
@ -94,7 +98,10 @@
<a href="#edit_meta_information">Edit meta information</a> action.
</p>
<h3 class="subsectionHeading" id="edit_meta_information">Edit meta information</h3>
<h3 class="subsectionHeading" id="edit_meta_information">
<img style="vertical-align: middle" src="images/edit_meta_information.png" alt="Edit meta information" />
Edit meta information
</h3>
<p>
The <span class="action">Edit meta information</span> action has two variations, accessed by the
arrow next to the button.
@ -111,7 +118,10 @@
</li>
</ul>
<h3 class="subsectionHeading" id="send_to_device">Send to device</h3>
<h3 class="subsectionHeading" id="send_to_device">
<img style="vertical-align: middle" src="images/send_to_device.png" alt="Send to device" />
Send to device
</h3>
<p>
The <span class="action">Send to device</span> action has two variations, accessed by the
arrow next to the button.
@ -125,7 +135,10 @@
</li>
</ul>
<h3 class="subsectionHeading" id="save_to_disk">Save to disk</h3>
<h3 class="subsectionHeading" id="save_to_disk">
<img style="vertical-align: middle" src="images/save_to_disk.png" alt="Save to disk" />
Save to disk
</h3>
<p>
The <span class="action">Save to disk</span> action has two variations, accessed by the
arrow next to the button.
@ -150,11 +163,63 @@ Author
action.
</p>
<h3 class="subsectionHeading" id="fetch_news">Fetch news</h3>
<h3 class="subsectionHeading" id="fetch_news">
<img style="vertical-align: middle" src="images/fetch_news.png" alt="Fetch news" />
Fetch news
</h3>
<p>
The <span class="action">Fetch news</span> action downloads news from various predefined
websites and converts it into an ebook that can be read on your ebook reader. Normally, the newly
created ebook is added to your ebook library, but if an ebook reader is connected at the time
the download finishes, the news is uploaded to the reader directly.
</p>
<p>
The <span class="action">Fetch news</span> uses simple profiles (10-15 lines of code) for each news
site. To learn how to create profiles for your own news sources, see
<a href="news.html">creating custom news profiles</a>.
</p>
<h3 class="subsectionHeading" id="convert_ebooks">Convert E-books</h3>
<h3 class="subsectionHeading" id="convert_ebooks">
<img style="vertical-align: middle" src="images/convert_ebooks.png" alt="Convert E-books" />
Convert E-books
</h3>
<p>
Ebooks can be converted from a number of formats into the LRF format (for the SONY Reader). Note that ebooks you purchase
will typically have <a href="http://en.wikipedia.org/wiki/Digital_rights_management">Digital Rights Management</a>
<i>(DRM)</i>. libprs500 will not convert these ebooks. For many DRM formats, it is easy to remove the DRM, but as this
is illegal, you have to find tools to liberate your books yourself and then use libprs500 to convert them.
</p>
<p>
For most people, conversion should be a simple 1-click affair. But if you want to learn more about the
conversion process, see <a href="conversion.html">E-book conversion</a>.
</p>
<p>
The <span class="action">Convert E-books</span> action has three variations, accessed by the
arrow next to the button.
</p>
<ul>
<li>
<b>Convert individually</b>: This will allow you to specify conversion options to customize the
conversion of each selected ebook.
</li>
<li>
<b>Bulk convert</b>: This allows you to specify options only once to convert a number of ebooks in bulk.
</li>
<li>
<b>Set conversion defaults</b>: Allows you to set the default settings for future conversions.
</li>
</ul>
<h3 class="subsectionHeading" id="view">View</h3>
<h3 class="subsectionHeading" id="view">
<img style="vertical-align: middle" src="images/view.png" alt="View" />
View
</h3>
<p>
The <span class="action">View</span> action displays the book in an ebook viewer program. libprs500 has a builtin
viewer for the LRF format. For other formats it uses the default operating system application. If a book has more than
one format, you can view a particular format by clicking the arrow next to the View button.
</p>
<hr />
<h2 class="sectionHeading" id="catalogs">Catalogs</h2>
@ -182,6 +247,16 @@ Author
<h2 class="sectionHeading" id="jobs">Jobs</h2>
<div><img src="images/jobs.png" alt="Jobs" /></div>
<hr />
<div class="footer">
<p>
<a href="http://validator.w3.org/check?uri=referer">
<img src="images/valid.png" alt="Valid XHTML 1.1" height="31" width="88" />
</a><br />
Created by Kovid Goyal &copy; 2008
</p>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -1,10 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd"
xml:lang="en" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<meta name="author" content="Kovid Goyal" />
@ -15,7 +12,16 @@
<body>
index.xhtml
<hr />
<div class="footer">
<p>
<a href="http://validator.w3.org/check?uri=referer">
<img src="images/valid.png" alt="Valid XHTML 1.1" height="31" width="88" />
</a><br />
Created by Kovid Goyal &copy; 2008
</p>
</div>
</body>
</html>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version='1.0' encoding='UTF-8'?>
<QtHelpProject version="1.0">
<namespace>libprs500</namespace>
<virtualFolder>manual</virtualFolder>
@ -10,25 +10,33 @@
<filterAttribute>libprs500</filterAttribute>
<toc>
<section title="Start" ref="index.html" />
<section title="Using the GUI" ref="gui.html">
<section title="Actions" ref="gui.html#actions" />
<section ref="index.html" title="Start" />
<section ref="gui.html" title="Using the GUI">
<section ref="gui.html#actions" title="Actions" />
</section>
</toc>
<files>
<file>index.html</file>
<file>gui.html</file>
<file>common.css</file>
<file>images/edit_meta_information.png</file>
<file>images/remove_books.png</file>
<file>images/book_details.png</file>
<file>images/library.png</file>
<file>images/convert_ebooks.png</file>
<file>images/add_books.png</file>
<file>images/save_to_disk.png</file>
<file>images/actions.png</file>
<file>images/catalogs.png</file>
<file>images/book_details.png</file>
<file>images/configuration.png</file>
<file>images/valid.png</file>
<file>images/jobs.png</file>
<file>images/library.png</file>
<file>images/send_to_device.png</file>
<file>images/configuration.png</file>
<file>images/search.png</file>
<file>images/news.png</file>
<file>images/view.png</file>
<file>images/fetch_news.png</file>
</files>
</filterSection>

View File

@ -14,19 +14,19 @@
<templates>templates/</templates>
<toolbars>toolbars/</toolbars>
<item url="templates/" uploadstatus="1" />
<item url="templates/basic.html" />
<item url="index.html" />
<item url="common.css" />
<item url="gui.html" />
<item url="images/" />
<item url="images/actions.png" />
<item url="images/book_details.png" />
<item url="images/catalogs.png" />
<item url="images/configuration.png" />
<item url="images/jobs.png" />
<item url="images/library.png" />
<item url="images/search.png" />
<item url="libprs500.session" />
<item url="libprs500.webprj" />
<item url="templates/basic.html" uploadstatus="1" />
<item url="index.html" uploadstatus="1" />
<item url="common.css" uploadstatus="1" />
<item url="gui.html" uploadstatus="1" />
<item url="images/" uploadstatus="1" />
<item url="images/actions.png" uploadstatus="1" />
<item url="images/book_details.png" uploadstatus="1" />
<item url="images/catalogs.png" uploadstatus="1" />
<item url="images/configuration.png" uploadstatus="1" />
<item url="images/jobs.png" uploadstatus="1" />
<item url="images/library.png" uploadstatus="1" />
<item url="images/search.png" uploadstatus="1" />
<item url="libprs500.session" uploadstatus="1" />
<item url="libprs500.webprj" uploadstatus="1" />
</project>
</webproject>

View File

@ -0,0 +1,73 @@
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
## Copyright (C) 2008 Kovid Goyal kovid@kovidgoyal.net
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with this program; if not, write to the Free Software Foundation, Inc.,
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
''''''
import sys, glob, mechanize, time, subprocess
from tempfile import NamedTemporaryFile
from xml.etree.ElementTree import parse, tostring, fromstring
from BeautifulSoup import BeautifulSoup
def browser():
opener = mechanize.Browser()
opener.set_handle_refresh(True)
opener.set_handle_robots(False)
opener.addheaders = [('User-agent', 'Mozilla/5.0 (X11; U; i686 Linux; en_US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4')]
return opener
def update_manifest(src='libprs500.qhp'):
root = parse(src).getroot()
files = root.find('filterSection').find('files')
files.clear()
for f in glob.glob('*.html')+glob.glob('*.css')+glob.glob('images/*'):
if f.startswith('preview'):
continue
files.append(fromstring('<file>%s</file>'%f))
raw = tostring(root, 'UTF-8').replace('<file>', '\n <file>')
raw = raw.replace('</files>', '\n </files>')
raw = raw.replace('</filterSection>', '\n\n </filterSection>')
open(src, 'wb').write(raw+'\n')
def validate_html():
br = browser()
for f in glob.glob('*.html'):
raw = open(f).read()
br.open('http://validator.w3.org/#validate_by_input')
br.form = tuple(br.forms())[2]
br.form.set_value(raw, id='fragment')
res = br.submit()
soup = BeautifulSoup(res.read())
if soup.find('div', id='result').find(id='congrats') is None:
print 'Invalid HTML in', f
t = NamedTemporaryFile()
t.write(unicode(soup).encode('utf-8'))
subprocess.call(('xdg-open', t.name))
time.sleep(2)
return
def main(args=sys.argv):
update_manifest()
validate_html()
return 0
if __name__ == '__main__':
sys.exit(main())

View File

@ -14,6 +14,17 @@
</head>
<body>
<hr />
<div class="footer">
<p>
<a href="http://validator.w3.org/check?uri=referer">
<img src="images/valid.png" alt="Valid XHTML 1.1" height="31" width="88" />
</a><br />
Created by Kovid Goyal &copy; 2008
</p>
</div>
</body>
</html>