chrisgrieser / shimmering-obsidian

Alfred Workflow with dozens of features for controlling your Obsidian vault.
https://alfred.app/workflows/chrisgrieser/shimmering-obsidian/
MIT License
817 stars 40 forks source link

[Bug]: Scratchpad Heading Feature needs a second heading #142

Closed caunus closed 1 year ago

caunus commented 1 year ago

Bug Description

HI,

my Scratchpad file looks like this:

---
aliases:
tags: []
---

# scratches

--
erstellt:  `=dateformat(this.file.ctime, "DDDD HH:mm")`
letzte Änderung: `=dateformat(this.file.mtime, "DDDD HH:mm")`
Ordner: `=this.file.folder`

Adding something to that file, also putting scratchpad#scratches into the 'Scratchpad Path' property the text will be added at the end of the file, below the line Ordner and not below the headline.

When adding another headline below # scratches it works. As workaround, because I don't want another headline I added # %%dummy%% as second headline, so it's at least hidden.

Thanks for your work, Caunus

Relevant Screenshot

No response

To Reproduce

No response

Debugging Log

No log

Workflow Configuration

Bildschirmfoto 2023-08-06 um 19 31 04

Version & System Information

I'm using the Obsidian Version Version 1.4.2 and the 3.12.8 and as all the latest versions of the recommended plugins

Last working version

just testet

Make sure you have done the following

chrisgrieser commented 1 year ago

Hi, this is not a bug, but the intended behavior.

"append below a heading" means appending to the section of the note belonging to the heading. The idea is that if you have a big file with multiple headings, you are able to append to a section of the note, instead of simply appending to the bottom of the file.

That's also why your "workaround" works: by adding a second heading, the "section" of the first heading ends earlier.

Adding content to the top of the heading section isn't really desirable, since you would reverse the chronology of your additions. (instead of old → new, you would order a section as new → old).

I clarified the phrasing in the settings, so it is more clear.

caunus commented 1 year ago

Hi, thanks your are right, may be it was my bad English, but the meaning of append is implemented! Sorry for that! But ;-), I think it's not unusual to have some kind of footer in a document as I have, also I'm not sure if there is a standard which enable you to spot this the markdown for your function. So may be working with a hidden second header might be something for the documentation or FAQ. Second, and during my testing I didn't see this behavior, because I was concentrated on finding a workaround. I disagree with your statement that adding new content on top isn't desirable. I personal prefer, the order New->Old if I'm collecting things, e.g in Pocket. Never the less this might be another function "Insert below Headline". Thanks again for your work, it looks like to be a great help working with obsidian on a Mac, it "seems", because I didn't really dive deeply into all the functionality. I have still to discover a lot helpful stuff! And sorry about my English.

chrisgrieser commented 1 year ago

Hmm yeah, reliably detecting a foot in a note might be a bit tricky. If you really prefer it the other way round, please open a feature request, and if there are more people also interested in this, I'll see that I implement it

caunus commented 1 year ago

Agree, this is tricky. I'm not a developer but I see you have to rely on some MD Objects, and a ruler might be use also in other context. So I see, the easies thing is the workaround the header hidden header. I think this is fair enough. I will add a feature request of adding stuff from new to old, but I think this might be another function "Insert below header". Will do it soon. Thanks again!