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

Display a custom key in the front matter block #94

Closed hanaTsuk1 closed 2 months ago

hanaTsuk1 commented 3 months ago

Problem

I manage time data in the front matter block, and the reason for doing so can be seen in this post

I hope to provide another way to display the created time and updated time

Idea

Provide an option to choose data from front matter, and then provide an input to fill in the specific key

isaaclyman commented 3 months ago

Sorry for the late response. I would accept a PR on this, but I'm not in a position to write it myself anytime soon.

hanaTsuk1 commented 3 months ago

Got it, thank you for considering this request

hanaTsuk1 commented 3 months ago

I have implemented this feature. If you think it is OK, I will submit a PR.

https://github.com/hanaTsuk1/novel-word-count-obsidian/tree/feat/custom-key

isaaclyman commented 2 months ago

The code looks great. Really solid work. I have a few small suggestions and want to do some testing, but go ahead and PR and I'll add a few comments.

hanaTsuk1 commented 2 months ago

I have created it, please check

isaaclyman commented 2 months ago

PR merged and released. Thanks for your help!

hanaTsuk1 commented 2 months ago

🥳

hanaTsuk1 commented 2 months ago

I tried the latest version and found that after turning on 'Use advanced formatting', the file tree displayed 'undefined'🧐. I looked for the reason and found that 'COUNT_TYPE-DEFAULT_SHOR_SUFFIXES' did not set the initial value for' FrontmatterKey '. I missed this point and left a message here for you to see

https://github.com/isaaclyman/novel-word-count-obsidian/blob/master/logic/settings.ts#L88

`

`

oPVMV8tggT

isaaclyman commented 2 months ago

Good catch. Fixed in v3.11.1.