17
17
WIDTH = 1000.0
18
18
19
19
CODEPANE_THEMES = ['tomorrow' , 'tomorrowNight' ]
20
- VALID_STYLE_KEYS = ['fontFamily' , 'fontSize' , 'margin' , 'position' ,
21
- 'textAlign' , 'opacity' , 'color' , 'fontStyle' ,
22
- 'fontWeight' , 'lineHeight' , 'minWidth' , 'textDecoration' ,
23
- 'wordBreak' ]
24
- VALID_PROPS_KEYS = ['theme' , 'listType' , 'href' ]
25
- NEEDED_STYLE_KEYS = ['left' , 'top' , 'height' , 'width' ]
20
+
26
21
VALID_LANGUAGES = ['cpp' , 'cs' , 'css' , 'fsharp' , 'go' , 'haskell' , 'java' ,
27
22
'javascript' , 'jsx' , 'julia' , 'xml' , 'matlab' , 'php' ,
28
23
'python' , 'r' , 'ruby' , 'scala' , 'sql' , 'yaml' ]
29
- VALID_CLASS_STYLES = ['pictureleft' , 'pictureright' , 'picturemiddle' ,
30
- 'pictureleft_tiled' , 'pictureright_tiled' ]
31
-
32
- VALID_SLIDE_PROPS = ['class' , 'transition' , 'background-image' ,
33
- 'background-position' , 'background-repeat' ,
34
- 'background-size' , 'background_color' ]
35
24
36
25
VALID_TRANSITIONS = ['slide' , 'zoom' , 'fade' , 'spin' ]
37
26
@@ -176,40 +165,21 @@ def _box(boxtype, text_or_url, left, top, height, width, id, props_attr,
176
165
if boxtype == 'Text' :
177
166
children_list = text_or_url .split ('\n ' )
178
167
179
- #props = {
180
- # 'isQuote': False,
181
- # 'listType': None,
182
- # 'paragraphStyle': paragraphStyle,
183
- # 'size': 4,
184
- # 'style': copy.deepcopy(paragraph_styles[paragraphStyle])
185
- # #'style': paragraph_styles[paragraphStyle]
186
- #}
187
-
188
- #props['style'].update(
189
- # {'height': height,
190
- # 'left': left,
191
- # 'top': top,
192
- # 'width': width}
193
- #)
194
-
195
- props = {'isQuote' : False ,
196
- 'listType' : None ,
197
- 'paragraphStyle' : 'Heading 1' ,
198
- 'size' : 4 ,
199
- 'style' : {'color' : '#3d3d3d' ,
200
- 'fontFamily' : 'Open Sans' ,
201
- 'fontSize' : 26 ,
202
- 'fontStyle' : 'normal' ,
203
- 'fontWeight' : 400 ,
204
- 'height' : height ,
205
- 'left' : left ,
206
- 'lineHeight' : 'normal' ,
207
- 'minWidth' : 20 ,
208
- 'opacity' : 1 ,
209
- 'textAlign' : 'center' ,
210
- 'textDecoration' : 'none' ,
211
- 'top' : top ,
212
- 'width' : width }}
168
+ props = {
169
+ 'isQuote' : False ,
170
+ 'listType' : None ,
171
+ 'paragraphStyle' : paragraphStyle ,
172
+ 'size' : 4 ,
173
+ 'style' : copy .deepcopy (paragraph_styles [paragraphStyle ])
174
+ }
175
+
176
+ props ['style' ].update (
177
+ {'height' : height ,
178
+ 'left' : left ,
179
+ 'top' : top ,
180
+ 'width' : width ,
181
+ 'position' : 'absolute' }
182
+ )
213
183
214
184
elif boxtype == 'Image' :
215
185
props = {
@@ -268,10 +238,10 @@ def _box(boxtype, text_or_url, left, top, height, width, id, props_attr,
268
238
'type' : boxtype
269
239
}
270
240
271
- # if boxtype == 'Text':
272
- # child['defaultHeight'] = 36
273
- # child['defaultWidth'] = 52
274
- # child['resizeVertical'] = False
241
+ if boxtype == 'Text' :
242
+ child ['defaultHeight' ] = 36
243
+ child ['defaultWidth' ] = 52
244
+ child ['resizeVertical' ] = False
275
245
if boxtype == 'CodePane' :
276
246
child ['defaultText' ] = 'Code'
277
247
@@ -613,7 +583,30 @@ def _return_layout_specs(num_of_boxes, url_lines, title_lines, text_block,
613
583
margin = 18
614
584
code_theme = 'tomorrowNight'
615
585
616
- # fill back
586
+ # set Headings styles
587
+ paragraph_styles ['Heading 1' ].update (
588
+ {'color' : '#000016' ,
589
+ 'fontFamily' : 'Roboto' ,
590
+ 'fontSize' : 55 ,
591
+ 'fontWeight' : fontWeight_dict ['Black' ]['fontWeight' ]}
592
+ )
593
+
594
+ paragraph_styles ['Heading 2' ] = copy .deepcopy (
595
+ paragraph_styles ['Heading 1' ]
596
+ )
597
+ paragraph_styles ['Heading 2' ].update ({'fontSize' : 36 })
598
+ paragraph_styles ['Heading 3' ] = copy .deepcopy (
599
+ paragraph_styles ['Heading 1' ]
600
+ )
601
+ paragraph_styles ['Heading 3' ].update ({'fontSize' : 30 })
602
+
603
+ # set Body style
604
+ paragraph_styles ['Body' ].update (
605
+ {'color' : '#000016' ,
606
+ 'fontFamily' : 'Roboto' ,
607
+ 'fontSize' : 16 ,
608
+ 'fontWeight' : fontWeight_dict ['Thin' ]['fontWeight' ]}
609
+ )
617
610
618
611
bkgd_color = '#FFFFFF'
619
612
title_font_color = None
@@ -996,8 +989,6 @@ def _markdown_to_presentation(self, markdown_string, style, imgStretch):
996
989
code_theme ) = _return_layout_specs (num_of_boxes , url_lines ,
997
990
title_lines , text_block , code_blocks , slide_num , style )
998
991
999
- print specs_for_title
1000
-
1001
992
# background color
1002
993
self ._color_background (bkgd_color , slide_num )
1003
994
@@ -1011,13 +1002,12 @@ def _markdown_to_presentation(self, markdown_string, style, imgStretch):
1011
1002
num_hashes += 1
1012
1003
title = _remove_extra_whitespace_from_line (title )
1013
1004
1014
- print specs_for_title
1015
1005
self ._insert (
1016
1006
box = 'Text' , text_or_url = title ,
1017
1007
left = specs_for_title [0 ], top = specs_for_title [1 ],
1018
1008
height = specs_for_title [2 ], width = specs_for_title [3 ],
1019
- slide = slide_num , # style_attr=title_style_attr,
1020
- paragraphStyle = 'Heading {} ' .format (
1009
+ slide = slide_num , style_attr = title_style_attr ,
1010
+ paragraphStyle = 'Heading 1 ' .format (
1021
1011
min (num_hashes , 3 )
1022
1012
)
1023
1013
)
0 commit comments