Use a set to track comment styles to include in build

This commit is contained in:
Veronica Berglyd Olsen
2025-04-17 16:27:06 +02:00
parent 21431058be
commit 312ad2a21b
9 changed files with 66 additions and 58 deletions
+4 -3
View File
@@ -32,7 +32,7 @@ from PyQt6.QtGui import QFont
from novelwriter import CONFIG
from novelwriter.constants import nwLabels
from novelwriter.core.item import NWItem
from novelwriter.enum import nwBuildFmt
from novelwriter.enum import nwBuildFmt, nwComment
from novelwriter.error import formatException, logException
from novelwriter.formats.todocx import ToDocX
from novelwriter.formats.tohtml import ToHtml
@@ -311,10 +311,11 @@ class NWBuildDocument:
)
bldObj.setBodyText(self._build.getBool("text.includeBodyText"))
bldObj.setSynopsis(self._build.getBool("text.includeSynopsis"))
bldObj.setComments(self._build.getBool("text.includeComments"))
bldObj.setKeywords(self._build.getBool("text.includeKeywords"))
bldObj.setIgnoredKeywords(self._build.getStr("text.ignoredKeywords"))
bldObj.setCommentType(nwComment.PLAIN, self._build.getBool("text.includeComments"))
bldObj.setCommentType(nwComment.SYNOPSIS, self._build.getBool("text.includeSynopsis"))
bldObj.setCommentType(nwComment.SHORT, self._build.getBool("text.includeSynopsis"))
if isinstance(bldObj, ToHtml):
bldObj.setStyles(self._build.getBool("html.addStyles"))