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-13-2023, 08:15 AM   #1
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,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Possible new feature for book details

I am considering adding the ability to display the output of templates in the comments section of book details. The output can go at the top or at the bottom.

Rationale: there are times when one wants to display something more complicated without creating a composite column for it. The template could generate arbitrary html, combine columns together, or both. Examples: tables of links to other books, text from multiple columns combined into a single display, books in a series sorted by %read, and so on.

The rationale is similar to why I added template searches -- permitting complex searches without requiring making a dedicated column.

The question: is this something people would use? No reason to build and maintain it if not.
chaley is offline   Reply With Quote
Old 03-13-2023, 09:19 AM   #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,608
Karma: 61176603
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
This is something I think I could use.

Example: I have a composite taglike called #links to display links using urls_from_identifiers. As this is only intended for the Book Details and not for sorting/displaying in the list, it makes sense to move it over.

Quote:
Originally Posted by chaley View Post
The rationale is similar to why I added template searches -- permitting complex searches without requiring making a dedicated column.
This also made me wonder if the columns I use only for sorting books in a specific way via View Manager could somehow be deprecated as well.

Example: The composite #onreadinglist lets me sort the series-like #readinglist to the top without reversing the series order.

Click image for larger version

Name:	2023-03-13 11_52_29-Customize View Manager.png
Views:	72
Size:	50.0 KB
ID:	200299

Last edited by ownedbycats; 03-13-2023 at 12:22 PM.
ownedbycats is offline   Reply With Quote
Advert
Old 03-14-2023, 10:29 PM   #3
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
I would like to have this feature as well. I actually has a composite column only for this purpose (displaying only in books details). I would imagine this feature will improve performance.
capink is offline   Reply With Quote
Old 03-21-2023, 12:29 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: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
The lack of demand tells me that this isn't something I should build, at least as described. This is expecially true given you can get the same behavior by creating a composite column, hiding it in the book view, and using the new "Show with comments in book details" option.

However, I am considering an alternate approach: providing a way to register a "generator function" for a composite column. If this works out then when the value of a composite column is required, calibre calls the generator function instead of calling the template processor. The generator must return a string matching the composite column type definition: date, number, or text. If text then it can be HTML, markdown, or plain text.

This scheme allows a plugin to do more-or-less arbitrary computations to produce the column value. For example, it could display:
  • an HTML table of links for the book.
  • bibliographic information about the authors
  • timelines for series
  • information about book editions
  • formatted bookmarks
  • ...
Because these are normal composites they would work in search and sort, as well as be displayable in book details. They could be displayed in the book list if the callback is fast enough.
chaley is offline   Reply With Quote
Old 03-21-2023, 11:43 PM   #5
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,608
Karma: 61176603
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I'm afraid I don't really understand. do you have an example of how this would differ from a regular composite column?
ownedbycats is offline   Reply With Quote
Advert
Old 03-22-2023, 06:22 AM   #6
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,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
I'm afraid I don't really understand. do you have an example of how this would differ from a regular composite column?
The generator function can do things that a template can't, or at least shouldn't. For example, it can keep information in the calibre database and produce images.

Some examples:

1) An "author information" plugin. This plugin would store information about an author such as descriptive text, pen names, pictures, location, languages, book lists, what-have-you. The plugin would register itself as a generator function, which would be called when book details is displayed. The plugin would build HTML of the information based on the current book using authors or some other column, which book details would display.

2) Should DaltonST choose, he could display the output of the Notes Viewer in book details. His plugin would be called when details for a book are displayed. It would return the HTML interpretation of the note that it currently generated. His Entity Manager might have similar possibilities.

3) A "series" plugin that returns information about the current series, for example text that describes the universe, offshoot series, reading order, and the like.

4) A plugin that generates a graph of book ratings with the current book highlighted. The graph could be by genre, series, author, library, or what-have-you.
chaley is offline   Reply With Quote
Old 03-22-2023, 09:53 AM   #7
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,608
Karma: 61176603
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
That can be useful
ownedbycats is offline   Reply With Quote
Old 03-22-2023, 02:18 PM   #8
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 399
Karma: 1121267
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
Quote:
Originally Posted by chaley View Post
Some examples:

1) An "author information" plugin. This plugin would store information about an author such as descriptive text, pen names, pictures, location, languages, book lists, what-have-you. The plugin would register itself as a generator function, which would be called when book details is displayed. The plugin would build HTML of the information based on the current book using authors or some other column, which book details would display.

[...]

3) A "series" plugin that returns information about the current series, for example text that describes the universe, offshoot series, reading order, and the like.
  1. So I enter all data in this generator/PI and it will be displayed in book details?
  2. No need of custom columns and composite columns for this kind of info anymore?
  3. It's searchable?
  4. It's sortable? I don't think so
