This DatoCMS plugin gives you information for text and string fields about word count, character count, sentences, paragraphs, reading time and common words.
structured-text
, string
and text
fields or your own selection of these fields.First add this plugin via DatoCMS Settings > Plugins > Add (/admin/plugins/new
).
For this plugin you can configure global settings and configure the plugin per field. Choose to apply the plugin automatically to all string/text fields or add the plugin as addon per model/field. Settings set per model/field will always overwrite all global settings.
Auto apply to fields (switch): When enabled this will automatically apply the plugin to all structured-text
, string
and text
fields.
By changing the following setting you can choose on which fields this plugin will be applied.
Field where this plugin is enabled (multi select): You can choose to which fields the plugin will be applied.
> Options of Field where this plugin is enabled
:
>
> - Structured-text fields
> - String fields
> - text fields
> Options of Calculations to show
:
>
> - Number of characters
> - Number of special characters
> - Number of sentences
> - Number of paragraphs
> - Reading time
> - Show common words
Show switch to toggle spaces
will show a switch to let the user choose themselves.> Options of Include space
:
>
> - Show switch to toggle spaces
> - Always include spaces
> - Never include spaces
Show switch to toggle HTML elements
will show a switch to let the user choose themselves.> Options of Include HTML elements
:
>
> - Show switch to HTML elements
> - Always include HTML elements
> - Never include HTML elements
With this word counter plugin you can expose the word count results in the API. To do this you have to specify a new field in the model where the word counter is implemented. The field that is added will automatically be hidden, but will still be exposed in the API.
> The field where the stats are being saved has to be a JSON field and make sure the ID isn't used in other fields
Implementing it like the screenshot will result in:
See contributing.md.