hadynz / obsidian-kindle-plugin

Sync your Kindle notes and highlights directly into your Obsidian vault
MIT License
922 stars 52 forks source link

[BUG] Notes are not distinct from highlights #221

Open putzwasser opened 1 year ago

putzwasser commented 1 year ago

Describe the bug

The plugin imports my highlights and my notes, but notes and highlights appear in the same way. Maybe this is because I'm using a fairly old kindle paperwhite 2 (from 2013), which might have a different clippings syntax.

I tried to make use of obsidian's callout syntax for my notes. Highlights are meant to be [!quote] callouts and notes are meant to be [!idea] callouts. This is my template:

> [!quote] [Author :: {{ authorsLastNames }} ] (Source :: {{ title }} ) | [Page :: {{ page }}] | [Loc :: [{{ location }}]({{ appLink }}) ]
> {{ text }}

{% if note %}> [!idea] (Source :: {{ title }} ) | [Page :: {{ page }}] | [Loc :: [{{ location }}]({{ appLink }}) ]
> {{ note }}{% endif %}

***

As I said, the plugin imports all clippings, but uses—for some reason—the {{ text }}/highlight template for everything. This makes it hard to distinguish between highlights and notes.

Method of syncing

To Reproduce

Steps to reproduce the behaviour:

  1. Download my My Clippings.txt
  2. import the clippings
  3. Share error(s) from Developer Tools console ==> There are no errors

Produced note

The plugin creates this note

---
kindle-sync:
  bookId: '51471'
  title: Using Fragments in Android
  author: Lars Vogel
  highlightsCount: 4
---
# Using Fragments in Android
## Metadata
* Author: [[Lars Vogel]]

## Highlights
> [!quote] [Author :: Vogel ] (Source :: Using Fragments in Android ) | [Page :: 11] | [Loc :: [161]() ]
> Improved interface implementation check. ^ref-34200

***
> [!quote] [Author :: Vogel ] (Source :: Using Fragments in Android ) | [Page :: 11] | [Loc :: [155]() ]
> if (activity instanceof OnItemSelectedListener) {       listener = (OnItemSelectedListener) activity;     } else {       throw new ClassCastException(activity.toString()           + " must implemenet MyListFragment.OnItemSelectedListener");     } ^ref-20113

***
> [!quote] [Author :: Vogel ] (Source :: Using Fragments in Android ) | [Page :: 25] | [Loc :: [376]() ]
> Direct access to fragment's methods ^ref-56895

***
> [!quote] [Author :: Vogel ] (Source :: Using Fragments in Android ) | [Page :: 25] | [Loc :: [373]() ]
> DetailFragment fragment = (DetailFragment) getFragmentManager()             .findFragmentById(R.id.detailFragment);         if (fragment != null && fragment.isInLayout()) {           fragment.setText(link);         }    } ^ref-63956

***

Expected behaviour

I expected a note containing these contents:

---
kindle-sync:
  bookId: '51471'
  title: Using Fragments in Android
  author: Lars Vogel
  highlightsCount: 4
---
# Using Fragments in Android
## Metadata
* Author: [[Lars Vogel]]

## Highlights

***
> [!quote] [Author :: Vogel ] (Source :: Using Fragments in Android ) | [Page :: 11] | [Loc :: [155]() ]
> if (activity instanceof OnItemSelectedListener) {       listener = (OnItemSelectedListener) activity;     } else {       throw new ClassCastException(activity.toString()           + " must implemenet MyListFragment.OnItemSelectedListener");     } ^ref-20113

> [!idea] [Author :: Vogel ] (Source :: Using Fragments in Android ) | [Page :: 11] | [Loc :: [161]() ]
> Improved interface implementation check. ^ref-34200

***

> [!quote] [Author :: Vogel ] (Source :: Using Fragments in Android ) | [Page :: 25] | [Loc :: [373]() ]
> DetailFragment fragment = (DetailFragment) getFragmentManager()             .findFragmentById(R.id.detailFragment);         if (fragment != null && fragment.isInLayout()) {           fragment.setText(link);         }    } ^ref-63956

> [!idea] [Author :: Vogel ] (Source :: Using Fragments in Android ) | [Page :: 25] | [Loc :: [376]() ]
> Direct access to fragment's methods ^ref-56895

Screenshots

Actual note image

Expected note image

(It would be fine, if all the clippings were separated by ***, if the notes would use the [!idea] part of the template)

Metadata

My Clippings.txt

My Clippings.txt

Using Fragments in Android (Lars Vogel)
- Meine Notiz auf Seite 11 | Position 161 | Hinzugefügt am Dienstag, 26. November 2013 um 19:56:11 Uhr

Improved interface implementation check.
==========
Using Fragments in Android (Lars Vogel)
- Meine Markierung auf Seite 11 | Position 155-161 | Hinzugefügt am Dienstag, 26. November 2013 um 19:56:11 Uhr

    if (activity instanceof OnItemSelectedListener) {       listener = (OnItemSelectedListener) activity;     } else {       throw new ClassCastException(activity.toString()           + " must implemenet MyListFragment.OnItemSelectedListener");     }
==========
Using Fragments in Android (Lars Vogel)
- Meine Notiz auf Seite 25 | Position 376 | Hinzugefügt am Dienstag, 26. November 2013 um 20:15:12 Uhr

Direct access to fragment's methods
==========
Using Fragments in Android (Lars Vogel)
- Meine Markierung auf Seite 25 | Position 373-376 | Hinzugefügt am Dienstag, 26. November 2013 um 20:15:12 Uhr

    DetailFragment fragment = (DetailFragment) getFragmentManager()             .findFragmentById(R.id.detailFragment);         if (fragment != null && fragment.isInLayout()) {           fragment.setText(link);         }    }     
==========

(Even though the clippings contain code, this isn't the problem, as the behaviour occurs in all books. I just selected this part of My Clippings.txt for its brevity. The complete My Clippings.txt. contains ~13k lines)