String changes

This commit is contained in:
Kovid Goyal 2020-08-30 08:05:30 +05:30
parent cb161b4f76
commit 72aa1ee196
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
6 changed files with 8 additions and 8 deletions

View File

@ -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.

View File

@ -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 <https://docs.python.org/library/re.html>`_.

View File

@ -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.

View File

@ -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

View File

@ -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)

View File

@ -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 <b>calibre viewer</b>!'))
safe_set_inner_html(div, _('Welcome to the <b>calibre E-book viewer</b>!'))
div = div.nextSibling
safe_set_inner_html(div, _('Use the <b>PageUp/PageDn</b> or <b>Arrow keys</b> to turn pages'))
div = div.nextSibling