def to_rst(self, indent=4, prefix=''): """ Outputs field in rst using as items in an list. Arguments --------- indent : int The indent to use for the decription block. prefix : str The prefix to use. For example if the item is part of a numbered list then ``prefix='# '``. Example ------- Note ---- The field descrption is reformated into a line. """ indent_str = ' ' * indent rst_pattern = '{0}{1}**{2}**{3}' if is_empty(self.desc[0]) else \ '{0}{1}**{2}** -- {3}' description = '' if is_empty(self.desc[0]) else \ ' '.join(remove_indent(self.desc)) return [rst_pattern.format(indent_str, prefix, self.name, description)]
def to_rst(self, indent=4, prefix=''): indent_str = ' ' * indent _type = '' if self.signature == '' else '({0})'.format(self.signature) rst_pattern = '{0}{1}**{2}** {3}{4}' if is_empty(self.desc[0]) else \ '{0}{1}**{2}** {3} -- {4}' description = '' if is_empty(self.desc[0]) else \ ' '.join(remove_indent(self.desc)) return [rst_pattern.format(indent_str, prefix, self.name, _type, description)]
def to_rst(self, indent=4, prefix=''): indent_str = ' ' * indent _type = '' if self.signature == '' else '({0})'.format(self.signature) rst_pattern = '{0}{1}**{2}** {3}{4}' if is_empty(self.desc[0]) else \ '{0}{1}**{2}** {3} -- {4}' description = '' if is_empty(self.desc[0]) else \ ' '.join(remove_indent(self.desc)) return [ rst_pattern.format(indent_str, prefix, self.name, _type, description) ]