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
77 stars 7 forks source link

Include ![[embedded]] content in word count #90

Open tyler-dot-earth opened 2 weeks ago

tyler-dot-earth commented 2 weeks ago

Problem

I would like content from ![[embeds]] (aka transclusions) to be included in the word count.

Relevant link to Obsidian docs: https://help.obsidian.md/Linking+notes+and+files/Embed+files

I basically want to count words in the "reading view", not the "editing view".

Idea

Add an option which enables counting of the content of an ![[embed]] in the word count.

tyler-dot-earth commented 2 weeks ago

I may be able to contribute to this feature, myself - just filing it as a feature request to get it logged.

That said, please feel free to share relevant parts of the code. That would make contributing a lot easier even if you don't have the time to implement this yourself :)

isaaclyman commented 2 weeks ago

This is an odd request to me, since it implies that embedded notes could be counted multiple times, making the overall vault count (arguably) incorrect. Can you confirm that's what you're requesting?

tyler-dot-earth commented 2 weeks ago

@isaaclyman This is an odd request to me, since it implies that embedded notes could be counted multiple times, making the overall vault count (arguably) incorrect. Can you confirm that's what you're requesting?

That's correct — I'd prefer the word count as it is read, not as it is written.

An example file:

Hello, world.

![[foo#^bar]]

![[fizz#buzz]]

If each of the embeds actually transcludes 10 words, I'd expect this word count to be 22 words.

isaaclyman commented 2 weeks ago

I'm open to this, but not totally sold on it yet—it's not just about the effort to write the feature, but the ongoing maintenance of it. The main questions on my mind are:

If we can get good answers to the above, it's a green light from me.