Go to file Use this template
Isaac Lyman a552e50bb7 Update README, add screenshot 2022-03-09 13:39:39 -07:00
logic Develop functionality 2022-03-09 13:15:14 -07:00
.editorconfig Update sample plugin to use ESBuild. 2021-10-19 13:34:58 -04:00
.eslintignore Adding eslint for code .\src\ (#17) 2021-10-30 14:04:07 -04:00
.eslintrc add version bump script (#10) 2022-01-22 16:13:50 -05:00
.gitignore Update .gitignore (#25) 2022-01-28 10:34:53 -05:00
.npmrc add version bump script (#10) 2022-01-22 16:13:50 -05:00
README.md Update README, add screenshot 2022-03-09 13:39:39 -07:00
esbuild.config.mjs Update esbuild script to include codemirror packages as external. 2022-01-10 09:01:38 -05:00
main.ts Reject instead of throw inside promise 2022-03-09 13:39:28 -07:00
manifest.json Develop functionality 2022-03-09 13:15:14 -07:00
package-lock.json Develop functionality 2022-03-09 13:15:14 -07:00
package.json Develop functionality 2022-03-09 13:15:14 -07:00
readme-screenshot-1.png Update README, add screenshot 2022-03-09 13:39:39 -07:00
styles.css Develop functionality 2022-03-09 13:15:14 -07:00
tsconfig.json add type check (#22) 2022-01-16 10:07:19 -05:00
version-bump.mjs add version bump script (#10) 2022-01-22 16:13:50 -05:00
versions.json add version bump script (#10) 2022-01-22 16:13:50 -05:00

README.md

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 or page count next to every file, folder, and vault in the File Explorer pane. It updates as you write.

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 unofficial means of access. Future updates of Obsidian may therefore break functionality. If and when that happens, this plugin is designed to fail gracefully. Any saved 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

  • Copy over main.js, styles.css, manifest.json to your vault VaultFolder/.obsidian/plugins/novel-word-count/.