My main focus would be pen-names, related books and series.

If that were possible without a big template thing, I would be very pleased. My calibre has already become noticeably slower in the meantime

Last edited by Wiggo; 03-22-2023 at 02:21 PM.
Wiggo is offline   Reply With Quote
Old 03-22-2023, 02:30 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: 11,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Wiggo View Post
  1. So I enter all data in this generator/PI and it will be displayed in book details?
  2. No need of custom columns and composite columns for this kind of info anymore?
  3. It's searchable?
  4. It's sortable? I don't think so
My main focus would be pen-names, related books and series.

If that were possible without a big template thing, I would be very pleased. My calibre has already become noticeably slower in the meantime
I can't control what a "generator" plugin will do. I don't intend to write such a plugin. Also note that there is no guarantee that a generator will be fast. It could slow down the display of book details if, for example, it does web queries to generate the displayed information.

As for no need for other custom columns, that depends on what you use them for. Perhaps some eventual plugin can replace them -- I can't say.

The generator plugin will have the option of providing searchable text. However, like all searches this will find books, not (for example) series information. The plugin can provide its own interface to search the series info.

It isn't clear to me what it means to sort by the generated text. It might be meaningless given that "sort" works on the booklist, not the stored series information.
chaley is offline   Reply With Quote
Old 03-22-2023, 03:35 PM   #10
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,608
Karma: 61176603
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Do you have any examples of a generator function that a user can setup without someone first making a custom plugin?
ownedbycats is offline   Reply With Quote
Old 03-22-2023, 05:05 PM   #11
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,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
Do you have any examples of a generator function that a user can setup without someone first making a custom plugin?
No I don't. The generator must work in some semantic domain and use/control data related to that domain. If it doesn't then they are no different from bog-standard templates.
chaley is offline   Reply With Quote
Old 03-22-2023, 06:11 PM   #12
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,565
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Could a generator plugin access a library other than the current library.

Example: glean content from my Books library to be shown in the Book Details of my Comics Library?

BR
BetterRed is offline   Reply With Quote
Old 03-22-2023, 06:19 PM   #13
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,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by BetterRed View Post
Could a generator plugin access a library other than the current library.

Example: glean content from my Books library to be shown in the Book Details of my Comics Library?

BR
Yes, but performance could be an issue. Opening another library in order to display book details could be unacceptably slow. I don't know. A "performance problem" could be mitigated with caching, for example if the timestamp on the "other" metadata.db hasn't changed, but I can't say if this makes sense in the context you are envisioning.

What I need, really, is someone who is interested in making a generator plugin (almost certainly a User Interface Plugin that registers a generator function), so we can work out exactly how (and whether) it would work.
chaley is offline   Reply With Quote
Old 03-22-2023, 09:29 PM   #14
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,087
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by chaley View Post
What I need, really, is someone who is interested in making a generator plugin (almost certainly a User Interface Plugin that registers a generator function), so we can work out exactly how (and whether) it would work.
Does this have to be a dedicated plugin, or can it be done from and existing plugin e.g. writing custom or builtin actions for Action Chains.

I can make the plugin call the actions to register the generator functions. if possible, would it need a restart whenever a custom action is added through the module editor?
capink is offline   Reply With Quote
Old 03-23-2023, 05:02 AM   #15
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,740
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by capink View Post
Does this have to be a dedicated plugin, or can it be done from and existing plugin e.g. writing custom or builtin actions for Action Chains.
I am thinking that it would be done in interface plugins by registering a function to be a generator for a lookup key.
Quote:
I can make the plugin call the actions to register the generator functions. if possible, would it need a restart whenever a custom action is added through the module editor?
I don't see a need to restart. A second call to the registration function would override the first. If the registration function no longer exists then "normal" processing would happen.

However, this does point out the need to be able to unregister a generator.

I am going to think about this a bit while looking at this. The idea might be an elegant solution to something I have thought about for months -- how to provide meta information about books such as author biographies and the like.
chaley is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Clickable Book IDs on Book details pane Comfy.n Calibre 26 04-11-2023 02:38 PM
Stop seeing book details when I open a book in Android Jo69 Android Devices 5 03-27-2021 05:41 AM
Calibre:Book Cover size in Book Details side pane & Edit Metadata Individually window Volfer Calibre 3 01-05-2016 01:56 PM
Dragging a book over the Book Details window Ripplinger Calibre 18 07-18-2013 01:19 PM
Book details under book list - not on the right side ILB Library Management 3 06-22-2013 03:46 PM


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


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