docs: def to_dict(self):
          """
          Serializes a definition to a dictionary, ready for json.
  
          Children are serialised recursively.
          """
          ddict = {'name': self.name, 'icon': self.icon,
                   'line': self.line, 'column': self.column,
                   'children': [], 'description': self.description,
                   'user_data': self.user_data, 'path': self.file_path}
          for child in self.children:
              ddict['children'].append(child.to_dict())
          return ddict