omnivore-app / logseq-omnivore

Logseq plugin to fetch articles and highlights from Omnivore
MIT License
278 stars 15 forks source link

How to display highlight note as a child bullet to the highlight? #130

Open stephanmax opened 10 months ago

stephanmax commented 10 months ago

OK, I feel like I am making a stupid mistake, because I see my wanted behavior in a lot of screenshots around. I would like to see the highlight note as a child bullet to the quoted highlight. Just like in this screnshot:

However, the default highlight template seems to add the note as a property and trying

> {{{text}}} [⤴️]({{{highlightUrl}}}) {{#labels}} #[[{{{name}}}]] {{/labels}}

{{#note.length}}{{{note}}}{{/note.length}}

just adds the text in the same block. I also tried copy’n’pasting a tab character into the template editor, but then Logseq throws an error.

What did I do wrong? How can I achieve the same structure as in the screenshot above? Many thanks in advance!

yitsushi commented 8 months ago

I tried to achieve the same, I couldn't, it seems no matter what happens they will end up in the same block.

For now I just changed the ordering so it's:

{{#note.length}}{{{note}}}{{/note.length}}

> {{{text}}} [⤴️]({{{highlightUrl}}}) {{#labels}} #[[{{{name}}}]] {{/labels}}

That way my note pops out more and easier to read "my note -> reference".

mbaker3 commented 5 months ago

I'm, trying to accomplish the same. It seems 6ee5090b7d140c0b8d153b166cd6aa9af54d8556 removed that behaviour and it was released as part of 1.12.5.

I can't find any explanation about why the change was made but it would be a really nice feature to bring back as an option in settings. Ideally we could dictate blocks ourselves in the templates but that seems like a much bigger ask.

jacksonh commented 5 months ago

/cc-ing @sywhb I believe this was an issue with Logseq's plugin api not being able to create the child block.

sywhb commented 5 months ago

yeah, logseq does not allow us to create nested blocks when generating the content from the template

mbaker3 commented 5 months ago

That's fair. Can we add a third template in the settings for highlight notes that can be optionally defined? If there is a template defined then the nested child block is created. Otherwise the nested child isn't.

It can be on the user to make sure they remove the note variable from their highlight template if they don't want to see the note duplicated.

It seems block content is less particular about the characters used than property values are. This change might also mitigate #176 🤷.