Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 06-01-2020, 11:02 PM   #871
Penny_Dreadful
She/Her
Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.
 
Penny_Dreadful's Avatar
 
Posts: 86
Karma: 142774
Join Date: Aug 2009
Location: Perth, Australia
Device: Kindle PW5 (G001PX) PW3 PW1
Question

Hello, I'm looking for some help creating a composite column combined with an advanced icon rule, to give me a column that has icons for the online libraries I can borrow that book from. I currently have columns for each of theses online libraries but I'm hoping to combine the columns into one.

The Calibre Library is my Wish-list/To Read Library so its full of empty books with full metadata. The ID field might have ids for "borrowbox", "wheelers" and "odid" which is a combined ID that might have Overdrive ID and/or a Kindle Unlimited ID. It might also not have any of those IDs in which case I'd like nothing to show in that column.

The IDs look like this:
borrowbox:AAU_779614 Three uppercase letters then an underscore then six numbers ^[A-Z]{3}_\d{6}$ is the regex I am using for the single column
wheelers:9781760873752 Yes this is the ISBN 13 of the book ^(?=(?:\D*\d){10}(?:(?:\D*\d){3})?$)[\d-]+$ ISBN regex.

and the odid can look like one of these:
odid:5426939@wapldmc.overdrive.com
odid:B088PB8T42@ak/unlimited
odid:2077018@wapldmc.overdrive.com&B00PY6CSNM@ak/unlimited

and my icons are named kunlimited.png, wheelers.png, borrowbox.png and overdrive.png

Thanks for any help!

I've created the column listing the IDs by using the template:
program:
strcat(select(field('identifiers'),'odid'),' ', select(field('identifiers'),'borrowbox'),' ', select(field('identifiers'),'wheelers'));

but getting the icons to work using an advanced rule is just confusing me.

Last edited by Penny_Dreadful; 06-02-2020 at 03:52 AM.
Penny_Dreadful is offline   Reply With Quote
Old 06-02-2020, 04:46 AM   #872
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,906
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Penny_Dreadful View Post
Hello, I'm looking for some help creating a composite column combined with an advanced icon rule, to give me a column that has icons for the online libraries I can borrow that book from. I currently have columns for each of theses online libraries but I'm hoping to combine the columns into one.

The Calibre Library is my Wish-list/To Read Library so its full of empty books with full metadata. The ID field might have ids for "borrowbox", "wheelers" and "odid" which is a combined ID that might have Overdrive ID and/or a Kindle Unlimited ID. It might also not have any of those IDs in which case I'd like nothing to show in that column.

The IDs look like this:
borrowbox:AAU_779614 Three uppercase letters then an underscore then six numbers ^[A-Z]{3}_\d{6}$ is the regex I am using for the single column
wheelers:9781760873752 Yes this is the ISBN 13 of the book ^(?=(?:\D*\d){10}(??:\D*\d){3})?$)[\d-]+$ ISBN regex.

and the odid can look like one of these:
odid:5426939@wapldmc.overdrive.com
odid:B088PB8T42@ak/unlimited
odid:2077018@wapldmc.overdrive.com&B00PY6CSNM@ak/unlimited

and my icons are named kunlimited.png, wheelers.png, borrowbox.png and overdrive.png

Thanks for any help!

I've created the column listing the IDs by using the template:
program:
strcat(select(field('identifiers'),'odid'),' ', select(field('identifiers'),'borrowbox'),' ', select(field('identifiers'),'wheelers'));

but getting the icons to work using an advanced rule is just confusing me.
The result of the advanced icon rule has to be the name of the icon to use. I can't work out how to return multiple icons in one advance rule, so, you need one rule per icon that could be displayed. If you could have only one source for each book, we could create a rule that returned a single icon name.

The following advanced rule should work to give the icon for Overdrive:

Code:
program:
id = select(field('identifiers'),'odid');
contains(id, 'overdrive', 'overdrive.png','')
And for Amazon Unlimited
Code:
program:
id = select(field('identifiers'),'odid');
contains(id, 'unlimited', 'kunlimited.png','')
Add each of the above as separate advanced rules with the "Kind" of either "composed icons w/text" or "composed icons w/no text". That will allow multiple icons to be shown in a single column.

