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 10-07-2024, 04:49 AM   #1
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,260
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
Dedicated identifier custom column converted into link

Hi,

I want to have a dedicated column for the Goodreads identifier, in order to display it in Book Details.

I'm aware that {identifiers:select(goodreads)} can replicate the identifier in text form, however I wanted it to behave just like the default identifiers column, as it allows converting the identifiers into links.

The default identifiers column has a clickable Goodreads link, however at the moment I'd prefer to have a dedicated one that can display just the GR link.

I've tried...
Code:
goodreads:{identifiers:select(goodreads)}
...hoping for some magic to take place but it didn't happen.
Comfy.n is online now   Reply With Quote
Old 10-07-2024, 07:10 AM   #2
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: 12,029
Karma: 7257323
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
I'm not sure what you want to display. Do you want "Goodreads" or do you want "Goodreads:12345"?

Assuming you want to see "Goodreads:12345" as a link and that the text column has "Contains HTML" checked, this should work:
Code:
program:
	gr_id = select($identifiers, 'goodreads');
	if gr_id then
		gr_id = 'goodreads:' & gr_id;
		l = urls_from_identifiers(gr_id, '');
		l = re(l, '>goodreads<', '>' & capitalize(gr_id) & '<')
	else
		l = ''
	fi
If you don't want to see the actual ID then use this:
Code:
program:
	gr_id = select($identifiers, 'goodreads');
	urls_from_identifiers('goodreads:' & gr_id, '')

Last edited by chaley; 10-07-2024 at 07:32 AM. Reason: Forgot to re-add < & >
chaley is offline   Reply With Quote
Old 10-07-2024, 12:29 PM   #3
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,260
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
And just like that, magic has happened. Thanks so much Chaley!

I think one of the reasons I want this, currently, is to leave more space for other items in Details panel!

The first template looks nicer to me, though the second is enough for what I had in mind.

Attached Thumbnails
Click image for larger version

Name:	MWSnap 2024-10-07, 12_10_44.png
Views:	56
Size:	81.5 KB
ID:	211262  
Comfy.n is online now   Reply With Quote
Old 10-07-2024, 01:39 PM   #4
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: 12,029
Karma: 7257323
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Given that screenshot I suspect that this template is more to your liking. The "Goodreads:" in the identifier is redundant, given the column name. This template shows only the identifier value without the "goodreads:" prefix. It is also slightly faster.
Code:
program:
	gr_id = select($identifiers, 'goodreads');
	if gr_id then
		l = urls_from_identifiers( 'goodreads:' & gr_id, '');
		l = re(l, '>goodreads<', '>' & gr_id & '<')
	else
		l = ''
	fi
chaley is offline   Reply With Quote
Old 10-07-2024, 01:54 PM   #5
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,260
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
Thanks, I'm going to use this to eliminate the redundancy
Comfy.n is online now   Reply With Quote
Old 10-17-2024, 09:16 PM   #6
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,998
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Comfy.n View Post
. . .
The first template looks nicer to me, though the second is enough for what I had in mind.
A trifle OT: How did you create that 2 column table in what I assume is an Author note:

Click image for larger version

Name:	MWSnap 2024-10-07, 12_10_44.png
Views:	24
Size:	81.5 KB
ID:	211470

Is there a there a hidden table tool a'la Summernote

BR
BetterRed is offline   Reply With Quote
Old 10-17-2024, 09:48 PM   #7
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,260
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
It's a tweaked version of GR author notes plugin (Terisa has posted a fixed version here: https://www.mobileread.com/forums/sh...8&postcount=54).

I just edited a bit the html inside its authornotes.py and changed the plugin name to GR Author notes "2". Modified plugin is attached.

I took a look at Summernotes and couldn't figure how to install it. In the past I'd use Macromedia Dreamweaver for stuff like this (I call it mixed code). This time I used a text editor and some (a lot of, actually...) Calibre restarts.

And I had to tweak the BD styling with some negative margin:

Code:
#_bio div {margin-left: -30px !important;    }
(Also, I can't remember where I got a Bookerly font download, maybe here, but it's necessary to have it installed for it to look exactly like that screencap, otherwise you can do search and replace for Bookerly in authornotes.py)
Attached Files
File Type: zip GR AuthorNotes 2.zip (2.17 MB, 18 views)

Last edited by Comfy.n; 10-17-2024 at 11:56 PM.
Comfy.n is online now   Reply With Quote
Old 10-17-2024, 09:58 PM   #8
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,260
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
Relevant code for the table is in lines 125-132:

PHP Code:
def gen_html(authorNamebiotitlesitemsdataurl):
    
html "<div>\r\n   <table border=\"0\" style=\"border-collapse: collapse\" cellspacing=\"2\" cellpadding=\"0\";   table-layout: fixed; width: 320px; text-align: center;>\r\n      <thead>\r\n         <tr>\r\n            <td bgcolor=\"[bgcolor]\" style=\"vertical-align: middle; padding-left: 3; padding-right: 3; padding-top: 10; padding-bottom: 10; border-top: 1px; border-right: 1px; border-bottom: 1px; border-left: 1px; border-top-color: [bordercolor]; border-right-color: [bordercolor]; border-bottom-color: [bordercolor]; border-left-color: [bordercolor]; border-top-style: solid; border-right-style: solid; text-align: center; border-bottom-style: solid; border-left-style: solid\">\r\n               <p align=\"center\" style=\"margin-top: 18px; margin-bottom: 12px; margin-left: auto; margin-right: auto; width: fit-content;  text-align: center !important; text-indent: 0px; background-color: [bgcolor]\" ;><strong style=\"font-family: \'Bookerly\',\'sans-serif\'; font-size: large; color: [textcolor]\">"
    
