##// END OF EJS Templates
Refactor autogen config
klonuo -
Show More
@@ -41,8 +41,7 b' clean_api:'
41
41
42 clean: clean_api
42 clean: clean_api
43 -rm -rf build/* dist/*
43 -rm -rf build/* dist/*
44 -cd $(SRCDIR)/config/options; test -f generated && cat generated | xargs rm -f
44 -rm -f $(SRCDIR)/config/options/config-generated.txt
45 -rm -rf $(SRCDIR)/config/options/generated
46 -rm -f $(SRCDIR)/interactive/magics-generated.txt
45 -rm -f $(SRCDIR)/interactive/magics-generated.txt
47
46
48 pdf: latex
47 pdf: latex
@@ -75,7 +74,7 b' source/interactive/magics-generated.txt: autogen_magics.py'
75 $(PYTHON) autogen_magics.py
74 $(PYTHON) autogen_magics.py
76 @echo "Created docs for line & cell magics"
75 @echo "Created docs for line & cell magics"
77
76
78 autoconfig: source/config/options/generated
77 autoconfig: source/config/options/config-generated.txt
79
78
80 source/config/options/generated:
79 source/config/options/generated:
81 $(PYTHON) autogen_config.py
80 $(PYTHON) autogen_config.py
@@ -7,10 +7,11 b' from ipykernel.kernelapp import IPKernelApp'
7
7
8 here = abspath(dirname(__file__))
8 here = abspath(dirname(__file__))
9 options = join(here, 'source', 'config', 'options')
9 options = join(here, 'source', 'config', 'options')
10 generated = join(options, 'config-generated.txt')
11
10
12
11 def write_doc(name, title, app, preamble=None):
13 def write_doc(name, title, app, preamble=None):
12 filename = '%s.rst' % name
14 with open(generated, 'a') as f:
13 with open(join(options, filename), 'w') as f:
14 f.write(title + '\n')
15 f.write(title + '\n')
15 f.write(('=' * len(title)) + '\n')
16 f.write(('=' * len(title)) + '\n')
16 f.write('\n')
17 f.write('\n')
@@ -20,6 +21,9 b' def write_doc(name, title, app, preamble=None):'
20
21
21
22
22 if __name__ == '__main__':
23 if __name__ == '__main__':
24 # create empty file
25 with open(generated, 'w'):
26 pass
23
27
24 write_doc('terminal', 'Terminal IPython options', TerminalIPythonApp())
28 write_doc('terminal', 'Terminal IPython options', TerminalIPythonApp())
25 write_doc('kernel', 'IPython kernel options', IPKernelApp(),
29 write_doc('kernel', 'IPython kernel options', IPKernelApp(),
@@ -6,7 +6,4 b' Any of the options listed here can be set in config files, at the'
6 command line, or from inside IPython. See :ref:`setting_config` for
6 command line, or from inside IPython. See :ref:`setting_config` for
7 details.
7 details.
8
8
9 .. toctree::
9 .. include:: config-generated.txt
10
11 terminal
12 kernel
General Comments 0
You need to be logged in to leave comments. Login now