For "Borrowbox" and "Wheelers", the value of the identifier shouldn't matter, just that the identifier exists. And you can use simple icon rules. The first field needs to be set to either "composed icons w/text" or "composed icons w/no text". The condition is "If the Identifiers column has id value: wheelers". And then do a similar rule for "Borrowbox".
davidfor is offline   Reply With Quote
Advert
Old 06-02-2020, 05:58 AM   #873
Penny_Dreadful
She/Her
Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.Penny_Dreadful is my North, my South, my East and West.
 
Penny_Dreadful's Avatar
 
Posts: 86
Karma: 142774
Join Date: Aug 2009
Location: Perth, Australia
Device: Kindle PW5 (G001PX) PW3 PW1
@davidfor Thank you so much, the big thing I was missing was "composed icons" now I know why my rules kept on overwriting each other!

The advanced rule code helped heaps too, my Wishlist library is now so much more useful now I can see all the libraries I can borrow a book from in a single column instead of having them spread across three columns.

The amount of help you give out on these forums is amazing, thank you!
Penny_Dreadful is offline   Reply With Quote
Old 06-02-2020, 06:08 AM   #874
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,774
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by davidfor View Post
The result of the advanced icon rule has to be the name of the icon to use. I can't work out how to return multiple icons in one advance rule,
Return a colon-separated list of icon file names. You can construct that list icon by icon using list_union
chaley is offline   Reply With Quote
Old 06-02-2020, 06:19 AM   #875
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,906
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by chaley View Post
Return a colon-separated list of icon file names. You can construct that list icon by icon using list_union
Colon's of course.
davidfor is offline   Reply With Quote
Advert
Old 06-20-2020, 07:12 AM   #876
Carmelocotonto
Connoisseur
Carmelocotonto began at the beginning.
 
Carmelocotonto's Avatar
 
Posts: 93
Karma: 12
Join Date: Nov 2018
Location: Salamanca
Device: kobo Clara HD, Onyxboox C67
Hi,
Is it possible to add the value of a custom column to the book description?, and then add the result to the epub file?
Thanks
Carmelocotonto is offline   Reply With Quote
Old 06-20-2020, 08:12 AM   #877
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,906
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Carmelocotonto View Post
Is it possible to add the value of a custom column to the book description?, and then add the result to the epub file?
A metadata plugboard can update the comments field when the book is sent to the device or a save to disk is done. This can include data from any column.
davidfor is offline   Reply With Quote
Old 06-20-2020, 09:50 AM   #878
Carmelocotonto
Connoisseur
Carmelocotonto began at the beginning.
 
Carmelocotonto's Avatar
 
