Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 09-20-2022, 09:46 PM   #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,073
Karma: 6425108
Join Date: Sep 2020
Device: Calibre E-book viewer
Clickable Book IDs on Book details pane

Is it possible to add clickable Book Ids on the Book Details pane (right side of the UI)?

Or else, can I make clickable references using the Calibre URL scheme in some field? I have tried adding <calibre://show-book/mylib/100> in comments, but it isn't clickable.

Use case would be to create a custom column for "Related Titles" or "See this", then add some Book IDs, that could be clicked on the details pane to select the linked titles.
Comfy.n is offline   Reply With Quote
Old 09-20-2022, 10:18 PM   #2
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,943
Karma: 62040409
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Theoretically I think this would be possible if you use a tag-like column to store the book IDs and then a composite (taglike?) HTML column to build them into URLs. I'm not sure how it'd work in practice.

Take a look at this post, though it's using the built-in identifiers rather than a custom column to build from: https://www.mobileread.com/forums/sh...12&postcount=2

Last edited by ownedbycats; 09-20-2022 at 10:21 PM.
ownedbycats is offline   Reply With Quote
Advert
Old 09-20-2022, 10:55 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,073
Karma: 6425108
Join Date: Sep 2020
Device: Calibre E-book viewer
It never ceases to amaze me how many Calibre "hidden" features I keep forgetting and rediscovering.

I knew there was a template editor for custom columns, but couldn't find it...

The secret portal is on the right-click, as shown in attached cap!
Attached Thumbnails
Click image for larger version

Name:	MWSnap0620 2022-09-20, 23_47_17.png
Views:	117
Size:	32.1 KB
ID:	196666  
Comfy.n is offline   Reply With Quote
Old 09-21-2022, 12:07 AM   #4
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,073
Karma: 6425108
Join Date: Sep 2020
Device: Calibre E-book viewer
The most I was able to do, so far, was create custom columns for isbn and amz identifiers, using the approach from your referenced post:

Code:
 {identifiers:select(isbn)}
I think I'd prefer to reference the Calibre Library Book id...

In trying to guess how to do this, I got template errors for {select(book_id)} and {select(id)}...

The search id:"=22" returns "book number 22" in the library.
Shouldn't {select(id)} work?

edit: all I needed was simply {id} in the template field.
Now, on to the tricky part...

