diff --git a/manual/creating_plugins.rst b/manual/creating_plugins.rst index b95c3bc010..e2e928b92e 100644 --- a/manual/creating_plugins.rst +++ b/manual/creating_plugins.rst @@ -262,7 +262,7 @@ visible strings as translatable, by surrounding them in _(). For example:: Then use some program to generate .po files from your plugin source code. There should be one .po file for every language you want to translate into. For example: de.po for German, fr.po for French and so on. You can use the -`poedit `_ program for this. +`poedit `_ program for this. Send these .po files to your translators. Once you get them back, compile them into .mo files. You can again use poedit for that, or just do:: diff --git a/manual/customize.rst b/manual/customize.rst index 8cb1f2d422..07c9bc2039 100644 --- a/manual/customize.rst +++ b/manual/customize.rst @@ -34,7 +34,7 @@ Environment variables * ``http_proxy`` - Used on linux to specify an HTTP proxy See `How to set environment variables in windows `_ or -`How to set environment variables in OS X `_. +`How to set environment variables in OS X `_. Tweaks ------------ diff --git a/manual/develop.rst b/manual/develop.rst index a1839c85be..f1c0c171f7 100644 --- a/manual/develop.rst +++ b/manual/develop.rst @@ -6,7 +6,7 @@ Setting up a calibre development environment calibre is completely open source, licensed under the `GNU GPL v3 `_. This means that you are free to download and modify the program to your heart's content. In this section, you will learn how to get a calibre development environment set up on the operating system of your choice. -calibre is written primarily in `Python `_ with some C/C++ code for speed and system interfacing. +calibre is written primarily in `Python `_ with some C/C++ code for speed and system interfacing. Note that calibre is not compatible with Python 3 and requires at least Python 2.7. .. contents:: Contents @@ -122,7 +122,7 @@ commits:: Be careful to not include merges when using ``HEAD~n``. If you plan to do a lot of development on calibre, then the best method is to create a -`GitHub `_ account. Below is a basic guide to setting up +`GitHub `_ account. Below is a basic guide to setting up your own fork of calibre in a way that will allow you to submit pull requests for inclusion into the main calibre repository: @@ -164,7 +164,7 @@ calibre is the directory that contains the src and resources sub-directories. The next step is to set the environment variable ``CALIBRE_DEVELOP_FROM`` to the absolute path of the src directory. So, following the example above, it would be ``C:\Users\kovid\work\calibre\src``. `Here is a short -guide `_ to setting environment +guide `_ to setting environment variables on Windows. Once you have set the environment variable, open a new command prompt and check that it was correctly set by using diff --git a/manual/faq.rst b/manual/faq.rst index c60fee616b..d5913c1599 100644 --- a/manual/faq.rst +++ b/manual/faq.rst @@ -878,7 +878,7 @@ be printed to it. If the debug output contains a line that looks like:: Qt: internal: -108: Error ATSUMeasureTextImage text/qfontengine_mac.mm then the problem is probably a corrupted font cache. You can clear the cache by following these -`instructions `_. If that doesn't +`instructions `_. If that doesn't solve it, look for a corrupted font file on your system, in ~/Library/Fonts or the like. An easy way to check for corrupted fonts in OS X is to start the "Font Book" application, select all fonts and then in the File menu, choose "Validate fonts". diff --git a/manual/glossary.rst b/manual/glossary.rst index 4a31e73dd4..0f340e4bfd 100644 --- a/manual/glossary.rst +++ b/manual/glossary.rst @@ -8,7 +8,7 @@ Glossary **RSS** *(Really Simple Syndication)* is a web feed format that is used to publish frequently updated content, like news articles, blog posts, etc. It is a format that is particularly suited to being read by computers, and is therefore the preferred way of getting content from the web into an ebook. There are many other feed formats in use on the Internet, and calibre understands most of them. In particular, it has good support for the *ATOM* format, which is commonly used for blogs. recipe - A recipe is a set of instructions that teach calibre how to convert an online news source, such as a magazine or a blog, into an ebook. A recipe is essentially `Python `_ code. As such, it is capable of converting arbitrarily complex news sources into ebooks. At the simplest level, it is just a set of variables, such as URLs, that give calibre enough information to go out onto the Internet and download the news. + A recipe is a set of instructions that teach calibre how to convert an online news source, such as a magazine or a blog, into an ebook. A recipe is essentially `Python `_ code. As such, it is capable of converting arbitrarily complex news sources into ebooks. At the simplest level, it is just a set of variables, such as URLs, that give calibre enough information to go out onto the Internet and download the news. HTML **HTML** *(Hyper Text Mark-Up Language)*, a subset of Standard Generalized Mark-Up Language (SGML) for electronic publishing, is the specific standard used for the World Wide Web. @@ -26,5 +26,5 @@ Glossary **URL** *(Uniform Resource Locator)* for example: ``http://example.com`` regexp - **Regular expressions** provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. See `regexp syntax `_ for the syntax of regular expressions used in Python. + **Regular expressions** provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters. See `regexp syntax `_ for the syntax of regular expressions used in Python. diff --git a/manual/news.rst b/manual/news.rst index 51dd049b62..db86570d98 100644 --- a/manual/news.rst +++ b/manual/news.rst @@ -101,7 +101,7 @@ This is python, so indentation is important. After you've added the lines, it sh .. image:: images/bbc_altered.png :align: center -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 `_ see the `tutorial `_. +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 `_ see the `tutorial `_. Now, click the :guilabel:`Add/update recipe` button and your changes will be saved. Re-download the ebook. You should have a much improved ebook. 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 ebook, but even after the fixing process, the font size of the menus and navigation bar to become too large relative to the article text. To fix this, we will do some more customization, in the next section. diff --git a/manual/regexp.rst b/manual/regexp.rst index 26265ba6b3..33b3cd7a96 100644 --- a/manual/regexp.rst +++ b/manual/regexp.rst @@ -114,7 +114,7 @@ Bulk editing metadata The last part is regular expression search and replace in metadata fields. You can access this by selecting multiple books in the library and using bulk metadata edit. Be very careful when using this last feature, as it can do **Very Bad Things** to your library! Doublecheck that your expressions do what you want them to using the test fields, and only mark the books you really want to change! In the regular expression search mode, you can search in one field, replace the text with something and even write the result into another field. A practical example: Say your library contained the books of Frank Herbert's Dune series, named after the fashion ``Dune 1 - Dune``, ``Dune 2 - Dune Messiah`` and so on. Now you want to get ``Dune`` into the series field. You can do that by searching for ``(.*?) \d+ - .*`` in the title field and replacing it with ``\1`` in the series field. See what I did there? That's a reference to the first group you're replacing the series field with. Now that you have the series all set, you only need to do another search for ``.*? -`` in the title field and replace it with ``""`` (an empty string), again in the title field, and your metadata is all neat and tidy. Isn't that great? By the way, instead of replacing the entire field, you can also append or prepend to the field, so, if you *wanted* the book title to be prepended with series info, you could do that as well. As you by now have undoubtedly noticed, there's a checkbox labeled :guilabel:`Case sensitive`, so you won't have to use flags to select behaviour here. -Well, that just about concludes the very short introduction to regular expressions. Hopefully I'll have shown you enough to at least get you started and to enable you to continue learning by yourself- a good starting point would be the `Python documentation for regexps `_. +Well, that just about concludes the very short introduction to regular expressions. Hopefully I'll have shown you enough to at least get you started and to enable you to continue learning by yourself- a good starting point would be the `Python documentation for regexps `_. One last word of warning, though: Regexps are powerful, but also really easy to get wrong. calibre provides really great testing possibilities to see if your expressions behave as you expect them to. Use them. Try not to shoot yourself in the foot. (God, I love that expression...) But should you, despite the warning, injure your foot (or any other body parts), try to learn from it. @@ -130,5 +130,5 @@ Thanks for helping with tips, corrections and such: * kacir * Starson17 -For more about regexps see `The Python User Manual `_. +For more about regexps see `The Python User Manual `_. diff --git a/manual/template_lang.rst b/manual/template_lang.rst index b43dc319c9..b2b7f77540 100644 --- a/manual/template_lang.rst +++ b/manual/template_lang.rst @@ -84,7 +84,7 @@ If you want only the first two letters of the data, use:: {author_sort:.2} - Only the first two letter of the author sort name -The calibre template language comes from python and for more details on the syntax of these advanced formatting operations, look at the `Python documentation `_. +The calibre template language comes from python and for more details on the syntax of these advanced formatting operations, look at the `Python documentation `_. Advanced features ------------------ diff --git a/manual/xpath.rst b/manual/xpath.rst index d811881c18..4805c84fb3 100644 --- a/manual/xpath.rst +++ b/manual/xpath.rst @@ -107,5 +107,5 @@ XPath built-in functions ``re:test(src, pattern, flags)`` returns `true` if the string `src` matches the regular expression `pattern`. A particularly useful flag is ``i``, it makes matching case insensitive. A good primer on the syntax for regular expressions can be found - at `regexp syntax `_ + at `regexp syntax `_ diff --git a/src/calibre/web/feeds/news.py b/src/calibre/web/feeds/news.py index d8faa92e81..3213be798f 100644 --- a/src/calibre/web/feeds/news.py +++ b/src/calibre/web/feeds/news.py @@ -551,11 +551,11 @@ class BasicNewsRecipe(Recipe): Override in a subclass to customize extraction of the :term:`URL` that points to the content for each article. Return the article URL. It is called with `article`, an object representing a parsed article - from a feed. See `feedparser `_. + from a feed. See `feedparser `_. By default it looks for the original link (for feeds syndicated via a service like feedburner or pheedo) and if found, returns that or else returns - `article.link `_. + `article.link `_. ''' for key in article.keys(): if key.endswith('_origlink'): @@ -579,7 +579,7 @@ class BasicNewsRecipe(Recipe): an ad page, return the HTML of the real page. Otherwise return None. - `soup`: A `BeautifulSoup `_ + `soup`: A `BeautifulSoup `_ instance containing the downloaded :term:`HTML`. ''' return None @@ -615,7 +615,7 @@ class BasicNewsRecipe(Recipe): It can be used to do arbitrarily powerful pre-processing on the :term:`HTML`. It should return `soup` after processing it. - `soup`: A `BeautifulSoup `_ + `soup`: A `BeautifulSoup `_ instance containing the downloaded :term:`HTML`. ''' return soup @@ -627,7 +627,7 @@ class BasicNewsRecipe(Recipe): It can be used to do arbitrarily powerful post-processing on the :term:`HTML`. It should return `soup` after processing it. - :param soup: A `BeautifulSoup `_ instance containing the downloaded :term:`HTML`. + :param soup: A `BeautifulSoup `_ instance containing the downloaded :term:`HTML`. :param first_fetch: True if this is the first page of an article. ''' @@ -643,7 +643,7 @@ class BasicNewsRecipe(Recipe): def index_to_soup(self, url_or_raw, raw=False, as_tree=False): ''' Convenience method that takes an URL to the index page and returns - a `BeautifulSoup `_ + a `BeautifulSoup `_ of it. `url_or_raw`: Either a URL or the downloaded index page as a string @@ -1624,14 +1624,14 @@ class BasicNewsRecipe(Recipe): def tag_to_string(self, tag, use_alt=True, normalize_whitespace=True): ''' Convenience method to take a - `BeautifulSoup `_ + `BeautifulSoup `_ `Tag` and extract the text from it recursively, including any CDATA sections and alt tag attributes. Return a possibly empty unicode string. `use_alt`: If `True` try to use the alt attribute for tags that don't have any textual content - `tag`: `BeautifulSoup `_ + `tag`: `BeautifulSoup `_ `Tag` ''' if tag is None: