Skip to content
master
Switch branches/tags
Code
This branch is 19 commits ahead of obsidianmd:master.
Contribute

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Novel word count plugin

A screenshot of the plugin, which shows slightly transparent word counts next to every document, folder, and vault in the File Explorer pane.

This plugin displays a word count, page count, created date, or last updated date next to every file, folder, and vault in the File Explorer pane. It updates as you write.

If you make changes to your files outside of Obsidian, you can trigger a reanalysis of all files from the Command Palette (type "recount") or the plugin settings.

Safety

This plugin treats your vault as read-only. It never modifies, deletes, or renames any file or folder. It uses cached reads of all files for performance reasons.

Obsidian's API does not provide contractual access to the File Explorer pane, so this plugin uses duck typing to find it. This is technically undocumented, so future updates of Obsidian may break functionality. If and when that happens, this plugin is designed to fail gracefully. Any cached word counts will still appear in the File Explorer but they won't update when you write; you may wish to disable the plugin until it can be updated.

This plugin's effect on the File Explorer DOM is extremely minimal. It adds a [data-novel-word-count-plugin] attribute to each node (vault, folder, or file), then defines CSS ::after pseudo-elements that display the contents of the attribute. The existing elements are not modified in any other way and the structure is not changed.

Development

  • Clone this repo.
  • npm i or yarn to install dependencies
  • npm run dev to start compilation in watch mode.

Manually installing the plugin

  • Visit the Releases page. Download main.js, styles.css, and manifest.json to your vault at VaultFolder/.obsidian/plugins/novel-word-count/.

About

Obsidian plugin. Displays a word count or other statistic for each file, folder and vault in the File Explorer pane.

Topics

Resources

License

Stars

Watchers

Forks