Module:Word count/doc

This module implements {{Word count}}.

Module:Word count/doc
Word_count
DescriptionThis module implements {{Word count}}.
Status
Alpha
UpdatedMay 25, 2026 (2 months ago)
DependenciesModule:Arguments

This module implements {{Word count}}.

Usage

Count the number of words in supplied text:

{{#invoke:Word count|main|Some text here}}

This will output the word count and display the supplied text.

Counting words on another page

To count the words on an existing page without displaying its contents, use the page parameter:

{{#invoke:Word count|main|page=Albert Einstein}}

When page is specified, the module outputs **only the word count** and does not display the page text.

Optional parameters

showcount
Set to yes to display the word count.
When counting another page, the word count is shown by default.
limit
Sets a target or maximum word count.
When provided, the output is styled to indicate whether the count is below, near, or above the limit.
trim
When used with supplied text, trims output to the specified word limit.
This parameter has no effect when page is used.
prepend, append
Text to add before or after the displayed content.
Ignored when page is used.

Notes

  • The page parameter only works for pages on the local wiki.
  • The word count is based on the page’s wikitext, with common non-content elements (such as templates and references) excluded.
  • This module does not expand templates when counting words.

Documentation

Package items

Word_count._main( str, limit ) (function)
Main entry point for modules
Parameters:
str Input string (string)
limit Word count limit (number)
Returns: table with necessary outputs
Word_count.main( frame ) (function)
Entrypoint for template
Parameters:
frame processing frame (table)
frame.args Template arguments (table)
frame.args.page Page mode (string)
frame.args.limit Word count limit (string)
frame.args.showcount whether to show the word count (boolean)
frame.args.trim Whether to trim at the word count limit (boolean)
frame.args.unsubst Whether to convert substitutions into transclusions (boolean)
frame.args.prepend What to prepend prior to word limited section (string)
frame.args.append What to append after word limited section (string)
Returns: Output wikitext (string)

Documentation above is auto generated


Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.