File tree 5 files changed +30
-12
lines changed
ipython_markdown_inspector
5 files changed +30
-12
lines changed Original file line number Diff line number Diff line change 1
1
# ipython-markdown-inspector
2
2
3
- [ ![ tests] ( https://github.com/krassowski/ipython-markdown-inspector/workflows/tests/badge.svg )] ( https://github.com/krassowski/ipython-markdown-inspector/actions?query=workflow%3A%22tests%22 )
3
+ [ ![ tests] ( https://github.com/krassowski/ipython-markdown-inspector/actions/ workflows/tests.yml /badge.svg?branch=main )] ( https://github.com/krassowski/ipython-markdown-inspector/actions/workflows/tests.yml )
4
4
![ CodeQL] ( https://github.com/krassowski/ipython-markdown-inspector/workflows/CodeQL/badge.svg )
5
+ [ ![ Binder] ( https://mybinder.org/badge_logo.svg )] ( https://mybinder.org/v2/gh/krassowski/ipython-markdown-inspector/main?urlpath=lab )
5
6
[ ![ pypi-version] ( https://img.shields.io/pypi/v/ipython-markdown-inspector.svg )] ( https://python.org/pypi/ipython-markdown-inspector )
6
7
7
8
IPython extension providing inspection results as Markdown, enabling better integration with Jupyter Notebook and JupyterLab.
Original file line number Diff line number Diff line change
1
+ name : ipython-markdown-inspector
2
+
3
+ channels :
4
+ - conda-forge
5
+ - nodefaults
6
+
7
+ dependencies :
8
+ - python =3.10
9
+ - pip
10
+ - jupyterlab >=4.1
11
+ - hatchling >=1.5.0
12
+ - ipykernel >=6.29
13
+ - notebook >=7.1
14
+ - jupyter_server >=2.12
15
+ - wheel
16
+ - build
17
+ - ipython >=8.22
18
+ - traitlets >=5.14.1
Original file line number Diff line number Diff line change
1
+ c .InteractiveShellApp .extensions = ["ipython_markdown_inspector" ] # noqa: F821
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ source activate ${NB_PYTHON_PREFIX}
4
+
5
+ pip install -v -e . --no-build-isolation
6
+
7
+ mkdir -p ~ /.ipython/profile_default/
8
+ cp binder/ipython_config.py ~ /.ipython/profile_default/
Original file line number Diff line number Diff line change 1
- from functools import partial
2
1
from typing import List
3
2
4
3
from IPython .core .interactiveshell import InteractiveShell
5
- from IPython .core .oinspect import InspectorHookData
6
4
7
5
from .formatter import as_markdown
8
6
9
7
10
- def hook (
11
- data : InspectorHookData ,
12
- * _ ,
13
- ipython : InteractiveShell ,
14
- ) -> str :
15
- return as_markdown (data )
16
-
17
-
18
8
ORIGINAL_HOOK = None
19
9
20
10
21
11
def load_ipython_extension (ipython : InteractiveShell ):
22
12
global ORIGINAL_HOOK
23
13
ORIGINAL_HOOK = ipython .inspector .mime_hooks .get ("text/markdown" , None )
24
- ipython .inspector .mime_hooks ["text/markdown" ] = partial ( hook , ipython = ipython )
14
+ ipython .inspector .mime_hooks ["text/markdown" ] = as_markdown
25
15
26
16
27
17
def unload_ipython_extension (ipython : InteractiveShell ):
You can’t perform that action at this time.
0 commit comments