This is even better

This commit is contained in:
Veronica K. B. Olsen
2020-05-28 00:29:45 +02:00
parent 5be945b901
commit f9e2d57fa7
5 changed files with 15 additions and 15 deletions
+3 -3
View File
@@ -12,11 +12,11 @@
<p><mark>%ch%</mark> &ndash; This is replaced with the chapter number of your chapter type
headings. These are generated automaticall starting from 1, but ignoring chapter headings in
files with "Unnumbered" layout.</p>
<p><mark>%chword%</mark> &ndash; This is replaced with the chapter number, but instead of an
<p><mark>%chw%</mark> &ndash; This is replaced with the chapter number, but instead of an
arabic number, the word for it is used, e.g. One, Two, Fifteen, Twenty-Five, etc.</p>
<p><mark>%sc1%</mark> &ndash; This is replaced with the scene number. The number is reset to one
<p><mark>%sc%</mark> &ndash; This is replaced with the scene number. The number is reset to one
for each new chapter, so it is the scene number within the current chapter.</p>
<p><mark>%sc2%</mark> &ndash; This is replaced with the absolute scene number. That is, the
<p><mark>%sca%</mark> &ndash; This is replaced with the absolute scene number. That is, the
number is counted from the first scene in the novel, and not reset for each chapter.</p>
<p><mark>\\</mark> &ndash; Two backslashes are replaced by a line break.</p>
<p><b>Note:</b> The Scene and Section formats are treated slightly differently than the other title
+5 -5
View File
@@ -565,11 +565,11 @@ class Tokenizer():
def _formatHeading(self, theTitle, theText):
"""Replaces the %keyword% strings.
"""
theTitle = theTitle.replace(r"%title%", theText)
theTitle = theTitle.replace(r"%ch%", str(self.numChapter))
theTitle = theTitle.replace(r"%sc1%", str(self.numChScene))
theTitle = theTitle.replace(r"%sc2%", str(self.numAbsScene))
theTitle = theTitle.replace(r"%chword%", numberToWord(self.numChapter,"en"))
theTitle = theTitle.replace(r"%title%", theText)
theTitle = theTitle.replace(r"%ch%", str(self.numChapter))
theTitle = theTitle.replace(r"%sc%", str(self.numChScene))
theTitle = theTitle.replace(r"%sca%", str(self.numAbsScene))
theTitle = theTitle.replace(r"%chw%", numberToWord(self.numChapter,"en"))
return theTitle
# END Class Tokenizer
+3 -3
View File
@@ -691,9 +691,9 @@ class GuiBuildNovel(QDialog):
"""Translates old formatting codes to new ones.
"""
theFormat = theFormat.replace(r"%chnum%", r"%ch%")
theFormat = theFormat.replace(r"%scnum%", r"%sc1%")
theFormat = theFormat.replace(r"%scabsnum%", r"%sc2%")
theFormat = theFormat.replace(r"%chnumword%", r"%chword%")
theFormat = theFormat.replace(r"%scnum%", r"%sc%")
theFormat = theFormat.replace(r"%scabsnum%", r"%sca%")
theFormat = theFormat.replace(r"%chnumword%", r"%chw%")
return theFormat
# END Class GuiBuildNovel