edit 2: Well, while it was nice to have the built-in 'id' show up in details panel (which wasn't selected in "displayed metadata"), I think what I wanted is too difficult to implement without some plugin interaction.

Last edited by Comfy.n; 09-21-2022 at 01:44 AM.
Comfy.n is offline   Reply With Quote
Old 09-21-2022, 01:47 AM   #5
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,752
Karma: 27405072
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Comfy.n View Post
Is it possible to add clickable Book Ids on the Book Details pane (right side of the UI)?

Or else, can I make clickable references using the Calibre URL scheme in some field? I have tried adding <calibre://show-book/mylib/100> in comments, but it isn't clickable.

Use case would be to create a custom column for "Related Titles" or "See this", then add some Book IDs, that could be clicked on the details pane to select the linked titles.
calibre:// is a URL, to make clickable in HTML you need to wrap it in <a ref > tags. Easiest way to do that in the Comments editor is to press Ctrl+L where you want it, and that will pop this dialogue:

Click image for larger version

Name:	Screenshot 2022-09-21 153749.jpg
Views:	127
Size:	50.2 KB
ID:	196668

With the values I entered, this HTML is generated

Code:
<p><a href="calibre://show-book/_hex_-54657374/311"><span style="color: #6cb4ee">The Fishing Fleet</span></a></p>
BetterRed is offline   Reply With Quote
Advert
Old 09-21-2022, 02:01 AM   #6
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,073
Karma: 6425108
Join Date: Sep 2020
Device: Calibre E-book viewer
Quote:
Originally Posted by BetterRed View Post
calibre:// is a URL, to make clickable in HTML you need to wrap it in <a ref > tags. Easiest way to do that in the Comments editor is to press Ctrl+L where you want it, and that will pop this dialogue:

Attachment 196668

With the values I entered, this HTML is generated

Code:
<p><a href="calibre://show-book/_hex_-54657374/311"><span style="color: #6cb4ee">The Fishing Fleet</span></a></p>
wheeeeeeeeeeeee, that works!





Hey BR, what programs do you recommend for screenshots?

While I love MWSnap, for its auto-saving template and other features, I miss annotations/drawing capabilities.

Last edited by Comfy.n; 09-21-2022 at 02:09 AM.
Comfy.n is offline   Reply With Quote
Old 09-21-2022, 04:03 AM   #7
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,752
Karma: 27405072
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Today I mainly use Windows snip and sketch, and annotate with IrfanView. Before S&S came along I used Greenshot. If S&S had autosave it would be perfect - for me.

BR
BetterRed is offline   Reply With Quote
Old 09-21-2022, 04:33 AM   #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,073
Karma: 6425108
Join Date: Sep 2020
Device: Calibre E-book viewer
Quote:
Originally Posted by BetterRed View Post
Today I mainly use Windows snip and sketch, and annotate with IrfanView. Before S&S came along I used Greenshot. If S&S had autosave it would be perfect - for me.

BR
Very nice to see that IV has that arrow feature in the Paint Dialog, I think that's essential for screenshot annotation. If XnView had that, it would be perfect :P
Comfy.n is offline   Reply With Quote
Old 09-21-2022, 05:35 AM   #9
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,835
Karma: 7030035
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Another way to do this is to generate the links directly in a composite column. An example template is attached.

This template depends on there being a column 'Text behaves like tags' named #comp2 that contains the book ids of interest. (I reuse existing test column names.) The template in column #comp3 (composite, contains html) generates a comma-separated list of clickable links from the book ids in #comp2. See the screen capture. You would normally hide #comp3 in the book list. You would of course change the lookup names to the columns you made.

Note also the column #comp2. This contains the template {id} so I can easily see them. Having this is up to you. It certainly isn't necessary.

Once set up, this is easier than pasting links into comments. The list of ids in the column is easily editable, with the resulting links automatically generated.

Here is the template. It requires calibre 6.5.
Code:
program:
	j = '';
	for id in $#mytextmult:
		if j then j = j & ', ' fi;
		j = j & '<a href="' & 'calibre://show-book/_hex_-' &
			to_hex(current_library_name()) & '/' & id & '">' & id & '</a>'
	rof
which produces this:
Click image for larger version

Name:	Clipboard01.jpg
Views:	132
Size:	170.7 KB
ID:	196675

Enhancement: the template could verify that the id actually exists, which can happen because of an input error or deleting a book. If the id doesn't exist then a message is displayed. Something like this:
Code:
program:
	j = '';
	for id in $#mytextmult:
		if j then j = j & ', ' fi;
		id_exists = book_count('id:' & id, 0);
		if id_exists != 1 then
			j = j & 'No such id ' & id
		else
			j = j & '<a href="' & 'calibre://show-book/_hex_-' &
				to_hex(current_library_name()) & '/' & id & '">' & id & '</a>'
		fi
	rof
which produces this:
Click image for larger version

Name:	Clipboard02.jpg
Views:	147
Size:	173.3 KB
ID:	196676
chaley is offline   Reply With Quote
Old 09-21-2022, 05:43 AM   #10
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,073
Karma: 6425108
Join Date: Sep 2020
Device: Calibre E-book viewer
I ended up creating three custom columns:
  • rel_id: stores the book id for the related title (just one ID allowed). It's entered manually, as the first step to accomplish what I wanted.
  • rel_urltxt: composite column with this template: calibre://show-book/mylib/{rel_id}
    This column would be enough for my use case, but it can't be clicked. So...
  • related: this one is where I get the clickable calibre URL. It's a comments field that I manually fill by copying the text from rel_urltxt, opening the Metadata Edit dialog at the "related" field, pressing control + L, and pasting it.

Note: after clicking the calibre URL, the Related Title gets selected. But I noticed that, when there's an active query on the library (search bar contains any expression), it doesn't get visually selected, unless it is one of the results of that expression
Attached Thumbnails
Click image for larger version

Name:	MWSnap0633 2022-09-21, 06_10_35.png
Views:	84
Size:	19.5 KB
ID:	196671   Click image for larger version

Name:	MWSnap0632 2022-09-21, 06_10_10.png
Views:	84
Size:	20.0 KB
ID:	196672   Click image for larger version

Name:	MWSnap0631 2022-09-21, 06_09_59.png
Views:	75
Size:	14.6 KB
ID:	196673   Click image for larger version

Name:	MWSnap0630 2022-09-21, 06_08_08.png
Views:	84
Size:	6.2 KB
ID:	196674  

Last edited by Comfy.n; 09-21-2022 at 06:37 AM.
Comfy.n is offline   Reply With Quote
Old 09-21-2022, 05:46 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,073
Karma: 6425108
Join Date: Sep 2020
Device: Calibre E-book viewer
Quote:
Originally Posted by chaley View Post
Another way to do this is to generate the links directly in a composite column. An example template is attached.

This template depends on there being a column 'Text behaves like tags' named #comp2 that contains the book ids of interest. (I reuse existing test column names.) The template in column #comp3 (composite, contains html) generates a comma-separated list of clickable links from the book ids in #comp2. See the screen capture. You would normally hide #comp3 in the book list. You would of course change the lookup names to the columns you made.

Note also the column #comp2. This contains the template {id} so I can easily see them. Having this is up to you. It certainly isn't necessary.

Once set up, this is easier than pasting links into comments. The list of ids in the column is easily editable, with the resulting links automatically generated.

Here is the template. It requires calibre 6.5.
Code:
program:
	j = '';
	for id in $#mytextmult:
		if j then j = j & ', ' fi;
		j = j & '<a href="' & 'calibre://show-book/_hex_-' &
			to_hex(current_library_name()) & '/' & id & '">' & id & '</a>'
	rof
which produces this:
Attachment 196675

Enhancement: the template could verify that the id actually exists, which can happen because of an input error or deleting a book. If the id doesn't exist then a message is displayed. Something like this:
Code:
program:
	j = '';
	for id in $#mytextmult:
		if j then j = j & ', ' fi;
		id_exists = book_count('id:' & id, 0);
		if id_exists != 1 then
			j = j & 'No such id ' & id
		else
			j = j & '<a href="' & 'calibre://show-book/_hex_-' &
				to_hex(current_library_name()) & '/' & id & '">' & id & '</a>'
		fi
	rof
which produces this:
Attachment 196676
ahhh, thank you so much!

I'm going to test that ASAP.
Comfy.n is offline   Reply With Quote
Old 09-21-2022, 05:52 AM   #12
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,835
Karma: 7030035
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Comfy.n View Post
[*]rel_urltxt: composite column with this template: calibre://show-book/mylib/{rel_id}
This column would be enough for my use case, but it can't be clicked. So...
It can be clicked if you use this template
Code:
<a href="calibre://show-book/mylib/{#rel_id}">{#rel_id}</a>
chaley is offline   Reply With Quote
Old 09-21-2022, 06:23 AM   #13
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,073
Karma: 6425108
Join Date: Sep 2020
Device: Calibre E-book viewer
Quote:
Originally Posted by chaley View Post
It can be clicked if you use this template
Code:
<a href="calibre://show-book/mylib/{#rel_id}">{#rel_id}</a>
That worked, thank you.
I had tried inserting the <a> tag before, but for some reason it didn't "take".
Later I'll have more time to play with all these custom columns you've remarkably contributed to Calibre.

Last edited by Comfy.n; 09-21-2022 at 06:25 AM.
Comfy.n is offline   Reply With Quote
Old 09-21-2022, 07:16 AM   #14
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,073
Karma: 6425108
Join Date: Sep 2020
Device: Calibre E-book viewer
Quote:
Originally Posted by chaley View Post
Another way to do this is to generate the links directly in a composite column. An example template is attached.
That's perfect! I was indeed missing the possibility of adding multiple titles, and this template enables that. Later I'll play more with it.
Attached Thumbnails
Click image for larger version

Name:	MWSnap0634 2022-09-21, 08_08_08.png
Views:	54
Size:	2.5 KB
ID:	196687  
Comfy.n is offline   Reply With Quote
Old 09-21-2022, 01:48 PM   #15
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: 30,069
Karma: 57259778
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by BetterRed View Post
Today I mainly use Windows snip and sketch, and annotate with IrfanView. Before S&S came along I used Greenshot. If S&S had autosave it would be perfect - for me.

BR
The old Windows Snipping tool
theducks is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to style (CSS) Custom columns/fields in Book details pane? What are their IDs? 01100001 Library Management 4 09-16-2022 11:06 AM
book details pane tracis035 Calibre 7 11-04-2016 12:00 AM
Is there a way to change the color of the clickable links in the book details pane? nalyd Calibre 3 07-08-2016 02:38 AM
Calibre:Book Cover size in Book Details side pane & Edit Metadata Individually window Volfer Calibre 3 01-05-2016 01:56 PM


All times are GMT -4. The time now is 02:15 AM.


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