From 72aa1ee196060cbfc23a9144436f7d2898f3d98a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 30 Aug 2020 08:05:30 +0530 Subject: [PATCH] String changes --- manual/faq.rst | 2 +- manual/regexp.rst | 6 +++--- manual/server.rst | 2 +- src/calibre/debug.py | 2 +- src/calibre/gui2/library/annotations.py | 2 +- src/pyj/read_book/view.pyj | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manual/faq.rst b/manual/faq.rst index a4f9a8c46e..0f7136f594 100644 --- a/manual/faq.rst +++ b/manual/faq.rst @@ -55,7 +55,7 @@ What's the deal with Table of Contents in MOBI files? The first thing to realize is that most e-books have two tables of contents. One is the traditional Table of Contents, like the ToC you find in paper books. This Table of Contents is part of the main document flow and can be styled however you like. This ToC is called the *content ToC*. -Then there is the *metadata ToC*. A metadata ToC is a ToC that is not part of the book text and is typically accessed by some special button on a reader. For example, in the calibre viewer, you use the Show Table of Contents button to see this ToC. This ToC cannot be styled by the book creator. How it is represented is up to the viewer program. +Then there is the *metadata ToC*. A metadata ToC is a ToC that is not part of the book text and is typically accessed by some special button on a reader. For example, in the calibre E-book viewer, you use the Show Table of Contents button to see this ToC. This ToC cannot be styled by the book creator. How it is represented is up to the viewer program. In the MOBI format, the situation is a little confused. This is because the MOBI format, alone amongst mainstream e-book formats, *does not* have decent support for a metadata ToC. A MOBI book simulates the presence of a metadata ToC by putting an *extra* content ToC at the end of the book. When you click Goto Table of Contents on your Kindle, it is to this extra content ToC that the Kindle takes you. diff --git a/manual/regexp.rst b/manual/regexp.rst index 089793dc7b..b499db799e 100644 --- a/manual/regexp.rst +++ b/manual/regexp.rst @@ -21,9 +21,9 @@ Where in calibre can you use regular expressions? There are a few places calibre uses regular expressions. There's the :guilabel:`Search & replace` in conversion options, metadata detection from filenames in the import settings and Search & replace when editing the metadata of books in bulk. The -calibre book editor can also use regular expressions in its search and replace +calibre book editor can also use regular expressions in its :guilabel:`Search and replace` feature. Finally, you can use regular expressions when searching the calibre -book list and when searching inside the calibre viewer. +book list and when searching inside the calibre E-book viewer. What on earth *is* a regular expression? @@ -118,7 +118,7 @@ Another thing you can use regular expressions for is to extract metadata from fi 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. +The last part is regular expression :guilabel:`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 `_. diff --git a/manual/server.rst b/manual/server.rst index 6a4220de72..a38f6f98a3 100644 --- a/manual/server.rst +++ b/manual/server.rst @@ -189,7 +189,7 @@ you can force a sync by tapping in the top quarter and choosing :guilabel:`Sync`. .. note:: On initial release, the book reader is fully functional but is - missing some more advanced features from the main calibre viewer, such as + missing some more advanced features from the main calibre E-book viewer, such as popup footnotes, bookmarks and annotations in general. These will be added in due course. In fact, the browser reader is designed to eventually replace the main viewer, once it matures. diff --git a/src/calibre/debug.py b/src/calibre/debug.py index 2df21b883a..04106baa7e 100644 --- a/src/calibre/debug.py +++ b/src/calibre/debug.py @@ -32,7 +32,7 @@ def option_parser(): Various command line interfaces useful for debugging calibre. With no options, this command starts an embedded Python interpreter. You can also run the main -calibre GUI, the calibre viewer and the calibre editor in debug mode. +calibre GUI, the calibre E-book viewer and the calibre editor in debug mode. It also contains interfaces to various bits of calibre that do not have dedicated command line tools, such as font subsetting, the E-book diff tool and so diff --git a/src/calibre/gui2/library/annotations.py b/src/calibre/gui2/library/annotations.py index 757be13fe9..f4ea91c929 100644 --- a/src/calibre/gui2/library/annotations.py +++ b/src/calibre/gui2/library/annotations.py @@ -593,7 +593,7 @@ class DetailsPanel(QWidget): atype=a(atype), text=annot_text, dt=_('Date'), date=a(date), ut=a(_('User')), user=a(friendly_username(r['user_type'], r['user'])), ov=a(_('Open in viewer')), sic=a(_('Show in calibre')), - ovtt=a(_('Open the book at this annotation in the calibre viewer')), + ovtt=a(_('Open the book at this annotation in the calibre E-book viewer')), sictt=(_('Show this book in the main calibre book list')), ) self.text_browser.setHtml(text) diff --git a/src/pyj/read_book/view.pyj b/src/pyj/read_book/view.pyj index b865ce0fb8..126d73d29b 100644 --- a/src/pyj/read_book/view.pyj +++ b/src/pyj/read_book/view.pyj @@ -96,7 +96,7 @@ def show_controls_help(): E.input(style='background: transparent; border-width: 0; outline: none', readonly='readonly'), )) div = container.lastChild.firstChild - safe_set_inner_html(div, _('Welcome to the calibre viewer!')) + safe_set_inner_html(div, _('Welcome to the calibre E-book viewer!')) div = div.nextSibling safe_set_inner_html(div, _('Use the PageUp/PageDn or Arrow keys to turn pages')) div = div.nextSibling