Converts the name instance to a pyqode.core.share.Definition

def to_definition(self):
        """
        Converts the name instance to a pyqode.core.share.Definition
        """
        icon = {
            Name.Type.Root: icons.ICON_MIMETYPE,
            Name.Type.Division: icons.ICON_DIVISION,
            Name.Type.Section: icons.ICON_SECTION,
            Name.Type.Variable: icons.ICON_VAR,
            Name.Type.Paragraph: icons.ICON_FUNC
        }[self.node_type]
        d = Definition(self.name, self.line, self.column, icon, self.description)
        for ch in self.children:
            d.add_child(ch.to_definition())
        return d