From bb1a7782772e0aae5572dfc9b2604bef3bb1b8e1 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Mon, 2 Aug 2021 23:44:35 +0200 Subject: [PATCH] Merge Novel Layouts (#837) * Merge novel layouts and simplify the Tokenizer class * Fix core tests * Delete auto-layout code * Remove no longer needed item layouts * Remove references to deleted item layouts in test * Make some minor changes to Tokenizer class and update tests * Update test reference files * Update sample project * Fix a few issues with the Tokenizer * Centre some text in the sample documents * Make some minor changes to how new projects are generated * Add support for New Page and VSpace commands to the Tokenizer * Remove Title and Page layouts and add codes for page break and vertical space * Add document layout and fix some issues in index class with new title formats * Update tests and reference files * Bump the project file version and fix a minor issue in items class * Update tests and test coverage * Clean up some warnings and issues in tests --- nw/constants.py | 27 +- nw/core/index.py | 21 +- nw/core/item.py | 5 +- nw/core/project.py | 55 +- nw/core/spellcheck.py | 2 +- nw/core/tohtml.py | 14 +- nw/core/tokenizer.py | 416 ++++++------ nw/core/tomd.py | 4 + nw/core/toodt.py | 8 +- nw/core/tree.py | 49 +- nw/dialogs/docsplit.py | 12 +- nw/dialogs/itemeditor.py | 8 +- nw/enum.py | 12 +- nw/gui/doceditor.py | 14 +- nw/gui/dochighlight.py | 59 +- nw/gui/docviewer.py | 6 + nw/gui/projtree.py | 6 +- pytest.ini | 3 +- sample/content/53b69b83cdafc.nwd | 11 +- sample/content/636b6aa9b697b.nwd | 2 +- sample/content/6a2d6d5f4f401.nwd | 2 +- sample/content/88706ddc78b1b.nwd | 2 +- sample/content/8a5deb88c0e97.nwd | 2 +- sample/content/974e400180a99.nwd | 7 +- sample/content/ae7339df26ded.nwd | 2 +- sample/content/b8136a5a774a0.nwd | 2 +- sample/content/ba8a28a246524.nwd | 4 +- sample/content/bc0cbd2a407f3.nwd | 2 +- sample/content/edca4be2fcaf8.nwd | 4 +- sample/nwProject.nwx | 62 +- tests/conftest.py | 1 - tests/lipsum/content/441420a886d82.nwd | 2 +- tests/lipsum/content/47666c91c7ccf.nwd | 2 +- tests/lipsum/content/7a992350f3eb6.nwd | 10 +- tests/lipsum/content/846352075de7d.nwd | 4 +- tests/lipsum/content/88243afbe5ed8.nwd | 2 +- tests/lipsum/content/88d59a277361b.nwd | 4 +- tests/lipsum/content/8c58a65414c23.nwd | 4 +- tests/lipsum/content/db7e733775d4d.nwd | 4 +- tests/lipsum/content/eb103bc70c90c.nwd | 2 +- tests/lipsum/content/f8c0562e50f1b.nwd | 2 +- tests/lipsum/content/f96ec11c6a3da.nwd | 2 +- tests/lipsum/content/fb609cd8319dc.nwd | 2 +- tests/lipsum/nwProject.nwx | 40 +- tests/minimal/content/8c659a11cd429.nwd | 2 +- tests/minimal/content/a35baf2e93843.nwd | 6 +- tests/minimal/content/f5ab3e30151e1.nwd | 2 +- tests/minimal/nwProject.nwx | 18 +- tests/mock.py | 2 + .../coreIndex_LoadSave_tagsIndex.json | 28 +- .../coreProject_NewCustomA_nwProject.nwx | 30 +- .../coreProject_NewCustomB_nwProject.nwx | 18 +- .../coreProject_NewFile_nwProject.nwx | 12 +- .../coreProject_NewMinimal_nwProject.nwx | 10 +- .../coreProject_NewRoot_nwProject.nwx | 10 +- .../guiBuild_Tool_Step1_Lorem_Ipsum.fodt | 41 +- .../guiBuild_Tool_Step1_Lorem_Ipsum.htm | 4 +- .../guiBuild_Tool_Step1_Lorem_Ipsum.nwd | 5 +- .../guiBuild_Tool_Step2_Lorem_Ipsum.fodt | 83 ++- .../guiBuild_Tool_Step2_Lorem_Ipsum.htm | 14 +- .../guiBuild_Tool_Step2_Lorem_Ipsum.md | 10 +- .../guiBuild_Tool_Step2_Lorem_Ipsum.nwd | 7 +- .../guiBuild_Tool_Step3_Lorem_Ipsum.fodt | 83 ++- .../guiBuild_Tool_Step3_Lorem_Ipsum.htm | 14 +- .../guiBuild_Tool_Step3_Lorem_Ipsum.md | 10 +- .../guiBuild_Tool_Step3_Lorem_Ipsum.nwd | 7 +- .../guiBuild_Tool_Step4H_Lorem_Ipsum.json | 8 +- .../guiBuild_Tool_Step4M_Lorem_Ipsum.json | 9 +- .../guiBuild_Tool_Step4_Lorem_Ipsum.htm | 4 +- .../guiBuild_Tool_Step4_Lorem_Ipsum.nwd | 5 +- .../guiEditor_Main_Final_0e17daca5f3e1.nwd | 2 +- .../guiEditor_Main_Final_nwProject.nwx | 14 +- .../guiEditor_Main_Initial_nwProject.nwx | 12 +- .../guiItemEditor_Dialog_nwProject.nwx | 12 +- .../guiProjSettings_Dialog_nwProject.nwx | 12 +- tests/test_base/test_base_common.py | 8 +- tests/test_base/test_base_error.py | 4 +- tests/test_core/test_core_document.py | 6 +- tests/test_core/test_core_index.py | 122 +++- tests/test_core/test_core_item.py | 42 +- tests/test_core/test_core_project.py | 30 +- tests/test_core/test_core_spell.py | 18 +- tests/test_core/test_core_tohtml.py | 179 ++++- tests/test_core/test_core_tokenizer.py | 637 ++++++++++++++---- tests/test_core/test_core_toodt.py | 4 +- tests/test_core/test_core_tree.py | 208 ++---- tests/test_dialogs/test_dlg_itemeditor.py | 10 +- tests/test_dialogs/test_dlg_merge.py | 2 +- tests/test_dialogs/test_dlg_preferences.py | 3 +- tests/test_dialogs/test_dlg_split.py | 14 +- tests/test_gui/test_gui_doceditor.py | 4 +- tests/test_gui/test_gui_theme.py | 6 +- 92 files changed, 1574 insertions(+), 1121 deletions(-) diff --git a/nw/constants.py b/nw/constants.py index 4c2b60b1..8500ae9b 100644 --- a/nw/constants.py +++ b/nw/constants.py @@ -65,6 +65,9 @@ class nwLists(): # Item classes which do not require items to have same class FREE_CLASS = {nwItemClass.ARCHIVE, nwItemClass.TRASH} + # Deprecated nwItemLayout entries + DEP_LAYOUT = ("TITLE", "PAGE", "BOOK", "PARTITION", "UNNUMBERED", "CHAPTER", "SCENE", "STORY") + # END Class nwLists @@ -169,26 +172,14 @@ class nwLabels(): nwItemClass.TRASH: "cls_trash", } LAYOUT_NAME = { - nwItemLayout.NO_LAYOUT: QT_TRANSLATE_NOOP("Constant", "None"), - nwItemLayout.TITLE: QT_TRANSLATE_NOOP("Constant", "Title Page"), - nwItemLayout.BOOK: QT_TRANSLATE_NOOP("Constant", "Book"), - nwItemLayout.PAGE: QT_TRANSLATE_NOOP("Constant", "Plain Page"), - nwItemLayout.PARTITION: QT_TRANSLATE_NOOP("Constant", "Partition"), - nwItemLayout.UNNUMBERED: QT_TRANSLATE_NOOP("Constant", "Unnumbered"), - nwItemLayout.CHAPTER: QT_TRANSLATE_NOOP("Constant", "Chapter"), - nwItemLayout.SCENE: QT_TRANSLATE_NOOP("Constant", "Scene"), - nwItemLayout.NOTE: QT_TRANSLATE_NOOP("Constant", "Note"), + nwItemLayout.NO_LAYOUT: QT_TRANSLATE_NOOP("Constant", "None"), + nwItemLayout.DOCUMENT: QT_TRANSLATE_NOOP("Constant", "Novel Document"), + nwItemLayout.NOTE: QT_TRANSLATE_NOOP("Constant", "Project Note"), } LAYOUT_FLAG = { - nwItemLayout.NO_LAYOUT: "Xo", - nwItemLayout.TITLE: "Tt", - nwItemLayout.BOOK: "Bk", - nwItemLayout.PAGE: "Pg", - nwItemLayout.PARTITION: "Pt", - nwItemLayout.UNNUMBERED: "Un", - nwItemLayout.CHAPTER: "Ch", - nwItemLayout.SCENE: "Sc", - nwItemLayout.NOTE: "Nt", + nwItemLayout.NO_LAYOUT: "Xo", + nwItemLayout.DOCUMENT: "Dc", + nwItemLayout.NOTE: "Nt", } KEY_NAME = { nwKeyWords.TAG_KEY: QT_TRANSLATE_NOOP("Constant", "Tag"), diff --git a/nw/core/index.py b/nw/core/index.py index 12e0d510..997ed33d 100644 --- a/nw/core/index.py +++ b/nw/core/index.py @@ -354,6 +354,12 @@ class NWIndex(): elif aLine.startswith("#### "): hDepth = "H4" hText = aLine[5:].strip() + elif aLine.startswith("#! "): + hDepth = "H1" + hText = aLine[2:].strip() + elif aLine.startswith("##! "): + hDepth = "H2" + hText = aLine[4:].strip() else: return False @@ -861,7 +867,13 @@ def countWords(theText): if aLine[0] == "@" or aLine[0] == "%": continue - if aLine[0] == "#": + if aLine[0] == "[": + if aLine.startswith(("[NEWPAGE]", "[NEW PAGE]", "[VSPACE]")): + continue + elif aLine.startswith("[VSPACE:") and aLine.endswith("]"): + continue + + elif aLine[0] == "#": if aLine[:5] == "#### ": aLine = aLine[5:] countPara = False @@ -874,6 +886,13 @@ def countWords(theText): elif aLine[:2] == "# ": aLine = aLine[2:] countPara = False + elif aLine[:3] == "#! ": + aLine = aLine[3:] + countPara = False + elif aLine[:4] == "##! ": + aLine = aLine[4:] + countPara = False + elif aLine[0] == ">" or aLine[-1] == "<": if aLine[:2] == ">>": aLine = aLine[2:].lstrip(" ") diff --git a/nw/core/item.py b/nw/core/item.py index a61e8a0b..74cd833f 100644 --- a/nw/core/item.py +++ b/nw/core/item.py @@ -29,6 +29,7 @@ from lxml import etree from nw.enum import nwItemType, nwItemClass, nwItemLayout from nw.common import checkInt, isHandle, isItemClass, isItemLayout, isItemType +from nw.constants import nwLists logger = logging.getLogger(__name__) @@ -230,6 +231,8 @@ class NWItem(): self.itemLayout = theLayout elif isItemLayout(theLayout): self.itemLayout = nwItemLayout[theLayout] + elif theLayout in nwLists.DEP_LAYOUT: + self.itemLayout = nwItemLayout.DOCUMENT else: logger.error("Unrecognised item layout '%s'", theLayout) self.itemLayout = nwItemLayout.NO_LAYOUT @@ -239,7 +242,7 @@ class NWItem(): """Set the item status by looking it up in the valid status items of the current project. """ - if self.itemClass == nwItemClass.NOVEL: + if self.itemClass in nwLists.CLS_NOVEL: self.itemStatus = self.theProject.statusItems.checkEntry(theStatus) else: self.itemStatus = self.theProject.importItems.checkEntry(theStatus) diff --git a/nw/core/project.py b/nw/core/project.py index ccdfcc45..7ca73a32 100644 --- a/nw/core/project.py +++ b/nw/core/project.py @@ -52,6 +52,8 @@ logger = logging.getLogger(__name__) class NWProject(): + FILE_VERSION = "1.3" + def __init__(self, theParent): # Internal @@ -142,14 +144,14 @@ class NWProject(): return newItem.itemHandle def newFile(self, fileName, fileClass, pHandle): - """Add a new file with a given name and class, and set a default - layout based on the class. SCENE for NOVEL, and otherwise NOTE. + """Add a new file with a given name and class, and set a layout + based on the class. DOCUMENT for NOVEL, otherwise NOTE. """ newItem = NWItem(self) newItem.setName(fileName) newItem.setType(nwItemType.FILE) if fileClass == nwItemClass.NOVEL: - newItem.setLayout(nwItemLayout.SCENE) + newItem.setLayout(nwItemLayout.DOCUMENT) else: newItem.setLayout(nwItemLayout.NOTE) newItem.setClass(fileClass) @@ -204,7 +206,7 @@ class NWProject(): self.autoReplace = {} self.titleFormat = { "title": "%title%", - "chapter": self.tr("Chapter")+" %ch%: %title%", + "chapter": "%title%", "unnumbered": "%title%", "scene": "* * *", "section": "", @@ -261,9 +263,9 @@ class NWProject(): self.setBookTitle(projTitle) self.setBookAuthors(projAuthors) - titlePage = "# %s\n\n" % (self.bookTitle if self.bookTitle else self.projName) + titlePage = "#! %s\n\n" % (self.bookTitle if self.bookTitle else self.projName) if self.bookAuthors: - titlePage = "%s%s %s\n" % (titlePage, self.tr("By"), self.getAuthors()) + titlePage = "%s>> %s %s <<\n" % (titlePage, self.tr("By"), self.getAuthors()) if popMinimal: # Creating a minimal project with a few root folders and a @@ -278,9 +280,6 @@ class NWProject(): xHandle[7] = self.newFile(self.tr("New Chapter"), nwItemClass.NOVEL, xHandle[6]) xHandle[8] = self.newFile(self.tr("New Scene"), nwItemClass.NOVEL, xHandle[6]) - self.projTree.setFileItemLayout(xHandle[5], nwItemLayout.TITLE) - self.projTree.setFileItemLayout(xHandle[7], nwItemLayout.CHAPTER) - aDoc = NWDoc(self, xHandle[5]) aDoc.writeDocument(titlePage) @@ -303,7 +302,7 @@ class NWProject(): # Create a title page tHandle = self.newFile(self.tr("Title Page"), nwItemClass.NOVEL, nHandle) - self.projTree.setFileItemLayout(tHandle, nwItemLayout.TITLE) + self.projTree.setFileItemLayout(tHandle, nwItemLayout.DOCUMENT) aDoc = NWDoc(self, tHandle) aDoc.writeDocument(titlePage) @@ -322,7 +321,7 @@ class NWProject(): pHandle = self.newFolder(chTitle, nwItemClass.NOVEL, nHandle) cHandle = self.newFile(chTitle, nwItemClass.NOVEL, pHandle) - self.projTree.setFileItemLayout(cHandle, nwItemLayout.CHAPTER) + self.projTree.setFileItemLayout(cHandle, nwItemLayout.DOCUMENT) aDoc = NWDoc(self, cHandle) aDoc.writeDocument("## %s\n\n" % chTitle) @@ -466,8 +465,11 @@ class NWProject(): # 1.2 : Changes the way autoReplace entries are stored. The 1.1 # parser will lose the autoReplace settings if allowed to # read the file. Introduced in version 0.10. + # 1.3 : Reduces the number of layouts to onlye two. One for + # novel documents and one for notes. Introduced in version + # 1.5. - if fileVersion not in ("1.0", "1.1", "1.2"): + if fileVersion not in ("1.0", "1.1", "1.2", "1.3"): self.makeAlert(self.tr( "Unknown or unsupported novelWriter project file format. " "The project cannot be opened by this version of novelWriter. " @@ -476,6 +478,19 @@ class NWProject(): self.clearProject() return False + if fileVersion != self.FILE_VERSION: + msgYes = self.theParent.askQuestion( + self.tr("File Version"), + self.tr( + "The file format of your project is about to be updated. " + "If you proceed, this project can no longer be opened by " + "an older version of novelWriter. Continue?" + ).format(appVersion, nw.__version__) + ) + if not msgYes: + self.clearProject() + return False + # Check novelWriter Version # ========================= @@ -621,10 +636,10 @@ class NWProject(): # Root element and project details logger.debug("Writing project meta") nwXML = etree.Element("novelWriterXML", attrib={ - "appVersion": str(nw.__version__), - "hexVersion": str(nw.__hexversion__), - "fileVersion": "1.2", - "timeStamp": formatTimeStamp(saveTime), + "appVersion": str(nw.__version__), + "hexVersion": str(nw.__hexversion__), + "fileVersion": self.FILE_VERSION, + "timeStamp": formatTimeStamp(saveTime), }) editTime = int(self.editTime + saveTime - self.projOpened) @@ -728,14 +743,14 @@ class NWProject(): if self.projPath is None or self.projPath == "": return False - if self.projPath == os.path.expanduser("~"): - # Don't make a mess in the user's home folder - return False - self.projMeta = os.path.join(self.projPath, "meta") self.projCache = os.path.join(self.projPath, "cache") self.projContent = os.path.join(self.projPath, "content") + if self.projPath == os.path.expanduser("~"): + # Don't make a mess in the user's home folder + return False + if not self._checkFolder(self.projMeta): return False if not self._checkFolder(self.projCache): diff --git a/nw/core/spellcheck.py b/nw/core/spellcheck.py index 455b8f4c..66bbd08a 100644 --- a/nw/core/spellcheck.py +++ b/nw/core/spellcheck.py @@ -143,7 +143,7 @@ class NWSpellEnchant(NWSpellCheck): try: import enchant if self.theBroker is not None: - logger.verbose("Deleting old pyenchant broker") + logger.debug("Deleting old pyenchant broker") del self.theBroker self.theBroker = enchant.Broker() diff --git a/nw/core/tohtml.py b/nw/core/tohtml.py index 93bc1290..8039fc86 100644 --- a/nw/core/tohtml.py +++ b/nw/core/tohtml.py @@ -128,9 +128,7 @@ class ToHtml(Tokenizer): } if self.isNovel and self.genMode != self.M_PREVIEW: - # For novel files for export, we bump the titles one level - # up as this is more useful for printing and word processor - # imports. + # For story files, we bump the titles one level up h1Cl = " class='title'" h1 = "h1" h2 = "h1" @@ -168,13 +166,9 @@ class ToHtml(Tokenizer): if tStyle & self.A_PBB: aStyle.append("page-break-before: always;") - elif tStyle & self.A_PBB_AUT: - aStyle.append("page-break-before: auto;") if tStyle & self.A_PBA: aStyle.append("page-break-after: always;") - elif tStyle & self.A_PBA_AUT: - aStyle.append("page-break-after: auto;") if tStyle & self.A_Z_BTMMRG: aStyle.append("margin-bottom: 0;") @@ -206,7 +200,7 @@ class ToHtml(Tokenizer): parClass = "" if len(thisPar) > 0: tTemp = "
".join(thisPar) - tmpResult.append("%s

\n" % (parStyle, parClass, tTemp.rstrip())) + tmpResult.append("%s

\n" % (parClass, parStyle, tTemp.rstrip())) thisPar = [] parStyle = None @@ -214,6 +208,10 @@ class ToHtml(Tokenizer): tHead = tText.replace(r"\\", "
") tmpResult.append("

%s%s

\n" % (hStyle, aNm, tHead)) + elif tType == self.T_UNNUM: + tHead = tText.replace(r"\\", "
") + tmpResult.append("<%s%s>%s%s\n" % (h2, hStyle, aNm, tHead, h2)) + elif tType == self.T_HEAD1: tHead = tText.replace(r"\\", "
") tmpResult.append("<%s%s%s>%s%s\n" % (h1, h1Cl, hStyle, aNm, tHead, h1)) diff --git a/nw/core/tokenizer.py b/nw/core/tokenizer.py index 7dbabc55..6e978387 100644 --- a/nw/core/tokenizer.py +++ b/nw/core/tokenizer.py @@ -33,7 +33,7 @@ from functools import partial from PyQt5.QtCore import QCoreApplication, QRegularExpression from nw.enum import nwItemLayout, nwItemType -from nw.common import numberToRoman +from nw.common import numberToRoman, checkInt from nw.constants import nwConst, nwRegEx, nwUnicode from nw.core.document import NWDoc @@ -56,13 +56,14 @@ class Tokenizer(): T_COMMENT = 3 # Comment line T_KEYWORD = 4 # Command line T_TITLE = 5 # Title - T_HEAD1 = 6 # Header 1 - T_HEAD2 = 7 # Header 2 - T_HEAD3 = 8 # Header 3 - T_HEAD4 = 9 # Header 4 - T_TEXT = 10 # Text line - T_SEP = 11 # Scene separator - T_SKIP = 12 # Paragraph break + T_UNNUM = 6 # Unnumbered + T_HEAD1 = 7 # Header 1 + T_HEAD2 = 8 # Header 2 + T_HEAD3 = 9 # Header 3 + T_HEAD4 = 10 # Header 4 + T_TEXT = 11 # Text line + T_SEP = 12 # Scene separator + T_SKIP = 13 # Paragraph break # Block Style A_NONE = 0x0000 # No special style @@ -70,14 +71,12 @@ class Tokenizer(): A_RIGHT = 0x0002 # Right aligned A_CENTRE = 0x0004 # Centred A_JUSTIFY = 0x0008 # Justified - A_PBB = 0x0010 # Page break before always - A_PBB_AUT = 0x0020 # Page break before auto - A_PBA = 0x0040 # Page break after always - A_PBA_AUT = 0x0080 # Page break after auto - A_Z_TOPMRG = 0x0100 # Zero top margin - A_Z_BTMMRG = 0x0200 # Zero bottom margin - A_IND_L = 0x0400 # Left indentation - A_IND_R = 0x0800 # Right indentation + A_PBB = 0x0010 # Page break before + A_PBA = 0x0020 # Page break after + A_Z_TOPMRG = 0x0040 # Zero top margin + A_Z_BTMMRG = 0x0080 # Zero bottom margin + A_IND_L = 0x0100 # Left indentation + A_IND_R = 0x0200 # Right indentation def __init__(self, theProject): @@ -136,15 +135,9 @@ class Tokenizer(): # This File self.isNone = False - self.isTitle = False - self.isBook = False - self.isPage = False - self.isPart = False - self.isUnNum = False - self.isChap = False - self.isScene = False - self.isNote = False self.isNovel = False + self.isNote = False + self.isFirst = True # Error Handling self.errData = [] @@ -268,10 +261,16 @@ class Tokenizer(): if theItem.itemType != nwItemType.ROOT: return False + if self.isFirst: + textAlign = self.A_CENTRE + self.isFirst = False + else: + textAlign = self.A_PBB | self.A_CENTRE + theTitle = "%s: %s" % (self._localLookup("Notes"), theItem.itemName) self.theTokens = [] self.theTokens.append(( - self.T_TITLE, 0, theTitle, None, self.A_PBB | self.A_CENTRE + self.T_TITLE, 0, theTitle, None, textAlign )) if self.keepMarkdown: self.theMarkdown.append("# %s\n\n" % theTitle) @@ -307,15 +306,8 @@ class Tokenizer(): self.errData.append(errVal) self.isNone = self.theItem.itemLayout == nwItemLayout.NO_LAYOUT - self.isTitle = self.theItem.itemLayout == nwItemLayout.TITLE - self.isBook = self.theItem.itemLayout == nwItemLayout.BOOK - self.isPage = self.theItem.itemLayout == nwItemLayout.PAGE - self.isPart = self.theItem.itemLayout == nwItemLayout.PARTITION - self.isUnNum = self.theItem.itemLayout == nwItemLayout.UNNUMBERED - self.isChap = self.theItem.itemLayout == nwItemLayout.CHAPTER - self.isScene = self.theItem.itemLayout == nwItemLayout.SCENE + self.isNovel = self.theItem.itemLayout == nwItemLayout.DOCUMENT self.isNote = self.theItem.itemLayout == nwItemLayout.NOTE - self.isNovel = self.isBook or self.isUnNum or self.isChap or self.isScene return True @@ -356,11 +348,11 @@ class Tokenizer(): def tokenizeText(self): """Scan the text for either lines starting with specific characters that indicate headers, comments, commands etc, or - just contains plain text. in the case of plain text, apply the + just contain plain text. In the case of plain text, apply the same RegExes that the syntax highlighter uses and save the locations of these formatting tags into the token array. - The format of the token list is an entry with a four-tuple for + The format of the token list is an entry with a five-tuple for each line in the file. The tuple is as follows: 1: The type of the block, self.T_* 2: The line in file where this block occurred @@ -375,73 +367,144 @@ class Tokenizer(): (QRegularExpression(nwRegEx.FMT_ST), [None, self.FMT_D_B, None, self.FMT_D_E]), ] - # Determine default text alignment - if self.isTitle or self.isPart: - defAlign = self.A_CENTRE - else: - defAlign = self.A_NONE - self.theTokens = [] tmpMarkdown = [] nLine = 0 + breakNext = False for aLine in self.theText.splitlines(): nLine += 1 + sLine = aLine.strip() - # Tag lines starting with specific characters - if len(aLine.strip()) == 0: + # Check for blank lines + if len(sLine) == 0: self.theTokens.append(( - self.T_EMPTY, nLine, "", None, defAlign + self.T_EMPTY, nLine, "", None, self.A_NONE )) if self.keepMarkdown: tmpMarkdown.append("\n") + continue + + if breakNext: + sAlign = self.A_PBB + breakNext = False + else: + sAlign = self.A_NONE + + # Check Line Format + # ================= + + if aLine[0] == "[": + # Parse special formatting line + + if sLine in ("[NEWPAGE]", "[NEW PAGE]"): + breakNext = True + continue + + elif sLine == "[VSPACE]": + self.theTokens.append( + (self.T_SKIP, nLine, "", None, sAlign) + ) + continue + + elif sLine.startswith("[VSPACE:") and sLine.endswith("]"): + nSkip = checkInt(sLine[8:-1], 0) + if nSkip >= 1: + self.theTokens.append( + (self.T_SKIP, nLine, "", None, sAlign) + ) + if nSkip > 1: + self.theTokens += (nSkip - 1) * [ + (self.T_SKIP, nLine, "", None, self.A_NONE) + ] + continue + elif aLine[0] == "%": cLine = aLine[1:].lstrip() synTag = cLine[:9].lower() if synTag == "synopsis:": self.theTokens.append(( - self.T_SYNOPSIS, nLine, cLine[9:].strip(), None, defAlign + self.T_SYNOPSIS, nLine, cLine[9:].strip(), None, sAlign )) if self.doSynopsis and self.keepMarkdown: tmpMarkdown.append("%s\n" % aLine) else: self.theTokens.append(( - self.T_COMMENT, nLine, aLine[1:].strip(), None, defAlign + self.T_COMMENT, nLine, aLine[1:].strip(), None, sAlign )) if self.doComments and self.keepMarkdown: tmpMarkdown.append("%s\n" % aLine) elif aLine[0] == "@": self.theTokens.append(( - self.T_KEYWORD, nLine, aLine[1:].strip(), None, defAlign + self.T_KEYWORD, nLine, aLine[1:].strip(), None, sAlign )) if self.doKeywords and self.keepMarkdown: tmpMarkdown.append("%s\n" % aLine) elif aLine[:2] == "# ": + if self.isNovel: + sAlign |= self.A_CENTRE + + if self.isNovel and not self.isFirst: + sAlign |= self.A_PBB + self.theTokens.append(( - self.T_HEAD1, nLine, aLine[2:].strip(), None, defAlign + self.T_HEAD1, nLine, aLine[2:].strip(), None, sAlign )) if self.keepMarkdown: tmpMarkdown.append("%s\n" % aLine) elif aLine[:3] == "## ": + if self.isNovel and not self.isFirst: + sAlign |= self.A_PBB + self.theTokens.append(( - self.T_HEAD2, nLine, aLine[3:].strip(), None, defAlign + self.T_HEAD2, nLine, aLine[3:].strip(), None, sAlign )) if self.keepMarkdown: tmpMarkdown.append("%s\n" % aLine) elif aLine[:4] == "### ": self.theTokens.append(( - self.T_HEAD3, nLine, aLine[4:].strip(), None, defAlign + self.T_HEAD3, nLine, aLine[4:].strip(), None, sAlign )) if self.keepMarkdown: tmpMarkdown.append("%s\n" % aLine) elif aLine[:5] == "#### ": self.theTokens.append(( - self.T_HEAD4, nLine, aLine[5:].strip(), None, defAlign + self.T_HEAD4, nLine, aLine[5:].strip(), None, sAlign + )) + if self.keepMarkdown: + tmpMarkdown.append("%s\n" % aLine) + + elif aLine[:3] == "#! ": + if self.isNovel: + tStyle = self.T_TITLE + else: + tStyle = self.T_HEAD1 + + if self.isNovel and not self.isFirst: + sAlign |= self.A_PBB + + self.theTokens.append(( + tStyle, nLine, aLine[3:].strip(), None, sAlign | self.A_CENTRE + )) + if self.keepMarkdown: + tmpMarkdown.append("%s\n" % aLine) + + elif aLine[:4] == "##! ": + if self.isNovel: + tStyle = self.T_UNNUM + else: + tStyle = self.T_HEAD2 + + if self.isNovel and not self.isFirst: + sAlign |= self.A_PBB + + self.theTokens.append(( + tStyle, nLine, aLine[4:].strip(), None, sAlign )) if self.keepMarkdown: tmpMarkdown.append("%s\n" % aLine) @@ -452,36 +515,35 @@ class Tokenizer(): continue # Check Alignment and Indentation - tagLeft = False - tagRight = False + alnLeft = False + alnRight = False indLeft = False indRight = False if aLine.startswith(">>"): - tagRight = True + alnRight = True aLine = aLine[2:].lstrip(" ") elif aLine.startswith(">"): indLeft = True aLine = aLine[1:].lstrip(" ") if aLine.endswith("<<"): - tagLeft = True + alnLeft = True aLine = aLine[:-2].rstrip(" ") elif aLine.endswith("<"): indRight = True aLine = aLine[:-1].rstrip(" ") - textAlign = defAlign - if tagLeft and tagRight: - textAlign = self.A_CENTRE - elif tagLeft: - textAlign = self.A_LEFT - elif tagRight: - textAlign = self.A_RIGHT + if alnLeft and alnRight: + sAlign |= self.A_CENTRE + elif alnLeft: + sAlign |= self.A_LEFT + elif alnRight: + sAlign |= self.A_RIGHT if indLeft: - textAlign |= self.A_IND_L + sAlign |= self.A_IND_L if indRight: - textAlign |= self.A_IND_R + sAlign |= self.A_IND_R # Otherwise we use RegEx to find formatting tags within a line of text fmtPos = [] @@ -499,14 +561,18 @@ class Tokenizer(): # sorted by position fmtPos = sorted(fmtPos, key=itemgetter(0)) self.theTokens.append(( - self.T_TEXT, nLine, aLine, fmtPos, textAlign + self.T_TEXT, nLine, aLine, fmtPos, sAlign )) if self.keepMarkdown: tmpMarkdown.append("%s\n" % aLine) - # Always add an empty line at the end + # If we have content, turn off the first page flag + if self.isFirst and self.theTokens: + self.isFirst = False + + # Always add an empty line at the end of the file self.theTokens.append(( - self.T_EMPTY, nLine, "", None, defAlign + self.T_EMPTY, nLine, "", None, self.A_NONE )) if self.keepMarkdown: tmpMarkdown.append("\n") @@ -518,8 +584,8 @@ class Tokenizer(): # =========== # Some items need a second pass - pToken = (self.T_EMPTY, 0, "", None, defAlign) - nToken = (self.T_EMPTY, 0, "", None, defAlign) + pToken = (self.T_EMPTY, 0, "", None, self.A_NONE) + nToken = (self.T_EMPTY, 0, "", None, self.A_NONE) tCount = len(self.theTokens) for n, tToken in enumerate(self.theTokens): @@ -541,148 +607,104 @@ class Tokenizer(): return def doHeaders(self): - """Apply formatting to the text headers according to document - layout and user settings. + """Apply formatting to the text headers for novel files. This + also applies chapter and scene numbering. """ - # No special header formatting for notes and no-layout files - if self.isNone or self.isNote: + if not self.isNovel: return False - # For novel files, we need to handle chapter numbering, scene - # numbering, and scene breaks - if self.isNovel: - for n, tToken in enumerate(self.theTokens): + for n, tToken in enumerate(self.theTokens): - # In case we see text before a scene, we reset the flag - if tToken[0] == self.T_TEXT: - self.firstScene = False + # In case we see text before a scene, we reset the flag + if tToken[0] == self.T_TEXT: + self.firstScene = False - elif tToken[0] == self.T_HEAD1: - # Main Title - # ========== + elif tToken[0] == self.T_HEAD1: + # Partition - tTemp = self._formatHeading(self.fmtTitle, tToken[2]) + tTemp = self._formatHeading(self.fmtTitle, tToken[2]) + self.theTokens[n] = ( + tToken[0], tToken[1], tTemp, None, tToken[4] + ) + + elif tToken[0] in (self.T_HEAD2, self.T_UNNUM): + # Chapter + + # Numbered or Unnumbered + if tToken[2].startswith("*"): + tTemp = self._formatHeading(self.fmtUnNum, tToken[2][1:].lstrip()) + elif tToken[0] == self.T_UNNUM: + tTemp = self._formatHeading(self.fmtUnNum, tToken[2]) + else: + self.numChapter += 1 + tTemp = self._formatHeading(self.fmtChapter, tToken[2]) + + # Format the chapter header + self.theTokens[n] = ( + tToken[0], tToken[1], tTemp, None, tToken[4] + ) + + # Set scene variables + self.firstScene = True + self.numChScene = 0 + + elif tToken[0] == self.T_HEAD3: + # Scene + + self.numChScene += 1 + self.numAbsScene += 1 + + tTemp = self._formatHeading(self.fmtScene, tToken[2]) + if tTemp == "" and self.hideScene: + self.theTokens[n] = ( + self.T_EMPTY, tToken[1], "", None, self.A_NONE + ) + elif tTemp == "" and not self.hideScene: + if self.firstScene: + self.theTokens[n] = ( + self.T_EMPTY, tToken[1], "", None, self.A_NONE + ) + else: + self.theTokens[n] = ( + self.T_SKIP, tToken[1], "", None, self.A_NONE + ) + elif tTemp == self.fmtScene: + if self.firstScene: + self.theTokens[n] = ( + self.T_EMPTY, tToken[1], "", None, self.A_NONE + ) + else: + self.theTokens[n] = ( + self.T_SEP, tToken[1], tTemp, None, self.A_CENTRE + ) + else: self.theTokens[n] = ( tToken[0], tToken[1], tTemp, None, self.A_NONE ) - elif tToken[0] == self.T_HEAD2: - # Novel Chapter - # ============= + # Definitely no longer the first scene + self.firstScene = False - # Numbered or Unnumbered - if self.isUnNum: - tTemp = self._formatHeading(self.fmtUnNum, tToken[2]) - elif tToken[2].startswith("*"): - tTemp = self._formatHeading(self.fmtUnNum, tToken[2][1:].lstrip()) - else: - self.numChapter += 1 - tTemp = self._formatHeading(self.fmtChapter, tToken[2]) + elif tToken[0] == self.T_HEAD4: + # Section - # Format the chapter header + tTemp = self._formatHeading(self.fmtSection, tToken[2]) + if tTemp == "" and self.hideSection: self.theTokens[n] = ( - tToken[0], tToken[1], tTemp, None, self.A_PBB + self.T_EMPTY, tToken[1], "", None, self.A_NONE + ) + elif tTemp == "" and not self.hideSection: + self.theTokens[n] = ( + self.T_SKIP, tToken[1], "", None, self.A_NONE + ) + elif tTemp == self.fmtSection: + self.theTokens[n] = ( + self.T_SEP, tToken[1], tTemp, None, self.A_CENTRE + ) + else: + self.theTokens[n] = ( + tToken[0], tToken[1], tTemp, None, self.A_NONE ) - - # Set scene variables - self.firstScene = True - self.numChScene = 0 - - elif tToken[0] == self.T_HEAD3: - # Novel Scene - # =========== - - self.numChScene += 1 - self.numAbsScene += 1 - - tTemp = self._formatHeading(self.fmtScene, tToken[2]) - if tTemp == "" and self.hideScene: - self.theTokens[n] = ( - self.T_EMPTY, tToken[1], "", None, self.A_NONE - ) - elif tTemp == "" and not self.hideScene: - if self.firstScene: - self.theTokens[n] = ( - self.T_EMPTY, tToken[1], "", None, self.A_NONE - ) - else: - self.theTokens[n] = ( - self.T_SKIP, tToken[1], "", None, self.A_NONE - ) - elif tTemp == self.fmtScene: - if self.firstScene: - self.theTokens[n] = ( - self.T_EMPTY, tToken[1], "", None, self.A_NONE - ) - else: - self.theTokens[n] = ( - self.T_SEP, tToken[1], tTemp, None, self.A_CENTRE - ) - else: - self.theTokens[n] = ( - tToken[0], tToken[1], tTemp, None, self.A_NONE - ) - - # Definitely no longer the first scene - self.firstScene = False - - elif tToken[0] == self.T_HEAD4: - # Novel Section - # ============= - - tTemp = self._formatHeading(self.fmtSection, tToken[2]) - if tTemp == "" and self.hideSection: - self.theTokens[n] = ( - self.T_EMPTY, tToken[1], "", None, self.A_NONE - ) - elif tTemp == "" and not self.hideSection: - self.theTokens[n] = ( - self.T_SKIP, tToken[1], "", None, self.A_NONE - ) - elif tTemp == self.fmtSection: - self.theTokens[n] = ( - self.T_SEP, tToken[1], tTemp, None, self.A_CENTRE - ) - else: - self.theTokens[n] = ( - tToken[0], tToken[1], tTemp, None, self.A_NONE - ) - - # For title page we use a different title class, and we will set - # an automatic page break before (i.e. added if needed). For - # partitions we always need a page break before. - if self.isTitle or self.isPart: - for n, tToken in enumerate(self.theTokens): - aStyle = tToken[4] - if n == 0: - if self.isTitle: - aStyle |= self.A_PBB_AUT - else: - aStyle |= self.A_PBB - - if tToken[0] == self.T_HEAD1: - if self.isTitle: - self.theTokens[n] = ( - self.T_TITLE, tToken[1], tToken[2], tToken[3], aStyle - ) - else: - self.theTokens[n] = ( - tToken[0], tToken[1], tToken[2], tToken[3], aStyle - ) - - # Add a page break after the last entry - if len(self.theTokens) > 0: - tToken = self.theTokens[-1] - self.theTokens[-1] = ( - tToken[0], tToken[1], tToken[2], tToken[3], tToken[4] | self.A_PBA - ) - - # A single page always starts on a fresh page, unless it's empty. - if self.isPage and len(self.theTokens) > 0: - tToken = self.theTokens[0] - self.theTokens[0] = ( - tToken[0], tToken[1], tToken[2], tToken[3], tToken[4] | self.A_PBB - ) return True diff --git a/nw/core/tomd.py b/nw/core/tomd.py index 896f17d5..e27fef0b 100644 --- a/nw/core/tomd.py +++ b/nw/core/tomd.py @@ -108,6 +108,10 @@ class ToMarkdown(Tokenizer): tHead = tText.replace(r"\\", "\n") tmpResult.append("# %s\n\n" % tHead) + elif tType == self.T_UNNUM: + tHead = tText.replace(r"\\", "\n") + tmpResult.append("## %s\n\n" % tHead) + elif tType == self.T_HEAD1: tHead = tText.replace(r"\\", "\n") tmpResult.append("# %s\n\n" % tHead) diff --git a/nw/core/toodt.py b/nw/core/toodt.py index fe417371..58919b30 100644 --- a/nw/core/toodt.py +++ b/nw/core/toodt.py @@ -345,13 +345,9 @@ class ToOdt(Tokenizer): if tStyle & self.A_PBB: oStyle.setBreakBefore("page") - elif tStyle & self.A_PBB_AUT: - oStyle.setBreakBefore("auto") if tStyle & self.A_PBA: oStyle.setBreakAfter("page") - elif tStyle & self.A_PBA_AUT: - oStyle.setBreakAfter("auto") if tStyle & self.A_Z_BTMMRG: oStyle.setMarginBottom("0.000cm") @@ -384,6 +380,10 @@ class ToOdt(Tokenizer): tHead = tText.replace(r"\\", "\n") self._addTextPar("Title", oStyle, tHead, isHead=True) + elif tType == self.T_UNNUM: + tHead = tText.replace(r"\\", "\n") + self._addTextPar("Heading_2", oStyle, tHead, isHead=True, oLevel="2") + elif tType == self.T_HEAD1: tHead = tText.replace(r"\\", "\n") self._addTextPar("Heading_1", oStyle, tHead, isHead=True, oLevel="1") diff --git a/nw/core/tree.py b/nw/core/tree.py index ebf91d77..a9d77496 100644 --- a/nw/core/tree.py +++ b/nw/core/tree.py @@ -33,34 +33,11 @@ from hashlib import sha256 from nw.enum import nwItemType, nwItemClass, nwItemLayout from nw.common import checkHandle -from nw.constants import nwConst, nwLists, nwFiles +from nw.constants import nwConst, nwFiles from nw.core.item import NWItem logger = logging.getLogger(__name__) -# Layout Translation Map -LAYOUT_MAP = { - nwItemLayout.SCENE: { - "H1": nwItemLayout.BOOK, - "H2": nwItemLayout.CHAPTER, - }, - nwItemLayout.CHAPTER: { - "H1": nwItemLayout.BOOK, - "H3": nwItemLayout.SCENE, - "H4": nwItemLayout.SCENE, - }, - nwItemLayout.UNNUMBERED: { - "H1": nwItemLayout.BOOK, - "H3": nwItemLayout.SCENE, - "H4": nwItemLayout.SCENE, - }, - nwItemLayout.PARTITION: { - "H2": nwItemLayout.CHAPTER, - "H3": nwItemLayout.SCENE, - "H4": nwItemLayout.SCENE, - }, -} - class NWTree(): @@ -229,30 +206,6 @@ class NWTree(): novelWords += tItem.wordCount return novelWords, noteWords - def updateItemLayout(self, tHandle, hLevel): - """Check if the item layout needs updating based on the header - given level. - """ - tItem = self.__getitem__(tHandle) - if tItem is None: - return False - if tItem.itemClass not in nwLists.CLS_NOVEL: - return False - if hLevel not in ("H1", "H2", "H3", "H4"): - return False - - iLayout = tItem.itemLayout - if iLayout in LAYOUT_MAP: - if hLevel in LAYOUT_MAP[iLayout]: - tItem.itemLayout = LAYOUT_MAP[iLayout][hLevel] - logger.debug( - "Changed layout for %s from %s to %s", - tHandle, iLayout.name, tItem.itemLayout.name - ) - return True - - return False - ## # Tree Structure Methods ## diff --git a/nw/dialogs/docsplit.py b/nw/dialogs/docsplit.py index c6a57466..5978fc7d 100644 --- a/nw/dialogs/docsplit.py +++ b/nw/dialogs/docsplit.py @@ -196,16 +196,10 @@ class GuiDocSplit(QDialog): # Loop through, and create the files for wTitle, iStart, iEnd in finalOrder: - itemLayout = nwItemLayout.NOTE if srcItem.itemClass == nwItemClass.NOVEL: - if wTitle.startswith("# "): - itemLayout = nwItemLayout.PARTITION - elif wTitle.startswith("## "): - itemLayout = nwItemLayout.CHAPTER - elif wTitle.startswith("### "): - itemLayout = nwItemLayout.SCENE - elif wTitle.startswith("#### "): - itemLayout = nwItemLayout.SCENE + itemLayout = nwItemLayout.DOCUMENT + else: + itemLayout = nwItemLayout.NOTE wTitle = wTitle.lstrip("#") wTitle = wTitle.strip() diff --git a/nw/dialogs/itemeditor.py b/nw/dialogs/itemeditor.py index 46258a82..0b4a514d 100644 --- a/nw/dialogs/itemeditor.py +++ b/nw/dialogs/itemeditor.py @@ -90,13 +90,7 @@ class GuiItemEditor(QDialog): validLayouts = [] if self.theItem.itemType == nwItemType.FILE: if self.theItem.itemClass in nwLists.CLS_NOVEL: - validLayouts.append(nwItemLayout.TITLE) - validLayouts.append(nwItemLayout.BOOK) - validLayouts.append(nwItemLayout.PAGE) - validLayouts.append(nwItemLayout.PARTITION) - validLayouts.append(nwItemLayout.UNNUMBERED) - validLayouts.append(nwItemLayout.CHAPTER) - validLayouts.append(nwItemLayout.SCENE) + validLayouts.append(nwItemLayout.DOCUMENT) validLayouts.append(nwItemLayout.NOTE) else: validLayouts.append(nwItemLayout.NO_LAYOUT) diff --git a/nw/enum.py b/nw/enum.py index 0e22315e..b60f849e 100644 --- a/nw/enum.py +++ b/nw/enum.py @@ -56,15 +56,9 @@ class nwItemClass(Enum): class nwItemLayout(Enum): - NO_LAYOUT = 0 - TITLE = 1 - BOOK = 2 - PAGE = 3 - PARTITION = 4 - UNNUMBERED = 5 - CHAPTER = 6 - SCENE = 7 - NOTE = 8 + NO_LAYOUT = 0 + DOCUMENT = 1 + NOTE = 2 # END Enum nwItemLayout diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index fdcba9b8..dea21b8e 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -468,14 +468,14 @@ class GuiDocEditor(QTextEdit): else: self.theParent.novelView.updateWordCounts(tHandle) - hLevel = "H0" - if self._docHeaders: - hLevel = self._docHeaders[0][1] + # hLevel = "H0" + # if self._docHeaders: + # hLevel = self._docHeaders[0][1] - if self.theProject.projTree.updateItemLayout(tHandle, hLevel): - self.theParent.treeView.setTreeItemValues(tHandle) - self._nwDocument.writeDocument(docText) - self.docFooter.updateInfo() + # if self.theProject.projTree.updateItemLayout(tHandle, hLevel): + # self.theParent.treeView.setTreeItemValues(tHandle) + # self._nwDocument.writeDocument(docText) + # self.docFooter.updateInfo() # Update the status bar self.theParent.setStatus( diff --git a/nw/gui/dochighlight.py b/nw/gui/dochighlight.py index 628f9511..94fd6837 100644 --- a/nw/gui/dochighlight.py +++ b/nw/gui/dochighlight.py @@ -34,6 +34,7 @@ from PyQt5.QtGui import ( ) from nw.constants import nwRegEx, nwUnicode +from nw.common import checkInt logger = logging.getLogger(__name__) @@ -127,6 +128,8 @@ class GuiDocHighlighter(QSyntaxHighlighter): "keyword": self._makeFormat(self.colKey), "modifier": self._makeFormat(self.colMod), "value": self._makeFormat(self.colVal, "underline"), + "codevalue": self._makeFormat(self.colVal), + "codeinval": self._makeFormat(None, "errline"), } self.hRules = [] @@ -312,25 +315,32 @@ class GuiDocHighlighter(QSyntaxHighlighter): # so we force a return here return - elif theText.startswith("# "): # Header 1 + elif theText.startswith(("# ", "#! ", "## ", "##! ", "### ", "#### ")): self.setCurrentBlockState(self.BLOCK_TITLE) - self.setFormat(0, 1, self.hStyles["header1h"]) - self.setFormat(1, len(theText), self.hStyles["header1"]) - elif theText.startswith("## "): # Header 2 - self.setCurrentBlockState(self.BLOCK_TITLE) - self.setFormat(0, 2, self.hStyles["header2h"]) - self.setFormat(2, len(theText), self.hStyles["header2"]) + if theText.startswith("# "): # Header 1 + self.setFormat(0, 1, self.hStyles["header1h"]) + self.setFormat(1, len(theText), self.hStyles["header1"]) - elif theText.startswith("### "): # Header 3 - self.setCurrentBlockState(self.BLOCK_TITLE) - self.setFormat(0, 3, self.hStyles["header3h"]) - self.setFormat(3, len(theText), self.hStyles["header3"]) + elif theText.startswith("## "): # Header 2 + self.setFormat(0, 2, self.hStyles["header2h"]) + self.setFormat(2, len(theText), self.hStyles["header2"]) - elif theText.startswith("#### "): # Header 4 - self.setCurrentBlockState(self.BLOCK_TITLE) - self.setFormat(0, 4, self.hStyles["header4h"]) - self.setFormat(4, len(theText), self.hStyles["header4"]) + elif theText.startswith("### "): # Header 3 + self.setFormat(0, 3, self.hStyles["header3h"]) + self.setFormat(3, len(theText), self.hStyles["header3"]) + + elif theText.startswith("#### "): # Header 4 + self.setFormat(0, 4, self.hStyles["header4h"]) + self.setFormat(4, len(theText), self.hStyles["header4"]) + + if theText.startswith("#! "): # Title + self.setFormat(0, 2, self.hStyles["header1h"]) + self.setFormat(2, len(theText), self.hStyles["header1"]) + + elif theText.startswith("##! "): # Unnumbered + self.setFormat(0, 3, self.hStyles["header2h"]) + self.setFormat(3, len(theText), self.hStyles["header2"]) elif theText.startswith("%"): # Comments self.setCurrentBlockState(self.BLOCK_TEXT) @@ -346,6 +356,25 @@ class GuiDocHighlighter(QSyntaxHighlighter): self.setFormat(0, tLen, self.hStyles["hidden"]) else: # Text Paragraph + + if theText.startswith("["): # Special Command + sText = theText.rstrip() + if sText in ("[NEWPAGE]", "[NEW PAGE]", "[VSPACE]"): + self.setFormat(0, len(theText), self.hStyles["keyword"]) + return + + elif sText.startswith("[VSPACE:") and sText.endswith("]"): + tLen = len(sText) + tVal = checkInt(sText[8:-1], 0) + self.setFormat(0, 8, self.hStyles["keyword"]) + if tVal > 0: + self.setFormat(8, tLen-9, self.hStyles["codevalue"]) + else: + self.setFormat(8, tLen-9, self.hStyles["codeinval"]) + self.setFormat(tLen-1, tLen, self.hStyles["keyword"]) + return + + # Regular text self.setCurrentBlockState(self.BLOCK_TEXT) for rX, xFmt in self.rxRules: rxItt = rX.globalMatch(theText, 0) diff --git a/nw/gui/docviewer.py b/nw/gui/docviewer.py index ddfe9b32..e45d7627 100644 --- a/nw/gui/docviewer.py +++ b/nw/gui/docviewer.py @@ -187,6 +187,7 @@ class GuiDocViewer(QTextBrowser): logger.error("Failed to generate preview for document with handle '%s'", tHandle) nw.logException() self.setText(self.tr("An error occurred while generating the preview.")) + return False # Refresh the tab stops if self.mainConf.verQtValue >= 51000: @@ -208,7 +209,9 @@ class GuiDocViewer(QTextBrowser): theCursor.insertText("\t") if self._docHandle == tHandle: + # This is a refresh, so we set the scrollbar back to where it was self.verticalScrollBar().setValue(sPos) + self._docHandle = tHandle self.theProject.setLastViewed(tHandle) self.docHeader.setTitleFromHandle(self._docHandle) @@ -539,6 +542,9 @@ class GuiDocViewer(QTextBrowser): ".synopsis {{" " color: rgb({mColR}, {mColG}, {mColB});" "}}\n" + ".title {{" + " text-align: center;" + "}}\n" ).format( tColR=self.theTheme.colText[0], tColG=self.theTheme.colText[1], diff --git a/nw/gui/projtree.py b/nw/gui/projtree.py index a5ad0e04..3d386dc3 100644 --- a/nw/gui/projtree.py +++ b/nw/gui/projtree.py @@ -292,11 +292,7 @@ class GuiProjectTree(QTreeWidget): curTxt = "" if curTxt == "": - if nwItem.itemLayout == nwItemLayout.CHAPTER: - newText = f"## {nwItem.itemName}\n\n" - elif nwItem.itemLayout == nwItemLayout.UNNUMBERED: - newText = f"## {nwItem.itemName}\n\n" - elif nwItem.itemLayout == nwItemLayout.SCENE: + if nwItem.itemLayout == nwItemLayout.DOCUMENT: newText = f"### {nwItem.itemName}\n\n" else: newText = f"# {nwItem.itemName}\n\n" diff --git a/pytest.ini b/pytest.ini index 1aa491bd..641984a8 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,7 +1,8 @@ [pytest] +log_level = DEBUG +qt_api = pyqt5 markers = base: Base classes tests core: Core classes tests gui: Qt5 GUI tests serial -qt_api = pyqt5 diff --git a/sample/content/53b69b83cdafc.nwd b/sample/content/53b69b83cdafc.nwd index 82e4361c..54fd6a26 100644 --- a/sample/content/53b69b83cdafc.nwd +++ b/sample/content/53b69b83cdafc.nwd @@ -1,10 +1,9 @@ %%~name: Title Page %%~path: 7031beac91f75/53b69b83cdafc -%%~kind: NOVEL/TITLE -# My Novel +%%~kind: NOVEL/DOCUMENT +#! My Novel -**By Jane Doh** +>> **By Jane Doh** << -It’s also possible to add some text on this page. Everything on Title and Partition pages is by default centred, but this can be overridden on individual paragraphs. - -For instance, the text can be left-aligned like this. << +>> This is the title page. << +>> It should be the first document of the project. << \ No newline at end of file diff --git a/sample/content/636b6aa9b697b.nwd b/sample/content/636b6aa9b697b.nwd index 9db44eec..8fe96042 100644 --- a/sample/content/636b6aa9b697b.nwd +++ b/sample/content/636b6aa9b697b.nwd @@ -1,6 +1,6 @@ %%~name: Making a Scene %%~path: e7ded148d6e4a/636b6aa9b697b -%%~kind: NOVEL/SCENE +%%~kind: NOVEL/DOCUMENT ### Making a Scene @pov: Jane diff --git a/sample/content/6a2d6d5f4f401.nwd b/sample/content/6a2d6d5f4f401.nwd index 172774d5..60d8d2a0 100644 --- a/sample/content/6a2d6d5f4f401.nwd +++ b/sample/content/6a2d6d5f4f401.nwd @@ -1,6 +1,6 @@ %%~name: Chapter One %%~path: e7ded148d6e4a/6a2d6d5f4f401 -%%~kind: NOVEL/CHAPTER +%%~kind: NOVEL/DOCUMENT ## So it Begins @pov: Jane diff --git a/sample/content/88706ddc78b1b.nwd b/sample/content/88706ddc78b1b.nwd index fbb5794a..ce4d2123 100644 --- a/sample/content/88706ddc78b1b.nwd +++ b/sample/content/88706ddc78b1b.nwd @@ -1,6 +1,6 @@ %%~name: Chapter Two %%~path: e7ded148d6e4a/88706ddc78b1b -%%~kind: NOVEL/CHAPTER +%%~kind: NOVEL/DOCUMENT ## Where has John Gone? @pov: Jane diff --git a/sample/content/8a5deb88c0e97.nwd b/sample/content/8a5deb88c0e97.nwd index bc504b02..bc94c4c5 100644 --- a/sample/content/8a5deb88c0e97.nwd +++ b/sample/content/8a5deb88c0e97.nwd @@ -1,6 +1,6 @@ %%~name: Old File %%~path: ae9bf3c3ea159/8a5deb88c0e97 -%%~kind: NOVEL/SCENE +%%~kind: NOVEL/DOCUMENT ### Discarded Scene If you have files you no longer want in your main project, you can move them to the “Outtakes” folder. This is equivalent to turning off the “Include when building project” switch, just that you also put the file away, although the switch can be ignored when building the project, this folder cannot. diff --git a/sample/content/974e400180a99.nwd b/sample/content/974e400180a99.nwd index 885e2bbb..266563ae 100644 --- a/sample/content/974e400180a99.nwd +++ b/sample/content/974e400180a99.nwd @@ -1,6 +1,9 @@ %%~name: Page %%~path: 7031beac91f75/974e400180a99 -%%~kind: NOVEL/PAGE +%%~kind: NOVEL/DOCUMENT +[NEW PAGE] +[VSPACE:2] + This is a plain page with some text on it. -Text on plain pages will always start on a fresh page when the project is exported. +If you want the text to start on a fresh page, add the [NEW PAGE] code above the text. You can also add empty paragraphs with the ]VSPACE] code. diff --git a/sample/content/ae7339df26ded.nwd b/sample/content/ae7339df26ded.nwd index 0443184e..9b135713 100644 --- a/sample/content/ae7339df26ded.nwd +++ b/sample/content/ae7339df26ded.nwd @@ -1,6 +1,6 @@ %%~name: We Found John! %%~path: e7ded148d6e4a/ae7339df26ded -%%~kind: NOVEL/SCENE +%%~kind: NOVEL/DOCUMENT ### We Found John! @pov: John diff --git a/sample/content/b8136a5a774a0.nwd b/sample/content/b8136a5a774a0.nwd index 8badd9bb..3c2c1854 100644 --- a/sample/content/b8136a5a774a0.nwd +++ b/sample/content/b8136a5a774a0.nwd @@ -1,6 +1,6 @@ %%~name: Delete Me! %%~path: 98acd8c76c93a/b8136a5a774a0 -%%~kind: NOVEL/SCENE +%%~kind: NOVEL/DOCUMENT ### Delete Me! This scene is trash. \ No newline at end of file diff --git a/sample/content/ba8a28a246524.nwd b/sample/content/ba8a28a246524.nwd index 55e1b507..cd684e19 100644 --- a/sample/content/ba8a28a246524.nwd +++ b/sample/content/ba8a28a246524.nwd @@ -1,7 +1,7 @@ %%~name: Interlude %%~path: e7ded148d6e4a/ba8a28a246524 -%%~kind: NOVEL/UNNUMBERED -## Interlude +%%~kind: NOVEL/DOCUMENT +##! Interlude % Notice that this is a file with the flag ‘N.Un’. The ‘N’ means it’s a novel file, and the ‘Un’ means it’s an unnumbered chapter. Unnumbered chapters can be treated separately from numbered chapters during export. Perfect for when you want to add an interlude, or for a prologue or epilogue. diff --git a/sample/content/bc0cbd2a407f3.nwd b/sample/content/bc0cbd2a407f3.nwd index 80f75eef..3c95e8ff 100644 --- a/sample/content/bc0cbd2a407f3.nwd +++ b/sample/content/bc0cbd2a407f3.nwd @@ -1,6 +1,6 @@ %%~name: Another Scene %%~path: e7ded148d6e4a/bc0cbd2a407f3 -%%~kind: NOVEL/SCENE +%%~kind: NOVEL/DOCUMENT ### Another Scene @pov: John diff --git a/sample/content/edca4be2fcaf8.nwd b/sample/content/edca4be2fcaf8.nwd index 73271f7e..3028b3fd 100644 --- a/sample/content/edca4be2fcaf8.nwd +++ b/sample/content/edca4be2fcaf8.nwd @@ -1,6 +1,6 @@ %%~name: Part One %%~path: 7031beac91f75/edca4be2fcaf8 -%%~kind: NOVEL/PARTITION +%%~kind: NOVEL/DOCUMENT # Part One -In the beginning … \ No newline at end of file +>> In the beginning … << \ No newline at end of file diff --git a/sample/nwProject.nwx b/sample/nwProject.nwx index 81b82b5e..dd91533c 100644 --- a/sample/nwProject.nwx +++ b/sample/nwProject.nwx @@ -1,13 +1,13 @@ - + Sample Project Sample Project Jane Smith Jay Doh - 1110 - 189 - 53279 + 1136 + 194 + 54509 False @@ -17,8 +17,8 @@ True 636b6aa9b697b 636b6aa9b697b - 1216 - 840 + 1209 + 833 376 B @@ -62,11 +62,11 @@ NOVEL Started True - TITLE - 241 - 42 - 3 - 252 + DOCUMENT + 93 + 19 + 2 + 2 Page @@ -74,11 +74,11 @@ NOVEL New True - PAGE - 125 - 26 - 2 - 127 + DOCUMENT + 206 + 42 + 3 + 21 Part One @@ -86,11 +86,11 @@ NOVEL New True - PARTITION + DOCUMENT 26 6 1 - 30 + 33 A Folder @@ -105,7 +105,7 @@ NOVEL Notes True - CHAPTER + DOCUMENT 75 14 1 @@ -117,11 +117,11 @@ NOVEL 1st Draft True - SCENE + DOCUMENT 2429 432 14 - 1329 + 813 Another Scene @@ -129,7 +129,7 @@ NOVEL 1st Draft True - SCENE + DOCUMENT 476 93 3 @@ -141,11 +141,11 @@ NOVEL New True - UNNUMBERED - 617 + DOCUMENT + 618 101 3 - 1137 + 4 A Note on Structure @@ -165,7 +165,7 @@ NOVEL 1st Draft True - CHAPTER + DOCUMENT 139 28 1 @@ -177,7 +177,7 @@ NOVEL 1st Draft True - SCENE + DOCUMENT 189 37 1 @@ -268,14 +268,14 @@ Outtakes ROOT ARCHIVE - None + New True Scenes FOLDER ARCHIVE - None + New True @@ -284,7 +284,7 @@ NOVEL 1st Draft True - SCENE + DOCUMENT 315 55 1 @@ -303,7 +303,7 @@ NOVEL New True - SCENE + DOCUMENT 30 6 1 diff --git a/tests/conftest.py b/tests/conftest.py index a1e97928..6e3d50de 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -157,7 +157,6 @@ def nwGUI(qtbot, monkeypatch, fncDir, fncConf): nwGUI = nw.main(["--testmode", "--config=%s" % fncDir, "--data=%s" % fncDir]) qtbot.addWidget(nwGUI) nwGUI.show() - qtbot.waitForWindowShown(nwGUI) qtbot.wait(20) nwGUI.mainConf.lastPath = fncDir diff --git a/tests/lipsum/content/441420a886d82.nwd b/tests/lipsum/content/441420a886d82.nwd index 26237180..15eeb3d8 100644 --- a/tests/lipsum/content/441420a886d82.nwd +++ b/tests/lipsum/content/441420a886d82.nwd @@ -1,6 +1,6 @@ %%~name: Chapter Two %%~path: 6bd935d2490cd/441420a886d82 -%%~kind: NOVEL/CHAPTER +%%~kind: NOVEL/DOCUMENT ## Chapter Two @pov: Bod diff --git a/tests/lipsum/content/47666c91c7ccf.nwd b/tests/lipsum/content/47666c91c7ccf.nwd index 7ea17223..0d3692fb 100644 --- a/tests/lipsum/content/47666c91c7ccf.nwd +++ b/tests/lipsum/content/47666c91c7ccf.nwd @@ -1,6 +1,6 @@ %%~name: Scene Five %%~path: 6bd935d2490cd/47666c91c7ccf -%%~kind: NOVEL/SCENE +%%~kind: NOVEL/DOCUMENT ### Scene Five @pov: Bod diff --git a/tests/lipsum/content/7a992350f3eb6.nwd b/tests/lipsum/content/7a992350f3eb6.nwd index 6982e548..b8de881c 100644 --- a/tests/lipsum/content/7a992350f3eb6.nwd +++ b/tests/lipsum/content/7a992350f3eb6.nwd @@ -1,10 +1,10 @@ %%~name: Lorem Ipsum %%~path: b3643d0f92e32/7a992350f3eb6 -%%~kind: NOVEL/TITLE -# Lorem Ipsum +%%~kind: NOVEL/DOCUMENT +#! Lorem Ipsum -**By lipsum.com** +>> **By lipsum.com** << -“Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…” +>> “Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…” << -“There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…” +>> “There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…” << diff --git a/tests/lipsum/content/846352075de7d.nwd b/tests/lipsum/content/846352075de7d.nwd index d362ccc6..c181e0e9 100644 --- a/tests/lipsum/content/846352075de7d.nwd +++ b/tests/lipsum/content/846352075de7d.nwd @@ -1,7 +1,7 @@ %%~name: Interlude %%~path: b3643d0f92e32/846352075de7d -%%~kind: NOVEL/BOOK -## Why do we use it? +%%~kind: NOVEL/DOCUMENT +##! Why do we use it? % Exctracted from the lipsum.com website. diff --git a/tests/lipsum/content/88243afbe5ed8.nwd b/tests/lipsum/content/88243afbe5ed8.nwd index 426ffeba..63f376be 100644 --- a/tests/lipsum/content/88243afbe5ed8.nwd +++ b/tests/lipsum/content/88243afbe5ed8.nwd @@ -1,6 +1,6 @@ %%~name: Scene One %%~path: 45e6b01ca35c1/88243afbe5ed8 -%%~kind: NOVEL/SCENE +%%~kind: NOVEL/DOCUMENT ### Scene One @pov: Bod diff --git a/tests/lipsum/content/88d59a277361b.nwd b/tests/lipsum/content/88d59a277361b.nwd index 4d55bfda..af6b3a48 100644 --- a/tests/lipsum/content/88d59a277361b.nwd +++ b/tests/lipsum/content/88d59a277361b.nwd @@ -1,7 +1,7 @@ %%~name: Prologue %%~path: b3643d0f92e32/88d59a277361b -%%~kind: NOVEL/UNNUMBERED -## Prologue +%%~kind: NOVEL/DOCUMENT +##! Prologue % Synopsis:Explanation from the lipsum.com website. diff --git a/tests/lipsum/content/8c58a65414c23.nwd b/tests/lipsum/content/8c58a65414c23.nwd index 28e54bef..15140e3b 100644 --- a/tests/lipsum/content/8c58a65414c23.nwd +++ b/tests/lipsum/content/8c58a65414c23.nwd @@ -1,6 +1,8 @@ %%~name: Front Matter %%~path: b3643d0f92e32/8c58a65414c23 -%%~kind: NOVEL/PAGE +%%~kind: NOVEL/DOCUMENT +[NEW PAGE] + % Exctracted from the lipsum.com website. Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of “de Finibus Bonorum et Malorum” (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, “Lorem ipsum dolor sit amet..”, comes from a line in section 1.10.32. diff --git a/tests/lipsum/content/db7e733775d4d.nwd b/tests/lipsum/content/db7e733775d4d.nwd index d677152f..15678925 100644 --- a/tests/lipsum/content/db7e733775d4d.nwd +++ b/tests/lipsum/content/db7e733775d4d.nwd @@ -1,6 +1,6 @@ %%~name: Act One %%~path: b3643d0f92e32/db7e733775d4d -%%~kind: NOVEL/PARTITION +%%~kind: NOVEL/DOCUMENT # Act One -“Fusce maximus felis libero” \ No newline at end of file +>> “Fusce maximus felis libero” << \ No newline at end of file diff --git a/tests/lipsum/content/eb103bc70c90c.nwd b/tests/lipsum/content/eb103bc70c90c.nwd index 65ce7e49..ec090623 100644 --- a/tests/lipsum/content/eb103bc70c90c.nwd +++ b/tests/lipsum/content/eb103bc70c90c.nwd @@ -1,6 +1,6 @@ %%~name: Scene Three %%~path: 6bd935d2490cd/eb103bc70c90c -%%~kind: NOVEL/SCENE +%%~kind: NOVEL/DOCUMENT ### Scene Three @pov: Bod diff --git a/tests/lipsum/content/f8c0562e50f1b.nwd b/tests/lipsum/content/f8c0562e50f1b.nwd index f8218e1f..e61e52fe 100644 --- a/tests/lipsum/content/f8c0562e50f1b.nwd +++ b/tests/lipsum/content/f8c0562e50f1b.nwd @@ -1,6 +1,6 @@ %%~name: Scene Four %%~path: 6bd935d2490cd/f8c0562e50f1b -%%~kind: NOVEL/SCENE +%%~kind: NOVEL/DOCUMENT ### Scene Four @pov: Bod diff --git a/tests/lipsum/content/f96ec11c6a3da.nwd b/tests/lipsum/content/f96ec11c6a3da.nwd index 60853dc2..e7fb3054 100644 --- a/tests/lipsum/content/f96ec11c6a3da.nwd +++ b/tests/lipsum/content/f96ec11c6a3da.nwd @@ -1,6 +1,6 @@ %%~name: Scene Two %%~path: 45e6b01ca35c1/f96ec11c6a3da -%%~kind: NOVEL/SCENE +%%~kind: NOVEL/DOCUMENT ### Scene Two @pov: Bod diff --git a/tests/lipsum/content/fb609cd8319dc.nwd b/tests/lipsum/content/fb609cd8319dc.nwd index ff48ad12..394d4bbc 100644 --- a/tests/lipsum/content/fb609cd8319dc.nwd +++ b/tests/lipsum/content/fb609cd8319dc.nwd @@ -1,6 +1,6 @@ %%~name: Chapter One %%~path: 45e6b01ca35c1/fb609cd8319dc -%%~kind: NOVEL/CHAPTER +%%~kind: NOVEL/DOCUMENT ## Chapter One @pov: Bod diff --git a/tests/lipsum/nwProject.nwx b/tests/lipsum/nwProject.nwx index 59aee52f..df7345d7 100644 --- a/tests/lipsum/nwProject.nwx +++ b/tests/lipsum/nwProject.nwx @@ -1,12 +1,12 @@ - + Lorem Ipsum Lorem Ipsum lipsum.com - 10 - 22 - 1571 + 17 + 24 + 1777 False @@ -14,7 +14,7 @@ False None True - 04468803b92e1 + 7a992350f3eb6 None 3847 3109 @@ -57,11 +57,11 @@ NOVEL Finished True - TITLE + DOCUMENT 230 40 3 - 239 + 148 Front Matter @@ -69,7 +69,7 @@ NOVEL Finished True - PAGE + DOCUMENT 1058 176 2 @@ -81,11 +81,11 @@ NOVEL Draft True - UNNUMBERED + DOCUMENT 584 92 1 - 79 + 4 Act One @@ -93,11 +93,11 @@ NOVEL New True - PARTITION + DOCUMENT 35 6 1 - 39 + 42 Chapter One @@ -112,7 +112,7 @@ NOVEL Draft True - CHAPTER + DOCUMENT 419 67 1 @@ -124,7 +124,7 @@ NOVEL Finished True - SCENE + DOCUMENT 2758 404 4 @@ -136,7 +136,7 @@ NOVEL Finished True - SCENE + DOCUMENT 4043 600 6 @@ -148,7 +148,7 @@ NOVEL New False - BOOK + DOCUMENT 631 109 3 @@ -167,7 +167,7 @@ NOVEL Draft True - CHAPTER + DOCUMENT 477 70 1 @@ -179,7 +179,7 @@ NOVEL Finished True - SCENE + DOCUMENT 3006 439 4 @@ -191,7 +191,7 @@ NOVEL Finished True - SCENE + DOCUMENT 3839 563 6 @@ -203,7 +203,7 @@ NOVEL Finished True - SCENE + DOCUMENT 3644 543 5 diff --git a/tests/minimal/content/8c659a11cd429.nwd b/tests/minimal/content/8c659a11cd429.nwd index bdb8079f..2d7072eb 100644 --- a/tests/minimal/content/8c659a11cd429.nwd +++ b/tests/minimal/content/8c659a11cd429.nwd @@ -1,5 +1,5 @@ %%~name: New Scene %%~path: a6d311a93600a/8c659a11cd429 -%%~kind: NOVEL/SCENE +%%~kind: NOVEL/DOCUMENT ### New Scene diff --git a/tests/minimal/content/a35baf2e93843.nwd b/tests/minimal/content/a35baf2e93843.nwd index a1120152..b328746c 100644 --- a/tests/minimal/content/a35baf2e93843.nwd +++ b/tests/minimal/content/a35baf2e93843.nwd @@ -1,6 +1,6 @@ %%~name: Title Page %%~path: a508bb932959c/a35baf2e93843 -%%~kind: NOVEL/TITLE -# Minimal +%%~kind: NOVEL/DOCUMENT +#! Minimal -By Jane Doe, John Doh +>> By Jane Doe, John Doh << diff --git a/tests/minimal/content/f5ab3e30151e1.nwd b/tests/minimal/content/f5ab3e30151e1.nwd index f08335a0..b4bbf9c6 100644 --- a/tests/minimal/content/f5ab3e30151e1.nwd +++ b/tests/minimal/content/f5ab3e30151e1.nwd @@ -1,5 +1,5 @@ %%~name: New Chapter %%~path: a6d311a93600a/f5ab3e30151e1 -%%~kind: NOVEL/CHAPTER +%%~kind: NOVEL/DOCUMENT ## New Chapter diff --git a/tests/minimal/nwProject.nwx b/tests/minimal/nwProject.nwx index 2ce2a162..664e4372 100644 --- a/tests/minimal/nwProject.nwx +++ b/tests/minimal/nwProject.nwx @@ -1,13 +1,13 @@ - + Test Minimal Minimal Jane Doe John Doh - 3 - 1 - 33 + 9 + 2 + 113 True @@ -47,7 +47,7 @@ ROOT NOVEL New - False + True Title Page @@ -55,7 +55,7 @@ NOVEL New True - TITLE + DOCUMENT 28 6 1 @@ -66,7 +66,7 @@ FOLDER NOVEL New - False + True New Chapter @@ -74,7 +74,7 @@ NOVEL New True - CHAPTER + DOCUMENT 11 2 0 @@ -86,7 +86,7 @@ NOVEL New True - SCENE + DOCUMENT 9 2 0 diff --git a/tests/mock.py b/tests/mock.py index c87a95ad..22f381b9 100644 --- a/tests/mock.py +++ b/tests/mock.py @@ -36,6 +36,7 @@ class MockGuiMain(): # Test Variables self.askResponse = True self.lastAlert = "" + self.lastQuestion = ("", "") return @@ -50,6 +51,7 @@ class MockGuiMain(): def askQuestion(self, theTitle, theQustion): print("Question: %s" % theQustion) + self.lastQuestion = (theTitle, theQustion) return self.askResponse def setStatus(self, theMessage): diff --git a/tests/reference/coreIndex_LoadSave_tagsIndex.json b/tests/reference/coreIndex_LoadSave_tagsIndex.json index 53c27096..d1745d20 100644 --- a/tests/reference/coreIndex_LoadSave_tagsIndex.json +++ b/tests/reference/coreIndex_LoadSave_tagsIndex.json @@ -32,42 +32,42 @@ }, "fileIndex": { "7a992350f3eb6": { - "T000001": {"level": "H1", "title": "Lorem Ipsum", "layout": "TITLE", "cCount": 230, "wCount": 40, "pCount": 3, "synopsis": ""} + "T000001": {"level": "H1", "title": "Lorem Ipsum", "layout": "DOCUMENT", "cCount": 230, "wCount": 40, "pCount": 3, "synopsis": ""} }, "8c58a65414c23": { - "T000000": {"level": "H0", "title": "", "layout": "PAGE", "cCount": 1058, "wCount": 176, "pCount": 2, "synopsis": ""} + "T000000": {"level": "H0", "title": "", "layout": "DOCUMENT", "cCount": 1058, "wCount": 176, "pCount": 2, "synopsis": ""} }, "88d59a277361b": { - "T000001": {"level": "H2", "title": "Prologue", "layout": "UNNUMBERED", "cCount": 584, "wCount": 92, "pCount": 1, "synopsis": "Explanation from the lipsum.com website."} + "T000001": {"level": "H2", "title": "Prologue", "layout": "DOCUMENT", "cCount": 584, "wCount": 92, "pCount": 1, "synopsis": "Explanation from the lipsum.com website."} }, "db7e733775d4d": { - "T000001": {"level": "H1", "title": "Act One", "layout": "PARTITION", "cCount": 35, "wCount": 6, "pCount": 1, "synopsis": ""} + "T000001": {"level": "H1", "title": "Act One", "layout": "DOCUMENT", "cCount": 35, "wCount": 6, "pCount": 1, "synopsis": ""} }, "fb609cd8319dc": { - "T000001": {"level": "H2", "title": "Chapter One", "layout": "CHAPTER", "cCount": 419, "wCount": 67, "pCount": 1, "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque at aliquam quam."} + "T000001": {"level": "H2", "title": "Chapter One", "layout": "DOCUMENT", "cCount": 419, "wCount": 67, "pCount": 1, "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque at aliquam quam."} }, "88243afbe5ed8": { - "T000001": {"level": "H3", "title": "Scene One", "layout": "SCENE", "cCount": 1197, "wCount": 174, "pCount": 2, "synopsis": "Aenean ut placerat velit. Etiam laoreet ullamcorper risus, eget lobortis enim scelerisque non. Suspendisse id maximus nunc, et mollis sapien. Curabitur vel semper sapien, non pulvinar dolor. Etiam finibus nisi vel mi molestie consectetur."}, - "T000013": {"level": "H4", "title": "Scene One, Section Two", "layout": "SCENE", "cCount": 1561, "wCount": 230, "pCount": 2, "synopsis": ""} + "T000001": {"level": "H3", "title": "Scene One", "layout": "DOCUMENT", "cCount": 1197, "wCount": 174, "pCount": 2, "synopsis": "Aenean ut placerat velit. Etiam laoreet ullamcorper risus, eget lobortis enim scelerisque non. Suspendisse id maximus nunc, et mollis sapien. Curabitur vel semper sapien, non pulvinar dolor. Etiam finibus nisi vel mi molestie consectetur."}, + "T000013": {"level": "H4", "title": "Scene One, Section Two", "layout": "DOCUMENT", "cCount": 1561, "wCount": 230, "pCount": 2, "synopsis": ""} }, "f96ec11c6a3da": { - "T000001": {"level": "H3", "title": "Scene Two", "layout": "SCENE", "cCount": 2034, "wCount": 299, "pCount": 3, "synopsis": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer sapien nulla, dictum at lacus a, dignissim consectetur dolor. Nunc vel eleifend lacus, eu dapibus orci."}, - "T000015": {"level": "H4", "title": "Scene Two, Section Two", "layout": "SCENE", "cCount": 2009, "wCount": 301, "pCount": 3, "synopsis": ""} + "T000001": {"level": "H3", "title": "Scene Two", "layout": "DOCUMENT", "cCount": 2034, "wCount": 299, "pCount": 3, "synopsis": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer sapien nulla, dictum at lacus a, dignissim consectetur dolor. Nunc vel eleifend lacus, eu dapibus orci."}, + "T000015": {"level": "H4", "title": "Scene Two, Section Two", "layout": "DOCUMENT", "cCount": 2009, "wCount": 301, "pCount": 3, "synopsis": ""} }, "846352075de7d": { - "T000001": {"level": "H2", "title": "Why do we use it?", "layout": "BOOK", "cCount": 631, "wCount": 109, "pCount": 3, "synopsis": ""} + "T000001": {"level": "H2", "title": "Why do we use it?", "layout": "DOCUMENT", "cCount": 631, "wCount": 109, "pCount": 3, "synopsis": ""} }, "441420a886d82": { - "T000001": {"level": "H2", "title": "Chapter Two", "layout": "CHAPTER", "cCount": 477, "wCount": 70, "pCount": 1, "synopsis": "Curabitur a elit posuere, varius ex et, convallis neque. Phasellus sagittis pharetra sem vitae dapibus. Curabitur varius lorem non pulvinar congue."} + "T000001": {"level": "H2", "title": "Chapter Two", "layout": "DOCUMENT", "cCount": 477, "wCount": 70, "pCount": 1, "synopsis": "Curabitur a elit posuere, varius ex et, convallis neque. Phasellus sagittis pharetra sem vitae dapibus. Curabitur varius lorem non pulvinar congue."} }, "eb103bc70c90c": { - "T000001": {"level": "H3", "title": "Scene Three", "layout": "SCENE", "cCount": 3006, "wCount": 439, "pCount": 4, "synopsis": "Aenean ut libero ut lectus porttitor rhoncus vel et massa. Nam pretium, nibh et varius vehicula, urna metus blandit eros, euismod pharetra diam diam et libero. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos."} + "T000001": {"level": "H3", "title": "Scene Three", "layout": "DOCUMENT", "cCount": 3006, "wCount": 439, "pCount": 4, "synopsis": "Aenean ut libero ut lectus porttitor rhoncus vel et massa. Nam pretium, nibh et varius vehicula, urna metus blandit eros, euismod pharetra diam diam et libero. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos."} }, "f8c0562e50f1b": { - "T000001": {"level": "H3", "title": "Scene Four", "layout": "SCENE", "cCount": 3839, "wCount": 563, "pCount": 6, "synopsis": "Nam tempor blandit magna laoreet aliquet. Vestibulum auctor posuere leo, ac gravida nisi rhoncus varius. Aenean posuere dolor vitae condimentum volutpat. Donec egestas volutpat risus, quis luctus justo."} + "T000001": {"level": "H3", "title": "Scene Four", "layout": "DOCUMENT", "cCount": 3839, "wCount": 563, "pCount": 6, "synopsis": "Nam tempor blandit magna laoreet aliquet. Vestibulum auctor posuere leo, ac gravida nisi rhoncus varius. Aenean posuere dolor vitae condimentum volutpat. Donec egestas volutpat risus, quis luctus justo."} }, "47666c91c7ccf": { - "T000001": {"level": "H3", "title": "Scene Five", "layout": "SCENE", "cCount": 3644, "wCount": 543, "pCount": 5, "synopsis": "Praesent eget est porta, dictum ante in, egestas risus. Mauris risus mauris, consequat aliquam mauris et, feugiat iaculis ipsum. Aliquam arcu ipsum, fermentum ut arcu sed, lobortis euismod sem. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus."} + "T000001": {"level": "H3", "title": "Scene Five", "layout": "DOCUMENT", "cCount": 3644, "wCount": 543, "pCount": 5, "synopsis": "Praesent eget est porta, dictum ante in, egestas risus. Mauris risus mauris, consequat aliquam mauris et, feugiat iaculis ipsum. Aliquam arcu ipsum, fermentum ut arcu sed, lobortis euismod sem. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus."} }, "4c4f28287af27": { "T000001": {"level": "H1", "title": "Nobody Owens", "layout": "NOTE", "cCount": 1864, "wCount": 284, "pCount": 3, "synopsis": ""} diff --git a/tests/reference/coreProject_NewCustomA_nwProject.nwx b/tests/reference/coreProject_NewCustomA_nwProject.nwx index 7673815d..a7f38108 100644 --- a/tests/reference/coreProject_NewCustomA_nwProject.nwx +++ b/tests/reference/coreProject_NewCustomA_nwProject.nwx @@ -1,5 +1,5 @@ - + Test Custom Test Novel @@ -23,7 +23,7 @@ %title% - Chapter %ch%: %title% + %title% %title% * * *
@@ -97,7 +97,7 @@ NOVEL New True - TITLE + DOCUMENT 0 0 0 @@ -116,7 +116,7 @@ NOVEL New True - CHAPTER + DOCUMENT 0 0 0 @@ -128,7 +128,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 @@ -140,7 +140,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 @@ -152,7 +152,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 @@ -171,7 +171,7 @@ NOVEL New True - CHAPTER + DOCUMENT 0 0 0 @@ -183,7 +183,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 @@ -195,7 +195,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 @@ -207,7 +207,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 @@ -226,7 +226,7 @@ NOVEL New True - CHAPTER + DOCUMENT 0 0 0 @@ -238,7 +238,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 @@ -250,7 +250,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 @@ -262,7 +262,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 diff --git a/tests/reference/coreProject_NewCustomB_nwProject.nwx b/tests/reference/coreProject_NewCustomB_nwProject.nwx index baaf3298..93cf1dee 100644 --- a/tests/reference/coreProject_NewCustomB_nwProject.nwx +++ b/tests/reference/coreProject_NewCustomB_nwProject.nwx @@ -1,5 +1,5 @@ - + Test Custom Test Novel @@ -23,7 +23,7 @@ %title% - Chapter %ch%: %title% + %title% %title% * * *
@@ -97,7 +97,7 @@ NOVEL New True - TITLE + DOCUMENT 0 0 0 @@ -109,7 +109,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 @@ -121,7 +121,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 @@ -133,7 +133,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 @@ -145,7 +145,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 @@ -157,7 +157,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 @@ -169,7 +169,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 diff --git a/tests/reference/coreProject_NewFile_nwProject.nwx b/tests/reference/coreProject_NewFile_nwProject.nwx index 83d80233..88c9aafb 100644 --- a/tests/reference/coreProject_NewFile_nwProject.nwx +++ b/tests/reference/coreProject_NewFile_nwProject.nwx @@ -1,5 +1,5 @@ - + New Project @@ -21,7 +21,7 @@ %title% - Chapter %ch%: %title% + %title% %title% * * *
@@ -74,7 +74,7 @@ NOVEL New True - TITLE + DOCUMENT 0 0 0 @@ -93,7 +93,7 @@ NOVEL New True - CHAPTER + DOCUMENT 0 0 0 @@ -105,7 +105,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 @@ -117,7 +117,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 diff --git a/tests/reference/coreProject_NewMinimal_nwProject.nwx b/tests/reference/coreProject_NewMinimal_nwProject.nwx index ba867df1..d3702a07 100644 --- a/tests/reference/coreProject_NewMinimal_nwProject.nwx +++ b/tests/reference/coreProject_NewMinimal_nwProject.nwx @@ -1,5 +1,5 @@ - + New Project @@ -21,7 +21,7 @@ %title% - Chapter %ch%: %title% + %title% %title% * * *
@@ -74,7 +74,7 @@ NOVEL New True - TITLE + DOCUMENT 0 0 0 @@ -93,7 +93,7 @@ NOVEL New True - CHAPTER + DOCUMENT 0 0 0 @@ -105,7 +105,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 diff --git a/tests/reference/coreProject_NewRoot_nwProject.nwx b/tests/reference/coreProject_NewRoot_nwProject.nwx index d437d4e2..58344c12 100644 --- a/tests/reference/coreProject_NewRoot_nwProject.nwx +++ b/tests/reference/coreProject_NewRoot_nwProject.nwx @@ -1,5 +1,5 @@ - + New Project @@ -21,7 +21,7 @@ %title% - Chapter %ch%: %title% + %title% %title% * * *
@@ -74,7 +74,7 @@ NOVEL New True - TITLE + DOCUMENT 0 0 0 @@ -93,7 +93,7 @@ NOVEL New True - CHAPTER + DOCUMENT 0 0 0 @@ -105,7 +105,7 @@ NOVEL New True - SCENE + DOCUMENT 0 0 0 diff --git a/tests/reference/guiBuild_Tool_Step1_Lorem_Ipsum.fodt b/tests/reference/guiBuild_Tool_Step1_Lorem_Ipsum.fodt index 0a86798c..a1e93752 100644 --- a/tests/reference/guiBuild_Tool_Step1_Lorem_Ipsum.fodt +++ b/tests/reference/guiBuild_Tool_Step1_Lorem_Ipsum.fodt @@ -1,8 +1,8 @@ - 2021-04-26T23:36:34 - novelWriter/1.3rc1 + 2021-07-26T23:47:22 + novelWriter/1.4rc1 @@ -59,16 +59,13 @@ - - - - + - + - + @@ -90,47 +87,47 @@ - Lorem Ipsum - + Lorem Ipsum + By lipsum.com - “Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…” - “There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…” + “Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…” + “There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…” Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of “de Finibus Bonorum et Malorum” (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, “Lorem ipsum dolor sit amet..”, comes from a line in section 1.10.32. The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from “de Finibus Bonorum et Malorum” by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. - Prologue + Prologue Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. - Act One - “Fusce maximus felis libero” - Chapter 1: Chapter One + Act One + “Fusce maximus felis libero” + Chapter 1: Chapter One Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque at aliquam quam. Praesent magna nunc, lacinia sit amet quam eget, aliquet ultrices justo. Morbi ornare enim et lorem rutrum finibus ut eu dolor. Aliquam a orci odio. Ut ultrices sem quis massa placerat, eget mollis nisl cursus. Cras vel sagittis justo. Ut non ultricies leo. Maecenas rutrum velit in est varius, et egestas massa pulvinar. - * * * + * * * Aenean ut placerat velit. Etiam laoreet ullamcorper risus, eget lobortis enim scelerisque non. Suspendisse id maximus nunc, et mollis sapien. Curabitur vel semper sapien, non pulvinar dolor. Etiam finibus nisi vel mi molestie consectetur. Donec quis ante nunc. Mauris ut leo ipsum. Vestibulum est neque, hendrerit nec neque a, ullamcorper lobortis tellus. Fusce sollicitudin purus quis congue bibendum. Aliquam condimentum ipsum tristique blandit tristique. Donec pulvinar neque ac suscipit malesuada. Aliquam ut nisl arcu. Ut ultricies, lorem dignissim rutrum convallis, risus orci tempus lectus, congue feugiat sem lectus vitae odio. Duis sit amet justo finibus, hendrerit nulla at, ullamcorper enim. Praesent vel tellus sit amet tellus vulputate bibendum. Morbi eleifend sagittis sem, ac volutpat ante congue non. In hac habitasse platea dictumst. Morbi lobortis fermentum elit, dignissim sagittis ligula volutpat lacinia. Vestibulum eu interdum odio. Integer ac purus commodo metus congue tempor non at urna. Sed eget tortor vel quam viverra egestas. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec non convallis mauris, ac feugiat ex. Integer vel libero ipsum. Donec varius aliquam libero, sit amet commodo urna hendrerit non. Nullam quis erat mollis nunc viverra volutpat tincidunt in odio. Nam vitae quam sem. Aliquam suscipit nulla non lorem pharetra semper. Ut suscipit erat eu ligula accumsan ultrices. Phasellus nisl tellus, placerat sed laoreet id, consectetur nec dolor. Sed fringilla ipsum id dapibus posuere. Aenean finibus pharetra tincidunt. Ut molestie malesuada nulla, id posuere lorem tincidunt eu. Aliquam tempor eros a est vulputate, scelerisque pulvinar ipsum fermentum. In hac habitasse platea dictumst. Curabitur congue, justo quis interdum fermentum, tellus nulla imperdiet sapien, eu interdum enim tellus condimentum metus. Vivamus nunc velit, dignissim ut ultrices sit amet, ultricies quis enim. Donec ut vestibulum neque. Vivamus semper neque id ex ullamcorper varius. Fusce mattis nibh viverra lorem sagittis, et tempor arcu congue. Suspendisse sit amet felis sed urna facilisis mattis eget vitae arcu. Proin eu magna hendrerit, tristique sem maximus, placerat diam. Nulla tristique sed velit sit amet varius. Etiam vel ornare magna, in vulputate arcu. Cras velit orci, tincidunt sed volutpat cursus, bibendum vel sem. Nunc vulputate pharetra tortor, ac consectetur neque tincidunt sit amet. Nulla ornare mi sed mi dignissim ultricies. Ut tincidunt bibendum mauris, sed elementum ex vulputate vel. Mauris fermentum, felis nec vehicula congue, felis lorem facilisis erat, a dictum dolor augue vitae quam. Maecenas rutrum tortor nec consequat eleifend. - * * * + * * * Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer sapien nulla, dictum at lacus a, dignissim consectetur dolor. Nunc vel eleifend lacus, eu dapibus orci. Vestibulum facilisis bibendum aliquam. Aliquam posuere, turpis ac bibendum varius, sem tellus venenatis risus, in elementum massa enim ac lorem. Integer in sem ac diam blandit ultricies ut in nulla. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sit amet erat est. Curabitur vitae cursus justo, sit amet placerat dolor. Vivamus eu felis hendrerit, tincidunt massa rutrum, maximus arcu. Pellentesque commodo justo odio, vel rutrum nulla tincidunt eu. Integer non neque condimentum, convallis diam non, varius ligula. Aliquam eget sapien mauris. Aenean pharetra nunc nisi, vel maximus ante tristique sit amet. Aliquam risus metus, interdum non odio eu, consectetur lacinia sapien. Proin vitae gravida nisl. Integer viverra orci turpis, sit amet pretium ligula facilisis consequat. Nulla interdum commodo metus, mollis consequat dui tincidunt et. Proin consequat bibendum justo id commodo. Fusce fermentum nunc turpis, eu vestibulum risus feugiat ut. Sed scelerisque vel ligula ut interdum. Suspendisse ac blandit ligula, sagittis fringilla dolor. In tincidunt convallis diam et ornare. Aenean id dignissim est, ut rhoncus quam. Donec vitae nisl velit. In convallis nibh ut augue dignissim, eu elementum quam cursus. Phasellus in lectus lorem. Curabitur in pellentesque nisi, at gravida sapien. Sed cursus justo volutpat lacus placerat, sit amet dignissim turpis commodo. Aliquam vitae orci eget nulla posuere condimentum in ut felis. Nulla accumsan ante in pulvinar efficitur. Nulla non velit quis urna hendrerit bibendum. Suspendisse ultrices ante eu justo malesuada, sed fermentum enim rutrum. Nunc fermentum pharetra felis, vitae sollicitudin quam rutrum porta. Aliquam fringilla velit a mi laoreet, et luctus est rutrum. In gravida non ipsum sit amet tempus. Curabitur et eleifend purus. Nulla facilisi. Suspendisse potenti. Fusce tempus lorem nec laoreet suscipit. Fusce vulputate nisl ac diam tincidunt, nec malesuada quam pellentesque. Maecenas congue, tellus quis commodo rutrum, magna leo egestas arcu, quis suscipit ex risus id ligula. Suspendisse potenti. Morbi blandit lacus vitae laoreet vulputate. Donec vitae tellus eleifend, lobortis eros eu, tincidunt enim. Nullam et ullamcorper nisi. Vivamus tellus ex, lobortis quis rutrum ut, dapibus sit amet turpis. Phasellus pellentesque metus diam, commodo tristique ante commodo ac. Ut mollis ipsum nec diam blandit sollicitudin. Duis bibendum lacus nec commodo dapibus. Sed condimentum luctus ante, id ultricies urna varius nec. Nam convallis magna nec bibendum ultrices. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed auctor pharetra quam, vitae porta ex bibendum eu. Vivamus ut venenatis lectus. Phasellus nec elit id sem dictum ornare. Quisque feugiat, diam eget sagittis ultricies, orci turpis efficitur nisi, et fringilla justo odio nec nibh. In hac habitasse platea dictumst. Sed tempus bibendum feugiat. Etiam luctus mauris arcu, non interdum ipsum ultrices id. Vivamus blandit urna sit amet scelerisque vulputate. Quisque in metus eget massa rutrum dictum sit amet sed nulla. Vivamus vel efficitur dolor. Ut et consequat enim, quis ornare nibh. In lectus neque, mollis et suscipit et, vestibulum vitae augue. Praesent id ante sit amet odio venenatis placerat a at erat. Sed sed metus sed nisi dictum varius. Integer tincidunt fermentum purus ac porta. Fusce porttitor non risus eget tristique. Donec augue nunc, maximus at fermentum vel, varius et neque. Ut sed consectetur mauris. Quisque ipsum enim, porttitor vitae imperdiet sit amet, tempor et mauris. Aliquam malesuada tincidunt lectus quis blandit. Sed commodo orci felis, quis ultrices tellus facilisis sed. Nunc vel varius est. Duis ullamcorper eu metus in pulvinar. Morbi at sapien dictum, rutrum mauris eget, interdum tellus. - Chapter 2: Chapter Two + Chapter 2: Chapter Two Curabitur a elit posuere, varius ex et, convallis neque. Phasellus sagittis pharetra sem vitae dapibus. Curabitur varius lorem non pulvinar congue. Vestibulum pharetra fermentum leo, sed faucibus eros placerat quis. In hac habitasse platea dictumst. Donec metus massa, rutrum quis consequat et, tincidunt ac felis. Duis mollis metus ac nunc tincidunt blandit. Ut aliquet velit eu odio pharetra condimentum. Integer rutrum lacus orci, id venenatis libero accumsan at. - * * * + * * * Aenean ut libero ut lectus porttitor rhoncus vel et massa. Nam pretium, nibh et varius vehicula, urna metus blandit eros, euismod pharetra diam diam et libero. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean tincidunt lacus vitae nibh elementum eleifend. Sed rutrum condimentum sem quis blandit. Duis imperdiet libero metus, quis convallis quam faucibus a. Nulla ligula est, semper quis sollicitudin et, pretium id justo. Curabitur pharetra risus eget consectetur commodo. Duis mattis arcu non est condimentum, id venenatis risus volutpat. Pellentesque aliquet mauris non mauris porttitor ultrices. Phasellus ut vestibulum mi. Suspendisse malesuada metus lorem, a malesuada orci rhoncus a. Praesent euismod convallis ante, lacinia tincidunt ex egestas id. Praesent sit amet efficitur sapien. Morbi tincidunt volutpat nunc sed dictum. Aliquam ultrices metus id fermentum lobortis. Pellentesque id sagittis dui. Praesent ut nisi sit amet libero euismod ornare. Vestibulum vehicula, lorem eget aliquet imperdiet, eros nulla iaculis mi, vel bibendum est dui sed orci. Nullam vitae lorem rutrum, euismod lacus id, ullamcorper lectus. Duis nec commodo mi, a fringilla diam. Vestibulum molestie nibh tristique, viverra augue non, aliquet metus. Phasellus a tellus ac nisl tempor aliquet. Nulla vitae sapien rutrum augue ornare ultrices a quis nisi. Sed pulvinar tincidunt ex. Fusce vel sem vitae ante pellentesque lobortis. Maecenas ullamcorper lacus nec turpis finibus aliquet eget rutrum augue. Integer lorem erat, faucibus non lacus lacinia, pulvinar egestas felis. Proin rutrum nunc eget nulla varius, id blandit mauris tincidunt. Donec sit amet ullamcorper nisi, ut efficitur mi. Aliquam aliquet, nulla eget rhoncus tristique, justo lorem consectetur dui, id ornare leo odio sed tellus. Curabitur interdum velit a turpis condimentum venenatis. Nunc rhoncus sem ac augue auctor, nec malesuada ex fringilla. Vestibulum egestas diam sed leo consectetur vulputate quis eget enim. Nam tincidunt metus sit amet maximus ullamcorper. Sed placerat velit vitae massa efficitur viverra. Etiam eleifend dignissim ante, sed luctus nisl tristique a. In vestibulum pharetra dolor in molestie. Vivamus auctor massa ac magna imperdiet, sit amet iaculis turpis finibus. Aenean dapibus vulputate purus, sit amet tempor nunc suscipit consequat. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris auctor congue eros, non pellentesque neque dapibus ac. Vestibulum non leo nec urna lacinia eleifend quis et diam. Praesent eu nisi magna. Nulla at magna massa. Suspendisse porta varius scelerisque. Duis at auctor dolor, non dapibus urna. Nunc venenatis feugiat magna non molestie. Aliquam non ornare ex. Quisque eu ultrices velit, quis pellentesque eros. Phasellus eleifend, elit id imperdiet aliquam, nulla quam molestie turpis, at egestas odio ante et tortor. Suspendisse fringilla condimentum justo, at aliquet odio aliquam ac. - * * * + * * * Nam tempor blandit magna laoreet aliquet. Vestibulum auctor posuere leo, ac gravida nisi rhoncus varius. Aenean posuere dolor vitae condimentum volutpat. Donec egestas volutpat risus, quis luctus justo. Nullam viverra dui et auctor pretium. Ut ullamcorper velit urna, sed imperdiet massa convallis a. Suspendisse efficitur, ipsum nec cursus pulvinar, eros urna posuere diam, nec elementum mi felis vitae sapien. Duis efficitur metus pulvinar, molestie magna eget, feugiat dui. Fusce convallis vehicula ipsum convallis blandit. Duis eros risus, malesuada eu imperdiet in, hendrerit ac metus. Vestibulum id justo gravida, dignissim nibh non, iaculis diam. Fusce accumsan est ut massa porta ultricies. Nulla vitae justo in tortor laoreet mollis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin eu libero justo. Vivamus aliquet placerat est, et auctor eros posuere venenatis. Nunc quam diam, tincidunt ac aliquet in, fermentum sit amet lectus. Proin commodo tincidunt blandit. Quisque erat arcu, semper nec dui non, consectetur gravida ipsum. Nullam pretium consectetur elit at condimentum. Etiam sagittis, erat vitae accumsan tempor, neque augue scelerisque nulla, ut ultrices justo urna sit amet augue. Interdum et malesuada fames ac ante ipsum primis in faucibus. Aenean at pulvinar tortor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Cras vel porta quam. Nullam eu mauris mollis, vehicula justo vel, placerat sapien. Phasellus viverra elit et vestibulum pharetra. Vestibulum commodo fermentum leo, eu porta nisi aliquam eget. Nulla tempus porttitor nisi nec mollis. Nam non mollis turpis. Nam finibus leo a bibendum tincidunt. Donec commodo velit magna, ac semper sapien mattis id. Proin sem velit, lobortis quis ultricies id, pharetra et lectus. Vestibulum condimentum neque vitae mi dapibus mollis. Mauris luctus vel sapien vitae hendrerit. Aenean vestibulum magna placerat fermentum tempus. Nam auctor condimentum nunc, in elementum quam ornare a. Etiam in ipsum elit. Proin pharetra, dolor sollicitudin pellentesque congue, lorem dolor ultricies magna, non iaculis risus nisl dictum diam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Vivamus vel euismod nibh, et lobortis dolor. Maecenas dui odio, gravida nec molestie ut, feugiat ut arcu. Pellentesque risus sapien, gravida a convallis quis, ullamcorper porttitor sapien. Donec ipsum eros, vestibulum sit amet cursus eget, iaculis quis dolor. Pellentesque magna augue, tristique dapibus mi vitae, molestie venenatis enim. Nam malesuada, turpis volutpat rhoncus ullamcorper, justo est eleifend orci, ut luctus risus ex rutrum arcu. Sed mi elit, feugiat rhoncus ornare sed, porta id leo. Pellentesque feugiat nulla tincidunt erat suscipit, eu congue lacus hendrerit. Morbi pulvinar enim sed consequat auctor. Ut eleifend enim sem, vitae euismod ex ultricies sit amet. Curabitur eu efficitur nisi, suscipit finibus sapien. In sodales blandit erat, vestibulum pulvinar ante volutpat nec. Vivamus dictum non libero at molestie. Donec sit amet neque in ante convallis pretium. Nunc vel iaculis dui. Phasellus eu nunc ut nunc faucibus laoreet. Aliquam at magna risus. Praesent lobortis, risus finibus semper varius, magna purus vestibulum eros, at pulvinar sapien enim a ex. In scelerisque malesuada ex, sit amet egestas neque condimentum sed. Praesent vulputate efficitur massa. Cras at accumsan ligula. In elementum lectus eget blandit dictum. Nam vitae libero ut justo eleifend rutrum ac nec arcu. Aliquam sodales in quam congue vestibulum. Aliquam in accumsan sapien. Quisque lobortis nisl nisi, vitae bibendum turpis efficitur sed. Vestibulum tempor nulla eget nisi convallis, blandit sagittis ipsum convallis. Donec odio nibh, ultrices quis odio in, mollis euismod libero. - * * * + * * * Praesent eget est porta, dictum ante in, egestas risus. Mauris risus mauris, consequat aliquam mauris et, feugiat iaculis ipsum. Aliquam arcu ipsum, fermentum ut arcu sed, lobortis euismod sem. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In sed felis auctor, rhoncus dui ac, consequat dolor. Integer volutpat libero sed nisl aliquet varius. Suspendisse et lorem sapien. Proin id ultrices nibh, ac suscipit diam. Suspendisse placerat varius porttitor. Curabitur elementum sed enim ultrices imperdiet. In ut lobortis lacus, nec luctus arcu. Vivamus condimentum sapien a ipsum malesuada sodales. Donec et vestibulum risus. Integer dictum euismod eros id tincidunt. Aliquam sagittis leo vitae consequat fermentum. Donec maximus ex eu ex iaculis porta. Praesent pharetra lacinia risus, et eleifend diam commodo non. Sed feugiat ipsum ut orci sagittis, quis faucibus lectus blandit. Sed tellus quam, gravida vitae laoreet quis, tempus lobortis dui. Vivamus semper accumsan ullamcorper. Praesent tempus pretium eros, non elementum risus. Pellentesque odio quam, auctor quis ex non, vulputate egestas dolor. Nunc luctus enim ut justo sodales consectetur. Sed aliquet a mauris vel posuere. Donec luctus lectus efficitur, blandit nisi vitae, dignissim tellus. Pellentesque euismod pharetra augue gravida hendrerit. Quisque nisi mi, mattis ac nisi non, maximus malesuada ante. Nulla lobortis, diam eu ornare ornare, tellus enim feugiat arcu, non vestibulum tortor nunc eu justo. Integer blandit felis justo, eu semper est scelerisque vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Nam ultricies, nisi vel elementum commodo, nisl dolor tincidunt magna, sed varius est nunc at lectus. Aliquam dolor tortor, sodales placerat ultricies quis, sodales quis sapien. Duis ullamcorper sollicitudin risus at mattis. Integer consequat et nunc at condimentum. Pellentesque cursus congue augue, non suscipit lectus sodales ut. Nam a mi bibendum, blandit nisl eu, accumsan nunc. Aliquam a ex mauris. Sed nec sem quis arcu dignissim tempus eget et turpis. Ut sed ex nec ipsum ultrices lobortis. diff --git a/tests/reference/guiBuild_Tool_Step1_Lorem_Ipsum.htm b/tests/reference/guiBuild_Tool_Step1_Lorem_Ipsum.htm index 5ab8b426..fd0f8244 100644 --- a/tests/reference/guiBuild_Tool_Step1_Lorem_Ipsum.htm +++ b/tests/reference/guiBuild_Tool_Step1_Lorem_Ipsum.htm @@ -22,7 +22,7 @@ article {width: 800px; margin: 40px auto;}
-

Lorem Ipsum

+

Lorem Ipsum

By lipsum.com

“Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…”

“There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…”

@@ -30,7 +30,7 @@ article {width: 800px; margin: 40px auto;}

The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from “de Finibus Bonorum et Malorum” by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.

Prologue

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

-

Act One

+

Act One

“Fusce maximus felis libero”

Chapter 1: Chapter One

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque at aliquam quam. Praesent magna nunc, lacinia sit amet quam eget, aliquet ultrices justo. Morbi ornare enim et lorem rutrum finibus ut eu dolor. Aliquam a orci odio. Ut ultrices sem quis massa placerat, eget mollis nisl cursus. Cras vel sagittis justo. Ut non ultricies leo. Maecenas rutrum velit in est varius, et egestas massa pulvinar.

diff --git a/tests/reference/guiBuild_Tool_Step1_Lorem_Ipsum.nwd b/tests/reference/guiBuild_Tool_Step1_Lorem_Ipsum.nwd index 010f3a80..91e2f5c3 100644 --- a/tests/reference/guiBuild_Tool_Step1_Lorem_Ipsum.nwd +++ b/tests/reference/guiBuild_Tool_Step1_Lorem_Ipsum.nwd @@ -1,4 +1,4 @@ -# Lorem Ipsum +#! Lorem Ipsum **By lipsum.com** @@ -7,11 +7,12 @@ “There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…” + Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of “de Finibus Bonorum et Malorum” (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, “Lorem ipsum dolor sit amet..”, comes from a line in section 1.10.32. The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from “de Finibus Bonorum et Malorum” by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. -## Prologue +##! Prologue _Lorem Ipsum_ is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. diff --git a/tests/reference/guiBuild_Tool_Step2_Lorem_Ipsum.fodt b/tests/reference/guiBuild_Tool_Step2_Lorem_Ipsum.fodt index a5aeb925..2c9a83ac 100644 --- a/tests/reference/guiBuild_Tool_Step2_Lorem_Ipsum.fodt +++ b/tests/reference/guiBuild_Tool_Step2_Lorem_Ipsum.fodt @@ -1,7 +1,7 @@ - 2021-07-31T00:20:16 + 2021-08-02T03:24:17 novelWriter/1.5-alpha0 @@ -59,28 +59,25 @@ - - - - + - + - + - + - + - + - + @@ -102,29 +99,29 @@ - Lorem Ipsum - + Lorem Ipsum + By lipsum.com - “Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…” - “There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…” - Comment: Exctracted from the lipsum.com website. + “Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…” + “There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…” + Comment: Exctracted from the lipsum.com website. Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of “de Finibus Bonorum et Malorum” (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, “Lorem ipsum dolor sit amet..”, comes from a line in section 1.10.32. The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from “de Finibus Bonorum et Malorum” by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. - Prologue + Prologue Synopsis: Explanation from the lipsum.com website. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. - Act One - “Fusce maximus felis libero” - Chapter One: Chapter One - Point of View: Bod - Plot: Main + Act One + “Fusce maximus felis libero” + Chapter One: Chapter One + Point of View: Bod + Plot: Main Locations: Europe Synopsis: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque at aliquam quam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque at aliquam quam. Praesent magna nunc, lacinia sit amet quam eget, aliquet ultrices justo. Morbi ornare enim et lorem rutrum finibus ut eu dolor. Aliquam a orci odio. Ut ultrices sem quis massa placerat, eget mollis nisl cursus. Cras vel sagittis justo. Ut non ultricies leo. Maecenas rutrum velit in est varius, et egestas massa pulvinar. Scene 1.1: Scene One - Point of View: Bod - Plot: Main + Point of View: Bod + Plot: Main Locations: Europe Synopsis: Aenean ut placerat velit. Etiam laoreet ullamcorper risus, eget lobortis enim scelerisque non. Suspendisse id maximus nunc, et mollis sapien. Curabitur vel semper sapien, non pulvinar dolor. Etiam finibus nisi vel mi molestie consectetur. Aenean ut placerat velit. Etiam laoreet ullamcorper risus, eget lobortis enim scelerisque non. Suspendisse id maximus nunc, et mollis sapien. Curabitur vel semper sapien, non pulvinar dolor. Etiam finibus nisi vel mi molestie consectetur. Donec quis ante nunc. Mauris ut leo ipsum. Vestibulum est neque, hendrerit nec neque a, ullamcorper lobortis tellus. Fusce sollicitudin purus quis congue bibendum. Aliquam condimentum ipsum tristique blandit tristique. Donec pulvinar neque ac suscipit malesuada. @@ -133,8 +130,8 @@ Integer vel libero ipsum. Donec varius aliquam libero, sit amet commodo urna hendrerit non. Nullam quis erat mollis nunc viverra volutpat tincidunt in odio. Nam vitae quam sem. Aliquam suscipit nulla non lorem pharetra semper. Ut suscipit erat eu ligula accumsan ultrices. Phasellus nisl tellus, placerat sed laoreet id, consectetur nec dolor. Sed fringilla ipsum id dapibus posuere. Aenean finibus pharetra tincidunt. Ut molestie malesuada nulla, id posuere lorem tincidunt eu. Aliquam tempor eros a est vulputate, scelerisque pulvinar ipsum fermentum. In hac habitasse platea dictumst. Curabitur congue, justo quis interdum fermentum, tellus nulla imperdiet sapien, eu interdum enim tellus condimentum metus. Vivamus nunc velit, dignissim ut ultrices sit amet, ultricies quis enim. Donec ut vestibulum neque. Vivamus semper neque id ex ullamcorper varius. Fusce mattis nibh viverra lorem sagittis, et tempor arcu congue. Suspendisse sit amet felis sed urna facilisis mattis eget vitae arcu. Proin eu magna hendrerit, tristique sem maximus, placerat diam. Nulla tristique sed velit sit amet varius. Etiam vel ornare magna, in vulputate arcu. Cras velit orci, tincidunt sed volutpat cursus, bibendum vel sem. Nunc vulputate pharetra tortor, ac consectetur neque tincidunt sit amet. Nulla ornare mi sed mi dignissim ultricies. Ut tincidunt bibendum mauris, sed elementum ex vulputate vel. Mauris fermentum, felis nec vehicula congue, felis lorem facilisis erat, a dictum dolor augue vitae quam. Maecenas rutrum tortor nec consequat eleifend. Scene 1.2: Scene Two - Point of View: Bod - Plot: Main + Point of View: Bod + Plot: Main Locations: Europe Synopsis: Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer sapien nulla, dictum at lacus a, dignissim consectetur dolor. Nunc vel eleifend lacus, eu dapibus orci. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer sapien nulla, dictum at lacus a, dignissim consectetur dolor. Nunc vel eleifend lacus, eu dapibus orci. Vestibulum facilisis bibendum aliquam. Aliquam posuere, turpis ac bibendum varius, sem tellus venenatis risus, in elementum massa enim ac lorem. Integer in sem ac diam blandit ultricies ut in nulla. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sit amet erat est. Curabitur vitae cursus justo, sit amet placerat dolor. Vivamus eu felis hendrerit, tincidunt massa rutrum, maximus arcu. Pellentesque commodo justo odio, vel rutrum nulla tincidunt eu. Integer non neque condimentum, convallis diam non, varius ligula. Aliquam eget sapien mauris. Aenean pharetra nunc nisi, vel maximus ante tristique sit amet. Aliquam risus metus, interdum non odio eu, consectetur lacinia sapien. @@ -144,29 +141,29 @@ Suspendisse potenti. Fusce tempus lorem nec laoreet suscipit. Fusce vulputate nisl ac diam tincidunt, nec malesuada quam pellentesque. Maecenas congue, tellus quis commodo rutrum, magna leo egestas arcu, quis suscipit ex risus id ligula. Suspendisse potenti. Morbi blandit lacus vitae laoreet vulputate. Donec vitae tellus eleifend, lobortis eros eu, tincidunt enim. Nullam et ullamcorper nisi. Vivamus tellus ex, lobortis quis rutrum ut, dapibus sit amet turpis. Phasellus pellentesque metus diam, commodo tristique ante commodo ac. Ut mollis ipsum nec diam blandit sollicitudin. Duis bibendum lacus nec commodo dapibus. Sed condimentum luctus ante, id ultricies urna varius nec. Nam convallis magna nec bibendum ultrices. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed auctor pharetra quam, vitae porta ex bibendum eu. Vivamus ut venenatis lectus. Phasellus nec elit id sem dictum ornare. Quisque feugiat, diam eget sagittis ultricies, orci turpis efficitur nisi, et fringilla justo odio nec nibh. In hac habitasse platea dictumst. Sed tempus bibendum feugiat. Etiam luctus mauris arcu, non interdum ipsum ultrices id. Vivamus blandit urna sit amet scelerisque vulputate. Quisque in metus eget massa rutrum dictum sit amet sed nulla. Vivamus vel efficitur dolor. Ut et consequat enim, quis ornare nibh. In lectus neque, mollis et suscipit et, vestibulum vitae augue. Praesent id ante sit amet odio venenatis placerat a at erat. Sed sed metus sed nisi dictum varius. Integer tincidunt fermentum purus ac porta. Fusce porttitor non risus eget tristique. Donec augue nunc, maximus at fermentum vel, varius et neque. Ut sed consectetur mauris. Quisque ipsum enim, porttitor vitae imperdiet sit amet, tempor et mauris. Aliquam malesuada tincidunt lectus quis blandit. Sed commodo orci felis, quis ultrices tellus facilisis sed. Nunc vel varius est. Duis ullamcorper eu metus in pulvinar. Morbi at sapien dictum, rutrum mauris eget, interdum tellus. - Chapter Two: Why do we use it? + Why do we use it? Comment: Exctracted from the lipsum.com website. It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). - Chapter Three: Chapter Two - Point of View: Bod - Plot: Main + Chapter Two: Chapter Two + Point of View: Bod + Plot: Main Locations: Europe Synopsis: Curabitur a elit posuere, varius ex et, convallis neque. Phasellus sagittis pharetra sem vitae dapibus. Curabitur varius lorem non pulvinar congue. Curabitur a elit posuere, varius ex et, convallis neque. Phasellus sagittis pharetra sem vitae dapibus. Curabitur varius lorem non pulvinar congue. Vestibulum pharetra fermentum leo, sed faucibus eros placerat quis. In hac habitasse platea dictumst. Donec metus massa, rutrum quis consequat et, tincidunt ac felis. Duis mollis metus ac nunc tincidunt blandit. Ut aliquet velit eu odio pharetra condimentum. Integer rutrum lacus orci, id venenatis libero accumsan at. - Scene 3.1: Scene Three - Point of View: Bod - Plot: Main + Scene 2.1: Scene Three + Point of View: Bod + Plot: Main Locations: Europe Synopsis: Aenean ut libero ut lectus porttitor rhoncus vel et massa. Nam pretium, nibh et varius vehicula, urna metus blandit eros, euismod pharetra diam diam et libero. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean ut libero ut lectus porttitor rhoncus vel et massa. Nam pretium, nibh et varius vehicula, urna metus blandit eros, euismod pharetra diam diam et libero. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean tincidunt lacus vitae nibh elementum eleifend. Sed rutrum condimentum sem quis blandit. Duis imperdiet libero metus, quis convallis quam faucibus a. Nulla ligula est, semper quis sollicitudin et, pretium id justo. Curabitur pharetra risus eget consectetur commodo. Duis mattis arcu non est condimentum, id venenatis risus volutpat. Pellentesque aliquet mauris non mauris porttitor ultrices. Phasellus ut vestibulum mi. Suspendisse malesuada metus lorem, a malesuada orci rhoncus a. Praesent euismod convallis ante, lacinia tincidunt ex egestas id. Praesent sit amet efficitur sapien. Morbi tincidunt volutpat nunc sed dictum. Aliquam ultrices metus id fermentum lobortis. Pellentesque id sagittis dui. Praesent ut nisi sit amet libero euismod ornare. Vestibulum vehicula, lorem eget aliquet imperdiet, eros nulla iaculis mi, vel bibendum est dui sed orci. Nullam vitae lorem rutrum, euismod lacus id, ullamcorper lectus. Duis nec commodo mi, a fringilla diam. Vestibulum molestie nibh tristique, viverra augue non, aliquet metus. Phasellus a tellus ac nisl tempor aliquet. Nulla vitae sapien rutrum augue ornare ultrices a quis nisi. Sed pulvinar tincidunt ex. Fusce vel sem vitae ante pellentesque lobortis. Maecenas ullamcorper lacus nec turpis finibus aliquet eget rutrum augue. Integer lorem erat, faucibus non lacus lacinia, pulvinar egestas felis. Proin rutrum nunc eget nulla varius, id blandit mauris tincidunt. Donec sit amet ullamcorper nisi, ut efficitur mi. Aliquam aliquet, nulla eget rhoncus tristique, justo lorem consectetur dui, id ornare leo odio sed tellus. Curabitur interdum velit a turpis condimentum venenatis. Nunc rhoncus sem ac augue auctor, nec malesuada ex fringilla. Vestibulum egestas diam sed leo consectetur vulputate quis eget enim. Nam tincidunt metus sit amet maximus ullamcorper. Sed placerat velit vitae massa efficitur viverra. Etiam eleifend dignissim ante, sed luctus nisl tristique a. In vestibulum pharetra dolor in molestie. Vivamus auctor massa ac magna imperdiet, sit amet iaculis turpis finibus. Aenean dapibus vulputate purus, sit amet tempor nunc suscipit consequat. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris auctor congue eros, non pellentesque neque dapibus ac. Vestibulum non leo nec urna lacinia eleifend quis et diam. Praesent eu nisi magna. Nulla at magna massa. Suspendisse porta varius scelerisque. Duis at auctor dolor, non dapibus urna. Nunc venenatis feugiat magna non molestie. Aliquam non ornare ex. Quisque eu ultrices velit, quis pellentesque eros. Phasellus eleifend, elit id imperdiet aliquam, nulla quam molestie turpis, at egestas odio ante et tortor. Suspendisse fringilla condimentum justo, at aliquet odio aliquam ac. - Scene 3.2: Scene Four - Point of View: Bod - Plot: Main + Scene 2.2: Scene Four + Point of View: Bod + Plot: Main Locations: Europe Synopsis: Nam tempor blandit magna laoreet aliquet. Vestibulum auctor posuere leo, ac gravida nisi rhoncus varius. Aenean posuere dolor vitae condimentum volutpat. Donec egestas volutpat risus, quis luctus justo. Nam tempor blandit magna laoreet aliquet. Vestibulum auctor posuere leo, ac gravida nisi rhoncus varius. Aenean posuere dolor vitae condimentum volutpat. Donec egestas volutpat risus, quis luctus justo. Nullam viverra dui et auctor pretium. Ut ullamcorper velit urna, sed imperdiet massa convallis a. Suspendisse efficitur, ipsum nec cursus pulvinar, eros urna posuere diam, nec elementum mi felis vitae sapien. @@ -175,9 +172,9 @@ Aenean vestibulum magna placerat fermentum tempus. Nam auctor condimentum nunc, in elementum quam ornare a. Etiam in ipsum elit. Proin pharetra, dolor sollicitudin pellentesque congue, lorem dolor ultricies magna, non iaculis risus nisl dictum diam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Vivamus vel euismod nibh, et lobortis dolor. Maecenas dui odio, gravida nec molestie ut, feugiat ut arcu. Pellentesque risus sapien, gravida a convallis quis, ullamcorper porttitor sapien. Donec ipsum eros, vestibulum sit amet cursus eget, iaculis quis dolor. Pellentesque magna augue, tristique dapibus mi vitae, molestie venenatis enim. Nam malesuada, turpis volutpat rhoncus ullamcorper, justo est eleifend orci, ut luctus risus ex rutrum arcu. Sed mi elit, feugiat rhoncus ornare sed, porta id leo. Pellentesque feugiat nulla tincidunt erat suscipit, eu congue lacus hendrerit. Morbi pulvinar enim sed consequat auctor. Ut eleifend enim sem, vitae euismod ex ultricies sit amet. Curabitur eu efficitur nisi, suscipit finibus sapien. In sodales blandit erat, vestibulum pulvinar ante volutpat nec. Vivamus dictum non libero at molestie. Donec sit amet neque in ante convallis pretium. Nunc vel iaculis dui. Phasellus eu nunc ut nunc faucibus laoreet. Aliquam at magna risus. Praesent lobortis, risus finibus semper varius, magna purus vestibulum eros, at pulvinar sapien enim a ex. In scelerisque malesuada ex, sit amet egestas neque condimentum sed. Praesent vulputate efficitur massa. Cras at accumsan ligula. In elementum lectus eget blandit dictum. Nam vitae libero ut justo eleifend rutrum ac nec arcu. Aliquam sodales in quam congue vestibulum. Aliquam in accumsan sapien. Quisque lobortis nisl nisi, vitae bibendum turpis efficitur sed. Vestibulum tempor nulla eget nisi convallis, blandit sagittis ipsum convallis. Donec odio nibh, ultrices quis odio in, mollis euismod libero. - Scene 3.3: Scene Five - Point of View: Bod - Plot: Main + Scene 2.3: Scene Five + Point of View: Bod + Plot: Main Locations: Europe Synopsis: Praesent eget est porta, dictum ante in, egestas risus. Mauris risus mauris, consequat aliquam mauris et, feugiat iaculis ipsum. Aliquam arcu ipsum, fermentum ut arcu sed, lobortis euismod sem. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Praesent eget est porta, dictum ante in, egestas risus. Mauris risus mauris, consequat aliquam mauris et, feugiat iaculis ipsum. Aliquam arcu ipsum, fermentum ut arcu sed, lobortis euismod sem. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In sed felis auctor, rhoncus dui ac, consequat dolor. Integer volutpat libero sed nisl aliquet varius. Suspendisse et lorem sapien. Proin id ultrices nibh, ac suscipit diam. Suspendisse placerat varius porttitor. Curabitur elementum sed enim ultrices imperdiet. @@ -185,19 +182,19 @@ Donec luctus lectus efficitur, blandit nisi vitae, dignissim tellus. Pellentesque euismod pharetra augue gravida hendrerit. Quisque nisi mi, mattis ac nisi non, maximus malesuada ante. Nulla lobortis, diam eu ornare ornare, tellus enim feugiat arcu, non vestibulum tortor nunc eu justo. Integer blandit felis justo, eu semper est scelerisque vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Nam ultricies, nisi vel elementum commodo, nisl dolor tincidunt magna, sed varius est nunc at lectus. Aliquam dolor tortor, sodales placerat ultricies quis, sodales quis sapien. Duis ullamcorper sollicitudin risus at mattis. Integer consequat et nunc at condimentum. Pellentesque cursus congue augue, non suscipit lectus sodales ut. Nam a mi bibendum, blandit nisl eu, accumsan nunc. Aliquam a ex mauris. Sed nec sem quis arcu dignissim tempus eget et turpis. Ut sed ex nec ipsum ultrices lobortis. Pellentesque rhoncus pharetra eros, non mollis nisi pretium non. Mauris accumsan quis odio quis euismod. Maecenas ultrices, augue et aliquam tincidunt, erat tellus ornare ligula, quis ultrices turpis nibh vel justo. Fusce gravida odio tellus. In a congue diam. Mauris consequat ex id leo lacinia dictum. Fusce id sem sodales, ultrices sapien ac, convallis orci. Donec gravida nunc sit amet nisi hendrerit, sed porta enim aliquam. In hac habitasse platea dictumst. Cras a orci felis. Curabitur non felis nec urna maximus auctor ut ut nisi. Curabitur at turpis eleifend, blandit eros at, molestie odio. Phasellus euismod neque augue. Integer egestas maximus leo eu facilisis. Nunc rhoncus dignissim lectus eu lacinia. Praesent lacinia urna porttitor aliquam condimentum. Nulla eu eros dictum, dictum nunc vitae, sagittis nibh. Integer ante neque, consequat nec sollicitudin id, consectetur vitae dolor. Nullam volutpat sem orci, quis viverra magna auctor a. Suspendisse potenti. Maecenas commodo sed neque pellentesque vehicula. Sed luctus nisl risus, elementum semper purus interdum vel. Ut pulvinar, massa sit amet venenatis placerat, nunc lacus hendrerit odio, non aliquet nunc risus eu lectus. Maecenas feugiat semper ligula, id lobortis sem porta eu. Integer posuere elit magna, at mollis eros bibendum et. Ut imperdiet purus vel nulla aliquam maximus. Morbi sodales purus tellus, a rhoncus sem rutrum sit amet. Quisque risus sem, laoreet nec convallis nec, rutrum vitae justo. - Notes: Characters + Notes: Characters Nobody Owens - Tag: Bod + Tag: Bod Plot: Main Pellentesque nec erat ut nulla posuere commodo. Curabitur nisi augue, imperdiet et porta imperdiet, efficitur id leo. Cras finibus arcu at nibh commodo congue. Proin suscipit placerat condimentum. Aenean ante enim, cursus id lorem a, blandit venenatis nibh. Maecenas suscipit porta elit, sit amet porta felis porttitor eu. Sed a dui nibh. Phasellus sed faucibus dui. Pellentesque felis nulla, ultrices non efficitur quis, rutrum id mi. Mauris tempus auctor nisl, in bibendum enim pellentesque sit amet. Proin nunc lacus, imperdiet nec posuere ac, interdum non lectus. Suspendisse faucibus est auctor orci mollis luctus. Praesent quis sodales neque. Interdum et malesuada fames ac ante ipsum primis in faucibus. Donec sodales rutrum mattis. In in sem ornare, consequat nulla ac, convallis arcu. Duis ac metus id felis commodo commodo sit amet eget diam. Curabitur rhoncus lacinia leo at sodales. Etiam finibus porta diam a viverra. Praesent nisi urna, volutpat sit amet odio at, vehicula vehicula leo. In non enim eget nisl luctus commodo. Pellentesque pellentesque at lectus at luctus. Quisque nec felis bibendum, lacinia libero ut, lacinia eros. Integer finibus ultricies nibh sit amet placerat. Nullam scelerisque velit et tortor congue vestibulum a at nisi. Vivamus sodales ut turpis a convallis. In dignissim nibh at luctus sodales. Etiam sit amet rhoncus massa. Phasellus ligula magna, sollicitudin non imperdiet sit amet, volutpat vel magna. Nunc vestibulum tempor lectus, sit amet porta nunc hendrerit in. Curabitur non odio sit amet massa tincidunt facilisis. Integer et luctus nunc, eget euismod leo. Praesent faucibus metus sed purus convallis scelerisque. Fusce viverra lorem et placerat malesuada. In at elit malesuada, ullamcorper risus vitae, sodales dolor. Donec quis elementum lectus. Quisque eu eros at dui imperdiet euismod ut id neque. - Notes: Plot + Notes: Plot Main Plot Tag: Main Suspendisse vulputate malesuada pellentesque. Aenean sollicitudin cursus mi, vitae ultricies felis ullamcorper eu. Duis luctus risus mi, in accumsan velit cursus ut. Vestibulum eleifend leo in magna eleifend fermentum. Proin nec ornare elit. Phasellus nec interdum risus. In a volutpat augue, quis egestas justo. Morbi porta mauris mattis bibendum imperdiet. Mauris ut erat eu lorem malesuada egestas vel vel urna. Maecenas ac semper quam. Maecenas aliquet metus non interdum mattis. Proin consectetur molestie ligula. Aliquam sollicitudin pulvinar urna a pellentesque. Suspendisse ultrices, est mattis scelerisque porta, nisi nisi laoreet nisl, non condimentum quam ante a velit. Proin scelerisque justo augue, nec laoreet ligula egestas at. Etiam enim quam, ultrices non accumsan hendrerit, elementum vel ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nam efficitur odio libero, in vestibulum arcu aliquam at. Cras non vehicula augue. Integer lobortis, est vitae aliquam facilisis, metus ligula aliquet eros, at porttitor sem tortor eget massa. Aliquam varius scelerisque neque sed gravida. Aenean eleifend lorem id ante elementum sollicitudin. Proin commodo massa a quam volutpat, mollis fermentum turpis efficitur. - Notes: World + Notes: World Ancient Europe Tag: Europe Vivamus sodales risus ac accumsan posuere. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Nunc vel enim felis. Vestibulum dignissim massa nunc, a auctor magna eleifend et. Proin dignissim sodales erat vitae convallis. Aliquam id tellus dui. Curabitur sollicitudin scelerisque ex sit amet posuere. Nam rutrum felis id rhoncus feugiat. Duis sagittis quam quis purus efficitur, quis rutrum odio iaculis. Maecenas semper ante turpis, at vulputate mi consectetur non. Sed rutrum nibh turpis, quis rhoncus purus ornare quis. Vestibulum at rutrum mauris. Integer dolor nisi, tincidunt eget vehicula ac, ultricies at ligula. diff --git a/tests/reference/guiBuild_Tool_Step2_Lorem_Ipsum.htm b/tests/reference/guiBuild_Tool_Step2_Lorem_Ipsum.htm index 9162ef03..0e672a68 100644 --- a/tests/reference/guiBuild_Tool_Step2_Lorem_Ipsum.htm +++ b/tests/reference/guiBuild_Tool_Step2_Lorem_Ipsum.htm @@ -22,7 +22,7 @@ article {width: 800px; margin: 40px auto;}
-

Lorem Ipsum

+

Lorem Ipsum

By lipsum.com

“Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…”

“There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…”

@@ -32,7 +32,7 @@ article {width: 800px; margin: 40px auto;}

Prologue

Synopsis: Explanation from the lipsum.com website.

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

-

Act One

+

Act One

“Fusce maximus felis libero”

Chapter One: Chapter One

Point of View: Bod

@@ -62,18 +62,18 @@ article {width: 800px; margin: 40px auto;}

Suspendisse potenti. Fusce tempus lorem nec laoreet suscipit. Fusce vulputate nisl ac diam tincidunt, nec malesuada quam pellentesque. Maecenas congue, tellus quis commodo rutrum, magna leo egestas arcu, quis suscipit ex risus id ligula. Suspendisse potenti. Morbi blandit lacus vitae laoreet vulputate. Donec vitae tellus eleifend, lobortis eros eu, tincidunt enim. Nullam et ullamcorper nisi. Vivamus tellus ex, lobortis quis rutrum ut, dapibus sit amet turpis. Phasellus pellentesque metus diam, commodo tristique ante commodo ac. Ut mollis ipsum nec diam blandit sollicitudin. Duis bibendum lacus nec commodo dapibus. Sed condimentum luctus ante, id ultricies urna varius nec. Nam convallis magna nec bibendum ultrices. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed auctor pharetra quam, vitae porta ex bibendum eu.

Vivamus ut venenatis lectus. Phasellus nec elit id sem dictum ornare. Quisque feugiat, diam eget sagittis ultricies, orci turpis efficitur nisi, et fringilla justo odio nec nibh. In hac habitasse platea dictumst. Sed tempus bibendum feugiat. Etiam luctus mauris arcu, non interdum ipsum ultrices id. Vivamus blandit urna sit amet scelerisque vulputate. Quisque in metus eget massa rutrum dictum sit amet sed nulla. Vivamus vel efficitur dolor.

Ut et consequat enim, quis ornare nibh. In lectus neque, mollis et suscipit et, vestibulum vitae augue. Praesent id ante sit amet odio venenatis placerat a at erat. Sed sed metus sed nisi dictum varius. Integer tincidunt fermentum purus ac porta. Fusce porttitor non risus eget tristique. Donec augue nunc, maximus at fermentum vel, varius et neque. Ut sed consectetur mauris. Quisque ipsum enim, porttitor vitae imperdiet sit amet, tempor et mauris. Aliquam malesuada tincidunt lectus quis blandit. Sed commodo orci felis, quis ultrices tellus facilisis sed. Nunc vel varius est. Duis ullamcorper eu metus in pulvinar. Morbi at sapien dictum, rutrum mauris eget, interdum tellus.

-

Chapter Two: Why do we use it?

+

Why do we use it?

Comment: Exctracted from the lipsum.com website.

It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.

The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.

Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).

-

Chapter Three: Chapter Two

+

Chapter Two: Chapter Two

Point of View: Bod

Plot: Main

Locations: Europe

Synopsis: Curabitur a elit posuere, varius ex et, convallis neque. Phasellus sagittis pharetra sem vitae dapibus. Curabitur varius lorem non pulvinar congue.

Curabitur a elit posuere, varius ex et, convallis neque. Phasellus sagittis pharetra sem vitae dapibus. Curabitur varius lorem non pulvinar congue. Vestibulum pharetra fermentum leo, sed faucibus eros placerat quis. In hac habitasse platea dictumst. Donec metus massa, rutrum quis consequat et, tincidunt ac felis. Duis mollis metus ac nunc tincidunt blandit. Ut aliquet velit eu odio pharetra condimentum. Integer rutrum lacus orci, id venenatis libero accumsan at.

-

Scene 3.1: Scene Three

+

Scene 2.1: Scene Three

Point of View: Bod

Plot: Main

Locations: Europe

@@ -82,7 +82,7 @@ article {width: 800px; margin: 40px auto;}

Pellentesque id sagittis dui. Praesent ut nisi sit amet libero euismod ornare. Vestibulum vehicula, lorem eget aliquet imperdiet, eros nulla iaculis mi, vel bibendum est dui sed orci. Nullam vitae lorem rutrum, euismod lacus id, ullamcorper lectus. Duis nec commodo mi, a fringilla diam. Vestibulum molestie nibh tristique, viverra augue non, aliquet metus. Phasellus a tellus ac nisl tempor aliquet. Nulla vitae sapien rutrum augue ornare ultrices a quis nisi. Sed pulvinar tincidunt ex. Fusce vel sem vitae ante pellentesque lobortis.

Maecenas ullamcorper lacus nec turpis finibus aliquet eget rutrum augue. Integer lorem erat, faucibus non lacus lacinia, pulvinar egestas felis. Proin rutrum nunc eget nulla varius, id blandit mauris tincidunt. Donec sit amet ullamcorper nisi, ut efficitur mi. Aliquam aliquet, nulla eget rhoncus tristique, justo lorem consectetur dui, id ornare leo odio sed tellus. Curabitur interdum velit a turpis condimentum venenatis. Nunc rhoncus sem ac augue auctor, nec malesuada ex fringilla. Vestibulum egestas diam sed leo consectetur vulputate quis eget enim. Nam tincidunt metus sit amet maximus ullamcorper. Sed placerat velit vitae massa efficitur viverra. Etiam eleifend dignissim ante, sed luctus nisl tristique a. In vestibulum pharetra dolor in molestie. Vivamus auctor massa ac magna imperdiet, sit amet iaculis turpis finibus.

Aenean dapibus vulputate purus, sit amet tempor nunc suscipit consequat. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris auctor congue eros, non pellentesque neque dapibus ac. Vestibulum non leo nec urna lacinia eleifend quis et diam. Praesent eu nisi magna. Nulla at magna massa. Suspendisse porta varius scelerisque. Duis at auctor dolor, non dapibus urna. Nunc venenatis feugiat magna non molestie. Aliquam non ornare ex. Quisque eu ultrices velit, quis pellentesque eros. Phasellus eleifend, elit id imperdiet aliquam, nulla quam molestie turpis, at egestas odio ante et tortor. Suspendisse fringilla condimentum justo, at aliquet odio aliquam ac.

-

Scene 3.2: Scene Four

+

Scene 2.2: Scene Four

Point of View: Bod

Plot: Main

Locations: Europe

@@ -93,7 +93,7 @@ article {width: 800px; margin: 40px auto;}

Aenean vestibulum magna placerat fermentum tempus. Nam auctor condimentum nunc, in elementum quam ornare a. Etiam in ipsum elit. Proin pharetra, dolor sollicitudin pellentesque congue, lorem dolor ultricies magna, non iaculis risus nisl dictum diam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Vivamus vel euismod nibh, et lobortis dolor. Maecenas dui odio, gravida nec molestie ut, feugiat ut arcu. Pellentesque risus sapien, gravida a convallis quis, ullamcorper porttitor sapien.

Donec ipsum eros, vestibulum sit amet cursus eget, iaculis quis dolor. Pellentesque magna augue, tristique dapibus mi vitae, molestie venenatis enim. Nam malesuada, turpis volutpat rhoncus ullamcorper, justo est eleifend orci, ut luctus risus ex rutrum arcu. Sed mi elit, feugiat rhoncus ornare sed, porta id leo. Pellentesque feugiat nulla tincidunt erat suscipit, eu congue lacus hendrerit. Morbi pulvinar enim sed consequat auctor. Ut eleifend enim sem, vitae euismod ex ultricies sit amet. Curabitur eu efficitur nisi, suscipit finibus sapien. In sodales blandit erat, vestibulum pulvinar ante volutpat nec. Vivamus dictum non libero at molestie. Donec sit amet neque in ante convallis pretium. Nunc vel iaculis dui.

Phasellus eu nunc ut nunc faucibus laoreet. Aliquam at magna risus. Praesent lobortis, risus finibus semper varius, magna purus vestibulum eros, at pulvinar sapien enim a ex. In scelerisque malesuada ex, sit amet egestas neque condimentum sed. Praesent vulputate efficitur massa. Cras at accumsan ligula. In elementum lectus eget blandit dictum. Nam vitae libero ut justo eleifend rutrum ac nec arcu. Aliquam sodales in quam congue vestibulum. Aliquam in accumsan sapien. Quisque lobortis nisl nisi, vitae bibendum turpis efficitur sed. Vestibulum tempor nulla eget nisi convallis, blandit sagittis ipsum convallis. Donec odio nibh, ultrices quis odio in, mollis euismod libero.

-

Scene 3.3: Scene Five

+

Scene 2.3: Scene Five

Point of View: Bod

Plot: Main

Locations: Europe

diff --git a/tests/reference/guiBuild_Tool_Step2_Lorem_Ipsum.md b/tests/reference/guiBuild_Tool_Step2_Lorem_Ipsum.md index a4aab271..37311525 100644 --- a/tests/reference/guiBuild_Tool_Step2_Lorem_Ipsum.md +++ b/tests/reference/guiBuild_Tool_Step2_Lorem_Ipsum.md @@ -72,7 +72,7 @@ Vivamus ut venenatis lectus. Phasellus nec elit id sem dictum ornare. Quisque fe Ut et consequat enim, quis ornare nibh. In lectus neque, mollis et suscipit et, vestibulum vitae augue. Praesent id ante sit amet odio venenatis placerat a at erat. Sed sed metus sed nisi dictum varius. Integer tincidunt fermentum purus ac porta. Fusce porttitor non risus eget tristique. Donec augue nunc, maximus at fermentum vel, varius et neque. Ut sed consectetur mauris. Quisque ipsum enim, porttitor vitae imperdiet sit amet, tempor et mauris. Aliquam malesuada tincidunt lectus quis blandit. Sed commodo orci felis, quis ultrices tellus facilisis sed. Nunc vel varius est. Duis ullamcorper eu metus in pulvinar. Morbi at sapien dictum, rutrum mauris eget, interdum tellus. -## Chapter Two: Why do we use it? +## Why do we use it? **Comment:** Exctracted from the lipsum.com website. @@ -82,7 +82,7 @@ Ut et consequat enim, quis ornare nibh. In lectus neque, mollis et suscipit et, Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). -## Chapter Three: Chapter Two +## Chapter Two: Chapter Two **Point of View:** Bod **Plot:** Main @@ -92,7 +92,7 @@ Ut et consequat enim, quis ornare nibh. In lectus neque, mollis et suscipit et, Curabitur a elit posuere, varius ex et, convallis neque. Phasellus sagittis pharetra sem vitae dapibus. Curabitur varius lorem non pulvinar congue. Vestibulum pharetra fermentum leo, sed faucibus eros placerat quis. In hac habitasse platea dictumst. Donec metus massa, rutrum quis consequat et, tincidunt ac felis. Duis mollis metus ac nunc tincidunt blandit. Ut aliquet velit eu odio pharetra condimentum. Integer rutrum lacus orci, id venenatis libero accumsan at. -### Scene 3.1: Scene Three +### Scene 2.1: Scene Three **Point of View:** Bod **Plot:** Main @@ -108,7 +108,7 @@ Maecenas ullamcorper lacus nec turpis finibus aliquet eget rutrum augue. Integer Aenean dapibus vulputate purus, sit amet tempor nunc suscipit consequat. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris auctor congue eros, non pellentesque neque dapibus ac. Vestibulum non leo nec urna lacinia eleifend quis et diam. Praesent eu nisi magna. Nulla at magna massa. Suspendisse porta varius scelerisque. Duis at auctor dolor, non dapibus urna. Nunc venenatis feugiat magna non molestie. Aliquam non ornare ex. Quisque eu ultrices velit, quis pellentesque eros. Phasellus eleifend, elit id imperdiet aliquam, nulla quam molestie turpis, at egestas odio ante et tortor. Suspendisse fringilla condimentum justo, at aliquet odio aliquam ac. -### Scene 3.2: Scene Four +### Scene 2.2: Scene Four **Point of View:** Bod **Plot:** Main @@ -128,7 +128,7 @@ Donec ipsum eros, vestibulum sit amet cursus eget, iaculis quis dolor. Pellentes Phasellus eu nunc ut nunc faucibus laoreet. Aliquam at magna risus. Praesent lobortis, risus finibus semper varius, magna purus vestibulum eros, at pulvinar sapien enim a ex. In scelerisque malesuada ex, sit amet egestas neque condimentum sed. Praesent vulputate efficitur massa. Cras at accumsan ligula. In elementum lectus eget blandit dictum. Nam vitae libero ut justo eleifend rutrum ac nec arcu. Aliquam sodales in quam congue vestibulum. Aliquam in accumsan sapien. Quisque lobortis nisl nisi, vitae bibendum turpis efficitur sed. Vestibulum tempor nulla eget nisi convallis, blandit sagittis ipsum convallis. Donec odio nibh, ultrices quis odio in, mollis euismod libero. -### Scene 3.3: Scene Five +### Scene 2.3: Scene Five **Point of View:** Bod **Plot:** Main diff --git a/tests/reference/guiBuild_Tool_Step2_Lorem_Ipsum.nwd b/tests/reference/guiBuild_Tool_Step2_Lorem_Ipsum.nwd index 9ed47b7e..f0e030c7 100644 --- a/tests/reference/guiBuild_Tool_Step2_Lorem_Ipsum.nwd +++ b/tests/reference/guiBuild_Tool_Step2_Lorem_Ipsum.nwd @@ -1,4 +1,4 @@ -# Lorem Ipsum +#! Lorem Ipsum **By lipsum.com** @@ -6,13 +6,14 @@ “There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…” + % Exctracted from the lipsum.com website. Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of “de Finibus Bonorum et Malorum” (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, “Lorem ipsum dolor sit amet..”, comes from a line in section 1.10.32. The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from “de Finibus Bonorum et Malorum” by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. -## Prologue +##! Prologue % Synopsis:Explanation from the lipsum.com website. @@ -72,7 +73,7 @@ Vivamus ut venenatis lectus. Phasellus nec elit id sem dictum ornare. Quisque fe Ut et consequat enim, quis ornare nibh. In lectus neque, mollis et suscipit et, vestibulum vitae augue. Praesent id ante sit amet odio venenatis placerat a at erat. Sed sed metus sed nisi dictum varius. Integer tincidunt fermentum purus ac porta. Fusce porttitor non risus eget tristique. Donec augue nunc, maximus at fermentum vel, varius et neque. Ut sed consectetur mauris. Quisque ipsum enim, porttitor vitae imperdiet sit amet, tempor et mauris. Aliquam malesuada tincidunt lectus quis blandit. Sed commodo orci felis, quis ultrices tellus facilisis sed. Nunc vel varius est. Duis ullamcorper eu metus in pulvinar. Morbi at sapien dictum, rutrum mauris eget, interdum tellus. -## Why do we use it? +##! Why do we use it? % Exctracted from the lipsum.com website. diff --git a/tests/reference/guiBuild_Tool_Step3_Lorem_Ipsum.fodt b/tests/reference/guiBuild_Tool_Step3_Lorem_Ipsum.fodt index d519190d..fe483d20 100644 --- a/tests/reference/guiBuild_Tool_Step3_Lorem_Ipsum.fodt +++ b/tests/reference/guiBuild_Tool_Step3_Lorem_Ipsum.fodt @@ -1,7 +1,7 @@ - 2021-07-31T00:25:38 + 2021-08-02T03:25:21 novelWriter/1.5-alpha0 @@ -59,28 +59,25 @@ - - - - + - + - + - + - + - + - + @@ -102,29 +99,29 @@ - Lorem Ipsum - + Lorem Ipsum + By lipsum.com - “Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…” - “There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…” - Comment: Exctracted from the lipsum.com website. + “Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…” + “There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…” + Comment: Exctracted from the lipsum.com website. Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of “de Finibus Bonorum et Malorum” (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, “Lorem ipsum dolor sit amet..”, comes from a line in section 1.10.32. The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from “de Finibus Bonorum et Malorum” by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. - Prologue + Prologue Synopsis: Explanation from the lipsum.com website. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. - Act One - “Fusce maximus felis libero” - Chapter One: Chapter One - Point of View: Bod - Plot: Main + Act One + “Fusce maximus felis libero” + Chapter One: Chapter One + Point of View: Bod + Plot: Main Locations: Europe Synopsis: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque at aliquam quam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque at aliquam quam. Praesent magna nunc, lacinia sit amet quam eget, aliquet ultrices justo. Morbi ornare enim et lorem rutrum finibus ut eu dolor. Aliquam a orci odio. Ut ultrices sem quis massa placerat, eget mollis nisl cursus. Cras vel sagittis justo. Ut non ultricies leo. Maecenas rutrum velit in est varius, et egestas massa pulvinar. Scene 1.1: Scene One - Point of View: Bod - Plot: Main + Point of View: Bod + Plot: Main Locations: Europe Synopsis: Aenean ut placerat velit. Etiam laoreet ullamcorper risus, eget lobortis enim scelerisque non. Suspendisse id maximus nunc, et mollis sapien. Curabitur vel semper sapien, non pulvinar dolor. Etiam finibus nisi vel mi molestie consectetur. Aenean ut placerat velit. Etiam laoreet ullamcorper risus, eget lobortis enim scelerisque non. Suspendisse id maximus nunc, et mollis sapien. Curabitur vel semper sapien, non pulvinar dolor. Etiam finibus nisi vel mi molestie consectetur. Donec quis ante nunc. Mauris ut leo ipsum. Vestibulum est neque, hendrerit nec neque a, ullamcorper lobortis tellus. Fusce sollicitudin purus quis congue bibendum. Aliquam condimentum ipsum tristique blandit tristique. Donec pulvinar neque ac suscipit malesuada. @@ -133,8 +130,8 @@ Integer vel libero ipsum. Donec varius aliquam libero, sit amet commodo urna hendrerit non. Nullam quis erat mollis nunc viverra volutpat tincidunt in odio. Nam vitae quam sem. Aliquam suscipit nulla non lorem pharetra semper. Ut suscipit erat eu ligula accumsan ultrices. Phasellus nisl tellus, placerat sed laoreet id, consectetur nec dolor. Sed fringilla ipsum id dapibus posuere. Aenean finibus pharetra tincidunt. Ut molestie malesuada nulla, id posuere lorem tincidunt eu. Aliquam tempor eros a est vulputate, scelerisque pulvinar ipsum fermentum. In hac habitasse platea dictumst. Curabitur congue, justo quis interdum fermentum, tellus nulla imperdiet sapien, eu interdum enim tellus condimentum metus. Vivamus nunc velit, dignissim ut ultrices sit amet, ultricies quis enim. Donec ut vestibulum neque. Vivamus semper neque id ex ullamcorper varius. Fusce mattis nibh viverra lorem sagittis, et tempor arcu congue. Suspendisse sit amet felis sed urna facilisis mattis eget vitae arcu. Proin eu magna hendrerit, tristique sem maximus, placerat diam. Nulla tristique sed velit sit amet varius. Etiam vel ornare magna, in vulputate arcu. Cras velit orci, tincidunt sed volutpat cursus, bibendum vel sem. Nunc vulputate pharetra tortor, ac consectetur neque tincidunt sit amet. Nulla ornare mi sed mi dignissim ultricies. Ut tincidunt bibendum mauris, sed elementum ex vulputate vel. Mauris fermentum, felis nec vehicula congue, felis lorem facilisis erat, a dictum dolor augue vitae quam. Maecenas rutrum tortor nec consequat eleifend. Scene 1.2: Scene Two - Point of View: Bod - Plot: Main + Point of View: Bod + Plot: Main Locations: Europe Synopsis: Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer sapien nulla, dictum at lacus a, dignissim consectetur dolor. Nunc vel eleifend lacus, eu dapibus orci. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer sapien nulla, dictum at lacus a, dignissim consectetur dolor. Nunc vel eleifend lacus, eu dapibus orci. Vestibulum facilisis bibendum aliquam. Aliquam posuere, turpis ac bibendum varius, sem tellus venenatis risus, in elementum massa enim ac lorem. Integer in sem ac diam blandit ultricies ut in nulla. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam sit amet erat est. Curabitur vitae cursus justo, sit amet placerat dolor. Vivamus eu felis hendrerit, tincidunt massa rutrum, maximus arcu. Pellentesque commodo justo odio, vel rutrum nulla tincidunt eu. Integer non neque condimentum, convallis diam non, varius ligula. Aliquam eget sapien mauris. Aenean pharetra nunc nisi, vel maximus ante tristique sit amet. Aliquam risus metus, interdum non odio eu, consectetur lacinia sapien. @@ -144,29 +141,29 @@ Suspendisse potenti. Fusce tempus lorem nec laoreet suscipit. Fusce vulputate nisl ac diam tincidunt, nec malesuada quam pellentesque. Maecenas congue, tellus quis commodo rutrum, magna leo egestas arcu, quis suscipit ex risus id ligula. Suspendisse potenti. Morbi blandit lacus vitae laoreet vulputate. Donec vitae tellus eleifend, lobortis eros eu, tincidunt enim. Nullam et ullamcorper nisi. Vivamus tellus ex, lobortis quis rutrum ut, dapibus sit amet turpis. Phasellus pellentesque metus diam, commodo tristique ante commodo ac. Ut mollis ipsum nec diam blandit sollicitudin. Duis bibendum lacus nec commodo dapibus. Sed condimentum luctus ante, id ultricies urna varius nec. Nam convallis magna nec bibendum ultrices. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed auctor pharetra quam, vitae porta ex bibendum eu. Vivamus ut venenatis lectus. Phasellus nec elit id sem dictum ornare. Quisque feugiat, diam eget sagittis ultricies, orci turpis efficitur nisi, et fringilla justo odio nec nibh. In hac habitasse platea dictumst. Sed tempus bibendum feugiat. Etiam luctus mauris arcu, non interdum ipsum ultrices id. Vivamus blandit urna sit amet scelerisque vulputate. Quisque in metus eget massa rutrum dictum sit amet sed nulla. Vivamus vel efficitur dolor. Ut et consequat enim, quis ornare nibh. In lectus neque, mollis et suscipit et, vestibulum vitae augue. Praesent id ante sit amet odio venenatis placerat a at erat. Sed sed metus sed nisi dictum varius. Integer tincidunt fermentum purus ac porta. Fusce porttitor non risus eget tristique. Donec augue nunc, maximus at fermentum vel, varius et neque. Ut sed consectetur mauris. Quisque ipsum enim, porttitor vitae imperdiet sit amet, tempor et mauris. Aliquam malesuada tincidunt lectus quis blandit. Sed commodo orci felis, quis ultrices tellus facilisis sed. Nunc vel varius est. Duis ullamcorper eu metus in pulvinar. Morbi at sapien dictum, rutrum mauris eget, interdum tellus. - Chapter Two: Why do we use it? + Why do we use it? Comment: Exctracted from the lipsum.com website. It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). - Chapter Three: Chapter Two - Point of View: Bod - Plot: Main + Chapter Two: Chapter Two + Point of View: Bod + Plot: Main Locations: Europe Synopsis: Curabitur a elit posuere, varius ex et, convallis neque. Phasellus sagittis pharetra sem vitae dapibus. Curabitur varius lorem non pulvinar congue. Curabitur a elit posuere, varius ex et, convallis neque. Phasellus sagittis pharetra sem vitae dapibus. Curabitur varius lorem non pulvinar congue. Vestibulum pharetra fermentum leo, sed faucibus eros placerat quis. In hac habitasse platea dictumst. Donec metus massa, rutrum quis consequat et, tincidunt ac felis. Duis mollis metus ac nunc tincidunt blandit. Ut aliquet velit eu odio pharetra condimentum. Integer rutrum lacus orci, id venenatis libero accumsan at. - Scene 3.1: Scene Three - Point of View: Bod - Plot: Main + Scene 2.1: Scene Three + Point of View: Bod + Plot: Main Locations: Europe Synopsis: Aenean ut libero ut lectus porttitor rhoncus vel et massa. Nam pretium, nibh et varius vehicula, urna metus blandit eros, euismod pharetra diam diam et libero. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean ut libero ut lectus porttitor rhoncus vel et massa. Nam pretium, nibh et varius vehicula, urna metus blandit eros, euismod pharetra diam diam et libero. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Aenean tincidunt lacus vitae nibh elementum eleifend. Sed rutrum condimentum sem quis blandit. Duis imperdiet libero metus, quis convallis quam faucibus a. Nulla ligula est, semper quis sollicitudin et, pretium id justo. Curabitur pharetra risus eget consectetur commodo. Duis mattis arcu non est condimentum, id venenatis risus volutpat. Pellentesque aliquet mauris non mauris porttitor ultrices. Phasellus ut vestibulum mi. Suspendisse malesuada metus lorem, a malesuada orci rhoncus a. Praesent euismod convallis ante, lacinia tincidunt ex egestas id. Praesent sit amet efficitur sapien. Morbi tincidunt volutpat nunc sed dictum. Aliquam ultrices metus id fermentum lobortis. Pellentesque id sagittis dui. Praesent ut nisi sit amet libero euismod ornare. Vestibulum vehicula, lorem eget aliquet imperdiet, eros nulla iaculis mi, vel bibendum est dui sed orci. Nullam vitae lorem rutrum, euismod lacus id, ullamcorper lectus. Duis nec commodo mi, a fringilla diam. Vestibulum molestie nibh tristique, viverra augue non, aliquet metus. Phasellus a tellus ac nisl tempor aliquet. Nulla vitae sapien rutrum augue ornare ultrices a quis nisi. Sed pulvinar tincidunt ex. Fusce vel sem vitae ante pellentesque lobortis. Maecenas ullamcorper lacus nec turpis finibus aliquet eget rutrum augue. Integer lorem erat, faucibus non lacus lacinia, pulvinar egestas felis. Proin rutrum nunc eget nulla varius, id blandit mauris tincidunt. Donec sit amet ullamcorper nisi, ut efficitur mi. Aliquam aliquet, nulla eget rhoncus tristique, justo lorem consectetur dui, id ornare leo odio sed tellus. Curabitur interdum velit a turpis condimentum venenatis. Nunc rhoncus sem ac augue auctor, nec malesuada ex fringilla. Vestibulum egestas diam sed leo consectetur vulputate quis eget enim. Nam tincidunt metus sit amet maximus ullamcorper. Sed placerat velit vitae massa efficitur viverra. Etiam eleifend dignissim ante, sed luctus nisl tristique a. In vestibulum pharetra dolor in molestie. Vivamus auctor massa ac magna imperdiet, sit amet iaculis turpis finibus. Aenean dapibus vulputate purus, sit amet tempor nunc suscipit consequat. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris auctor congue eros, non pellentesque neque dapibus ac. Vestibulum non leo nec urna lacinia eleifend quis et diam. Praesent eu nisi magna. Nulla at magna massa. Suspendisse porta varius scelerisque. Duis at auctor dolor, non dapibus urna. Nunc venenatis feugiat magna non molestie. Aliquam non ornare ex. Quisque eu ultrices velit, quis pellentesque eros. Phasellus eleifend, elit id imperdiet aliquam, nulla quam molestie turpis, at egestas odio ante et tortor. Suspendisse fringilla condimentum justo, at aliquet odio aliquam ac. - Scene 3.2: Scene Four - Point of View: Bod - Plot: Main + Scene 2.2: Scene Four + Point of View: Bod + Plot: Main Locations: Europe Synopsis: Nam tempor blandit magna laoreet aliquet. Vestibulum auctor posuere leo, ac gravida nisi rhoncus varius. Aenean posuere dolor vitae condimentum volutpat. Donec egestas volutpat risus, quis luctus justo. Nam tempor blandit magna laoreet aliquet. Vestibulum auctor posuere leo, ac gravida nisi rhoncus varius. Aenean posuere dolor vitae condimentum volutpat. Donec egestas volutpat risus, quis luctus justo. Nullam viverra dui et auctor pretium. Ut ullamcorper velit urna, sed imperdiet massa convallis a. Suspendisse efficitur, ipsum nec cursus pulvinar, eros urna posuere diam, nec elementum mi felis vitae sapien. @@ -175,9 +172,9 @@ Aenean vestibulum magna placerat fermentum tempus. Nam auctor condimentum nunc, in elementum quam ornare a. Etiam in ipsum elit. Proin pharetra, dolor sollicitudin pellentesque congue, lorem dolor ultricies magna, non iaculis risus nisl dictum diam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Vivamus vel euismod nibh, et lobortis dolor. Maecenas dui odio, gravida nec molestie ut, feugiat ut arcu. Pellentesque risus sapien, gravida a convallis quis, ullamcorper porttitor sapien. Donec ipsum eros, vestibulum sit amet cursus eget, iaculis quis dolor. Pellentesque magna augue, tristique dapibus mi vitae, molestie venenatis enim. Nam malesuada, turpis volutpat rhoncus ullamcorper, justo est eleifend orci, ut luctus risus ex rutrum arcu. Sed mi elit, feugiat rhoncus ornare sed, porta id leo. Pellentesque feugiat nulla tincidunt erat suscipit, eu congue lacus hendrerit. Morbi pulvinar enim sed consequat auctor. Ut eleifend enim sem, vitae euismod ex ultricies sit amet. Curabitur eu efficitur nisi, suscipit finibus sapien. In sodales blandit erat, vestibulum pulvinar ante volutpat nec. Vivamus dictum non libero at molestie. Donec sit amet neque in ante convallis pretium. Nunc vel iaculis dui. Phasellus eu nunc ut nunc faucibus laoreet. Aliquam at magna risus. Praesent lobortis, risus finibus semper varius, magna purus vestibulum eros, at pulvinar sapien enim a ex. In scelerisque malesuada ex, sit amet egestas neque condimentum sed. Praesent vulputate efficitur massa. Cras at accumsan ligula. In elementum lectus eget blandit dictum. Nam vitae libero ut justo eleifend rutrum ac nec arcu. Aliquam sodales in quam congue vestibulum. Aliquam in accumsan sapien. Quisque lobortis nisl nisi, vitae bibendum turpis efficitur sed. Vestibulum tempor nulla eget nisi convallis, blandit sagittis ipsum convallis. Donec odio nibh, ultrices quis odio in, mollis euismod libero. - Scene 3.3: Scene Five - Point of View: Bod - Plot: Main + Scene 2.3: Scene Five + Point of View: Bod + Plot: Main Locations: Europe Synopsis: Praesent eget est porta, dictum ante in, egestas risus. Mauris risus mauris, consequat aliquam mauris et, feugiat iaculis ipsum. Aliquam arcu ipsum, fermentum ut arcu sed, lobortis euismod sem. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Praesent eget est porta, dictum ante in, egestas risus. Mauris risus mauris, consequat aliquam mauris et, feugiat iaculis ipsum. Aliquam arcu ipsum, fermentum ut arcu sed, lobortis euismod sem. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In sed felis auctor, rhoncus dui ac, consequat dolor. Integer volutpat libero sed nisl aliquet varius. Suspendisse et lorem sapien. Proin id ultrices nibh, ac suscipit diam. Suspendisse placerat varius porttitor. Curabitur elementum sed enim ultrices imperdiet. @@ -185,19 +182,19 @@ Donec luctus lectus efficitur, blandit nisi vitae, dignissim tellus. Pellentesque euismod pharetra augue gravida hendrerit. Quisque nisi mi, mattis ac nisi non, maximus malesuada ante. Nulla lobortis, diam eu ornare ornare, tellus enim feugiat arcu, non vestibulum tortor nunc eu justo. Integer blandit felis justo, eu semper est scelerisque vel. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Nam ultricies, nisi vel elementum commodo, nisl dolor tincidunt magna, sed varius est nunc at lectus. Aliquam dolor tortor, sodales placerat ultricies quis, sodales quis sapien. Duis ullamcorper sollicitudin risus at mattis. Integer consequat et nunc at condimentum. Pellentesque cursus congue augue, non suscipit lectus sodales ut. Nam a mi bibendum, blandit nisl eu, accumsan nunc. Aliquam a ex mauris. Sed nec sem quis arcu dignissim tempus eget et turpis. Ut sed ex nec ipsum ultrices lobortis. Pellentesque rhoncus pharetra eros, non mollis nisi pretium non. Mauris accumsan quis odio quis euismod. Maecenas ultrices, augue et aliquam tincidunt, erat tellus ornare ligula, quis ultrices turpis nibh vel justo. Fusce gravida odio tellus. In a congue diam. Mauris consequat ex id leo lacinia dictum. Fusce id sem sodales, ultrices sapien ac, convallis orci. Donec gravida nunc sit amet nisi hendrerit, sed porta enim aliquam. In hac habitasse platea dictumst. Cras a orci felis. Curabitur non felis nec urna maximus auctor ut ut nisi. Curabitur at turpis eleifend, blandit eros at, molestie odio. Phasellus euismod neque augue. Integer egestas maximus leo eu facilisis. Nunc rhoncus dignissim lectus eu lacinia. Praesent lacinia urna porttitor aliquam condimentum. Nulla eu eros dictum, dictum nunc vitae, sagittis nibh. Integer ante neque, consequat nec sollicitudin id, consectetur vitae dolor. Nullam volutpat sem orci, quis viverra magna auctor a. Suspendisse potenti. Maecenas commodo sed neque pellentesque vehicula. Sed luctus nisl risus, elementum semper purus interdum vel. Ut pulvinar, massa sit amet venenatis placerat, nunc lacus hendrerit odio, non aliquet nunc risus eu lectus. Maecenas feugiat semper ligula, id lobortis sem porta eu. Integer posuere elit magna, at mollis eros bibendum et. Ut imperdiet purus vel nulla aliquam maximus. Morbi sodales purus tellus, a rhoncus sem rutrum sit amet. Quisque risus sem, laoreet nec convallis nec, rutrum vitae justo. - Notes: Characters + Notes: Characters Nobody Owens - Tag: Bod + Tag: Bod Plot: Main Pellentesque nec erat ut nulla posuere commodo. Curabitur nisi augue, imperdiet et porta imperdiet, efficitur id leo. Cras finibus arcu at nibh commodo congue. Proin suscipit placerat condimentum. Aenean ante enim, cursus id lorem a, blandit venenatis nibh. Maecenas suscipit porta elit, sit amet porta felis porttitor eu. Sed a dui nibh. Phasellus sed faucibus dui. Pellentesque felis nulla, ultrices non efficitur quis, rutrum id mi. Mauris tempus auctor nisl, in bibendum enim pellentesque sit amet. Proin nunc lacus, imperdiet nec posuere ac, interdum non lectus. Suspendisse faucibus est auctor orci mollis luctus. Praesent quis sodales neque. Interdum et malesuada fames ac ante ipsum primis in faucibus. Donec sodales rutrum mattis. In in sem ornare, consequat nulla ac, convallis arcu. Duis ac metus id felis commodo commodo sit amet eget diam. Curabitur rhoncus lacinia leo at sodales. Etiam finibus porta diam a viverra. Praesent nisi urna, volutpat sit amet odio at, vehicula vehicula leo. In non enim eget nisl luctus commodo. Pellentesque pellentesque at lectus at luctus. Quisque nec felis bibendum, lacinia libero ut, lacinia eros. Integer finibus ultricies nibh sit amet placerat. Nullam scelerisque velit et tortor congue vestibulum a at nisi. Vivamus sodales ut turpis a convallis. In dignissim nibh at luctus sodales. Etiam sit amet rhoncus massa. Phasellus ligula magna, sollicitudin non imperdiet sit amet, volutpat vel magna. Nunc vestibulum tempor lectus, sit amet porta nunc hendrerit in. Curabitur non odio sit amet massa tincidunt facilisis. Integer et luctus nunc, eget euismod leo. Praesent faucibus metus sed purus convallis scelerisque. Fusce viverra lorem et placerat malesuada. In at elit malesuada, ullamcorper risus vitae, sodales dolor. Donec quis elementum lectus. Quisque eu eros at dui imperdiet euismod ut id neque. - Notes: Plot + Notes: Plot Main Plot Tag: Main Suspendisse vulputate malesuada pellentesque. Aenean sollicitudin cursus mi, vitae ultricies felis ullamcorper eu. Duis luctus risus mi, in accumsan velit cursus ut. Vestibulum eleifend leo in magna eleifend fermentum. Proin nec ornare elit. Phasellus nec interdum risus. In a volutpat augue, quis egestas justo. Morbi porta mauris mattis bibendum imperdiet. Mauris ut erat eu lorem malesuada egestas vel vel urna. Maecenas ac semper quam. Maecenas aliquet metus non interdum mattis. Proin consectetur molestie ligula. Aliquam sollicitudin pulvinar urna a pellentesque. Suspendisse ultrices, est mattis scelerisque porta, nisi nisi laoreet nisl, non condimentum quam ante a velit. Proin scelerisque justo augue, nec laoreet ligula egestas at. Etiam enim quam, ultrices non accumsan hendrerit, elementum vel ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nam efficitur odio libero, in vestibulum arcu aliquam at. Cras non vehicula augue. Integer lobortis, est vitae aliquam facilisis, metus ligula aliquet eros, at porttitor sem tortor eget massa. Aliquam varius scelerisque neque sed gravida. Aenean eleifend lorem id ante elementum sollicitudin. Proin commodo massa a quam volutpat, mollis fermentum turpis efficitur. - Notes: World + Notes: World Ancient Europe Tag: Europe Vivamus sodales risus ac accumsan posuere. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Nunc vel enim felis. Vestibulum dignissim massa nunc, a auctor magna eleifend et. Proin dignissim sodales erat vitae convallis. Aliquam id tellus dui. Curabitur sollicitudin scelerisque ex sit amet posuere. Nam rutrum felis id rhoncus feugiat. Duis sagittis quam quis purus efficitur, quis rutrum odio iaculis. Maecenas semper ante turpis, at vulputate mi consectetur non. Sed rutrum nibh turpis, quis rhoncus purus ornare quis. Vestibulum at rutrum mauris. Integer dolor nisi, tincidunt eget vehicula ac, ultricies at ligula. diff --git a/tests/reference/guiBuild_Tool_Step3_Lorem_Ipsum.htm b/tests/reference/guiBuild_Tool_Step3_Lorem_Ipsum.htm index 14305e48..1a945ea4 100644 --- a/tests/reference/guiBuild_Tool_Step3_Lorem_Ipsum.htm +++ b/tests/reference/guiBuild_Tool_Step3_Lorem_Ipsum.htm @@ -22,7 +22,7 @@ article {width: 800px; margin: 40px auto;}
-

Lorem Ipsum

+

Lorem Ipsum

By lipsum.com

“Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit…”

“There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…”

@@ -32,7 +32,7 @@ article {width: 800px; margin: 40px auto;}

Prologue

Synopsis: Explanation from the lipsum.com website.

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

-

Act One

+

Act One

“Fusce maximus felis libero”

Chapter One: Chapter One

Point of View: Bod

@@ -62,18 +62,18 @@ article {width: 800px; margin: 40px auto;}

Suspendisse potenti. Fusce tempus lorem nec laoreet suscipit. Fusce vulputate nisl ac diam tincidunt, nec malesuada quam pellentesque. Maecenas congue, tellus quis commodo rutrum, magna leo egestas arcu, quis suscipit ex risus id ligula. Suspendisse potenti. Morbi blandit lacus vitae laoreet vulputate. Donec vitae tellus eleifend, lobortis eros eu, tincidunt enim. Nullam et ullamcorper nisi. Vivamus tellus ex, lobortis quis rutrum ut, dapibus sit amet turpis. Phasellus pellentesque metus diam, commodo tristique ante commodo ac. Ut mollis ipsum nec diam blandit sollicitudin. Duis bibendum lacus nec commodo dapibus. Sed condimentum luctus ante, id ultricies urna varius nec. Nam convallis magna nec bibendum ultrices. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed auctor pharetra quam, vitae porta ex bibendum eu.

Vivamus ut venenatis lectus. Phasellus nec elit id sem dictum ornare. Quisque feugiat, diam eget sagittis ultricies, orci turpis efficitur nisi, et fringilla justo odio nec nibh. In hac habitasse platea dictumst. Sed tempus bibendum feugiat. Etiam luctus mauris arcu, non interdum ipsum ultrices id. Vivamus blandit urna sit amet scelerisque vulputate. Quisque in metus eget massa rutrum dictum sit amet sed nulla. Vivamus vel efficitur dolor.

Ut et consequat enim, quis ornare nibh. In lectus neque, mollis et suscipit et, vestibulum vitae augue. Praesent id ante sit amet odio venenatis placerat a at erat. Sed sed metus sed nisi dictum varius. Integer tincidunt fermentum purus ac porta. Fusce porttitor non risus eget tristique. Donec augue nunc, maximus at fermentum vel, varius et neque. Ut sed consectetur mauris. Quisque ipsum enim, porttitor vitae imperdiet sit amet, tempor et mauris. Aliquam malesuada tincidunt lectus quis blandit. Sed commodo orci felis, quis ultrices tellus facilisis sed. Nunc vel varius est. Duis ullamcorper eu metus in pulvinar. Morbi at sapien dictum, rutrum mauris eget, interdum tellus.

-

Chapter Two: Why do we use it?

+

Why do we use it?

Comment: Exctracted from the lipsum.com website.

        It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.

        The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English.

        Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).

-

Chapter Three: Chapter Two

+

Chapter Two: Chapter Two

Point of View: Bod

Plot: Main

Locations: Europe

Synopsis: Curabitur a elit posuere, varius ex et, convallis neque. Phasellus sagittis pharetra sem vitae dapibus. Curabitur varius lorem non pulvinar congue.

Curabitur a elit posuere, varius ex et, convallis neque. Phasellus sagittis pharetra sem vitae dapibus. Curabitur varius lorem non pulvinar congue. Vestibulum pharetra fermentum leo, sed faucibus eros placerat quis. In hac habitasse platea dictumst. Donec metus massa, rutrum quis consequat et, tincidunt ac felis. Duis mollis metus ac nunc tincidunt blandit. Ut aliquet velit eu odio pharetra condimentum. Integer rutrum lacus orci, id venenatis libero accumsan at.

-

Scene 3.1: Scene Three

+

Scene 2.1: Scene Three

Point of View: Bod

Plot: Main

Locations: Europe

@@ -82,7 +82,7 @@ article {width: 800px; margin: 40px auto;}

Pellentesque id sagittis dui. Praesent ut nisi sit amet libero euismod ornare. Vestibulum vehicula, lorem eget aliquet imperdiet, eros nulla iaculis mi, vel bibendum est dui sed orci. Nullam vitae lorem rutrum, euismod lacus id, ullamcorper lectus. Duis nec commodo mi, a fringilla diam. Vestibulum molestie nibh tristique, viverra augue non, aliquet metus. Phasellus a tellus ac nisl tempor aliquet. Nulla vitae sapien rutrum augue ornare ultrices a quis nisi. Sed pulvinar tincidunt ex. Fusce vel sem vitae ante pellentesque lobortis.

Maecenas ullamcorper lacus nec turpis finibus aliquet eget rutrum augue. Integer lorem erat, faucibus non lacus lacinia, pulvinar egestas felis. Proin rutrum nunc eget nulla varius, id blandit mauris tincidunt. Donec sit amet ullamcorper nisi, ut efficitur mi. Aliquam aliquet, nulla eget rhoncus tristique, justo lorem consectetur dui, id ornare leo odio sed tellus. Curabitur interdum velit a turpis condimentum venenatis. Nunc rhoncus sem ac augue auctor, nec malesuada ex fringilla. Vestibulum egestas diam sed leo consectetur vulputate quis eget enim. Nam tincidunt metus sit amet maximus ullamcorper. Sed placerat velit vitae massa efficitur viverra. Etiam eleifend dignissim ante, sed luctus nisl tristique a. In vestibulum pharetra dolor in molestie. Vivamus auctor massa ac magna imperdiet, sit amet iaculis turpis finibus.

Aenean dapibus vulputate purus, sit amet tempor nunc suscipit consequat. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris auctor congue eros, non pellentesque neque dapibus ac. Vestibulum non leo nec urna lacinia eleifend quis et diam. Praesent eu nisi magna. Nulla at magna massa. Suspendisse porta varius scelerisque. Duis at auctor dolor, non dapibus urna. Nunc venenatis feugiat magna non molestie. Aliquam non ornare ex. Quisque eu ultrices velit, quis pellentesque eros. Phasellus eleifend, elit id imperdiet aliquam, nulla quam molestie turpis, at egestas odio ante et tortor. Suspendisse fringilla condimentum justo, at aliquet odio aliquam ac.

