@@ -202,14 +202,14 @@ def _box(boxtype, text_or_url, left, top, height, width, id, props_attr,
202202 'fontStyle' : 'normal' ,
203203 'fontWeight' : 400 ,
204204 'height' : height ,
205- 'left' : 0.0 ,
205+ 'left' : left ,
206206 'lineHeight' : 'normal' ,
207207 'minWidth' : 20 ,
208208 'opacity' : 1 ,
209209 'textAlign' : 'center' ,
210210 'textDecoration' : 'none' ,
211- 'top' : 350.0 ,
212- 'width' : 1000.0 }}
211+ 'top' : top ,
212+ 'width' : width }}
213213
214214 elif boxtype == 'Image' :
215215 props = {
@@ -335,48 +335,6 @@ def _list_of_slides(markdown_string):
335335 return list_of_slides
336336
337337
338- def _boxes_in_slide (slide ):
339- boxes = []
340- slide_copy = copy .deepcopy (slide )
341- prop_split = ';'
342- prop_val_sep = '='
343-
344- while '.left' in slide_copy :
345- prop_dict = {}
346- left_idx = slide_copy .find ('.left' )
347- l_brace_idx = slide_copy [left_idx :].find ('{{' ) + left_idx
348- properties = slide_copy [left_idx + 1 : l_brace_idx ].split (
349- prop_split
350- )
351-
352- # remove white chars from properties
353- empty_props = []
354- for prop in properties :
355- if all (char in [' ' , '\n ' ] for char in prop ):
356- empty_props .append (prop )
357-
358- for prop in empty_props :
359- properties .remove (prop )
360-
361- for prop in properties :
362- prop_name = prop .split (prop_val_sep )[0 ]
363- prop_val = prop .split (prop_val_sep )[1 ]
364-
365- try :
366- prop_val = float (prop_val )
367- except ValueError :
368- pass
369- prop_dict [prop_name ] = prop_val
370-
371- r_brace_idx = slide_copy [l_brace_idx :].find ('}}' ) + l_brace_idx
372- box = slide_copy [l_brace_idx + 2 : r_brace_idx ]
373- box_no_breaks = _remove_extra_whitespace_from_line (box )
374- boxes .append ((box_no_breaks , prop_dict ))
375-
376- slide_copy = slide_copy [r_brace_idx + 2 :]
377- return boxes
378-
379-
380338def _top_spec_for_text_at_bottom (text_block , width_per , per_from_bottom = 0 ,
381339 min_top = 30 ):
382340 # TODO: customize this function for different fonts/sizes
@@ -1058,7 +1016,7 @@ def _markdown_to_presentation(self, markdown_string, style, imgStretch):
10581016 box = 'Text' , text_or_url = title ,
10591017 left = specs_for_title [0 ], top = specs_for_title [1 ],
10601018 height = specs_for_title [2 ], width = specs_for_title [3 ],
1061- slide = slide_num , style_attr = title_style_attr ,
1019+ slide = slide_num , # style_attr=title_style_attr,
10621020 paragraphStyle = 'Heading {}' .format (
10631021 min (num_hashes , 3 )
10641022 )
0 commit comments