Closed cjwelborn closed 8 years ago
On second thought, this isn't exactly efficient. Using full=True
for the HtmlFormatter
means that the css classes are generated for each file. It also means that there will be multiple html
, head
, and body
tags. The correct way is to do each file with full=False
, grab the style definitions with formatter.get_style_defs()
, and then build your own html page by wrapping all file content in <body>
, wrapping style definitions in <head>
and <style>
, and then wrapping all of that in <html>
. That would require more work though. A lot of things would need to be moved around. Anyway, sorry to waste your time.
Each file is highlighted separately and the final content is set to the QDocument. This takes care of Issue #13.
Instead of a filename,
-
may be used to pipe stdin to Code2Pdf. Stdin can only be read once, but it can be mixed in with other files.Putting the
QApplication
inside of a class method was causing segfaults (reference was lost before Qt could cleanup). Moving theQApplication
to the global scope fixed it. TheCode2pdf
class is now a subclass ofQApplication
.