@@ -25,6 +25,7 @@ def to_markdown(item, skip_octicon=False):
25
25
else :
26
26
return ''
27
27
28
+
28
29
def process_admonitions (key , value , format , meta ):
29
30
# Replace admonitions with proper HTML.
30
31
if key == 'Div' :
@@ -59,7 +60,7 @@ def process_admonitions(key, value, format, meta):
59
60
note_content_md = '' .join (to_markdown (item ) for item in note_content )
60
61
html_content = markdown .markdown (note_content_md )
61
62
62
- return [{'t' : 'RawBlock' , 'c' : ['html' , f'<div style="background-color: { color } ; color: #fff; font-weight: 700; padding-left: 10px; padding-top: 5px; padding-bottom: 5px">{ label } </div>' ]}, {'t' : 'RawBlock' , 'c' : ['html' , '<div style="background-color: #f3f4f7; padding-left: 10px; padding-top: 10px; padding-bottom: 10px; padding-right: 10px">' ]}, {'t' : 'RawBlock' , 'c' : ['html' , html_content ]}, {'t' : 'RawBlock' , 'c' : ['html' , '</div>' ]}]
63
+ return [{'t' : 'RawBlock' , 'c' : ['html' , f'<div style="background-color: { color } ; color: #fff; font-weight: 700; padding-left: 10px; padding-top: 5px; padding-bottom: 5px"><strong> { label } </strong> </div>' ]}, {'t' : 'RawBlock' , 'c' : ['html' , '<div style="background-color: #f3f4f7; padding-left: 10px; padding-top: 10px; padding-bottom: 10px; padding-right: 10px">' ]}, {'t' : 'RawBlock' , 'c' : ['html' , html_content ]}, {'t' : 'RawBlock' , 'c' : ['html' , '</div>' ]}]
63
64
elif key == 'RawBlock' :
64
65
# this is needed for the cells that have embedded video.
65
66
# We add a special tag to those: ``` {python, .jupyter-code-cell}
@@ -93,9 +94,10 @@ def process_images(key, value, format, meta):
93
94
if src .startswith ('/_static' ):
94
95
src = src [1 :]
95
96
src = 'https://pytorch.org/tutorials/' + src
96
-
97
+
97
98
return {'t' : 'Image' , 'c' : [[ident , classes , keyvals ], caption , [src , title ]]}
98
99
100
+
99
101
def process_grids (key , value , format , meta ):
100
102
# Generate side by side grid cards. Only for the two-cards layout
101
103
# that we use in the tutorial template.
0 commit comments