From 6e270db850626a8b8aca60ff4570b3248d6d998c 2012-12-17 04:41:37 From: Bradley M. Froehle Date: 2012-12-17 04:41:37 Subject: [PATCH] Add %%cython magics to generated documentation. --- diff --git a/IPython/extensions/cythonmagic.py b/IPython/extensions/cythonmagic.py index 8edf5d5..289214c 100644 --- a/IPython/extensions/cythonmagic.py +++ b/IPython/extensions/cythonmagic.py @@ -1,6 +1,23 @@ # -*- coding: utf-8 -*- """ -Cython related magics. +===================== +Cython related magics +===================== + +Usage +===== + +``%%cython`` + +{CYTHON_DOC} + +``%%cython_inline`` + +{CYTHON_INLINE_DOC} + +``%%cython_pyximport`` + +{CYTHON_PYXIMPORT_DOC} Author: * Brian Granger @@ -273,6 +290,11 @@ class CythonMagics(Magics): html = '\n'.join(l for l in html.splitlines() if not r.match(l)) return html +__doc__ = __doc__.format( + CYTHON_DOC = ' '*8 + CythonMagics.cython.__doc__, + CYTHON_INLINE_DOC = ' '*8 + CythonMagics.cython_inline.__doc__, + CYTHON_PYXIMPORT_DOC = ' '*8 + CythonMagics.cython_pyximport.__doc__, +) def load_ipython_extension(ip): """Load the extension in IPython."""