-

Scene 3.2: Scene Four

+

Scene 2.2: Scene Four

Point of View: Bod

Plot: Main

Locations: Europe

@@ -93,7 +93,7 @@ article {width: 800px; margin: 40px auto;}

Aenean vestibulum magna placerat fermentum tempus. Nam auctor condimentum nunc, in elementum quam ornare a. Etiam in ipsum elit. Proin pharetra, dolor sollicitudin pellentesque congue, lorem dolor ultricies magna, non iaculis risus nisl dictum diam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Vivamus vel euismod nibh, et lobortis dolor. Maecenas dui odio, gravida nec molestie ut, feugiat ut arcu. Pellentesque risus sapien, gravida a convallis quis, ullamcorper porttitor sapien.

Donec ipsum eros, vestibulum sit amet cursus eget, iaculis quis dolor. Pellentesque magna augue, tristique dapibus mi vitae, molestie venenatis enim. Nam malesuada, turpis volutpat rhoncus ullamcorper, justo est eleifend orci, ut luctus risus ex rutrum arcu. Sed mi elit, feugiat rhoncus ornare sed, porta id leo. Pellentesque feugiat nulla tincidunt erat suscipit, eu congue lacus hendrerit. Morbi pulvinar enim sed consequat auctor. Ut eleifend enim sem, vitae euismod ex ultricies sit amet. Curabitur eu efficitur nisi, suscipit finibus sapien. In sodales blandit erat, vestibulum pulvinar ante volutpat nec. Vivamus dictum non libero at molestie. Donec sit amet neque in ante convallis pretium. Nunc vel iaculis dui.

Phasellus eu nunc ut nunc faucibus laoreet. Aliquam at magna risus. Praesent lobortis, risus finibus semper varius, magna purus vestibulum eros, at pulvinar sapien enim a ex. In scelerisque malesuada ex, sit amet egestas neque condimentum sed. Praesent vulputate efficitur massa. Cras at accumsan ligula. In elementum lectus eget blandit dictum. Nam vitae libero ut justo eleifend rutrum ac nec arcu. Aliquam sodales in quam congue vestibulum. Aliquam in accumsan sapien. Quisque lobortis nisl nisi, vitae bibendum turpis efficitur sed. Vestibulum tempor nulla eget nisi convallis, blandit sagittis ipsum convallis. Donec odio nibh, ultrices quis odio in, mollis euismod libero.

-

Scene 3.3: Scene Five

+

Scene 2.3: Scene Five

Point of View: Bod

Plot: Main

Locations: Europe

diff --git a/tests/reference/guiBuild_Tool_Step3_Lorem_Ipsum.md b/tests/reference/guiBuild_Tool_Step3_Lorem_Ipsum.md index 1fba3815..4c2dee67 100644 --- a/tests/reference/guiBuild_Tool_Step3_Lorem_Ipsum.md +++ b/tests/reference/guiBuild_Tool_Step3_Lorem_Ipsum.md @@ -72,7 +72,7 @@ Vivamus ut venenatis lectus. Phasellus nec elit id sem dictum ornare. Quisque fe Ut et consequat enim, quis ornare nibh. In lectus neque, mollis et suscipit et, vestibulum vitae augue. Praesent id ante sit amet odio venenatis placerat a at erat. Sed sed metus sed nisi dictum varius. Integer tincidunt fermentum purus ac porta. Fusce porttitor non risus eget tristique. Donec augue nunc, maximus at fermentum vel, varius et neque. Ut sed consectetur mauris. Quisque ipsum enim, porttitor vitae imperdiet sit amet, tempor et mauris. Aliquam malesuada tincidunt lectus quis blandit. Sed commodo orci felis, quis ultrices tellus facilisis sed. Nunc vel varius est. Duis ullamcorper eu metus in pulvinar. Morbi at sapien dictum, rutrum mauris eget, interdum tellus. -## Chapter Two: Why do we use it? +## Why do we use it? **Comment:** Exctracted from the lipsum.com website. @@ -82,7 +82,7 @@ Ut et consequat enim, quis ornare nibh. In lectus neque, mollis et suscipit et, Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like). -## Chapter Three: Chapter Two +## Chapter Two: Chapter Two **Point of View:** Bod **Plot:** Main @@ -92,7 +92,7 @@ Ut et consequat enim, quis ornare nibh. In lectus neque, mollis et suscipit et, Curabitur a elit posuere, varius ex et, convallis neque. Phasellus sagittis pharetra sem vitae dapibus. Curabitur varius lorem non pulvinar congue. Vestibulum pharetra fermentum leo, sed faucibus eros placerat quis. In hac habitasse platea dictumst. Donec metus massa, rutrum quis consequat et, tincidunt ac felis. Duis mollis metus ac nunc tincidunt blandit. Ut aliquet velit eu odio pharetra condimentum. Integer rutrum lacus orci, id venenatis libero accumsan at. -### Scene 3.1: Scene Three +### Scene 2.1: Scene Three **Point of View:** Bod **Plot:** Main @@ -108,7 +108,7 @@ Maecenas ullamcorper lacus nec turpis finibus aliquet eget rutrum augue. Integer Aenean dapibus vulputate purus, sit amet tempor nunc suscipit consequat. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris auctor congue eros, non pellentesque neque dapibus ac. Vestibulum non leo nec urna lacinia eleifend quis et diam. Praesent eu nisi magna. Nulla at magna massa. Suspendisse porta varius scelerisque. Duis at auctor dolor, non dapibus urna. Nunc venenatis feugiat magna non molestie. Aliquam non ornare ex. Quisque eu ultrices velit, quis pellentesque eros. Phasellus eleifend, elit id imperdiet aliquam, nulla quam molestie turpis, at egestas odio ante et tortor. Suspendisse fringilla condimentum justo, at aliquet odio aliquam ac. -### Scene 3.2: Scene Four +### Scene 2.2: Scene Four **Point of View:** Bod **Plot:** Main @@ -128,7 +128,7 @@ Donec ipsum eros, vestibulum sit amet cursus eget, iaculis quis dolor. Pellentes Phasellus eu nunc ut nunc faucibus laoreet. Aliquam at magna risus. Praesent lobortis, risus finibus semper varius, magna purus vestibulum eros, at pulvinar sapien enim a ex. In scelerisque malesuada ex, sit amet egestas neque condimentum sed. Praesent vulputate efficitur massa. Cras at accumsan ligula. In elementum lectus eget blandit dictum. Nam vitae libero ut justo eleifend rutrum ac nec arcu. Aliquam sodales in quam congue vestibulum. Aliquam in accumsan sapien. Quisque lobortis nisl nisi, vitae bibendum turpis efficitur sed. Vestibulum tempor nulla eget nisi convallis, blandit sagittis ipsum convallis. Donec odio nibh, ultrices quis odio in, mollis euismod libero. -### Scene 3.3: Scene Five +### Scene 2.3: Scene Five **Point of View:** Bod **Plot:** Main diff --git a/tests/reference/guiBuild_Tool_Step3_Lorem_Ipsum.nwd b/tests/reference/guiBuild_Tool_Step3_Lorem_Ipsum.nwd index 9ed47b7e..f0e030c7 100644 --- a/tests/reference/guiBuild_Tool_Step3_Lorem_Ipsum.nwd +++ b/tests/reference/guiBuild_Tool_Step3_Lorem_Ipsum.nwd @@ -1,4 +1,4 @@ -# Lorem Ipsum +#! Lorem Ipsum **By lipsum.com** @@ -6,13 +6,14 @@ “There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain…” + % Exctracted from the lipsum.com website. Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of “de Finibus Bonorum et Malorum” (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, “Lorem ipsum dolor sit amet..”, comes from a line in section 1.10.32. The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from “de Finibus Bonorum et Malorum” by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham. -## Prologue +##! Prologue % Synopsis:Explanation from the lipsum.com website. @@ -72,7 +73,7 @@ Vivamus ut venenatis lectus. Phasellus nec elit id sem dictum ornare. Quisque fe Ut et consequat enim, quis ornare nibh. In lectus neque, mollis et suscipit et, vestibulum vitae augue. Praesent id ante sit amet odio venenatis placerat a at erat. Sed sed metus sed nisi dictum varius. Integer tincidunt fermentum purus ac porta. Fusce porttitor non risus eget tristique. Donec augue nunc, maximus at fermentum vel, varius et neque. Ut sed consectetur mauris. Quisque ipsum enim, porttitor vitae imperdiet sit amet, tempor et mauris. Aliquam malesuada tincidunt lectus quis blandit. Sed commodo orci felis, quis ultrices tellus facilisis sed. Nunc vel varius est. Duis ullamcorper eu metus in pulvinar. Morbi at sapien dictum, rutrum mauris eget, interdum tellus. -## Why do we use it? +##! Why do we use it? % Exctracted from the lipsum.com website. diff --git a/tests/reference/guiBuild_Tool_Step4H_Lorem_Ipsum.json b/tests/reference/guiBuild_Tool_Step4H_Lorem_Ipsum.json index cc6d8c91..44666860 100644 --- a/tests/reference/guiBuild_Tool_Step4H_Lorem_Ipsum.json +++ b/tests/reference/guiBuild_Tool_Step4H_Lorem_Ipsum.json @@ -5,7 +5,7 @@ "authors": [ "lipsum.com" ], - "buildTime": 1612954696 + "buildTime": 1627336583 }, "text": { "css": [ @@ -25,7 +25,7 @@ ], "html": [ [ - "

