Giter Club home page Giter Club logo

obsidian-ibook-plugin's Introduction

Hey there! I'm bingryan.

👨🏻‍💻 About Me

  • 🤔   A whimsical man,love freedom, enjoy freedom.

obsidian-ibook-plugin's People

Contributors

bingryan avatar machinly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

machinly silloy

obsidian-ibook-plugin's Issues

Not compatible with Obsidian 1.5.3?

I've managed to install version 2.0.12 of this plugin, but no options are available for it in Obsidian and there are no commands for using it.

According to the Obsidian settings I use "Current version: v1.5.3" and "(Installer version: v1.4.16)" of Obsidian.

I also use macOS 10.15.7 (19H2026).

Would you consider supporting the delta sync/incremental backup feature?

The current plug-in is very good 👍🏻, but the original folder must be deleted every time it is imported, and it cannot be overwritten or incrementally synchronized on the existing basis.

I hope you will consider supporting the delta sync feature.

  1. The same book, updated to the latest highlights and notes.
  2. When the highlights and notes of the book have not changed, do not adjust.

If a book is deleted in iBooks, the highlights and annotations of the deleted book will be hidden when the plug-in is used to reimport all books.
It is hoped that the highlights and annotations will not be adjusted during incremental synchronization.

I need some help!

Thank you for creating this plugin!But when I use the parameters your provide to to modify my note template,I found that I couldn't get the cover, abstract, ISBN, etc. of the book in iBook. So I hope you can tell me how to go about solving these problems.

Update the same file with updated annotations

I really appreciate your work on this plugin. It is amazing. But I wish you add a very basic feature as explained below.

Problem

If I import a book into obsidian it makes the file accordingly based on the template mentioned. And I can see you have added an option to rename the old file when importing a updated instance of the same book. It won't even import the same book with the off. Really painful.

Possible solution

I am using a plugin called Obsidian Zotero Integration. It pulls the entries in my Zotero library and then creates a file in the said location according to the defined template.

Now, the best part is that it follows something called Nunjucks templating language. I don't know the technical stuff much but it made the plugin really amazing.

What it does?

Well simply saying it just prevents part of the defined template to not be overwritten every time the user initiate the import to add the new annotations into pre-existent file. For more information please check this section of obsidian zotero plugin

I can add {% persist "id" %} nothing is changed inside this {% endpersist %}

For example I am attaching a part of my zotero import code here

{% persist "annotations" %}
{% set newAnnotations = annotations | filterby("date", "dateafter", lastImportDate) %}
{% if newAnnotations.length > 0 %}

### Imported on {{importDate | format("DD MMM, YYYY HH:mm")}}

{% for annotation in newAnnotations -%}

> [!{{annotation.colorCategory|lower}}|{{annotation.colorCategory|lower}}]+ Annotation
> {%- if annotation.annotatedText -%} {{annotation.annotatedText}} ([pg. {{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}}&annotation={{annotation.id}})){% endif %}
> {% if annotation.imageRelativePath %}![[{{annotation.imageRelativePath}}]]{% endif %}
> >{% if annotation.comment %} [!note]- comment
> > {{annotation.comment}}{%- endif %}

{% endfor %}

{% endif %}
{% endpersist %}

Outcome

  • Make it easier to manage annotations
  • No file clutter

Some additional fields

Very cool plugin, adding some notes on improving, if it's possible.

Is there a way of getting these details in too?

  1. & 2) - Under the book title and language, I'd like to see these two things:
    last_highlight: {{latest instance of ZANNOTATIONMODIFICATIONDATE}}
    highlight_count: {{number of records per book}}

If you could have a look


  1. Add on each highlight:
    Highlighted: {{ZANNOTATIONMODIFICATIONDATE}}

You are pulling this, but it will needs some logic to convert it to readable data.
Looking into it, will report back.

My Template:

