![]() |
#1 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,309
Karma: 7955525
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. |
![]() |
![]() |
![]() |
#2 | |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,561
Karma: 74000001
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:
Example: The composite #onreadinglist lets me sort the series-like #readinglist to the top without reversing the series order. Last edited by ownedbycats; 03-13-2023 at 12:22 PM. |
|
![]() |
![]() |
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,185
Karma: 1988646
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.
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,309
Karma: 7955525
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:
|
![]() |
![]() |
![]() |
#5 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,561
Karma: 74000001
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I'm afraid I don't really understand.
![]() |
![]() |
![]() |
![]() |
#6 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,309
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#7 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,561
Karma: 74000001
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
That can be useful
![]() |
![]() |
![]() |
![]() |
#8 | |
Leftutti
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 549
Karma: 1717097
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#9 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,309
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#10 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,561
Karma: 74000001
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?
|
![]() |
![]() |
![]() |
#11 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,309
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
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.
|
![]() |
![]() |
![]() |
#12 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,590
Karma: 29709834
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 |
![]() |
![]() |
![]() |
#13 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,309
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#14 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,185
Karma: 1988646
Join Date: Aug 2015
Device: Kindle
|
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? |
|
![]() |
![]() |
![]() |
#15 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,309
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
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. |
||
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
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 |