Lorem Ipsum

" + "

Lorem Ipsum

" ], [ "" @@ -35,7 +35,7 @@ "

Synopsis: Explanation from the lipsum.com website.

" ], [ - "

Act One

" + "

Act One

" ], [ "

Chapter One: Chapter One

", @@ -90,4 +90,4 @@ ] ] } -} \ No newline at end of file +} diff --git a/tests/reference/guiBuild_Tool_Step4M_Lorem_Ipsum.json b/tests/reference/guiBuild_Tool_Step4M_Lorem_Ipsum.json index 9c357d54..cdfa694e 100644 --- a/tests/reference/guiBuild_Tool_Step4M_Lorem_Ipsum.json +++ b/tests/reference/guiBuild_Tool_Step4M_Lorem_Ipsum.json @@ -5,12 +5,12 @@ "authors": [ "lipsum.com" ], - "buildTime": 1601120788 + "buildTime": 1627867578 }, "text": { "nwd": [ [ - "# Lorem Ipsum", + "#! Lorem Ipsum", "", "", "", @@ -21,10 +21,11 @@ "", "", "", + "", "" ], [ - "## Prologue", + "##! Prologue", "", "% Synopsis:Explanation from the lipsum.com website.", "", @@ -147,4 +148,4 @@ ] ] } -} \ No newline at end of file +} diff --git a/tests/reference/guiBuild_Tool_Step4_Lorem_Ipsum.htm b/tests/reference/guiBuild_Tool_Step4_Lorem_Ipsum.htm index f7629ef9..20f6e6b6 100644 --- a/tests/reference/guiBuild_Tool_Step4_Lorem_Ipsum.htm +++ b/tests/reference/guiBuild_Tool_Step4_Lorem_Ipsum.htm @@ -22,10 +22,10 @@ article {width: 800px; margin: 40px auto;}
-

Lorem Ipsum

+

Lorem Ipsum

Prologue

Synopsis: Explanation from the lipsum.com website.

-

Act One

+

Act One

Chapter One: Chapter One

Point of View: Bod

Plot: Main

diff --git a/tests/reference/guiBuild_Tool_Step4_Lorem_Ipsum.nwd b/tests/reference/guiBuild_Tool_Step4_Lorem_Ipsum.nwd index 4867d764..fa1b8656 100644 --- a/tests/reference/guiBuild_Tool_Step4_Lorem_Ipsum.nwd +++ b/tests/reference/guiBuild_Tool_Step4_Lorem_Ipsum.nwd @@ -1,4 +1,4 @@ -# Lorem Ipsum +#! Lorem Ipsum @@ -6,7 +6,8 @@ -## Prologue + +##! Prologue % Synopsis:Explanation from the lipsum.com website. diff --git a/tests/reference/guiEditor_Main_Final_0e17daca5f3e1.nwd b/tests/reference/guiEditor_Main_Final_0e17daca5f3e1.nwd index 65bcb039..2fd0b8b5 100644 --- a/tests/reference/guiEditor_Main_Final_0e17daca5f3e1.nwd +++ b/tests/reference/guiEditor_Main_Final_0e17daca5f3e1.nwd @@ -1,6 +1,6 @@ %%~name: New Scene %%~path: 31489056e0916/0e17daca5f3e1 -%%~kind: NOVEL/BOOK +%%~kind: NOVEL/DOCUMENT # Novel ## Chapter diff --git a/tests/reference/guiEditor_Main_Final_nwProject.nwx b/tests/reference/guiEditor_Main_Final_nwProject.nwx index 861888fa..8230ba92 100644 --- a/tests/reference/guiEditor_Main_Final_nwProject.nwx +++ b/tests/reference/guiEditor_Main_Final_nwProject.nwx @@ -1,11 +1,11 @@ - + New Project - 4 + 5 2 - 8 + 3 True @@ -21,7 +21,7 @@ %title% - Chapter %ch%: %title% + %title% %title% * * *
@@ -53,7 +53,7 @@ NOVEL New True - TITLE + DOCUMENT 11 2 0 @@ -72,7 +72,7 @@ NOVEL New True - CHAPTER + DOCUMENT 11 2 0 @@ -84,7 +84,7 @@ NOVEL New True - BOOK + DOCUMENT 482 83 4 diff --git a/tests/reference/guiEditor_Main_Initial_nwProject.nwx b/tests/reference/guiEditor_Main_Initial_nwProject.nwx index 96af56bb..7d2cfe5f 100644 --- a/tests/reference/guiEditor_Main_Initial_nwProject.nwx +++ b/tests/reference/guiEditor_Main_Initial_nwProject.nwx @@ -1,9 +1,9 @@ - + New Project - 2 + 3 1 0 @@ -21,7 +21,7 @@ %title% - Chapter %ch%: %title% + %title% %title% * * *
@@ -53,7 +53,7 @@ NOVEL New True - TITLE + DOCUMENT 11 2 0 @@ -72,7 +72,7 @@ NOVEL New True - CHAPTER + DOCUMENT 11 2 0 @@ -84,7 +84,7 @@ NOVEL New True - SCENE + DOCUMENT 9 2 0 diff --git a/tests/reference/guiItemEditor_Dialog_nwProject.nwx b/tests/reference/guiItemEditor_Dialog_nwProject.nwx index 89beddc9..17f65bcd 100644 --- a/tests/reference/guiItemEditor_Dialog_nwProject.nwx +++ b/tests/reference/guiItemEditor_Dialog_nwProject.nwx @@ -1,9 +1,9 @@ - + New Project - 1 + 2 1 0 @@ -21,7 +21,7 @@ %title% - Chapter %ch%: %title% + %title% %title% * * *
@@ -53,7 +53,7 @@ NOVEL New True - TITLE + DOCUMENT 11 2 0 @@ -72,7 +72,7 @@ NOVEL New True - CHAPTER + DOCUMENT 11 2 0 @@ -84,7 +84,7 @@ NOVEL Note False - PAGE + DOCUMENT 9 2 0 diff --git a/tests/reference/guiProjSettings_Dialog_nwProject.nwx b/tests/reference/guiProjSettings_Dialog_nwProject.nwx index a935bee7..96334e16 100644 --- a/tests/reference/guiProjSettings_Dialog_nwProject.nwx +++ b/tests/reference/guiProjSettings_Dialog_nwProject.nwx @@ -1,11 +1,11 @@ - + Project Name Project Title Jane Doe John Doh - 1 + 2 1 0 @@ -27,7 +27,7 @@
%title% - Chapter %ch%: %title% + %title% %title% * * *
@@ -59,7 +59,7 @@ NOVEL New True - TITLE + DOCUMENT 11 2 0 @@ -78,7 +78,7 @@ NOVEL New True - CHAPTER + DOCUMENT 11 2 0 @@ -90,7 +90,7 @@ NOVEL New True - SCENE + DOCUMENT 9 2 0 diff --git a/tests/test_base/test_base_common.py b/tests/test_base/test_base_common.py index ffc8a4ab..c011f112 100644 --- a/tests/test_base/test_base_common.py +++ b/tests/test_base/test_base_common.py @@ -175,13 +175,7 @@ def testBaseCommon_IsItemLayout(): """Test the isItemLayout function. """ assert isItemLayout("NO_LAYOUT") is True - assert isItemLayout("TITLE") is True - assert isItemLayout("BOOK") is True - assert isItemLayout("PAGE") is True - assert isItemLayout("PARTITION") is True - assert isItemLayout("UNNUMBERED") is True - assert isItemLayout("CHAPTER") is True - assert isItemLayout("SCENE") is True + assert isItemLayout("DOCUMENT") is True assert isItemLayout("NOTE") is True assert isItemLayout("None") is False diff --git a/tests/test_base/test_base_error.py b/tests/test_base/test_base_error.py index 03cbbb5d..713e6892 100644 --- a/tests/test_base/test_base_error.py +++ b/tests/test_base/test_base_error.py @@ -37,7 +37,7 @@ def testBaseError_Dialog(qtbot, monkeypatch, fncDir, tmpDir): nwGUI = nw.main(["--testmode", "--config=%s" % fncDir, "--data=%s" % tmpDir]) qtbot.addWidget(nwGUI) nwGUI.show() - qtbot.waitForWindowShown(nwGUI) + qtbot.wait(20) nwErr = NWErrorMessage(nwGUI) qtbot.addWidget(nwErr) @@ -82,7 +82,7 @@ def testBaseError_Handler(qtbot, monkeypatch, fncDir, tmpDir): nwGUI = nw.main(["--testmode", "--config=%s" % fncDir, "--data=%s" % tmpDir]) qtbot.addWidget(nwGUI) nwGUI.show() - qtbot.waitForWindowShown(nwGUI) + qtbot.wait(20) # Normal shutdown with monkeypatch.context() as mp: diff --git a/tests/test_core/test_core_document.py b/tests/test_core/test_core_document.py index 85ae47af..ff33b12f 100644 --- a/tests/test_core/test_core_document.py +++ b/tests/test_core/test_core_document.py @@ -79,7 +79,7 @@ def testCoreDocument_LoadSave(monkeypatch, mockGUI, nwMinimal): assert readFile(docPath) == ( "%%~name: New File\n" f"%%~path: a508bb932959c/{xHandle}\n" - "%%~kind: NOVEL/SCENE\n" + "%%~kind: NOVEL/DOCUMENT\n" "### Test File\n\n" "Text ...\n\n" ) @@ -145,14 +145,14 @@ def testCoreDocument_Methods(mockGUI, nwMinimal): assert theName == "New Scene" assert theParent == "a6d311a93600a" assert theClass == nwItemClass.NOVEL - assert theLayout == nwItemLayout.SCENE + assert theLayout == nwItemLayout.DOCUMENT # Add meta data garbage assert theDoc.writeDocument("%%~ stuff\n### Test File\n\nText ...\n\n") assert readFile(docPath) == ( "%%~name: New Scene\n" f"%%~path: a6d311a93600a/{sHandle}\n" - "%%~kind: NOVEL/SCENE\n" + "%%~kind: NOVEL/DOCUMENT\n" "%%~ stuff\n" "### Test File\n\n" "Text ...\n\n" diff --git a/tests/test_core/test_core_index.py b/tests/test_core/test_core_index.py index c9064563..95f410b6 100644 --- a/tests/test_core/test_core_index.py +++ b/tests/test_core/test_core_index.py @@ -267,7 +267,7 @@ def testCoreIndex_ScanText(nwMinimal, mockGUI): assert theIndex.scanText(dHandle, "Hello World!") is False assert theIndex.scanText(xHandle, "Hello World!") is False - xItem.setLayout(nwItemLayout.SCENE) + xItem.setLayout(nwItemLayout.DOCUMENT) xItem.setParent(None) assert theIndex.scanText(xHandle, "Hello World!") is False @@ -284,11 +284,15 @@ def testCoreIndex_ScanText(nwMinimal, mockGUI): assert theIndex.scanText(xHandle, "Hello World!") is False # Make some usable items + tHandle = theProject.newFile("Title", nwItemClass.NOVEL, "a508bb932959c") pHandle = theProject.newFile("Page", nwItemClass.NOVEL, "a508bb932959c") nHandle = theProject.newFile("Hello", nwItemClass.NOVEL, "a508bb932959c") cHandle = theProject.newFile("Jane", nwItemClass.CHARACTER, "afb3043c7b2b3") sHandle = theProject.newFile("Scene", nwItemClass.NOVEL, "a508bb932959c") + # Text Indexing + # ============= + # Index correct text assert theIndex.scanText(cHandle, ( "# Jane Smith\n" @@ -305,7 +309,10 @@ def testCoreIndex_ScanText(nwMinimal, mockGUI): assert theIndex._tagIndex == {"Jane": [2, cHandle, "CHARACTER", "T000001"]} assert theIndex.getNovelData(nHandle, "T000001")["title"] == "Hello World!" - # Check that title sections are indexed properly + # Title Indexing + # ============== + + # Document File assert theIndex.scanText(nHandle, ( "# Title One\n\n" "% synopsis: Synopsis One.\n\n" @@ -322,7 +329,7 @@ def testCoreIndex_ScanText(nwMinimal, mockGUI): "##### Title Five\n\n" # Not interpreted as a title, the hashes are counted as a word "Paragraph Five.\n\n" )) - assert cHandle not in theIndex._refIndex + assert nHandle not in theIndex._refIndex assert theIndex._fileIndex[nHandle]["T000001"]["level"] == "H1" assert theIndex._fileIndex[nHandle]["T000007"]["level"] == "H2" @@ -334,10 +341,10 @@ def testCoreIndex_ScanText(nwMinimal, mockGUI): assert theIndex._fileIndex[nHandle]["T000013"]["title"] == "Title Three" assert theIndex._fileIndex[nHandle]["T000019"]["title"] == "Title Four" - assert theIndex._fileIndex[nHandle]["T000001"]["layout"] == "SCENE" - assert theIndex._fileIndex[nHandle]["T000007"]["layout"] == "SCENE" - assert theIndex._fileIndex[nHandle]["T000013"]["layout"] == "SCENE" - assert theIndex._fileIndex[nHandle]["T000019"]["layout"] == "SCENE" + assert theIndex._fileIndex[nHandle]["T000001"]["layout"] == "DOCUMENT" + assert theIndex._fileIndex[nHandle]["T000007"]["layout"] == "DOCUMENT" + assert theIndex._fileIndex[nHandle]["T000013"]["layout"] == "DOCUMENT" + assert theIndex._fileIndex[nHandle]["T000019"]["layout"] == "DOCUMENT" assert theIndex._fileIndex[nHandle]["T000001"]["cCount"] == 23 assert theIndex._fileIndex[nHandle]["T000007"]["cCount"] == 23 @@ -359,6 +366,7 @@ def testCoreIndex_ScanText(nwMinimal, mockGUI): assert theIndex._fileIndex[nHandle]["T000013"]["synopsis"] == "Synopsis Three." assert theIndex._fileIndex[nHandle]["T000019"]["synopsis"] == "Synopsis Four." + # Note File assert theIndex.scanText(cHandle, ( "# Title One\n\n" "@tag: One\n\n" @@ -375,6 +383,7 @@ def testCoreIndex_ScanText(nwMinimal, mockGUI): assert theIndex._fileIndex[cHandle]["T000001"]["pCount"] == 1 assert theIndex._fileIndex[cHandle]["T000001"]["synopsis"] == "Synopsis One." + # Valid and Invalid References assert theIndex.scanText(sHandle, ( "# Title One\n\n" "@pov: One\n\n" # Valid @@ -387,15 +396,48 @@ def testCoreIndex_ScanText(nwMinimal, mockGUI): [[3, "@pov", "One"], [5, "@char", "Two"]] ) + # Special Titles + # ============== + + assert theIndex.scanText(tHandle, ( + "#! My Project\n\n" + ">> By Jane Doe <<\n\n" + )) + assert tHandle not in theIndex._refIndex + + assert theIndex._fileIndex[tHandle]["T000001"]["level"] == "H1" + assert theIndex._fileIndex[tHandle]["T000001"]["title"] == "My Project" + assert theIndex._fileIndex[tHandle]["T000001"]["layout"] == "DOCUMENT" + assert theIndex._fileIndex[tHandle]["T000001"]["cCount"] == 21 + assert theIndex._fileIndex[tHandle]["T000001"]["wCount"] == 5 + assert theIndex._fileIndex[tHandle]["T000001"]["pCount"] == 1 + assert theIndex._fileIndex[tHandle]["T000001"]["synopsis"] == "" + + assert theIndex.scanText(tHandle, ( + "##! Prologue\n\n" + "In the beginning there was time ...\n\n" + )) + assert tHandle not in theIndex._refIndex + + assert theIndex._fileIndex[tHandle]["T000001"]["level"] == "H2" + assert theIndex._fileIndex[tHandle]["T000001"]["title"] == "Prologue" + assert theIndex._fileIndex[tHandle]["T000001"]["layout"] == "DOCUMENT" + assert theIndex._fileIndex[tHandle]["T000001"]["cCount"] == 43 + assert theIndex._fileIndex[tHandle]["T000001"]["wCount"] == 8 + assert theIndex._fileIndex[tHandle]["T000001"]["pCount"] == 1 + assert theIndex._fileIndex[tHandle]["T000001"]["synopsis"] == "" + # Page wo/Title - theProject.projTree[pHandle].itemLayout = nwItemLayout.PAGE + # ============= + + theProject.projTree[pHandle].itemLayout = nwItemLayout.DOCUMENT assert theIndex.scanText(pHandle, ( "This is a page with some text on it.\n\n" )) assert pHandle in theIndex._fileIndex assert theIndex._fileIndex[pHandle]["T000000"]["level"] == "H0" assert theIndex._fileIndex[pHandle]["T000000"]["title"] == "" - assert theIndex._fileIndex[pHandle]["T000000"]["layout"] == "PAGE" + assert theIndex._fileIndex[pHandle]["T000000"]["layout"] == "DOCUMENT" assert theIndex._fileIndex[pHandle]["T000000"]["cCount"] == 36 assert theIndex._fileIndex[pHandle]["T000000"]["wCount"] == 9 assert theIndex._fileIndex[pHandle]["T000000"]["pCount"] == 1 @@ -587,9 +629,9 @@ def testCoreIndex_ExtractData(nwMinimal, mockGUI): sHandle = theProject.newFile("Scene One", nwItemClass.NOVEL, "a508bb932959c") tHandle = theProject.newFile("Scene Two", nwItemClass.NOVEL, "a508bb932959c") - theProject.projTree[hHandle].itemLayout == nwItemLayout.CHAPTER - theProject.projTree[sHandle].itemLayout == nwItemLayout.SCENE - theProject.projTree[tHandle].itemLayout == nwItemLayout.SCENE + theProject.projTree[hHandle].itemLayout == nwItemLayout.DOCUMENT + theProject.projTree[sHandle].itemLayout == nwItemLayout.DOCUMENT + theProject.projTree[tHandle].itemLayout == nwItemLayout.DOCUMENT assert theIndex.scanText(hHandle, "## Chapter One\n\n") assert theIndex.scanText(sHandle, "### Scene One\n\n") @@ -797,8 +839,8 @@ def testCoreIndex_CheckRefIndex(mockGUI): @pytest.mark.core -def testCoreIndex_CheckNovelNoteIndex(mockGUI): - """Test the novel and note index checkers. +def testCoreIndex_CheckFileIndex(mockGUI): + """Test the file index checker. """ theProject = NWProject(mockGUI) theIndex = NWIndex(theProject) @@ -809,7 +851,7 @@ def testCoreIndex_CheckNovelNoteIndex(mockGUI): "T000001": { "level": "H1", "title": "My Novel", - "layout": "TITLE", + "layout": "DOCUMENT", "cCount": 72, "wCount": 15, "pCount": 2, @@ -826,7 +868,7 @@ def testCoreIndex_CheckNovelNoteIndex(mockGUI): "T000001": { "level": "H1", "title": "My Novel", - "layout": "TITLE", + "layout": "DOCUMENT", "cCount": 72, "wCount": 15, "pCount": 2, @@ -843,7 +885,7 @@ def testCoreIndex_CheckNovelNoteIndex(mockGUI): "INVALID": { "level": "H1", "title": "My Novel", - "layout": "TITLE", + "layout": "DOCUMENT", "cCount": 72, "wCount": 15, "pCount": 2, @@ -860,7 +902,7 @@ def testCoreIndex_CheckNovelNoteIndex(mockGUI): "T000001": { "level": "H1", "title": "My Novel", - "layout": "TITLE", + "layout": "DOCUMENT", "cCount": 72, "wCount": 15, "pCount": 2, @@ -881,7 +923,7 @@ def testCoreIndex_CheckNovelNoteIndex(mockGUI): "T000001": { "stuff": "H1", "title": "My Novel", - "layout": "TITLE", + "layout": "DOCUMENT", "cCount": 72, "wCount": 15, "pCount": 2, @@ -898,7 +940,7 @@ def testCoreIndex_CheckNovelNoteIndex(mockGUI): "T000001": { "level": "H1", "stuff": "My Novel", - "layout": "TITLE", + "layout": "DOCUMENT", "cCount": 72, "wCount": 15, "pCount": 2, @@ -915,7 +957,7 @@ def testCoreIndex_CheckNovelNoteIndex(mockGUI): "T000001": { "level": "H1", "title": "My Novel", - "stuff": "TITLE", + "stuff": "DOCUMENT", "cCount": 72, "wCount": 15, "pCount": 2, @@ -932,7 +974,7 @@ def testCoreIndex_CheckNovelNoteIndex(mockGUI): "T000001": { "level": "H1", "title": "My Novel", - "layout": "TITLE", + "layout": "DOCUMENT", "stuff": 72, "wCount": 15, "pCount": 2, @@ -949,7 +991,7 @@ def testCoreIndex_CheckNovelNoteIndex(mockGUI): "T000001": { "level": "H1", "title": "My Novel", - "layout": "TITLE", + "layout": "DOCUMENT", "cCount": 72, "stuff": 15, "pCount": 2, @@ -966,7 +1008,7 @@ def testCoreIndex_CheckNovelNoteIndex(mockGUI): "T000001": { "level": "H1", "title": "My Novel", - "layout": "TITLE", + "layout": "DOCUMENT", "cCount": 72, "wCount": 15, "stuff": 2, @@ -983,7 +1025,7 @@ def testCoreIndex_CheckNovelNoteIndex(mockGUI): "T000001": { "level": "H1", "title": "My Novel", - "layout": "TITLE", + "layout": "DOCUMENT", "cCount": 72, "wCount": 15, "pCount": 2, @@ -1003,7 +1045,7 @@ def testCoreIndex_CheckNovelNoteIndex(mockGUI): "T000001": { "level": "XX", "title": "My Novel", - "layout": "TITLE", + "layout": "DOCUMENT", "cCount": 72, "wCount": 15, "pCount": 2, @@ -1020,7 +1062,7 @@ def testCoreIndex_CheckNovelNoteIndex(mockGUI): "T000001": { "level": "H1", "title": 12345678, - "layout": "TITLE", + "layout": "DOCUMENT", "cCount": 72, "wCount": 15, "pCount": 2, @@ -1054,7 +1096,7 @@ def testCoreIndex_CheckNovelNoteIndex(mockGUI): "T000001": { "level": "H1", "title": "My Novel", - "layout": "TITLE", + "layout": "DOCUMENT", "cCount": "72", "wCount": 15, "pCount": 2, @@ -1071,7 +1113,7 @@ def testCoreIndex_CheckNovelNoteIndex(mockGUI): "T000001": { "level": "H1", "title": "My Novel", - "layout": "TITLE", + "layout": "DOCUMENT", "cCount": 72, "wCount": "15", "pCount": 2, @@ -1088,7 +1130,7 @@ def testCoreIndex_CheckNovelNoteIndex(mockGUI): "T000001": { "level": "H1", "title": "My Novel", - "layout": "TITLE", + "layout": "DOCUMENT", "cCount": 72, "wCount": 15, "pCount": "2", @@ -1105,7 +1147,7 @@ def testCoreIndex_CheckNovelNoteIndex(mockGUI): "T000001": { "level": "H1", "title": "My Novel", - "layout": "TITLE", + "layout": "DOCUMENT", "cCount": 72, "wCount": 15, "pCount": 2, @@ -1116,7 +1158,7 @@ def testCoreIndex_CheckNovelNoteIndex(mockGUI): with pytest.raises(ValueError): theIndex._checkFileIndex() -# END Test testCoreIndex_CheckNovelNoteIndex +# END Test testCoreIndex_CheckFileIndex @pytest.mark.core @@ -1235,4 +1277,20 @@ def testCoreIndex_CountWords(): assert wC == 9 assert pC == 4 + # Formatting Codes + cC, wC, pC = countWords(( + "Some text\n\n" + "[NEWPAGE]\n\n" + "more text\n\n" + "[NEW PAGE]]\n\n" + "even more text\n\n" + "[VSPACE]\n\n" + "and some final text\n\n" + "[VSPACE:4]\n\n" + "THE END\n\n" + )) + assert cC == 58 + assert wC == 13 + assert pC == 5 + # END Test testCoreIndex_CountWords diff --git a/tests/test_core/test_core_item.py b/tests/test_core/test_core_item.py index 6b2df2b2..8b10c109 100644 --- a/tests/test_core/test_core_item.py +++ b/tests/test_core/test_core_item.py @@ -73,7 +73,7 @@ def testCoreItem_Setters(mockGUI): theItem.setOrder(1) assert theItem.itemOrder == 1 - # Status + # Importance theItem.setStatus("Nonsense") assert theItem.itemStatus == "New" theItem.setStatus("New") @@ -85,7 +85,7 @@ def testCoreItem_Setters(mockGUI): theItem.setStatus("Main") assert theItem.itemStatus == "Main" - # Importance + # Status theItem.itemClass = nwItemClass.NOVEL theItem.setStatus("Nonsense") assert theItem.itemStatus == "New" @@ -244,29 +244,37 @@ def testCoreItem_LayoutSetter(mockGUI): theProject = NWProject(mockGUI) theItem = NWItem(theProject) - # Layout + # Faulty Layouts theItem.setLayout(None) assert theItem.itemLayout == nwItemLayout.NO_LAYOUT theItem.setLayout("NONSENSE") assert theItem.itemLayout == nwItemLayout.NO_LAYOUT + + # Current Layouts theItem.setLayout("NO_LAYOUT") assert theItem.itemLayout == nwItemLayout.NO_LAYOUT - theItem.setLayout("TITLE") - assert theItem.itemLayout == nwItemLayout.TITLE - theItem.setLayout("BOOK") - assert theItem.itemLayout == nwItemLayout.BOOK - theItem.setLayout("PAGE") - assert theItem.itemLayout == nwItemLayout.PAGE - theItem.setLayout("PARTITION") - assert theItem.itemLayout == nwItemLayout.PARTITION - theItem.setLayout("UNNUMBERED") - assert theItem.itemLayout == nwItemLayout.UNNUMBERED - theItem.setLayout("CHAPTER") - assert theItem.itemLayout == nwItemLayout.CHAPTER - theItem.setLayout("SCENE") - assert theItem.itemLayout == nwItemLayout.SCENE + theItem.setLayout("DOCUMENT") + assert theItem.itemLayout == nwItemLayout.DOCUMENT theItem.setLayout("NOTE") assert theItem.itemLayout == nwItemLayout.NOTE + + # Deprecated Layouts + theItem.setLayout("TITLE") + assert theItem.itemLayout == nwItemLayout.DOCUMENT + theItem.setLayout("PAGE") + assert theItem.itemLayout == nwItemLayout.DOCUMENT + theItem.setLayout("BOOK") + assert theItem.itemLayout == nwItemLayout.DOCUMENT + theItem.setLayout("PARTITION") + assert theItem.itemLayout == nwItemLayout.DOCUMENT + theItem.setLayout("UNNUMBERED") + assert theItem.itemLayout == nwItemLayout.DOCUMENT + theItem.setLayout("CHAPTER") + assert theItem.itemLayout == nwItemLayout.DOCUMENT + theItem.setLayout("SCENE") + assert theItem.itemLayout == nwItemLayout.DOCUMENT + + # Alternatives theItem.setLayout(nwItemLayout.NOTE) assert theItem.itemLayout == nwItemLayout.NOTE diff --git a/tests/test_core/test_core_project.py b/tests/test_core/test_core_project.py index 801c8803..0f03415a 100644 --- a/tests/test_core/test_core_project.py +++ b/tests/test_core/test_core_project.py @@ -398,7 +398,7 @@ def testCoreProject_Open(monkeypatch, nwMinimal, mockGUI): )) assert theProject.openProject(nwMinimal) is False - # Larger hex version + # Update file version writeFile(rName, ( "\n" "\n" + "\n" + "\n" + ) % theProject.FILE_VERSION) + mockGUI.askResponse = False + assert theProject.openProject(nwMinimal) is False + assert mockGUI.lastQuestion[0] == "Version Conflict" mockGUI.undo() # Test skipping XML entries @@ -672,12 +688,12 @@ def testCoreProject_Methods(monkeypatch, nwMinimal, mockGUI, tmpDir): assert theProject.projPath == os.path.expanduser("~") # Create a new folder and populate it - projPath = os.path.join(nwMinimal, "dummy1") + projPath = os.path.join(nwMinimal, "mock1") assert theProject.setProjectPath(projPath, newProject=True) # Make os.mkdir fail monkeypatch.setattr("os.mkdir", causeOSError) - projPath = os.path.join(nwMinimal, "dummy2") + projPath = os.path.join(nwMinimal, "mock2") assert not theProject.setProjectPath(projPath, newProject=True) # Set back @@ -753,6 +769,14 @@ def testCoreProject_Methods(monkeypatch, nwMinimal, mockGUI, tmpDir): assert theProject.projSpell == "en_GB" assert theProject.projChanged + # Project Language + theProject.projChanged = False + theProject.projLang = "en" + assert theProject.setProjectLang(None) is True + assert theProject.projLang is None + assert theProject.setProjectLang("en_GB") is True + assert theProject.projLang == "en_GB" + # Automatic outline update theProject.projChanged = False assert theProject.setAutoOutline(True) diff --git a/tests/test_core/test_core_spell.py b/tests/test_core/test_core_spell.py index ec6ab23e..32246fd3 100644 --- a/tests/test_core/test_core_spell.py +++ b/tests/test_core/test_core_spell.py @@ -51,6 +51,8 @@ def testCoreSpell_Super(monkeypatch, tmpDir): with monkeypatch.context() as mp: mp.setattr("builtins.open", causeOSError) assert spChk._readProjectDictionary(wList) is False + + assert spChk._readProjectDictionary(None) is False assert spChk._readProjectDictionary(wList) is True assert spChk.projectDict == wList @@ -85,22 +87,24 @@ def testCoreSpell_Enchant(monkeypatch, tmpDir): spChk.setLanguage("en", wList) assert spChk.setLanguage("", "") is None - assert spChk.checkWord("") + assert spChk.checkWord("") is True assert spChk.suggestWords("") == [] assert spChk.listDictionaries() == [] assert spChk.describeDict() == ("", "") - # Load the proper enchant package + # Load the proper enchant package (twice) spChk = NWSpellEnchant() spChk.setLanguage("en", wList) + spChk.setLanguage("en", wList) - assert spChk.checkWord("a_word") - assert spChk.checkWord("b_word") - assert spChk.checkWord("c_word") - assert not spChk.checkWord("d_word") + # Check words + assert spChk.checkWord("a_word") is True + assert spChk.checkWord("b_word") is True + assert spChk.checkWord("c_word") is True + assert spChk.checkWord("d_word") is False spChk.addWord("d_word") - assert spChk.checkWord("d_word") + assert spChk.checkWord("d_word") is True wSuggest = spChk.suggestWords("wrod") assert len(wSuggest) > 0 diff --git a/tests/test_core/test_core_tohtml.py b/tests/test_core/test_core_tohtml.py index 69e6dd39..011c18e7 100644 --- a/tests/test_core/test_core_tohtml.py +++ b/tests/test_core/test_core_tohtml.py @@ -81,29 +81,35 @@ def testCoreToHtml_Format(mockGUI): @pytest.mark.core -def testCoreToHtml_Convert(mockGUI): - """Test the converter of the ToHtml class. +def testCoreToHtml_ConvertFormat(mockGUI): + """Test the tokenizer and converter chain using the ToHtml class. """ theProject = NWProject(mockGUI) mockGUI.theIndex = NWIndex(theProject) theHtml = ToHtml(theProject) - # Export Mode - # =========== + # Novel Files Headers + # =================== theHtml.isNovel = True + theHtml.isNote = False + theHtml.isFirst = True # Header 1 - theHtml.theText = "# Title\n" + theHtml.theText = "# Partition\n" theHtml.tokenizeText() theHtml.doConvert() - assert theHtml.theResult == "

