From f1b3c57ba88d609ce952673a5b616c7f082ba2a8 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 10 Jun 2012 13:41:13 +0200 Subject: [PATCH 01/10] Do sphinx-quickstart under doc/ --- doc/Makefile | 153 +++++++++++++++++++++++++++ doc/make.bat | 190 +++++++++++++++++++++++++++++++++ doc/source/conf.py | 242 +++++++++++++++++++++++++++++++++++++++++++ doc/source/index.rst | 22 ++++ 4 files changed, 607 insertions(+) create mode 100644 doc/Makefile create mode 100644 doc/make.bat create mode 100644 doc/source/conf.py create mode 100644 doc/source/index.rst diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..93085c3 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,153 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/EmacsIPythonNotebook.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/EmacsIPythonNotebook.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/EmacsIPythonNotebook" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/EmacsIPythonNotebook" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." diff --git a/doc/make.bat b/doc/make.bat new file mode 100644 index 0000000..707fa7d --- /dev/null +++ b/doc/make.bat @@ -0,0 +1,190 @@ +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source +set I18NSPHINXOPTS=%SPHINXOPTS% source +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% + set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. texinfo to make Texinfo files + echo. gettext to make PO message catalogs + echo. changes to make an overview over all changed/added/deprecated items + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\EmacsIPythonNotebook.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\EmacsIPythonNotebook.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "texinfo" ( + %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. + goto end +) + +if "%1" == "gettext" ( + %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The message catalogs are in %BUILDDIR%/locale. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + if errorlevel 1 exit /b 1 + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + if errorlevel 1 exit /b 1 + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + if errorlevel 1 exit /b 1 + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +:end diff --git a/doc/source/conf.py b/doc/source/conf.py new file mode 100644 index 0000000..f2aff33 --- /dev/null +++ b/doc/source/conf.py @@ -0,0 +1,242 @@ +# -*- coding: utf-8 -*- +# +# Emacs IPython Notebook documentation build configuration file, created by +# sphinx-quickstart on Sun Jun 10 13:37:13 2012. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ----------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = ['sphinx.ext.todo'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'Emacs IPython Notebook' +copyright = u'2012, Takafumi Arakaki' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '0' +# The full version, including alpha/beta/rc tags. +release = '0' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = [] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'default' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'EmacsIPythonNotebookdoc' + + +# -- Options for LaTeX output -------------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', 'EmacsIPythonNotebook.tex', u'Emacs IPython Notebook Documentation', + u'Takafumi Arakaki', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'emacsipythonnotebook', u'Emacs IPython Notebook Documentation', + [u'Takafumi Arakaki'], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------------ + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', 'EmacsIPythonNotebook', u'Emacs IPython Notebook Documentation', + u'Takafumi Arakaki', 'EmacsIPythonNotebook', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' diff --git a/doc/source/index.rst b/doc/source/index.rst new file mode 100644 index 0000000..628cbec --- /dev/null +++ b/doc/source/index.rst @@ -0,0 +1,22 @@ +.. Emacs IPython Notebook documentation master file, created by + sphinx-quickstart on Sun Jun 10 13:37:13 2012. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Emacs IPython Notebook's documentation! +================================================== + +Contents: + +.. toctree:: + :maxdepth: 2 + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + From 3f1f486e521f0cce7312db038e9011175a8b6751 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Sun, 10 Jun 2012 21:59:48 +0200 Subject: [PATCH 02/10] Use sphinx-eldomain to document EIN --- .gitignore | 1 + .gitmodules | 3 ++ doc/eldomain | 1 + doc/source/conf.el | 5 ++++ doc/source/conf.py | 13 +++++++-- doc/source/index.rst | 66 ++++++++++++++++++++++++++++++++++++++------ 6 files changed, 79 insertions(+), 10 deletions(-) create mode 100644 .gitignore create mode 160000 doc/eldomain create mode 100644 doc/source/conf.el diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1edf253 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +doc/build/ diff --git a/.gitmodules b/.gitmodules index 633163b..7810754 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "tests/mocker"] path = tests/mocker url = https://github.com/sigma/mocker.el.git +[submodule "doc/eldomain"] + path = doc/eldomain + url = git://github.com/tkf/sphinx-eldomain.git diff --git a/doc/eldomain b/doc/eldomain new file mode 160000 index 0000000..ac300b2 --- /dev/null +++ b/doc/eldomain @@ -0,0 +1 @@ +Subproject commit ac300b2fec7fd1795bba2c82b5bbe4ae8050e3d8 diff --git a/doc/source/conf.el b/doc/source/conf.el new file mode 100644 index 0000000..b49102a --- /dev/null +++ b/doc/source/conf.el @@ -0,0 +1,5 @@ +(add-to-list 'load-path "~/.emacs.d/el-get/ein/") +(add-to-list 'load-path "~/.emacs.d/el-get/websocket/") + +(require 'ein-notebooklist) +(require 'ein-connect) diff --git a/doc/source/conf.py b/doc/source/conf.py index f2aff33..2d40128 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -16,7 +16,7 @@ import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) +sys.path.insert(0, os.path.join(os.path.abspath('..'), 'eldomain')) # -- General configuration ----------------------------------------------------- @@ -25,7 +25,10 @@ import sys, os # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.todo'] +extensions = [ + 'sphinx.ext.todo', + 'eldomain', +] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -240,3 +243,9 @@ texinfo_documents = [ # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' + + +# -- Options for EL domain ----------------------------------------------------- + +emacs_executable = 'emacs-snapshot' +elisp_packages = {'ein': 'ein:'} diff --git a/doc/source/index.rst b/doc/source/index.rst index 628cbec..9d3139f 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -1,16 +1,66 @@ -.. Emacs IPython Notebook documentation master file, created by - sphinx-quickstart on Sun Jun 10 13:37:13 2012. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - Welcome to Emacs IPython Notebook's documentation! ================================================== -Contents: +.. el:package:: ein -.. toctree:: - :maxdepth: 2 +Commands +-------- +.. el:function:: ein:notebooklist-open +.. el:function:: ein:notebooklist-new-notebook +.. el:function:: ein:notebooklist-open-notebook-global +.. el:function:: ein:notebooklist-new-scratch-notebook + + +Customization +------------- + +Subpackages +^^^^^^^^^^^ + +.. el:variable:: ein:use-auto-complete +.. el:variable:: ein:use-auto-complete-superpack +.. el:variable:: ein:use-smartrep +.. el:variable:: ein:load-dev + +Notebook list +^^^^^^^^^^^^^ + +.. el:variable:: ein:url-or-port +.. el:variable:: ein:scratch-notebook-name-template + +Notebook +^^^^^^^^ + +.. el:variable:: ein:notebook-discard-output-on-save +.. el:variable:: ein:notebook-modes +.. el:variable:: ein:notebook-kill-buffer-ask +.. el:variable:: ein:notebook-console-security-dir +.. el:variable:: ein:notebook-console-executable +.. el:variable:: ein:notebook-console-args + +Connect +^^^^^^^ + +.. el:variable:: ein:connect-run-command +.. el:variable:: ein:connect-save-before-run +.. el:variable:: ein:propagate-connect + +MuMaMo +^^^^^^ + +.. el:variable:: ein:mumamo-codecell-mode +.. el:variable:: ein:mumamo-textcell-mode +.. el:variable:: ein:mumamo-htmlcell-mode +.. el:variable:: ein:mumamo-markdowncell-mode +.. el:variable:: ein:mumamo-rawcell-mode +.. el:variable:: ein:mumamo-headingcell-mode +.. el:variable:: ein:mumamo-fallback-mode + +Misc +^^^^ + +.. el:variable:: ein:query-timeout Indices and tables From 6c12e188c672900adc606e1612f90f2bc0006464 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Mon, 11 Jun 2012 03:52:59 +0200 Subject: [PATCH 03/10] Document keymaps --- doc/eldomain | 2 +- doc/source/conf.el | 4 ++++ doc/source/index.rst | 19 ++++++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/doc/eldomain b/doc/eldomain index ac300b2..b6ad502 160000 --- a/doc/eldomain +++ b/doc/eldomain @@ -1 +1 @@ -Subproject commit ac300b2fec7fd1795bba2c82b5bbe4ae8050e3d8 +Subproject commit b6ad502aea841a10cf3e6de926a222f27905045f diff --git a/doc/source/conf.el b/doc/source/conf.el index b49102a..9393a32 100644 --- a/doc/source/conf.el +++ b/doc/source/conf.el @@ -3,3 +3,7 @@ (require 'ein-notebooklist) (require 'ein-connect) + +;; Load `wid-edit'. Otherwise the following error will be raised: +;; Symbol's function definition is void: widget-button-press +(require 'wid-edit) diff --git a/doc/source/index.rst b/doc/source/index.rst index 9d3139f..2cf2419 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -3,6 +3,24 @@ Welcome to Emacs IPython Notebook's documentation! .. el:package:: ein +Keybinds +-------- + +Notebook +^^^^^^^^ + +.. el:keymap:: ein:notebook-mode-map + +Connected buffer +^^^^^^^^^^^^^^^^ + +.. el:keymap:: ein:connect-mode-map + +Traceback viewer +^^^^^^^^^^^^^^^^ + +.. el:keymap:: ein:traceback-mode-map + Commands -------- @@ -11,7 +29,6 @@ Commands .. el:function:: ein:notebooklist-open-notebook-global .. el:function:: ein:notebooklist-new-scratch-notebook - Customization ------------- From 37da52a213113634fab19c03cb99462ab86430db Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Mon, 11 Jun 2012 04:21:30 +0200 Subject: [PATCH 04/10] Tweak docstrings to make them RST-friendly --- doc/source/index.rst | 6 +++++ ein-connect.el | 15 ++++++++---- ein-notebook.el | 55 ++++++++++++++++++++++++++------------------ 3 files changed, 49 insertions(+), 27 deletions(-) diff --git a/doc/source/index.rst b/doc/source/index.rst index 2cf2419..9c95014 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -16,6 +16,12 @@ Connected buffer .. el:keymap:: ein:connect-mode-map +Other useful commands: + +.. el:function:: ein:connect-to-notebook +.. el:function:: ein:connect-eval-buffer +.. el:function:: ein:connect-run-buffer + Traceback viewer ^^^^^^^^^^^^^^^^ diff --git a/ein-connect.el b/ein-connect.el index 4f07cf0..390eb4d 100644 --- a/ein-connect.el +++ b/ein-connect.el @@ -61,7 +61,8 @@ of OPTION: ;;; Variable/class (defcustom ein:connect-run-command "%run -n" - "%run command used for `ein:connect-run-buffer'." + "``%run`` magic command used for `ein:connect-run-buffer'. +Types same as `ein:notebook-console-security-dir' are valid." :type '(choice (string :tag "command" "%run") (alist :tag "command mapping" @@ -125,13 +126,15 @@ of OPTION: (ein:$notebook-kernel (ein:connect-get-notebook))) (defun ein:connect-eval-buffer () + "Evaluate the whole buffer. Note that this will run the code +inside the ``if __name__ == \"__main__\":`` block." (interactive) (ein:connect-eval-string-internal (buffer-string)) (ein:log 'info "Whole buffer is sent to the kernel.")) (defun ein:connect-run-buffer (&optional ask-command) - "Run buffer using %run. Ask for option if the prefix (C-u) is given. -Variable `ein:connect-run-options' sets the default option." + "Run buffer using ``%run``. Ask for command if the prefix ``C-u`` is given. +Variable `ein:connect-run-command' sets the default command." (interactive "P") ;; FIXME: this should be more intelligent than just `buffer-file-name' ;; to support connecting IPython over ssh. @@ -150,7 +153,11 @@ Variable `ein:connect-run-options' sets the default option." "Use `ein:connect-eval-buffer' instead.")))) (defun ein:connect-run-or-eval-buffer (&optional eval) - "Run buffer with %run or eval whole buffer if the prefix (C-u) is given." + "Run buffer using the ``%run`` magic command or eval whole +buffer if the prefix ``C-u`` is given. +Variable `ein:connect-run-command' sets the command to run. +You can change the command and/or set the options. +See also: `ein:connect-run-buffer', `ein:connect-eval-buffer'." (interactive "P") (if eval (ein:connect-eval-buffer) diff --git a/ein-notebook.el b/ein-notebook.el index 6e319af..64ec946 100644 --- a/ein-notebook.el +++ b/ein-notebook.el @@ -57,13 +57,15 @@ (defcustom ein:notebook-discard-output-on-save 'no "Configure if the output part of the cell should be saved or not. -`no' (symbol) : Save output. This is the default. -`yes' (symbol) : Always discard output. -a function : This function takes two arguments, notebook - and cell. Return `t' to discard output and - return `nil' to save. - If you don't want to save image output, use - `ein:notebook-cell-has-image-output-p'. +`no' : symbol + Save output. This is the default. +`yes' : symbol + Always discard output. +a function + This function takes two arguments, notebook and cell. Return + `t' to discard output and return `nil' to save. For example, + if you don't want to save image output but other kind of + output, use `ein:notebook-cell-has-image-output-p'. Note that using function needs EIN lisp API, which is not defined yet. So be careful when using EIN functions. They may change." @@ -959,6 +961,7 @@ it is installed. If not, a simple mode derived from `python-mode' is used. Examples: + * To avoid using MuMaMo even when it is installed: (setq ein:notebook-modes (delq 'ein:notebook-mumamo-mode ein:notebook-modes)) * Do not use `python-mode'. Use plain mode when MuMaMo is not installed: @@ -1128,16 +1131,20 @@ Called via `kill-emacs-query-functions'." (defcustom ein:notebook-console-security-dir "" "Security directory setting. -Following type is accepted: -string : Use this value as a path to security directory. - Handy when you have only one IPython server. -alist : An alist whose element is \"(URL-OR-PORT . DIR)\". - Key (URL-OR-PORT) can be string (URL), integer (port), or - `default' (symbol). The value of `default' is used when - other key does not much. Normally you should have this - entry. -function : Called with an argument URL-OR-PORT (integer or string). - You can have complex setting using this." +Following types are valid: + +string + Use this value as a path to security directory. + Handy when you have only one IPython server. +alist + An alist whose element is \"(URL-OR-PORT . DIR)\". + Key (URL-OR-PORT) can be string (URL), integer (port), or + `default' (symbol). The value of `default' is used when + other key does not much. Normally you should have this + entry. +function + Called with an argument URL-OR-PORT (integer or string). + You can have complex setting using this." :type '(choice (string :tag "Security directory" "~/.config/ipython/profile_nbserver/security/") @@ -1156,8 +1163,8 @@ function : Called with an argument URL-OR-PORT (integer or string). (defcustom ein:notebook-console-executable (executable-find "ipython") "IPython executable used for console. -Example: \"/user/bin/ipython\" -Types same as `ein:notebook-console-security-dir' are accepted." +Example: ``\"/user/bin/ipython\"``. +Types same as `ein:notebook-console-security-dir' are valid." :type '(choice (string :tag "IPython executable" "/user/bin/ipython") (alist :tag "IPython executable mapping" @@ -1174,8 +1181,8 @@ Types same as `ein:notebook-console-security-dir' are accepted." (defcustom ein:notebook-console-args "--profile nbserver" "Additional argument when using console. -Example: \"--ssh HOSTNAME\" -Types same as `ein:notebook-console-security-dir' are accepted." +Example: ``\"--ssh HOSTNAME\"``. +Types same as `ein:notebook-console-security-dir' are valid." :type '(choice (string :tag "Arguments to IPython" "--profile nbserver --ssh HOSTNAME") @@ -1210,8 +1217,10 @@ Types same as `ein:notebook-console-security-dir' are accepted." "Open IPython console. To use this function, `ein:notebook-console-security-dir' and `ein:notebook-console-args' must be set properly. -This function requires Fabian Gallina's python.el for now: -https://github.com/fgallina/python.el" +This function requires `Fabian Gallina's python.el`_ for now; +It should be possible to support python-mode.el. Patches are welcome! + +.. _`Fabian Gallina's python.el`: https://github.com/fgallina/python.el" ;; FIXME: use %connect_info to get connection file, then I can get ;; rid of `ein:notebook-console-security-dir'. (interactive) From a1b0603ded9f1c0f0cfb15cf448d304a49702c4b Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Mon, 11 Jun 2012 04:38:46 +0200 Subject: [PATCH 05/10] Fix: ein:mumamo-*-mode was not auto documented --- doc/source/conf.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/conf.el b/doc/source/conf.el index 9393a32..710bbc7 100644 --- a/doc/source/conf.el +++ b/doc/source/conf.el @@ -1,7 +1,9 @@ (add-to-list 'load-path "~/.emacs.d/el-get/ein/") (add-to-list 'load-path "~/.emacs.d/el-get/websocket/") +(add-to-list 'load-path "~/.emacs.d/el-get/nxhtml/util/") ; mumamo (require 'ein-notebooklist) +(require 'ein-mumamo) (require 'ein-connect) ;; Load `wid-edit'. Otherwise the following error will be raised: From 724099ac49929719e029e0303bb49ab2f10c4fd6 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Mon, 11 Jun 2012 04:46:11 +0200 Subject: [PATCH 06/10] RST-friendly fix --- ein-notebook.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ein-notebook.el b/ein-notebook.el index 64ec946..0eac89f 100644 --- a/ein-notebook.el +++ b/ein-notebook.el @@ -962,9 +962,12 @@ used. Examples: -* To avoid using MuMaMo even when it is installed: +Avoid using MuMaMo even when it is installed:: + (setq ein:notebook-modes (delq 'ein:notebook-mumamo-mode ein:notebook-modes)) -* Do not use `python-mode'. Use plain mode when MuMaMo is not installed: + +Do not use `python-mode'. Use plain mode when MuMaMo is not installed:: + (setq ein:notebook-modes '(ein:notebook-mumamo-mode ein:notebook-plain-mode)) " :type '(repeat (choice (const :tag "MuMaMo" ein:notebook-mumamo-mode) From 40d5d9ca9a63ceb338fd85a65f0baa9ce392a774 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Mon, 11 Jun 2012 05:12:04 +0200 Subject: [PATCH 07/10] Write more documents --- doc/source/index.rst | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/doc/source/index.rst b/doc/source/index.rst index 9c95014..84a534a 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -6,14 +6,34 @@ Welcome to Emacs IPython Notebook's documentation! Keybinds -------- +Notebook list +^^^^^^^^^^^^^ + +You can start notebook by ``M-x ein:notebooklist-open`` and enter the +port or URL of the IPython notebook server. + +.. el:function:: ein:notebooklist-open +.. el:function:: ein:notebooklist-new-notebook +.. el:function:: ein:notebooklist-open-notebook-global +.. el:function:: ein:notebooklist-new-scratch-notebook + Notebook ^^^^^^^^ +The following keybinds are available in notebook buffers. + .. el:keymap:: ein:notebook-mode-map Connected buffer ^^^^^^^^^^^^^^^^ +You can connect any buffer (typically buffer opening Python file) to +opened notebook and use the kernel of the notebook to execute the +code, inspect objects, auto-complete code, jump to the other source, +etc. Once the buffer is connected to the notebook, minor mode +:el:symbol:`ein:connect-mode` is enabled and the following keybinds +are available. + .. el:keymap:: ein:connect-mode-map Other useful commands: @@ -25,19 +45,20 @@ Other useful commands: Traceback viewer ^^^^^^^^^^^^^^^^ +Traceback in notebook buffer is not easy to understand. You can open +Traceback viewer by the command :el:symbol:`ein:notebook-view-traceback`. +In the Traceback viewer, following keybinds are available. + .. el:keymap:: ein:traceback-mode-map -Commands --------- - -.. el:function:: ein:notebooklist-open -.. el:function:: ein:notebooklist-new-notebook -.. el:function:: ein:notebooklist-open-notebook-global -.. el:function:: ein:notebooklist-new-scratch-notebook Customization ------------- +You can customize EIN using the Emacs customization UI by typing +``M-x customize-group RET ein RET``. +All the configurable variables are listed below. + Subpackages ^^^^^^^^^^^ From 74d64bd20a308fe3c21e9c8ad73d3e24729e77c0 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Mon, 11 Jun 2012 05:28:10 +0200 Subject: [PATCH 08/10] Copy intro part from README to the document --- README.rst | 3 ++- doc/source/index.rst | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 9195cd7..7604573 100644 --- a/README.rst +++ b/README.rst @@ -25,7 +25,7 @@ Highlighted features: * Copy/paste cells, even to/from different notebooks. * Console integration: You can easily connect to kernel via console application. This enables you to start debugging in the same - kernel. + kernel. It is even possible to connect console over ssh. * IPython kernel can be "connected" to any buffers. This enables you to evaluate buffer/region using same kernel as notebook. Notebook goodies such as tooltip help, help browser and code completion are @@ -40,6 +40,7 @@ Other notebook features: * Popup (tooltip) help * Syntax highlighting in each cell types (Python/Markdown) * Help browser (opens when executing ``function?``) +* Traceback viewer Quick try diff --git a/doc/source/index.rst b/doc/source/index.rst index 84a534a..97a14fd 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -3,6 +3,35 @@ Welcome to Emacs IPython Notebook's documentation! .. el:package:: ein +Emacs IPython Notebook (EIN) provides fully featured IPython Notebook +client and integrated REPL (like SLIME_). + +.. _SLIME: http://common-lisp.net/project/slime/ + +Highlighted features: + +* Copy/paste cells, even to/from different notebooks. +* Console integration: You can easily connect to kernel via console + application. This enables you to start debugging in the same + kernel. It is even possible to connect console over ssh [#]_. +* IPython kernel can be "connected" to any buffers. This enables you + to evaluate buffer/region using same kernel as notebook. Notebook + goodies such as tooltip help, help browser and code completion are + available in these buffers. +* Jump to definition (go to the definition by hitting ``M-.`` over an + object). + +Other notebook features: + +* Inline images +* Auto/manual-completion +* Popup (tooltip) help +* Syntax highlighting in each cell types (Python/Markdown) +* Help browser (opens when executing ``function?``) +* Traceback viewer + +.. [#] You need to setup :el:symbol:`ein:notebook-console-args` properly + Keybinds -------- From c6696eb0c61bcf2d82645d48c511064331b70e2a Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Mon, 11 Jun 2012 05:32:52 +0200 Subject: [PATCH 09/10] Remove the dead link to py-modindex.html --- doc/source/index.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/source/index.rst b/doc/source/index.rst index 97a14fd..8135d10 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -140,6 +140,5 @@ Indices and tables ================== * :ref:`genindex` -* :ref:`modindex` * :ref:`search` From 6cd6c3b2c764806cf8c01bacf72eef6390d983bf Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Mon, 11 Jun 2012 06:15:34 +0200 Subject: [PATCH 10/10] Document more --- doc/source/index.rst | 16 ++++++++++++++++ ein-notebook.el | 26 ++++++++++++++++++++++++++ ein-pytools.el | 13 ++++++++++--- ein-shared-output.el | 1 + 4 files changed, 53 insertions(+), 3 deletions(-) diff --git a/doc/source/index.rst b/doc/source/index.rst index 8135d10..481dcf4 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -71,6 +71,13 @@ Other useful commands: .. el:function:: ein:connect-eval-buffer .. el:function:: ein:connect-run-buffer +Shared output buffer +^^^^^^^^^^^^^^^^^^^^ + +.. el:function:: ein:shared-output-pop-to-buffer + +.. el:keymap:: ein:shared-output-mode-map + Traceback viewer ^^^^^^^^^^^^^^^^ @@ -80,6 +87,15 @@ In the Traceback viewer, following keybinds are available. .. el:keymap:: ein:traceback-mode-map +PyTools +^^^^^^^ + +These commands can be used in the notebook buffer and the connected +buffer. + +.. el:function:: ein:pytools-whos +.. el:function:: ein:pytools-hierarchy + Customization ------------- diff --git a/ein-notebook.el b/ein-notebook.el index 0eac89f..959c922 100644 --- a/ein-notebook.el +++ b/ein-notebook.el @@ -394,6 +394,9 @@ But be careful!" (ein:aif (ein:notebook-get-current-cell) (ein:cell-goto it)))) (defun ein:notebook-kill-cell-command () + "Kill (\"cut\") the cell at point. +Note the kill-ring for cells is not shared with the default +kill-ring of Emacs (kill-ring for texts)." (interactive) (ein:notebook-with-cell nil (ein:cell-save-text cell) @@ -402,11 +405,14 @@ But be careful!" (ein:aif (ein:notebook-get-current-cell) (ein:cell-goto it)))) (defun ein:notebook-copy-cell-command () + "Copy the cell at point. (Put the current cell into the kill-ring.)" (interactive) (ein:notebook-with-cell nil (ein:kill-new (ein:cell-deactivate (ein:cell-copy cell))))) (defun ein:notebook-yank-cell-command (&optional arg) + "Insert (\"paste\") the latest killed cell. +Prefixes are act same as the normal `yank' command." (interactive "*P") ;; Do not use `ein:notebook-with-cell'. ;; `ein:notebook-insert-cell-below' handles empty cell. @@ -489,6 +495,9 @@ when the prefix argument is given." cell)))) (defun ein:notebook-toggle-cell-type () + "Toggle the cell type of the cell at point. +Use `ein:notebook-change-cell-type' to change the cell type +directly." (interactive) (ein:notebook-with-cell nil (let ((type (case (ein:$notebook-nbformat ein:notebook) @@ -506,6 +515,8 @@ when the prefix argument is given." (ein:cell-goto new))))) (defun ein:notebook-change-cell-type () + "Change the cell type of the current cell. +Prompt will appear in the minibuffer." (interactive) (ein:notebook-with-cell nil (let* ((choices (case (ein:$notebook-nbformat ein:notebook) @@ -630,6 +641,8 @@ If prefix is given, merge current cell into previous cell." (setf (ein:$notebook-dirty notebook) t)) (defun ein:notebook-toggle-output-command () + "Toggle the visibility of the output of the cell at point. +This does not alter the actual data stored in the cell." (interactive) (ein:notebook-with-cell #'ein:codecell-p (ein:notebook-toggle-output ein:notebook cell))) @@ -670,6 +683,7 @@ Do not clear input prompts when the prefix argument is given." ;;; Traceback (defun ein:notebook-view-traceback () + "Open traceback viewer for the traceback at point." (interactive) (ein:notebook-with-cell #'ein:codecell-p (let ((tb-data @@ -702,6 +716,7 @@ Do not clear input prompts when the prefix argument is given." (ein:kernel-restart (ein:$notebook-kernel notebook))) (defun ein:notebook-restart-kernel-command () + "Send request to the server to restart kernel." (interactive) (if ein:notebook (when (y-or-n-p "Really restart kernel? ") @@ -788,6 +803,9 @@ Do not clear input prompts when the prefix argument is given." (ein:notebook-request-help ein:notebook)) (defun ein:notebook-request-tool-tip-or-help-command (&optional pager) + "Show the help for the object at point using tooltip. +When the prefix argument ``C-u`` is given, open the help in the +pager buffer." (interactive "P") (if pager (ein:notebook-request-help-command) @@ -810,6 +828,8 @@ Do not clear input prompts when the prefix argument is given." (ein:notebook-complete-at-point ein:notebook)))) (defun ein:notebook-kernel-interrupt-command () + "Interrupt the kernel. +This is equivalent to do ``C-c`` in the console program." (interactive) (ein:kernel-interrupt (ein:$notebook-kernel ein:notebook))) @@ -821,6 +841,11 @@ Do not clear input prompts when the prefix argument is given." ;; misc kernel related (defun ein:notebook-eval-string (code) + "Evaluate a code. Prompt will appear asking the code to run. +This is handy when you want to execute something quickly without +making a cell. If the code outputs something, it will go to the +shared output buffer. You can open the buffer by the command +`ein:shared-output-pop-to-buffer'." (interactive "sIP[y]: ") (let ((cell (ein:shared-output-get-cell)) (kernel (ein:$notebook-kernel ein:notebook)) @@ -897,6 +922,7 @@ Do not clear input prompts when the prefix argument is given." `((204 . ,(cons #'ein:notebook-save-notebook-success notebook)))))) (defun ein:notebook-save-notebook-command () + "Save the notebook." (interactive) (ein:notebook-save-notebook ein:notebook 0)) diff --git a/ein-pytools.el b/ein-pytools.el index 5987c16..3e4130e 100644 --- a/ein-pytools.el +++ b/ein-pytools.el @@ -128,6 +128,9 @@ If OTHER-WINDOW is non-`nil', open the file in the other window." (list object other-window notebook-buffer))))) (defun ein:pytools-jump-to-source-command (&optional other-window) + "Jump to the source code of the object at point. +When the prefix argument ``C-u`` is given, open the source code +in the other window." (interactive "P") (require 'ein-connect) (let ((kernel (ein:pytools-get-kernel)) @@ -139,6 +142,9 @@ If OTHER-WINDOW is non-`nil', open the file in the other window." (ein:pytools-get-notebook-buffer))))) (defun ein:pytools-jump-back-command (&optional other-window) + "Go back to the point where `ein:pytools-jump-to-source-command' +is executed last time. When the prefix argument ``C-u`` is +given, open the last point in the other window." (interactive "P") (when (ein:aand (car ein:pytools-jump-stack) (equal (point) (marker-position it))) @@ -155,14 +161,15 @@ If OTHER-WINDOW is non-`nil', open the file in the other window." (ein:cell-execute cell kernel code popup))) (defun ein:pytools-whos () - "Execute %whos magic command and popup the result." + "Execute ``%whos`` magic command and popup the result." (interactive) (ein:pytools-eval-string-internal "%whos" t)) (defun ein:pytools-hierarchy (&optional ask) "Draw inheritance graph of the class at point. -hierarchymagic extension is needed to be installed. -see: https://github.com/tkf/ipython-hierarchymagic" +hierarchymagic_ extension is needed to be installed. + +.. _hierarchymagic: https://github.com/tkf/ipython-hierarchymagic" (interactive "P") (let ((object (ein:object-at-point))) (when ask diff --git a/ein-shared-output.el b/ein-shared-output.el index 4a38969..5d0c74b 100644 --- a/ein-shared-output.el +++ b/ein-shared-output.el @@ -123,6 +123,7 @@ Create a cell if the buffer has none." (oref cell :kernel)))) (defun ein:shared-output-pop-to-buffer () + "Open shared output buffer." (interactive) (ein:shared-output-get-or-create) (pop-to-buffer (ein:shared-output-create-buffer)))