Implement @takluyver's doc generation API

This commit is contained in:
Jonathan Frederic 2015-06-01 13:06:33 -07:00
parent 75e53d915e
commit 0e10d87292
4 changed files with 53 additions and 308 deletions

1
.gitignore vendored
View File

@ -4,6 +4,7 @@ dist
_build
docs/man/*.gz
docs/source/api/generated
docs/source/config.rst
docs/gh-pages
notebook/static/components
notebook/static/style/*.min.css*

View File

@ -50,12 +50,17 @@ help:
clean:
rm -rf $(BUILDDIR)/*
rm -rf source/config.rst
html:
html: source/config.rst
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
source/config.rst:
python3 autogen_config.py
@echo "Created docs for config options"
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo

46
docs/autogen_config.py Normal file
View File

@ -0,0 +1,46 @@
#!/usr/bin/env python
from qtconsole.qtconsoleapp import JupyterQtConsoleApp
header = """\
.. _config:
Config
======
The notebook server can be run with a variety of command line arguments.
A list of available options can be found below in the :ref:`options section
<options>`.
Defaults for these options can also be set by creating a file named
``jupyter_notebook_config.py`` in your Jupyter *profile folder*. The profile
folder is a subfolder of your Jupyter directory; to find out where it is
located, run::
$ jupyter locate
To create a new set of default configuration files, with lots of information
on available options, use::
$ jupyter profile create
.. seealso::
:ref:`public_server`
.. _options:
Options
-------
This list of options can be generated by running the following and hitting
enter::
$ jupyter notebook --help
"""
with open("source/config.rst", 'w') as f:
f.write(header)
f.write(JupyterQtConsoleApp().document_config_options())

View File

@ -1,307 +0,0 @@
.. _config:
Config
======
The notebook server can be run with a variety of command line arguments.
A list of available options can be found below in the :ref:`options section
<options>`.
Defaults for these options can also be set by creating a file named
``jupyter_notebook_config.py`` in your Jupyter *profile folder*. The profile
folder is a subfolder of your Jupyter directory; to find out where it is
located, run::
$ jupyter locate
To create a new set of default configuration files, with lots of information
on available options, use::
$ jupyter profile create
.. seealso::
:ref:`public_server`
.. _options:
Options
-------
This list of options can be generated by running the following and hitting
enter::
$ jupyter notebook --help
NotebookApp.allow_credentials : Bool
Default: ``False``
Set the Access-Control-Allow-Credentials: true header
NotebookApp.allow_origin : Unicode
Default: ``''``
Set the Access-Control-Allow-Origin header
Use '*' to allow any origin to access your server.
Takes precedence over allow_origin_pat.
NotebookApp.allow_origin_pat : Unicode
Default: ``''``
Use a regular expression for the Access-Control-Allow-Origin header
Requests from an origin matching the expression will get replies with:
Access-Control-Allow-Origin: origin
where `origin` is the origin of the request.
Ignored if allow_origin is set.
NotebookApp.base_project_url : Unicode
Default: ``'/'``
DEPRECATED use base_url
NotebookApp.base_url : Unicode
Default: ``'/'``
The base URL for the notebook server.
Leading and trailing slashes can be omitted,
and will automatically be added.
NotebookApp.browser : Unicode
Default: ``''``
Specify what command to use to invoke a web
browser when opening the notebook. If not specified, the
default browser will be determined by the `webbrowser`
standard library module, which allows setting of the
BROWSER environment variable to override it.
NotebookApp.certfile : Unicode
Default: ``''``
The full path to an SSL/TLS certificate file.
NotebookApp.cluster_manager_class : Type
Default: ``<class 'notebook.services.clusters.clustermanager.ClusterMana...``
The cluster manager class to use.
NotebookApp.config_manager_class : Type
Default: ``<class 'notebook.services.config.manager.ConfigManager'>``
The config manager class to use
NotebookApp.contents_manager_class : Type
Default: ``<class 'notebook.services.contents.filemanager.FileContentsMa...``
The notebook manager class to use.
NotebookApp.cookie_secret : Bytes
Default: ``b''``
The random bytes used to secure cookies.
By default this is a new random number every time you start the Notebook.
Set it to a value in a config file to enable logins to persist across server sessions.
Note: Cookie secrets should be kept private, do not share config files with
cookie_secret stored in plaintext (you can read the value from a file).
NotebookApp.cookie_secret_file : Unicode
Default: ``''``
The file where the cookie secret is stored.
NotebookApp.default_url : Unicode
Default: ``'/tree'``
The default URL to redirect to from `/`
NotebookApp.enable_mathjax : Bool
Default: ``True``
Whether to enable MathJax for typesetting math/TeX
MathJax is the javascript library IPython uses to render math/LaTeX. It is
very large, so you may want to disable it if you have a slow internet
connection, or for offline use of the notebook.
When disabled, equations etc. will appear as their untransformed TeX source.
NotebookApp.extra_nbextensions_path : List
Default: ``[]``
extra paths to look for Javascript notebook extensions
NotebookApp.extra_static_paths : List
Default: ``[]``
Extra paths to search for serving static files.
This allows adding javascript/css to be available from the notebook server machine,
or overriding individual files in the IPython
NotebookApp.extra_template_paths : List
Default: ``[]``
Extra paths to search for serving jinja templates.
Can be used to override templates from notebook.templates.
NotebookApp.file_to_run : Unicode
Default: ``''``
No description
NotebookApp.ip : Unicode
Default: ``'localhost'``
The IP address the notebook server will listen on.
NotebookApp.jinja_environment_options : Dict
Default: ``{}``
Supply extra arguments that will be passed to Jinja environment.
NotebookApp.jinja_template_vars : Dict
Default: ``{}``
Extra variables to supply to jinja templates when rendering.
NotebookApp.kernel_manager_class : Type
Default: ``<class 'notebook.services.kernels.kernelmanager.MappingKernel...``
The kernel manager class to use.
NotebookApp.kernel_spec_manager_class : Type
Default: ``<class 'jupyter_client.kernelspec.KernelSpecManager'>``
The kernel spec manager class to use. Should be a subclass
of `jupyter_client.kernelspec.KernelSpecManager`.
The Api of KernelSpecManager is provisional and might change
without warning between this version of IPython and the next stable one.
NotebookApp.keyfile : Unicode
Default: ``''``
The full path to a private key file for usage with SSL/TLS.
NotebookApp.login_handler_class : Type
Default: ``<class 'notebook.auth.login.LoginHandler'>``
The login handler class to use.
NotebookApp.logout_handler_class : Type
Default: ``<class 'notebook.auth.logout.LogoutHandler'>``
The logout handler class to use.
NotebookApp.mathjax_url : Unicode
Default: ``''``
The url for MathJax.js.
NotebookApp.notebook_dir : Unicode
Default: ``''``
The directory to use for notebooks and kernels.
NotebookApp.open_browser : Bool
Default: ``True``
Whether to open in a browser after starting.
The specific browser used is platform dependent and
determined by the python standard library `webbrowser`
module, unless it is overridden using the --browser
(NotebookApp.browser) configuration option.
NotebookApp.password : Unicode
Default: ``''``
Hashed password to use for web authentication.
To generate, type in a python/IPython shell:
from notebook.auth import passwd; passwd()
The string should be of the form type:salt:hashed-password.
NotebookApp.port : Int
Default: ``8888``
The port the notebook server will listen on.
NotebookApp.port_retries : Int
Default: ``50``
The number of additional ports to try if the specified port is not available.
NotebookApp.pylab : Unicode
Default: ``'disabled'``
DISABLED: use %pylab or %matplotlib in the notebook to enable matplotlib.
NotebookApp.reraise_server_extension_failures : Bool
Default: ``False``
Reraise exceptions encountered loading server extensions?
NotebookApp.server_extensions : List
Default: ``[]``
Python modules to load as notebook server extensions. This is an experimental API, and may change in future releases.
NotebookApp.session_manager_class : Type
Default: ``<class 'notebook.services.sessions.sessionmanager.SessionMana...``
The session manager class to use.
NotebookApp.ssl_options : Dict
Default: ``{}``
Supply SSL options for the tornado HTTPServer.
See the tornado docs for details.
NotebookApp.tornado_settings : Dict
Default: ``{}``
Supply overrides for the tornado.web.Application that the IPython notebook uses.
NotebookApp.trust_xheaders : Bool
Default: ``False``
Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded-For headerssent by the upstream reverse proxy. Necessary if the proxy handles SSL
NotebookApp.webapp_settings : Dict
Default: ``{}``
DEPRECATED, use tornado_settings
NotebookApp.websocket_url : Unicode
Default: ``''``
The base URL for websockets,
if it differs from the HTTP server (hint: it almost certainly doesn't).
Should be in the form of an HTTP origin: ws[s]://hostname[:port]