Title

\n" + assert theHtml.theResult == ( + "

Partition

\n" + ) # Header 2 theHtml.theText = "## Chapter Title\n" theHtml.tokenizeText() theHtml.doConvert() - assert theHtml.theResult == "

Chapter Title

\n" + assert theHtml.theResult == ( + "

Chapter Title

\n" + ) # Header 3 theHtml.theText = "### Scene Title\n" @@ -117,7 +123,26 @@ def testCoreToHtml_Convert(mockGUI): theHtml.doConvert() assert theHtml.theResult == "

Section Title

\n" + # Title + theHtml.theText = "#! Title\n" + theHtml.tokenizeText() + theHtml.doConvert() + assert theHtml.theResult == ( + "

Title

\n" + ) + + # Unnumbered + theHtml.theText = "##! Prologue\n" + theHtml.tokenizeText() + theHtml.doConvert() + assert theHtml.theResult == "

Prologue

\n" + + # Note Files Headers + # ================== + theHtml.isNovel = False + theHtml.isNote = True + theHtml.isFirst = True theHtml.setLinkHeaders(True) # Header 1 @@ -144,6 +169,23 @@ def testCoreToHtml_Convert(mockGUI): theHtml.doConvert() assert theHtml.theResult == "

Heading Four

\n" + # Title + theHtml.theText = "#! Heading One\n" + theHtml.tokenizeText() + theHtml.doConvert() + assert theHtml.theResult == ( + "

Heading One

\n" + ) + + # Unnumbered + theHtml.theText = "##! Heading Two\n" + theHtml.tokenizeText() + theHtml.doConvert() + assert theHtml.theResult == "

Heading Two

\n" + + # Paragraphs + # ========== + # Text theHtml.theText = "Some **nested bold and _italic_ and ~~strikethrough~~ text** here\n" theHtml.tokenizeText() @@ -223,22 +265,64 @@ def testCoreToHtml_Convert(mockGUI): "

\n" ) - # Direct Tests + # Preview Mode # ============ + theHtml.setPreview(True, True) + + # Text (HTML4) + theHtml.theText = "Some **nested bold and _italic_ and ~~strikethrough~~ text** here\n" + theHtml.tokenizeText() + theHtml.doConvert() + assert theHtml.theResult == ( + "

Some nested bold and italic and " + "strikethrough " + "text here

\n" + ) + +# END Test testCoreToHtml_ConvertFormat + + +@pytest.mark.core +def testCoreToHtml_ConvertDirect(mockGUI): + """Test the converter directly using the ToHtml class. + """ + theProject = NWProject(mockGUI) + mockGUI.theIndex = NWIndex(theProject) + theHtml = ToHtml(theProject) + theHtml.isNovel = True + theHtml.isNote = False + theHtml.setLinkHeaders(True) + + # Special Titles + # ============== # Title theHtml.theTokens = [ - (theHtml.T_TITLE, 1, "A Title", None, theHtml.A_PBB_AUT | theHtml.A_CENTRE), + (theHtml.T_TITLE, 1, "A Title", None, theHtml.A_PBB | theHtml.A_CENTRE), (theHtml.T_EMPTY, 1, "", None, theHtml.A_NONE), ] theHtml.doConvert() assert theHtml.theResult == ( - "

" + "

" "A Title

\n" ) + # Unnumbered + theHtml.theTokens = [ + (theHtml.T_UNNUM, 1, "Prologue", None, theHtml.A_PBB), + (theHtml.T_EMPTY, 1, "", None, theHtml.A_NONE), + ] + theHtml.doConvert() + assert theHtml.theResult == ( + "

" + "Prologue

\n" + ) + + # Separators + # ========== + # Separator theHtml.theTokens = [ (theHtml.T_SEP, 1, "* * *", None, theHtml.A_CENTRE), @@ -255,8 +339,8 @@ def testCoreToHtml_Convert(mockGUI): theHtml.doConvert() assert theHtml.theResult == "

 

\n" - # Styles - # ====== + # Alignment + # ========= theHtml.setLinkHeaders(False) @@ -308,6 +392,9 @@ def testCoreToHtml_Convert(mockGUI): "

A Title

\n" ) + # Page Break + # ========== + # Page Break Always theHtml.theTokens = [ (theHtml.T_HEAD1, 1, "A Title", None, theHtml.A_PBB | theHtml.A_PBA), @@ -318,32 +405,30 @@ def testCoreToHtml_Convert(mockGUI): "style='page-break-before: always; page-break-after: always;'>A Title\n" ) - # Page Break Auto + # Indent + # ====== + + # Indent Left theHtml.theTokens = [ - (theHtml.T_HEAD1, 1, "A Title", None, theHtml.A_PBB_AUT | theHtml.A_PBA_AUT), + (theHtml.T_TEXT, 1, "Some text ...", [], theHtml.A_IND_L), + (theHtml.T_EMPTY, 2, "", None, theHtml.A_NONE), ] theHtml.doConvert() assert theHtml.theResult == ( - "

A Title

\n" + "

Some text ...

\n" ) - # Preview Mode - # ============ - - theHtml.setPreview(True, True) - - # Text (HTML4) - theHtml.theText = "Some **nested bold and _italic_ and ~~strikethrough~~ text** here\n" - theHtml.tokenizeText() + # Indent Right + theHtml.theTokens = [ + (theHtml.T_TEXT, 1, "Some text ...", [], theHtml.A_IND_R), + (theHtml.T_EMPTY, 2, "", None, theHtml.A_NONE), + ] theHtml.doConvert() assert theHtml.theResult == ( - "

Some nested bold and italic and " - "strikethrough " - "text here

\n" + "

Some text ...

\n" ) -# END Test testCoreToHtml_Convert +# END Test testCoreToHtml_ConvertDirect @pytest.mark.core @@ -352,6 +437,7 @@ def testCoreToHtml_Complex(mockGUI, fncDir): """ theProject = NWProject(mockGUI) theHtml = ToHtml(theProject) + theHtml.isNovel = True # Build Project # ============= @@ -366,13 +452,34 @@ def testCoreToHtml_Complex(mockGUI, fncDir): "#### A Section\n\n\tMore text in scene two.\n", ] resText = [ - "

My Novel

\n

By Jane Doh

\n", - "

Chapter 1

\n

The text of chapter one.

\n", - "

Scene 1

\n

The text of scene one.

\n", - "

A Section

\n

More text in scene one.

\n", - "

Chapter 2

\n

The text of chapter two.

\n", - "

Scene 2

\n

The text of scene two.

\n", - "

A Section

\n

\tMore text in scene two.

\n", + ( + "

My Novel

\n" + "

By Jane Doh

\n" + ), + ( + "

Chapter 1

\n" + "

The text of chapter one.

\n" + ), + ( + "

Scene 1

\n" + "

The text of scene one.

\n" + ), + ( + "

A Section

\n" + "

More text in scene one.

\n" + ), + ( + "

Chapter 2

\n" + "

The text of chapter two.

\n" + ), + ( + "

Scene 2

\n" + "

The text of scene two.

\n" + ), + ( + "

A Section

\n" + "

\tMore text in scene two.

\n" + ), ] for i in range(len(docText)): @@ -385,7 +492,7 @@ def testCoreToHtml_Complex(mockGUI, fncDir): assert theHtml.fullHTML == resText theHtml.replaceTabs(nSpaces=2, spaceChar=" ") - resText[6] = "

A Section

\n

  More text in scene two.

\n" + resText[6] = "

A Section

\n

  More text in scene two.

