Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 09-21-2024, 03:55 PM   #61
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,447
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by justanotheruser. View Post
I’d really appreciate some help in seeing if we can get some more field options please?

I’m hoping to get pages (page length), isbn and published year as options when sending to obsidian. I normally have the book sync plugin do this for me but with these implementations I would not need that plugin anymore.

@jm289765

Otherwise, can someone show me where I could add that myself? If it is possible?
Preferences: Add your own columns
theducks is offline   Reply With Quote
Old 09-21-2024, 07:16 PM   #62
justanotheruser.
Junior Member
justanotheruser. began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Sep 2024
Device: Kindle iOS, Kindle PC, Calibre
Quote:
Originally Posted by theducks View Post
Preferences: Add your own columns
Thanks, I have now added that for isbn. Haven’t figured out pages count yet, but I’ll try.

I’m looking for how to implement that into this plugin so that it also comes into obsidian when it is imported. I tried just adding the {isbn} tag but looks like it isn’t supported.

Any idea how I would do that please?
justanotheruser. is offline   Reply With Quote
Old 09-22-2024, 08: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
Old 09-22-2024, 08:40 AM   #64
justanotheruser.
Junior Member
justanotheruser. began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Sep 2024
Device: Kindle iOS, Kindle PC, Calibre
Quote:
Originally Posted by jm289765 View Post
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.
Wow, thank you for such a detailed response from the developer of the plugin themselves. Thank you. I can’t wait to delve into it.

While you are here, is there any chance you could point me in the direction to inherit the chapter number for the highlights/annotations that are coming through please? Similar to when exporting in .md through annotations

That is literally the only other thing I would need to make this perfect for importing in one go.

Again, thank you for taking the time to respond.
justanotheruser. is offline   Reply With Quote
Old 09-22-2024, 02:42 PM   #65
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,447
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Do you really need a custom column for ISBN?
This number can be INCLUDED in identifiers
The search is just a bit more complex to extract just that.

Code:
identifiers:=isbn:=123456789 will find books with a type equal to ISBN having a value equal to 123456789.
BTW custom columns are always referenced by their lookup name which get a leading (#name}
theducks is offline   Reply With Quote
Old 09-23-2024, 09:22 AM   #66
jm289765
Enthusiast
jm289765 began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Jan 2023
Device: calibre
Quote:
Originally Posted by justanotheruser. View Post
While you are here, is there any chance you could point me in the direction to inherit the chapter number for the highlights/annotations that are coming through please? Similar to when exporting in .md through annotations
Use toc_family_titles from the annotation's json object.

Instead of make_book_format_dict, you would add this one to make_highlight_format_dict.

Code:
highlight_format = {
    ...
    chapter_title: str(annot["toc_family_titles"])
}
jm289765 is offline   Reply With Quote
Old 10-02-2024, 12:02 PM   #67
retval
Enthusiast
retval began at the beginning.
 
Posts: 34
Karma: 10
Join Date: Mar 2011
Device: none
Greetings, I am trying to use this plugin, but it does not recognize the specific folder inside my vault. I have thought that maybe the path is too long and I have shortened it, but it still doesn't work.

I get the following error message:
Vault not found.
A vault could not be found for the URL.

The address of the vault is this
D:\NUESTROS DOCUMENTOS\CHRISTIAN\Bobeda de notas OBSIDIAN\Mi boveda
I appreciate your help.
retval is offline   Reply With Quote
Old 10-08-2024, 09:41 AM   #68
jm289765
Enthusiast
jm289765 began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Jan 2023
Device: calibre
Quote:
Originally Posted by retval View Post
Greetings, I am trying to use this plugin, but it does not recognize the specific folder inside my vault. [...]
H2O uses the "vault" and "file" parameters when using the Obsidian URI. Maybe Obsidian defaults to only checking the C:\ drive, and it might be fixable by either changing H2O to use the "path" URI parameter or by moving your vault from your D:\ drive to your C:\ drive.

Alternatively, if your vault is on a USB stick or something similar, your Obsidian installation might not be aware that the vault exists. You can fix that by opening the vault in Obsidian.

It's also possible that your H2O config is wrong. Under Config -> Other Options, the "Obsidian vault name" setting should be the name of the folder that has a folder called .obsidian inside it. The name of the sub-folder inside your vault should be specified in Config -> Formatting Options -> Note title format.
jm289765 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
KOReader Highlights in Obsidian Edo78 KOReader 5 10-30-2023 10:12 PM
[GUI Plugin] Noosfere_util, a companion plugin to noosfere DB lrpirlet Plugins 2 08-18-2022 04:15 PM
[GUI Plugin] Save Virtual Libraries To Column (GUI) chaley Plugins 14 04-04-2021 06:25 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 01:27 PM


All times are GMT -4. The time now is 07:55 AM.


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