mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
string changes
This commit is contained in:
parent
1ff9bf9e24
commit
04adea1b10
@ -415,7 +415,7 @@ Examples:
|
||||
|
||||
* ``program: field('series') == 'foo'`` returns ``'1'`` if the book's series is 'foo', otherwise ``''``.
|
||||
* ``program: 'f.o' in field('series')`` returns ``'1'`` if the book's series matches the regular expression ``f.o`` (e.g., `foo`, `Off Onyx`, etc.), otherwise ``''``.
|
||||
* ``program: 'science' inlist field('#genre')`` returns ``'1'`` if any of the book's genres match the regular expression ``science``, e.g., `Science`, `History of Science`, `Science Fiction` etc.), otherwise ``''``.
|
||||
* ``program: 'science' inlist field('#genre')`` returns ``'1'`` if any of the book's genres match the regular expression ``science``, e.g., `Science`, `History of Science`, `Science Fiction` etc., otherwise ``''``.
|
||||
* ``program: '^science$' inlist field('#genre')`` returns ``'1'`` if any of the book's genres exactly match the regular expression ``^science$``, e.g., `Science`. The genres `History of Science` and `Science Fiction` don't match. If there isn't a match then returns ``''``.
|
||||
* ``program: if field('series') != 'foo' then 'bar' else 'mumble' fi`` returns ``'bar'`` if the book's series is not ``foo``. Otherwise it returns ``'mumble'``.
|
||||
* ``program: if field('series') == 'foo' || field('series') == '1632' then 'yes' else 'no' fi`` returns ``'yes'`` if series is either ``'foo'`` or ``'1632'``, otherwise ``'no'``.
|
||||
@ -875,7 +875,7 @@ To accomplish this, we:
|
||||
|
||||
1. Create a composite field (give it lookup name #aa) containing ``{series}/{series_index} - {title}``. If the series is not empty, then this template will produce `series/series_index - title`.
|
||||
2. Create a composite field (give it lookup name #bb) containing ``{#genre:ifempty(Unknown)}/{author_sort}/{title}``. This template produces `genre/author_sort/title`, where an empty genre is replaced with `Unknown`.
|
||||
3. Set the save template to ``{series:lookup(.,#aa,#bb}``. This template chooses composite field ``#aa`` if series is not empty and composite field ``#bb`` if series is empty. We therefore have two completely different save paths, depending on whether or not `series` is empty.
|
||||
3. Set the save template to ``{series:lookup(.,#aa,#bb)}``. This template chooses composite field ``#aa`` if series is not empty and composite field ``#bb`` if series is empty. We therefore have two completely different save paths, depending on whether or not `series` is empty.
|
||||
|
||||
Tips
|
||||
-----
|
||||
|
@ -456,9 +456,9 @@ class ResultsView(QTreeView):
|
||||
m.addAction(QIcon.ic('marked.png'), _('Mark this book in the library'), partial(mark_books, results.book_id))
|
||||
if match is not None:
|
||||
match = index.row()
|
||||
m.addAction(QIcon.ic('view.png'), _('Open this book at this search result'), partial(open_book, results, match_index=match))
|
||||
m.addAction(QIcon.ic('view.png'), _('View this book at this search result'), partial(open_book, results, match_index=match))
|
||||
else:
|
||||
m.addAction(QIcon.ic('view.png'), _('Open this book'), partial(open_book, results))
|
||||
m.addAction(QIcon.ic('view.png'), _('View this book'), partial(open_book, results))
|
||||
m.addSeparator()
|
||||
m.addAction(QIcon.ic('plus.png'), _('Expand all'), self.expandAll)
|
||||
m.addAction(QIcon.ic('minus.png'), _('Collapse all'), self.collapseAll)
|
||||
|
@ -906,7 +906,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'])), highlight_css=highlight_css,
|
||||
ov=a(_('Open in viewer')), sic=a(_('Show in calibre')),
|
||||
ovtt=a(_('Open the book at this annotation in the calibre E-book viewer')),
|
||||
ovtt=a(_('View 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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user