def text(self): for section, settings in self.sections(): if section is None: continue s = section.lower().replace(' ', '-') yield '.. _setting-section-{0}:\n\n\ {1}\n=====================================\n\n'.format(s, section) section_doc = section_docs.get(section) if section_doc: yield section_doc yield '\n' for sett in settings: desc = sett.desc.strip() yield '.. _setting-{0}:\n\n\ {0}\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n'.format(sett.name) if sett.app: yield '*Application namespace*: ``%s``\n' % sett.app yield '*Config name*: ``%s``\n' % sett.name if sett.flags: yield '*Command line*: %s\n' %\ ', '.join('``%s``' % f for f in sett.flags) if isfunction(sett.default): default = ':func:`%s`' % sett.default.__name__ else: default = '``%r``' % sett.default yield '*Default*: %s\n' % default yield desc + '\n'
def text(self): for section, settings in self.sections(): if section is None: continue s = section.lower().replace(" ", "-") yield ".. _setting-section-{0}:\n\n\ {1}\n=====================================\n\n".format( s, section ) section_doc = section_docs.get(section) if section_doc: yield section_doc yield "\n" for sett in settings: desc = sett.desc.strip() yield ".. _setting-{0}:\n\n\ {0}\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n".format( sett.name ) if sett.app: yield "*Application namespace*: ``%s``\n" % sett.app yield "*Config name*: ``%s``\n" % sett.name if sett.flags: yield "*Command line*: %s\n" % ", ".join("``%s``" % f for f in sett.flags) if isfunction(sett.default): default = ":func:`%s`" % sett.default.__name__ else: default = "``%r``" % sett.default yield "*Default*: %s\n" % default yield desc + "\n"