Skip to content

Commit

Permalink
Merge pull request #2692 from bfroehle/cython_doc_fixes
Browse files Browse the repository at this point in the history
Add %%cython magics to generated documentation.
  • Loading branch information
takluyver committed Dec 18, 2012
2 parents bb2d35b + 6e270db commit b8f97bc
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion IPython/extensions/cythonmagic.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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."""
Expand Down

0 comments on commit b8f97bc

Please sign in to comment.