Simple word and character counter that calculates the number of words across nested blocks",
- Count either word or characters across all nested blocks. Supports deeply nested blocks.
- Count words on a page level.
- Set a writing target and measure your progress.
- Open Logseq.
- Go to the Marketplace (Plugins > Marketplace).
- Search for logseq-todoist-plugin.
- Click Install.
- Use
/Word count. It will then count the number of words below this parent block. This supports an unlimited number of nested blocks. - You can use more than 1 word counter in a single page. Just prefix the blocks you would like to count with another
/Word count. - It also supports counting sentences that have both English and Chinese/ Japanese words. E.g.
敏捷的棕色狐狸跳过了懒狗 is a funny phrasereturns 16 words. - You can also use
/Character countto count the number of characters (including spaces) instead of words. - Turn on the "Wordcount Toolbar" setting and total word count of the page will be displayed in the toolbar.
You can style the wordcount button using the class .wordcount-btn. Simply add it into your custom.css.
Example:
.wordcount-btn {
border-color: red;
font-size: 2em;
}Go to plugin settings, and make the changes as you like.
Roam uses {{word-count}}. All you need to do is to replace each instance of {{word-count}} with {{renderer :wordcount_abc123}} (abc123 can be any other string you want). You can also a use a terminal command (in MacOS or Linux) to do so. In terminal, navigate to the folder (e.g. pages) and run the following command.
find . -type f -name '*.md' -exec sed -i '' s/word-count/renderer\ :wordcount_abc123/g {} +If you enjoy this plugin, please consider supporting the development!
Issues are welcome. If you find a bug, please open an issue. Pull requests are not accepted at the moment as I am not able to commit to reviewing them in a timely fashion.
pengx17 for his suggestions and Ken Lee for his word counting algorithm.



