Add build details widget to manuscript tool
This commit is contained in:
@@ -36,6 +36,7 @@ from functools import partial
|
||||
|
||||
from PyQt5.QtCore import QCoreApplication, QRegularExpression
|
||||
|
||||
from novelwriter import SHARED
|
||||
from novelwriter.enum import nwItemLayout
|
||||
from novelwriter.common import formatTimeStamp, numberToRoman, checkInt
|
||||
from novelwriter.constants import nwConst, nwHeadFmt, nwRegEx, nwUnicode
|
||||
@@ -147,7 +148,7 @@ class Tokenizer(ABC):
|
||||
self._linkHeaders = False # Add an anchor before headers
|
||||
|
||||
# Instance Variables
|
||||
self._hFormatter = HeadingFormatter(self._project)
|
||||
self._hFormatter = HeadingFormatter()
|
||||
self._firstScene = False # Flag to indicate that the first scene of the chapter
|
||||
|
||||
# This File
|
||||
@@ -771,8 +772,7 @@ class Tokenizer(ABC):
|
||||
|
||||
class HeadingFormatter:
|
||||
|
||||
def __init__(self, project: NWProject) -> None:
|
||||
self._project = project
|
||||
def __init__(self) -> None:
|
||||
self._chCount = 0
|
||||
self._scChCount = 0
|
||||
self._scAbsCount = 0
|
||||
@@ -801,7 +801,7 @@ class HeadingFormatter:
|
||||
hFormat = hFormat.replace(nwHeadFmt.SC_NUM, str(self._scChCount))
|
||||
hFormat = hFormat.replace(nwHeadFmt.SC_ABS, str(self._scAbsCount))
|
||||
if nwHeadFmt.CH_WORD in hFormat:
|
||||
chWord = self._project.localLookup(self._chCount)
|
||||
chWord = SHARED.project.localLookup(self._chCount)
|
||||
hFormat = hFormat.replace(nwHeadFmt.CH_WORD, chWord)
|
||||
if nwHeadFmt.CH_ROML in hFormat:
|
||||
chRom = numberToRoman(self._chCount, toLower=True)
|
||||
|
||||
Reference in New Issue
Block a user