import os, urllib
import wx

A Insertion plugin for WikidPad to count the words on the page 

Written by Eric Tolman (
WIKIDPAD_PLUGIN = (("InsertionByKey", 1),)

def describeInsertionKeys(ver, app):
	Adds a word count insertion.
	[:wordcount:]			Outputs the word count
	return ((u"wordcount", ("wikidpad_language",), WordCountHandler),)

class WordCountHandler:
	Class fulfilling the "insertion by key" protocol.
	def __init__(self, app): = app

	def taskStart(self, exporter, exportType):

	def taskEnd(self):

	def createContent(self, exporter, exportType, insToken):
		wiki = exporter.mainControl
		editor = wiki.getActiveEditor()
		text = editor.GetText()
		return str(len(text.split(None)))

	def getExtraFeatures(self):
		return ()

Last modified 6 years ago Last modified on Nov 12, 2011 12:19:55 AM