readwiseio / obsidian-readwise

Official Readwise plugin for Obsidian
GNU General Public License v3.0
239 stars 23 forks source link

YAML and other meta data - Is this mic on? #47

Open writtenfool opened 9 months ago

writtenfool commented 9 months ago
Amparose commented 9 months ago

They really need to give us proper, full template instead of the piecemeal segments. Customising where the h1 tag goes, for instance, would fix the infernal extra line-break after the h1.

It's frustratingly close to perfect but far enough that I am hesitant to fully integrate it into my system.

Actually, I don't understand your points:

With "Use Custom Formatting" on, there's a "YAML front matter" section that you can move things from the confusingly named "Page metadata". Just make sure you format it correctly for front-matter like:

Author: {% if author %}{{author}}{% endif %}
Title: {{full_title}}
{% if url -%}
url: {{url}}
{% endif -%}

This might solve these two issues you have?

Amparose commented 9 months ago

After fiddling with this a bit, there are definitely issues that need to be resolved to avoid generating invalid front-matter:

So yeah, you're right, this plugin isn't great past the "out of the box" template, which is now out of date.

writtenfool commented 9 months ago

Regarding YAML, if you create a property in a readwise generated note in Obsidian, the readwise plugin isn't aware of it. So, if you delete the readwise file to refresh it on the next running of the plugin, that yaml element is destroyed. This means you can't do anything with a readwise file on the Obsidian side except refer to it with links in another note.

In the Readwise and Obsidian discord, several folks provided jinja code that parses multiple authors.

I know it's possible to navigate the obsidian headers programmatically in an Obsidian note, Dataview does this quite well with file.lists .

Cheers!

tyler-dot-earth commented 3 weeks ago

While frustrating for some use-cases, I think these are compelling reasons to treat readwise exports as read-only given how the plugin works right now. You may also find value in my readwise to obsidian template configurations — I've solved a few of the issues you have talked mentioned.

That said, I share many of these frustrations - particularly the lack of more template variables across all export sections.

writtenfool commented 3 weeks ago

Is it possible for the plugin to check if a incoming note exists in Obsidian, and, if so, preserve whatever is in the yaml (properties) and replace the rest of the note with the incoming content? Just add an option in the plugin for how to handle this conflict.

Or, maybe I don't understand where the work is done in this plugin. Are the markdown files created on the Readwise digs and then simply inserted as new notes in Obsidian?

Thanks, btw, appreciate you folks looking into this interface and adding functionality!

Cheers!

tyler-dot-earth commented 3 weeks ago

@writtenfool

Is it possible for the plugin to check if a incoming note exists in Obsidian, and, if so, preserve whatever is in the yaml (properties) and replace the rest of the note with the incoming content? Just add an option in the plugin for how to handle this conflict.

Or, maybe I don't understand where the work is done in this plugin. Are the markdown files created on the Readwise digs and then simply inserted as new notes in Obsidian?

For the specific pain of not clobbering existing properties, that may be able to be fixed in the plugin.

A quick look into the code and here's what I'm seeing:

It's also worth noting that none of the code in the links above handle frontmatter specifically.

So tl;dr yes, I think the plugin could be modified to avoid clobbering the YAML - it would just be additional logic.

I don't work for Readwise, but I will consider working on this if I get some time. Other contributors should feel free to work on it as well.

I'm currently working on improving the reliability of sync functionality - see this comment if you're curious.

Thanks, btw, appreciate you folks looking into this interface and adding functionality!

:heart_hands:

writtenfool commented 3 weeks ago

@tyler-dot-earth - you are a SAINT !

We should probably start using properties instead of yaml and frontmatter. Yaml is the markdown name for this top section in a note and frontmatter is the obsidian api name for the same thing, but properties is the feature in Obsidian that folks know to assign meta data to notes.

Bummer about the archive, if only the plugin could iterate it locally, note by note.

Are you a Obsidian user? Reason I bring this up, most folks won't see this discussion. There's only six of us that are watching. If we want more feedback, we might consider mentioning these conversations on the Obsidian Discord.

And, btw, tl;dr is ok with me; happy to help.

I'd come back as a subscriber to Reader and Readwise in a heartbeat if some of this stuff could happen in the interface. Reader is freaking awesome.

tyler-dot-earth commented 3 weeks ago

@tyler-dot-earth - you are a SAINT !

:angel:

@writtenfool: We should probably start using properties instead of yaml and frontmatter. Yaml is the markdown name for this top section in a note and frontmatter is the obsidian api name for the same thing, but properties is the feature in Obsidian that folks know to assign meta data to notes.

Note quite. Frontmatter is metadata at the beginning of the file - typically YAML at the beginning of a markdown file (as in Obsidian's case). Properties are Obsidian's branding for the markdown's frontmatter - it's just a friendly interface on top of the YAML. Open any of your notes with properties - they're just YAML frontmatter.

Bummer about the archive, if only the plugin could iterate it locally, note by note.

It can. That's exactly what's going on here: https://github.com/readwiseio/obsidian-readwise/blob/4de9c9331e939e3c6ef6289071504592b2cb141a/src/main.ts#L265-L268

Are you a Obsidian user? Reason I bring this up, most folks won't see this discussion. There's only six of us that are watching. If we want more feedback, we might consider mentioning these conversations on the Obsidian Discord.

I am an Obsidian user. The Obsidian discord, Readwise discord, Readwise subreddit are good places to rally for your cause. You might also consider just submitting a feature request in the app so it can end up on their feature tracking board.

I'd come back as a subscriber to Reader and Readwise in a heartbeat if some of this stuff could happen in the interface. Reader is freaking awesome.

Great info for the Readwise team, though worth noting that I'm just a random contributor :)

writtenfool commented 3 weeks ago

Lemme think on this, I don't have time and you don't either. If I reach out to Obsidian discord or subreddit folks, they would get excited and up for it, but no body available to do the work; letdown ain't healthy.

I am not a current readwise subscriber so their feature tracking isn't available.

My interest is that there is value in keeping this plugin updated routinely and, from my vantive the Readwise folks have dumped us :(

They were such hard chargers when they announced this on the Obsidian discord three years ago. But not a peep since.

Well, if nothing else, we've left a small kindle here, maybe somebody will notice this Obsidian SOS.

Cheers!