in doc/directives.py [0:0]
def run(self):
try:
if "name" in self.options:
name = self.options["name"]
if "description" in self.options:
description = self.options["description"]
else:
raise ValueError("description not found")
if "link" in self.options:
link = self.options["link"]
else:
link = "code/qml_templates"
except FileNotFoundError as e:
print(e)
return []
except ValueError as e:
print(e)
raise
return []
thumbnail_rst = GALLERY_TEMPLATE.format(name=name, description=description, link=link)
thumbnail = StringList(thumbnail_rst.split("\n"))
thumb = nodes.paragraph()
self.state.nested_parse(thumbnail, self.content_offset, thumb)
return [thumb]