---
book: {{library.ZSORTTITLE}}
author: {{library.ZAUTHOR}}
language: {{library.ZLANGUAGE}}
last_opened: {{library.ZLASTOPENDATE}}
last_highlight: {{latest instance of ZANNOTATIONMODIFICATIONDATE}} -- WANT
highlight_count: {{number of records per book}} -- WANT
tags:
- highlights/iBooks
---
# 📔 {{library.ZSORTTITLE}}
---
{{#if library.ZBOOKDESCRIPTION}}

# 🧾 Description
---
	{{{library.ZBOOKDESCRIPTION}}}
{{/if}}

# 🔍 Highlights
---

{{#group annotation by="ZFUTUREPROOFING5"}}
#### 📚{{value}}
---

{{#each items}}
{{#if ZANNOTATIONSELECTEDTEXT}}
{{#is ZANNOTATIONSTYLE 5}}
- 🎯 <mark style="background: #C4B3D9;">{{ZANNOTATIONSELECTEDTEXT}}</mark>
{{/is}}
{{#is ZANNOTATIONSTYLE 4}}
- 🎯 <mark style="background: #E6A5AB;">{{ZANNOTATIONSELECTEDTEXT}}</mark>
{{/is}}
{{#is ZANNOTATIONSTYLE 3}}
- 🎯 <mark style="background: #EDD570;">{{ZANNOTATIONSELECTEDTEXT}}</mark>
{{/is}}
{{#is ZANNOTATIONSTYLE 2}}
- 🎯 <mark style="background: #A8BADE;">{{ZANNOTATIONSELECTEDTEXT}}</mark>
{{/is}}
{{#is ZANNOTATIONSTYLE 1}}
- 🎯 <mark style="background: #B0D17F;">{{ZANNOTATIONSELECTEDTEXT}}</mark>
{{/is}}
{{#is ZANNOTATIONSTYLE 0}}
- 🎯 <mark style="background: #FFD9B3;">{{ZANNOTATIONSELECTEDTEXT}}</mark>
{{/is}}
{{/if}}
{{#if ZANNOTATIONNOTE}}
        - ✍️ {{ZANNOTATIONNOTE}}
{{/if}}
<sub>Last Highlighted: {{ZANNOTATIONMODIFICATIONDATE}}</sub>
---
{{/each}}
{{/group}}
Source::  [Apple Books Link](ibooks://assetid/{{library.ZASSETID}})

ZCOVERURL and ZPAGECOUNT parameters do not get populated

A few parameters do not get populated when importing notes from an Apple Books entry:
ZCOVERURL and ZPAGECOUNT
I got the param names from https://github.com/bingryan/obsidian-ibook-plugin/blob/master/docs/parameters.md

Template:

# 📔 Book: {{library.ZSORTTITLE}}

**Book cover URL**:: {{library.ZCOVERURL}}
**Page count**:: {{library.ZPAGECOUNT}}

**Author**:: {{library.ZAUTHOR}}

**LANGUAGE**:: {{library.ZLANGUAGE}}

Gets rendered as:
image

Ideally I want to show the book cover in my Obsidian note

help request: highlighted text's color.

Thank you for your plugin.
I'm trying to modify it a bit to import to obsidian text with it's highlighted color (yellow, blue...) but failing to find the parameter.
Could you please help me out?

Why iBook PDF won't export?

👋 @bingryan, I appreciate your more Obsidian-direct automation of the ibooks_notes_exporter tool, cheers!

Request

I've been trying to figure why my iBook PDFs won't export via your tool. (Normal iBooks seem to work just fine.)

🙏 Would you mind reviewing if your tool works for exporting PDFs? And if not, will you kindly consider the feature request? If not able, will you kindly consider filtering out PDFs from your search since they won't work as a bug?

I'll go through manual scripting if needed as an alternative to munach/obsidian-extract-pdf-annotations and/or akaalias/obsidian-extract-pdf-highlights in order to customize back to the formatting you've defined which I prefer if expanding to include PDFs ends up not being within scope. TIA!

Example

Playing forward troubleshooting steps from #49, I checked

  1. I highlighted the first text of example How to Make a Complete Map of Every Thought You Think.pdf (original URL reference) PDF has text highlighted(/annotated) on page#0. For good measure I also highlighted & left a comment on page#iii.
    image
  2. Your "Obsidian iBook" tool has workable settings for testing
    image
  3. Using ibook: export by search for "how to make a complete" shows my PDF title and submitting does not DevTool console error
    image
    image
    downloads$ echo "
    >         SELECT
    >             *
    >         FROM ZBKLIBRARYASSET
    >         WHERE ZASSETID == '3821D2BFD7B808DE03C5F042C99A2A55'
    >     " | sqlite3 ~/Library/Containers/com.apple.iBooksX/Data/Documents/BKLibrary/BKLibrary-1-091020131601.sqlite -json
    [{"Z_PK":210,"Z_ENT":5,"Z_OPT":22,"ZCANREDOWNLOAD":1,"ZCOMBINEDSTATE":1,"ZCOMPUTEDRATING":null,"ZCONTENTTYPE":3,"ZDESKTOPSUPPORTLEVEL":0,"ZDIDRUNFORYOUENDOFBOOKEXPERIENCE":null,"ZDIDWARNABOUTDESKTOPSUPPORT":0,"ZFILESIZE":526770,"ZGENERATION":1,"ZHASRACSUPPORT":0,"ZISDEVELOPMENT":0,"ZISDOWNLOADINGSUPPLEMENTALCONTENT":null,"ZISEPHEMERAL":0,"ZISEXPLICIT":null,"ZISFINISHED":null,"ZISHIDDEN":0,"ZISLOCKED":0,"ZISNEW":1,"ZISPROOF":0,"ZISSAMPLE":0,"ZISSTOREAUDIOBOOK":null,"ZISSUPPLEMENTALCONTENT":0,"ZISTRACKEDASRECENT":null,"ZMETADATAMIGRATIONVERSION":null,"ZNOTFINISHED":null,"ZPAGECOUNT":0,"ZRATING":0,"ZSERIESISCLOUDONLY":null,"ZSERIESISHIDDEN":null,"ZSERIESNEXTFLAG":null,"ZSERIESSORTKEY":0,"ZSORTKEY":0,"ZSTATE":1,"ZTASTE":0,"ZTASTESYNCEDTOSTORE":0,"ZLOCALONLYSERIESITEMSPARENT":null,"ZPURCHASEDANDLOCALPARENT":null,"ZSERIESCONTAINER":null,"ZSUPPLEMENTALCONTENTPARENT":null,"ZASSETDETAILSMODIFICATIONDATE":719171132.39047099071,"ZBOOKHIGHWATERMARKPROGRESS":0.0,"ZBOOKMARKSSERVERMAXMODIFICATIONDATE":null,"ZCREATIONDATE":709921075.50168004337,"ZDATEFINISHED":null,"ZDURATION":0.0,"ZEXPECTEDDATE":null,"ZFILEONDISKLASTTOUCHDATE":null,"ZLASTENGAGEDDATE":null,"ZLASTOPENDATE":719171132.39014991421,"ZLOCATIONSERVERMAXMODIFICATIONDATE":null,"ZMODIFICATIONDATE":719171132.39014991421,"ZPURCHASEDATE":709921074.19790002609,"ZREADINGPROGRESS":0.0,"ZRELEASEDATE":null,"ZUPDATEDATE":719170411,"ZVERSIONNUMBER":0.0,"ZACCOUNTID":null,"ZASSETGUID":"23FCD756-0212-425D-AD20-1DF509E72D48","ZASSETID":"3821D2BFD7B808DE03C5F042C99A2A55","ZAUTHOR":"Lion Kimbro","ZBOOKDESCRIPTION":null,"ZBOOKMARKSSERVERVERSION":null,"ZCOMMENTS":null,"ZCOVERURL":null,"ZCOVERWRITINGMODE":null,"ZDATASOURCEIDENTIFIER":"com.apple.ibooks.datasource.ubiquity","ZDOWNLOADEDDSID":null,"ZEPUBID":"","ZFAMILYID":null,"ZGENRE":null,"ZGROUPING":null,"ZKIND":null,"ZLANGUAGE":null,"ZLOCATIONSERVERVERSION":null,"ZPAGEPROGRESSIONDIRECTION":null,"ZPATH":"/Users/stef/Library/Mobile Documents/iCloud~com~apple~iBooks/Documents/How to Make a Complete Map of Every Thought You Think.pdf","ZPERMLINK":null,"ZPURCHASEDDSID":null,"ZSEQUENCEDISPLAYNAME":null,"ZSERIESID":null,"ZSERIESSTACKIDS":null,"ZSORTAUTHOR":"Lion Kimbro","ZSORTTITLE":"How to Make a Complete Map of Every Thought You Think","ZSTOREID":null,"ZSTOREPLAYLISTID":null,"ZTEMPORARYASSETID":null,"ZTITLE":"How to Make a Complete Map of Every Thought You Think","ZVERSIONNUMBERHUMANREADABLE":null,"ZYEAR":null}]
    downloads$ echo "
    >         SELECT
    >             *
    >         FROM ZAEANNOTATION
    >         WHERE ZANNOTATIONASSETID == '3821D2BFD7B808DE03C5F042C99A2A55'
    >         ORDER BY ZPLLOCATIONRANGESTART,ZFUTUREPROOFING6
    >     " | sqlite3 ~/Library/Containers/com.apple.iBooksX/Data/Documents/AEAnnotation/AEAnnotation_v10312011_1727_local.sqlite -json
    # NULL
    
  4. Note in (3) that PDF JSON did export but no annotations returned in your second custom SQLite query, so the resulting page only has top-level PDF details but no annotations
    image

Many books not imported

After using this plugin to import my iBook-annotations into Obsidian, I found that many (most?) annotated books in my iBooks library weren't imported.

If I open and close one of the missing books using books.app and then again try to import with the ibook plugin, the book's annotations are imported as expected.

It seems the ibook-plugin only imports annotations from books that have been recently opened in books.app.


According to the Obsidian settings I use "Current version: v1.5.3" and "(Installer version: v1.4.16)" of Obsidian.
I also use macOS 10.15.7 (19H2026).

Chapter titles are missing

First of all, very useful plugin!

I'm currently using Obsidian version 1.5.8.

Using the default template, importing my highlights works fine so far, but the titles of the chapters in which the highlight occurs are missing:

CleanShot 2024-02-23 at 12 44 50

I've tried it with other books too, but it didn't work with these either. Is there a quick fix to it?

Thanks in advance

ISSUE

Thank you for creating this plugin!But there is a issue,I can not find this plugin after I click COMMAND+P,and I also can not set this plugin,wish your reply,thank you.

Dates not working

Various date properties are just pushing the current date/time instead of the relevant date/time. I have this in my template:

Last Highlight: {{date ZANNOTATIONMODIFICATIONDATE "YYYY/MM/DDTHH:mm:ss "}}
Date Finished: {{date ZDATEFINISHED "YYYY/MM/DDTHH:mm:ss" }}

Both don't work. Also, I tried on a book that isn't finished and it still puts in the current date/time.

Bug: No book page created when ':' is in book title

Hello!

Let me preface by thanking the developer for making this plugin. It greatly enhances my obsidian experience.

I found a small bug. Whenever a book title contains a ':', no book page will be created when the export command is called. This is likely due to the book title not being sanitized and/or Obsidian not accepting ':' in a note title.

To @bingryan, consider sanitizing the book title; or making a check in export.ts that checks for forbidden characters in note titles.

To users, a temporary override can be created either in export.ts (line 100) when building from source or in the obsidian config file when it's already downloaded (line 47084 in main.js). Replace ${contentname}.md with overide.md. You can then import books with ':' in the title, and then manually changing the title as all new imports will be named override.md.

Why won't a certain book import?

Hello,
I was able to import four books to my Obsidian vault, lovely. Canceling Readwise in 4... 3... 2...
However on the fifth book, it just seemed to silently fail.
There are many highlights in the book, and it's the same format as the others, which is epub, but it just doesn't show up in the target folder.
How can I troubleshoot this please?
Thanks for any guidance

The best plugin of my 2023

Didn't sure about if issue should be used in this way, but... thanks for making this plugin, I am dedicated to using Obsidian and iBook, just be amazed by your plugin, all best wishes to you!

Variation of the template - handlebars help

Great idea for a plugin!

I have a question, I dont know the templating language good enough.

Currently the annotation has the form (included template)

- section 1
	- annotation A
 - section 1
	-  annotation B
 - section  2
	- annotation C

I would like to have following effect

- section 1
	 - annotation A
	 - annotation B
 -  section 2
	 -  annotation C

how to access previous item in handlebars and compare value of ZFUTUREPROOFING5, and add value of ZFUTUREPROOFING5 to file only if it is different from the previous one?
I need to write a custom helper? I never used handlebars/js.

Deleted books still displayed in ibook export options

Deleted books (from Apple Books) are still displayed in book export options. Reinstalling ibook plugin, logging out of iCloud, and restarting the workstation does not resolve the issue. Is there a way to clear the cache or folder?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.