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 03-17-2021, 11:50 PM   #1
CloudReader
Member
CloudReader began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Mar 2021
Device: Kindle Paperwhite 4
Automatically load 'template' into Comments field?

Hello, folks

I've been searching and reading posts for a few hours, now, and can't seem to find what I'm looking for (probably just not using the correct terminology...).

I want to add a 'template' to the Comments field of each new book I catalogue, containing some HTML code to display alternate/back covers, special characters (—…), etc., and a formatted 'About the Author' section.

Is there anywhere in Calibre to enter this so it's automatically picked up and added, instead of me having to copy/paste each time?

Here's hoping...
CloudReader is offline   Reply With Quote
Old 03-18-2021, 12:25 AM   #2
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: 21,717
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by CloudReader View Post
Hello, folks

I've been searching and reading posts for a few hours, now, and can't seem to find what I'm looking for (probably just not using the correct terminology...).

I want to add a 'template' to the Comments field of each new book I catalogue, containing some HTML code to display alternate/back covers, special characters (—…), etc., and a formatted 'About the Author' section.

Is there anywhere in Calibre to enter this so it's automatically picked up and added, instead of me having to copy/paste each time?

Here's hoping...
Not that I know of, might be possible to create a file type plugin, see GetFileName as an example ==>> Index of plugins.

