File tree Expand file tree Collapse file tree 3 files changed +29
-12
lines changed Expand file tree Collapse file tree 3 files changed +29
-12
lines changed Original file line number Diff line number Diff line change @@ -178,23 +178,44 @@ thumbnail with its default link Background color */
178
178
max-height : 112px ;
179
179
max-width : 160px ;
180
180
}
181
- .sphx-glr-thumbcontainer [tooltip ]: hover : after {
182
- background : var (--sg-tooltip-background );
181
+
182
+ .sphx-glr-thumbcontainer [tooltip ]::before {
183
+ content : "" ;
184
+ position : absolute;
185
+ pointer-events : none;
186
+ top : 0 ;
187
+ left : 0 ;
188
+ width : 100% ;
189
+ height : 100% ;
190
+ z-index : 97 ;
191
+ background-color : var (--sg-tooltip-background );
192
+ backdrop-filter : blur (3px );
193
+ opacity : 0 ;
194
+ transition : opacity 0.3s ;
195
+ }
196
+
197
+ .sphx-glr-thumbcontainer [tooltip ]: hover ::before {
198
+ opacity : 1 ;
199
+ }
200
+
201
+ .sphx-glr-thumbcontainer [tooltip ]: hover ::after {
183
202
-webkit-border-radius : 4px ;
184
203
-moz-border-radius : 4px ;
185
204
border-radius : 4px ;
186
205
color : var (--sg-tooltip-foreground );
187
206
content : attr (tooltip);
188
- padding : 10px ;
207
+ padding : 10px 10 px 5 px ;
189
208
z-index : 98 ;
190
209
width : 100% ;
191
- height : 100% ;
210
+ max- height: 100% ;
192
211
position : absolute;
193
212
pointer-events : none;
194
213
top : 0 ;
195
214
box-sizing : border-box;
196
215
overflow : hidden;
197
- backdrop-filter : blur (3px );
216
+ display : -webkit-box;
217
+ -webkit-box-orient : vertical;
218
+ -webkit-line-clamp : 6 ;
198
219
}
199
220
200
221
.sphx-glr-script-out {
Original file line number Diff line number Diff line change @@ -331,9 +331,6 @@ def extract_intro_and_title(filename, docstring):
331
331
# Concatenate all lines of the first paragraph and truncate at 95 chars
332
332
intro = re .sub ("\n " , " " , intro_paragraph )
333
333
intro = _sanitize_rst (intro )
334
- if len (intro ) > 95 :
335
- intro = intro [:95 ] + "..."
336
-
337
334
title = _sanitize_rst (title )
338
335
339
336
return intro , title
Original file line number Diff line number Diff line change @@ -352,15 +352,14 @@ def test_extract_intro_and_title():
352
352
) # noqa: E501
353
353
assert title == '"-`Header"-with:; punct mark\' s'
354
354
355
- # Long intro paragraph gets shortened
355
+ # Long intro paragraph are preserved
356
356
intro_paragraph = "\n " .join (["this is one line" for _ in range (10 )])
357
357
intro , _ = sg .extract_intro_and_title (
358
358
"filename" , "Title\n -----\n \n " + intro_paragraph
359
359
)
360
360
assert len (intro_paragraph ) > 100
361
- assert len (intro ) < 100
362
- assert intro .endswith ("..." )
363
- assert intro_paragraph .replace ("\n " , " " )[:95 ] == intro [:95 ]
361
+ assert len (intro ) > 100
362
+ assert intro_paragraph .replace ("\n " , " " ) == intro
364
363
365
364
# Errors
366
365
with pytest .raises (ExtensionError , match = "should have a header" ):
You can’t perform that action at this time.
0 commit comments