diff --git a/docs/Makefile b/docs/Makefile index 6beba8a..b804b51 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -41,8 +41,7 @@ clean_api: clean: clean_api -rm -rf build/* dist/* - -cd $(SRCDIR)/config/options; test -f generated && cat generated | xargs rm -f - -rm -rf $(SRCDIR)/config/options/generated + -rm -f $(SRCDIR)/config/options/config-generated.txt -rm -f $(SRCDIR)/interactive/magics-generated.txt pdf: latex @@ -75,7 +74,7 @@ source/interactive/magics-generated.txt: autogen_magics.py $(PYTHON) autogen_magics.py @echo "Created docs for line & cell magics" -autoconfig: source/config/options/generated +autoconfig: source/config/options/config-generated.txt source/config/options/generated: $(PYTHON) autogen_config.py diff --git a/docs/autogen_config.py b/docs/autogen_config.py index a562ab4..f2f6f66 100755 --- a/docs/autogen_config.py +++ b/docs/autogen_config.py @@ -7,10 +7,11 @@ from ipykernel.kernelapp import IPKernelApp here = abspath(dirname(__file__)) options = join(here, 'source', 'config', 'options') +generated = join(options, 'config-generated.txt') + def write_doc(name, title, app, preamble=None): - filename = '%s.rst' % name - with open(join(options, filename), 'w') as f: + with open(generated, 'a') as f: f.write(title + '\n') f.write(('=' * len(title)) + '\n') f.write('\n') @@ -20,6 +21,9 @@ def write_doc(name, title, app, preamble=None): if __name__ == '__main__': + # create empty file + with open(generated, 'w'): + pass write_doc('terminal', 'Terminal IPython options', TerminalIPythonApp()) write_doc('kernel', 'IPython kernel options', IPKernelApp(), diff --git a/docs/source/config/options/index.rst b/docs/source/config/options/index.rst index a0f38e2..7090799 100644 --- a/docs/source/config/options/index.rst +++ b/docs/source/config/options/index.rst @@ -6,7 +6,4 @@ Any of the options listed here can be set in config files, at the command line, or from inside IPython. See :ref:`setting_config` for details. -.. toctree:: - - terminal - kernel +.. include:: config-generated.txt