Debian Codegraph @

translations/manual/news.pot

raw
1 # SOME DESCRIPTIVE TITLE.
2 # Copyright (C) Kovid Goyal
3 # This file is distributed under the same license as the calibre package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 #, fuzzy
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: calibre 9.15.0\n"
10 "Report-Msgid-Bugs-To: \n"
11 "POT-Creation-Date: 2026-09-18 07:37+0530\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 "Language-Team: LANGUAGE <[email protected]>\n"
15 "MIME-Version: 1.0\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
18
19 #: ../../../home/kovid/work/calibre/manual/news.rst:4
20 msgid "Adding your favorite news website"
21 msgstr ""
22
23 #: ../../../home/kovid/work/calibre/manual/news.rst:6
24 msgid "calibre has a powerful, flexible and easy-to-use framework for downloading news from the Internet and converting it into an e-book. The following will show you, by means of examples, how to get news from various websites."
25 msgstr ""
26
27 #: ../../../home/kovid/work/calibre/manual/news.rst:8
28 msgid "To gain an understanding of how to use the framework, follow the examples in the order listed below:"
29 msgstr ""
30
31 #: ../../../home/kovid/work/calibre/manual/news.rst:15
32 msgid "Completely automatic fetching"
33 msgstr ""
34
35 #: ../../../home/kovid/work/calibre/manual/news.rst:17
36 msgid "If your news source is simple enough, calibre may well be able to fetch it completely automatically, all you need to do is provide the URL. calibre gathers all the information needed to download a news source into a :term:`recipe`. In order to tell calibre about a news source, you have to create a :term:`recipe` for it. Let's see some examples:"
37 msgstr ""
38
39 #: ../../../home/kovid/work/calibre/manual/news.rst:26
40 msgid "The calibre blog"
41 msgstr ""
42
43 #: ../../../home/kovid/work/calibre/manual/news.rst:28
44 msgid "The calibre blog is a blog of posts that describe many useful calibre features in a simple and accessible way for new calibre users. In order to download this blog into an e-book, we rely on the :term:`RSS` feed of the blog::"
45 msgstr ""
46
47 #: ../../../home/kovid/work/calibre/manual/news.rst:34
48 msgid "I got the RSS URL by looking under \"Subscribe to\" at the bottom of the blog page and choosing :guilabel:`Posts->Atom`. To make calibre download the feeds and convert them into an e-book, you should right click the :guilabel:`Fetch news` button and then the :guilabel:`Add a custom news source` menu item and then the :guilabel:`New Recipe` button. A dialog similar to that shown below should open up."
49 msgstr ""
50
51 #: ../../../home/kovid/work/calibre/manual/news.rst:43
52 msgid "First enter ``Calibre Blog`` 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."
53 msgstr ""
54
55 #: ../../../home/kovid/work/calibre/manual/news.rst:45
56 msgid "The next two fields (:guilabel:`Oldest article` and :guilabel:`Max. number of articles`) allow you some control over how many articles should be downloaded from each feed, and they are pretty self explanatory."
57 msgstr ""
58
59 #: ../../../home/kovid/work/calibre/manual/news.rst:47
60 msgid "To add the feeds to the recipe, enter the feed title and the feed URL and click the :guilabel:`Add feed` button. Once you have added the feed, simply click the :guilabel:`Save` button and you're done! Close the dialog."
61 msgstr ""
62
63 #: ../../../home/kovid/work/calibre/manual/news.rst:51
64 msgid "To test your new :term:`recipe`, click the :guilabel:`Fetch news` button and in the :guilabel:`Custom news sources` sub-menu click :guilabel:`calibre Blog`. After a couple of minutes, the newly downloaded e-book of blog posts will appear in the main library view (if you have your reader connected, it will be put onto the reader instead of into the library). Select it and hit the :guilabel:`View` button to read!"
65 msgstr ""
66
67 #: ../../../home/kovid/work/calibre/manual/news.rst:53
68 msgid "The reason this worked so well, with so little effort is that the blog provides *full-content* :term:`RSS` feeds, i.e., the article content is embedded in the feed itself. For most news sources that provide news in this fashion, with *full-content* feeds, you don't need any more effort to convert them to e-books. Now we will look at a news source that does not provide full content feeds. In such feeds, the full article is a webpage and the feed only contains a link to the webpage with a short summary of the article."
69 msgstr ""
70
71 #: ../../../home/kovid/work/calibre/manual/news.rst:58
72 msgid "bbc.co.uk"
73 msgstr ""
74
75 #: ../../../home/kovid/work/calibre/manual/news.rst:60
76 msgid "Let's try the following two feeds from *The BBC*:"
77 msgstr ""
78
79 #: ../../../home/kovid/work/calibre/manual/news.rst:62
80 msgid "News Front Page: https://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml"
81 msgstr ""
82
83 #: ../../../home/kovid/work/calibre/manual/news.rst:63
84 msgid "Science/Nature: https://newsrss.bbc.co.uk/rss/newsonline_world_edition/science/nature/rss.xml"
85 msgstr ""
86
87 #: ../../../home/kovid/work/calibre/manual/news.rst:65
88 msgid "Follow the procedure outlined in :ref:`calibre_blog` above to create a recipe for *The BBC* (using the feeds above). Looking at the downloaded e-book, we see that calibre has done a creditable job of extracting only the content you care about from each article's webpage. However, the extraction process is not perfect. Sometimes it leaves in undesirable content like menus and navigation aids or it removes content that should have been left alone, like article headings. In order, to have perfect content extraction, we will need to customize the fetch process, as described in the next section."
89 msgstr ""
90
91 #: ../../../home/kovid/work/calibre/manual/news.rst:68
92 msgid "Customizing the fetch process"
93 msgstr ""
94
95 #: ../../../home/kovid/work/calibre/manual/news.rst:70
96 msgid "When you want to perfect the download process, or download content from a particularly complex website, you can avail yourself of all the power and flexibility of the :term:`recipe` framework. In order to do that, in the :guilabel:`Add custom news sources` dialog, simply click the :guilabel:`Switch to Advanced mode` button."
97 msgstr ""
98
99 #: ../../../home/kovid/work/calibre/manual/news.rst:72
100 msgid "The easiest and often most productive customization is to use the print version of the online articles. The print version typically has much less cruft and translates much more smoothly to an e-book. Let's try to use the print version of the articles from *The BBC*."
101 msgstr ""
102
103 #: ../../../home/kovid/work/calibre/manual/news.rst:75
104 msgid "Using the print version of bbc.co.uk"
105 msgstr ""
106
107 #: ../../../home/kovid/work/calibre/manual/news.rst:77
108 msgid "The first step is to look at the e-book we downloaded previously from :ref:`bbc`. At the end of each article, in the e-book is a little blurb telling you where the article was downloaded from. Copy and paste that URL into a browser. Now on the article webpage look for a link that points to the \"Printable version\". Click it to see the print version of the article. It looks much neater! Now compare the two URLs. For me they were:"
109 msgstr ""
110
111 #: ../../../home/kovid/work/calibre/manual/news.rst:79
112 msgid "Article URL"
113 msgstr ""
114
115 #: ../../../home/kovid/work/calibre/manual/news.rst:80
116 msgid "https://news.bbc.co.uk/2/hi/science/nature/7312016.stm"
117 msgstr ""
118
119 #: ../../../home/kovid/work/calibre/manual/news.rst:82
120 msgid "Print version URL"
121 msgstr ""
122
123 #: ../../../home/kovid/work/calibre/manual/news.rst:83
124 msgid "https://newsvote.bbc.co.uk/mpapps/pagetools/print/news.bbc.co.uk/2/hi/science/nature/7312016.stm"
125 msgstr ""
126
127 #: ../../../home/kovid/work/calibre/manual/news.rst:85
128 msgid "So it looks like to get the print version, we need to prefix every article URL with:"
129 msgstr ""
130
131 #: ../../../home/kovid/work/calibre/manual/news.rst:87
132 msgid "newsvote.bbc.co.uk/mpapps/pagetools/print/"
133 msgstr ""
134
135 #: ../../../home/kovid/work/calibre/manual/news.rst:89
136 msgid "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):"
137 msgstr ""
138
139 #: ../../../home/kovid/work/calibre/manual/news.rst:94
140 msgid "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:"
141 msgstr ""
142
143 #: ../../../home/kovid/work/calibre/manual/news.rst:101
144 msgid "This is Python, so indentation is important. After you've added the lines, it should look like:"
145 msgstr ""
146
147 #: ../../../home/kovid/work/calibre/manual/news.rst:106
148 msgid "In the above, ``def print_version(self, url)`` defines a *method* that is called by calibre 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 <https://www.python.org>`_ see the `tutorial <https://docs.python.org/tutorial/>`_."
149 msgstr ""
150
151 #: ../../../home/kovid/work/calibre/manual/news.rst:108
152 msgid "Now, click the :guilabel:`Add/update recipe` button and your changes will be saved. Re-download the e-book. You should have a much improved e-book. One of the problems with the new version is that the fonts on the print version webpage are too small. This is automatically fixed when converting to an e-book, but even after the fixing process, the font size of the menus and navigation bar become too large relative to the article text. To fix this, we will do some more customization, in the next section."
153 msgstr ""
154
155 #: ../../../home/kovid/work/calibre/manual/news.rst:111
156 msgid "Replacing article styles"
157 msgstr ""
158
159 #: ../../../home/kovid/work/calibre/manual/news.rst:113
160 msgid "In the previous section, we saw that the font size for articles from the print version of *The BBC* was too small. In most websites, *The BBC* included, this font size is set by means of :term:`CSS` stylesheets. We can disable the fetching of such stylesheets by adding the line::"
161 msgstr ""
162
163 #: ../../../home/kovid/work/calibre/manual/news.rst:119
164 msgid "The recipe now looks like:"
165 msgstr ""
166
167 #: ../../../home/kovid/work/calibre/manual/news.rst:124
168 msgid "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."
169 msgstr ""
170
171 #: ../../../home/kovid/work/calibre/manual/news.rst:127
172 msgid "Slicing and dicing"
173 msgstr ""
174
175 #: ../../../home/kovid/work/calibre/manual/news.rst:129
176 msgid "calibre contains very powerful and flexible abilities when it comes to manipulating downloaded content. To show off a couple of these, let's look at our old friend the :ref:`The BBC <bbc1>` recipe again. Looking at the source code (:term:`HTML`) of a couple of articles (print version), we see that they have a footer that contains no useful information, contained in"
177 msgstr ""
178
179 #: ../../../home/kovid/work/calibre/manual/news.rst:137
180 msgid "This can be removed by adding::"
181 msgstr ""
182
183 #: ../../../home/kovid/work/calibre/manual/news.rst:141
184 msgid "to the recipe. Finally, let's replace some of the :term:`CSS` that we disabled earlier, with our own :term:`CSS` that is suitable for conversion to an e-book::"
185 msgstr ""
186
187 #: ../../../home/kovid/work/calibre/manual/news.rst:145
188 msgid "With these additions, our recipe has become \"production quality\"."
189 msgstr ""
190
191 #: ../../../home/kovid/work/calibre/manual/news.rst:147
192 msgid "This :term:`recipe` explores only the tip of the iceberg when it comes to the power of calibre. To explore more of the abilities of calibre we'll examine a more complex real life example in the next section."
193 msgstr ""
194
195 #: ../../../home/kovid/work/calibre/manual/news.rst:150
196 msgid "Real life example"
197 msgstr ""
198
199 #: ../../../home/kovid/work/calibre/manual/news.rst:152
200 msgid "A reasonably complex real life example that exposes more of the :term:`API` of ``BasicNewsRecipe`` is the :term:`recipe` for *The New York Times*"
201 msgstr ""
202
203 #: ../../../home/kovid/work/calibre/manual/news.rst:238
204 msgid "We see several new features in this :term:`recipe`. First, we have::"
205 msgstr ""
206
207 #: ../../../home/kovid/work/calibre/manual/news.rst:242
208 msgid "This sets the displayed time on the front page of the created e-book to be in the format, ``Day, Day_Number Month, Year``. See :attr:`timefmt <calibre.web.feeds.news.BasicNewsRecipe.timefmt>`."
209 msgstr ""
210
211 #: ../../../home/kovid/work/calibre/manual/news.rst:245
212 msgid "Then we see a group of directives to cleanup the downloaded :term:`HTML`::"
213 msgstr ""
214
215 #: ../../../home/kovid/work/calibre/manual/news.rst:251
216 msgid "These remove everything before the first ``<h1>`` tag and everything after the first tag whose id is ``footer``. See :attr:`remove_tags <calibre.web.feeds.news.BasicNewsRecipe.remove_tags>`, :attr:`remove_tags_before <calibre.web.feeds.news.BasicNewsRecipe.remove_tags_before>`, :attr:`remove_tags_after <calibre.web.feeds.news.BasicNewsRecipe.remove_tags_after>`."
217 msgstr ""
218
219 #: ../../../home/kovid/work/calibre/manual/news.rst:253
220 msgid "The next interesting feature is::"
221 msgstr ""
222
223 #: ../../../home/kovid/work/calibre/manual/news.rst:260
224 msgid "``needs_subscription = True`` tells calibre that this recipe needs a username and password in order to access the content. This causes, calibre to ask for a username and password whenever you try to use this recipe. The code in :meth:`calibre.web.feeds.news.BasicNewsRecipe.get_browser` actually does the login into the NYT website. Once logged in, calibre will use the same, logged in, browser instance to fetch all content. See `mechanize <https://mechanize.readthedocs.io/en/latest/>`_ to understand the code in ``get_browser``."
225 msgstr ""
226
227 #: ../../../home/kovid/work/calibre/manual/news.rst:262
228 msgid "The next new feature is the :meth:`calibre.web.feeds.news.BasicNewsRecipe.parse_index` method. Its job is to go to https://www.nytimes.com/pages/todayspaper/index.html and fetch the list of articles that appear in *today's* paper. While more complex than simply using :term:`RSS`, the recipe creates an e-book that corresponds very closely to the day's paper. ``parse_index`` makes heavy use of `BeautifulSoup <https://www.crummy.com/software/BeautifulSoup/bs4/doc/>`_ to parse the daily paper webpage. You can also use other, more modern parsers if you dislike BeautifulSoup. calibre comes with `lxml <https://lxml.de/>`_ and `html5lib <https://github.com/html5lib/html5lib-python>`_, which are the recommended parsers. To use them, replace the call to ``index_to_soup()`` with the following::"
229 msgstr ""
230
231 #: ../../../home/kovid/work/calibre/manual/news.rst:283
232 msgid "The final new feature is the :meth:`calibre.web.feeds.news.BasicNewsRecipe.preprocess_html` method. It can be used to perform arbitrary transformations on every downloaded HTML page. Here it is used to bypass the ads that the nytimes shows you before each article."
233 msgstr ""
234
235 #: ../../../home/kovid/work/calibre/manual/news.rst:286
236 msgid "Tips for developing new recipes"
237 msgstr ""
238
239 #: ../../../home/kovid/work/calibre/manual/news.rst:288
240 msgid "The best way to develop new recipes is to use the command line interface. Create the recipe using your favorite Python editor and save it to a file say :file:`myrecipe.recipe`. The `.recipe` extension is required. You can download content using this recipe with the command::"
241 msgstr ""
242
243 #: ../../../home/kovid/work/calibre/manual/news.rst:292
244 msgid "The command :command:`ebook-convert` will download all the webpages and save them to the EPUB file :file:`myrecipe.epub`. The ``-vv`` option makes ebook-convert spit out a lot of information about what it is doing. The :option:`ebook-convert-recipe-input --test` option makes it download only a couple of articles from at most two feeds. In addition, ebook-convert will put the downloaded HTML into the ``debug/input`` folder, where ``debug`` is the folder you specified in the :option:`ebook-convert --debug-pipeline` option."
245 msgstr ""
246
247 #: ../../../home/kovid/work/calibre/manual/news.rst:300
248 msgid "Once the download is complete, you can look at the downloaded :term:`HTML` by opening the file :file:`debug/input/index.html` in a browser. Once you're satisfied that the download and preprocessing is happening correctly, you can generate e-books in different formats as shown below::"
249 msgstr ""
250
251 #: ../../../home/kovid/work/calibre/manual/news.rst:307
252 msgid "If you're satisfied with your recipe, and you feel there is enough demand to justify its inclusion into the set of built-in recipes, post your recipe in the `calibre recipes forum <https://www.mobileread.com/forums/forumdisplay.php?f=228>`_ to share it with other calibre users."
253 msgstr ""
254
255 #: ../../../home/kovid/work/calibre/manual/news.rst:310
256 msgid "On macOS, the command line tools are inside the calibre bundle, for example, if you installed calibre in :file:`/Applications` the command line tools are in :file:`/Applications/calibre.app/Contents/MacOS/`."
257 msgstr ""
258
259 #: ../../../home/kovid/work/calibre/manual/news.rst:316
260 msgid ":doc:`generated/en/ebook-convert`"
261 msgstr ""
262
263 #: ../../../home/kovid/work/calibre/manual/news.rst:317
264 msgid "The command line interface for all e-book conversion."
265 msgstr ""
266
267 #: ../../../home/kovid/work/calibre/manual/news.rst:321
268 msgid "Further reading"
269 msgstr ""
270
271 #: ../../../home/kovid/work/calibre/manual/news.rst:323
272 msgid "To learn more about writing advanced recipes using some of the facilities, available in ``BasicNewsRecipe`` you should consult the following sources:"
273 msgstr ""
274
275 #: ../../../home/kovid/work/calibre/manual/news.rst:325
276 msgid ":ref:`API documentation <news_recipe>`"
277 msgstr ""
278
279 #: ../../../home/kovid/work/calibre/manual/news.rst:326
280 msgid "Documentation of the ``BasicNewsRecipe`` class and all its important methods and fields."
281 msgstr ""
282
283 #: ../../../home/kovid/work/calibre/manual/news.rst:328
284 msgid "`BasicNewsRecipe <https://github.com/kovidgoyal/calibre/blob/master/src/calibre/web/feeds/news.py>`_"
285 msgstr ""
286
287 #: ../../../home/kovid/work/calibre/manual/news.rst:329
288 msgid "The source code of ``BasicNewsRecipe``"
289 msgstr ""
290
291 #: ../../../home/kovid/work/calibre/manual/news.rst:331
292 msgid "`Built-in recipes <https://github.com/kovidgoyal/calibre/tree/master/recipes>`_"
293 msgstr ""
294
295 #: ../../../home/kovid/work/calibre/manual/news.rst:332
296 msgid "The source code for the built-in recipes that come with calibre"
297 msgstr ""
298
299 #: ../../../home/kovid/work/calibre/manual/news.rst:334
300 msgid "`The calibre recipes forum <https://www.mobileread.com/forums/forumdisplay.php?f=228>`_"
301 msgstr ""
302
303 #: ../../../home/kovid/work/calibre/manual/news.rst:335
304 msgid "Lots of knowledgeable calibre recipe writers hang out here."
305 msgstr ""
306
307 #: ../../../home/kovid/work/calibre/manual/news.rst:339
308 msgid "API documentation"
309 msgstr ""