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

Daily Word count #96

Open Rudgas opened 1 month ago

Rudgas commented 1 month ago

Problem

Hey, would you consider adding a daily word count? I've tried Daily Statistics, Daily Stats and Better Word count which all report different numbers, up to ~10% off from what your plugin is reporting. Also, they don't include the Canvas in the daily word count.

Idea

A status Bar "n words today" counter. I like the implementation of better word count to allow a custom pre/suffix, but don't think it's really necessary. Cherry on top is logging and visualization :-)

Thanks for the effort to make the plugin in the first place!

isaaclyman commented 1 month ago

Take a look at Writing Goals, that's typically what I recommend for this kind of thing.

Exact parity with Obsidian's own word count, or with other plugins, isn't a goal of this plugin. There isn't an established "right way" to count words, so of the options available, I picked one that is easy to understand and maintain. See #38 for more details.

Rudgas commented 3 weeks ago

Unfortnately Writing Goals doesn't include a daily word count (without setting a daily goal).

I didn't mean for you to adjust your word count method to available solutions, rather displaying the daily word count based on the same method the word count is already shown for all the folders. (As that is not available).

isaaclyman commented 3 weeks ago

I see. Thanks for clarifying.

Time-based counts would be new to this plugin, and there have been enough bugs around timezones and formats in the Created/Updated Date data types that I'm reluctant to take on the complexity. Still, I can wait and see if more requests come through; I might consider it.

As for implementation, the Status Bar is strictly off limits to this plugin. Novel Word Count only touches the file explorer. So if it ever did get implemented, it would be as a data type there.

Rudgas commented 3 days ago

Thanks for the response! Yeah mucking around with timezones is not particularly fun.

Just thinking aloud, I wonder if it would make it a bit simpler if the user can define the timezone (to avoid trouble with the fetched locale) and the preferred hour of "reset". This should be relatively ok to translate to unixtime + 246060 as the windows for counting. Watching the root-folder wordcount for changes would give the difference in counted words without having to interact with the database and looking through "Last-modified" dates. Super-simple Version would be just use word-count on obsidian startup and reset on close. Giving the root-folder it's own configuration would look quite pretty I think. Can imagine there would be some interest to have a different setting from folders.

Anyway, have a coffee on me for the excellent plugin so far :-)

Cheers!

isaaclyman commented 3 days ago

Hey, thank you. That's so kind.

"Words since startup" is a good idea, if it would meet your needs. I just want to reiterate that it would only appear in the File Explorer pane, not the status bar.

Rudgas commented 3 days ago

obsidian_screenshot

"Words since startup" would totally work for me! Thanks for considering it!

I get why you would want to keep changes in the explorer view only.

Aesthetically I think it would be best to go in the green area. If "Words since startup" becomes a "data type to show", adding a root-folder setting would be nice, since the file-view might get quite cluttered if it is added in line to each file/folder.

isaaclyman commented 3 days ago

There have been a number of requests to include/exclude the root folder. I'll start with that as soon as I get some time.