Add new_magic.rst: guide for creating custom magics#351
Merged
blink1073 merged 1 commit intoCalysto:mainfrom Mar 9, 2026
Merged
Add new_magic.rst: guide for creating custom magics#351blink1073 merged 1 commit intoCalysto:mainfrom
blink1073 merged 1 commit intoCalysto:mainfrom
Conversation
Addresses Calysto#282 by documenting how to write, install, and distribute custom magics for MetaKernel kernels (line/cell magics, @option, user-local install, %install_magic, IPython compatibility). Adds a test verifying that magics in ~/.ipython/metakernel/magics/ are discovered at kernel startup.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #351 +/- ##
=======================================
Coverage 90.88% 90.88%
=======================================
Files 51 51
Lines 2854 2854
Branches 396 396
=======================================
Hits 2594 2594
Misses 181 181
Partials 79 79 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #282
docs/source/new_magic.rstaddressing possible / how to define a new magic ? #282 — documents how to write, install, and distribute custom magics for any MetaKernel-based kernel@optiondecorator, user-local install (~/.ipython/metakernel/magics/),%install_magic, bundling with a kernel package, output helpers, docstring conventions, and IPython compatibilitydocs/index.rsttest_local_magics_dir_loadedto verify that magics placed in~/.ipython/metakernel/magics/are discovered at kernel startupTest plan
just test tests/test_metakernel.py::test_local_magics_dir_loadedpassesjust docsbuilds without warnings