9481:0b936ff1bbb9 | 9482:a2bc06a54d9d |
---|---|
20 from PyQt6.QtWidgets import QInputDialog | 20 from PyQt6.QtWidgets import QInputDialog |
21 | 21 |
22 from eric7 import Preferences, Utilities | 22 from eric7 import Preferences, Utilities |
23 from eric7.EricGui.EricOverrideCursor import EricOverrideCursor | 23 from eric7.EricGui.EricOverrideCursor import EricOverrideCursor |
24 from eric7.EricWidgets import EricMessageBox | 24 from eric7.EricWidgets import EricMessageBox |
25 from eric7.UI.Previewers import MarkdownExtensions, PreviewerHTMLStyles | |
25 | 26 |
26 from .ExporterBase import ExporterBase | 27 from .ExporterBase import ExporterBase |
27 | 28 |
28 | 29 |
29 class HTMLGenerator: | 30 class HTMLGenerator: |
510 ] | 511 ] |
511 for key in unloadKeys: | 512 for key in unloadKeys: |
512 sys.modules.pop(key) | 513 sys.modules.pop(key) |
513 | 514 |
514 try: | 515 try: |
515 import docutils.core # __IGNORE_EXCEPTION__ | 516 import docutils.core # __IGNORE_EXCEPTION__ __IGNORE_WARNING_I10__ |
516 except ImportError: | 517 except ImportError: |
517 EricMessageBox.critical( | 518 EricMessageBox.critical( |
518 self.editor, | 519 self.editor, |
519 self.tr("Export source"), | 520 self.tr("Export source"), |
520 self.tr( | 521 self.tr( |
546 @type bool | 547 @type bool |
547 @return processed HTML | 548 @return processed HTML |
548 @rtype str | 549 @rtype str |
549 """ | 550 """ |
550 try: | 551 try: |
551 import markdown # __IGNORE_EXCEPTION__ | 552 import markdown # __IGNORE_EXCEPTION__ __IGNORE_WARNING_I10__ |
552 except ImportError: | 553 except ImportError: |
553 EricMessageBox.critical( | 554 EricMessageBox.critical( |
554 self.editor, | 555 self.editor, |
555 self.tr("Export source"), | 556 self.tr("Export source"), |
556 self.tr( | 557 self.tr( |
560 """<a href="http://pythonhosted.org/Markdown/install""" | 561 """<a href="http://pythonhosted.org/Markdown/install""" |
561 """.html"> installation instructions.</a></p>""" | 562 """.html"> installation instructions.</a></p>""" |
562 ), | 563 ), |
563 ) | 564 ) |
564 return "" | 565 return "" |
565 | |
566 from eric7.UI.Previewers import MarkdownExtensions, PreviewerHTMLStyles | |
567 | 566 |
568 extensions = [] | 567 extensions = [] |
569 | 568 |
570 text = self.editor.text() | 569 text = self.editor.text() |
571 | 570 |