nbconvert can convert to the following formats:
- HTML
- LaTeX
- webPDF (equivalent to rendering as HTML and printing to PDF)
- Reveal.js HTML slideshow
- ascii
import logging | |
from sys import stderr, stdout | |
# Handle log messages from only these loggers. | |
# We will always log messages from "root" logger | |
# by appending names to this list, we can add additional loggers | |
# that should be handled | |
terminal_logger_names = [] | |
# Format for terminal output: only show the log message |
from PyQt5 import QtCore, QtWidgets, QtWebEngineWidgets | |
from queue import Queue | |
class Renderer(QtWebEngineWidgets.QWebEnginePage): | |
def __init__(self,profile=None,parent=None): | |
super().__init__(profile,parent) | |
self._result_queue=Queue(maxsize=1) | |
self.loadFinished.connect(lambda: self.toHtml(self._result_queue.put)) | |
def render(self,url): |