##// END OF EJS Templates
Also update .ipynb examples and Readme
Also update .ipynb examples and Readme

File last commit:

r21590:1b9c89e1
r22290:97a71f80
Show More
autogen_config.py
35 lines | 1.1 KiB | text/x-python | PythonLexer
/ docs / autogen_config.py
Yaroslav Halchenko
ENH: list generated config files in generated, and rm them upon clean
r16197 #!/usr/bin/env python
Min RK
abspath fixes for autogen scripts
r21590 from os.path import join, dirname, abspath
Thomas Kluyver
Generate docs for config options.
r13459 from IPython.terminal.ipapp import TerminalIPythonApp
Thomas Kluyver
Use new traitlets API to generate config docs...
r21400 from ipykernel.kernelapp import IPKernelApp
Thomas Kluyver
Generate docs for config options.
r13459
Min RK
abspath fixes for autogen scripts
r21590 here = abspath(dirname(__file__))
options = join(here, 'source', 'config', 'options')
generated = join(options, 'generated.rst')
Thomas Kluyver
Use new traitlets API to generate config docs...
r21400 def write_doc(name, title, app, preamble=None):
Yaroslav Halchenko
ENH: list generated config files in generated, and rm them upon clean
r16197 filename = '%s.rst' % name
Min RK
abspath fixes for autogen scripts
r21590 with open(join(options, filename), 'w') as f:
Thomas Kluyver
Generate docs for config options.
r13459 f.write(title + '\n')
f.write(('=' * len(title)) + '\n')
f.write('\n')
if preamble is not None:
f.write(preamble + '\n\n')
Thomas Kluyver
Use new traitlets API to generate config docs...
r21400 f.write(app.document_config_options())
Min RK
abspath fixes for autogen scripts
r21590 with open(generated, 'a') as f:
Yaroslav Halchenko
ENH: list generated config files in generated, and rm them upon clean
r16197 f.write(filename + '\n')
Thomas Kluyver
Generate docs for config options.
r13459
if __name__ == '__main__':
Yaroslav Halchenko
ENH: list generated config files in generated, and rm them upon clean
r16197 # create empty file
Min RK
abspath fixes for autogen scripts
r21590 with open(generated, 'w'):
Yaroslav Halchenko
ENH: list generated config files in generated, and rm them upon clean
r16197 pass
Thomas Kluyver
Use new traitlets API to generate config docs...
r21400 write_doc('terminal', 'Terminal IPython options', TerminalIPythonApp())
write_doc('kernel', 'IPython kernel options', IPKernelApp(),
preamble=("These options can be used in :file:`ipython_kernel_config.py`. "
"The kernel also respects any options in `ipython_config.py`"),
MinRK
remove references to kernel config in parent config files...
r18030 )
Thomas Kluyver
Generate docs for config options.
r13459