mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-02 21:24:25 -04:00
revert "let's <> lets"
This commit is contained in:
parent
a6b17efea9
commit
a08f63e332
@ -118,7 +118,7 @@ Normally, calibre will automatically choose a base font size appropriate to the
|
||||
have chosen (see :ref:`page-setup`). However, you can override this here in case the default is
|
||||
not suitable for you.
|
||||
|
||||
The :guilabel:`Font size key` option let's you control how non-base font sizes are rescaled.
|
||||
The :guilabel:`Font size key` option lets you control how non-base font sizes are rescaled.
|
||||
The font rescaling algorithm works using a font size key, which is simply a comma-separated
|
||||
list of font sizes. The font size key tells calibre how many "steps" bigger or smaller a given font
|
||||
size should be compared to the base font size. The idea is that there should be a limited number
|
||||
|
@ -43,7 +43,7 @@ You can download the Hello World plugin from
|
||||
:download_file:`helloworld_plugin.zip`.
|
||||
|
||||
Every time you use calibre to convert a book, the plugin's :meth:`run` method will be called and the
|
||||
converted book will have its publisher set to "Hello World". This is a trivial plugin, let's move on to
|
||||
converted book will have its publisher set to "Hello World". This is a trivial plugin, lets move on to
|
||||
a more complex example that actually adds a component to the user interface.
|
||||
|
||||
A User Interface plugin
|
||||
|
@ -101,7 +101,7 @@ want to rename all the HTML files to have names Chapter-1.html, Chapter-2.html
|
||||
and so on. Select the files you want bulk renamed by holding down the :kbd:`Shift` or
|
||||
:kbd:`Ctrl` key and clicking the files. Then right click and select :guilabel:`Bulk
|
||||
rename`. Enter a prefix and what number you would like the automatic numbering
|
||||
to start at, click OK and you are done. The bulk rename dialog also let's you
|
||||
to start at, click OK and you are done. The bulk rename dialog also lets you
|
||||
rename files by the order they appear in the book instead of the order you
|
||||
selected them in, useful, for instance to rename all images by the order
|
||||
they appear.
|
||||
@ -191,7 +191,7 @@ Adding new images/fonts/etc. or creating new blank files
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
You can add a new image, font, stylesheet, etc. from your computer into the
|
||||
book by clicking :guilabel:`File->New file`. This let's you either import a file
|
||||
book by clicking :guilabel:`File->New file`. This lets you either import a file
|
||||
by clicking the :guilabel:`Import resource file` button or create a new blank HTML file
|
||||
or stylesheet by simply entering the file name into the box for the new file.
|
||||
|
||||
|
@ -602,7 +602,7 @@ In calibre, you would instead use tags to mark genre and read status and then ju
|
||||
|
||||
To those of you that claim that you need access to the filesystem, so that you can have access to your books over the network, calibre has an excellent Content server that gives you access to your calibre library over the net.
|
||||
|
||||
If you are worried that someday calibre will cease to be developed, leaving all your books marooned in its folder structure, explore the powerful :guilabel:`Save to disk` feature in calibre that let's you export all your files into a folder structure of arbitrary complexity based on their metadata.
|
||||
If you are worried that someday calibre will cease to be developed, leaving all your books marooned in its folder structure, explore the powerful :guilabel:`Save to disk` feature in calibre that lets you export all your files into a folder structure of arbitrary complexity based on their metadata.
|
||||
|
||||
Finally, the reason there are numbers at the end of every title folder, is for *robustness*. That number is the id number of the book record in the calibre database. The presence of the number allows you to have multiple records with the same title and author names. It is also part of what allows calibre to magically regenerate the database with all metadata if the database file gets corrupted. Given that calibre's mission is to get you to stop storing metadata in filenames and stop using the filesystem to find things, the increased robustness afforded by the id numbers is well worth the uglier folder names.
|
||||
|
||||
|
@ -153,7 +153,7 @@ are processed in the order in which they appear in the book. See
|
||||
Auto create a Table of Contents
|
||||
-------------------------------
|
||||
|
||||
Finally, let's try something a little more ambitious. Suppose your book has
|
||||
Finally, lets try something a little more ambitious. Suppose your book has
|
||||
headings in ``h1`` and ``h2`` tags that look like
|
||||
``<h1 id="someid">Some Text</h1>``. We will auto-generate an HTML Table of
|
||||
Contents based on these headings. Create the custom function below:
|
||||
|
@ -72,7 +72,7 @@ Regular expression mode has some differences from character mode, beyond (of cou
|
||||
|
||||
The third and most important is that the replace string can make reference to parts of the search string by using backreferences. A backreference is ``\\n`` where n is an integer that refers to the n'th parenthesized group in the search expression. For example, given the same example as above, `a bad cat`, a search expression `a (...) (...)`, and a replace expression `a \\2 \\1`, the result will be `a cat bad`. Please see the :ref:`regexptutorial` for more information on backreferences.
|
||||
|
||||
One useful pattern: assume you want to change the case of an entire field. The easiest way to do this is to use character mode, but let's further assume you want to use regular expression mode. The search expression should be `(^.*$)`, the replace expression should be `\\1`, and the desired case change function should be selected.
|
||||
One useful pattern: assume you want to change the case of an entire field. The easiest way to do this is to use character mode, but lets further assume you want to use regular expression mode. The search expression should be `(^.*$)`, the replace expression should be `\\1`, and the desired case change function should be selected.
|
||||
|
||||
Finally, in regular expression mode you can copy values from one field to another. Simply make the source and destination field different. The copy can replace the destination field, prepend to the field (add to the front), or append to the field (add at the end). The 'use comma' checkbox tells calibre to (or not to) add a comma between the text and the destination field in prepend and append modes. If the destination is multiple (e.g., tags), then you cannot uncheck this box.
|
||||
|
||||
|
@ -138,7 +138,7 @@ This can be removed by adding::
|
||||
|
||||
remove_tags = [dict(name='div', attrs={'class':'footer'})]
|
||||
|
||||
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::
|
||||
to the recipe. Finally, lets replace some of the :term:`CSS` that we disabled earlier, with our own :term:`CSS` that is suitable for conversion to an e-book::
|
||||
|
||||
extra_css = '.headline {font-size: x-large;} \n .fact { padding-top: 10pt }'
|
||||
|
||||
|
@ -108,7 +108,7 @@ In the beginning, you said there was a way to make a regular expression case ins
|
||||
|
||||
Yes, I did, thanks for paying attention and reminding me. You can tell calibre how you want certain things handled by using something called flags. You include flags in your expression by using the special construct ``(?flags go here)`` where, obviously, you'd replace "flags go here" with the specific flags you want. For ignoring case, the flag is ``i``, thus you include ``(?i)`` in your expression. Thus, ``(?i)test`` would match "Test", "tEst", "TEst" and any case variation you could think of.
|
||||
|
||||
Another useful flag let's the dot match any character at all, *including* the newline, the flag ``s``. If you want to use multiple flags in an expression, just put them in the same statement: ``(?is)`` would ignore case and make the dot match all. It doesn't matter which flag you state first, ``(?si)`` would be equivalent to the above.
|
||||
Another useful flag lets the dot match any character at all, *including* the newline, the flag ``s``. If you want to use multiple flags in an expression, just put them in the same statement: ``(?is)`` would ignore case and make the dot match all. It doesn't matter which flag you state first, ``(?si)`` would be equivalent to the above.
|
||||
|
||||
I think I'm beginning to understand these regular expressions now... how do I use them in calibre?
|
||||
-----------------------------------------------------------------------------------------------------
|
||||
|
@ -474,7 +474,7 @@ In `TPM`, using ``{`` and ``}`` characters in string literals can lead to errors
|
||||
Python Template Mode
|
||||
-----------------------------------
|
||||
|
||||
Python Template Mode (PTM) let's you write templates using native Python and the `calibre API <https://manual.calibre-ebook.com/develop.html#api-documentation-for-various-parts-of-calibre>`_. The database API will be of most use; further discussion is beyond the scope of this manual. PTM templates are faster and can do more complicated operations but you must know how to write code in Python using the calibre API.
|
||||
Python Template Mode (PTM) lets you write templates using native Python and the `calibre API <https://manual.calibre-ebook.com/develop.html#api-documentation-for-various-parts-of-calibre>`_. The database API will be of most use; further discussion is beyond the scope of this manual. PTM templates are faster and can do more complicated operations but you must know how to write code in Python using the calibre API.
|
||||
|
||||
A PTM template begins with:
|
||||
|
||||
@ -797,7 +797,7 @@ For example, assume we want the folder structure `series/series_index - title`,
|
||||
|
||||
The slash and the hyphen appear only if series is not empty.
|
||||
|
||||
The lookup function let's us do even fancier processing. For example, assume that if a book has a series, then we want the folder structure `series/series index - title.fmt`. If the book does not have a series then we want the folder structure `genre/author_sort/title.fmt`. If the book has no genre then we want to use 'Unknown'. We want two completely different paths, depending on the value of series.
|
||||
The lookup function lets us do even fancier processing. For example, assume that if a book has a series, then we want the folder structure `series/series index - title.fmt`. If the book does not have a series then we want the folder structure `genre/author_sort/title.fmt`. If the book has no genre then we want to use 'Unknown'. We want two completely different paths, depending on the value of series.
|
||||
|
||||
To accomplish this, we:
|
||||
|
||||
|
@ -125,6 +125,7 @@ ignore-words-list = [
|
||||
"errorString",
|
||||
"FocusIn",
|
||||
"iff",
|
||||
"lets",
|
||||
"lite",
|
||||
"NMAKE",
|
||||
"nmake",
|
||||
|
@ -285,7 +285,7 @@ auto_connect_to_folder = ''
|
||||
# category. If two books have fields that generate the same collection name,
|
||||
# then both books will be in that collection.
|
||||
#
|
||||
# This set of tweaks let's you specify for a standard or custom field how
|
||||
# This set of tweaks lets you specify for a standard or custom field how
|
||||
# the collections are to be named. You can use it to add a description to a
|
||||
# standard field, for example 'Foo (Tag)' instead of the 'Foo'. You can also use
|
||||
# it to force multiple fields to end up in the same collection.
|
||||
|
@ -2287,7 +2287,7 @@ class Cache:
|
||||
# We must preserve order.
|
||||
vals = list(vals)
|
||||
# Don't need to worry about case here because we
|
||||
# are fetching its one-true spelling. But let's be
|
||||
# are fetching its one-true spelling. But lets be
|
||||
# careful anyway
|
||||
try:
|
||||
dex = vals.index(self._get_item_name(field, old_id))
|
||||
|
@ -29,7 +29,7 @@
|
||||
* These flags are used to indicate if some or other
|
||||
* device need special treatment. These should be possible
|
||||
* to concatenate using logical OR so please use one bit per
|
||||
* feature and let's pray we don't need more than 32 bits...
|
||||
* feature and lets pray we don't need more than 32 bits...
|
||||
*/
|
||||
#define DEVICE_FLAG_NONE 0x00000000
|
||||
/**
|
||||
|
@ -620,7 +620,7 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin):
|
||||
if e.args[0] != EAGAIN and e.args[0] != EINTR:
|
||||
self._close_device_socket()
|
||||
raise
|
||||
time.sleep(0.1) # let's not hammer the OS too hard
|
||||
time.sleep(0.1) # lets not hammer the OS too hard
|
||||
except:
|
||||
self._close_device_socket()
|
||||
raise
|
||||
|
@ -62,7 +62,7 @@ class SortByAction(InterfaceAction):
|
||||
m.aboutToShow.connect(self.about_to_show_menu)
|
||||
# self.qaction.triggered.connect(self.show_menu)
|
||||
|
||||
# Create a "hidden" menu that can have a shortcut. This also let's us
|
||||
# Create a "hidden" menu that can have a shortcut. This also lets us
|
||||
# manually show the menu instead of letting Qt do it to work around a
|
||||
# problem where Qt can show the menu on the wrong screen.
|
||||
self.hidden_menu = QMenu()
|
||||
|
@ -491,7 +491,7 @@ class TemplateDialog(QDialog, Ui_TemplateDialog):
|
||||
python_context_object=None, dialog_number=None, kwargs=None,
|
||||
formatter=SafeFormat, icon_dir='cc_icons'):
|
||||
# If dialog_number isn't None then we want separate non-modal windows
|
||||
# that don't stay on top of the main dialog. This let's Alt-Tab work to
|
||||
# that don't stay on top of the main dialog. This lets Alt-Tab work to
|
||||
# switch between them. dialog_number must be set only by the template
|
||||
# tester, not the rules dialogs etc that depend on modality.
|
||||
|
||||
|
@ -107,7 +107,7 @@ class CalibreStyle : public QProxyStyle {
|
||||
|
||||
/*!
|
||||
\class QProgressIndicator
|
||||
\brief The QProgressIndicator class let's an application display a progress indicator to show that a lengthy task is under way.
|
||||
\brief The QProgressIndicator class lets an application display a progress indicator to show that a lengthy task is under way.
|
||||
|
||||
Progress indicators are indeterminate and do nothing more than spin to show that the application is busy.
|
||||
\sa QProgressBar
|
||||
|
@ -134,7 +134,7 @@ def delete_tree(path, permanent=False):
|
||||
try:
|
||||
# For completely mysterious reasons, sometimes a file is left open
|
||||
# leading to access errors. If we get an exception, wait and hope
|
||||
# that whatever has the file (Antivirus, DropBox?) let's go of it.
|
||||
# that whatever has the file (Antivirus, DropBox?) lets go of it.
|
||||
shutil.rmtree(path)
|
||||
except:
|
||||
import traceback
|
||||
|
@ -43,7 +43,7 @@ it's *much* faster (see below). It's also much smaller than the CRT
|
||||
versions code-space-wise. We've also added some simple improvements
|
||||
that are super handy (commas in thousands, callbacks at buffer full,
|
||||
for example). Finally, the format strings for MSVC and GCC differ
|
||||
for 64-bit integers (among other small things), so this let's you use
|
||||
for 64-bit integers (among other small things), so this lets you use
|
||||
the same format strings in cross platform code.
|
||||
|
||||
It uses the standard single file trick of being both the header file
|
||||
|
@ -524,7 +524,7 @@ def at(x, y, doc): # {{{
|
||||
# has large margins/padding (e.g. in fullscreen mode)
|
||||
# A possible solution for this is to wrap all text node
|
||||
# children of body in <span> but that is seriously ugly and
|
||||
# might have side effects. Let's do this only if there are lots of
|
||||
# might have side effects. Lets do this only if there are lots of
|
||||
# books in the wild that actually have text children of body,
|
||||
# and even in this case it might be better to change the input
|
||||
# plugin to prevent this from happening.
|
||||
|
Loading…
x
Reference in New Issue
Block a user