_UpdatableMenu
-
+
From Template
diff --git a/novelwriter/core/buildsettings.py b/novelwriter/core/buildsettings.py
index 0d2d3b44d..ace47d640 100644
--- a/novelwriter/core/buildsettings.py
+++ b/novelwriter/core/buildsettings.py
@@ -159,6 +159,13 @@
"format.indentFirstPar": QT_TRANSLATE_NOOP("Builds", "Indent First Paragraph"),
"format.grpMargins": QT_TRANSLATE_NOOP("Builds", "Text Margins"),
+ "format.titleMargin": QT_TRANSLATE_NOOP("Builds", "Title and Partition"),
+ "format.h1Margin": QT_TRANSLATE_NOOP("Builds", "Heading 1 and Chapter"),
+ "format.h2Margin": QT_TRANSLATE_NOOP("Builds", "Heading 2 and Scene"),
+ "format.h3Margin": QT_TRANSLATE_NOOP("Builds", "Heading 3 and Section"),
+ "format.h4Margin": QT_TRANSLATE_NOOP("Builds", "Heading 4"),
+ "format.textMargin": QT_TRANSLATE_NOOP("Builds", "Text Paragraph"),
+ "format.sepMargin": QT_TRANSLATE_NOOP("Builds", "Scene Separator"),
"format.grpPage": QT_TRANSLATE_NOOP("Builds", "Page Layout"),
"format.pageUnit": QT_TRANSLATE_NOOP("Builds", "Unit"),
diff --git a/novelwriter/formats/shared.py b/novelwriter/formats/shared.py
index b1c0f2885..0eba66982 100644
--- a/novelwriter/formats/shared.py
+++ b/novelwriter/formats/shared.py
@@ -104,17 +104,18 @@ class BlockTyp(IntEnum):
EMPTY = 1 # Empty line (new paragraph)
TITLE = 2 # Title
- HEAD1 = 3 # Heading 1
- HEAD2 = 4 # Heading 2
- HEAD3 = 5 # Heading 3
- HEAD4 = 6 # Heading 4
- TEXT = 7 # Text line
- SEP = 8 # Scene separator
- SKIP = 9 # Paragraph break
- SUMMARY = 10 # Synopsis/short comment
- NOTE = 11 # Note
- COMMENT = 12 # Comment
- KEYWORD = 13 # Tag/reference keywords
+ PART = 3 # Partition
+ HEAD1 = 4 # Heading 1 or Chapter
+ HEAD2 = 5 # Heading 2 or Scene
+ HEAD3 = 6 # Heading 3 or Section
+ HEAD4 = 7 # Heading 4
+ TEXT = 8 # Text line
+ SEP = 9 # Scene separator
+ SKIP = 10 # Paragraph break
+ SUMMARY = 11 # Synopsis/short comment
+ NOTE = 12 # Note
+ COMMENT = 13 # Comment
+ KEYWORD = 14 # Tag/reference keywords
class BlockFmt(Flag):
diff --git a/novelwriter/formats/todocx.py b/novelwriter/formats/todocx.py
index 694ffac00..bbca924d0 100644
--- a/novelwriter/formats/todocx.py
+++ b/novelwriter/formats/todocx.py
@@ -271,7 +271,7 @@ def doConvert(self) -> None:
if tType == BlockTyp.TEXT:
self._processFragments(par, S_NORM, tText, tFormat)
- elif tType == BlockTyp.TITLE:
+ elif tType in (BlockTyp.TITLE, BlockTyp.PART):
self._processFragments(par, S_TITLE, tText, tFormat)
elif tType == BlockTyp.HEAD1:
diff --git a/novelwriter/formats/tohtml.py b/novelwriter/formats/tohtml.py
index 51e746d08..fb2c1ee51 100644
--- a/novelwriter/formats/tohtml.py
+++ b/novelwriter/formats/tohtml.py
@@ -30,7 +30,7 @@
from time import time
from novelwriter.common import formatTimeStamp
-from novelwriter.constants import nwHtmlUnicode
+from novelwriter.constants import nwHtmlUnicode, nwStyles
from novelwriter.core.project import NWProject
from novelwriter.formats.shared import BlockFmt, BlockTyp, T_Formats, TextFmt, stripEscape
from novelwriter.formats.tokenizer import Tokenizer
@@ -130,20 +130,6 @@ def doPreProcessing(self) -> None:
def doConvert(self) -> None:
"""Convert the list of text tokens into an HTML document."""
- if self._isNovel:
- # For story files, we bump the titles one level up
- h1Cl = " class='title'"
- h1 = "h1"
- h2 = "h1"
- h3 = "h2"
- h4 = "h3"
- else:
- h1Cl = ""
- h1 = "h1"
- h2 = "h2"
- h3 = "h3"
- h4 = "h4"
-
lines = []
for tType, tMeta, tText, tFmt, tStyle in self._blocks:
@@ -213,25 +199,25 @@ def doConvert(self) -> None:
if tType == BlockTyp.TEXT:
lines.append(f"{self._formatText(tText, tFmt)}
\n")
- elif tType == BlockTyp.TITLE:
+ elif tType in (BlockTyp.TITLE, BlockTyp.PART):
tHead = tText.replace("\n", "
")
lines.append(f"{aNm}{tHead}
\n")
elif tType == BlockTyp.HEAD1:
tHead = tText.replace("\n", "
")
- lines.append(f"<{h1}{h1Cl}{hStyle}>{aNm}{tHead}{h1}>\n")
+ lines.append(f"{aNm}{tHead}
\n")
elif tType == BlockTyp.HEAD2:
tHead = tText.replace("\n", "
")
- lines.append(f"<{h2}{hStyle}>{aNm}{tHead}{h2}>\n")
+ lines.append(f"{aNm}{tHead}
\n")
elif tType == BlockTyp.HEAD3:
tHead = tText.replace("\n", "
")
- lines.append(f"<{h3}{hStyle}>{aNm}{tHead}{h3}>\n")
+ lines.append(f"{aNm}{tHead}
\n")
elif tType == BlockTyp.HEAD4:
tHead = tText.replace("\n", "
")
- lines.append(f"<{h4}{hStyle}>{aNm}{tHead}{h4}>\n")
+ lines.append(f"{aNm}{tHead}
\n")
elif tType == BlockTyp.SEP:
lines.append(f"{tText}
\n")
@@ -310,9 +296,7 @@ def saveDocument(self, path: Path) -> None:
"\n"
"\n"
"\n"
- "\n"
"{body:s}\n"
- "\n"
"\n"
"