- 🤔 A whimsical man,love freedom, enjoy freedom.
bingryan / obsidian-ibook-plugin Goto Github PK
View Code? Open in Web Editor NEWexport mac ibook annotations/hightlights to obsidian vault
License: MIT License
export mac ibook annotations/hightlights to obsidian vault
License: MIT License
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).
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.
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.
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.
Can I get rid of the message that keep showing when I open Obsidian
see here: https://ibb.co/wzP4TGP
I really appreciate your work on this plugin. It is amazing. But I wish you add a very basic feature as explained below.
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.
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.
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 %}
Very cool plugin, adding some notes on improving, if it's possible.
Is there a way of getting these details in too?
If you could have a look
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}})
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:
Ideally I want to show the book cover in my Obsidian note
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?
👋 @bingryan, I appreciate your more Obsidian-direct automation of the ibooks_notes_exporter tool, cheers!
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!
Playing forward troubleshooting steps from #49, I checked
ibook: export by search
for "how to make a complete" shows my PDF title and submitting does not DevTool console errordownloads$ 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
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).
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:
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
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.
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.
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.
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
I want to use it on my phone or ipad as i don't have macbook
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!
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 (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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.