Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 03-02-2024, 12:39 PM   #16
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,730
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by tgiladi View Post
I am using this code in the template.xhtml file to create the jacket (this is at the bottom of the code):
<snip>
I guess you are using a text custom column, not a composite. One problem: the base64 string isn't html so calibre wraps it in valid tags and adds escapes to make it html. The data is considered html if it starts with a '<'.

If it is a composite column then you can't make it work until my changes are released.

Assuming it isn't a composite column, I think you would be better served by putting the entire URL into the custom column. This would make the column html and puts you in control of its formatting. For example, put this in the column assuming the image is a png:
Code:
<img src="data:png;base64, <base64 string for image>" width="100" style="vertical-align: top">
then refer to it in your jacket template as in:
Code:
<p align="center" dir="rtl" style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; background-color: transparent">{_author_image}</p>
Note that I haven't tried this, but from what I see in the code it should work.
Quote:
If only I could somehow pull the information stored in the author notes and use it in the template.xhtml, that would have solved the problem. I thought it might be a property like {author.notes}, but that didn't work.
I have submitted code to @kovid that does this. I will post here when (if) it exists in master calibre source.

When it exists in calibre, you would create a composite column with the template something like this:
Code:
program: get_note('authors', $authors, '')
I tested it with this column definition.
Click image for larger version

Name:	Clipboard01.jpg
Views:	33
Size:	48.0 KB
ID:	206642

then put this in the jacket template:
Code:
<div><b>{_composite_label}:</b> {_composite}</div>
Note that it works only if you have one author. If you have more than one author then you must loop through the author names to find notes then do something reasonable when you find them.

Last edited by chaley; 03-02-2024 at 12:43 PM. Reason: fixed [code] formatting
chaley is offline   Reply With Quote
Old 03-02-2024, 02:07 PM   #17
tgiladi
Enthusiast
tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.
 
Posts: 26
Karma: 30486
Join Date: Dec 2023
Device: Kindle Oasis
Thanks again for your help and patience, really appreciated. Unfortunately, putting the entire URL didn't work, the unwanted tags are still created. So, for now, I will continue as I have: e.g. manually paste my table with the author details and image into the comments section and have that added to the jacket when polishing.
But I'm hopeful that your code for getting the notes does end up added to Calibre, because that would be the best solution overall.
I'm also happy to have learned about the notes section since it allows me to save this table for each author within Calibre itself (I noticed there's even import/export option), and that's really great.
tgiladi is offline   Reply With Quote
Old 03-03-2024, 06:08 AM   #18
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,730
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
The changes I mentioned in post #16 are now in calibre source, as are the changes so composite columns work in jacket templates.

Here is a capture of a jacket. The image and the text just above it are in the author notes.
Attached Thumbnails
Click image for larger version

Name:	Clipboard01.jpg
Views:	27
Size:	74.6 KB
ID:	206655  

Last edited by chaley; 03-03-2024 at 06:13 AM. Reason: Add image of the example jacket
chaley is offline   Reply With Quote
Old 03-04-2024, 05:10 AM   #19
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: 991
Karma: 6417070
Join Date: Sep 2020
Device: Calibre E-book viewer
Quote:
Originally Posted by chaley View Post
I tested it with this column definition.
Attachment 206642
I've tested this mostly out of curiosity, as I haven't yet figured all the possibilities this feature opens. It goes pretty well with the GR Author Notes plugin styling:
Attached Thumbnails
Click image for larger version

Name:	MWSnap 2024-03-04, 07_04_13.png
Views:	29
Size:	761.1 KB
ID:	206685   Click image for larger version

Name:	MWSnap 2024-03-04, 07_40_11.png
Views:	22
Size:	133.4 KB
ID:	206686  

Last edited by Comfy.n; 03-04-2024 at 05:41 AM.
Comfy.n is offline   Reply With Quote
Old 03-08-2024, 01:33 AM   #20
tgiladi
Enthusiast
tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.
 
Posts: 26
Karma: 30486
Join Date: Dec 2023
Device: Kindle Oasis
Oh, wow thanks!
I'm going to give it a try, it looks like it would make my life so much easier

Edit:
So I've followed the example in post #16 excatly. It works as described for showing the author notes as either a pop-up (if the column is visible in the book list) or as part of the metadata.
But I am having the same problem with inserting it into my jacket, as I did before.
The code in my template for the jacket is excatly like the example in post #16:
Code:
<div><b>{_composite_label}:</b> {_composite}</div>
But when the jacket is created, this is what the code looks like:
Code:
<div><b>composite:</b> &lt;div&gt;
&lt;p&gt;some details about the author&lt;/p&gt;&lt;/div&gt;</div>
I have only put some text into the author's note, for testing purposes. So there are no complicated tables or images that might have caused this. But I guess the template doesn't understand that data inside the composite column is supposed to be html.

Any idea how to work around that?

