Instead of putting plugins in the file system, make them a wiki page

Idea

I have been thinking about this idea for some time. Instead of installing plugins as files in specific points of the file system, put them in the wiki with particular names. I guess the names would be something like !MyWiki/Extensions/Macro/Macroname for macros !MyWiki/Extensions/Action/ActionName for actions, ...etc.

A macro page can look like this:

   1 def execute(macro, args):
   2     return macro.formatter.text("I'm a macro page.")

When you view the page, the colored code is displayed. When the wiki try to load the macro on the first time, it will load the page text and save a compiled code in the page cache directory as MacroName.pyc. The next load will be done from the compiled module.

Advantages

Disadvantages

Implementation

The loading system can be created as a plugin itself. For example, a Macro macro can be installed as a wiki macro, and load exiting pages as macros.

[[Macro(HelloWord)]]

This markup will load a macro from the page HelloWorld. This kind of system will work of any version of moin without changing the core.

Discussion

Might be easy enough to write an action that copies the latest version of the page to the conventional location in the file system. -- TimCera 2005-10-07 02:05:02

Storing executable code in wiki and its problems is already discussed somewhere else. In 2.0 we will concentrate on storing non-executable stuff as wiki items first.


CategoryFeatureRejected

MoinMoin: FeatureRequests/StorePlugInsAsWikiPages (last edited 2008-03-18 02:15:00 by JohannesBerg)