Skip to content
Michael Butscher edited this page Jan 23, 2021 · 1 revision

This plugin automatically evals wikipages when opened. To allow a wikipage to be automatically loaded you should set the property autoeval to "true" or "1"

"""AutoEval.py
	Automatically evals the page when opened if marked with autoeval property. 
	v0.1 by chaosct, 28 Apr 2009
"""

WIKIDPAD_PLUGIN = (("hooks", 1),)

def openedWikiWord(docPagePresenter, wikiWord):
	editor = docPagePresenter.getActiveEditor()
	properties = docPagePresenter.getWikiDocument().getWikiData().getPropertiesForWord(wikiWord)
	for (p,v) in properties:
		if p.upper() == 'AUTOEVAL' and (v.upper() == 'TRUE' or v == '1'):
			editor.evalScriptBlocks()

Clone this wiki locally