Tags:
create new tag
view all tags

Question

How do I create a variable to include on a WikiPage that would display the word count for that page?

Environment

TWiki version: TWikiRelease01Feb2003
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  

-- StevenSchulman - 21 Jul 2004

Answer

There is no ready made way to do this. However with some programming it can be done with a plugin something like this: Create a new Plugin, could be called TopicInfoPlugin that expands a %TOPICINFO{}% variable. It could be made to understand tokens like $wordcount, $charcount and $lines, so that you can write %TOPICINFO{ "Word count: $wordcount, number of lines: $lines" }%. It could also understand additional parameters like topic="SomeTopic".

To create the Plugin follow the instructions in TWikiPlugins, you can also get some ideas by studying existing Plugins like the LocalCityTimePlugin.

Perl knowledge is assumed. CodersForHire could help if you aren't a programmer.

-- PeterThoeny - 21 Jul 2004, -- MattWilkie 27 Jul 2004

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2004-07-27 - MattWilkie
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.