diff --git a/src/libprs500/manual/Makefile b/src/libprs500/manual/Makefile index e55d7e0ac5..a19cb3be95 100644 --- a/src/libprs500/manual/Makefile +++ b/src/libprs500/manual/Makefile @@ -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 & diff --git a/src/libprs500/manual/common.css b/src/libprs500/manual/common.css index 060e199eb9..9f7ed49057 100644 --- a/src/libprs500/manual/common.css +++ b/src/libprs500/manual/common.css @@ -27,4 +27,10 @@ font-family: monospace; .action { font-family: monospace; font-weight: bold; +} + +.footer { + font-size: x-small; + color: lightgray; + text-align: right; } \ No newline at end of file diff --git a/src/libprs500/manual/gui.html b/src/libprs500/manual/gui.html index 9d6c976fee..e83aafd8bd 100644 --- a/src/libprs500/manual/gui.html +++ b/src/libprs500/manual/gui.html @@ -46,7 +46,10 @@
  • View
  • -

    Add books

    +

    + Add books + Add books +

    The Add books 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 Edit meta information action.

    -

    Remove books

    +

    Remove books + Remove books

    The Remove books action deletes books permanently, so use it with care. It is context sensitive, @@ -94,7 +98,10 @@ Edit meta information action.

    -

    Edit meta information

    +

    + Edit meta information + Edit meta information +

    The Edit meta information action has two variations, accessed by the arrow next to the button. @@ -111,7 +118,10 @@ -

    Send to device

    +

    + Send to device + Send to device +

    The Send to device action has two variations, accessed by the arrow next to the button. @@ -125,7 +135,10 @@ -

    Save to disk

    +

    + Save to disk + Save to disk +

    The Save to disk action has two variations, accessed by the arrow next to the button. @@ -150,11 +163,63 @@ Author action.

    -

    Fetch news

    +

    + Fetch news + Fetch news +

    +

    + The Fetch news 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. +

    +

    + The Fetch news uses simple profiles (10-15 lines of code) for each news + site. To learn how to create profiles for your own news sources, see + creating custom news profiles. +

    -

    Convert E-books

    +

    + Convert E-books + Convert E-books +

    +

    + 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 Digital Rights Management + (DRM). 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. +

    +

    + For most people, conversion should be a simple 1-click affair. But if you want to learn more about the + conversion process, see E-book conversion. +

    +

    + The Convert E-books action has three variations, accessed by the + arrow next to the button. +

    + -

    View

    + +

    + View + View +

    +

    + The View 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. +


    Catalogs

    @@ -182,6 +247,16 @@ Author

    Jobs

    Jobs
    +
    + + diff --git a/src/libprs500/manual/images/add_books.png b/src/libprs500/manual/images/add_books.png new file mode 100644 index 0000000000..1a0b341bbd Binary files /dev/null and b/src/libprs500/manual/images/add_books.png differ diff --git a/src/libprs500/manual/images/convert_ebooks.png b/src/libprs500/manual/images/convert_ebooks.png new file mode 100644 index 0000000000..e82725e170 Binary files /dev/null and b/src/libprs500/manual/images/convert_ebooks.png differ diff --git a/src/libprs500/manual/images/edit_meta_information.png b/src/libprs500/manual/images/edit_meta_information.png new file mode 100644 index 0000000000..061653a60a Binary files /dev/null and b/src/libprs500/manual/images/edit_meta_information.png differ diff --git a/src/libprs500/manual/images/fetch_news.png b/src/libprs500/manual/images/fetch_news.png new file mode 100644 index 0000000000..f93108db49 Binary files /dev/null and b/src/libprs500/manual/images/fetch_news.png differ diff --git a/src/libprs500/manual/images/news.png b/src/libprs500/manual/images/news.png new file mode 100644 index 0000000000..a5eb718c0c Binary files /dev/null and b/src/libprs500/manual/images/news.png differ diff --git a/src/libprs500/manual/images/remove_books.png b/src/libprs500/manual/images/remove_books.png new file mode 100644 index 0000000000..9d798394d9 Binary files /dev/null and b/src/libprs500/manual/images/remove_books.png differ diff --git a/src/libprs500/manual/images/save_to_disk.png b/src/libprs500/manual/images/save_to_disk.png new file mode 100644 index 0000000000..74db6ba6b1 Binary files /dev/null and b/src/libprs500/manual/images/save_to_disk.png differ diff --git a/src/libprs500/manual/images/send_to_device.png b/src/libprs500/manual/images/send_to_device.png new file mode 100644 index 0000000000..1cc45f020f Binary files /dev/null and b/src/libprs500/manual/images/send_to_device.png differ diff --git a/src/libprs500/manual/images/valid.png b/src/libprs500/manual/images/valid.png new file mode 100644 index 0000000000..88fefcbf1c Binary files /dev/null and b/src/libprs500/manual/images/valid.png differ diff --git a/src/libprs500/manual/images/view.png b/src/libprs500/manual/images/view.png new file mode 100644 index 0000000000..c16ec58bcf Binary files /dev/null and b/src/libprs500/manual/images/view.png differ diff --git a/src/libprs500/manual/index.html b/src/libprs500/manual/index.html index d67b88fdb2..ce7900fdaa 100644 --- a/src/libprs500/manual/index.html +++ b/src/libprs500/manual/index.html @@ -1,10 +1,7 @@ - + @@ -15,7 +12,16 @@ - index.xhtml + +
    + \ No newline at end of file diff --git a/src/libprs500/manual/libprs500.qhp b/src/libprs500/manual/libprs500.qhp index 79fe275da3..5552224e4f 100644 --- a/src/libprs500/manual/libprs500.qhp +++ b/src/libprs500/manual/libprs500.qhp @@ -1,4 +1,4 @@ - + libprs500 manual @@ -10,25 +10,33 @@ libprs500 -
    -
    -
    +
    +
    +
    index.html gui.html - common.css - + images/edit_meta_information.png + images/remove_books.png + images/book_details.png + images/library.png + images/convert_ebooks.png + images/add_books.png + images/save_to_disk.png images/actions.png images/catalogs.png - images/book_details.png - images/configuration.png + images/valid.png images/jobs.png - images/library.png + images/send_to_device.png + images/configuration.png images/search.png + images/news.png + images/view.png + images/fetch_news.png diff --git a/src/libprs500/manual/libprs500.webprj b/src/libprs500/manual/libprs500.webprj index d7b2cf3f38..97b7691da6 100644 --- a/src/libprs500/manual/libprs500.webprj +++ b/src/libprs500/manual/libprs500.webprj @@ -14,19 +14,19 @@ templates/ toolbars/ - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/src/libprs500/manual/preprocess.py b/src/libprs500/manual/preprocess.py new file mode 100644 index 0000000000..480ca234ec --- /dev/null +++ b/src/libprs500/manual/preprocess.py @@ -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('%s'%f)) + + raw = tostring(root, 'UTF-8').replace('', '\n ') + raw = raw.replace('', '\n ') + raw = raw.replace('', '\n\n ') + 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()) \ No newline at end of file diff --git a/src/libprs500/manual/templates/basic.html b/src/libprs500/manual/templates/basic.html index 55e5c8b88d..58d245eb92 100644 --- a/src/libprs500/manual/templates/basic.html +++ b/src/libprs500/manual/templates/basic.html @@ -14,6 +14,17 @@ + + +
    + \ No newline at end of file