BR
BetterRed is offline   Reply With Quote
Advert
Old 03-18-2021, 01:39 AM   #3
CloudReader
Member
CloudReader began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Mar 2021
Device: Kindle Paperwhite 4
Quote:
Originally Posted by BetterRed View Post
Not that I know of, might be possible to create a file type plugin, see GetFileName as an example ==>> Index of plugins.
Thanks for the suggestion
Took a brief look at the thread (didn't read all 23 pages...), and if there's a solution there, I fear it might be above my paygrade/skill set. I've never created or dissected a plugin before

I originally just wanted to insert two special characters, an emdash and the ellpisis, as I use both of them heavily in comments and grew tired of typing the codes each time. It seemed natural (to me, anyway) that there would be a section somewhere in the configuration where you could add code or text to automatically populate to a new entry, but no such animal...
As time went on, the 'snippet' has grown to include all the aforementioned things.
I use a clipboard manager and have the 'template' in it all the time, but that still requires bringing it up, copying, tabbing back to Calibre, clicking in the Comments area and pasting.
CloudReader is offline   Reply With Quote
Old 03-18-2021, 06:11 AM   #4
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: 21,717
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
I was suggesting you have a look at the GFN plugin code not the thread, it's the zip that's attached to the first post.

FWIW: I use a gadget that comes with the Transtools add-in for Word to insert single special chars, I think its packaged with the free version of Transtools, I have it set to pop on Ctrl+Win+S, viz:

Click image for larger version

Name:	Screenshot 2021-03-18 204611.jpg
Views:	232
Size:	16.0 KB
ID:	186030

And Clipboard Fusion is good for boilerplate snippets, I have it set to pop a list of named snippets on Alt+Win+P.

For this sort of thing I prefer tools that work everywhere, rather than application specific tools.

BR
BetterRed is offline   Reply With Quote
Old 03-18-2021, 07:34 AM   #5
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,440
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by CloudReader View Post
Hello, folks

I've been searching and reading posts for a few hours, now, and can't seem to find what I'm looking for (probably just not using the correct terminology...).

I want to add a 'template' to the Comments field of each new book I catalogue, containing some HTML code to display alternate/back covers, special characters (—…), etc., and a formatted 'About the Author' section.

Is there anywhere in Calibre to enter this so it's automatically picked up and added, instead of me having to copy/paste each time?

Here's hoping...
Two ideas:
  • You could do this with a custom column "built from other columns", with "Show as HTML in book details" checked. The calibre language template would compute the HTML for what you want to see, using other metadata.
  • You create a custom comments column with an empty "template". You then manually add the data to the column instance when you add a new book.
Personally, I would do the former. That way the result is always up-to-date even if metadata changes.
chaley is offline   Reply With Quote
Advert
Old 03-18-2021, 12:00 PM   #6
CloudReader
Member
CloudReader began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Mar 2021
Device: Kindle Paperwhite 4
Quote:
Originally Posted by BetterRed View Post
I was suggesting you have a look at the GFN plugin code not the thread, it's the zip that's attached to the first post.
Well, I opened up one of the files but don't really see anything that I could use - I know next to nothing about Python programming.

Quote:
Originally Posted by BetterRed View Post
...Clipboard Fusion is good for boilerplate snippets, I have it set to pop a list of named snippets on Alt+Win+P.
This sounds much more promising - I think I could live with a macro that inserted my template.
Might you share your macro?
CloudReader is offline   Reply With Quote
Old 03-18-2021, 12:30 PM   #7
CloudReader
Member
CloudReader began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Mar 2021
Device: Kindle Paperwhite 4
Quote:
Originally Posted by chaley View Post
Two ideas:
  • You could do this with a custom column "built from other columns", with "Show as HTML in book details" checked. The calibre language template would compute the HTML for what you want to see, using other metadata.
  • You create a custom comments column with an empty "template". You then manually add the data to the column instance when you add a new book.
Personally, I would do the former. That way the result is always up-to-date even if metadata changes.
Thank You for the suggestions
The first one works... kinda - It adds the empty template to the details pane, but everything gets all jumbled up with the existing details.
Also, this is display-only - I want the actual data to reside within the metadata file of the book, able to save with it to disk, etc.

The second one: I tried creating a custom comments column and adding my code, but it doesn't seem to retain the template - The field is blank when adding a new book.
Also, this would force me to have to go to the Custom Metadata tab to access/edit it, and I stay away from there if I can. I have several added columns (Origin, Price, Read, Retail) but they are all of the yes/no or checkbox variety, accessible from the main Calibre catalog window when adding the new book.

Without there being a built-in mechanism for adding a template to the Comments field, I suppose that a manual system like I've been using is going to be the only way...
CloudReader is offline   Reply With Quote
Old 03-18-2021, 04:36 PM   #8
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: 21,717
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by CloudReader View Post
This sounds much more promising - I think I could live with a macro that inserted my template.
Might you share your macro?
I don't need a Clipboard Fusion (CF) macro for this.
  1. I type text wherever I am - Word, Browser, Onenote, etc;
  2. I select and copy it to the clipboard in the normal way - i.e Ctrl+C;
  3. CF maintains a list of most recent clips (200 works for me), which I pop with Win+Alt+C;
  4. The context menu in that list has an option to Pin an item, which puts it in the the Pinned items (snippets) list, i.e. the one I pop with Win+Alt+P;
  5. The Pinned items popup has context menu options to order the list, search the list, name, remove, and edit items etc
The following is an item named 'CalPlugs' from my Pinned Item list:

Index of plugins --- which is:

Code:
[url=https://www.mobileread.com/forums/showthread.php?t=118764][b][u]Index of plugins[/b][/u][/url]
BR

Last edited by BetterRed; 03-18-2021 at 04:48 PM.
BetterRed is offline   Reply With Quote
Old 03-18-2021, 04:43 PM   #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: 12,440
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by CloudReader View Post
Also, this is display-only - I want the actual data to reside within the metadata file of the book, able to save with it to disk, etc.
It does. Calibre stores custom metadata in the book when sent to device, saved to disk, or polished. For composite (computed) columns both the template and the last calculated value are stored.
chaley is offline   Reply With Quote
Old 03-21-2021, 11:18 AM   #10
CloudReader
Member
CloudReader began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Mar 2021
Device: Kindle Paperwhite 4
Quote:
Originally Posted by BetterRed View Post
I don't need a Clipboard Fusion (CF) macro for this...
Hmm... I was almost able to reproduce your results with CP, but in the long run, it's still a two- or three-step process, while I had envisioned it to be only one.

I can do basically the same thing with QCopy, the clipboard manager I'm using now. I have the 'template' pinned in it, and ctrl-Q brings it up where I can choose and copy it. I was hoping for a global macro where I could remain in Calibre and simply hit the key combination to copy into it...

*sigh* I'll just continue to plod along like I've been doing.

Thank You for all the help, BR
CloudReader is offline   Reply With Quote
Old 03-21-2021, 11:31 AM   #11
CloudReader
Member
CloudReader began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Mar 2021
Device: Kindle Paperwhite 4
Quote:
Originally Posted by chaley View Post
It does. Calibre stores custom metadata in the book when sent to device, saved to disk, or polished. For composite (computed) columns both the template and the last calculated value are stored.
I don't think I'm understanding - Would I be building the data from separate columns? And then it would only appear in the Details pane?

I'm just used to having everything 'physically' (you know what I mean ) in the Comments field of the entry, where I can read/edit it, and it then gets saved in the OPF file of the book.
CloudReader is offline   Reply With Quote
Old 04-21-2021, 06:17 PM   #12
cgrapski
Enthusiast
cgrapski began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Dec 2016
Device: Kindle
I actually was having the same idea today - I'd like a standard template that I can use to build the Comments container with for all books - where I can have a section to add links to notes on the book, have a place for the contents of a book, a place for author information, a place for translator information, etc.

I have no idea how to do this though - I have my head spinning around as I stumbled on the idea while I was trying to clean up my libraries. And haven't gotten much of that done today - and never got to the reading and note taking I should be doing now.
cgrapski is offline   Reply With Quote
Old 12-19-2023, 08:37 PM   #13
CloudReader
Member
CloudReader began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Mar 2021
Device: Kindle Paperwhite 4
Quote:
Originally Posted by cgrapski View Post
I actually was having the same idea today - I'd like a standard template that I can use to build the Comments container with for all books - where I can have a section to add links to notes on the book, have a place for the contents of a book, a place for author information, a place for translator information, etc.

I have no idea how to do this though - I have my head spinning around as I stumbled on the idea while I was trying to clean up my libraries. And haven't gotten much of that done today - and never got to the reading and note taking I should be doing now.
So sorry, @cgrapski - I didn't see your comment until today...

Here is the 'template' that I use, simply copying/pasting it into the Comments field:

Code:
<p>—…</p>
<p style="font-style: italic; font-weight: bold"><span style="color: #ff0000">NOTE: </span></p>
<p><a href="https://www.imdb.com/title//"><img src="file:///E:/~eBooks/~~~~~Temp/imdb.gif" width="40"></a> <strong>YEAR Movie with </strong><a href="https://www.imdb.com/name//"><strong style="color: #6cb4ee">ACTOR</strong></a><strong> &amp; </strong><a href="https://www.imdb.com/name//"><strong style="color: #6cb4ee">ACTOR</strong></a></p>
<hr>
<h3>My Review</h3>
<p style="font-weight: bold">TAGLINE</p>
<blockquote>*** NOTE: I received an advance eBook copy and this is my honest review *** </blockquote>
<blockquote>REVIEW</blockquote>
<hr>
<h3>About the Author</h3>
<p>.</p>
<p>★<span style="font-family: 'Arial','sans-serif'; font-size: 14px">✅</span>➜</p>
<p>. <strong style="color: #000000; background-color: #00ff00">Website</strong></p>
<hr>
<h2 align="center">Alternate/Back Cover</h2>
<p align="center"><a href="file:///E:/~eBooks/~~~~~Temp/Covers/"><img src="file:///E:/~eBooks/~~~~~Temp/Covers/" width="150"></a></p>
<hr>
<h2 align="center">Floating Images</h2>
<p><a href="file:///E:/~eBooks/~~~~~Temp/"><img src="file:///E:/~eBooks/~~~~~Temp/" width="150" style="float: right; margin-left: 0.5em"></a></p>
<p><br></p>
You have to be in the HTML Source tab for this to work.

An explanation of the different sections:
  • First there are an Em Dash and a Vertical Ellipsis (three dots), as I use them quite frequently in the first line of the book's description and got tired of having to bring up the clipboard manager every time I needed to use one.

Then my book's description goes here, followed by...
  • The Note section in Red to draw attention.
  • Next is a section to list an IMDb link if the book has a Movie/TV tie-in. There's also a local link to an IMDb icon, which (if you use any of this code) you'll have to alter to point to whatever folder you're storing your images in. I also have a couple of Actors' links, in case maybe I want to remember that Danny DeVito was the star
  • Then we have the My Review section, for books that I've reviewed and want to keep a record of what I said.
  • Next up we have an About the Author section where you can put, you guessed it, info/bio/whatever about the book's author(s). I considered including a small avatar-like pic, but that seemed like way too much trouble to go to.

    There's a few special characters that I've used from time to time in author's descriptions and decided to include in the template: a Star ★ (maybe for ratings, whatever); a Checkbox ✅; and an Arrow ➜ (was going to substitute it for the normal List icon, but QT won't allow me to do that...).

    One thing I did make is a highlight for the author's website/blog/etc. I didn't like QT's choice of colors for the link, so that's why there's complete background- and link colors in there.
  • On to the Alternate/Back Cover section, where I link to covers.

Note that something is broken? in Calibre version 7.0 and beyond - Image links are not working, forcing me to go back to 6.29.0 until the issue is resolved...
  • The last section, the Floating Images one, is there so I can keep the formatting handy for floating an image left or right (I forget easily...) - With Omnibus editions of series, I include the synopsii of each volume along with the front cover, staggered from left to right in the comments.

I hope this is helpful for you - I have no idea how mystified or proficient you may be with HTML, so I tried to explain - If you need more help, don't hesitate to ask! I'm not a wizard with HTML, but I get by and I'll try to help

--CloudReader
CloudReader is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Template: field vs raw_field ownedbycats Library Management 5 03-24-2021 05:27 AM
How to automatically add comments MarcDS Library Management 3 09-01-2017 05:23 PM
Comments field emeybee Calibre 1 05-27-2010 02:01 PM
Comments field banjomike Calibre 7 04-08-2010 02:18 PM
Comments field hyperact Calibre 3 12-28-2008 01:38 PM


All times are GMT -4. The time now is 11:39 PM.


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