title: Render Markdown with PyQt5
body: <p>How can I render a markdown file in my PyQt5 application?</p>
  <p><a href="https://stackoverflow.com/questions/59485010/markdown-supported-in-pyqt5-14">Here</a> I read that I should use a QWebEngineView instead of a QTextEdit because the QTextEdit can't render external images.</p>
  <p>In a comment someone references <a href="https://doc.qt.io/qt-5/qtwebengine-webenginewidgets-markdowneditor-example.html" rel="nofollow noreferrer">this</a> example. It is however a complete markdown texteditor and additionally written in c++. I tried to translate the needed parts into Python but I don't quite get how what works. I just need a minimal example.</p>
  <p>What I have right now is the following:</p>
  <pre><code>from PyQt5.QtWebChannel import QWebChannel
  from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEnginePage
  from PyQt5.QtWidgets import QApplication
  from PyQt5.QtCore import QUrl
  import sys
  
  app = QApplication(sys.argv)
  
  web_widget = QWebEngineView()  
  webChannel = QWebChannel()    # ?
  page = QWebEnginePage()       # ?
  web_widget.setPage(page)      # ? 
  my_url = QUrl(&quot;/index.html&quot;)
  web_widget.load(my_url)
  
  # now somehow replace the placeholder in the loaded html page with file contents?
  
  file_url = QUrl(&quot;file.md&quot;)
  
  # help 
  
  
  web_widget.show()
  app.exec_()
  </code></pre>