Factor out ImageInfo into a core type. Refer to that in other msgtypes.

Add templating for msgtypes. ImageInfo core type is not referred to for
m.image in order for the ImageInfo table to render for it.
This commit is contained in:
Kegan Dougal 2015-05-27 16:30:11 +01:00
parent 59168df363
commit 59f856c7e6
9 changed files with 106 additions and 43 deletions

View file

@ -20,7 +20,22 @@ class MatrixSections(Sections):
schemas = self.units.get("event_schemas")
sections = []
for event_name in sorted(schemas):
if not event_name.startswith("m.room"):
if (not event_name.startswith("m.room") or
event_name.startswith("m.room.message#m.")):
continue
sections.append(template.render(
example=examples[event_name],
event=schemas[event_name]
))
return "\n\n".join(sections)
def render_msgtype_events(self):
template = self.env.get_template("msgtypes.tmpl")
examples = self.units.get("event_examples")
schemas = self.units.get("event_schemas")
sections = []
for event_name in sorted(schemas):
if not event_name.startswith("m.room.message#m."):
continue
sections.append(template.render(
example=examples[event_name],