Merge pull request #406 from vkbo/unnum_chapter_heading

Unnumbered Chapter: Alternative Syntax
This commit is contained in:
Veronica K. Berglyd Olsen
2020-08-15 20:14:21 +02:00
committed by GitHub
3 changed files with 27 additions and 2 deletions
+3 -2
View File
@@ -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]
+21
View File
@@ -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
+3
View File
@@ -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])