Changes

Jump to: navigation, search

Labs/Ubiquity/Ubiquity Source Tip Author Tutorial

207 bytes added, 02:30, 22 June 2009
Echo
This says that the command "echo" takes one argument which is arbitrary text. Whatever text the user enters will get wrapped in an input object and passed into both the preview and execute function.
Ubiquity takes care of parsing the user's input, so you don't need to worry about handling prounoun substitution or any of the other natural-language-like features of the Ubiquity parser. Try selecting some text on a page, and it! Ubiq "echo thishellooooo". Ubiquity should now echo the selected textand watch what happens.
Ubiquity takes care of parsing the user's input, so you don't need to worry about handling prounoun substitution or any of the other natural-language-like features of the Ubiquity parser. Try selecting some text on a page, and Ubiq "echo this". Ubiquity should now echo the selected text.  Note that we gave three pieces of information when defining our argument: its role, its nountype, and its label. We'll cover each of these in detail next. === How Arguments are Defined Argument Roles ===
Your command can take multiple arguments. Each one is identified by a "role". To understand roles, it helps to think of your command name as a verb, and each argument as a noun. Remember that Ubiquity's command line is a pseudo-natural-language environment, so it attempts to be as close to natural language grammar as possible.
"Object" is the most common role. If a command takes only one argument, that argument is usually an "object".
==== What Roles Can I Use? ====
* object (in "echo helloooo", hello is the object.)
1,007
edits

Navigation menu