From 19b97bf8a64aed9906ae928a6223785a85242543 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 15 Aug 2020 19:40:17 +0200 Subject: [PATCH 1/3] Added an override for unnumbered chapters based on a leading asterisk --- nw/core/tokenizer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nw/core/tokenizer.py b/nw/core/tokenizer.py index bf881f50..5db2d19d 100644 --- a/nw/core/tokenizer.py +++ b/nw/core/tokenizer.py @@ -490,6 +490,9 @@ class Tokenizer(): # Numbered or Unnumbered if self.isUnNum: tTemp = self._formatHeading(self.fmtUnNum, tToken[2]) + elif tToken[2].startswith("*"): + tTemp = self._formatHeading(self.fmtUnNum, tToken[2]) + tTemp = tTemp[1:].lstrip() else: self.numChapter += 1 tTemp = self._formatHeading(self.fmtChapter, tToken[2]) From 29d19c6f10a80e643b480e4bd899cefd022fc3b3 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 15 Aug 2020 19:40:48 +0200 Subject: [PATCH 2/3] Updated documentation accordingly --- docs/source/structure.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/source/structure.rst b/docs/source/structure.rst index 146f56e7..4e5b51a5 100644 --- a/docs/source/structure.rst +++ b/docs/source/structure.rst @@ -56,6 +56,27 @@ instance, chapter numbers can be applied automatically, and so can scene numbers a draft manuscript. See the :ref:`a_export` page for more details. +.. _a_struct_heads_unnum: + +Unnumbered Chapter Headings +--------------------------- + +If you use file layout types for your files, the automatic numbering feature for your chapters is +controlled by whether you use the :guilabel:`Chapter` or :guilabel:`Unnumbered` layout type for your +file. However, if you have a different file layout where this isn't practical, you can also switch +off chapter numbering for a chapter by making the first charcater of the chapter title an ``*``. +Like so: + +``## *Unnumbered Chapter Title`` + +The leading asterisk is only considered by the :guilabel:`Build Novel Project` tool, and will be +removed before inserted at the location of the ``%title%`` label. See the :ref:`a_export` page for +more details. + +.. note:: + If you need the first character of the title to be an actual asterisk, you must escape it: ``\*``. + + .. _a_struct_tags: Tag References From 2ddbb628a4cb8f3e1b1879f46ff035fada51bcc1 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 15 Aug 2020 20:09:06 +0200 Subject: [PATCH 3/3] Updated changelog --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0febee8f..41a373ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,10 @@ ## Version 1.0 Beta 1 [2020-08-23] - Not Yet Released -**Improvements** +**Feature Improvements** -* The Select Paragraph feature in the Edit menu now selects only the paragraph itself, without the leading line break. This was previously handled entirely by the Qt library, which does this for some reason. Issue #395, PR #403. +* The Select Paragraph feature in the Edit menu now selects only the paragraph itself, without the leading line break. This was previously handled entirely by the Qt library, which does this for some reason. Issue #395, PR #405. +* A chapter heading in a file with a different layout than `Unnumbered` can now also be flagged as an unnumbered chapter heading by adding an asterisk to the begfinning of the title text. This only affects the number assignment and counter when running the Build Novel Project tool. The rest of the app ignores the asterisk. Issue #402, PR #406. ## Version 0.12 [2020-08-15]