\n" # Check File # ========== diff --git a/tests/test_core/test_core_tokenizer.py b/tests/test_core/test_core_tokenizer.py index 45ac3685..17484f28 100644 --- a/tests/test_core/test_core_tokenizer.py +++ b/tests/test_core/test_core_tokenizer.py @@ -45,6 +45,7 @@ def testCoreToken_Setters(mockGUI): assert theToken.textSize == 11 assert theToken.textFixed is False assert theToken.lineHeight == 1.15 + assert theToken.blockIndent == 4.0 assert theToken.doJustify is False assert theToken.marginTitle == (1.000, 0.500) assert theToken.marginHead1 == (1.000, 0.500) @@ -68,7 +69,8 @@ def testCoreToken_Setters(mockGUI): theToken.setSceneFormat("S: %title%", True) theToken.setSectionFormat("X: %title%", True) theToken.setFont("Monospace", 10, True) - theToken.setLineHeight(2) + theToken.setLineHeight(2.0) + theToken.setBlockIndent(6.0) theToken.setJustify(True) theToken.setTitleMargins(2.0, 2.0) theToken.setHead1Margins(2.0, 2.0) @@ -93,6 +95,7 @@ def testCoreToken_Setters(mockGUI): assert theToken.textSize == 10 assert theToken.textFixed is True assert theToken.lineHeight == 2.0 + assert theToken.blockIndent == 6.0 assert theToken.doJustify is True assert theToken.marginTitle == (2.0, 2.0) assert theToken.marginHead1 == (2.0, 2.0) @@ -109,6 +112,17 @@ def testCoreToken_Setters(mockGUI): assert theToken.doComments is True assert theToken.doKeywords is True + # Check Limits + theToken.setLineHeight(0.0) + assert theToken.lineHeight == 0.5 + theToken.setLineHeight(10.0) + assert theToken.lineHeight == 5.0 + + theToken.setBlockIndent(-6.0) + assert theToken.blockIndent == 0.0 + theToken.setBlockIndent(60.0) + assert theToken.blockIndent == 10.0 + # END Test testCoreToken_Setters @@ -145,13 +159,25 @@ def testCoreToken_TextOps(monkeypatch, nwMinimal, mockGUI): assert theProject.saveProject() - # Root heading + # Root Heading assert theToken.addRootHeading("stuff") is False assert theToken.addRootHeading(sHandle) is False + + # First Page assert theToken.addRootHeading("7695ce551d265") is True assert theToken.theMarkdown[-1] == "# Notes: Plot\n\n" + assert theToken.theTokens[-1] == ( + Tokenizer.T_TITLE, 0, "Notes: Plot", None, Tokenizer.A_CENTRE + ) - # Set text + # Not First Page + assert theToken.addRootHeading("7695ce551d265") is True + assert theToken.theMarkdown[-1] == "# Notes: Plot\n\n" + assert theToken.theTokens[-1] == ( + Tokenizer.T_TITLE, 0, "Notes: Plot", None, Tokenizer.A_CENTRE | Tokenizer.A_PBB + ) + + # Set Text assert theToken.setText("stuff") is False assert theToken.setText(sHandle) is True assert theToken.theText == docText @@ -168,15 +194,8 @@ def testCoreToken_TextOps(monkeypatch, nwMinimal, mockGUI): assert theToken.theText == docText assert theToken.isNone is False - assert theToken.isTitle is False - assert theToken.isBook is False - assert theToken.isPage is False - assert theToken.isPart is False - assert theToken.isUnNum is False - assert theToken.isChap is False - assert theToken.isScene is True - assert theToken.isNote is False assert theToken.isNovel is True + assert theToken.isNote is False # Pre Processing theToken.doPreProcessing() @@ -190,39 +209,115 @@ def testCoreToken_TextOps(monkeypatch, nwMinimal, mockGUI): # Save File savePath = os.path.join(nwMinimal, "dump.nwd") theToken.saveRawMarkdown(savePath) - assert readFile(savePath) == "# Notes: Plot\n\n" + assert readFile(savePath) == ( + "# Notes: Plot\n\n" + "# Notes: Plot\n\n" + ) # END Test testCoreToken_TextOps @pytest.mark.core -def testCoreToken_Tokenize(mockGUI): - """Test the tokenization of the Tokenizer class. +def testCoreToken_HeaderFormat(mockGUI): + """Test the tokenization of header formats in the Tokenizer class. """ theProject = NWProject(mockGUI) theToken = Tokenizer(theProject) theToken.setKeepMarkdown(True) - # Header 1 - theToken.theText = "# Novel Title\n" + # Title + # ===== + + # Story File + theToken.isNovel = True + theToken.isNote = False + theToken.isFirst = True + theToken.theText = "#! Novel Title\n" + theToken.tokenizeText() assert theToken.theTokens == [ - (Tokenizer.T_HEAD1, 1, "Novel Title", None, Tokenizer.A_NONE), + (Tokenizer.T_TITLE, 1, "Novel Title", None, Tokenizer.A_CENTRE), + (Tokenizer.T_EMPTY, 1, "", None, Tokenizer.A_NONE), + ] + assert theToken.theMarkdown[-1] == "#! Novel Title\n\n" + + # Note File + theToken.isNovel = False + theToken.isNote = True + theToken.isFirst = True + theToken.theText = "#! Note Title\n" + + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_HEAD1, 1, "Note Title", None, Tokenizer.A_CENTRE), + (Tokenizer.T_EMPTY, 1, "", None, Tokenizer.A_NONE), + ] + assert theToken.theMarkdown[-1] == "#! Note Title\n\n" + + # Header 1 + # ======== + + # Story File + theToken.isNovel = True + theToken.isNote = False + theToken.isFirst = True + theToken.theText = "# Novel Title\n" + + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_HEAD1, 1, "Novel Title", None, Tokenizer.A_CENTRE), (Tokenizer.T_EMPTY, 1, "", None, Tokenizer.A_NONE), ] assert theToken.theMarkdown[-1] == "# Novel Title\n\n" - # Header 2 - theToken.theText = "## Chapter One\n" + # Note File + theToken.isNovel = False + theToken.isNote = True + theToken.isFirst = True + theToken.theText = "# Note Title\n" + theToken.tokenizeText() assert theToken.theTokens == [ - (Tokenizer.T_HEAD2, 1, "Chapter One", None, Tokenizer.A_NONE), + (Tokenizer.T_HEAD1, 1, "Note Title", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 1, "", None, Tokenizer.A_NONE), + ] + assert theToken.theMarkdown[-1] == "# Note Title\n\n" + + # Header 2 + # ======== + + # Story File + theToken.isNovel = True + theToken.isNote = False + theToken.theText = "## Chapter One\n" + + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_HEAD2, 1, "Chapter One", None, Tokenizer.A_PBB), (Tokenizer.T_EMPTY, 1, "", None, Tokenizer.A_NONE), ] assert theToken.theMarkdown[-1] == "## Chapter One\n\n" + # Note File + theToken.isNovel = False + theToken.isNote = True + theToken.theText = "## Heading 2\n" + + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_HEAD2, 1, "Heading 2", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 1, "", None, Tokenizer.A_NONE), + ] + assert theToken.theMarkdown[-1] == "## Heading 2\n\n" + # Header 3 + # ======== + + # Story File + theToken.isNovel = True + theToken.isNote = False theToken.theText = "### Scene One\n" + theToken.tokenizeText() assert theToken.theTokens == [ (Tokenizer.T_HEAD3, 1, "Scene One", None, Tokenizer.A_NONE), @@ -230,8 +325,26 @@ def testCoreToken_Tokenize(mockGUI): ] assert theToken.theMarkdown[-1] == "### Scene One\n\n" + # Note File + theToken.isNovel = False + theToken.isNote = True + theToken.theText = "### Heading 3\n" + + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_HEAD3, 1, "Heading 3", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 1, "", None, Tokenizer.A_NONE), + ] + assert theToken.theMarkdown[-1] == "### Heading 3\n\n" + # Header 4 + # ======== + + # Story File + theToken.isNovel = True + theToken.isNote = False theToken.theText = "#### A Section\n" + theToken.tokenizeText() assert theToken.theTokens == [ (Tokenizer.T_HEAD4, 1, "A Section", None, Tokenizer.A_NONE), @@ -239,6 +352,83 @@ def testCoreToken_Tokenize(mockGUI): ] assert theToken.theMarkdown[-1] == "#### A Section\n\n" + # Note File + theToken.isNovel = False + theToken.isNote = True + theToken.theText = "#### Heading 4\n" + + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_HEAD4, 1, "Heading 4", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 1, "", None, Tokenizer.A_NONE), + ] + assert theToken.theMarkdown[-1] == "#### Heading 4\n\n" + + # Title + # ===== + + # Story File + theToken.isNovel = True + theToken.isNote = False + theToken.theText = "#! Title\n" + + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_TITLE, 1, "Title", None, Tokenizer.A_CENTRE | Tokenizer.A_PBB), + (Tokenizer.T_EMPTY, 1, "", None, Tokenizer.A_NONE), + ] + assert theToken.theMarkdown[-1] == "#! Title\n\n" + + # Note File + theToken.isNovel = False + theToken.isNote = True + theToken.theText = "#! Title\n" + + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_HEAD1, 1, "Title", None, Tokenizer.A_CENTRE), + (Tokenizer.T_EMPTY, 1, "", None, Tokenizer.A_NONE), + ] + assert theToken.theMarkdown[-1] == "#! Title\n\n" + + # Unnumbered + # ========== + + # Story File + theToken.isNovel = True + theToken.isNote = False + theToken.theText = "##! Prologue\n" + + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_UNNUM, 1, "Prologue", None, Tokenizer.A_PBB), + (Tokenizer.T_EMPTY, 1, "", None, Tokenizer.A_NONE), + ] + assert theToken.theMarkdown[-1] == "##! Prologue\n\n" + + # Note File + theToken.isNovel = False + theToken.isNote = True + theToken.theText = "##! Prologue\n" + + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_HEAD2, 1, "Prologue", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 1, "", None, Tokenizer.A_NONE), + ] + assert theToken.theMarkdown[-1] == "##! Prologue\n\n" + +# END Test testCoreToken_HeaderFormat + + +@pytest.mark.core +def testCoreToken_MetaFormat(mockGUI): + """Test the tokenization of meta formats in the Tokenizer class. + """ + theProject = NWProject(mockGUI) + theToken = Tokenizer(theProject) + theToken.setKeepMarkdown(True) + # Comment theToken.theText = "% A comment\n" theToken.tokenizeText() @@ -297,6 +487,72 @@ def testCoreToken_Tokenize(mockGUI): ] assert theToken.theMarkdown[-1] == "@pov: Bod\n@plot: Main\n@location: Europe\n\n" +# END Test testCoreToken_MetaFormat + + +@pytest.mark.core +def testCoreToken_MarginFormat(mockGUI): + """Test the tokenization of margin formats in the Tokenizer class. + """ + theProject = NWProject(mockGUI) + theToken = Tokenizer(theProject) + theToken.setKeepMarkdown(True) + + # Alignment and Indentation + dblIndent = Tokenizer.A_IND_L | Tokenizer.A_IND_R + rIndAlign = Tokenizer.A_RIGHT | Tokenizer.A_IND_R + theToken.theText = ( + "Some regular text\n\n" + "Some left-aligned text <<\n\n" + ">> Some right-aligned text\n\n" + ">> Some centered text <<\n\n" + "> Left-indented block\n\n" + "Right-indented block <\n\n" + "> Double-indented block <\n\n" + ">> Right-indent, right-aligned <\n\n" + ) + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_TEXT, 1, "Some regular text", [], Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 2, "", None, Tokenizer.A_NONE), + (Tokenizer.T_TEXT, 3, "Some left-aligned text", [], Tokenizer.A_LEFT), + (Tokenizer.T_EMPTY, 4, "", None, Tokenizer.A_NONE), + (Tokenizer.T_TEXT, 5, "Some right-aligned text", [], Tokenizer.A_RIGHT), + (Tokenizer.T_EMPTY, 6, "", None, Tokenizer.A_NONE), + (Tokenizer.T_TEXT, 7, "Some centered text", [], Tokenizer.A_CENTRE), + (Tokenizer.T_EMPTY, 8, "", None, Tokenizer.A_NONE), + (Tokenizer.T_TEXT, 9, "Left-indented block", [], Tokenizer.A_IND_L), + (Tokenizer.T_EMPTY, 10, "", None, Tokenizer.A_NONE), + (Tokenizer.T_TEXT, 11, "Right-indented block", [], Tokenizer.A_IND_R), + (Tokenizer.T_EMPTY, 12, "", None, Tokenizer.A_NONE), + (Tokenizer.T_TEXT, 13, "Double-indented block", [], dblIndent), + (Tokenizer.T_EMPTY, 14, "", None, Tokenizer.A_NONE), + (Tokenizer.T_TEXT, 15, "Right-indent, right-aligned", [], rIndAlign), + (Tokenizer.T_EMPTY, 16, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 16, "", None, Tokenizer.A_NONE), + ] + assert theToken.theMarkdown[-1] == ( + "Some regular text\n\n" + "Some left-aligned text\n\n" + "Some right-aligned text\n\n" + "Some centered text\n\n" + "Left-indented block\n\n" + "Right-indented block\n\n" + "Double-indented block\n\n" + "Right-indent, right-aligned\n\n\n" + ) + +# END Test testCoreToken_MarginFormat + + +@pytest.mark.core +def testCoreToken_TextFormat(mockGUI): + """Test the tokenization of text formats in the Tokenizer class. + """ + theProject = NWProject(mockGUI) + theToken = Tokenizer(theProject) + theToken.setKeepMarkdown(True) + # Text theToken.theText = "Some plain text\non two lines\n\n\n" theToken.tokenizeText() @@ -408,55 +664,214 @@ def testCoreToken_Tokenize(mockGUI): "Some **nested bold and _italic_ and ~~strikethrough~~ text** here\n\n" ) - # Alignment and Indentation - dblIndent = Tokenizer.A_IND_L | Tokenizer.A_IND_R - rIndAlign = Tokenizer.A_RIGHT | Tokenizer.A_IND_R - theToken.theText = ( - "Some regular text\n\n" - "Some left-aligned text <<\n\n" - ">> Some right-aligned text\n\n" - ">> Some centered text <<\n\n" - "> Left-indented block\n\n" - "Right-indented block <\n\n" - "> Double-indented block <\n\n" - ">> Right-indent, right-aligned <\n\n" - ) - theToken.tokenizeText() - assert theToken.theTokens == [ - (Tokenizer.T_TEXT, 1, "Some regular text", [], Tokenizer.A_NONE), - (Tokenizer.T_EMPTY, 2, "", None, Tokenizer.A_NONE), - (Tokenizer.T_TEXT, 3, "Some left-aligned text", [], Tokenizer.A_LEFT), - (Tokenizer.T_EMPTY, 4, "", None, Tokenizer.A_NONE), - (Tokenizer.T_TEXT, 5, "Some right-aligned text", [], Tokenizer.A_RIGHT), - (Tokenizer.T_EMPTY, 6, "", None, Tokenizer.A_NONE), - (Tokenizer.T_TEXT, 7, "Some centered text", [], Tokenizer.A_CENTRE), - (Tokenizer.T_EMPTY, 8, "", None, Tokenizer.A_NONE), - (Tokenizer.T_TEXT, 9, "Left-indented block", [], Tokenizer.A_IND_L), - (Tokenizer.T_EMPTY, 10, "", None, Tokenizer.A_NONE), - (Tokenizer.T_TEXT, 11, "Right-indented block", [], Tokenizer.A_IND_R), - (Tokenizer.T_EMPTY, 12, "", None, Tokenizer.A_NONE), - (Tokenizer.T_TEXT, 13, "Double-indented block", [], dblIndent), - (Tokenizer.T_EMPTY, 14, "", None, Tokenizer.A_NONE), - (Tokenizer.T_TEXT, 15, "Right-indent, right-aligned", [], rIndAlign), - (Tokenizer.T_EMPTY, 16, "", None, Tokenizer.A_NONE), - (Tokenizer.T_EMPTY, 16, "", None, Tokenizer.A_NONE), - ] - assert theToken.theMarkdown[-1] == ( - "Some regular text\n\n" - "Some left-aligned text\n\n" - "Some right-aligned text\n\n" - "Some centered text\n\n" - "Left-indented block\n\n" - "Right-indented block\n\n" - "Double-indented block\n\n" - "Right-indent, right-aligned\n\n\n" - ) - -# END Test testCoreToken_Tokenize +# END Test testCoreToken_TextFormat @pytest.mark.core -def testCoreToken_Headers(mockGUI): +def testCoreToken_SpecialFormat(mockGUI): + """Test the tokenization of special formats in the Tokenizer class. + """ + theProject = NWProject(mockGUI) + theToken = Tokenizer(theProject) + + theToken.isNovel = True + + # New Page + # ======== + + correctResp = [ + (Tokenizer.T_HEAD1, 1, "Title One", None, Tokenizer.A_CENTRE), + (Tokenizer.T_EMPTY, 2, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 4, "", None, Tokenizer.A_NONE), + (Tokenizer.T_HEAD1, 5, "Title Two", None, Tokenizer.A_CENTRE | Tokenizer.A_PBB), + (Tokenizer.T_EMPTY, 6, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 6, "", None, Tokenizer.A_NONE), + ] + + # Command wo/Space + theToken.isFirst = True + theToken.theText = ( + "# Title One\n\n" + "[NEWPAGE]\n\n" + "# Title Two\n\n" + ) + theToken.tokenizeText() + assert theToken.theTokens == correctResp + + # Command w/Space + theToken.isFirst = True + theToken.theText = ( + "# Title One\n\n" + "[NEW PAGE]\n\n" + "# Title Two\n\n" + ) + theToken.tokenizeText() + assert theToken.theTokens == correctResp + + # Trailing Spaces + theToken.isFirst = True + theToken.theText = ( + "# Title One\n\n" + "[NEW PAGE] \t\n\n" + "# Title Two\n\n" + ) + theToken.tokenizeText() + assert theToken.theTokens == correctResp + + # Single Empty Paragraph + # ====================== + + theToken.theText = ( + "# Title One\n\n" + "[VSPACE] \n\n" + "Some text to go here ...\n\n" + ) + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_HEAD1, 1, "Title One", None, Tokenizer.A_PBB | Tokenizer.A_CENTRE), + (Tokenizer.T_EMPTY, 2, "", None, Tokenizer.A_NONE), + (Tokenizer.T_SKIP, 3, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 4, "", None, Tokenizer.A_NONE), + (Tokenizer.T_TEXT, 5, "Some text to go here ...", [], Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 6, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 6, "", None, Tokenizer.A_NONE), + ] + + # Multiple Empty Paragraphs + # ========================= + + # One Skip + theToken.theText = ( + "# Title One\n\n" + "[VSPACE:1] \n\n" + "Some text to go here ...\n\n" + ) + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_HEAD1, 1, "Title One", None, Tokenizer.A_PBB | Tokenizer.A_CENTRE), + (Tokenizer.T_EMPTY, 2, "", None, Tokenizer.A_NONE), + (Tokenizer.T_SKIP, 3, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 4, "", None, Tokenizer.A_NONE), + (Tokenizer.T_TEXT, 5, "Some text to go here ...", [], Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 6, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 6, "", None, Tokenizer.A_NONE), + ] + + # Three Skips + theToken.theText = ( + "# Title One\n\n" + "[VSPACE:3] \n\n" + "Some text to go here ...\n\n" + ) + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_HEAD1, 1, "Title One", None, Tokenizer.A_PBB | Tokenizer.A_CENTRE), + (Tokenizer.T_EMPTY, 2, "", None, Tokenizer.A_NONE), + (Tokenizer.T_SKIP, 3, "", None, Tokenizer.A_NONE), + (Tokenizer.T_SKIP, 3, "", None, Tokenizer.A_NONE), + (Tokenizer.T_SKIP, 3, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 4, "", None, Tokenizer.A_NONE), + (Tokenizer.T_TEXT, 5, "Some text to go here ...", [], Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 6, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 6, "", None, Tokenizer.A_NONE), + ] + + # Malformed Command, Case 1 + theToken.theText = ( + "# Title One\n\n" + "[VSPACE:3xa] \n\n" + "Some text to go here ...\n\n" + ) + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_HEAD1, 1, "Title One", None, Tokenizer.A_PBB | Tokenizer.A_CENTRE), + (Tokenizer.T_EMPTY, 2, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 4, "", None, Tokenizer.A_NONE), + (Tokenizer.T_TEXT, 5, "Some text to go here ...", [], Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 6, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 6, "", None, Tokenizer.A_NONE), + ] + + # Malformed Command, Case 2 + theToken.theText = ( + "# Title One\n\n" + "[VSPACE:3.5]\n\n" + "Some text to go here ...\n\n" + ) + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_HEAD1, 1, "Title One", None, Tokenizer.A_PBB | Tokenizer.A_CENTRE), + (Tokenizer.T_EMPTY, 2, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 4, "", None, Tokenizer.A_NONE), + (Tokenizer.T_TEXT, 5, "Some text to go here ...", [], Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 6, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 6, "", None, Tokenizer.A_NONE), + ] + + # Malformed Command, Case 3 + theToken.theText = ( + "# Title One\n\n" + "[VSPACE:-1]\n\n" + "Some text to go here ...\n\n" + ) + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_HEAD1, 1, "Title One", None, Tokenizer.A_PBB | Tokenizer.A_CENTRE), + (Tokenizer.T_EMPTY, 2, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 4, "", None, Tokenizer.A_NONE), + (Tokenizer.T_TEXT, 5, "Some text to go here ...", [], Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 6, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 6, "", None, Tokenizer.A_NONE), + ] + + # Empty Paragraph and Page Break + # ============================== + + # Single Skip + theToken.theText = ( + "# Title One\n\n" + "[NEW PAGE]\n\n" + "[VSPACE]\n\n" + "Some text to go here ...\n\n" + ) + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_HEAD1, 1, "Title One", None, Tokenizer.A_PBB | Tokenizer.A_CENTRE), + (Tokenizer.T_EMPTY, 2, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 4, "", None, Tokenizer.A_NONE), + (Tokenizer.T_SKIP, 5, "", None, Tokenizer.A_PBB), + (Tokenizer.T_EMPTY, 6, "", None, Tokenizer.A_NONE), + (Tokenizer.T_TEXT, 7, "Some text to go here ...", [], 0), + (Tokenizer.T_EMPTY, 8, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 8, "", None, Tokenizer.A_NONE), + ] + + # Multiple Skip + theToken.theText = ( + "# Title One\n\n" + "[NEW PAGE]\n\n" + "[VSPACE:3]\n\n" + "Some text to go here ...\n\n" + ) + theToken.tokenizeText() + assert theToken.theTokens == [ + (Tokenizer.T_HEAD1, 1, "Title One", None, Tokenizer.A_PBB | Tokenizer.A_CENTRE), + (Tokenizer.T_EMPTY, 2, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 4, "", None, Tokenizer.A_NONE), + (Tokenizer.T_SKIP, 5, "", None, Tokenizer.A_PBB), + (Tokenizer.T_SKIP, 5, "", None, Tokenizer.A_NONE), + (Tokenizer.T_SKIP, 5, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 6, "", None, Tokenizer.A_NONE), + (Tokenizer.T_TEXT, 7, "Some text to go here ...", [], 0), + (Tokenizer.T_EMPTY, 8, "", None, Tokenizer.A_NONE), + (Tokenizer.T_EMPTY, 8, "", None, Tokenizer.A_NONE), + ] + +# END Test testCoreToken_SpecialFormat + + +@pytest.mark.core +def testCoreToken_ProcessHeaders(mockGUI): """Test the header and page parser of the Tokenizer class. """ theProject = NWProject(mockGUI) @@ -466,31 +881,45 @@ def testCoreToken_Headers(mockGUI): # Nothing theToken.theText = "Some text ...\n" - assert theToken.doHeaders() is True + assert theToken.doHeaders() is False theToken.isNone = True assert theToken.doHeaders() is False theToken.isNone = False - assert theToken.doHeaders() is True + assert theToken.doHeaders() is False theToken.isNote = True assert theToken.doHeaders() is False theToken.isNote = False ## - # Novel + # Story FIles ## + theToken.isNone = False + theToken.isNote = False theToken.isNovel = True # Titles # ====== - # H1: Title - theToken.theText = "# Novel Title\n" + # H1: Title, First Page + assert theToken.isFirst is True + theToken.theText = "# Part One\n" theToken.setTitleFormat(r"T: %title%") theToken.tokenizeText() theToken.doHeaders() assert theToken.theTokens == [ - (Tokenizer.T_HEAD1, 1, "T: Novel Title", None, Tokenizer.A_NONE), + (Tokenizer.T_HEAD1, 1, "T: Part One", None, Tokenizer.A_CENTRE), + (Tokenizer.T_EMPTY, 1, "", None, Tokenizer.A_NONE), + ] + + # H1: Title, Not First Page + assert theToken.isFirst is False + theToken.theText = "# Part One\n" + theToken.setTitleFormat(r"T: %title%") + theToken.tokenizeText() + theToken.doHeaders() + assert theToken.theTokens == [ + (Tokenizer.T_HEAD1, 1, "T: Part One", None, Tokenizer.A_PBB | Tokenizer.A_CENTRE), (Tokenizer.T_EMPTY, 1, "", None, Tokenizer.A_NONE), ] @@ -508,20 +937,8 @@ def testCoreToken_Headers(mockGUI): ] # H2: Unnumbered Chapter - theToken.theText = "## Chapter One\n" - theToken.setUnNumberedFormat(r"U: %title%") - theToken.isUnNum = True - theToken.tokenizeText() - theToken.doHeaders() - assert theToken.theTokens == [ - (Tokenizer.T_HEAD2, 1, "U: Chapter One", None, Tokenizer.A_PBB), - (Tokenizer.T_EMPTY, 1, "", None, Tokenizer.A_NONE), - ] - - # H2: Unnumbered Chapter with Star theToken.theText = "## *Prologue\n" theToken.setUnNumberedFormat(r"U: %title%") - theToken.isUnNum = False theToken.tokenizeText() theToken.doHeaders() assert theToken.theTokens == [ @@ -703,54 +1120,4 @@ def testCoreToken_Headers(mockGUI): theToken.doHeaders() assert theToken.firstScene is False - ## - # Title or Partition - ## - - theToken.isNovel = False - - # H1: Title - theToken.theText = "# Novel Title\n" - theToken.setTitleFormat(r"T: %title%") - theToken.isTitle = True - theToken.isPart = False - theToken.tokenizeText() - theToken.doHeaders() - assert theToken.theTokens == [ - (Tokenizer.T_TITLE, 1, "Novel Title", None, Tokenizer.A_PBB_AUT | Tokenizer.A_CENTRE), - (Tokenizer.T_EMPTY, 1, "", None, Tokenizer.A_PBA | Tokenizer.A_CENTRE), - ] - - # H1: Partition - theToken.theText = "# Partition Title\n" - theToken.setTitleFormat(r"T: %title%") - theToken.isTitle = False - theToken.isPart = True - theToken.tokenizeText() - theToken.doHeaders() - assert theToken.theTokens == [ - (Tokenizer.T_HEAD1, 1, "Partition Title", None, Tokenizer.A_PBB | Tokenizer.A_CENTRE), - (Tokenizer.T_EMPTY, 1, "", None, Tokenizer.A_PBA | Tokenizer.A_CENTRE), - ] - - ## - # Page - ## - - theToken.isNovel = False - theToken.isTitle = False - theToken.isPart = False - theToken.isPage = True - - # Some Page Text - theToken.theText = "Page text\n\nMore text\n" - theToken.tokenizeText() - theToken.doHeaders() - assert theToken.theTokens == [ - (Tokenizer.T_TEXT, 1, "Page text", [], Tokenizer.A_PBB), - (Tokenizer.T_EMPTY, 2, "", None, Tokenizer.A_NONE), - (Tokenizer.T_TEXT, 3, "More text", [], Tokenizer.A_NONE), - (Tokenizer.T_EMPTY, 3, "", None, Tokenizer.A_NONE), - ] - -# END Test testCoreToken_Headers +# END Test testCoreToken_ProcessHeaders diff --git a/tests/test_core/test_core_toodt.py b/tests/test_core/test_core_toodt.py index aa5bcdeb..103aa21f 100644 --- a/tests/test_core/test_core_toodt.py +++ b/tests/test_core/test_core_toodt.py @@ -65,7 +65,7 @@ def testCoreToOdt_Convert(mockGUI): theDoc.closeDocument() assert xmlToText(theDoc._xText) == ( '' - 'Title' + 'Title' '' ) @@ -77,7 +77,7 @@ def testCoreToOdt_Convert(mockGUI): theDoc.closeDocument() assert xmlToText(theDoc._xText) == ( '' - 'Chapter Title' + 'Chapter Title' '' ) diff --git a/tests/test_core/test_core_tree.py b/tests/test_core/test_core_tree.py index 50e52422..b14460e3 100644 --- a/tests/test_core/test_core_tree.py +++ b/tests/test_core/test_core_tree.py @@ -33,7 +33,7 @@ from nw.constants import nwFiles @pytest.fixture(scope="function") -def dummyItems(mockGUI): +def mockItems(mockGUI): """Create a list of mock items. """ theProject = NWProject(mockGUI) @@ -54,7 +54,7 @@ def dummyItems(mockGUI): itemC.itemName = "Chapter One" itemC.itemType = nwItemType.FILE itemC.itemClass = nwItemClass.NOVEL - itemC.itemLayout = nwItemLayout.CHAPTER + itemC.itemLayout = nwItemLayout.DOCUMENT itemC.charCount = 300 itemC.wordCount = 50 itemC.paraCount = 2 @@ -63,7 +63,7 @@ def dummyItems(mockGUI): itemD.itemName = "Scene One" itemD.itemType = nwItemType.FILE itemD.itemClass = nwItemClass.NOVEL - itemD.itemLayout = nwItemLayout.SCENE + itemD.itemLayout = nwItemLayout.DOCUMENT itemD.charCount = 3000 itemD.wordCount = 500 itemD.paraCount = 20 @@ -110,7 +110,7 @@ def dummyItems(mockGUI): @pytest.mark.core -def testCoreTree_BuildTree(mockGUI, dummyItems): +def testCoreTree_BuildTree(mockGUI, mockItems): """Test building a project tree from a list of items. """ theProject = NWProject(mockGUI) @@ -128,7 +128,7 @@ def testCoreTree_BuildTree(mockGUI, dummyItems): assert not theTree.isTrashRoot("a000000000003") aHandles = [] - for tHandle, pHandle, nwItem in dummyItems: + for tHandle, pHandle, nwItem in mockItems: aHandles.append(tHandle) assert theTree.append(tHandle, pHandle, nwItem) @@ -138,7 +138,7 @@ def testCoreTree_BuildTree(mockGUI, dummyItems): assert theTree # Check the number of elements (calls __len__) - assert len(theTree) == len(dummyItems) + assert len(theTree) == len(mockItems) # Check that we have the correct handles assert theTree.handles() == aHandles @@ -160,46 +160,46 @@ def testCoreTree_BuildTree(mockGUI, dummyItems): itemT.isExpanded = False assert not theTree.append("1234567890abc", None, itemT) - assert len(theTree) == len(dummyItems) + assert len(theTree) == len(mockItems) # Generate handle automatically itemT = NWItem(theProject) itemT.itemName = "New File" itemT.itemType = nwItemType.FILE itemT.itemClass = nwItemClass.NOVEL - itemT.itemLayout = nwItemLayout.SCENE + itemT.itemLayout = nwItemLayout.DOCUMENT assert theTree.append(None, None, itemT) - assert len(theTree) == len(dummyItems) + 1 + assert len(theTree) == len(mockItems) + 1 theList = theTree.handles() assert theList[-1] == "73475cb40a568" # Try to add existing handle assert not theTree.append("73475cb40a568", None, itemT) - assert len(theTree) == len(dummyItems) + 1 + assert len(theTree) == len(mockItems) + 1 # Delete a non-existing item del theTree["stuff"] - assert len(theTree) == len(dummyItems) + 1 + assert len(theTree) == len(mockItems) + 1 # Delete the last item del theTree["73475cb40a568"] - assert len(theTree) == len(dummyItems) + assert len(theTree) == len(mockItems) assert "73475cb40a568" not in theTree # Delete the Novel, Archive and Trash folders del theTree["a000000000001"] - assert len(theTree) == len(dummyItems) - 1 + assert len(theTree) == len(mockItems) - 1 assert "a000000000001" not in theTree del theTree["a000000000002"] - assert len(theTree) == len(dummyItems) - 2 + assert len(theTree) == len(mockItems) - 2 assert "a000000000002" not in theTree assert theTree.archiveRoot() is None del theTree["a000000000003"] - assert len(theTree) == len(dummyItems) - 3 + assert len(theTree) == len(mockItems) - 3 assert "a000000000003" not in theTree assert theTree.trashRoot() is None @@ -207,16 +207,16 @@ def testCoreTree_BuildTree(mockGUI, dummyItems): @pytest.mark.core -def testCoreTree_Methods(mockGUI, dummyItems): - """Test bvarious class methods. +def testCoreTree_Methods(mockGUI, mockItems): + """Test various class methods. """ theProject = NWProject(mockGUI) theTree = NWTree(theProject) - for tHandle, pHandle, nwItem in dummyItems: + for tHandle, pHandle, nwItem in mockItems: theTree.append(tHandle, pHandle, nwItem) - assert len(theTree) == len(dummyItems) + assert len(theTree) == len(mockItems) # Root item lookup theTree._treeRoots.append("stuff") @@ -254,141 +254,15 @@ def testCoreTree_Methods(mockGUI, dummyItems): ] # Change file layout - assert not theTree.setFileItemLayout("stuff", nwItemLayout.UNNUMBERED) - assert not theTree.setFileItemLayout("b000000000001", nwItemLayout.UNNUMBERED) - assert not theTree.setFileItemLayout("c000000000001", "stuff") - assert theTree.setFileItemLayout("c000000000001", nwItemLayout.UNNUMBERED) - assert theTree["c000000000001"].itemLayout == nwItemLayout.UNNUMBERED + assert theTree.setFileItemLayout("stuff", nwItemLayout.DOCUMENT) is False + assert theTree.setFileItemLayout("b000000000001", nwItemLayout.DOCUMENT) is False + assert theTree.setFileItemLayout("c000000000001", "stuff") is False + assert theTree.setFileItemLayout("c000000000001", nwItemLayout.NOTE) is True + assert theTree["c000000000001"].itemLayout == nwItemLayout.NOTE # END Test testCoreTree_Methods -@pytest.mark.core -def testCoreTree_UpdateItemLayout(mockGUI, dummyItems): - """Test building a project tree from a list of items. - """ - theProject = NWProject(mockGUI) - theTree = NWTree(theProject) - - for tHandle, pHandle, nwItem in dummyItems: - theTree.append(tHandle, pHandle, nwItem) - - assert len(theTree) == len(dummyItems) - - # Check rejected items - assert not theTree.updateItemLayout("0000000000000", "H1") # Non-existent handle - assert not theTree.updateItemLayout("a000000000004", "H2") # Character file - assert not theTree.updateItemLayout("c000000000002", "H0") # Wrong header level - - cHandle = "c000000000002" - - # Check layouts we won't change - theTree[cHandle].setLayout(nwItemLayout.NO_LAYOUT) - assert not theTree.updateItemLayout("c000000000002", "H1") - - theTree[cHandle].setLayout(nwItemLayout.TITLE) - assert not theTree.updateItemLayout("c000000000002", "H1") - - theTree[cHandle].setLayout(nwItemLayout.PAGE) - assert not theTree.updateItemLayout("c000000000002", "H1") - - theTree[cHandle].setLayout(nwItemLayout.NOTE) - assert not theTree.updateItemLayout("c000000000002", "H1") - - # BOOK is also a layout we change to, but never from - theTree[cHandle].setLayout(nwItemLayout.BOOK) - assert not theTree.updateItemLayout("c000000000002", "H1") - - # Test SCENE Changes - # ================== - - # H1 -> BOOK - theTree[cHandle].setLayout(nwItemLayout.SCENE) - assert theTree.updateItemLayout("c000000000002", "H1") - assert theTree[cHandle].itemLayout == nwItemLayout.BOOK - - # H2 -> CHAPTER - theTree[cHandle].setLayout(nwItemLayout.SCENE) - assert theTree.updateItemLayout("c000000000002", "H2") - assert theTree[cHandle].itemLayout == nwItemLayout.CHAPTER - - # H3 -> No CHange - theTree[cHandle].setLayout(nwItemLayout.SCENE) - assert not theTree.updateItemLayout("c000000000002", "H3") - - # H4 -> No CHange - theTree[cHandle].setLayout(nwItemLayout.SCENE) - assert not theTree.updateItemLayout("c000000000002", "H4") - - # Test CHAPTER Changes - # ==================== - - # H1 -> BOOK - theTree[cHandle].setLayout(nwItemLayout.CHAPTER) - assert theTree.updateItemLayout("c000000000002", "H1") - assert theTree[cHandle].itemLayout == nwItemLayout.BOOK - - # H2 -> No Change - theTree[cHandle].setLayout(nwItemLayout.CHAPTER) - assert not theTree.updateItemLayout("c000000000002", "H2") - - # H3 -> SCENE - theTree[cHandle].setLayout(nwItemLayout.CHAPTER) - assert theTree.updateItemLayout("c000000000002", "H3") - assert theTree[cHandle].itemLayout == nwItemLayout.SCENE - - # H4 -> SCENE - theTree[cHandle].setLayout(nwItemLayout.CHAPTER) - assert theTree.updateItemLayout("c000000000002", "H4") - assert theTree[cHandle].itemLayout == nwItemLayout.SCENE - - # Test UNNUMBERED Changes - # ======================= - - # H1 -> BOOK - theTree[cHandle].setLayout(nwItemLayout.UNNUMBERED) - assert theTree.updateItemLayout("c000000000002", "H1") - assert theTree[cHandle].itemLayout == nwItemLayout.BOOK - - # H2 -> No Change - theTree[cHandle].setLayout(nwItemLayout.UNNUMBERED) - assert not theTree.updateItemLayout("c000000000002", "H2") - - # H3 -> SCENE - theTree[cHandle].setLayout(nwItemLayout.UNNUMBERED) - assert theTree.updateItemLayout("c000000000002", "H3") - assert theTree[cHandle].itemLayout == nwItemLayout.SCENE - - # H4 -> SCENE - theTree[cHandle].setLayout(nwItemLayout.UNNUMBERED) - assert theTree.updateItemLayout("c000000000002", "H4") - assert theTree[cHandle].itemLayout == nwItemLayout.SCENE - - # Test PARTITION Changes - # ====================== - - # H1 -> BOOK - theTree[cHandle].setLayout(nwItemLayout.PARTITION) - assert not theTree.updateItemLayout("c000000000002", "H1") - - # H2 -> No Change - theTree[cHandle].setLayout(nwItemLayout.PARTITION) - assert theTree.updateItemLayout("c000000000002", "H2") - assert theTree[cHandle].itemLayout == nwItemLayout.CHAPTER - - # H3 -> SCENE - theTree[cHandle].setLayout(nwItemLayout.PARTITION) - assert theTree.updateItemLayout("c000000000002", "H3") - assert theTree[cHandle].itemLayout == nwItemLayout.SCENE - - # H4 -> SCENE - theTree[cHandle].setLayout(nwItemLayout.PARTITION) - assert theTree.updateItemLayout("c000000000002", "H4") - assert theTree[cHandle].itemLayout == nwItemLayout.SCENE - -# END Test testCoreTree_UpdateItemLayout - - @pytest.mark.core def testCoreTree_MakeHandles(monkeypatch, mockGUI): """Test generating item handles. @@ -433,16 +307,16 @@ def testCoreTree_MakeHandles(monkeypatch, mockGUI): @pytest.mark.core -def testCoreTree_Stats(mockGUI, dummyItems): +def testCoreTree_Stats(mockGUI, mockItems): """Test project stats methods. """ theProject = NWProject(mockGUI) theTree = NWTree(theProject) - for tHandle, pHandle, nwItem in dummyItems: + for tHandle, pHandle, nwItem in mockItems: theTree.append(tHandle, pHandle, nwItem) - assert len(theTree) == len(dummyItems) + assert len(theTree) == len(mockItems) theTree._treeOrder.append("stuff") # Count Words @@ -460,18 +334,18 @@ def testCoreTree_Stats(mockGUI, dummyItems): @pytest.mark.core -def testCoreTree_Reorder(mockGUI, dummyItems): +def testCoreTree_Reorder(mockGUI, mockItems): """Test changing tree order. """ theProject = NWProject(mockGUI) theTree = NWTree(theProject) aHandle = [] - for tHandle, pHandle, nwItem in dummyItems: + for tHandle, pHandle, nwItem in mockItems: aHandle.append(tHandle) theTree.append(tHandle, pHandle, nwItem) - assert len(theTree) == len(dummyItems) + assert len(theTree) == len(mockItems) bHandle = aHandle.copy() bHandle[2], bHandle[3] = bHandle[3], bHandle[2] @@ -492,16 +366,16 @@ def testCoreTree_Reorder(mockGUI, dummyItems): @pytest.mark.core -def testCoreTree_XMLPackUnpack(mockGUI, dummyItems): +def testCoreTree_XMLPackUnpack(mockGUI, mockItems): """Test packing and unpacking the tree to and from XML. """ theProject = NWProject(mockGUI) theTree = NWTree(theProject) - for tHandle, pHandle, nwItem in dummyItems: + for tHandle, pHandle, nwItem in mockItems: theTree.append(tHandle, pHandle, nwItem) - assert len(theTree) == len(dummyItems) + assert len(theTree) == len(mockItems) nwXML = etree.Element("novelWriterXML") theTree.packXML(nwXML) @@ -516,11 +390,11 @@ def testCoreTree_XMLPackUnpack(mockGUI, dummyItems): b"True" b"" b"Chapter OneFILENOVELNone" - b"TrueCHAPTER300" + b"TrueDOCUMENT300" b"5020" b"" b"Scene OneFILENOVELNone" - b"TrueSCENE3000" + b"TrueDOCUMENT3000" b"500200" b"" b"OuttakesROOTARCHIVENone" @@ -542,22 +416,22 @@ def testCoreTree_XMLPackUnpack(mockGUI, dummyItems): assert len(theTree) == 0 assert not theTree.unpackXML(nwXML) assert theTree.unpackXML(nwXML[0]) - assert len(theTree) == len(dummyItems) + assert len(theTree) == len(mockItems) # END Test testCoreTree_XMLPackUnpack @pytest.mark.core -def testCoreTree_ToCFile(monkeypatch, mockGUI, dummyItems, tmpDir): +def testCoreTree_ToCFile(monkeypatch, mockGUI, mockItems, tmpDir): """Test writing the ToC.txt file. """ theProject = NWProject(mockGUI) theTree = NWTree(theProject) - for tHandle, pHandle, nwItem in dummyItems: + for tHandle, pHandle, nwItem in mockItems: theTree.append(tHandle, pHandle, nwItem) - assert len(theTree) == len(dummyItems) + assert len(theTree) == len(mockItems) theTree._treeOrder.append("stuff") def dummyIsFile(fileName): @@ -588,8 +462,8 @@ def testCoreTree_ToCFile(monkeypatch, mockGUI, dummyItems, tmpDir): "\n" "File Name Class Layout Document Label\n" "-------------------------------------------------------------\n" - f"{pathA} NOVEL CHAPTER Chapter One\n" - f"{pathB} NOVEL SCENE Scene One\n" + f"{pathA} NOVEL DOCUMENT Chapter One\n" + f"{pathB} NOVEL DOCUMENT Scene One\n" f"{pathC} CHARACTER NOTE Jane Doe\n" ) diff --git a/tests/test_dialogs/test_dlg_itemeditor.py b/tests/test_dialogs/test_dlg_itemeditor.py index 2a61444c..c65db492 100644 --- a/tests/test_dialogs/test_dlg_itemeditor.py +++ b/tests/test_dialogs/test_dlg_itemeditor.py @@ -64,14 +64,14 @@ def testDlgItemEditor_Dialog(qtbot, monkeypatch, nwGUI, fncProj, refDir, outDir) qtbot.addWidget(itemEdit) - assert itemEdit.editName.text() == "New Scene" + assert itemEdit.editName.text() == "New Scene" assert itemEdit.editStatus.currentData() == "New" - assert itemEdit.editLayout.currentData() == nwItemLayout.SCENE + assert itemEdit.editLayout.currentData() == nwItemLayout.DOCUMENT for c in "Just a Page": qtbot.keyClick(itemEdit.editName, c, delay=typeDelay) itemEdit.editStatus.setCurrentIndex(1) - layoutIdx = itemEdit.editLayout.findData(nwItemLayout.PAGE) + layoutIdx = itemEdit.editLayout.findData(nwItemLayout.DOCUMENT) itemEdit.editLayout.setCurrentIndex(layoutIdx) itemEdit.editExport.setChecked(False) @@ -86,9 +86,9 @@ def testDlgItemEditor_Dialog(qtbot, monkeypatch, nwGUI, fncProj, refDir, outDir) itemEdit.show() qtbot.addWidget(itemEdit) - assert itemEdit.editName.text() == "Just a Page" + assert itemEdit.editName.text() == "Just a Page" assert itemEdit.editStatus.currentData() == "Note" - assert itemEdit.editLayout.currentData() == nwItemLayout.PAGE + assert itemEdit.editLayout.currentData() == nwItemLayout.DOCUMENT itemEdit._doClose() # Check that the header is updated diff --git a/tests/test_dialogs/test_dlg_merge.py b/tests/test_dialogs/test_dlg_merge.py index 5bcf6906..039e0654 100644 --- a/tests/test_dialogs/test_dlg_merge.py +++ b/tests/test_dialogs/test_dlg_merge.py @@ -142,7 +142,7 @@ def testDlgMerge_Main(qtbot, monkeypatch, nwGUI, fncProj): assert readFile(mergedFile) == ( "%%%%~name: New Chapter\n" "%%%%~path: 73475cb40a568/2858dcd1057d3\n" - "%%%%~kind: NOVEL/SCENE\n" + "%%%%~kind: NOVEL/DOCUMENT\n" "%s\n\n" "%s\n\n" "%s\n\n" diff --git a/tests/test_dialogs/test_dlg_preferences.py b/tests/test_dialogs/test_dlg_preferences.py index 2e89f63c..ee30a0bc 100644 --- a/tests/test_dialogs/test_dlg_preferences.py +++ b/tests/test_dialogs/test_dlg_preferences.py @@ -62,8 +62,7 @@ def testDlgPreferences_Main(qtbot, monkeypatch, fncDir, outDir, refDir): nwGUI = nw.main(["--testmode", "--config=%s" % fncDir, "--data=%s" % fncDir]) qtbot.addWidget(nwGUI) nwGUI.show() - qtbot.waitForWindowShown(nwGUI) - qtbot.wait(20) + qtbot.wait(stepDelay) theConf = nwGUI.mainConf assert theConf.confPath == fncDir diff --git a/tests/test_dialogs/test_dlg_split.py b/tests/test_dialogs/test_dlg_split.py index 1c761615..6b8f1f7d 100644 --- a/tests/test_dialogs/test_dlg_split.py +++ b/tests/test_dialogs/test_dlg_split.py @@ -178,49 +178,49 @@ def testDlgSplit_Main(qtbot, monkeypatch, nwGUI, fncProj): assert readFile(os.path.join(contentDir, hPartition+".nwd")) == ( "%%%%~name: Nantucket\n" "%%%%~path: 031b4af5197ec/%s\n" - "%%%%~kind: NOVEL/PARTITION\n" + "%%%%~kind: NOVEL/DOCUMENT\n" "%s\n\n" ) % (hPartition, tPartition) assert readFile(os.path.join(contentDir, hChapterOne+".nwd")) == ( "%%%%~name: Chapter One\n" "%%%%~path: 031b4af5197ec/%s\n" - "%%%%~kind: NOVEL/CHAPTER\n" + "%%%%~kind: NOVEL/DOCUMENT\n" "%s\n\n" ) % (hChapterOne, tChapterOne) assert readFile(os.path.join(contentDir, hSceneOne+".nwd")) == ( "%%%%~name: Scene One\n" "%%%%~path: 031b4af5197ec/%s\n" - "%%%%~kind: NOVEL/SCENE\n" + "%%%%~kind: NOVEL/DOCUMENT\n" "%s\n\n" ) % (hSceneOne, tSceneOne) assert readFile(os.path.join(contentDir, hSceneTwo+".nwd")) == ( "%%%%~name: Scene Two\n" "%%%%~path: 031b4af5197ec/%s\n" - "%%%%~kind: NOVEL/SCENE\n" + "%%%%~kind: NOVEL/DOCUMENT\n" "%s\n\n" ) % (hSceneTwo, tSceneTwo) assert readFile(os.path.join(contentDir, hSceneThree+".nwd")) == ( "%%%%~name: Scene Three\n" "%%%%~path: 031b4af5197ec/%s\n" - "%%%%~kind: NOVEL/SCENE\n" + "%%%%~kind: NOVEL/DOCUMENT\n" "%s\n\n" ) % (hSceneThree, tSceneThree) assert readFile(os.path.join(contentDir, hSceneFour+".nwd")) == ( "%%%%~name: Scene Four\n" "%%%%~path: 031b4af5197ec/%s\n" - "%%%%~kind: NOVEL/SCENE\n" + "%%%%~kind: NOVEL/DOCUMENT\n" "%s\n\n" ) % (hSceneFour, tSceneFour) assert readFile(os.path.join(contentDir, hSceneFive+".nwd")) == ( "%%%%~name: The End\n" "%%%%~path: 031b4af5197ec/%s\n" - "%%%%~kind: NOVEL/SCENE\n" + "%%%%~kind: NOVEL/DOCUMENT\n" "%s\n\n" ) % (hSceneFive, tSceneFive) diff --git a/tests/test_gui/test_gui_doceditor.py b/tests/test_gui/test_gui_doceditor.py index 37f9be08..1cb6ccdd 100644 --- a/tests/test_gui/test_gui_doceditor.py +++ b/tests/test_gui/test_gui_doceditor.py @@ -183,10 +183,10 @@ def testGuiEditor_SaveText(qtbot, monkeypatch, caplog, nwGUI, nwMinimal, ipsumTe assert "Could not save document." in caplog.text # Change header level - assert nwGUI.theProject.projTree[sHandle].itemLayout == nwItemLayout.SCENE + assert nwGUI.theProject.projTree[sHandle].itemLayout == nwItemLayout.DOCUMENT nwGUI.docEditor.replaceText(longText[1:]) assert nwGUI.docEditor.saveText() is True - assert nwGUI.theProject.projTree[sHandle].itemLayout == nwItemLayout.CHAPTER + assert nwGUI.theProject.projTree[sHandle].itemLayout == nwItemLayout.DOCUMENT # Regular save assert nwGUI.docEditor.saveText() is True diff --git a/tests/test_gui/test_gui_theme.py b/tests/test_gui/test_gui_theme.py index b9fc1f69..3290be80 100644 --- a/tests/test_gui/test_gui_theme.py +++ b/tests/test_gui/test_gui_theme.py @@ -40,8 +40,7 @@ def testGuiTheme_Main(qtbot, monkeypatch, nwMinimal, tmpDir): nwGUI = nw.main(["--testmode", "--config=%s" % nwMinimal, "--data=%s" % tmpDir, nwMinimal]) qtbot.addWidget(nwGUI) nwGUI.show() - qtbot.waitForWindowShown(nwGUI) - qtbot.wait(500) + qtbot.wait(stepDelay) # Change Settings assert nw.CONFIG.confPath == nwMinimal @@ -64,8 +63,7 @@ def testGuiTheme_Main(qtbot, monkeypatch, nwMinimal, tmpDir): assert nwGUI.mainConf.confPath == nwMinimal qtbot.addWidget(nwGUI) nwGUI.show() - qtbot.waitForWindowShown(nwGUI) - qtbot.wait(500) + qtbot.wait(stepDelay) assert nw.CONFIG.guiTheme == "default_dark" assert nw.CONFIG.guiSyntax == "tomorrow_night_eighties"