diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-08-12 18:05:45 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-08-12 18:05:45 +0000 |
commit | dc342e20703804d2ff2f36458e54e298226d5db0 (patch) | |
tree | 6630e796dade2c2ae81daa8434e3293591bc09c0 /doc | |
parent | 3276d28aa2188d936f90acff8a86f2f1b271a3eb (diff) | |
download | ikiwiki-dc342e20703804d2ff2f36458e54e298226d5db0.tar ikiwiki-dc342e20703804d2ff2f36458e54e298226d5db0.tar.gz |
new todo item
Diffstat (limited to 'doc')
-rw-r--r-- | doc/todo/support_for_plugins_written_in_other_languages.mdwn | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/doc/todo/support_for_plugins_written_in_other_languages.mdwn b/doc/todo/support_for_plugins_written_in_other_languages.mdwn new file mode 100644 index 000000000..65fd84f90 --- /dev/null +++ b/doc/todo/support_for_plugins_written_in_other_languages.mdwn @@ -0,0 +1,47 @@ +ikiwiki should support writing plugins in other languages + +While it should be possible to call ikiwiki from C, doing the callbacks in C is +probably hard. And accessing perl at all from C is ugly. It also doesn't +make it very easy to write plugins in an interpreted language, since that +would mean linking perl and eg, python in one binary. (Been there, done +that, never again.) + +Instead, I'm considering using XML RPC to let ikiwiki communicate with a +child process that it can spawn. The child could then be any program, +written in any language. It could talk XML RPC via stdio. + +Here's how it would basically look, not showing the actual XML RPC used to +pass values. + + -> init + <- 1 + <- hook type => preprocess, id => foo + -> 1 + <- done 1 + -> 1 + + -> callback type => preprocess id => foo, page => bar + <- 1 + <- getconfig url + -> "http://example.com", ... + <- debug "foo" + -> 1 + <- done "my return value" + -> 1 + +From ikiwiki's POV: + +* ikiwiki always initiates each conversation with a command +* After sending a command, ikiwiki reads commands, dispatches them, and + returns the results, in a loop. +* The loop continues until the plugin calls the "done" command, with a value + that is the return value for the command that initiated the conversation. + +From the plugin's POV: + +* It's probably sitting in an XML::RPC loop. +* Get a command from ikiwiki. +* Call the appropriate callback. +* The callback can use XML::RPC to communicate with ikiwiki to get things + like config values; and to call ikiwiki functions. +* When the callback returns, use XML::RPC to send a "done" command to ikiwiki. |