diff --git a/novelwriter/assets/i18n/project_en_GB.json b/novelwriter/assets/i18n/project_en_GB.json index 19cdda1e..b5288d04 100644 --- a/novelwriter/assets/i18n/project_en_GB.json +++ b/novelwriter/assets/i18n/project_en_GB.json @@ -3,6 +3,7 @@ "Short Description": "Short Description", "Footnotes": "Footnotes", "Comment": "Comment", + "Story Structure": "Story Structure", "Notes": "Notes", "Tag": "Tag", "Point of View": "Point of View", diff --git a/novelwriter/formats/tokenizer.py b/novelwriter/formats/tokenizer.py index 7d1aeec0..3f3637a7 100644 --- a/novelwriter/formats/tokenizer.py +++ b/novelwriter/formats/tokenizer.py @@ -64,12 +64,12 @@ class ComStyle(NamedTuple): COMMENT_STYLE = { nwComment.PLAIN: ComStyle("Comment", "comment", "comment"), nwComment.IGNORE: ComStyle(), - nwComment.SYNOPSIS: ComStyle("Synopsis", "modifier", "synopsis"), - nwComment.SHORT: ComStyle("Short Description", "modifier", "synopsis"), + nwComment.SYNOPSIS: ComStyle("Synopsis", "modifier", "note"), + nwComment.SHORT: ComStyle("Short Description", "modifier", "note"), nwComment.NOTE: ComStyle("Note", "modifier", "note"), nwComment.FOOTNOTE: ComStyle("", "modifier", "note"), nwComment.COMMENT: ComStyle(), - nwComment.STORY: ComStyle("", "modifier", "note"), + nwComment.STORY: ComStyle("Story Structure", "modifier", "note"), } HEADINGS = [ BlockTyp.TITLE, BlockTyp.PART, BlockTyp.HEAD1, @@ -440,7 +440,7 @@ class Tokenizer(ABC): def initDocument(self) -> None: """Initialise data after settings.""" self._classes["modifier"] = self._theme.modifier - self._classes["synopsis"] = self._theme.note + self._classes["note"] = self._theme.note self._classes["comment"] = self._theme.comment self._classes["dialog"] = self._theme.dialog self._classes["altdialog"] = self._theme.altdialog @@ -615,7 +615,9 @@ class Tokenizer(ABC): if doJustify and not tStyle & BlockFmt.ALIGNED: tStyle |= BlockFmt.JUSTIFY - if cStyle in (nwComment.SYNOPSIS, nwComment.SHORT, nwComment.PLAIN): + if cStyle in ( + nwComment.SYNOPSIS, nwComment.SHORT, nwComment.PLAIN, nwComment.STORY + ): bStyle = COMMENT_STYLE[cStyle] tLine, tFmt = self._formatComment(bStyle, cKey, cText) tBlocks.append(( diff --git a/sample/content/636b6aa9b697b.nwd b/sample/content/636b6aa9b697b.nwd index aa2a13ce..5fd4bb76 100644 --- a/sample/content/636b6aa9b697b.nwd +++ b/sample/content/636b6aa9b697b.nwd @@ -1,8 +1,8 @@ %%~name: Making a Scene %%~path: 6a2d6d5f4f401/636b6aa9b697b %%~kind: NOVEL/DOCUMENT -%%~hash: 8d245fa740926779d19741ff7f75ef387b55130c -%%~date: Unknown/2024-10-25 23:54:52 +%%~hash: c057a5e9309b0e764c367b0fe9ab0607e3308622 +%%~date: Unknown/2025-04-08 20:10:33 ### Making a Scene @pov: Jane @@ -10,6 +10,8 @@ @location: Earth @mention: Space +%Story.Resolution: You can describe the scene structure with story comments. + A scene is defined by a level three heading, like the one at the top of this page. The scene will be assigned to the chapter preceding it in the project tree. The scene document can be sorted after the chapter document, or as a child of the chapter. Both result in the same output in the end, so it is a matter of preference. Each paragraph in the scene is separated by a blank line. The text supports minimal formatting, like **bold**, _italic_ and **_bold italic_**. You can also ~~strike through~~ text. There is **some support for _nested_ emphasis**, but there are some known limitations. If the syntax highlighter doesn’t show it correctly, the export tool will not either. diff --git a/sample/nwProject.nwx b/sample/nwProject.nwx index 6b36208e..f9c04fcf 100644 --- a/sample/nwProject.nwx +++ b/sample/nwProject.nwx @@ -1,6 +1,6 @@ - - + + Sample Project Jane Smith @@ -58,7 +58,7 @@ Chapter One - + Making a Scene diff --git a/tests/test_formats/test_fmt_tokenizer.py b/tests/test_formats/test_fmt_tokenizer.py index fed6b270..26dd7173 100644 --- a/tests/test_formats/test_fmt_tokenizer.py +++ b/tests/test_formats/test_fmt_tokenizer.py @@ -785,7 +785,7 @@ def testFmtToken_MetaFormat(mockGUI): BlockTyp.COMMENT, "", "Synopsis: The synopsis", [ (0, TextFmt.B_B, ""), (0, TextFmt.COL_B, "modifier"), (9, TextFmt.COL_E, ""), (9, TextFmt.B_E, ""), - (10, TextFmt.COL_B, "synopsis"), (22, TextFmt.COL_E, "") + (10, TextFmt.COL_B, "note"), (22, TextFmt.COL_E, "") ], BlockFmt.NONE )] @@ -802,7 +802,7 @@ def testFmtToken_MetaFormat(mockGUI): BlockTyp.COMMENT, "", "Short Description: A short description", [ (0, TextFmt.B_B, ""), (0, TextFmt.COL_B, "modifier"), (18, TextFmt.COL_E, ""), (18, TextFmt.B_E, ""), - (19, TextFmt.COL_B, "synopsis"), (38, TextFmt.COL_E, ""), + (19, TextFmt.COL_B, "note"), (38, TextFmt.COL_E, ""), ], BlockFmt.NONE )] @@ -1553,7 +1553,7 @@ def testFmtToken_TextIndent(mockGUI): tokens.tokenizeText() tFmt = [ (0, TextFmt.B_B, ""), (0, TextFmt.COL_B, "modifier"), (9, TextFmt.COL_E, ""), - (9, TextFmt.B_E, ""), (10, TextFmt.COL_B, "synopsis"), (24, TextFmt.COL_E, ""), + (9, TextFmt.B_E, ""), (10, TextFmt.COL_B, "note"), (24, TextFmt.COL_E, ""), ] assert tokens._blocks == [ (BlockTyp.HEAD3, TM1, "Scene Two", [], BlockFmt.NONE), @@ -1814,7 +1814,7 @@ def testFmtToken_FormatComment(mockGUI): "Synopsis: Hello world!", [ (0, TextFmt.B_B, ""), (0, TextFmt.COL_B, "modifier"), (9, TextFmt.COL_E, ""), (9, TextFmt.B_E, ""), - (10, TextFmt.COL_B, "synopsis"), (22, TextFmt.COL_E, ""), + (10, TextFmt.COL_B, "note"), (22, TextFmt.COL_E, ""), ] )