Exemple #1
0
    def preview(self, settingsWidget, previewWidget):
        settings = settingsWidget.getSettings()

        # Save settings
        settingsWidget.writeSettings()

        md = markdown.output(self, settingsWidget)
        html = MD.markdown(md)
        path = os.path.join(self.projectPath(), "dummy.html")

        self.preparesTextEditView(previewWidget.widget(0),
                                  settings["Preview"]["PreviewFont"])
        self.preparesTextEditViewMarkdown(previewWidget.widget(0), settings)
        previewWidget.widget(0).setPlainText(md)
        self.preparesTextEditView(previewWidget.widget(1),
                                  settings["Preview"]["PreviewFont"])
        previewWidget.widget(1).setPlainText(html)
        previewWidget.widget(2).setHtml(html, QUrl.fromLocalFile(path))
Exemple #2
0
    def preview(self, settingsWidget, previewWidget):
        settings = settingsWidget.getSettings()

        # Save settings
        settingsWidget.writeSettings()

        md = markdown.output(self, settingsWidget)
        html = MD.markdown(md)
        path = os.path.join(self.projectPath(), "dummy.html")

        self.preparesTextEditView(previewWidget.widget(0), settings["Preview"]["PreviewFont"])
        self.preparesTextEditViewMarkdown(previewWidget.widget(0), settings)
        previewWidget.widget(0).setPlainText(md)
        self.preparesTextEditView(previewWidget.widget(1), settings["Preview"]["PreviewFont"])
        previewWidget.widget(1).setPlainText(html)
        w2 = previewWidget.widget(2)
        if isinstance(w2, QTextEdit):
            w2.setHtml(html)
        else:
            w2.setHtml(html, QUrl.fromLocalFile(path))
Exemple #3
0
 def src(self, settingsWidget):
     return markdown.output(self, settingsWidget)
 def src(self, settingsWidget):
     return markdown.output(self, settingsWidget)
Exemple #5
0
 def output(self, settingsWidget):
     html = MD.markdown(markdown.output(self, settingsWidget))
     return html
Exemple #6
0
 def output(self, settingsWidget):
     html = MD.markdown(markdown.output(self, settingsWidget))
     return html