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] 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 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])