@@ -102,12 +102,12 @@ def __init__(self, master, **kwargs):
102
102
self .text_area = self .editor_frame .tbox
103
103
self .preview_tabs = Notebook (self .editor_pw )
104
104
#make the previews
105
- self .preview_area = HtmlFrame (self .preview_tabs )
105
+ self .preview_document = HtmlFrame (self .preview_tabs )
106
106
107
- self .preview_html_frame = ScrolledTextBox (self .preview_tabs )
108
- self .preview_html = self .preview_html_frame .tbox
109
- self .preview_tabs .add (self .preview_area , text = "Preview Format " )
110
- self .preview_tabs .add (self .preview_html_frame , text = "Preview HTML code " )
107
+ self .export_options_frame = ScrolledTextBox (self .preview_tabs )
108
+ self .export_options = self .export_options_frame .tbox
109
+ self .preview_tabs .add (self .preview_document , text = "Preview Document " )
110
+ self .preview_tabs .add (self .export_options_frame , text = "Export Options " )
111
111
#add the areas to the paned window
112
112
self .editor_pw .add (self .editor_frame )
113
113
self .editor_pw .add (self .preview_tabs )
@@ -163,7 +163,7 @@ def __init__(self, master, **kwargs):
163
163
164
164
# # This links the scrollbars but is currently causing issues.
165
165
# Changing the settings to make the scrolling work
166
- # self.preview_area .html['yscrollcommand'] = self.on_mousewheel
166
+ # self.preview_document .html['yscrollcommand'] = self.on_mousewheel
167
167
168
168
def popup (self , event ):
169
169
"""Right-click popup at mouse location within the text area only.
@@ -187,7 +187,7 @@ def popup(self, event):
187
187
# """
188
188
# self.text_area.yview(*args)
189
189
# # # This links the scrollbars but is currently causing issues.
190
- # # self.preview_area .html.yview(*args)
190
+ # # self.preview_document .html.yview(*args)
191
191
192
192
# def on_mousewheel(self, *args):
193
193
# """Moves the scrollbar and scrolls the text area on mousewheel event.
@@ -198,7 +198,7 @@ def popup(self, event):
198
198
# """
199
199
# self.scrollbar.set(*args)
200
200
# # # This links the scrollbars but is currently causing issues.
201
- # # self.preview_area .vsb.set(*args)
201
+ # # self.preview_document .vsb.set(*args)
202
202
# self.on_scrollbar('moveto', args[0])
203
203
204
204
def select_all (self , * args ):
@@ -305,7 +305,7 @@ def save_as_html_file(self):
305
305
- If a filename is provided then `try` to open it in "write" mode.
306
306
- If any of the above fails then display an error message.
307
307
"""
308
- html_file_data = self .preview_html .get ("1.0" , END )
308
+ html_file_data = self .export_options .get ("1.0" , END )
309
309
self .html_save_filename = filedialog .asksaveasfilename (filetypes = (("HTML file" , ("*.html" , "*.htm" )),) , title = "Save HTML File" )
310
310
if self .html_save_filename :
311
311
try :
@@ -329,10 +329,10 @@ def on_input_change(self, event):
329
329
md2html = Markdown (extensions = constants .extensions , extension_configs = constants .extension_configs )
330
330
markdownText = self .text_area .get ("1.0" , END )
331
331
html = md2html .convert (markdownText )
332
- self .preview_html .delete ("1.0" , END )
333
- self .preview_html .insert (END , html )
334
- self .preview_area .load_html (html )
335
- self .preview_area .add_css (self .css )
332
+ self .export_options .delete ("1.0" , END )
333
+ self .export_options .insert (END , html )
334
+ self .preview_document .load_html (html )
335
+ self .preview_document .add_css (self .css )
336
336
self .check_markdown_highlighting (start = "1.0" , end = END )
337
337
self .text_area .edit_modified (0 ) # resets the text widget to generate another event when another change occours
338
338
@@ -359,25 +359,25 @@ def load_style(self, stylename):
359
359
kwargs ['font' ] = font
360
360
kwargs ['underline' ] = opts ['underline' ]
361
361
self .text_area .tag_configure (str (token ), ** kwargs )
362
- self .preview_html .tag_configure (str (token ), ** kwargs )
362
+ self .export_options .tag_configure (str (token ), ** kwargs )
363
363
self .syntax_highlighting_tags .append (str (token ))
364
364
# print(self.style.background_color or 'white', self.text_area.tag_cget("Token.Text", "foreground") or 'black', stylename)
365
365
self .text_area .configure (bg = self .style .background_color or 'white' ,
366
366
fg = self .text_area .tag_cget ("Token.Text" , "foreground" ) or 'black' ,
367
367
selectbackground = self .style .highlight_color ,
368
368
)
369
369
self .text_area .tag_configure (str (Generic .StrongEmph ), font = ('Monospace' , 10 , 'bold' , 'italic' ))
370
- self .preview_html .configure (bg = self .style .background_color or 'white' ,
371
- fg = self .preview_html .tag_cget ("Token.Text" , "foreground" ) or 'black' ,
370
+ self .export_options .configure (bg = self .style .background_color or 'white' ,
371
+ fg = self .export_options .tag_cget ("Token.Text" , "foreground" ) or 'black' ,
372
372
selectbackground = self .style .highlight_color ,
373
373
)
374
- self .preview_html .tag_configure (str (Generic .StrongEmph ), font = ('Monospace' , 10 , 'bold' , 'italic' ))
374
+ self .export_options .tag_configure (str (Generic .StrongEmph ), font = ('Monospace' , 10 , 'bold' , 'italic' ))
375
375
self .syntax_highlighting_tags .append (str (Generic .StrongEmph ))
376
376
self .css = 'body {background-color: %s; color: %s}' % (
377
377
self .style .background_color or 'white' ,
378
378
self .text_area .tag_cget ("Token.Text" , "foreground" ) or 'black' ,
379
379
)# used string%interpolation here because f'string' interpolation is too annoying with embeded { and }
380
- self .preview_area .add_css (self .css )
380
+ self .preview_document .add_css (self .css )
381
381
return self .syntax_highlighting_tags
382
382
383
383
def check_markdown_highlighting (self , start = 'insert linestart' , end = 'insert lineend' ):
0 commit comments