diff --git a/docs/source/usage_shortcuts.rst b/docs/source/usage_shortcuts.rst index 6e25ca36..4ddbde83 100644 --- a/docs/source/usage_shortcuts.rst +++ b/docs/source/usage_shortcuts.rst @@ -163,12 +163,12 @@ a key or key combination for the inserted content. ":kbd:`Ctrl+K`, :kbd:`E`", "Insert an ``@entity`` keyword" ":kbd:`Ctrl+K`, :kbd:`F`", "Insert a ``@focus`` keyword" ":kbd:`Ctrl+K`, :kbd:`G`", "Insert a ``@tag`` keyword" + ":kbd:`Ctrl+K`, :kbd:`H`", "Insert a short description comment" ":kbd:`Ctrl+K`, :kbd:`L`", "Insert a ``@location`` keyword" ":kbd:`Ctrl+K`, :kbd:`O`", "Insert an ``@object`` keyword" ":kbd:`Ctrl+K`, :kbd:`P`", "Insert a ``@plot`` keyword" ":kbd:`Ctrl+K`, :kbd:`S`", "Insert a synopsis comment" ":kbd:`Ctrl+K`, :kbd:`T`", "Insert a ``@time`` keyword" - ":kbd:`Ctrl+K`, :kbd:`U`", "Insert a summary comment" ":kbd:`Ctrl+K`, :kbd:`V`", "Insert a ``@pov`` keyword" ":kbd:`Ctrl+K`, :kbd:`X`", "Insert a ``@custom`` keyword" ":kbd:`Ctrl+K`, :kbd:`Ctrl+Space`", "Insert a thin non-breaking space" diff --git a/novelwriter/assets/i18n/project_en_GB.json b/novelwriter/assets/i18n/project_en_GB.json index d1e27ea9..f8e30410 100644 --- a/novelwriter/assets/i18n/project_en_GB.json +++ b/novelwriter/assets/i18n/project_en_GB.json @@ -1,6 +1,6 @@ { "Synopsis": "Synopsis", - "Summary": "Summary", + "Short Description": "Short Description", "Comment": "Comment", "Notes": "Notes", "Tag": "Tag", diff --git a/novelwriter/core/coretools.py b/novelwriter/core/coretools.py index d870bb0b..bacf9e7c 100644 --- a/novelwriter/core/coretools.py +++ b/novelwriter/core/coretools.py @@ -406,7 +406,7 @@ class ProjectBuilder: chSynop = self.tr("Summary of the chapter.") scSynop = self.tr("Summary of the scene.") - bfNote = self.tr("A brief description.") + bfNote = self.tr("A short description.") # Create chapters if numChapters > 0: @@ -450,7 +450,7 @@ class ProjectBuilder: aDoc.writeDocument( f"# {noteTitles[newRoot]}\n\n" f"@tag: {ntTag}\n\n" - f"% Summary: {bfNote}\n\n" + f"% Short: {bfNote}\n\n" ) # Also add the archive and trash folders diff --git a/novelwriter/core/index.py b/novelwriter/core/index.py index 4795b30d..119b4416 100644 --- a/novelwriter/core/index.py +++ b/novelwriter/core/index.py @@ -339,7 +339,7 @@ class NWIndex: elif line.startswith("%"): if cTitle != TT_NONE: cStyle, cText, _ = processComment(line) - if cStyle in (nwComment.SYNOPSIS, nwComment.SUMMARY): + if cStyle in (nwComment.SYNOPSIS, nwComment.SHORT): self._itemIndex.setHeadingSynopsis(tHandle, cTitle, cText) # Count words for remaining text after last heading @@ -1268,7 +1268,7 @@ class IndexHeading: # =============================================================================================== # CLASSIFIERS = { - "summary": nwComment.SUMMARY, + "short": nwComment.SHORT, "synopsis": nwComment.SYNOPSIS, } diff --git a/novelwriter/core/tohtml.py b/novelwriter/core/tohtml.py index 762c61c4..6b5dbfe2 100644 --- a/novelwriter/core/tohtml.py +++ b/novelwriter/core/tohtml.py @@ -289,7 +289,7 @@ class ToHtml(Tokenizer): elif tType == self.T_SYNOPSIS and self._doSynopsis: lines.append(self._formatSynopsis(tText, True)) - elif tType == self.T_SUMMARY and self._doSynopsis: + elif tType == self.T_SHORT and self._doSynopsis: lines.append(self._formatSynopsis(tText, False)) elif tType == self.T_COMMENT and self._doComments: @@ -459,7 +459,10 @@ class ToHtml(Tokenizer): def _formatSynopsis(self, text: str, synopsis: bool) -> str: """Apply HTML formatting to synopsis.""" - sSynop = self._localLookup("Synopsis") if synopsis else self._localLookup("Summary") + if synopsis: + sSynop = self._localLookup("Synopsis") + else: + sSynop = self._localLookup("Short Description") if self._genMode == self.M_PREVIEW: return f"
{sSynop}: {text}
\n" else: diff --git a/novelwriter/core/tokenizer.py b/novelwriter/core/tokenizer.py index 70b6d246..cdb50119 100644 --- a/novelwriter/core/tokenizer.py +++ b/novelwriter/core/tokenizer.py @@ -80,7 +80,7 @@ class Tokenizer(ABC): # Block Type T_EMPTY = 1 # Empty line (new paragraph) T_SYNOPSIS = 2 # Synopsis comment - T_SUMMARY = 3 # Summary comment + T_SHORT = 3 # Short description comment T_COMMENT = 4 # Comment line T_KEYWORD = 5 # Command line T_TITLE = 6 # Title @@ -470,9 +470,9 @@ class Tokenizer(ABC): )) if self._doSynopsis and self._keepMarkdown: tmpMarkdown.append("%s\n" % aLine) - elif cStyle == nwComment.SUMMARY: + elif cStyle == nwComment.SHORT: self._tokens.append(( - self.T_SUMMARY, nHead, cText, None, sAlign + self.T_SHORT, nHead, cText, None, sAlign )) if self._doSynopsis and self._keepMarkdown: tmpMarkdown.append("%s\n" % aLine) diff --git a/novelwriter/core/tomd.py b/novelwriter/core/tomd.py index e73e142b..54dffdae 100644 --- a/novelwriter/core/tomd.py +++ b/novelwriter/core/tomd.py @@ -170,8 +170,8 @@ class ToMarkdown(Tokenizer): label = self._localLookup("Synopsis") lines.append(f"**{label}:** {tText}\n\n") - elif tType == self.T_SUMMARY and self._doSynopsis: - label = self._localLookup("Summary") + elif tType == self.T_SHORT and self._doSynopsis: + label = self._localLookup("Short Description") lines.append(f"**{label}:** {tText}\n\n") elif tType == self.T_COMMENT and self._doComments: diff --git a/novelwriter/core/toodt.py b/novelwriter/core/toodt.py index ddae70f6..681e3a68 100644 --- a/novelwriter/core/toodt.py +++ b/novelwriter/core/toodt.py @@ -484,7 +484,7 @@ class ToOdt(Tokenizer): tTemp, fTemp = self._formatSynopsis(tText, True) self._addTextPar("Text_20_Meta", oStyle, tTemp, tFmt=fTemp) - elif tType == self.T_SUMMARY and self._doSynopsis: + elif tType == self.T_SHORT and self._doSynopsis: tTemp, fTemp = self._formatSynopsis(tText, False) self._addTextPar("Text_20_Meta", oStyle, tTemp, tFmt=fTemp) @@ -558,7 +558,10 @@ class ToOdt(Tokenizer): def _formatSynopsis(self, text: str, synopsis: bool) -> tuple[str, list[tuple[int, int]]]: """Apply formatting to synopsis lines.""" - name = self._localLookup("Synopsis") if synopsis else self._localLookup("Summary") + if synopsis: + name = self._localLookup("Synopsis") + else: + name = self._localLookup("Short Description") rTxt = f"{name}: {text}" rFmt = [(0, self.FMT_B_B), (len(name) + 1, self.FMT_B_E)] return rTxt, rFmt diff --git a/novelwriter/enum.py b/novelwriter/enum.py index 7280dc36..5bb41f71 100644 --- a/novelwriter/enum.py +++ b/novelwriter/enum.py @@ -65,7 +65,7 @@ class nwComment(Enum): PLAIN = 0 SYNOPSIS = 1 - SUMMARY = 2 + SHORT = 2 # END Enum nwComment @@ -136,7 +136,7 @@ class nwDocInsert(Enum): QUOTE_LD = 3 QUOTE_RD = 4 SYNOPSIS = 5 - SUMMARY = 6 + SHORT = 6 NEW_PAGE = 7 VSPACE_S = 8 VSPACE_M = 9 diff --git a/novelwriter/gui/doceditor.py b/novelwriter/gui/doceditor.py index ec2aeea3..5747bce8 100644 --- a/novelwriter/gui/doceditor.py +++ b/novelwriter/gui/doceditor.py @@ -834,8 +834,8 @@ class GuiDocEditor(QPlainTextEdit): text = "% Synopsis: " newBlock = True goAfter = True - elif insert == nwDocInsert.SUMMARY: - text = "% Summary: " + elif insert == nwDocInsert.SHORT: + text = "% Short: " newBlock = True goAfter = True elif insert == nwDocInsert.NEW_PAGE: diff --git a/novelwriter/gui/docviewerpanel.py b/novelwriter/gui/docviewerpanel.py index f12a9aac..47986f58 100644 --- a/novelwriter/gui/docviewerpanel.py +++ b/novelwriter/gui/docviewerpanel.py @@ -316,13 +316,13 @@ class _ViewPanelBackRefs(QTreeWidget): class _ViewPanelKeyWords(QTreeWidget): - C_DATA = 0 - C_NAME = 0 - C_EDIT = 1 - C_VIEW = 2 - C_DOC = 3 - C_TITLE = 4 - C_SUMMARY = 5 + C_DATA = 0 + C_NAME = 0 + C_EDIT = 1 + C_VIEW = 2 + C_DOC = 3 + C_TITLE = 4 + C_SHORT = 5 D_TAG = Qt.ItemDataRole.UserRole @@ -337,7 +337,7 @@ class _ViewPanelKeyWords(QTreeWidget): self.setHeaderLabels([ self.tr("Tag"), "", "", self.tr("Document"), - self.tr("Heading"), self.tr("Summary") + self.tr("Heading"), self.tr("Short Description") ]) self.setIndentation(0) self.setIconSize(QSize(iPx, iPx)) @@ -401,7 +401,7 @@ class _ViewPanelKeyWords(QTreeWidget): trItem.setText(self.C_DOC, nwItem.itemName) trItem.setText(self.C_TITLE, hItem.title) trItem.setData(self.C_TITLE, Qt.ItemDataRole.DecorationRole, hDec) - trItem.setText(self.C_SUMMARY, hItem.synopsis) + trItem.setText(self.C_SHORT, hItem.synopsis) trItem.setData(self.C_DATA, self.D_TAG, tag) if tag not in self._treeMap: diff --git a/novelwriter/gui/mainmenu.py b/novelwriter/gui/mainmenu.py index f6fde5c7..736655c3 100644 --- a/novelwriter/gui/mainmenu.py +++ b/novelwriter/gui/mainmenu.py @@ -564,11 +564,11 @@ class GuiMainMenu(QMenuBar): lambda: self.requestDocInsert.emit(nwDocInsert.SYNOPSIS) ) - # Insert > Summary Comment - self.aInsSummary = self.mInsComments.addAction(self.tr("Summary Comment")) - self.aInsSummary.setShortcut("Ctrl+K, U") - self.aInsSummary.triggered.connect( - lambda: self.requestDocInsert.emit(nwDocInsert.SUMMARY) + # Insert > Short Description Comment + self.aInsShort = self.mInsComments.addAction(self.tr("Short Description Comment")) + self.aInsShort.setShortcut("Ctrl+K, U") + self.aInsShort.triggered.connect( + lambda: self.requestDocInsert.emit(nwDocInsert.SHORT) ) # Insert > Symbols diff --git a/novelwriter/guimain.py b/novelwriter/guimain.py index 65589ed6..f61b4e83 100644 --- a/novelwriter/guimain.py +++ b/novelwriter/guimain.py @@ -1461,7 +1461,7 @@ class GuiMain(QMainWindow): self.addAction(self.mainMenu.aInsTimes) self.addAction(self.mainMenu.aInsDivide) self.addAction(self.mainMenu.aInsSynopsis) - self.addAction(self.mainMenu.aInsSummary) + self.addAction(self.mainMenu.aInsShort) for mAction, _ in self.mainMenu.mInsKWItems.values(): self.addAction(mAction) diff --git a/sample/content/14298de4d9524.nwd b/sample/content/14298de4d9524.nwd index 9431806c..6e4c795d 100644 --- a/sample/content/14298de4d9524.nwd +++ b/sample/content/14298de4d9524.nwd @@ -7,6 +7,6 @@ @tag: John -% Summary: The sidekick +% Short: The sidekick He’s pretty cool. Not Brad Pitt though. diff --git a/sample/content/bb2c23b3c42cc.nwd b/sample/content/bb2c23b3c42cc.nwd index ddb0ad5e..f2048c84 100644 --- a/sample/content/bb2c23b3c42cc.nwd +++ b/sample/content/bb2c23b3c42cc.nwd @@ -7,6 +7,6 @@ @tag: Jane -% Summary: The heroine +% Short: The heroine She’s pretty cool. Not Angelina Jolie though. diff --git a/sample/nwProject.nwx b/sample/nwProject.nwx index ea845e2c..a68d8074 100644 --- a/sample/nwProject.nwx +++ b/sample/nwProject.nwx @@ -1,6 +1,6 @@ -Line one
Line two
Line three
Summary: A description ...
\n" + "Short Description: A short description ...
\n" ) # Comment @@ -621,8 +621,8 @@ def testCoreToHtml_Format(mockGUI): assert html._formatSynopsis("synopsis text", True) == ( "Synopsis: synopsis text
\n" ) - assert html._formatSynopsis("summary text", False) == ( - "Summary: summary text
\n" + assert html._formatSynopsis("short text", False) == ( + "Short Description: short text
\n" ) assert html._formatComments("comment text") == ( "Comment: comment text
\n" @@ -646,8 +646,8 @@ def testCoreToHtml_Format(mockGUI): assert html._formatSynopsis("synopsis text", True) == ( "Synopsis: synopsis text
\n" ) - assert html._formatSynopsis("summary text", False) == ( - "Summary: summary text
\n" + assert html._formatSynopsis("short text", False) == ( + "Short Description: short text
\n" ) assert html._formatComments("comment text") == ( "comment text
\n" diff --git a/tests/test_core/test_core_tokenizer.py b/tests/test_core/test_core_tokenizer.py index 29532d77..deab422b 100644 --- a/tests/test_core/test_core_tokenizer.py +++ b/tests/test_core/test_core_tokenizer.py @@ -471,19 +471,19 @@ def testCoreToken_MetaFormat(mockGUI): tokens.tokenizeText() assert tokens.theMarkdown[-1] == "% synopsis: The synopsis\n\n" - # Summary + # Short tokens.setSynopsis(False) - tokens._text = "% summary: A description\n" + tokens._text = "% short: A short description\n" tokens.tokenizeText() assert tokens._tokens == [ - (Tokenizer.T_SUMMARY, 0, "A description", None, Tokenizer.A_NONE), + (Tokenizer.T_SHORT, 0, "A short description", None, Tokenizer.A_NONE), (Tokenizer.T_EMPTY, 0, "", None, Tokenizer.A_NONE), ] assert tokens.theMarkdown[-1] == "\n" tokens.setSynopsis(True) tokens.tokenizeText() - assert tokens.theMarkdown[-1] == "% summary: A description\n\n" + assert tokens.theMarkdown[-1] == "% short: A short description\n\n" # Keyword tokens._text = "@char: Bod\n" diff --git a/tests/test_core/test_core_tomd.py b/tests/test_core/test_core_tomd.py index 385af38a..b18676ea 100644 --- a/tests/test_core/test_core_tomd.py +++ b/tests/test_core/test_core_tomd.py @@ -106,7 +106,7 @@ def testCoreToMarkdown_ConvertFormat(mockGUI): theMD.doConvert() assert theMD.theResult == "Line one \nLine two \nLine three\n\n" - # Synopsis, Summary + # Synopsis, Short theMD._text = "%synopsis: The synopsis ...\n" theMD.tokenizeText() theMD.doConvert() @@ -119,10 +119,10 @@ def testCoreToMarkdown_ConvertFormat(mockGUI): assert theMD.theResult == "**Synopsis:** The synopsis ...\n\n" theMD.setSynopsis(True) - theMD._text = "%summary: A description ...\n" + theMD._text = "%short: A description ...\n" theMD.tokenizeText() theMD.doConvert() - assert theMD.theResult == "**Summary:** A description ...\n\n" + assert theMD.theResult == "**Short Description:** A description ...\n\n" # Comment theMD._text = "% A comment ...\n" diff --git a/tests/test_core/test_core_toodt.py b/tests/test_core/test_core_toodt.py index 3622b4bb..a81e8e3a 100644 --- a/tests/test_core/test_core_toodt.py +++ b/tests/test_core/test_core_toodt.py @@ -447,12 +447,12 @@ def testCoreToOdt_Convert(mockGUI): '' ) - # Synopsis, Summary, Comment, Keywords + # Synopsis, Short, Comment, Keywords odt._text = ( "### Scene\n\n" "@pov: Jane\n\n" "% synopsis: So it begins\n\n" - "% summary: Then what\n\n" + "% short: Then what\n\n" "% A plain comment\n\n" ) odt.setSynopsis(True) @@ -471,7 +471,7 @@ def testCoreToOdt_Convert(mockGUI): '