View Single Post
Old 09-22-2024, 07:20 AM   #63
jm289765
Enthusiast
jm289765 began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Jan 2023
Device: calibre
Quote:
Originally Posted by justanotheruser. View Post
I tried just adding the {isbn} tag but looks like it isn’t supported.

Any idea how I would do that please?
How to add the isbn formatting option.

Go to make_book_format_dict in highlight_sender.py. Edit the format_options dict to have an "isbn" element with the book's ISBN. The keys in this dict should be the same as the formatting options you plan to use in H2O, e.g. an "isbn" key in format_options will let you use the {isbn} tag.

You'll need to modify the make_book_format_dict function to take the book's isbn as an input. To do that, put the isbn into a dict similar to how the book titles and authors are handled, and pass that value through make_format_dict (lines 237, 705).

The value of book_titles_authors is set on line 564. The logic for calculating the value of it is in button_actions.py, lines 49 and 227-246. It should be relatively easy to make something similar for isbn.

I think db.field_for("column_name", book_id) will give you the value of custom columns via the lookup name that you choose when creating the column in calibre, but i'm not completely sure.

Formatting options for page length and pub_date can be created similarly.
jm289765 is offline   Reply With Quote