mirror of
https://github.com/explosion/spaCy.git
synced 2025-09-19 18:42:37 +03:00
chore(ipython): import from IPython.display
instead of IPython.core.display
This commit is contained in:
parent
41e07772dc
commit
f767ab90cd
|
@ -66,7 +66,7 @@ def render(
|
|||
if jupyter or (jupyter is None and is_in_jupyter()):
|
||||
# return HTML rendered by IPython display()
|
||||
# See #4840 for details on span wrapper to disable mathjax
|
||||
from IPython.core.display import HTML, display
|
||||
from IPython.display import HTML, display
|
||||
|
||||
return display(HTML('<span class="tex2jax_ignore">{}</span>'.format(html)))
|
||||
return html
|
||||
|
|
|
@ -1452,7 +1452,7 @@ detecting the IPython kernel. Mainly used for the
|
|||
> ```python
|
||||
> html = "<h1>Hello world!</h1>"
|
||||
> if util.is_in_jupyter():
|
||||
> from IPython.core.display import display, HTML
|
||||
> from IPython.display import display, HTML
|
||||
> display(HTML(html))
|
||||
> ```
|
||||
|
||||
|
|
|
@ -254,12 +254,12 @@ rendering if auto-detection fails.
|
|||
|
||||

|
||||
|
||||
Internally, displaCy imports `display` and `HTML` from `IPython.core.display`
|
||||
Internally, displaCy imports `display` and `HTML` from `IPython.display`
|
||||
and returns a Jupyter HTML object. If you were doing it manually, it'd look like
|
||||
this:
|
||||
|
||||
```python
|
||||
from IPython.core.display import display, HTML
|
||||
from IPython.display import display, HTML
|
||||
|
||||
html = displacy.render(doc, style="dep")
|
||||
display(HTML(html))
|
||||
|
|
Loading…
Reference in New Issue
Block a user