Preserve markdown during build, and use lists instead of strings

This commit is contained in:
Veronica K. B. Olsen
2020-05-12 18:41:08 +02:00
parent 2a67b69d32
commit aa4778d4cd
3 changed files with 69 additions and 19 deletions
+15 -2
View File
@@ -29,6 +29,7 @@ import logging
import nw
from os import path
from time import time
from PyQt5.QtCore import Qt, QByteArray
from PyQt5.QtPrintSupport import QPrinter, QPrintPreviewDialog
@@ -69,6 +70,7 @@ class GuiBuildNovel(QDialog):
self.optState = self.theProject.optState
self.htmlText = ""
self.nwdText = ""
self.setWindowTitle("Build Novel Project")
self.setMinimumWidth(800)
@@ -311,9 +313,13 @@ class GuiBuildNovel(QDialog):
makeHtml.setKeywords(incKeywords)
makeHtml.setJustify(justifyText)
self.htmlText = ""
self.buildProgress.setMaximum(len(self.theProject.projTree))
self.buildProgress.setValue(0)
tStart = time()
tmpHtml = []
tmpNwd = []
for nItt, tItem in enumerate(self.theProject.projTree):
if self._checkInclude(tItem, noteFiles, novelFiles, ignoreFlag):
makeHtml.setText(tItem.itemHandle)
@@ -322,9 +328,16 @@ class GuiBuildNovel(QDialog):
makeHtml.doHeaders()
makeHtml.doConvert()
makeHtml.doPostProcessing()
self.htmlText += makeHtml.getResult()
tmpHtml.append(makeHtml.getResult())
tmpNwd.append(makeHtml.getFilteredMarkdown())
self.buildProgress.setValue(nItt+1)
self.htmlText = "".join(tmpHtml)
self.nwdText = "".join(tmpNwd)
tEnd = time()
logger.debug("Built project in %.3f ms" % (1000*(tEnd-tStart)))
self.docView.setHtml(self.htmlText)
return