@staticmethod<EOL><INDENT>def resource_to_html(resource):<DEDENT>
if resource.mimetype == "<STR_LIT>":<EOL><INDENT>if resource.kind == "<STR_LIT:text>":<EOL><INDENT>return u"<STR_LIT>" % resource.data<EOL><DEDENT>elif resource.kind == "<STR_LIT:url>":<EOL><INDENT>return u"<STR_LIT>" % resource.data<EOL><DEDENT>else:<EOL><INDENT>raise Exception("<STR_LIT>" % resource.kind)<EOL><DEDENT><DEDENT>elif resource.mimetype == "<STR_LIT>":<EOL><INDENT>if resource.kind == "<STR_LIT:text>":<EOL><INDENT>return u"<STR_LIT>" % resource.data<EOL><DEDENT>elif resource.kind == "<STR_LIT:url>":<EOL><INDENT>return u"<STR_LIT>" % resource.data<EOL><DEDENT>else:<EOL><INDENT>raise Exception("<STR_LIT>" % resource.kind)<EOL><DEDENT><DEDENT>elif resource.mimetype == "<STR_LIT>":<EOL><INDENT>assert resource.kind == "<STR_LIT:text>"<EOL>return resource.data<EOL><DEDENT>else:<EOL><INDENT>raise Exception("<STR_LIT>" % resource.mimetype)<EOL><DEDENT>
Returns `resource` wrapped in the appropriate html tag for it's mimetype.