File tree Expand file tree Collapse file tree 9 files changed +4176
-2883
lines changed
Expand file tree Collapse file tree 9 files changed +4176
-2883
lines changed Load Diff Large diffs are not rendered by default.
Load Diff Large diffs are not rendered by default.
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ def _repr_html_(self) -> str:
185185 jinja_env = get_jinja_env ()
186186 if jinja_env :
187187 template = jinja_env .get_template ("JSON.jinja2" )
188- return str (template .render (dict = self .to_dict ()))
188+ return str (template .render (dict = self .to_dict (), plain = escape ( repr ( self )) ))
189189 else :
190190 return escape (repr (self ))
191191
Original file line number Diff line number Diff line change 2929 color : rgb (0 , 128 , 0 );
3030 font-weight : 700 ;
3131}
32+ .pystac-wrap {
33+ display : block !important ;
34+ }
35+ .pystac-text-repr-fallback {
36+ /* fallback to plain text repr when CSS is not injected (untrusted notebook) */
37+ display : none ;
38+ }
3239 </style >
33- <div class =" jp-RenderedJSON jp-mod-trusted jp-OutputArea-output" >
40+ <div >
41+ <div class =" pystac-text-repr-fallback" >
42+ {{ plain }}
43+ </div >
44+ <div class =" jp-RenderedJSON jp-mod-trusted jp-OutputArea-output pystac-wrap" style =' display :none ' >
3445 <div class =" container" style =" line-height : normal ;" >
3546 <ul style =" padding : 0px ; margin : 0px ; list-style : none ; display : block ;" >
3647 {% for key , value in dict .items () %}
4253 {% endfor %}
4354 </ul >
4455 </div >
45- </div >
56+ </div >
57+ </div >
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ def _repr_html_(self) -> str:
150150 jinja_env = get_jinja_env ()
151151 if jinja_env :
152152 template = jinja_env .get_template ("JSON.jinja2" )
153- return str (template .render (dict = self .to_dict ()))
153+ return str (template .render (dict = self .to_dict (), plain = escape ( repr ( self )) ))
154154 else :
155155 return escape (repr (self ))
156156
Original file line number Diff line number Diff line change @@ -275,7 +275,11 @@ def _repr_html_(self) -> str:
275275 jinja_env = get_jinja_env ()
276276 if jinja_env :
277277 template = jinja_env .get_template ("JSON.jinja2" )
278- return str (template .render (dict = self .to_dict ()))
278+ return str (
279+ template .render (
280+ dict = self .to_dict (transform_href = False ), plain = escape (repr (self ))
281+ )
282+ )
279283 else :
280284 return escape (repr (self ))
281285
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ def _repr_html_(self) -> str:
7676 jinja_env = get_jinja_env ()
7777 if jinja_env :
7878 template = jinja_env .get_template ("JSON.jinja2" )
79- return str (template .render (dict = self .to_dict ()))
79+ return str (template .render (dict = self .to_dict (), plain = escape ( repr ( self )) ))
8080 else :
8181 return escape (repr (self ))
8282
Original file line number Diff line number Diff line change @@ -587,7 +587,11 @@ def _repr_html_(self) -> str:
587587 jinja_env = get_jinja_env ()
588588 if jinja_env :
589589 template = jinja_env .get_template ("JSON.jinja2" )
590- return str (template .render (dict = self .to_dict (transform_hrefs = False )))
590+ return str (
591+ template .render (
592+ dict = self .to_dict (transform_hrefs = False ), plain = escape (repr (self ))
593+ )
594+ )
591595 else :
592596 return escape (repr (self ))
593597
You can’t perform that action at this time.
0 commit comments