html f'{html}{authorName}</strong></p>\r\n            </td>\r\n            <td bgcolor=\"[bgcolor]\" style=\"vertical-align: top; padding-left: 3; padding-right: 1; padding-top: 10; padding-bottom: 10; border-top: 1px; border-right: 1px; border-bottom: 1px; border-left: 1px; border-top-color: [bordercolor]; border-right-color: [bordercolor]; border-bottom-color: [bordercolor]; border-left-color: [bordercolor]; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid\">\r\n               <p align=\"center\" style=\"margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; background-color: [bgcolor]\"><img src=\"'
    
html f'{html}{dataurl}\" width=\"140\" style=\"vertical-align: top\"></p>\r\n            </td>\r\n         </tr>\r\n      </thead>\r\n      <tbody>\r\n         '
    
for c in range(len(titles)):
        
html f'{html}<tr>\r\n            <td bgcolor=\"[bgcolor]\" style=\"vertical-align: top; padding-left: 5; padding-right: 5; padding-top: 10; padding-bottom: 10; border-top: 1px; border-right: 1px; border-bottom: 1px; border-left: 1px; border-top-color: [bordercolor]; border-right-color: [bordercolor]; border-bottom-color: [bordercolor]; border-left-color: [bordercolor]; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid\">\r\n               <p style=\"margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; background-color: [bgcolor]\"><strong style=\"font-family: \'Bookerly\',\'sans-serif\'; font-size: 12px; color: [textcolor]; background-color: [bgcolor]\">{titles[c]}</strong></p>\r\n            </td>\r\n            <td bgcolor=\"[bgcolor]\" style=\"vertical-align: top; padding-left: 5; padding-right: 5; padding-top: 10; padding-bottom: 10; border-top: 1px; border-right: 1px; border-bottom: 1px; border-left: 1px; border-top-color: [bordercolor]; border-right-color: [bordercolor]; border-bottom-color: [bordercolor]; border-left-color: [bordercolor]; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid\">\r\n               <p style=\"margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; background-color: [bgcolor]\"><span style=\"font-family: \'Bookerly\',\'sans-serif\'; font-size: 12px; color: [textcolor]; background-color: [bgcolor]\">{items[c]}</span></p>\r\n            </td>\r\n         </tr>\r\n         '
    
html f'{html}<tr>\r\n            <td colspan=\"2\" bgcolor=\"[bgcolor]\" style=\"vertical-align: top; padding-left: 5; padding-right: 5; padding-top: 10; padding-bottom: 10; border-top: 1px; border-right: 1px; border-bottom: 1px; border-left: 1px; border-top-color: [bordercolor]; border-right-color: [bordercolor]; border-bottom-color: [bordercolor]; border-left-color: [bordercolor]; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid\">\r\n               <p style=\"margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; background-color: [bgcolor]\" id=\"freeTextContainerauthor23386367\"><span style=\"font-family: \'Bookerly\',\'sans-serif\'; font-size: 12px; color: [textcolor]\"></span><span style=\"font-family: \'Bookerly\',\'sans-serif\'; font-size: 12px; color: [textcolor]\">{bio}</span></p><p align=\"right\" style=\"margin-top: 12px; margin-bottom: 12px; margin-left: 0px; margin-right: 0px; text-indent: 0px; background-color: #242424\"><span style=\"font-family: \'Bookerly\',\'sans-serif\'; font-size: 8px; color: #ffffff; background-color: #242424\">Generated using the GR AuthorNotes 2 plugin</span></p>\r\n            </td>\r\n         </tr>\r\n      </tbody>\r\n   </table>\r\n</div>'
    
return html 
Comfy.n is online now   Reply With Quote
Old 10-17-2024, 10:13 PM   #9
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,260
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
I have a modified tweak for BD font-size too:

# Change the font size of the Book details panel in the interface

change_book_details_font_size_by = -1
Comfy.n is online now   Reply With Quote
Old 10-18-2024, 02:11 AM   #10
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,998
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Comfy.n View Post
It's a tweaked version of GR author notes plugin (Terisa has posted a fixed version here: https://www.mobileread.com/forums/sh...8&postcount=54).

I just edited a bit the html inside its authornotes.py and changed the plugin name to GR Author notes "2". Modified plugin is attached.

I took a look at Summernotes and couldn't figure how to install it.


I was hoping you'd found a table widget chaley had squirreled away in the long text editor Don't have time or inclination to be delving into rats nests of td, /tr, br etc tags when I want to insert a row in table, I'll stick to embedded onenote URLs..

BR
BetterRed is offline   Reply With Quote
Old 10-18-2024, 02:35 AM   #11
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,260
Karma: 6426810
Join Date: Sep 2020
Device: Calibre E-book viewer
Quote:
Originally Posted by BetterRed View Post


I was hoping you'd found a table widget chaley had squirreled away in the long text editor Don't have time or inclination to be delving into rats nests of td, /tr, br etc tags when I want to insert a row in table, I'll stick to embedded onenote URLs..

BR
Maybe a new feature for upcoming 7.21 version?
Comfy.n is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with title link custom column SallyK Library Management 2 12-18-2020 09:00 AM
Identifier-like custom column nqk Library Management 5 05-20-2017 02:38 AM
Custom Column to remember converted books deadman36g Library Management 2 06-23-2016 05:22 PM
Creating a Custom Column Link a_daley Library Management 5 02-16-2014 06:56 AM
Single column ePUB becomes 2 column when converted to Kindle (mobi) rmcape Conversion 0 09-21-2013 01:52 PM


All times are GMT -4. The time now is 05:47 AM.


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