rmutt92 / obsidian-counter

MIT License
7 stars 4 forks source link

Can't find Counter in the Community plugins list ? #3

Open I-Pch opened 1 year ago

I-Pch commented 1 year ago

Hi there 😊 !

I'm sorry, I don't want to pressure anyone but I really would love to see this plugin added to the Obsidian Community plugin list 😁 !

I saw there was a PR and some changes were requested https://github.com/obsidianmd/obsidian-releases/pull/1835#issuecomment-1511272505 ... but it stops there πŸ˜” ...

So my question is, any chance to see this plugin added to the list at some point in time ? πŸ˜‡

(I really don't want to sound entitled here and I'm sorry if I unintentionaly do 😢 ... It's just that I'm not a dev so all I can do is ask questions πŸ˜” )

rmutt92 commented 1 year ago

Hi, Pch! Thanks for the message!

I'm not a dev too so I got stuck there 🀣 Unfortunately, my enthusiasm for Obsidian is now kind of off and it's not really managed now...

But yes, I'm so happy to hear this kind of message from Obsidians. So, I'd love to find a time to retry the request again πŸ”₯ You definitely made its priority higher for me!

wanderloots commented 1 year ago

I also could not find this plugin in the community plugin list, but am very interested! I think it would make for a great pairing with the new Core Properties Plugin.

As an alternative, if you don't mind, maybe you could explain how you get the view count to increase? It's possible we can merely add it as a new Property with the latest update.

Any help is much appreciated 😊

rmutt92 commented 1 year ago

I'm not familiar with that new Core Properties Plugin thing, but I'd be happy if it helps you and the communityπŸŽ‰:

This line does the job. https://github.com/rmutt92/obsidian-counter/blob/20b00c2872a82f99f70ee01ade9b6663d774a506/main.ts#L83C4-L84C1 this.app.workspace.on('file-open', () => { this.updateCounter('Open File'); })

Every time a file is opened, the updateCounter() should be called with passing the id 'Open FIle'. No confidence about whether this is the best way to do this, but it was at least sufficient for my use case.

I couldn't find out how to do this with registerEvent function, which is used for updating page edits/modification. this.registerEvent(this.app.vault.on('modify', () => { this.updateCounter('Modify'); }));

I hope I could have explained this better, but this was my first time writing TypeScript and I'm still a noob 😎 Hope it helps anyway!

wanderloots commented 1 year ago

Thank you!

The core properties is an insider update that converts the frontmatter into a property table that can take in dynamic info. It's kind of like Notion properties for notes to make the YAML more easily adjustable and templatable.

I think I somewhat understand what you are saying but I'll need to learn more about coding to implement it.

Do you know why the counter plugin doesn't show up in the community plugins section? (I'm new to github and obsidian so you may have already explained haha)

rmutt92 commented 1 year ago

Sounds great feature!

So, the thing is that a plugin must be written correctly to be included in the Obsidian community plugin list. I once submitted a request to the Obsidian team to have it added to the official list, and they provided me with feedback on what needed to be fixed. However, I haven't touched yet 🫣