Posts: 93
Karma: 12
Join Date: Nov 2018
Location: Salamanca
Device: kobo Clara HD, Onyxboox C67
Quote:
Originally Posted by davidfor View Post
A metadata plugboard can update the comments field when the book is sent to the device or a save to disk is done. This can include data from any column.
Thanks. Something like...
epub:save_to_disk = ([{#words} - {comments}] -> comments)

But I don't see what happens. Where will the new 'comments' be?

I have created custom columns but I have never used templates. Any help will help me.

This is what I want (I have modified this one by hand):
Click image for larger version

Name:	20200620_160048_resized.png
Views:	458
Size:	392.0 KB
ID:	180021

And then, polish epub.

Last edited by Carmelocotonto; 06-20-2020 at 10:09 AM.
Carmelocotonto is offline   Reply With Quote
Old 06-20-2020, 10:37 AM   #879
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,906
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by Carmelocotonto View Post
Thanks. Something like...
epub:save_to_disk = ([{#words} - {comments}] -> comments)

But I don't see what happens. Where will the new 'comments' be?

I have created custom columns but I have never used templates. Any help will help me.

This is what I want (I have modified this one by hand):
Attachment 180021

And then, polish epub.
What you have would work. But, it would be pretty ugly on the device. What I use is:

Code:
{comments}{:'raw_field("tags")'|<p><b>Tags:</b> |</p>}{rating:rating_as_stars()|<p><b>Rating:</b> |</p>}{#kobo_last_read:|<p><b>Last Read:</b> |</p>}{:'test(field('#words'),'<p>',test(field('#pages'),'<p>',''))'}{#words:|<b>Word count:</b> |}{:'test(field('#words'),test(field('#pages'),' ',''),'')'}{#pages:|<b>Page count:</b> |}{:'test(field('#words'),'</p>',test(field('#pages'),'</p>',''))'}
That produces something like:
Quote:
This is the book comment.

Tags: Science Fiction, Space Opera
Pages: 200 Words: 123450
The complications in the plugboard is in case any of the values are missing.

Another was posted in the Kobo forum in the last couple of days. That one puts the details first. And the post has some screenshots of what it looks like on a Kobo device.
davidfor is offline   Reply With Quote
Old 06-20-2020, 11:01 AM   #880
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,949
Karma: 55705602
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Not all devices support (can display) Comments.
Where they choose to gather what they display, might be another.
And if you use a wireless delivery, who knows what they filter/insert/replace
theducks is offline   Reply With Quote
Old 07-10-2020, 06:57 PM   #881
shonaich
Junior Member
shonaich began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jul 2020
Device: Paperwhite 2015
Superscript in a title on kindle?

I have a kindle paperwhite 2015 and do all my ebook management via calibre. I want to use the plugboard to put the rating (star amount) in either the title as a superscript to make it less conspicuous or in the author field. Is there a way to make it a superscript? I've searched and can't find anything on it and my programming skills were tasked to the max just to be able to write my plugboard in the first place, lol.

Code:
Also, I have {author_sort} going to the author field.  I'd assumed that if I added another value, the output would place it after the author's name.  So, {author_sort}{rating:| *|} would become 'First Last *3'. Instead it's 'First *3 Last' and I'm not sure why.
I've tried everything my extremely limited understanding knows, but I can't get it to put anything after the author name, it always puts it in the middle.

Sorry if I've used the code tags wrong, I didn't want the bit of code to make a mess...

Thanks for any help!
shonaich is offline   Reply With Quote
Old 07-15-2020, 02:44 PM   #882
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,813
Karma: 62032371
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Is there any specific template function for marked books? For visibility reasons I'd like to apply column colouring to them.
ownedbycats is offline   Reply With Quote
Old 07-15-2020, 03:23 PM   #883
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,774
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Is there any specific template function for marked books? For visibility reasons I'd like to apply column colouring to them.
Nope, there is no way to see marks in a template.
chaley is offline   Reply With Quote
Old 07-26-2020, 04:12 AM   #884
vargr
Member
vargr began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Oct 2019
Device: paperwhite; android
Hello, can anyone help with a template I'm trying to make for cover generation? I want it to take a text field that's a series of 2+ names separated by slashes, and return just the first word of each name, retaining the slashes.

i.e., so that "John Doe/Jim Smith" would show as "John/Jim" on the generated cover.
vargr is offline   Reply With Quote
Old 07-26-2020, 05:33 AM   #885
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,774
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by vargr View Post
Hello, can anyone help with a template I'm trying to make for cover generation? I want it to take a text field that's a series of 2+ names separated by slashes, and return just the first word of each name, retaining the slashes.

i.e., so that "John Doe/Jim Smith" would show as "John/Jim" on the generated cover.
One of these should do it. Using general program mode:
Code:
program: list_re(field('#text'), '/', '^(..*?)\b.*$', '\1')
Using template program mode:
Code:
{#text:'list_re($, '/', '^(..*?)\b.*$', '\1')'}
Change #text to be the lookup name of your text column.

The above also handles single names. For example "John Doe/Fred/Jim Smith" produces "/John/Fred/Jim". If you don't want that then change the \b to a space character.

Last edited by chaley; 07-26-2020 at 12:06 PM. Reason: Fix the regexes
chaley is offline   Reply With Quote
Reply

Tags
custom column, tag, tags


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
custom column i need a little help shinken Calibre 3 09-15-2010 03:41 AM
Using Custom Metadata in Save Template EJvdH Calibre 1 07-02-2010 06:06 AM
Accessories Decalgirl Kindle 2 custom skin template srmalloy Amazon Kindle 6 04-09-2010 09:55 PM
Donations for Custom Recipes ddavtian Calibre 5 01-23-2010 04:54 PM
Help understanding custom recipes andersent Calibre 0 12-17-2009 02:37 PM


All times are GMT -4. The time now is 01:08 PM.


MobileRead.com is a privately owned, operated and funded community.