dcorking / google-wave-resources

Automatically exported from code.google.com/p/google-wave-resources
0 stars 0 forks source link

Robots Feature Request: Writing Headings Annotations #706

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The Google Wave Robots API: Annotations does not include the headings style, 
like Heading 1, 2, 3, 4, and default

Robots are not able to write text as headings, so they need to be translated 
to font size, and bold style, in order to make it look similar.

Original issue reported on code.google.com by alexandrojv9 on 29 Mar 2010 at 7:31

GoogleCodeExporter commented 9 years ago
Headings are part of line elements, and they are in the API now. Have you 
looked at the 
Line element class?

Original comment by pamela.fox on 29 Mar 2010 at 9:55

GoogleCodeExporter commented 9 years ago
Could you provide an example of usage in this case? I was hoping that 
centred/heading 
etc. were annotations of the text, as opposed to separate objects.

Original comment by nat.abbo...@gmail.com on 31 Mar 2010 at 6:36

GoogleCodeExporter commented 9 years ago
It's probably easiest to see in the Python reference:
http://wave-robot-python-
client.googlecode.com/svn/trunk/pydocs/index.html#element.Line

Per the Wave Model (documented at waveprotocol.org), they are part of the Line 
elements. We are using that model.

Original comment by pamela.fox on 31 Mar 2010 at 10:37

GoogleCodeExporter commented 9 years ago
yeah we were looking at that, but couldn't make something out of it, perhaps 
there is a 
sample robot that uses this, so we can refer for reference?

Original comment by alexandrojv9 on 1 Apr 2010 at 1:29

GoogleCodeExporter commented 9 years ago
I think there's been an oversight. The Python API provides no way of retrieving 
the
position of elements. For example, how are we meant to know *which* line is the 
heading?

Original comment by puffnfresh@gmail.com on 5 Apr 2010 at 1:37

GoogleCodeExporter commented 9 years ago
The elements dictionary is keyed by element position, so it is possible to find 
out the 
position. Please post in the forum if you want additional sample code. There 
may be a 
modification we can make to the library to make it easier to use, as well.

(We answered the original question live in last week's office hours with some 
sample 
code, by the way).

Original comment by pamela.fox on 5 Apr 2010 at 2:36

GoogleCodeExporter commented 9 years ago
I wasn't looking hard enough.

You're right, _elements is a dictionary but the elements property isn't.

  @property
  def elements(self):
    return self._elements.values()

Is it then by design that the dictionary is "hidden" and you are only meant to
retrieve an Element list?

Should I ask these questions in the Wave Preview forum, instead?

Original comment by puffnfresh@gmail.com on 6 Apr 2010 at 12:40