##// END OF EJS Templates
Various improvements to generating config docs
Thomas Kluyver -
Show More
@@ -1,6 +1,6 b''
1 1 #!/usr/bin/env python
2 2
3 from IPython.utils.text import indent, wrap_paragraphs
3 from IPython.utils.text import indent, dedent
4 4
5 5 from IPython.terminal.ipapp import TerminalIPythonApp
6 6 from IPython.kernel.zmq.kernelapp import IPKernelApp
@@ -34,13 +34,12 b' def document_config_options(classes):'
34 34 dvr = dvr[:61]+'...'
35 35 # Double up backslashes, so they get to the rendered docs
36 36 dvr = dvr.replace('\\n', '\\\\n')
37 lines.append(' Default: ' + dvr)
37 lines.append(' Default: `%s`' % dvr)
38 38 lines.append('')
39 39
40 40 help = trait.get_metadata('help')
41 41 if help is not None:
42 help = '\n\n'.join(wrap_paragraphs(help, 76))
43 lines.append(indent(help, 4))
42 lines.append(indent(dedent(help), 4))
44 43 else:
45 44 lines.append(' No description')
46 45
@@ -72,8 +71,7 b" if __name__ == '__main__':"
72 71 write_doc('kernel', 'IPython kernel options', kernel_classes,
73 72 preamble="These options can be used in :file:`ipython_kernel_config.py`",
74 73 )
75 nbclasses = set(NotebookApp().classes) - set(kernel_classes)
76 write_doc('notebook', 'IPython notebook options', nbclasses,
74 write_doc('notebook', 'IPython notebook options', NotebookApp().classes,
77 75 preamble="To configure the IPython kernel, see :doc:`kernel`."
78 76 )
79 77
@@ -83,8 +81,7 b" if __name__ == '__main__':"
83 81 print("WARNING: Could not import qtconsoleapp. Config options for the "
84 82 "Qt Console will not be documented.")
85 83 else:
86 qtclasses = set(IPythonQtConsoleApp().classes) - set(kernel_classes)
87 write_doc('qtconsole', 'IPython Qt console options', qtclasses,
84 write_doc('qtconsole', 'IPython Qt console options', IPythonQtConsoleApp().classes,
88 85 preamble="To configure the IPython kernel, see :doc:`kernel`."
89 86 )
90 87
General Comments 0
You need to be logged in to leave comments. Login now