Last edited by tgiladi; 03-08-2024 at 03:25 AM. Reason: Reporting the result of the test
tgiladi is offline   Reply With Quote
Old 03-08-2024, 06:58 AM   #21
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,730
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by tgiladi View Post
I have only put some text into the author's note, for testing purposes. So there are no complicated tables or images that might have caused this. But I guess the template doesn't understand that data inside the composite column is supposed to be html.

Any idea how to work around that?
The changes to make composite columns work in book jackets haven't been released yet. If you want to try them then you must run calibre from source.

Last edited by chaley; 03-08-2024 at 07:00 AM.
chaley is offline   Reply With Quote
Old 03-08-2024, 10:04 AM   #22
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,730
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by chaley View Post
The changes to make composite columns work in book jackets haven't been released yet. If you want to try them then you must run calibre from source.
You can avoid running from source. See https://www.mobileread.com/forums/sh...d.php?t=359648
chaley is offline   Reply With Quote
Old 03-08-2024, 01:02 PM   #23
tgiladi
Enthusiast
tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.tgiladi can even cheer up an android equipped with a defective Genuine Personality Prototype.
 
Posts: 26
Karma: 30486
Join Date: Dec 2023
Device: Kindle Oasis
Quote:
Originally Posted by chaley View Post
You can avoid running from source. See https://www.mobileread.com/forums/sh...d.php?t=359648
Amazing! I installed the beta and tried again. Everything worked perfectly. Thanks a lot!
tgiladi is offline   Reply With Quote
Old 03-09-2024, 05:27 PM   #24
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: 991
Karma: 6417070
Join Date: Sep 2020
Device: Calibre E-book viewer
Today I played a bit with the html inside the GR Author Notes plugin, with the purpose of making the composite column fit better in the book details pane. It wasn't easy, so I'd say it was more like the html + css were playing ME.

Changing the picture size was simple, only a matter of adding width to the img tag. Eventually I was able to style the first cell, the one containing the author name, which was the hardest part. Whatever i tried, I would get this styling <strong style="font-family: 'Arial','sans-serif'; font-size: xx-large; color: #ffffff"> Author name </strong></h1></td>, instead of font-size: small or h4/h5 etc... Actually, I can't even tell exactly what was the solution.

I'm not sure I'm going to settle down with the current CSS, so it would be great if there was some sort of search and replace scripting to bulk-change the html code inside the notes.

I'm sharing the modified version in the attachment in case someone wants to help me tweak it; the only modified file was authornotes.py, in the plugin root folder. I won't request the plugin author a more detailed styling feature, because it must be very difficult to implement, and the plugin is already amazing.

Images below show what it looked like before and after the changes I managed to do:

before
Click image for larger version

Name:	before MWSnap 2024-03-09, 18_25_15.png
Views:	18
Size:	240.0 KB
ID:	206792

after
Click image for larger version

Name:	after MWSnap 2024-03-09, 18_29_54.png
Views:	16
Size:	197.4 KB
ID:	206791

I had also changed the font-family tag but reverted to Arial for broader compatibility. Arial Narrow seemed a good choice to make the table narrower, but it looked blurry.

edit: corrected some padding asymmetry from 1 to 3 in the beginning of the modified plugin. edit2: added some extra styling to enforce centered alignment
Attached Files
File Type: zip GR Author Notes---modified---.zip (3.13 MB, 12 views)

Last edited by Comfy.n; 03-27-2024 at 01:59 AM.
Comfy.n is offline   Reply With Quote
Old 03-10-2024, 12:21 PM   #25
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: 991
Karma: 6417070
Join Date: Sep 2020
Device: Calibre E-book viewer
Thanks to new Export/Import Notes action, I was able to bulk edit the html and fit nicely the notes generated in the book details pane.

It was cool to find that Notepad++ can process 1600+ files all at once, though I'm sure there must be some text replacement tool more fitting to this task.

These were the replacements I made:

--------------------------------
font-size: xx-large

font-size: large
----------------------------
<img style=

<img width="140" style=
-----------------------------
font-size: 14px

font-size: 12px
------------------------------
<h1

<h4
-------------------------
h1>

h4>
--------------------------------

-----------------------
Attached Thumbnails
Click image for larger version

Name:	MWSnap 2024-03-10, 13_06_21.png
Views:	19
Size:	203.9 KB
ID:	206829   Click image for larger version

Name:	2024-03-10 12_56_27-Import notes.png
Views:	17
Size:	5.6 KB
ID:	206830  
Comfy.n is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't see description/comments scarlettruin Devices 1 02-02-2019 04:37 PM
Metadata/Comments/Book Description not showing up on Nook Semco Devices 3 10-29-2017 02:48 PM
Incorrect styling with specific CSS quiris Marvin 9 07-04-2016 01:04 PM
Styling Elements in CSS - ADE and Sony toskpro Sony Reader 0 07-19-2010 01:55 PM
CSS Styling not showing up in digital editions sjkramer Sigil 9 01-30-2010 10:46 AM


All times are GMT -4. The time now is 06:25 PM.


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