|
|
@ -91,6 +91,9 @@ def print_man(doc):
|
|
|
|
for ex in doc['examples']:
|
|
|
|
for ex in doc['examples']:
|
|
|
|
print "%s\n" % (ex['code'])
|
|
|
|
print "%s\n" % (ex['code'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if 'plainexamples' in doc and doc['plainexamples'] is not None:
|
|
|
|
|
|
|
|
print doc['plainexamples']
|
|
|
|
|
|
|
|
|
|
|
|
def print_snippet(doc):
|
|
|
|
def print_snippet(doc):
|
|
|
|
|
|
|
|
|
|
|
|
desc = tty_ify("".join(doc['short_description']))
|
|
|
|
desc = tty_ify("".join(doc['short_description']))
|
|
|
@ -153,7 +156,7 @@ def main():
|
|
|
|
|
|
|
|
|
|
|
|
filename = utils.plugins.module_finder.find_plugin(module)
|
|
|
|
filename = utils.plugins.module_finder.find_plugin(module)
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
doc = module_docs.get_docstring(filename)
|
|
|
|
doc, plainexamples = module_docs.get_docstring(filename)
|
|
|
|
desc = tty_ify(doc.get('short_description', '?'))
|
|
|
|
desc = tty_ify(doc.get('short_description', '?'))
|
|
|
|
if len(desc) > 55:
|
|
|
|
if len(desc) > 55:
|
|
|
|
desc = desc + '...'
|
|
|
|
desc = desc + '...'
|
|
|
@ -180,7 +183,7 @@ def main():
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
doc = module_docs.get_docstring(filename)
|
|
|
|
doc, plainexamples = module_docs.get_docstring(filename)
|
|
|
|
except:
|
|
|
|
except:
|
|
|
|
traceback.print_exc()
|
|
|
|
traceback.print_exc()
|
|
|
|
sys.stderr.write("ERROR: module %s has a documentation error formatting or is missing documentation\n" % module)
|
|
|
|
sys.stderr.write("ERROR: module %s has a documentation error formatting or is missing documentation\n" % module)
|
|
|
@ -197,6 +200,7 @@ def main():
|
|
|
|
doc['filename'] = filename
|
|
|
|
doc['filename'] = filename
|
|
|
|
doc['docuri'] = doc['module'].replace('_', '-')
|
|
|
|
doc['docuri'] = doc['module'].replace('_', '-')
|
|
|
|
doc['now_date'] = datetime.date.today().strftime('%Y-%m-%d')
|
|
|
|
doc['now_date'] = datetime.date.today().strftime('%Y-%m-%d')
|
|
|
|
|
|
|
|
doc['plainexamples'] = plainexamples
|
|
|
|
|
|
|
|
|
|
|
|
if options.show_snippet:
|
|
|
|
if options.show_snippet:
|
|
|
|
print_snippet(doc)
|
|
|
|
print_snippet(doc)
|
|
|
|