ipython/ipython — pull request #2002 by bfroehle (2012-06-22 00:43:44+00:00)
Title: Refactor %magic into a lsmagic_docs API function.

From @fperez in #1999:
> @bfroehle, I think %magic -brief was added for doc generation at some point, which is obviously a bit of a hack, though I'm not totally sure anymore.
>
> The right answer now would obviously be to move that functionality into the magics manager as an api call, and let the magic call be strictly for human-friendly use with direct printing.

I've added a `lsmagic_docs` method which returns a dictionary of magic function docstrings. It optionally takes parameters `brief` (list only first line of the docstring) and `missing` (to use in lieu of an empty docstring).