Return dict of documentation of magic functions. The return dict has the keys 'line' and 'cell', corresponding to the two types of magics we support. Each value is a dict keyed by magic name whose value is the function docstring. If a docstring is unavailable, the va
(
self, brief: bool = False, missing: str = ""
)
| 426 | return self.magics |
| 427 | |
| 428 | def lsmagic_docs( |
| 429 | self, brief: bool = False, missing: str = "" |
| 430 | ) -> dict[str, dict[str, str]]: |
| 431 | """Return dict of documentation of magic functions. |
| 432 | |
| 433 | The return dict has the keys 'line' and 'cell', corresponding to the |
| 434 | two types of magics we support. Each value is a dict keyed by magic |
| 435 | name whose value is the function docstring. If a docstring is |
| 436 | unavailable, the value of `missing` is used instead. |
| 437 | |
| 438 | If brief is True, only the first line of each docstring will be returned. |
| 439 | """ |
| 440 | docs: dict[str, dict[str, str]] = {} |
| 441 | for m_type in self.magics: |
| 442 | m_docs: dict[str, str] = {} |
| 443 | for m_name, m_func in self.magics[m_type].items(): |
| 444 | if m_func.__doc__: |
| 445 | if brief: |
| 446 | m_docs[m_name] = m_func.__doc__.split("\n", 1)[0] |
| 447 | else: |
| 448 | m_docs[m_name] = m_func.__doc__.rstrip() |
| 449 | else: |
| 450 | m_docs[m_name] = missing |
| 451 | docs[m_type] = m_docs |
| 452 | return docs |
| 453 | |
| 454 | def register_lazy(self, name: str, fully_qualified_name: str) -> None: |
| 455 | """ |