From 452769dcfd86d0250a0e94e223eef7fd3db4f486 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 25 Feb 2011 10:21:33 -0700 Subject: [PATCH] ... --- src/calibre/manual/news.rst | 4 ++++ src/calibre/manual/templates/layout.html | 2 +- src/calibre/manual/viewer.rst | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/calibre/manual/news.rst b/src/calibre/manual/news.rst index 88b6dd47bc..d0838ccb0f 100644 --- a/src/calibre/manual/news.rst +++ b/src/calibre/manual/news.rst @@ -33,6 +33,7 @@ Lets pick a couple of feeds that look interesting: I got the URLs by clicking the little orange RSS icon next to each feed name. To make |app| download the feeds and convert them into an e-book, you should click the :guilabel:`Fetch news` button and then the :guilabel:`Add a custom news source` menu item. A dialog similar to that shown below should open up. .. image:: images/custom_news.png + :align: center First enter ``Portfolio`` into the :guilabel:`Recipe title` field. This will be the title of the e-book that will be created from the articles in the above feeds. @@ -81,6 +82,7 @@ So it looks like to get the print version, we need to prefix every article URL w Now in the :guilabel:`Advanced Mode` of the Custom news sources dialog, you should see something like (remember to select *The BBC* recipe before switching to advanced mode): .. image:: images/bbc_advanced.png + :align: center You can see that the fields from the :guilabel:`Basic mode` have been translated to python code in a straightforward manner. We need to add instructions to this recipe to use the print version of the articles. All that's needed is to add the following two lines: @@ -92,6 +94,7 @@ You can see that the fields from the :guilabel:`Basic mode` have been translated This is python, so indentation is important. After you've added the lines, it should look like: .. image:: images/bbc_altered.png + :align: center In the above, ``def print_version(self, url)`` defines a *method* that is called by |app| for every article. ``url`` is the URL of the original article. What ``print_version`` does is take that url and replace it with the new URL that points to the print version of the article. To learn about `python `_ see the `tutorial `_. @@ -109,6 +112,7 @@ The recipe now looks like: .. _bbc1: .. image:: images/bbc_altered1.png + :align: center The new version looks pretty good. If you're a perfectionist, you'll want to read the next section, which deals with actually modifying the downloaded content. diff --git a/src/calibre/manual/templates/layout.html b/src/calibre/manual/templates/layout.html index de61075931..6b639e3e67 100644 --- a/src/calibre/manual/templates/layout.html +++ b/src/calibre/manual/templates/layout.html @@ -31,7 +31,7 @@ {%- endif %}
{% if not embedded %} -
+