Printer Friendly Version Attach Files
leiger |
18 Mar 2011 02:29. Edited 2 times. (Edit, Permalink) Summary: Essentially, all this means is that I want to change the name of existing instructions/methods (and add many new ones!). An example is input-boolean being renamed to message.get.boolean. What I've written below is mainly there to explain why I've chosen these new names, and what some of the new methods are supposed to do. Note: There is a lot of reading involved here. If you don't have much time, you might want to read this later. I'm considering changing a few things in regards to how extensions work. Note that backwards compatibility will not be kept, but I will use the API to automatically update all existing extensions in the gallery so that they work with the new syntax (if this goes ahead). You will need to manually update any developer-mode extensions.
I'd like to change the term "instructions" to be "methods" - because it sounds better, and because it better fits the new system I am proposing here. So whenever I say 'methods' below, think 'instructions'. They are the same thing. Except for comments (i.e. [!-- comment --]), this proposal says that all other instructions/methods should be scrapped and no longer supported. Instead, the new ones will be supported (some which do the exact same thing as the existing instructions/methods, and others that give new functionality). Proposed methods: Everything should be put into a separate namespace. So to append text to the document you would say "content" -> "append". This means: find the current page's content (the text in the main text area), and append something to the end of it. How you currently do it:
New method:
Now, here's the full list that I'd like to implement and have working. With these, extensions should become far more powerful than they are now: (if you have more suggestions, let me know!) The set methods allow you to input something, e.g. text. The get methods allow you to specify the name of a variable (which you can use later), and STE will put something into that variable. To help explain… I'll give some code examples after the list. And please ask if you don't understand any of this, or let me know if you think it's going to be too complicated for new users to learn.
How this works: Here's a quick example, to aid understanding. Line numbers added for reference and won't be needed in real code. I want my extension to change the 'start' page on a site that the user chooses. It might work something like this:
Line-by-line breakdown:
Included page "inc:signature" does not exist (create it now) |
Franknarf |
19 Mar 2011 01:49. Edited 0 times. (Edit, Permalink) Other uninformed comments:
Included page "inc:signature" does not exist (create it now) |
leiger |
20 Mar 2011 00:55. Edited 0 times. (Edit, Permalink)
Yes, that is how it would work (and how it already works). I'd like to eventually separate the question and the variable name, but at this stage for simplicity they are the same.
I agree - this is something else that I plan to implement in the future. I'm thinking that the syntax won't change at all - if you ask for several inputs on consecutive lines, they should probably be combined into one modal dialog automatically. Included page "inc:signature" does not exist (create it now) |