Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add %%cython magics to generated documentation.

  • Loading branch information...
commit 6e270db850626a8b8aca60ff4570b3248d6d998c 1 parent bb2d35b
@bfroehle authored
Showing with 23 additions and 1 deletion.
  1. +23 −1 IPython/extensions/cythonmagic.py
View
24 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 @@ def clean_annotated_html(html):
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."""
Please sign in to comment.
Something went wrong with that request. Please try again.