isaaclyman / novel-word-count-obsidian

Obsidian plugin. Displays a word count or other statistic for each file, folder and vault in the File Explorer pane.
https://obsidian.md/plugins?id=novel-word-count
MIT License
82 stars 8 forks source link

Add explicit include directories setting #67

Closed adamhp closed 8 months ago

adamhp commented 10 months ago

It would be nice if we could explicitly include directories. I have a Vault with mixed uses, one of them being writing, and I'd like to only include my "Writing" directory. The changes here are more of a proof-of-concept, but they work. If you'd consider supporting this feature and want me to flesh this out a bit more I can.

CleanShot 2023-12-01 at 09 26 13

Apologies for some of the formatting changes. If you have other prettier settings outside of .prettierrc I can rework these changes to adhere to style guidelines.

isaaclyman commented 10 months ago

Thanks for the PR. A few thoughts:

In the meantime, I have a couple of code changes to recommend, I'll comment them inline.

adamhp commented 10 months ago

The rationale for me for not using separate vaults is that I like not having to duplicate plugin settings across vaults, and I just prefer the consolidated organization of a single vault. I have about 10 plugins I'm using regularly and they all have pretty fine-tuned settings. I don't want to duplicate that across several vaults. I have a separate vault for my day job, but that's about the only reason I use a separate vault, and mostly so I can get my employer to pay for the commercial license for the work project stuff.

It seems very relevant to me for a plugin whose purpose is to read directories and files and display metrics about them to have the capability to configure which directories it is doing that for. Ideally I could add multiple, maybe comma-separated, and glob paths.

Your point about balancing configuration vs. complexity though, is very much understandable and if you don't feel like supporting this, it's up to you. I just thought this was relatively painless and straightforward to implement and would support my own selfish use case 😇, and I'm happy to do the leg work.

From a developer's perspective, this is how I expect pretty much everything touching my directories and files to behave. Docker, Prettier, eslint, npm, webpack, babel, git, etc.... they all have ways of meaningfully excluding or including directories being processed.

From an Obsidian user's perspective, just browsing a few of the plugins I use: obsidian-linter has a "Folders to ignore" setting; obsidian-periodic-notes has ways to configure which folders to place periodic notes in, or which to source templates from; Templater lets you configure template folders.

Some of these aren't quite parallel to the use case we're discussing, but to me, the overarching theme is "this plugin interacts with X, I should have control over how it interacts with X".

isaaclyman commented 10 months ago

Thanks for the response. I do find that persuasive. Let's get the code in a place where we're both happy with it and we can merge later this month.

Btw, would you mind including an update to the README? I don't want to forget to document the new setting.

adamhp commented 10 months ago

Sounds good! And yes, I'll definitely update the README. This was more of a proof-of-concept, so I'll flesh it out, incorporate your feedback, update the README, and do some more thorough testing.

isaaclyman commented 8 months ago

Hey @adamhp, are you able to put the finishing touches on this PR? I think I'm ready for it.

adamhp commented 8 months ago

Yep! I’ll look at it this afternoon.

On Tue, Jan 23, 2024 at 11:18 PM Isaac Lyman @.***> wrote:

Hey @adamhp https://github.com/adamhp, are you able to put the finishing touches on this PR? I think I'm ready for it.

— Reply to this email directly, view it on GitHub https://github.com/isaaclyman/novel-word-count-obsidian/pull/67#issuecomment-1907351093, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWGL5UFLI5W54CGXY2YG5LYQCDP5AVCNFSM6AAAAABAC6BEMCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBXGM2TCMBZGM . You are receiving this because you were mentioned.Message ID: @.***>

isaaclyman commented 8 months ago

@adamhp Let me know if you're too busy to finish this one and I'll pick it up.

adamhp commented 8 months ago

Hey, apologies, that suddenly may be the case. Don’t want to hold this up. Sorry about that.

On Wed, Jan 31, 2024 at 3:52 PM Isaac Lyman @.***> wrote:

@adamhp https://github.com/adamhp Let me know if you're too busy to finish this one and I'll pick it up.

— Reply to this email directly, view it on GitHub https://github.com/isaaclyman/novel-word-count-obsidian/pull/67#issuecomment-1919937938, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWGL5Q54Y6PZTO5CMVVLCDYRKVI7AVCNFSM6AAAAABAC6BEMCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJZHEZTOOJTHA . You are receiving this because you were mentioned.Message ID: @.***>

isaaclyman commented 8 months ago

No problem, totally understandable.