Skip to content

Latest commit

 

History

History
54 lines (31 loc) · 1.81 KB

README.md

File metadata and controls

54 lines (31 loc) · 1.81 KB

[💝 Sponsor this project on Github or ☕ Get me a coffee if you like this plugin!

Introduction

Usage

Use /wordcount. 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 /wordcount.

It also supports counting sentences that have both English and Chinese/ Japanese words. E.g. 敏捷的棕色狐狸跳过了懒狗 is a funny phrase returns 16 words.

You can also use /character count to count the number of characters (including spaces) instead of words.

Happy counting!

Styling the wordcount button

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;
}

Customising text in the wordcount button

Go to plugin settings, and make the changes as you like.

Migrating from Roam

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 {} +

Installation

Install from the marketplace.

Credits

pengx17 for his suggestions and Ken Lee for his word counting algorithm.