forked from butscher/WikidPad
-
Notifications
You must be signed in to change notification settings - Fork 0
AutoEval
Christian Ziemski edited this page Mar 7, 2016
·
4 revisions
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()
Source: http://trac.wikidpad2.webfactional.com/wiki/AutoEval