diff --git a/novelwriter/assets/i18n/project_en_GB.json b/novelwriter/assets/i18n/project_en_GB.json index 39d52e6e0..fe4be646f 100644 --- a/novelwriter/assets/i18n/project_en_GB.json +++ b/novelwriter/assets/i18n/project_en_GB.json @@ -3,7 +3,7 @@ "Short Description": "Short Description", "Footnotes": "Footnotes", "Comment": "Comment", - "Notes": "Notes", + "Note": "Note", "Tag": "Tag", "Point of View": "Point of View", "Focus": "Focus", diff --git a/novelwriter/core/docbuild.py b/novelwriter/core/docbuild.py index f753b61b4..d587a2ddd 100644 --- a/novelwriter/core/docbuild.py +++ b/novelwriter/core/docbuild.py @@ -160,6 +160,7 @@ def iterBuildDocument(self, path: Path, bFormat: nwBuildFmt) -> Iterable[tuple[i elif bFormat in (nwBuildFmt.HTML, nwBuildFmt.J_HTML): makeObj = ToHtml(self._project) filtered = self._setupBuild(makeObj) + makeObj.initDocument() yield from self._iterBuild(makeObj, filtered) diff --git a/novelwriter/formats/shared.py b/novelwriter/formats/shared.py new file mode 100644 index 000000000..ef36e9555 --- /dev/null +++ b/novelwriter/formats/shared.py @@ -0,0 +1,150 @@ +""" +novelWriter – Formats Shared +============================ + +File History: +Created: 2024-10-21 [2.6b1] TextFmt +Created: 2024-10-21 [2.6b1] BlockTyp +Created: 2024-10-21 [2.6b1] BlockFmt + +This file is a part of novelWriter +Copyright 2018–2024, Veronica Berglyd Olsen + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +""" +from __future__ import annotations + +import re + +from enum import Flag, IntEnum + +from PyQt5.QtGui import QColor + +ESCAPES = {r"\*": "*", r"\~": "~", r"\_": "_", r"\[": "[", r"\]": "]", r"\ ": ""} +RX_ESC = re.compile("|".join([re.escape(k) for k in ESCAPES.keys()]), flags=re.DOTALL) + + +def stripEscape(text: str) -> str: + """Strip escaped Markdown characters from paragraph text.""" + if "\\" in text: + return RX_ESC.sub(lambda x: ESCAPES[x.group(0)], text) + return text + + +class TextDocumentTheme: + """Default document theme.""" + + text: QColor = QColor(0, 0, 0) + highlight: QColor = QColor(255, 255, 166) + head: QColor = QColor(66, 113, 174) + comment: QColor = QColor(100, 100, 100) + note: QColor = QColor(129, 55, 9) + code: QColor = QColor(66, 113, 174) + modifier: QColor = QColor(129, 55, 9) + keyword: QColor = QColor(245, 135, 31) + tag: QColor = QColor(66, 113, 174) + optional: QColor = QColor(66, 113, 174) + dialog: QColor = QColor(66, 113, 174) + altdialog: QColor = QColor(129, 55, 9) + + +# Enums +# ===== + +class TextFmt(IntEnum): + """Text Format. + + An enum indicating the beginning or end of a text format region. + They must be paired with a position, and apply to locations in a + text block. + """ + + B_B = 1 # Begin bold + B_E = 2 # End bold + I_B = 3 # Begin italics + I_E = 4 # End italics + D_B = 5 # Begin strikeout + D_E = 6 # End strikeout + U_B = 7 # Begin underline + U_E = 8 # End underline + M_B = 9 # Begin mark + M_E = 10 # End mark + SUP_B = 11 # Begin superscript + SUP_E = 12 # End superscript + SUB_B = 13 # Begin subscript + SUB_E = 14 # End subscript + COL_B = 15 # Begin colour + COL_E = 16 # End colour + ANM_B = 17 # Begin anchor name + ANM_E = 18 # End anchor name + HRF_B = 19 # Begin href link + HRF_E = 20 # End href link + FNOTE = 21 # Footnote marker + STRIP = 22 # Strip the format code + + +class BlockTyp(IntEnum): + """Text Block Type. + + An enum indicating the type of a text block. + """ + + EMPTY = 1 # Empty line (new paragraph) + TITLE = 2 # Title + HEAD1 = 3 # Heading 1 + HEAD2 = 4 # Heading 2 + HEAD3 = 5 # Heading 3 + HEAD4 = 6 # Heading 4 + TEXT = 7 # Text line + SEP = 8 # Scene separator + SKIP = 9 # Paragraph break + SUMMARY = 10 # Synopsis/short comment + NOTE = 11 # Note + COMMENT = 12 # Comment + KEYWORD = 13 # Tag/reference keywords + + +class BlockFmt(Flag): + """Text Block Format. + + An enum of flags that can be combined to format a text block. + """ + + NONE = 0x0000 # No special style + LEFT = 0x0001 # Left aligned + RIGHT = 0x0002 # Right aligned + CENTRE = 0x0004 # Centred + JUSTIFY = 0x0008 # Justified + PBB = 0x0010 # Page break before + PBA = 0x0020 # Page break after + Z_TOPMRG = 0x0040 # Zero top margin + Z_BTMMRG = 0x0080 # Zero bottom margin + IND_L = 0x0100 # Left indentation + IND_R = 0x0200 # Right indentation + IND_T = 0x0400 # Text indentation + + +# Types +# ===== + +# A list of formats for a single text string, consisting of: +# text position, text format, and meta data +T_Formats = list[tuple[int, TextFmt, str]] + +# A note or comment with text and associated text formats +T_Note = tuple[str, T_Formats] + +# A tokenized text block, consisting of: +# type, header number, text, text formats, and block format +T_Block = tuple[BlockTyp, int, str, T_Formats, BlockFmt] diff --git a/novelwriter/formats/todocx.py b/novelwriter/formats/todocx.py index e417d0ae6..16772d7ad 100644 --- a/novelwriter/formats/todocx.py +++ b/novelwriter/formats/todocx.py @@ -34,12 +34,15 @@ from zipfile import ZIP_DEFLATED, ZipFile from PyQt5.QtCore import QMarginsF, QSizeF +from PyQt5.QtGui import QColor from novelwriter import __version__ from novelwriter.common import firstFloat, xmlSubElem -from novelwriter.constants import nwHeadFmt, nwKeyWords, nwLabels, nwStyles +from novelwriter.constants import nwHeadFmt, nwStyles from novelwriter.core.project import NWProject -from novelwriter.formats.tokenizer import T_Formats, Tokenizer +from novelwriter.formats.shared import BlockFmt, BlockTyp, T_Formats, TextFmt +from novelwriter.formats.tokenizer import Tokenizer +from novelwriter.types import QtHexRgb logger = logging.getLogger(__name__) @@ -79,6 +82,11 @@ def _mkTag(ns: str, tag: str) -> str: return tag +def _docXCol(color: QColor) -> str: + """Format a QColor as the DocX accepted value.""" + return color.name(QtHexRgb).lstrip("#") + + # Formatting Codes X_BLD = 0x001 # Bold format X_ITA = 0x002 # Italic format @@ -87,8 +95,7 @@ def _mkTag(ns: str, tag: str) -> str: X_MRK = 0x010 # Marked format X_SUP = 0x020 # Superscript X_SUB = 0x040 # Subscript -X_DLG = 0x080 # Dialogue -X_DLA = 0x100 # Alt. Dialogue +X_COL = 0x080 # Coloured text # Formatting Masks M_BLD = ~X_BLD @@ -98,8 +105,7 @@ def _mkTag(ns: str, tag: str) -> str: M_MRK = ~X_MRK M_SUP = ~X_SUP M_SUB = ~X_SUB -M_DLG = ~X_DLG -M_DLA = ~X_DLA +M_COL = ~X_COL # DocX Styles S_NORM = "Normal" @@ -113,14 +119,6 @@ def _mkTag(ns: str, tag: str) -> str: S_HEAD = "Header" S_FNOTE = "FootnoteText" -# Colours -COL_HEAD_L12 = "2a6099" -COL_HEAD_L34 = "444444" -COL_DIALOG_M = "2a6099" -COL_DIALOG_A = "813709" -COL_META_TXT = "813709" -COL_MARK_TXT = "ffffa6" - class DocXXmlFile(NamedTuple): @@ -208,6 +206,7 @@ def setHeaderFormat(self, format: str, offset: int) -> None: def initDocument(self) -> None: """Initialises the DocX document structure.""" + super().initDocument() self._fontFamily = self._textFont.family() self._fontSize = self._textFont.pointSizeF() self._generateStyles() @@ -219,7 +218,7 @@ def doConvert(self) -> None: bIndent = self._fontSize * self._blockIndent - for tType, _, tText, tFormat, tStyle in self._tokens: + for tType, _, tText, tFormat, tStyle in self._blocks: # Create Paragraph par = DocXParagraph() @@ -227,79 +226,67 @@ def doConvert(self) -> None: # Styles if tStyle is not None: - if tStyle & self.A_LEFT: + if tStyle & BlockFmt.LEFT: par.setAlignment("left") - elif tStyle & self.A_RIGHT: + elif tStyle & BlockFmt.RIGHT: par.setAlignment("right") - elif tStyle & self.A_CENTRE: + elif tStyle & BlockFmt.CENTRE: par.setAlignment("center") - elif tStyle & self.A_JUSTIFY: + elif tStyle & BlockFmt.JUSTIFY: par.setAlignment("both") - if tStyle & self.A_PBB: + if tStyle & BlockFmt.PBB: par.setPageBreakBefore(True) - if tStyle & self.A_PBA: + if tStyle & BlockFmt.PBA: par.setPageBreakAfter(True) - if tStyle & self.A_Z_BTMMRG: + if tStyle & BlockFmt.Z_BTMMRG: par.setMarginBottom(0.0) - if tStyle & self.A_Z_TOPMRG: + if tStyle & BlockFmt.Z_TOPMRG: par.setMarginTop(0.0) - if tStyle & self.A_IND_T: + if tStyle & BlockFmt.IND_T: par.setIndentFirst(True) - if tStyle & self.A_IND_L: + if tStyle & BlockFmt.IND_L: par.setMarginLeft(bIndent) - if tStyle & self.A_IND_R: + if tStyle & BlockFmt.IND_R: par.setMarginRight(bIndent) # Process Text Types - if tType == self.T_TEXT: - if self._doJustify and "\n" in tText: - par.overrideJustify(self._defaultAlign) + if tType == BlockTyp.TEXT: self._processFragments(par, S_NORM, tText, tFormat) - elif tType == self.T_TITLE: + elif tType == BlockTyp.TITLE: tHead = tText.replace(nwHeadFmt.BR, "\n") self._processFragments(par, S_TITLE, tHead, tFormat) - elif tType == self.T_HEAD1: + elif tType == BlockTyp.HEAD1: tHead = tText.replace(nwHeadFmt.BR, "\n") self._processFragments(par, S_HEAD1, tHead, tFormat) - elif tType == self.T_HEAD2: + elif tType == BlockTyp.HEAD2: tHead = tText.replace(nwHeadFmt.BR, "\n") self._processFragments(par, S_HEAD2, tHead, tFormat) - elif tType == self.T_HEAD3: + elif tType == BlockTyp.HEAD3: tHead = tText.replace(nwHeadFmt.BR, "\n") self._processFragments(par, S_HEAD3, tHead, tFormat) - elif tType == self.T_HEAD4: + elif tType == BlockTyp.HEAD4: tHead = tText.replace(nwHeadFmt.BR, "\n") self._processFragments(par, S_HEAD4, tHead, tFormat) - elif tType == self.T_SEP: + elif tType == BlockTyp.SEP: self._processFragments(par, S_SEP, tText) - elif tType == self.T_SKIP: + elif tType == BlockTyp.SKIP: self._processFragments(par, S_NORM, "") - elif tType == self.T_SYNOPSIS and self._doSynopsis: - tTemp, tFmt = self._formatSynopsis(tText, tFormat, True) - self._processFragments(par, S_META, tTemp, tFmt) - - elif tType == self.T_SHORT and self._doSynopsis: - tTemp, tFmt = self._formatSynopsis(tText, tFormat, False) - self._processFragments(par, S_META, tTemp, tFmt) + elif tType == BlockTyp.COMMENT: + self._processFragments(par, S_META, tText, tFormat) - elif tType == self.T_COMMENT and self._doComments: - tTemp, tFmt = self._formatComments(tText, tFormat) - self._processFragments(par, S_META, tTemp, tFmt) - - elif tType == self.T_KEYWORD and self._doKeywords: - tTemp, tFmt = self._formatKeywords(tText) - self._processFragments(par, S_META, tTemp, tFmt) + elif tType == BlockTyp.KEYWORD: + self._processFragments(par, S_META, tText, tFormat) return @@ -375,40 +362,6 @@ def xmlToZip(name: str, xObj: ET.Element, zipObj: ZipFile) -> None: # Internal Functions ## - def _formatSynopsis(self, text: str, fmt: T_Formats, synopsis: bool) -> tuple[str, T_Formats]: - """Apply formatting to synopsis lines.""" - name = self._localLookup("Synopsis" if synopsis else "Short Description") - shift = len(name) + 2 - rTxt = f"{name}: {text}" - rFmt: T_Formats = [(0, self.FMT_B_B, ""), (len(name) + 1, self.FMT_B_E, "")] - rFmt.extend((p + shift, f, d) for p, f, d in fmt) - return rTxt, rFmt - - def _formatComments(self, text: str, fmt: T_Formats) -> tuple[str, T_Formats]: - """Apply formatting to comments.""" - name = self._localLookup("Comment") - shift = len(name) + 2 - rTxt = f"{name}: {text}" - rFmt: T_Formats = [(0, self.FMT_B_B, ""), (len(name) + 1, self.FMT_B_E, "")] - rFmt.extend((p + shift, f, d) for p, f, d in fmt) - return rTxt, rFmt - - def _formatKeywords(self, text: str) -> tuple[str, T_Formats]: - """Apply formatting to keywords.""" - valid, bits, _ = self._project.index.scanThis("@"+text) - if not valid or not bits or bits[0] not in nwLabels.KEY_NAME: - return "", [] - - rTxt = f"{self._localLookup(nwLabels.KEY_NAME[bits[0]])}: " - rFmt: T_Formats = [(0, self.FMT_B_B, ""), (len(rTxt) - 1, self.FMT_B_E, "")] - if len(bits) > 1: - if bits[0] == nwKeyWords.TAG_KEY: - rTxt += bits[1] - else: - rTxt += ", ".join(bits[1:]) - - return rTxt, rFmt - def _processFragments( self, par: DocXParagraph, pStyle: str, text: str, tFmt: T_Formats | None = None ) -> None: @@ -417,6 +370,7 @@ def _processFragments( xFmt = 0x00 xNode = None fStart = 0 + fClass = "" for fPos, fFmt, fData in tFmt or []: if xNode is not None: @@ -424,47 +378,45 @@ def _processFragments( xNode = None if temp := text[fStart:fPos]: - par.addContent(self._textRunToXml(temp, xFmt)) + par.addContent(self._textRunToXml(temp, xFmt, fClass)) - if fFmt == self.FMT_B_B: + if fFmt == TextFmt.B_B: xFmt |= X_BLD - elif fFmt == self.FMT_B_E: + elif fFmt == TextFmt.B_E: xFmt &= M_BLD - elif fFmt == self.FMT_I_B: + elif fFmt == TextFmt.I_B: xFmt |= X_ITA - elif fFmt == self.FMT_I_E: + elif fFmt == TextFmt.I_E: xFmt &= M_ITA - elif fFmt == self.FMT_D_B: + elif fFmt == TextFmt.D_B: xFmt |= X_DEL - elif fFmt == self.FMT_D_E: + elif fFmt == TextFmt.D_E: xFmt &= M_DEL - elif fFmt == self.FMT_U_B: + elif fFmt == TextFmt.U_B: xFmt |= X_UND - elif fFmt == self.FMT_U_E: + elif fFmt == TextFmt.U_E: xFmt &= M_UND - elif fFmt == self.FMT_M_B: + elif fFmt == TextFmt.M_B: xFmt |= X_MRK - elif fFmt == self.FMT_M_E: + elif fFmt == TextFmt.M_E: xFmt &= M_MRK - elif fFmt == self.FMT_SUP_B: + elif fFmt == TextFmt.SUP_B: xFmt |= X_SUP - elif fFmt == self.FMT_SUP_E: + elif fFmt == TextFmt.SUP_E: xFmt &= M_SUP - elif fFmt == self.FMT_SUB_B: + elif fFmt == TextFmt.SUB_B: xFmt |= X_SUB - elif fFmt == self.FMT_SUB_E: + elif fFmt == TextFmt.SUB_E: xFmt &= M_SUB - elif fFmt == self.FMT_DL_B: - xFmt |= X_DLG - elif fFmt == self.FMT_DL_E: - xFmt &= M_DLG - elif fFmt == self.FMT_ADL_B: - xFmt |= X_DLA - elif fFmt == self.FMT_ADL_E: - xFmt &= M_DLA - elif fFmt == self.FMT_FNOTE: + elif fFmt == TextFmt.COL_B: + xFmt |= X_COL + fClass = fData + elif fFmt == TextFmt.COL_E: + xFmt &= M_COL + fClass = "" + elif fFmt == TextFmt.FNOTE: xNode = self._generateFootnote(fData) - elif fFmt == self.FMT_STRIP: + elif fFmt == TextFmt.STRIP: pass # Move pos for next pass @@ -474,34 +426,32 @@ def _processFragments( par.addContent(xNode) if temp := text[fStart:]: - par.addContent(self._textRunToXml(temp, xFmt)) + par.addContent(self._textRunToXml(temp, xFmt, fClass)) return - def _textRunToXml(self, text: str, fmt: int) -> ET.Element: + def _textRunToXml(self, text: str, fmt: int, fClass: str = "") -> ET.Element: """Encode the text run into XML.""" run = ET.Element(_wTag("r")) rPr = xmlSubElem(run, _wTag("rPr")) - if fmt & X_BLD == X_BLD: + if fmt & X_BLD: xmlSubElem(rPr, _wTag("b")) - if fmt & X_ITA == X_ITA: + if fmt & X_ITA: xmlSubElem(rPr, _wTag("i")) - if fmt & X_UND == X_UND: + if fmt & X_UND: xmlSubElem(rPr, _wTag("u"), attrib={_wTag("val"): "single"}) - if fmt & X_MRK == X_MRK: + if fmt & X_MRK: xmlSubElem(rPr, _wTag("shd"), attrib={ - _wTag("fill"): COL_MARK_TXT, _wTag("val"): "clear", + _wTag("fill"): _docXCol(self._theme.highlight), _wTag("val"): "clear", }) - if fmt & X_DEL == X_DEL: + if fmt & X_DEL: xmlSubElem(rPr, _wTag("strike")) - if fmt & X_SUP == X_SUP: + if fmt & X_SUP: xmlSubElem(rPr, _wTag("vertAlign"), attrib={_wTag("val"): "superscript"}) - if fmt & X_SUB == X_SUB: + if fmt & X_SUB: xmlSubElem(rPr, _wTag("vertAlign"), attrib={_wTag("val"): "subscript"}) - if fmt & X_DLG == X_DLG: - xmlSubElem(rPr, _wTag("color"), attrib={_wTag("val"): COL_DIALOG_M}) - if fmt & X_DLA == X_DLA: - xmlSubElem(rPr, _wTag("color"), attrib={_wTag("val"): COL_DIALOG_A}) + if fmt & X_COL and (color := self._classes.get(fClass)): + xmlSubElem(rPr, _wTag("color"), attrib={_wTag("val"): _docXCol(color)}) for segment in RX_TEXT.split(text): if segment == "\n": @@ -536,7 +486,7 @@ def _generateStyles(self) -> None: styles: list[DocXParStyle] = [] hScale = self._scaleHeads - hColor = self._colorHeads + hColor = _docXCol(self._theme.head) if self._colorHeads else None fSz = self._fontSize fnSz = 0.8 * self._fontSize fSz0 = (nwStyles.H_SIZES[0] * fSz) if hScale else fSz @@ -544,7 +494,6 @@ def _generateStyles(self) -> None: fSz2 = (nwStyles.H_SIZES[2] * fSz) if hScale else fSz fSz3 = (nwStyles.H_SIZES[3] * fSz) if hScale else fSz fSz4 = (nwStyles.H_SIZES[4] * fSz) if hScale else fSz - align = "both" if self._doJustify else "left" # Add Normal Style styles.append(DocXParStyle( @@ -556,7 +505,7 @@ def _generateStyles(self) -> None: after=fSz * self._marginText[1], line=fSz * self._lineHeight, indentFirst=fSz * self._firstWidth, - align=align, + align=self._defaultAlign, )) # Add Title @@ -584,7 +533,7 @@ def _generateStyles(self) -> None: after=fSz * self._marginHead1[1], line=fSz1 * self._lineHeight, level=0, - color=COL_HEAD_L12 if hColor else None, + color=hColor, bold=self._boldHeads, )) @@ -599,7 +548,7 @@ def _generateStyles(self) -> None: after=fSz * self._marginHead2[1], line=fSz2 * self._lineHeight, level=1, - color=COL_HEAD_L12 if hColor else None, + color=hColor, bold=self._boldHeads, )) @@ -614,7 +563,7 @@ def _generateStyles(self) -> None: after=fSz * self._marginHead3[1], line=fSz3 * self._lineHeight, level=1, - color=COL_HEAD_L34 if hColor else None, + color=hColor, bold=self._boldHeads, )) @@ -629,7 +578,7 @@ def _generateStyles(self) -> None: after=fSz * self._marginHead4[1], line=fSz4 * self._lineHeight, level=1, - color=COL_HEAD_L34 if hColor else None, + color=hColor, bold=self._boldHeads, )) @@ -656,7 +605,6 @@ def _generateStyles(self) -> None: before=fSz * self._marginMeta[0], after=fSz * self._marginMeta[1], line=fSz * self._lineHeight, - color=COL_META_TXT, )) # Header @@ -1085,12 +1033,6 @@ def setPageBreakAfter(self, state: bool) -> None: # Methods ## - def overrideJustify(self, default: str) -> None: - """Override inherited justify setting if None is set.""" - if self._textAlign is None: - self.setAlignment(default) - return - def addContent(self, run: ET.Element) -> None: """Add a run segment to the paragraph.""" self._content.append(run) diff --git a/novelwriter/formats/tohtml.py b/novelwriter/formats/tohtml.py index 54827a2a1..af46ee289 100644 --- a/novelwriter/formats/tohtml.py +++ b/novelwriter/formats/tohtml.py @@ -30,37 +30,40 @@ from time import time from novelwriter.common import formatTimeStamp -from novelwriter.constants import nwHeadFmt, nwHtmlUnicode, nwKeyWords, nwLabels +from novelwriter.constants import nwHeadFmt, nwHtmlUnicode from novelwriter.core.project import NWProject -from novelwriter.formats.tokenizer import T_Formats, Tokenizer, stripEscape -from novelwriter.types import FONT_STYLE, FONT_WEIGHTS +from novelwriter.formats.shared import BlockFmt, BlockTyp, T_Formats, TextFmt, stripEscape +from novelwriter.formats.tokenizer import Tokenizer +from novelwriter.types import FONT_STYLE, FONT_WEIGHTS, QtHexRgb logger = logging.getLogger(__name__) # Each opener tag, with the id of its corresponding closer and tag format HTML_OPENER: dict[int, tuple[int, str]] = { - Tokenizer.FMT_B_B: (Tokenizer.FMT_B_E, ""), - Tokenizer.FMT_I_B: (Tokenizer.FMT_I_E, ""), - Tokenizer.FMT_D_B: (Tokenizer.FMT_D_E, ""), - Tokenizer.FMT_U_B: (Tokenizer.FMT_U_E, ""), - Tokenizer.FMT_M_B: (Tokenizer.FMT_M_E, ""), - Tokenizer.FMT_SUP_B: (Tokenizer.FMT_SUP_E, ""), - Tokenizer.FMT_SUB_B: (Tokenizer.FMT_SUB_E, ""), - Tokenizer.FMT_DL_B: (Tokenizer.FMT_DL_E, ""), - Tokenizer.FMT_ADL_B: (Tokenizer.FMT_ADL_E, ""), + TextFmt.B_B: (TextFmt.B_E, ""), + TextFmt.I_B: (TextFmt.I_E, ""), + TextFmt.D_B: (TextFmt.D_E, ""), + TextFmt.U_B: (TextFmt.U_E, ""), + TextFmt.M_B: (TextFmt.M_E, ""), + TextFmt.SUP_B: (TextFmt.SUP_E, ""), + TextFmt.SUB_B: (TextFmt.SUB_E, ""), + TextFmt.COL_B: (TextFmt.COL_E, ""), + TextFmt.ANM_B: (TextFmt.ANM_E, ""), + TextFmt.HRF_B: (TextFmt.HRF_E, ""), } # Each closer tag, with the id of its corresponding opener and tag format HTML_CLOSER: dict[int, tuple[int, str]] = { - Tokenizer.FMT_B_E: (Tokenizer.FMT_B_B, ""), - Tokenizer.FMT_I_E: (Tokenizer.FMT_I_B, ""), - Tokenizer.FMT_D_E: (Tokenizer.FMT_D_B, ""), - Tokenizer.FMT_U_E: (Tokenizer.FMT_U_B, ""), - Tokenizer.FMT_M_E: (Tokenizer.FMT_M_B, ""), - Tokenizer.FMT_SUP_E: (Tokenizer.FMT_SUP_B, ""), - Tokenizer.FMT_SUB_E: (Tokenizer.FMT_SUB_B, ""), - Tokenizer.FMT_DL_E: (Tokenizer.FMT_DL_B, ""), - Tokenizer.FMT_ADL_E: (Tokenizer.FMT_ADL_B, ""), + TextFmt.B_E: (TextFmt.B_B, ""), + TextFmt.I_E: (TextFmt.I_B, ""), + TextFmt.D_E: (TextFmt.D_B, ""), + TextFmt.U_E: (TextFmt.U_B, ""), + TextFmt.M_E: (TextFmt.M_B, ""), + TextFmt.SUP_E: (TextFmt.SUP_B, ""), + TextFmt.SUB_E: (TextFmt.SUB_B, ""), + TextFmt.COL_E: (TextFmt.COL_B, ""), + TextFmt.ANM_E: (TextFmt.ANM_B, ""), + TextFmt.HRF_E: (TextFmt.HRF_B, ""), } # Empty HTML tag record @@ -156,21 +159,21 @@ def doConvert(self) -> None: lines = [] tHandle = self._handle - for tType, nHead, tText, tFormat, tStyle in self._tokens: + for tType, nHead, tText, tFmt, tStyle in self._blocks: # Replace < and > with HTML entities - if tFormat: + if tFmt: # If we have formatting, we must recompute the locations cText = [] i = 0 for c in tText: if c == "<": cText.append("<") - tFormat = [(p + 3 if p > i else p, f, k) for p, f, k in tFormat] + tFmt = [(p + 3 if p > i else p, f, k) for p, f, k in tFmt] i += 4 elif c == ">": cText.append(">") - tFormat = [(p + 3 if p > i else p, f, k) for p, f, k in tFormat] + tFmt = [(p + 3 if p > i else p, f, k) for p, f, k in tFmt] i += 4 else: cText.append(c) @@ -183,30 +186,30 @@ def doConvert(self) -> None: # Styles aStyle = [] if tStyle is not None and self._cssStyles: - if tStyle & self.A_LEFT: + if tStyle & BlockFmt.LEFT: aStyle.append("text-align: left;") - elif tStyle & self.A_RIGHT: + elif tStyle & BlockFmt.RIGHT: aStyle.append("text-align: right;") - elif tStyle & self.A_CENTRE: + elif tStyle & BlockFmt.CENTRE: aStyle.append("text-align: center;") - elif tStyle & self.A_JUSTIFY: + elif tStyle & BlockFmt.JUSTIFY: aStyle.append("text-align: justify;") - if tStyle & self.A_PBB: + if tStyle & BlockFmt.PBB: aStyle.append("page-break-before: always;") - if tStyle & self.A_PBA: + if tStyle & BlockFmt.PBA: aStyle.append("page-break-after: always;") - if tStyle & self.A_Z_BTMMRG: + if tStyle & BlockFmt.Z_BTMMRG: aStyle.append("margin-bottom: 0;") - if tStyle & self.A_Z_TOPMRG: + if tStyle & BlockFmt.Z_TOPMRG: aStyle.append("margin-top: 0;") - if tStyle & self.A_IND_L: + if tStyle & BlockFmt.IND_L: aStyle.append(f"margin-left: {self._blockIndent:.2f}em;") - if tStyle & self.A_IND_R: + if tStyle & BlockFmt.IND_R: aStyle.append(f"margin-right: {self._blockIndent:.2f}em;") - if tStyle & self.A_IND_T: + if tStyle & BlockFmt.IND_T: aStyle.append(f"text-indent: {self._firstWidth:.2f}em;") if aStyle: @@ -221,49 +224,40 @@ def doConvert(self) -> None: aNm = "" # Process Text Type - if tType == self.T_TEXT: - lines.append(f"{self._formatText(tText, tFormat)}

\n") + if tType == BlockTyp.TEXT: + lines.append(f"{self._formatText(tText, tFmt)}

\n") - elif tType == self.T_TITLE: + elif tType == BlockTyp.TITLE: tHead = tText.replace(nwHeadFmt.BR, "
") lines.append(f"

{aNm}{tHead}

\n") - elif tType == self.T_HEAD1: + elif tType == BlockTyp.HEAD1: tHead = tText.replace(nwHeadFmt.BR, "
") lines.append(f"<{h1}{h1Cl}{hStyle}>{aNm}{tHead}\n") - elif tType == self.T_HEAD2: + elif tType == BlockTyp.HEAD2: tHead = tText.replace(nwHeadFmt.BR, "
") lines.append(f"<{h2}{hStyle}>{aNm}{tHead}\n") - elif tType == self.T_HEAD3: + elif tType == BlockTyp.HEAD3: tHead = tText.replace(nwHeadFmt.BR, "
") lines.append(f"<{h3}{hStyle}>{aNm}{tHead}\n") - elif tType == self.T_HEAD4: + elif tType == BlockTyp.HEAD4: tHead = tText.replace(nwHeadFmt.BR, "
") lines.append(f"<{h4}{hStyle}>{aNm}{tHead}\n") - elif tType == self.T_SEP: + elif tType == BlockTyp.SEP: lines.append(f"

{tText}

\n") - elif tType == self.T_SKIP: + elif tType == BlockTyp.SKIP: lines.append(f"

 

\n") - elif tType == self.T_SYNOPSIS and self._doSynopsis: - lines.append(self._formatSynopsis(self._formatText(tText, tFormat), True)) + elif tType == BlockTyp.COMMENT: + lines.append(f"

{self._formatText(tText, tFmt)}

\n") - elif tType == self.T_SHORT and self._doSynopsis: - lines.append(self._formatSynopsis(self._formatText(tText, tFormat), False)) - - elif tType == self.T_COMMENT and self._doComments: - lines.append(self._formatComments(self._formatText(tText, tFormat))) - - elif tType == self.T_KEYWORD and self._doKeywords: - tag, text = self._formatKeywords(tText) - kClass = f" class='meta meta-{tag}'" if tag else "" - tTemp = f"{text}

\n" - lines.append(tTemp) + elif tType == BlockTyp.KEYWORD: + lines.append(f"

{self._formatText(tText, tFmt)}

\n") self._result = "".join(lines) self._fullHTML.append(self._result) @@ -353,16 +347,18 @@ def getStyleSheet(self) -> list[str]: return [] mScale = self._lineHeight/1.15 + tColor = self._theme.text.name(QtHexRgb) + hColor = self._theme.head.name(QtHexRgb) if self._colorHeads else tColor styles = [] font = self._textFont styles.append(( "body {{" - "font-family: '{0:s}'; font-size: {1:d}pt; " - "font-weight: {2:d}; font-style: {3:s};" + "color: {0:s}; font-family: '{1:s}'; font-size: {2:d}pt; " + "font-weight: {3:d}; font-style: {4:s};" "}}" ).format( - font.family(), font.pointSize(), + tColor, font.family(), font.pointSize(), FONT_WEIGHTS.get(font.weight(), 400), FONT_STYLE.get(font.style(), "normal"), )) @@ -372,50 +368,50 @@ def getStyleSheet(self) -> list[str]: "margin-top: {2:.2f}em; margin-bottom: {3:.2f}em;" "}}" ).format( - "justify" if self._doJustify else self._defaultAlign, + self._defaultAlign, round(100 * self._lineHeight), mScale * self._marginText[0], mScale * self._marginText[1], )) styles.append(( "h1 {{" - "color: rgb(66, 113, 174); " + "color: {0:s}; " "page-break-after: avoid; " - "margin-top: {0:.2f}em; " - "margin-bottom: {1:.2f}em;" + "margin-top: {1:.2f}em; " + "margin-bottom: {2:.2f}em;" "}}" ).format( - mScale * self._marginHead1[0], mScale * self._marginHead1[1] + hColor, mScale * self._marginHead1[0], mScale * self._marginHead1[1] )) styles.append(( "h2 {{" - "color: rgb(66, 113, 174); " + "color: {0:s}; " "page-break-after: avoid; " - "margin-top: {0:.2f}em; " - "margin-bottom: {1:.2f}em;" + "margin-top: {1:.2f}em; " + "margin-bottom: {2:.2f}em;" "}}" ).format( - mScale * self._marginHead2[0], mScale * self._marginHead2[1] + hColor, mScale * self._marginHead2[0], mScale * self._marginHead2[1] )) styles.append(( "h3 {{" - "color: rgb(50, 50, 50); " + "color: {0:s}; " "page-break-after: avoid; " - "margin-top: {0:.2f}em; " - "margin-bottom: {1:.2f}em;" + "margin-top: {1:.2f}em; " + "margin-bottom: {2:.2f}em;" "}}" ).format( - mScale * self._marginHead3[0], mScale * self._marginHead3[1] + hColor, mScale * self._marginHead3[0], mScale * self._marginHead3[1] )) styles.append(( "h4 {{" - "color: rgb(50, 50, 50); " + "color: {0:s}; " "page-break-after: avoid; " - "margin-top: {0:.2f}em; " - "margin-bottom: {1:.2f}em;" + "margin-top: {1:.2f}em; " + "margin-bottom: {2:.2f}em;" "}}" ).format( - mScale * self._marginHead4[0], mScale * self._marginHead4[1] + hColor, mScale * self._marginHead4[0], mScale * self._marginHead4[1] )) styles.append(( ".title {{" @@ -436,14 +432,8 @@ def getStyleSheet(self) -> list[str]: mScale, mScale )) - styles.append("a {color: rgb(66, 113, 174);}") - styles.append("mark {background: rgb(255, 255, 166);}") - styles.append(".keyword {color: rgb(245, 135, 31); font-weight: bold;}") - styles.append(".break {text-align: left;}") - styles.append(".synopsis {font-style: italic;}") - styles.append(".comment {font-style: italic; color: rgb(100, 100, 100);}") - styles.append(".dialog {color: rgb(66, 113, 174);}") - styles.append(".altdialog {color: rgb(129, 55, 9);}") + styles.append("a {{color: {0:s};}}".format(self._theme.head.name(QtHexRgb))) + styles.append("mark {{background: {0:s};}}".format(self._theme.highlight.name(QtHexRgb))) return styles @@ -463,13 +453,18 @@ def _formatText(self, text: str, tFmt: T_Formats) -> str: for pos, fmt, data in tFmt: if m := HTML_OPENER.get(fmt): if not state.get(fmt, True): - tags.append((pos, m[1])) + if fmt == TextFmt.COL_B and (color := self._classes.get(data)): + tags.append((pos, m[1].format(color.name(QtHexRgb)))) + elif fmt in (TextFmt.ANM_B, TextFmt.HRF_B): + tags.append((pos, m[1].format(data or "#"))) + else: + tags.append((pos, m[1])) state[fmt] = True elif m := HTML_CLOSER.get(fmt): if state.get(m[0], False): tags.append((pos, m[1])) state[m[0]] = False - elif fmt == self.FMT_FNOTE: + elif fmt == TextFmt.FNOTE: if data in self._footnotes: index = len(self._usedNotes) + 1 self._usedNotes[data] = index @@ -495,36 +490,3 @@ def _formatText(self, text: str, tFmt: T_Formats) -> str: temp = temp.replace("\n", "
") return stripEscape(temp) - - def _formatSynopsis(self, text: str, synopsis: bool) -> str: - """Apply HTML formatting to synopsis.""" - if synopsis: - sSynop = self._localLookup("Synopsis") - else: - sSynop = self._localLookup("Short Description") - return f"

{sSynop}: {text}

\n" - - def _formatComments(self, text: str) -> str: - """Apply HTML formatting to comments.""" - sComm = self._localLookup("Comment") - return f"

{sComm}: {text}

\n" - - def _formatKeywords(self, text: str) -> tuple[str, str]: - """Apply HTML formatting to keywords.""" - valid, bits, _ = self._project.index.scanThis("@"+text) - if not valid or not bits or bits[0] not in nwLabels.KEY_NAME: - return "", "" - - result = f"{self._localLookup(nwLabels.KEY_NAME[bits[0]])}: " - if len(bits) > 1: - if bits[0] == nwKeyWords.TAG_KEY: - one, two = self._project.index.parseValue(bits[1]) - result += f"{one}" - if two: - result += f" | {two}" - else: - result += ", ".join( - f"{t}" for t in bits[1:] - ) - - return bits[0][1:], result diff --git a/novelwriter/formats/tokenizer.py b/novelwriter/formats/tokenizer.py index 04ce876af..a6f67783d 100644 --- a/novelwriter/formats/tokenizer.py +++ b/novelwriter/formats/tokenizer.py @@ -32,9 +32,10 @@ from functools import partial from pathlib import Path from time import time +from typing import NamedTuple from PyQt5.QtCore import QCoreApplication -from PyQt5.QtGui import QFont +from PyQt5.QtGui import QColor, QFont from novelwriter import CONFIG from novelwriter.common import checkInt, formatTimeStamp, numberToRoman @@ -44,23 +45,31 @@ from novelwriter.core.index import processComment from novelwriter.core.project import NWProject from novelwriter.enum import nwComment, nwItemLayout +from novelwriter.formats.shared import ( + BlockFmt, BlockTyp, T_Block, T_Formats, T_Note, TextDocumentTheme, TextFmt +) from novelwriter.text.patterns import REGEX_PATTERNS logger = logging.getLogger(__name__) -ESCAPES = {r"\*": "*", r"\~": "~", r"\_": "_", r"\[": "[", r"\]": "]", r"\ ": ""} -RX_ESC = re.compile("|".join([re.escape(k) for k in ESCAPES.keys()]), flags=re.DOTALL) -T_Formats = list[tuple[int, int, str]] -T_Comment = tuple[str, T_Formats] -T_Token = tuple[int, int, str, T_Formats, int] +class ComStyle(NamedTuple): + + label: str = "" + labelClass: str = "" + textClass: str = "" -def stripEscape(text: str) -> str: - """Strip escaped Markdown characters from paragraph text.""" - if "\\" in text: - return RX_ESC.sub(lambda x: ESCAPES[x.group(0)], text) - return text +COMMENT_STYLE = { + nwComment.PLAIN: ComStyle("Comment", "comment", "comment"), + nwComment.IGNORE: ComStyle(), + nwComment.SYNOPSIS: ComStyle("Synopsis", "modifier", "synopsis"), + nwComment.SHORT: ComStyle("Short Description", "modifier", "synopsis"), + nwComment.NOTE: ComStyle("Note", "modifier", "note"), + nwComment.FOOTNOTE: ComStyle("", "modifier", "note"), + nwComment.COMMENT: ComStyle(), + nwComment.STORY: ComStyle("", "modifier", "note"), +} class Tokenizer(ABC): @@ -72,64 +81,17 @@ class Tokenizer(ABC): subclasses. """ - # In-Text Format - FMT_B_B = 1 # Begin bold - FMT_B_E = 2 # End bold - FMT_I_B = 3 # Begin italics - FMT_I_E = 4 # End italics - FMT_D_B = 5 # Begin strikeout - FMT_D_E = 6 # End strikeout - FMT_U_B = 7 # Begin underline - FMT_U_E = 8 # End underline - FMT_M_B = 9 # Begin mark - FMT_M_E = 10 # End mark - FMT_SUP_B = 11 # Begin superscript - FMT_SUP_E = 12 # End superscript - FMT_SUB_B = 13 # Begin subscript - FMT_SUB_E = 14 # End subscript - FMT_DL_B = 15 # Begin dialogue - FMT_DL_E = 16 # End dialogue - FMT_ADL_B = 17 # Begin alt dialogue - FMT_ADL_E = 18 # End alt dialogue - FMT_FNOTE = 19 # Footnote marker - FMT_STRIP = 20 # Strip the format code - - # Block Type - T_EMPTY = 1 # Empty line (new paragraph) - T_SYNOPSIS = 2 # Synopsis comment - T_SHORT = 3 # Short description comment - T_COMMENT = 4 # Comment line - T_KEYWORD = 5 # Command line - T_TITLE = 6 # Title - T_HEAD1 = 7 # Heading 1 - T_HEAD2 = 8 # Heading 2 - T_HEAD3 = 9 # Heading 3 - T_HEAD4 = 10 # Heading 4 - T_TEXT = 11 # Text line - T_SEP = 12 # Scene separator - T_SKIP = 13 # Paragraph break - - # Block Style - A_NONE = 0x0000 # No special style - A_LEFT = 0x0001 # Left aligned - A_RIGHT = 0x0002 # Right aligned - A_CENTRE = 0x0004 # Centred - A_JUSTIFY = 0x0008 # Justified - 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 - A_IND_T = 0x0400 # Text indentation - # Masks - M_ALIGNED = A_LEFT | A_RIGHT | A_CENTRE | A_JUSTIFY + M_ALIGNED = BlockFmt.LEFT | BlockFmt.RIGHT | BlockFmt.CENTRE | BlockFmt.JUSTIFY # Lookups - L_HEADINGS = [T_TITLE, T_HEAD1, T_HEAD2, T_HEAD3, T_HEAD4] - L_SKIP_INDENT = [T_TITLE, T_HEAD1, T_HEAD2, T_HEAD2, T_HEAD3, T_HEAD4, T_SEP, T_SKIP] - L_SUMMARY = [T_SYNOPSIS, T_SHORT] + L_HEADINGS = [ + BlockTyp.TITLE, BlockTyp.HEAD1, BlockTyp.HEAD2, BlockTyp.HEAD3, BlockTyp.HEAD4, + ] + L_SKIP_INDENT = [ + BlockTyp.TITLE, BlockTyp.HEAD1, BlockTyp.HEAD2, BlockTyp.HEAD2, BlockTyp.HEAD3, + BlockTyp.HEAD4, BlockTyp.SEP, BlockTyp.SKIP, + ] def __init__(self, project: NWProject) -> None: @@ -141,11 +103,11 @@ def __init__(self, project: NWProject) -> None: self._result = "" # The result of the last document self._keepRaw = False # Whether to keep the raw text, used by ToRaw - # Tokens and Meta Data (Per Document) - self._tokens: list[T_Token] = [] - self._footnotes: dict[str, T_Comment] = {} + # Blocks and Meta Data (Per Document) + self._blocks: list[T_Block] = [] + self._footnotes: dict[str, T_Note] = {} - # Tokens and Meta Data (Per Instance) + # Blocks and Meta Data (Per Instance) self._counts: dict[str, int] = {} self._outline: dict[str, str] = {} self._markdown: list[str] = [] @@ -165,10 +127,15 @@ def __init__(self, project: NWProject) -> None: self._doSynopsis = False # Also process synopsis comments self._doComments = False # Also process comments self._doKeywords = False # Also process keywords like tags and references - self._skipKeywords = set() # Keywords to ignore self._keepBreaks = True # Keep line breaks in paragraphs self._defaultAlign = "left" # The default text alignment + self._skipKeywords: set[str] = set() # Keywords to ignore + + # Other Setting + self._theme = TextDocumentTheme() + self._classes: dict[str, QColor] = {} + # Margins self._marginTitle = nwStyles.T_MARGIN["H0"] self._marginHead1 = nwStyles.T_MARGIN["H1"] @@ -197,10 +164,10 @@ def __init__(self, project: NWProject) -> None: self._linkHeadings = False # Add an anchor before headings - self._titleStyle = self.A_CENTRE | self.A_PBB - self._partStyle = self.A_CENTRE | self.A_PBB - self._chapterStyle = self.A_PBB - self._sceneStyle = self.A_NONE + self._titleStyle = BlockFmt.CENTRE | BlockFmt.PBB + self._partStyle = BlockFmt.CENTRE | BlockFmt.PBB + self._chapterStyle = BlockFmt.PBB + self._sceneStyle = BlockFmt.NONE # Instance Variables self._hFormatter = HeadingFormatter(self._project) @@ -220,27 +187,27 @@ def __init__(self, project: NWProject) -> None: # Format RegEx self._rxMarkdown = [ - (REGEX_PATTERNS.markdownItalic, [0, self.FMT_I_B, 0, self.FMT_I_E]), - (REGEX_PATTERNS.markdownBold, [0, self.FMT_B_B, 0, self.FMT_B_E]), - (REGEX_PATTERNS.markdownStrike, [0, self.FMT_D_B, 0, self.FMT_D_E]), + (REGEX_PATTERNS.markdownItalic, [0, TextFmt.I_B, 0, TextFmt.I_E]), + (REGEX_PATTERNS.markdownBold, [0, TextFmt.B_B, 0, TextFmt.B_E]), + (REGEX_PATTERNS.markdownStrike, [0, TextFmt.D_B, 0, TextFmt.D_E]), ] self._rxShortCodes = REGEX_PATTERNS.shortcodePlain self._rxShortCodeVals = REGEX_PATTERNS.shortcodeValue self._shortCodeFmt = { - nwShortcode.ITALIC_O: self.FMT_I_B, nwShortcode.ITALIC_C: self.FMT_I_E, - nwShortcode.BOLD_O: self.FMT_B_B, nwShortcode.BOLD_C: self.FMT_B_E, - nwShortcode.STRIKE_O: self.FMT_D_B, nwShortcode.STRIKE_C: self.FMT_D_E, - nwShortcode.ULINE_O: self.FMT_U_B, nwShortcode.ULINE_C: self.FMT_U_E, - nwShortcode.MARK_O: self.FMT_M_B, nwShortcode.MARK_C: self.FMT_M_E, - nwShortcode.SUP_O: self.FMT_SUP_B, nwShortcode.SUP_C: self.FMT_SUP_E, - nwShortcode.SUB_O: self.FMT_SUB_B, nwShortcode.SUB_C: self.FMT_SUB_E, + nwShortcode.ITALIC_O: TextFmt.I_B, nwShortcode.ITALIC_C: TextFmt.I_E, + nwShortcode.BOLD_O: TextFmt.B_B, nwShortcode.BOLD_C: TextFmt.B_E, + nwShortcode.STRIKE_O: TextFmt.D_B, nwShortcode.STRIKE_C: TextFmt.D_E, + nwShortcode.ULINE_O: TextFmt.U_B, nwShortcode.ULINE_C: TextFmt.U_E, + nwShortcode.MARK_O: TextFmt.M_B, nwShortcode.MARK_C: TextFmt.M_E, + nwShortcode.SUP_O: TextFmt.SUP_B, nwShortcode.SUP_C: TextFmt.SUP_E, + nwShortcode.SUB_O: TextFmt.SUB_B, nwShortcode.SUB_C: TextFmt.SUB_E, } self._shortCodeVals = { - nwShortcode.FOOTNOTE_B: self.FMT_FNOTE, + nwShortcode.FOOTNOTE_B: TextFmt.FNOTE, } - self._rxDialogue: list[tuple[re.Pattern, int, int]] = [] + self._rxDialogue: list[tuple[re.Pattern, tuple[int, str], tuple[int, str]]] = [] return @@ -277,6 +244,11 @@ def errData(self) -> list[str]: # Setters ## + def setTheme(self, theme: TextDocumentTheme) -> None: + """Set the document colour theme.""" + self._theme = theme + return + def setPartitionFormat(self, hFormat: str, hide: bool = False) -> None: """Set the partition format pattern.""" self._fmtPart = hFormat.strip() @@ -315,30 +287,26 @@ def setSectionFormat(self, hFormat: str, hide: bool = False) -> None: def setTitleStyle(self, center: bool, pageBreak: bool) -> None: """Set the title heading style.""" - self._titleStyle = ( - (self.A_CENTRE if center else self.A_NONE) | (self.A_PBB if pageBreak else self.A_NONE) - ) + self._titleStyle = BlockFmt.CENTRE if center else BlockFmt.NONE + self._titleStyle |= BlockFmt.PBB if pageBreak else BlockFmt.NONE return def setPartitionStyle(self, center: bool, pageBreak: bool) -> None: """Set the partition heading style.""" - self._partStyle = ( - (self.A_CENTRE if center else self.A_NONE) | (self.A_PBB if pageBreak else self.A_NONE) - ) + self._partStyle = BlockFmt.CENTRE if center else BlockFmt.NONE + self._partStyle |= BlockFmt.PBB if pageBreak else BlockFmt.NONE return def setChapterStyle(self, center: bool, pageBreak: bool) -> None: """Set the chapter heading style.""" - self._chapterStyle = ( - (self.A_CENTRE if center else self.A_NONE) | (self.A_PBB if pageBreak else self.A_NONE) - ) + self._chapterStyle = BlockFmt.CENTRE if center else BlockFmt.NONE + self._chapterStyle |= BlockFmt.PBB if pageBreak else BlockFmt.NONE return def setSceneStyle(self, center: bool, pageBreak: bool) -> None: """Set the scene heading style.""" - self._sceneStyle = ( - (self.A_CENTRE if center else self.A_NONE) | (self.A_PBB if pageBreak else self.A_NONE) - ) + self._sceneStyle = BlockFmt.CENTRE if center else BlockFmt.NONE + self._sceneStyle |= BlockFmt.PBB if pageBreak else BlockFmt.NONE return def setFont(self, font: QFont) -> None: @@ -383,19 +351,23 @@ def setDialogueHighlight(self, state: bool) -> None: if state: if CONFIG.dialogStyle > 0: self._rxDialogue.append(( - REGEX_PATTERNS.dialogStyle, self.FMT_DL_B, self.FMT_DL_E + REGEX_PATTERNS.dialogStyle, + (TextFmt.COL_B, "dialog"), (TextFmt.COL_E, ""), )) if CONFIG.dialogLine: self._rxDialogue.append(( - REGEX_PATTERNS.dialogLine, self.FMT_DL_B, self.FMT_DL_E + REGEX_PATTERNS.dialogLine, + (TextFmt.COL_B, "dialog"), (TextFmt.COL_E, ""), )) if CONFIG.narratorBreak: self._rxDialogue.append(( - REGEX_PATTERNS.narratorBreak, self.FMT_DL_E, self.FMT_DL_B + REGEX_PATTERNS.narratorBreak, + (TextFmt.COL_E, ""), (TextFmt.COL_B, "dialog"), )) if CONFIG.altDialogOpen and CONFIG.altDialogClose: self._rxDialogue.append(( - REGEX_PATTERNS.altDialogStyle, self.FMT_ADL_B, self.FMT_ADL_E + REGEX_PATTERNS.altDialogStyle, + (TextFmt.COL_B, "altdialog"), (TextFmt.COL_E, ""), )) return @@ -486,6 +458,18 @@ def doConvert(self) -> None: def saveDocument(self, path: Path) -> None: raise NotImplementedError + def initDocument(self) -> None: + """Initialise data after settings.""" + self._classes["modifier"] = self._theme.modifier + self._classes["synopsis"] = self._theme.note + self._classes["comment"] = self._theme.comment + self._classes["dialog"] = self._theme.dialog + self._classes["altdialog"] = self._theme.altdialog + self._classes["tag"] = self._theme.tag + self._classes["keyword"] = self._theme.keyword + self._classes["optional"] = self._theme.optional + return + def addRootHeading(self, tHandle: str) -> None: """Add a heading at the start of a new root folder.""" self._text = "" @@ -494,16 +478,16 @@ def addRootHeading(self, tHandle: str) -> None: if (tItem := self._project.tree[tHandle]) and tItem.isRootType(): self._handle = tHandle if self._isFirst: - textAlign = self.A_CENTRE + textAlign = BlockFmt.CENTRE self._isFirst = False else: - textAlign = self.A_PBB | self.A_CENTRE + textAlign = BlockFmt.PBB | BlockFmt.CENTRE trNotes = self._localLookup("Notes") title = f"{trNotes}: {tItem.itemName}" - self._tokens = [] - self._tokens.append(( - self.T_TITLE, 1, title, [], textAlign + self._blocks = [] + self._blocks.append(( + BlockTyp.TITLE, 1, title, [], textAlign )) if self._keepRaw: self._markdown.append(f"#! {title}\n\n") @@ -544,15 +528,15 @@ def tokenizeText(self) -> None: characters that indicate headings, comments, commands etc, or 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. + locations of these formatting tags into the blocks list. - The format of the token list is an entry with a five-tuple for + The format of the blocs 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_* + 1: The type of the block, BlockType.* 2: The heading number under which the text is placed 3: The text content of the block, without leading tags - 4: The internal formatting map of the text, self.FMT_* - 5: The style of the block, self.A_* + 4: The internal formatting map of the text, TxtFmt.* + 5: The formats of the block, BlockFmt.* """ if self._isNovel: self._hFormatter.setHandle(self._handle) @@ -561,14 +545,14 @@ def tokenizeText(self) -> None: breakNext = False tmpMarkdown = [] tHandle = self._handle or "" - tokens: list[T_Token] = [] + blocks: list[T_Block] = [] for aLine in self._text.splitlines(): sLine = aLine.strip().lower() # Check for blank lines if len(sLine) == 0: - tokens.append(( - self.T_EMPTY, nHead, "", [], self.A_NONE + blocks.append(( + BlockTyp.EMPTY, nHead, "", [], BlockFmt.NONE )) if self._keepRaw: tmpMarkdown.append("\n") @@ -576,10 +560,10 @@ def tokenizeText(self) -> None: continue if breakNext: - sAlign = self.A_PBB + sAlign = BlockFmt.PBB breakNext = False else: - sAlign = self.A_NONE + sAlign = BlockFmt.NONE # Check Line Format # ================= @@ -596,20 +580,20 @@ def tokenizeText(self) -> None: continue elif sLine == "[vspace]": - tokens.append( - (self.T_SKIP, nHead, "", [], sAlign) + blocks.append( + (BlockTyp.SKIP, nHead, "", [], sAlign) ) continue elif sLine.startswith("[vspace:") and sLine.endswith("]"): nSkip = checkInt(sLine[8:-1], 0) if nSkip >= 1: - tokens.append( - (self.T_SKIP, nHead, "", [], sAlign) + blocks.append( + (BlockTyp.SKIP, nHead, "", [], sAlign) ) if nSkip > 1: - tokens += (nSkip - 1) * [ - (self.T_SKIP, nHead, "", [], self.A_NONE) + blocks += (nSkip - 1) * [ + (BlockTyp.SKIP, nHead, "", [], BlockFmt.NONE) ] continue @@ -623,32 +607,28 @@ def tokenizeText(self) -> None: continue cStyle, cKey, cText, _, _ = processComment(aLine) - if cStyle == nwComment.SYNOPSIS: - tLine, tFmt = self._extractFormats(cText) - tokens.append(( - self.T_SYNOPSIS, nHead, tLine, tFmt, sAlign - )) - if self._doSynopsis and self._keepRaw: - tmpMarkdown.append(f"{aLine}\n") - elif cStyle == nwComment.SHORT: - tLine, tFmt = self._extractFormats(cText) - tokens.append(( - self.T_SHORT, nHead, tLine, tFmt, sAlign + if cStyle in (nwComment.SYNOPSIS, nwComment.SHORT) and not self._doSynopsis: + continue + if cStyle == nwComment.PLAIN and not self._doComments: + continue + + if self._doJustify and not sAlign & self.M_ALIGNED: + sAlign |= BlockFmt.JUSTIFY + + if cStyle in (nwComment.SYNOPSIS, nwComment.SHORT, nwComment.PLAIN): + bStyle = COMMENT_STYLE[cStyle] + tLine, tFmt = self._formatComment(bStyle, cKey, cText) + blocks.append(( + BlockTyp.COMMENT, nHead, tLine, tFmt, sAlign )) - if self._doSynopsis and self._keepRaw: + if self._keepRaw: tmpMarkdown.append(f"{aLine}\n") + elif cStyle == nwComment.FOOTNOTE: - tLine, tFmt = self._extractFormats(cText, skip=self.FMT_FNOTE) + tLine, tFmt = self._extractFormats(cText, skip=TextFmt.FNOTE) self._footnotes[f"{tHandle}:{cKey}"] = (tLine, tFmt) if self._keepRaw: tmpMarkdown.append(f"{aLine}\n") - else: - tLine, tFmt = self._extractFormats(cText) - tokens.append(( - self.T_COMMENT, nHead, tLine, tFmt, sAlign - )) - if self._doComments and self._keepRaw: - tmpMarkdown.append(f"{aLine}\n") elif aLine.startswith("@"): # Keywords @@ -656,15 +636,15 @@ def tokenizeText(self) -> None: # Only valid keyword lines are parsed, and any ignored keywords # are automatically skipped. - valid, bits, _ = self._project.index.scanThis(aLine) - if ( - valid and bits and bits[0] in nwLabels.KEY_NAME - and bits[0] not in self._skipKeywords - ): - tokens.append(( - self.T_KEYWORD, nHead, aLine[1:].strip(), [], sAlign + if not self._doKeywords: + continue + + tLine, tFmt = self._formatMeta(aLine) + if tLine: + blocks.append(( + BlockTyp.KEYWORD, nHead, tLine, tFmt, sAlign )) - if self._doKeywords and self._keepRaw: + if self._keepRaw: tmpMarkdown.append(f"{aLine}\n") elif aLine.startswith(("# ", "#! ")): @@ -680,14 +660,14 @@ def tokenizeText(self) -> None: nHead += 1 tText = aLine[2:].strip() - tType = self.T_HEAD1 if isPlain else self.T_TITLE - tStyle = self.A_NONE if isPlain else self._titleStyle + tType = BlockTyp.HEAD1 if isPlain else BlockTyp.TITLE + tStyle = BlockFmt.NONE if isPlain else self._titleStyle sHide = self._hidePart if isPlain else False if self._isNovel: if sHide: tText = "" - tType = self.T_EMPTY - tStyle = self.A_NONE + tType = BlockTyp.EMPTY + tStyle = BlockFmt.NONE elif isPlain: tText = self._hFormatter.apply(self._fmtPart, tText, nHead) tStyle = self._partStyle @@ -697,7 +677,7 @@ def tokenizeText(self) -> None: self._hFormatter.resetAll() self._noSep = True - tokens.append(( + blocks.append(( tType, nHead, tText, [], tStyle )) if self._keepRaw: @@ -716,8 +696,8 @@ def tokenizeText(self) -> None: nHead += 1 tText = aLine[3:].strip() - tType = self.T_HEAD2 - tStyle = self.A_NONE + tType = BlockTyp.HEAD2 + tStyle = BlockFmt.NONE sHide = self._hideChapter if isPlain else self._hideUnNum tFormat = self._fmtChapter if isPlain else self._fmtUnNum if self._isNovel: @@ -725,14 +705,14 @@ def tokenizeText(self) -> None: self._hFormatter.incChapter() if sHide: tText = "" - tType = self.T_EMPTY + tType = BlockTyp.EMPTY else: tText = self._hFormatter.apply(tFormat, tText, nHead) tStyle = self._chapterStyle self._hFormatter.resetScene() self._noSep = True - tokens.append(( + blocks.append(( tType, nHead, tText, [], tStyle )) if self._keepRaw: @@ -753,27 +733,27 @@ def tokenizeText(self) -> None: nHead += 1 tText = aLine[4:].strip() - tType = self.T_HEAD3 - tStyle = self.A_NONE + tType = BlockTyp.HEAD3 + tStyle = BlockFmt.NONE sHide = self._hideScene if isPlain else self._hideHScene tFormat = self._fmtScene if isPlain else self._fmtHScene if self._isNovel: self._hFormatter.incScene() if sHide: tText = "" - tType = self.T_EMPTY + tType = BlockTyp.EMPTY else: tText = self._hFormatter.apply(tFormat, tText, nHead) tStyle = self._sceneStyle if tText == "": # Empty Format - tType = self.T_EMPTY if self._noSep else self.T_SKIP + tType = BlockTyp.EMPTY if self._noSep else BlockTyp.SKIP elif tText == tFormat: # Static Format tText = "" if self._noSep else tText - tType = self.T_EMPTY if self._noSep else self.T_SEP - tStyle = self.A_NONE if self._noSep else self.A_CENTRE + tType = BlockTyp.EMPTY if self._noSep else BlockTyp.SEP + tStyle = BlockFmt.NONE if self._noSep else BlockFmt.CENTRE self._noSep = False - tokens.append(( + blocks.append(( tType, nHead, tText, [], tStyle )) if self._keepRaw: @@ -789,21 +769,21 @@ def tokenizeText(self) -> None: nHead += 1 tText = aLine[5:].strip() - tType = self.T_HEAD4 - tStyle = self.A_NONE + tType = BlockTyp.HEAD4 + tStyle = BlockFmt.NONE if self._isNovel: if self._hideSection: tText = "" - tType = self.T_EMPTY + tType = BlockTyp.EMPTY else: tText = self._hFormatter.apply(self._fmtSection, tText, nHead) if tText == "": # Empty Format - tType = self.T_SKIP + tType = BlockTyp.SKIP elif tText == self._fmtSection: # Static Format - tType = self.T_SEP - tStyle = self.A_CENTRE + tType = BlockTyp.SEP + tStyle = BlockFmt.CENTRE - tokens.append(( + blocks.append(( tType, nHead, tText, [], tStyle )) if self._keepRaw: @@ -838,40 +818,40 @@ def tokenizeText(self) -> None: aLine = aLine[:-1].rstrip(" ") if alnLeft and alnRight: - sAlign |= self.A_CENTRE + sAlign |= BlockFmt.CENTRE elif alnLeft: - sAlign |= self.A_LEFT + sAlign |= BlockFmt.LEFT elif alnRight: - sAlign |= self.A_RIGHT + sAlign |= BlockFmt.RIGHT if indLeft: - sAlign |= self.A_IND_L + sAlign |= BlockFmt.IND_L if indRight: - sAlign |= self.A_IND_R + sAlign |= BlockFmt.IND_R # Process formats tLine, tFmt = self._extractFormats(aLine, hDialog=self._isNovel) - tokens.append(( - self.T_TEXT, nHead, tLine, tFmt, sAlign + blocks.append(( + BlockTyp.TEXT, nHead, tLine, tFmt, sAlign )) if self._keepRaw: tmpMarkdown.append(f"{aLine}\n") # If we have content, turn off the first page flag - if self._isFirst and tokens: + if self._isFirst and blocks: self._isFirst = False # First document has been processed - # Make sure the token array doesn't start with a page break + # Make sure the blocks array doesn't start with a page break # on the very first page, adding a blank first page. - if tokens[0][4] & self.A_PBB: - cToken = tokens[0] - tokens[0] = ( - cToken[0], cToken[1], cToken[2], cToken[3], cToken[4] & ~self.A_PBB + if blocks[0][4] & BlockFmt.PBB: + cBlock = blocks[0] + blocks[0] = ( + cBlock[0], cBlock[1], cBlock[2], cBlock[3], cBlock[4] & ~BlockFmt.PBB ) # Always add an empty line at the end of the file - tokens.append(( - self.T_EMPTY, nHead, "", [], self.A_NONE + blocks.append(( + BlockTyp.EMPTY, nHead, "", [], BlockFmt.NONE )) if self._keepRaw: tmpMarkdown.append("\n") @@ -884,61 +864,64 @@ def tokenizeText(self) -> None: # It also ensures that there isn't paragraph spacing between # meta data lines for formats that has spacing. - self._tokens = [] - pToken: T_Token = (self.T_EMPTY, 0, "", [], self.A_NONE) - nToken: T_Token = (self.T_EMPTY, 0, "", [], self.A_NONE) + self._blocks = [] + pBlock: T_Block = (BlockTyp.EMPTY, 0, "", [], BlockFmt.NONE) + nBlock: T_Block = (BlockTyp.EMPTY, 0, "", [], BlockFmt.NONE) lineSep = "\n" if self._keepBreaks else " " - pLines: list[T_Token] = [] + pLines: list[T_Block] = [] - tCount = len(tokens) - for n, cToken in enumerate(tokens): + tCount = len(blocks) + for n, cBlock in enumerate(blocks): if n > 0: - pToken = tokens[n-1] # Look behind + pBlock = blocks[n-1] # Look behind if n < tCount - 1: - nToken = tokens[n+1] # Look ahead + nBlock = blocks[n+1] # Look ahead - if cToken[0] in self.L_SKIP_INDENT and not self._indentFirst: + if cBlock[0] in self.L_SKIP_INDENT and not self._indentFirst: # Unless the indentFirst flag is set, we set up the next # paragraph to not be indented if we see a block of a # specific type self._noIndent = True - if cToken[0] == self.T_EMPTY: + if cBlock[0] == BlockTyp.EMPTY: # We don't need to keep the empty lines after this pass pass - elif cToken[0] == self.T_KEYWORD: + elif cBlock[0] == BlockTyp.KEYWORD: # Adjust margins for lines in a list of keyword lines - aStyle = cToken[4] - if pToken[0] == self.T_KEYWORD: - aStyle |= self.A_Z_TOPMRG - if nToken[0] == self.T_KEYWORD: - aStyle |= self.A_Z_BTMMRG - self._tokens.append(( - cToken[0], cToken[1], cToken[2], cToken[3], aStyle + aStyle = cBlock[4] + if pBlock[0] == BlockTyp.KEYWORD: + aStyle |= BlockFmt.Z_TOPMRG + if nBlock[0] == BlockTyp.KEYWORD: + aStyle |= BlockFmt.Z_BTMMRG + self._blocks.append(( + cBlock[0], cBlock[1], cBlock[2], cBlock[3], aStyle )) - elif cToken[0] == self.T_TEXT: + elif cBlock[0] == BlockTyp.TEXT: # Combine lines from the same paragraph - pLines.append(cToken) + pLines.append(cBlock) - if nToken[0] != self.T_TEXT: - # Next token is not text, so we add the buffer to tokens + if nBlock[0] != BlockTyp.TEXT: + # Next block is not text, so we add the buffer to blocks nLines = len(pLines) cStyle = pLines[0][4] if self._firstIndent and not (self._noIndent or cStyle & self.M_ALIGNED): # If paragraph indentation is enabled, not temporarily # turned off, and the block is not aligned, we add the # text indentation flag - cStyle |= self.A_IND_T + cStyle |= BlockFmt.IND_T if nLines == 1: - # The paragraph contains a single line, so we just - # save that directly to the token list - self._tokens.append(( - self.T_TEXT, pLines[0][1], pLines[0][2], pLines[0][3], cStyle + # The paragraph contains a single line, so we just save + # that directly to the blocks list. If justify is + # enabled, and there is no alignment, we apply it. + if self._doJustify and not cStyle & self.M_ALIGNED: + cStyle |= BlockFmt.JUSTIFY + self._blocks.append(( + BlockTyp.TEXT, pLines[0][1], pLines[0][2], pLines[0][3], cStyle )) elif nLines > 1: # The paragraph contains multiple lines, so we need to @@ -946,12 +929,12 @@ def tokenizeText(self) -> None: # recompute all the formatting markers tTxt = "" tFmt: T_Formats = [] - for aToken in pLines: + for aBlock in pLines: tLen = len(tTxt) - tTxt += f"{aToken[2]}{lineSep}" - tFmt.extend((p+tLen, fmt, key) for p, fmt, key in aToken[3]) - self._tokens.append(( - self.T_TEXT, pLines[0][1], tTxt[:-1], tFmt, cStyle + tTxt += f"{aBlock[2]}{lineSep}" + tFmt.extend((p+tLen, fmt, key) for p, fmt, key in aBlock[3]) + self._blocks.append(( + BlockTyp.TEXT, pLines[0][1], tTxt[:-1], tFmt, cStyle )) # Reset buffer and make sure text indent is on for next pass @@ -959,7 +942,7 @@ def tokenizeText(self) -> None: self._noIndent = False else: - self._tokens.append(cToken) + self._blocks.append(cBlock) return @@ -967,14 +950,14 @@ def buildOutline(self) -> None: """Build an outline of the text up to level 3 headings.""" tHandle = self._handle or "" isNovel = self._isNovel - for tType, nHead, tText, _, _ in self._tokens: - if tType == self.T_TITLE: + for tType, nHead, tText, _, _ in self._blocks: + if tType == BlockTyp.TITLE: prefix = "TT" - elif tType == self.T_HEAD1: + elif tType == BlockTyp.HEAD1: prefix = "PT" if isNovel else "H1" - elif tType == self.T_HEAD2: + elif tType == BlockTyp.HEAD2: prefix = "CH" if isNovel else "H2" - elif tType == self.T_HEAD3: + elif tType == BlockTyp.HEAD3: prefix = "SC" if isNovel else "H3" else: continue @@ -1002,7 +985,7 @@ def countStats(self) -> None: textWordChars = self._counts.get("textWordChars", 0) titleWordChars = self._counts.get("titleWordChars", 0) - for tType, _, tText, _, _ in self._tokens: + for tType, _, tText, _, _ in self._blocks: tText = tText.replace(nwUnicode.U_ENDASH, " ") tText = tText.replace(nwUnicode.U_EMDASH, " ") @@ -1011,7 +994,7 @@ def countStats(self) -> None: nChars = len(tText) nWChars = len("".join(tWords)) - if tType == self.T_TEXT: + if tType == BlockTyp.TEXT: tPWords = tText.split() nPWords = len(tPWords) nPChars = len(tText) @@ -1034,42 +1017,17 @@ def countStats(self) -> None: titleChars += nChars titleWordChars += nWChars - elif tType == self.T_SEP: + elif tType == BlockTyp.SEP: allWords += nWords allChars += nChars allWordChars += nWChars - elif tType == self.T_SYNOPSIS and self._doSynopsis: - text = "{0}: {1}".format(self._localLookup("Synopsis"), tText) - words = text.split() - allWords += len(words) - allChars += len(text) - allWordChars += len("".join(words)) - - elif tType == self.T_SHORT and self._doSynopsis: - text = "{0}: {1}".format(self._localLookup("Short Description"), tText) - words = text.split() - allWords += len(words) - allChars += len(text) - allWordChars += len("".join(words)) - - elif tType == self.T_COMMENT and self._doComments: - text = "{0}: {1}".format(self._localLookup("Comment"), tText) - words = text.split() + elif tType in (BlockTyp.COMMENT, BlockTyp.KEYWORD): + words = tText.split() allWords += len(words) - allChars += len(text) + allChars += len(tText) allWordChars += len("".join(words)) - elif tType == self.T_KEYWORD and self._doKeywords: - valid, bits, _ = self._project.index.scanThis("@"+tText) - if valid and bits: - key = self._localLookup(nwLabels.KEY_NAME[bits[0]]) - text = "{0}: {1}".format(key, ", ".join(bits[1:])) - words = text.split() - allWords += len(words) - allChars += len(text) - allWordChars += len("".join(words)) - self._counts["titleCount"] = titleCount self._counts["paragraphCount"] = paragraphCount @@ -1118,6 +1076,70 @@ def saveRawDocument(self, path: str | Path, asJson: bool = False) -> None: # Internal Functions ## + def _formatComment(self, style: ComStyle, key: str, text: str) -> tuple[str, T_Formats]: + """Apply formatting to comments and notes.""" + tTxt, tFmt = self._extractFormats(text) + tFmt.insert(0, (0, TextFmt.COL_B, style.textClass)) + tFmt.append((len(tTxt), TextFmt.COL_E, "")) + if label := (self._localLookup(style.label) + (f" ({key})" if key else "")).strip(): + shift = len(label) + 2 + tTxt = f"{label}: {tTxt}" + rFmt = [(0, TextFmt.B_B, ""), (shift - 1, TextFmt.B_E, "")] + if style.labelClass: + rFmt.insert(1, (0, TextFmt.COL_B, style.labelClass)) + rFmt.append((shift - 1, TextFmt.COL_E, "")) + rFmt.extend((p + shift, f, d) for p, f, d in tFmt) + return tTxt, rFmt + + def _formatMeta(self, text: str) -> tuple[str, T_Formats]: + """Parse a meta line into a """ + txt = [] + fmt = [] + valid, bits, _ = self._project.index.scanThis(text) + if valid and bits and bits[0] in nwLabels.KEY_NAME and bits[0] not in self._skipKeywords: + pos = 0 + lbl = f"{self._localLookup(nwLabels.KEY_NAME[bits[0]])}:" + end = len(lbl) + fmt = [ + (pos, TextFmt.B_B, ""), (pos, TextFmt.COL_B, "keyword"), + (end, TextFmt.B_E, ""), (end, TextFmt.COL_E, ""), + ] + txt = [lbl, " "] + pos = end + 1 + + if (num := len(bits)) > 1: + if bits[0] == nwKeyWords.TAG_KEY: + one, two = self._project.index.parseValue(bits[1]) + end = pos + len(one) + fmt.append((pos, TextFmt.COL_B, "tag")) + fmt.append((pos, TextFmt.ANM_B, f"tag_{one}".lower())) + fmt.append((end, TextFmt.ANM_E, "")) + fmt.append((end, TextFmt.COL_E, "")) + txt.append(one) + pos = end + if two: + txt.append(" | ") + pos += 3 + end = pos + len(two) + fmt.append((pos, TextFmt.COL_B, "optional")) + fmt.append((end, TextFmt.COL_E, "")) + txt.append(two) + pos = end + else: + for n, bit in enumerate(bits[1:], 2): + end = pos + len(bit) + fmt.append((pos, TextFmt.COL_B, "tag")) + fmt.append((pos, TextFmt.HRF_B, f"#tag_{bit}".lower())) + fmt.append((end, TextFmt.HRF_E, "")) + fmt.append((end, TextFmt.COL_E, "")) + txt.append(bit) + pos = end + if n < num: + txt.append(", ") + pos += 2 + + return "".join(txt), fmt + def _extractFormats( self, text: str, skip: int = 0, hDialog: bool = False ) -> tuple[str, T_Formats]: @@ -1149,16 +1171,16 @@ def _extractFormats( kind = self._shortCodeVals.get(res.group(1).lower(), 0) temp.append(( res.start(0), res.end(0), - self.FMT_STRIP if kind == skip else kind, + TextFmt.STRIP if kind == skip else kind, f"{tHandle}:{res.group(2)}", )) # Match Dialogue if self._rxDialogue and hDialog: - for regEx, fmtB, fmtE in self._rxDialogue: + for regEx, (fmtB, clsB), (fmtE, clsE) in self._rxDialogue: for res in regEx.finditer(text): - temp.append((res.start(0), 0, fmtB, "")) - temp.append((res.end(0), 0, fmtE, "")) + temp.append((res.start(0), 0, fmtB, clsB)) + temp.append((res.end(0), 0, fmtE, clsE)) # Post-process text and format result = text diff --git a/novelwriter/formats/tomarkdown.py b/novelwriter/formats/tomarkdown.py index 82526cd5b..e4e30ac34 100644 --- a/novelwriter/formats/tomarkdown.py +++ b/novelwriter/formats/tomarkdown.py @@ -27,49 +27,50 @@ from pathlib import Path -from novelwriter.constants import nwHeadFmt, nwLabels, nwUnicode +from novelwriter.constants import nwHeadFmt, nwUnicode from novelwriter.core.project import NWProject -from novelwriter.formats.tokenizer import T_Formats, Tokenizer +from novelwriter.formats.shared import BlockFmt, BlockTyp, T_Formats, TextFmt +from novelwriter.formats.tokenizer import Tokenizer logger = logging.getLogger(__name__) # Standard Markdown STD_MD = { - Tokenizer.FMT_B_B: "**", - Tokenizer.FMT_B_E: "**", - Tokenizer.FMT_I_B: "_", - Tokenizer.FMT_I_E: "_", - Tokenizer.FMT_D_B: "", - Tokenizer.FMT_D_E: "", - Tokenizer.FMT_U_B: "", - Tokenizer.FMT_U_E: "", - Tokenizer.FMT_M_B: "", - Tokenizer.FMT_M_E: "", - Tokenizer.FMT_SUP_B: "", - Tokenizer.FMT_SUP_E: "", - Tokenizer.FMT_SUB_B: "", - Tokenizer.FMT_SUB_E: "", - Tokenizer.FMT_STRIP: "", + TextFmt.B_B: "**", + TextFmt.B_E: "**", + TextFmt.I_B: "_", + TextFmt.I_E: "_", + TextFmt.D_B: "", + TextFmt.D_E: "", + TextFmt.U_B: "", + TextFmt.U_E: "", + TextFmt.M_B: "", + TextFmt.M_E: "", + TextFmt.SUP_B: "", + TextFmt.SUP_E: "", + TextFmt.SUB_B: "", + TextFmt.SUB_E: "", + TextFmt.STRIP: "", } # Extended Markdown EXT_MD = { - Tokenizer.FMT_B_B: "**", - Tokenizer.FMT_B_E: "**", - Tokenizer.FMT_I_B: "_", - Tokenizer.FMT_I_E: "_", - Tokenizer.FMT_D_B: "~~", - Tokenizer.FMT_D_E: "~~", - Tokenizer.FMT_U_B: "", - Tokenizer.FMT_U_E: "", - Tokenizer.FMT_M_B: "==", - Tokenizer.FMT_M_E: "==", - Tokenizer.FMT_SUP_B: "^", - Tokenizer.FMT_SUP_E: "^", - Tokenizer.FMT_SUB_B: "~", - Tokenizer.FMT_SUB_E: "~", - Tokenizer.FMT_STRIP: "", + TextFmt.B_B: "**", + TextFmt.B_E: "**", + TextFmt.I_B: "_", + TextFmt.I_E: "_", + TextFmt.D_B: "~~", + TextFmt.D_E: "~~", + TextFmt.U_B: "", + TextFmt.U_E: "", + TextFmt.M_B: "==", + TextFmt.M_E: "==", + TextFmt.SUP_B: "^", + TextFmt.SUP_E: "^", + TextFmt.SUB_B: "~", + TextFmt.SUB_E: "~", + TextFmt.STRIP: "", } @@ -117,52 +118,44 @@ def doConvert(self) -> None: cSkip = "" lines = [] - for tType, _, tText, tFormat, tStyle in self._tokens: + for tType, _, tText, tFormat, tStyle in self._blocks: - if tType == self.T_TEXT: + if tType == BlockTyp.TEXT: tTemp = self._formatText(tText, tFormat, mTags).replace("\n", " \n") lines.append(f"{tTemp}\n\n") - elif tType == self.T_TITLE: + elif tType == BlockTyp.TITLE: tHead = tText.replace(nwHeadFmt.BR, "\n") lines.append(f"# {tHead}\n\n") - elif tType == self.T_HEAD1: + elif tType == BlockTyp.HEAD1: tHead = tText.replace(nwHeadFmt.BR, "\n") lines.append(f"# {tHead}\n\n") - elif tType == self.T_HEAD2: + elif tType == BlockTyp.HEAD2: tHead = tText.replace(nwHeadFmt.BR, "\n") lines.append(f"## {tHead}\n\n") - elif tType == self.T_HEAD3: + elif tType == BlockTyp.HEAD3: tHead = tText.replace(nwHeadFmt.BR, "\n") lines.append(f"### {tHead}\n\n") - elif tType == self.T_HEAD4: + elif tType == BlockTyp.HEAD4: tHead = tText.replace(nwHeadFmt.BR, "\n") lines.append(f"#### {tHead}\n\n") - elif tType == self.T_SEP: + elif tType == BlockTyp.SEP: lines.append(f"{tText}\n\n") - elif tType == self.T_SKIP: + elif tType == BlockTyp.SKIP: lines.append(f"{cSkip}\n\n") - elif tType == self.T_SYNOPSIS and self._doSynopsis: - label = self._localLookup("Synopsis") - lines.append(f"**{label}:** {self._formatText(tText, tFormat, mTags)}\n\n") + elif tType == BlockTyp.COMMENT: + lines.append(f"{self._formatText(tText, tFormat, mTags)}\n\n") - elif tType == self.T_SHORT and self._doSynopsis: - label = self._localLookup("Short Description") - lines.append(f"**{label}:** {self._formatText(tText, tFormat, mTags)}\n\n") - - elif tType == self.T_COMMENT and self._doComments: - label = self._localLookup("Comment") - lines.append(f"**{label}:** {self._formatText(tText, tFormat, mTags)}\n\n") - - elif tType == self.T_KEYWORD and self._doKeywords: - lines.append(self._formatKeywords(tText, tStyle)) + elif tType == BlockTyp.KEYWORD: + end = " \n" if tStyle & BlockFmt.Z_BTMMRG else "\n\n" + lines.append(f"{self._formatText(tText, tFormat, mTags)}{end}") self._result = "".join(lines) self._fullMD.append(self._result) @@ -180,7 +173,7 @@ def appendFootnotes(self) -> None: for key, index in self._usedNotes.items(): if content := self._footnotes.get(key): marker = f"{index}. " - text = self._formatText(*content, tags) + text = self._formatText(content[0], content[1], tags) lines.append(f"{marker}{text}\n") lines.append("\n") @@ -207,12 +200,12 @@ def replaceTabs(self, nSpaces: int = 8, spaceChar: str = " ") -> None: # Internal Functions ## - def _formatText(self, text: str, tFmt: T_Formats, tags: dict[int, str]) -> str: + def _formatText(self, text: str, tFmt: T_Formats, tags: dict[TextFmt, str]) -> str: """Apply formatting tags to text.""" temp = text for pos, fmt, data in reversed(tFmt): md = "" - if fmt == self.FMT_FNOTE: + if fmt == TextFmt.FNOTE: if data in self._footnotes: index = len(self._usedNotes) + 1 self._usedNotes[data] = index @@ -223,19 +216,3 @@ def _formatText(self, text: str, tFmt: T_Formats, tags: dict[int, str]) -> str: md = tags.get(fmt, "") temp = f"{temp[:pos]}{md}{temp[pos:]}" return temp - - def _formatKeywords(self, text: str, style: int) -> str: - """Apply Markdown formatting to keywords.""" - valid, bits, _ = self._project.index.scanThis("@"+text) - if not valid or not bits: - return "" - - result = "" - if bits[0] in nwLabels.KEY_NAME: - result += f"**{self._localLookup(nwLabels.KEY_NAME[bits[0]])}:** " - if len(bits) > 1: - result += ", ".join(bits[1:]) - - result += " \n" if style & self.A_Z_BTMMRG else "\n\n" - - return result diff --git a/novelwriter/formats/toodt.py b/novelwriter/formats/toodt.py index fdacf287e..a6d7f000d 100644 --- a/novelwriter/formats/toodt.py +++ b/novelwriter/formats/toodt.py @@ -35,14 +35,15 @@ from pathlib import Path from zipfile import ZIP_DEFLATED, ZipFile -from PyQt5.QtGui import QFont +from PyQt5.QtGui import QColor, QFont from novelwriter import __version__ from novelwriter.common import xmlIndent, xmlSubElem -from novelwriter.constants import nwHeadFmt, nwKeyWords, nwLabels, nwStyles +from novelwriter.constants import nwHeadFmt, nwStyles from novelwriter.core.project import NWProject -from novelwriter.formats.tokenizer import T_Formats, Tokenizer, stripEscape -from novelwriter.types import FONT_STYLE, FONT_WEIGHTS +from novelwriter.formats.shared import BlockFmt, BlockTyp, TextFmt, stripEscape +from novelwriter.formats.tokenizer import Tokenizer +from novelwriter.types import FONT_STYLE, FONT_WEIGHTS, QtHexRgb logger = logging.getLogger(__name__) @@ -89,8 +90,7 @@ def _mkTag(ns: str, tag: str) -> str: X_MRK = 0x010 # Marked format X_SUP = 0x020 # Superscript X_SUB = 0x040 # Subscript -X_DLG = 0x080 # Dialogue -X_DLA = 0x100 # Alt. Dialogue +X_COL = 0x080 # Coloured text # Formatting Masks M_BLD = ~X_BLD @@ -100,8 +100,7 @@ def _mkTag(ns: str, tag: str) -> str: M_MRK = ~X_MRK M_SUP = ~X_SUP M_SUB = ~X_SUB -M_DLG = ~X_DLG -M_DLA = ~X_DLA +M_COL = ~X_COL # ODT Styles S_TITLE = "Title" @@ -151,7 +150,7 @@ def __init__(self, project: NWProject, isFlat: bool) -> None: self._mainPara: dict[str, ODTParagraphStyle] = {} # User-accessible paragraph styles self._autoPara: dict[str, ODTParagraphStyle] = {} # Auto-generated paragraph styles - self._autoText: dict[int, ODTTextStyle] = {} # Auto-generated text styles + self._autoText: dict[str, ODTTextStyle] = {} # Auto-generated text styles # Footnotes self._nNote = 0 @@ -183,7 +182,6 @@ def __init__(self, project: NWProject, isFlat: bool) -> None: self._fLineHeight = "115%" self._fBlockIndent = "1.693cm" self._fTextIndent = "0.499cm" - self._textAlign = "left" self._dLanguage = "en" self._dCountry = "GB" @@ -219,17 +217,6 @@ def __init__(self, project: NWProject, isFlat: bool) -> None: self._mDocLeft = "2.000cm" self._mDocRight = "2.000cm" - # Colour - self._colHead12 = None - self._opaHead12 = None - self._colHead34 = None - self._opaHead34 = None - self._colDialogM = "#2a6099" - self._colDialogA = "#813709" - self._colMetaTx = "#813709" - self._opaMetaTx = "100%" - self._markText = "#ffffa6" - return ## @@ -268,6 +255,8 @@ def setHeaderFormat(self, format: str, offset: int) -> None: def initDocument(self) -> None: """Initialises a new open document XML tree.""" + super().initDocument() + # Initialise Variables # ==================== @@ -318,16 +307,9 @@ def initDocument(self) -> None: self._mLeftFoot = self._emToCm(self._marginFoot[0]) self._mBotFoot = self._emToCm(self._marginFoot[1]) - if self._colorHeads: - self._colHead12 = "#2a6099" - self._opaHead12 = "100%" - self._colHead34 = "#444444" - self._opaHead34 = "100%" - self._fLineHeight = f"{round(100 * self._lineHeight):d}%" self._fBlockIndent = self._emToCm(self._blockIndent) self._fTextIndent = self._emToCm(self._firstWidth) - self._textAlign = "justify" if self._doJustify else self._defaultAlign # Clear Errors self._errData = [] @@ -426,89 +408,76 @@ def doConvert(self) -> None: self._result = "" # Not used, but cleared just in case xText = self._xText - for tType, _, tText, tFormat, tStyle in self._tokens: + for tType, _, tText, tFormat, tStyle in self._blocks: # Styles oStyle = ODTParagraphStyle("New") if tStyle is not None: - if tStyle & self.A_LEFT: + if tStyle & BlockFmt.LEFT: oStyle.setTextAlign("left") - elif tStyle & self.A_RIGHT: + elif tStyle & BlockFmt.RIGHT: oStyle.setTextAlign("right") - elif tStyle & self.A_CENTRE: + elif tStyle & BlockFmt.CENTRE: oStyle.setTextAlign("center") - elif tStyle & self.A_JUSTIFY: + elif tStyle & BlockFmt.JUSTIFY: oStyle.setTextAlign("justify") - if tStyle & self.A_PBB: + if tStyle & BlockFmt.PBB: oStyle.setBreakBefore("page") - if tStyle & self.A_PBA: + if tStyle & BlockFmt.PBA: oStyle.setBreakAfter("page") - if tStyle & self.A_Z_BTMMRG: + if tStyle & BlockFmt.Z_BTMMRG: oStyle.setMarginBottom("0.000cm") - if tStyle & self.A_Z_TOPMRG: + if tStyle & BlockFmt.Z_TOPMRG: oStyle.setMarginTop("0.000cm") - if tStyle & self.A_IND_L: + if tStyle & BlockFmt.IND_L: oStyle.setMarginLeft(self._fBlockIndent) - if tStyle & self.A_IND_R: + if tStyle & BlockFmt.IND_R: oStyle.setMarginRight(self._fBlockIndent) # Process Text Types - if tType == self.T_TEXT: - if self._doJustify and "\n" in tText: - oStyle.overrideJustify(self._defaultAlign) - + if tType == BlockTyp.TEXT: # Text indentation is processed here because there is a # dedicated pre-defined style for it - if tStyle & self.A_IND_T: + if tStyle & BlockFmt.IND_T: self._addTextPar(xText, S_FIND, oStyle, tText, tFmt=tFormat) else: self._addTextPar(xText, S_TEXT, oStyle, tText, tFmt=tFormat) - elif tType == self.T_TITLE: + elif tType == BlockTyp.TITLE: # Title must be text:p tHead = tText.replace(nwHeadFmt.BR, "\n") self._addTextPar(xText, S_TITLE, oStyle, tHead, isHead=False) - elif tType == self.T_HEAD1: + elif tType == BlockTyp.HEAD1: tHead = tText.replace(nwHeadFmt.BR, "\n") self._addTextPar(xText, S_HEAD1, oStyle, tHead, isHead=True, oLevel="1") - elif tType == self.T_HEAD2: + elif tType == BlockTyp.HEAD2: tHead = tText.replace(nwHeadFmt.BR, "\n") self._addTextPar(xText, S_HEAD2, oStyle, tHead, isHead=True, oLevel="2") - elif tType == self.T_HEAD3: + elif tType == BlockTyp.HEAD3: tHead = tText.replace(nwHeadFmt.BR, "\n") self._addTextPar(xText, S_HEAD3, oStyle, tHead, isHead=True, oLevel="3") - elif tType == self.T_HEAD4: + elif tType == BlockTyp.HEAD4: tHead = tText.replace(nwHeadFmt.BR, "\n") self._addTextPar(xText, S_HEAD4, oStyle, tHead, isHead=True, oLevel="4") - elif tType == self.T_SEP: + elif tType == BlockTyp.SEP: self._addTextPar(xText, S_SEP, oStyle, tText) - elif tType == self.T_SKIP: + elif tType == BlockTyp.SKIP: self._addTextPar(xText, S_TEXT, oStyle, "") - elif tType == self.T_SYNOPSIS and self._doSynopsis: - tTemp, tFmt = self._formatSynopsis(tText, tFormat, True) - self._addTextPar(xText, S_META, oStyle, tTemp, tFmt=tFmt) - - elif tType == self.T_SHORT and self._doSynopsis: - tTemp, tFmt = self._formatSynopsis(tText, tFormat, False) - self._addTextPar(xText, S_META, oStyle, tTemp, tFmt=tFmt) + elif tType == BlockTyp.COMMENT: + self._addTextPar(xText, S_META, oStyle, tText, tFmt=tFormat) - elif tType == self.T_COMMENT and self._doComments: - tTemp, tFmt = self._formatComments(tText, tFormat) - self._addTextPar(xText, S_META, oStyle, tTemp, tFmt=tFmt) - - elif tType == self.T_KEYWORD and self._doKeywords: - tTemp, tFmt = self._formatKeywords(tText) - self._addTextPar(xText, S_META, oStyle, tTemp, tFmt=tFmt) + elif tType == BlockTyp.KEYWORD: + self._addTextPar(xText, S_META, oStyle, tText, tFmt=tFormat) return @@ -576,40 +545,6 @@ def xmlToZip(name: str, xObj: ET.Element, zipObj: ZipFile) -> None: # Internal Functions ## - def _formatSynopsis(self, text: str, fmt: T_Formats, synopsis: bool) -> tuple[str, T_Formats]: - """Apply formatting to synopsis lines.""" - name = self._localLookup("Synopsis" if synopsis else "Short Description") - shift = len(name) + 2 - rTxt = f"{name}: {text}" - rFmt: T_Formats = [(0, self.FMT_B_B, ""), (len(name) + 1, self.FMT_B_E, "")] - rFmt.extend((p + shift, f, d) for p, f, d in fmt) - return rTxt, rFmt - - def _formatComments(self, text: str, fmt: T_Formats) -> tuple[str, T_Formats]: - """Apply formatting to comments.""" - name = self._localLookup("Comment") - shift = len(name) + 2 - rTxt = f"{name}: {text}" - rFmt: T_Formats = [(0, self.FMT_B_B, ""), (len(name) + 1, self.FMT_B_E, "")] - rFmt.extend((p + shift, f, d) for p, f, d in fmt) - return rTxt, rFmt - - def _formatKeywords(self, text: str) -> tuple[str, T_Formats]: - """Apply formatting to keywords.""" - valid, bits, _ = self._project.index.scanThis("@"+text) - if not valid or not bits or bits[0] not in nwLabels.KEY_NAME: - return "", [] - - rTxt = f"{self._localLookup(nwLabels.KEY_NAME[bits[0]])}: " - rFmt: T_Formats = [(0, self.FMT_B_B, ""), (len(rTxt) - 1, self.FMT_B_E, "")] - if len(bits) > 1: - if bits[0] == nwKeyWords.TAG_KEY: - rTxt += bits[1] - else: - rTxt += ", ".join(bits[1:]) - - return rTxt, rFmt - def _addTextPar( self, xParent: ET.Element, @@ -639,11 +574,11 @@ def _addTextPar( parProc = XMLParagraph(xElem) - pErr = 0 xFmt = 0x00 tFrag = "" fLast = 0 xNode = None + fClass = "" for fPos, fFmt, fData in tFmt or []: # Add any extra nodes @@ -656,51 +591,47 @@ def _addTextPar( if xFmt == 0x00: parProc.appendText(tFrag) else: - parProc.appendSpan(tFrag, self._textStyle(xFmt)) + parProc.appendSpan(tFrag, self._textStyle(xFmt, fClass)) # Calculate the change of format - if fFmt == self.FMT_B_B: + if fFmt == TextFmt.B_B: xFmt |= X_BLD - elif fFmt == self.FMT_B_E: + elif fFmt == TextFmt.B_E: xFmt &= M_BLD - elif fFmt == self.FMT_I_B: + elif fFmt == TextFmt.I_B: xFmt |= X_ITA - elif fFmt == self.FMT_I_E: + elif fFmt == TextFmt.I_E: xFmt &= M_ITA - elif fFmt == self.FMT_D_B: + elif fFmt == TextFmt.D_B: xFmt |= X_DEL - elif fFmt == self.FMT_D_E: + elif fFmt == TextFmt.D_E: xFmt &= M_DEL - elif fFmt == self.FMT_U_B: + elif fFmt == TextFmt.U_B: xFmt |= X_UND - elif fFmt == self.FMT_U_E: + elif fFmt == TextFmt.U_E: xFmt &= M_UND - elif fFmt == self.FMT_M_B: + elif fFmt == TextFmt.M_B: xFmt |= X_MRK - elif fFmt == self.FMT_M_E: + elif fFmt == TextFmt.M_E: xFmt &= M_MRK - elif fFmt == self.FMT_SUP_B: + elif fFmt == TextFmt.SUP_B: xFmt |= X_SUP - elif fFmt == self.FMT_SUP_E: + elif fFmt == TextFmt.SUP_E: xFmt &= M_SUP - elif fFmt == self.FMT_SUB_B: + elif fFmt == TextFmt.SUB_B: xFmt |= X_SUB - elif fFmt == self.FMT_SUB_E: + elif fFmt == TextFmt.SUB_E: xFmt &= M_SUB - elif fFmt == self.FMT_DL_B: - xFmt |= X_DLG - elif fFmt == self.FMT_DL_E: - xFmt &= M_DLG - elif fFmt == self.FMT_ADL_B: - xFmt |= X_DLA - elif fFmt == self.FMT_ADL_E: - xFmt &= M_DLA - elif fFmt == self.FMT_FNOTE: + elif fFmt == TextFmt.COL_B: + xFmt |= X_COL + fClass = fData + elif fFmt == TextFmt.COL_E: + xFmt &= M_COL + fClass = "" + elif fFmt == TextFmt.FNOTE: xNode = self._generateFootnote(fData) - elif fFmt == self.FMT_STRIP: + elif fFmt == TextFmt.STRIP: pass - else: - pErr += 1 fLast = fPos @@ -711,10 +642,7 @@ def _addTextPar( if xFmt == 0x00: parProc.appendText(tFrag) else: - parProc.appendSpan(tFrag, self._textStyle(xFmt)) - - if pErr > 0: - self._errData.append("Unknown format tag encountered") + parProc.appendSpan(tFrag, self._textStyle(xFmt, fClass)) nErr, errMsg = parProc.checkError() if nErr > 0: # pragma: no cover @@ -745,10 +673,14 @@ def _paraStyle(self, mainName: str, modStyle: ODTParagraphStyle) -> str: return modStyle.name - def _textStyle(self, hFmt: int) -> str: + def _textStyle(self, hFmt: int, fClass: str = "") -> str: """Return a text style for a given style code.""" - if hFmt in self._autoText: - return self._autoText[hFmt].name + tKey = str(hFmt) + if fClass and (color := self._classes.get(fClass)): + tKey = f"{tKey}:{fClass}" + + if tKey in self._autoText: + return self._autoText[tKey].name style = ODTTextStyle(f"T{len(self._autoText)+1:d}") if hFmt & X_BLD: @@ -761,18 +693,16 @@ def _textStyle(self, hFmt: int) -> str: if hFmt & X_UND: style.setUnderlineStyle("solid") style.setUnderlineWidth("auto") - style.setUnderlineColour("font-color") + style.setUnderlineColor("font-color") if hFmt & X_MRK: - style.setBackgroundColour(self._markText) + style.setBackgroundColor(self._theme.highlight) if hFmt & X_SUP: style.setTextPosition("super") if hFmt & X_SUB: style.setTextPosition("sub") - if hFmt & X_DLG: - style.setColour(self._colDialogM) - if hFmt & X_DLA: - style.setColour(self._colDialogA) - self._autoText[hFmt] = style + if hFmt & X_COL and color: + style.setColor(color) + self._autoText[tKey] = style return style.name @@ -898,6 +828,8 @@ def _defaultStyles(self) -> None: def _useableStyles(self) -> None: """Set the usable styles.""" + hColor = self._theme.head if self._colorHeads else None + # Add Text Body Style style = ODTParagraphStyle(S_TEXT) style.setDisplayName("Text body") @@ -906,7 +838,7 @@ def _useableStyles(self) -> None: style.setMarginTop(self._mTopText) style.setMarginBottom(self._mBotText) style.setLineHeight(self._fLineHeight) - style.setTextAlign(self._textAlign) + style.setTextAlign(self._defaultAlign) style.setFontName(self._fontFamily) style.setFontFamily(self._fontFamily) style.setFontSize(self._fSizeText) @@ -935,8 +867,6 @@ def _useableStyles(self) -> None: style.setFontFamily(self._fontFamily) style.setFontSize(self._fSizeText) style.setFontWeight(self._fontWeight) - style.setColour(self._colMetaTx) - style.setOpacity(self._opaMetaTx) style.packXML(self._xStyl) self._mainPara[style.name] = style @@ -986,8 +916,7 @@ def _useableStyles(self) -> None: style.setFontFamily(self._fontFamily) style.setFontSize(self._fSizeHead1) style.setFontWeight(self._headWeight) - style.setColour(self._colHead12) - style.setOpacity(self._opaHead12) + style.setColor(hColor) style.packXML(self._xStyl) self._mainPara[style.name] = style @@ -1004,8 +933,7 @@ def _useableStyles(self) -> None: style.setFontFamily(self._fontFamily) style.setFontSize(self._fSizeHead2) style.setFontWeight(self._headWeight) - style.setColour(self._colHead12) - style.setOpacity(self._opaHead12) + style.setColor(hColor) style.packXML(self._xStyl) self._mainPara[style.name] = style @@ -1022,8 +950,7 @@ def _useableStyles(self) -> None: style.setFontFamily(self._fontFamily) style.setFontSize(self._fSizeHead3) style.setFontWeight(self._headWeight) - style.setColour(self._colHead34) - style.setOpacity(self._opaHead34) + style.setColor(hColor) style.packXML(self._xStyl) self._mainPara[style.name] = style @@ -1040,8 +967,7 @@ def _useableStyles(self) -> None: style.setFontFamily(self._fontFamily) style.setFontSize(self._fSizeHead4) style.setFontWeight(self._headWeight) - style.setColour(self._colHead34) - style.setOpacity(self._opaHead34) + style.setColor(hColor) style.packXML(self._xStyl) self._mainPara[style.name] = style @@ -1302,26 +1228,20 @@ def setFontWeight(self, value: str | None) -> None: self._tAttr["font-weight"][1] = None return - def setColour(self, value: str | None) -> None: + def setColor(self, value: QColor | None) -> None: """Set text colour.""" - self._tAttr["color"][1] = value - return - - def setOpacity(self, value: str | None) -> None: - """Set text opacity.""" - self._tAttr["opacity"][1] = value + if isinstance(value, QColor): + self._tAttr["color"][1] = value.name(QtHexRgb) + self._tAttr["opacity"][1] = f"{int(100.0 * value.alphaF())}%" + else: + self._tAttr["color"][1] = None + self._tAttr["opacity"][1] = None return ## # Methods ## - def overrideJustify(self, default: str) -> None: - """Override inherited justify setting if None is set.""" - if self._pAttr["text-align"][1] is None: - self.setTextAlign(default) - return - def checkNew(self, style: ODTParagraphStyle) -> bool: """Check if there are new settings in style that differ from those in this object. Unset styles are ignored as they can be @@ -1416,18 +1336,18 @@ def setFontStyle(self, value: str | None) -> None: self._tAttr["font-style"][1] = None return - def setColour(self, value: str | None) -> None: + def setColor(self, value: QColor | None) -> None: """Set text colour.""" - if value and len(value) == 7 and value[0] == "#": - self._tAttr["color"][1] = value + if isinstance(value, QColor): + self._tAttr["color"][1] = value.name(QtHexRgb) else: self._tAttr["color"][1] = None return - def setBackgroundColour(self, value: str | None) -> None: + def setBackgroundColor(self, value: QColor | None) -> None: """Set text background colour.""" - if value and len(value) == 7 and value[0] == "#": - self._tAttr["background-color"][1] = value + if isinstance(value, QColor): + self._tAttr["background-color"][1] = value.name(QtHexRgb) else: self._tAttr["background-color"][1] = None return @@ -1472,7 +1392,7 @@ def setUnderlineWidth(self, value: str | None) -> None: self._tAttr["text-underline-width"][1] = None return - def setUnderlineColour(self, value: str | None) -> None: + def setUnderlineColor(self, value: str | None) -> None: """Set text underline colour.""" if value in self.VALID_LCOL: self._tAttr["text-underline-color"][1] = value diff --git a/novelwriter/formats/toqdoc.py b/novelwriter/formats/toqdoc.py index 627b47223..30ee93370 100644 --- a/novelwriter/formats/toqdoc.py +++ b/novelwriter/formats/toqdoc.py @@ -29,14 +29,15 @@ from PyQt5.QtCore import QMarginsF, QSizeF from PyQt5.QtGui import ( - QColor, QFont, QFontMetricsF, QPageSize, QTextBlockFormat, QTextCharFormat, + QFont, QFontMetricsF, QPageSize, QTextBlockFormat, QTextCharFormat, QTextCursor, QTextDocument ) from PyQt5.QtPrintSupport import QPrinter -from novelwriter.constants import nwHeadFmt, nwKeyWords, nwLabels, nwStyles, nwUnicode +from novelwriter.constants import nwHeadFmt, nwStyles, nwUnicode from novelwriter.core.project import NWProject -from novelwriter.formats.tokenizer import T_Formats, Tokenizer +from novelwriter.formats.shared import BlockFmt, BlockTyp, T_Formats, TextFmt +from novelwriter.formats.tokenizer import Tokenizer from novelwriter.types import ( QtAlignAbsolute, QtAlignCenter, QtAlignJustify, QtAlignLeft, QtAlignRight, QtPageBreakAfter, QtPageBreakBefore, QtTransparent, QtVAlignNormal, @@ -48,21 +49,6 @@ T_TextStyle = tuple[QTextBlockFormat, QTextCharFormat] -class TextDocumentTheme: - text: QColor = QColor(0, 0, 0) - highlight: QColor = QColor(255, 255, 166) - head: QColor = QColor(66, 113, 174) - comment: QColor = QColor(100, 100, 100) - note: QColor = QColor(129, 55, 9) - code: QColor = QColor(66, 113, 174) - modifier: QColor = QColor(129, 55, 9) - keyword: QColor = QColor(245, 135, 31) - tag: QColor = QColor(66, 113, 174) - optional: QColor = QColor(66, 113, 174) - dialog: QColor = QColor(66, 113, 174) - altdialog: QColor = QColor(129, 55, 9) - - def newBlock(cursor: QTextCursor, bFmt: QTextBlockFormat) -> None: if cursor.position() > 0: cursor.insertBlock(bFmt) @@ -83,7 +69,6 @@ def __init__(self, project: NWProject) -> None: self._document.setUndoRedoEnabled(False) self._document.setDocumentMargin(0) - self._theme = TextDocumentTheme() self._styles: dict[int, T_TextStyle] = {} self._usedNotes: dict[str, int] = {} @@ -109,11 +94,6 @@ def document(self) -> QTextDocument: # Setters ## - def setTheme(self, theme: TextDocumentTheme) -> None: - """Set the document colour theme.""" - self._theme = theme - return - def setPageLayout( self, width: float, height: float, top: float, bottom: float, left: float, right: float ) -> None: @@ -128,6 +108,8 @@ def setPageLayout( def initDocument(self) -> None: """Initialise all computed values of the document.""" + super().initDocument() + self._document.setUndoRedoEnabled(False) self._document.blockSignals(True) self._document.clear() @@ -141,20 +123,20 @@ def initDocument(self) -> None: # ============ self._mHead = { - self.T_TITLE: (mPx * self._marginTitle[0], mPx * self._marginTitle[1]), - self.T_HEAD1: (mPx * self._marginHead1[0], mPx * self._marginHead1[1]), - self.T_HEAD2: (mPx * self._marginHead2[0], mPx * self._marginHead2[1]), - self.T_HEAD3: (mPx * self._marginHead3[0], mPx * self._marginHead3[1]), - self.T_HEAD4: (mPx * self._marginHead4[0], mPx * self._marginHead4[1]), + BlockTyp.TITLE: (mPx * self._marginTitle[0], mPx * self._marginTitle[1]), + BlockTyp.HEAD1: (mPx * self._marginHead1[0], mPx * self._marginHead1[1]), + BlockTyp.HEAD2: (mPx * self._marginHead2[0], mPx * self._marginHead2[1]), + BlockTyp.HEAD3: (mPx * self._marginHead3[0], mPx * self._marginHead3[1]), + BlockTyp.HEAD4: (mPx * self._marginHead4[0], mPx * self._marginHead4[1]), } hScale = self._scaleHeads self._sHead = { - self.T_TITLE: (nwStyles.H_SIZES.get(0, 1.0) * fPt) if hScale else fPt, - self.T_HEAD1: (nwStyles.H_SIZES.get(1, 1.0) * fPt) if hScale else fPt, - self.T_HEAD2: (nwStyles.H_SIZES.get(2, 1.0) * fPt) if hScale else fPt, - self.T_HEAD3: (nwStyles.H_SIZES.get(3, 1.0) * fPt) if hScale else fPt, - self.T_HEAD4: (nwStyles.H_SIZES.get(4, 1.0) * fPt) if hScale else fPt, + BlockTyp.TITLE: (nwStyles.H_SIZES.get(0, 1.0) * fPt) if hScale else fPt, + BlockTyp.HEAD1: (nwStyles.H_SIZES.get(1, 1.0) * fPt) if hScale else fPt, + BlockTyp.HEAD2: (nwStyles.H_SIZES.get(2, 1.0) * fPt) if hScale else fPt, + BlockTyp.HEAD3: (nwStyles.H_SIZES.get(3, 1.0) * fPt) if hScale else fPt, + BlockTyp.HEAD4: (nwStyles.H_SIZES.get(4, 1.0) * fPt) if hScale else fPt, } self._mText = (mPx * self._marginText[0], mPx * self._marginText[1]) @@ -164,49 +146,20 @@ def initDocument(self) -> None: self._mIndent = mPx * 2.0 self._tIndent = mPx * self._firstWidth - # Block Format + # Text Formats # ============ self._blockFmt = QTextBlockFormat() self._blockFmt.setTopMargin(self._mText[0]) self._blockFmt.setBottomMargin(self._mText[1]) - self._blockFmt.setAlignment(QtAlignJustify if self._doJustify else QtAlignAbsolute) + self._blockFmt.setAlignment(QtAlignAbsolute) self._blockFmt.setLineHeight( 100*self._lineHeight, QTextBlockFormat.LineHeightTypes.ProportionalHeight ) - # Character Formats - # ================= - - self._cText = QTextCharFormat() - self._cText.setBackground(QtTransparent) - self._cText.setForeground(self._theme.text) - - self._cComment = QTextCharFormat(self._cText) - self._cComment.setForeground(self._theme.comment) - - self._cCommentMod = QTextCharFormat(self._cText) - self._cCommentMod.setForeground(self._theme.comment) - self._cCommentMod.setFontWeight(self._bold) - - self._cNote = QTextCharFormat(self._cText) - self._cNote.setForeground(self._theme.note) - - self._cCode = QTextCharFormat(self._cText) - self._cCode.setForeground(self._theme.code) - - self._cModifier = QTextCharFormat(self._cText) - self._cModifier.setForeground(self._theme.modifier) - self._cModifier.setFontWeight(self._bold) - - self._cKeyword = QTextCharFormat(self._cText) - self._cKeyword.setForeground(self._theme.keyword) - - self._cTag = QTextCharFormat(self._cText) - self._cTag.setForeground(self._theme.tag) - - self._cOptional = QTextCharFormat(self._cText) - self._cOptional.setForeground(self._theme.optional) + self._charFmt = QTextCharFormat() + self._charFmt.setBackground(QtTransparent) + self._charFmt.setForeground(self._theme.text) self._init = True @@ -221,74 +174,60 @@ def doConvert(self) -> None: cursor = QTextCursor(self._document) cursor.movePosition(QTextCursor.MoveOperation.End) - for tType, nHead, tText, tFormat, tStyle in self._tokens: + for tType, nHead, tText, tFormat, tStyle in self._blocks: # Styles bFmt = QTextBlockFormat(self._blockFmt) + if tType in (BlockTyp.COMMENT, BlockTyp.KEYWORD): + bFmt.setTopMargin(self._mMeta[0]) + bFmt.setBottomMargin(self._mMeta[1]) + elif tType == BlockTyp.SEP: + bFmt.setTopMargin(self._mSep[0]) + bFmt.setBottomMargin(self._mSep[1]) + if tStyle is not None: - if tStyle & self.A_LEFT: + if tStyle & BlockFmt.LEFT: bFmt.setAlignment(QtAlignLeft) - elif tStyle & self.A_RIGHT: + elif tStyle & BlockFmt.RIGHT: bFmt.setAlignment(QtAlignRight) - elif tStyle & self.A_CENTRE: + elif tStyle & BlockFmt.CENTRE: bFmt.setAlignment(QtAlignCenter) - elif tStyle & self.A_JUSTIFY: + elif tStyle & BlockFmt.JUSTIFY: bFmt.setAlignment(QtAlignJustify) - if tStyle & self.A_PBB: + if tStyle & BlockFmt.PBB: bFmt.setPageBreakPolicy(QtPageBreakBefore) - if tStyle & self.A_PBA: + if tStyle & BlockFmt.PBA: bFmt.setPageBreakPolicy(QtPageBreakAfter) - if tStyle & self.A_Z_BTMMRG: + if tStyle & BlockFmt.Z_BTMMRG: bFmt.setBottomMargin(0.0) - if tStyle & self.A_Z_TOPMRG: + if tStyle & BlockFmt.Z_TOPMRG: bFmt.setTopMargin(0.0) - if tStyle & self.A_IND_L: + if tStyle & BlockFmt.IND_L: bFmt.setLeftMargin(self._mIndent) - if tStyle & self.A_IND_R: + if tStyle & BlockFmt.IND_R: bFmt.setRightMargin(self._mIndent) - if tStyle & self.A_IND_T: + if tStyle & BlockFmt.IND_T: bFmt.setTextIndent(self._tIndent) - if tType == self.T_TEXT: + if tType in (BlockTyp.TEXT, BlockTyp.COMMENT, BlockTyp.KEYWORD): newBlock(cursor, bFmt) - self._insertFragments(tText, tFormat, cursor, self._cText) + self._insertFragments(tText, tFormat, cursor, self._charFmt) elif tType in self.L_HEADINGS: bFmt, cFmt = self._genHeadStyle(tType, nHead, bFmt) newBlock(cursor, bFmt) cursor.insertText(tText.replace(nwHeadFmt.BR, "\n"), cFmt) - elif tType == self.T_SEP: - sFmt = QTextBlockFormat(bFmt) - sFmt.setTopMargin(self._mSep[0]) - sFmt.setBottomMargin(self._mSep[1]) - newBlock(cursor, sFmt) - cursor.insertText(tText, self._cText) - - elif tType == self.T_SKIP: - newBlock(cursor, bFmt) - cursor.insertText(nwUnicode.U_NBSP, self._cText) - - elif tType in self.L_SUMMARY and self._doSynopsis: + elif tType == BlockTyp.SEP: newBlock(cursor, bFmt) - modifier = self._localLookup( - "Short Description" if tType == self.T_SHORT else "Synopsis" - ) - cursor.insertText(f"{modifier}: ", self._cModifier) - self._insertFragments(tText, tFormat, cursor, self._cNote) + cursor.insertText(tText, self._charFmt) - elif tType == self.T_COMMENT and self._doComments: + elif tType == BlockTyp.SKIP: newBlock(cursor, bFmt) - modifier = self._localLookup("Comment") - cursor.insertText(f"{modifier}: ", self._cCommentMod) - self._insertFragments(tText, tFormat, cursor, self._cComment) - - elif tType == self.T_KEYWORD and self._doKeywords: - newBlock(cursor, bFmt) - self._insertKeywords(tText, cursor) + cursor.insertText(nwUnicode.U_NBSP, self._charFmt) self._document.blockSignals(False) @@ -317,18 +256,19 @@ def appendFootnotes(self) -> None: cursor = QTextCursor(self._document) cursor.movePosition(QTextCursor.MoveOperation.End) - bFmt, cFmt = self._genHeadStyle(self.T_HEAD4, -1, self._blockFmt) + bFmt, cFmt = self._genHeadStyle(BlockTyp.HEAD4, -1, self._blockFmt) newBlock(cursor, bFmt) cursor.insertText(self._localLookup("Footnotes"), cFmt) for key, index in self._usedNotes.items(): if content := self._footnotes.get(key): - cFmt = QTextCharFormat(self._cCode) + cFmt = QTextCharFormat(self._charFmt) + cFmt.setForeground(self._theme.code) cFmt.setAnchor(True) cFmt.setAnchorNames([f"footnote_{index}"]) newBlock(cursor, self._blockFmt) cursor.insertText(f"{index}. ", cFmt) - self._insertFragments(*content, cursor, self._cText) + self._insertFragments(*content, cursor, self._charFmt) self._document.blockSignals(False) @@ -351,44 +291,54 @@ def _insertFragments( cursor.insertText(temp[start:pos], cFmt) # Construct next format - if fmt == self.FMT_B_B: + if fmt == TextFmt.B_B: cFmt.setFontWeight(self._bold) - elif fmt == self.FMT_B_E: + elif fmt == TextFmt.B_E: cFmt.setFontWeight(self._normal) - elif fmt == self.FMT_I_B: + elif fmt == TextFmt.I_B: cFmt.setFontItalic(True) - elif fmt == self.FMT_I_E: + elif fmt == TextFmt.I_E: cFmt.setFontItalic(False) - elif fmt == self.FMT_D_B: + elif fmt == TextFmt.D_B: cFmt.setFontStrikeOut(True) - elif fmt == self.FMT_D_E: + elif fmt == TextFmt.D_E: cFmt.setFontStrikeOut(False) - elif fmt == self.FMT_U_B: + elif fmt == TextFmt.U_B: cFmt.setFontUnderline(True) - elif fmt == self.FMT_U_E: + elif fmt == TextFmt.U_E: cFmt.setFontUnderline(False) - elif fmt == self.FMT_M_B: + elif fmt == TextFmt.M_B: cFmt.setBackground(self._theme.highlight) - elif fmt == self.FMT_M_E: + elif fmt == TextFmt.M_E: cFmt.setBackground(QtTransparent) - elif fmt == self.FMT_SUP_B: + elif fmt == TextFmt.SUP_B: cFmt.setVerticalAlignment(QtVAlignSuper) - elif fmt == self.FMT_SUP_E: + elif fmt == TextFmt.SUP_E: cFmt.setVerticalAlignment(QtVAlignNormal) - elif fmt == self.FMT_SUB_B: + elif fmt == TextFmt.SUB_B: cFmt.setVerticalAlignment(QtVAlignSub) - elif fmt == self.FMT_SUB_E: + elif fmt == TextFmt.SUB_E: cFmt.setVerticalAlignment(QtVAlignNormal) - elif fmt == self.FMT_DL_B: - cFmt.setForeground(self._theme.dialog) - elif fmt == self.FMT_DL_E: - cFmt.setForeground(self._theme.text) - elif fmt == self.FMT_ADL_B: - cFmt.setForeground(self._theme.altdialog) - elif fmt == self.FMT_ADL_E: + elif fmt == TextFmt.COL_B: + if color := self._classes.get(data): + cFmt.setForeground(color) + elif fmt == TextFmt.COL_E: cFmt.setForeground(self._theme.text) - elif fmt == self.FMT_FNOTE: - xFmt = QTextCharFormat(self._cCode) + elif fmt == TextFmt.ANM_B: + cFmt.setAnchor(True) + cFmt.setAnchorNames([data]) + elif fmt == TextFmt.ANM_E: + cFmt.setAnchor(False) + elif fmt == TextFmt.HRF_B: + cFmt.setFontUnderline(True) + cFmt.setAnchor(True) + cFmt.setAnchorHref(data) + elif fmt == TextFmt.HRF_E: + cFmt.setFontUnderline(False) + cFmt.setAnchor(False) + elif fmt == TextFmt.FNOTE: + xFmt = QTextCharFormat(self._charFmt) + xFmt.setForeground(self._theme.code) xFmt.setVerticalAlignment(QtVAlignSuper) if data in self._footnotes: index = len(self._usedNotes) + 1 @@ -408,34 +358,7 @@ def _insertFragments( return - def _insertKeywords(self, text: str, cursor: QTextCursor) -> None: - """Apply Markdown formatting to keywords.""" - valid, bits, _ = self._project.index.scanThis("@"+text) - if valid and bits: - key = f"{self._localLookup(nwLabels.KEY_NAME[bits[0]])}: " - cursor.insertText(key, self._cKeyword) - if (num := len(bits)) > 1: - if bits[0] == nwKeyWords.TAG_KEY: - one, two = self._project.index.parseValue(bits[1]) - cFmt = QTextCharFormat(self._cTag) - cFmt.setAnchor(True) - cFmt.setAnchorNames([f"tag_{one}".lower()]) - cursor.insertText(one, cFmt) - if two: - cursor.insertText(" | ", self._cText) - cursor.insertText(two, self._cOptional) - else: - for n, bit in enumerate(bits[1:], 2): - cFmt = QTextCharFormat(self._cTag) - cFmt.setFontUnderline(True) - cFmt.setAnchor(True) - cFmt.setAnchorHref(f"#tag_{bit}".lower()) - cursor.insertText(bit, cFmt) - if n < num: - cursor.insertText(", ", self._cText) - return - - def _genHeadStyle(self, hType: int, nHead: int, rFmt: QTextBlockFormat) -> T_TextStyle: + def _genHeadStyle(self, hType: BlockTyp, nHead: int, rFmt: QTextBlockFormat) -> T_TextStyle: """Generate a heading style set.""" mTop, mBottom = self._mHead.get(hType, (0.0, 0.0)) @@ -443,11 +366,11 @@ def _genHeadStyle(self, hType: int, nHead: int, rFmt: QTextBlockFormat) -> T_Tex bFmt.setTopMargin(mTop) bFmt.setBottomMargin(mBottom) - self._cTitle = QTextCharFormat(self._cText) + self._cTitle = QTextCharFormat(self._charFmt) self._cTitle.setFontWeight(self._bold if self._boldHeads else self._normal) - hCol = self._colorHeads and hType != self.T_TITLE - cFmt = QTextCharFormat(self._cText) + hCol = self._colorHeads and hType != BlockTyp.TITLE + cFmt = QTextCharFormat(self._charFmt) cFmt.setForeground(self._theme.head if hCol else self._theme.text) cFmt.setFontWeight(self._bold if self._boldHeads else self._normal) cFmt.setFontPointSize(self._sHead.get(hType, 1.0)) diff --git a/novelwriter/gui/docviewer.py b/novelwriter/gui/docviewer.py index c2a75479b..5b296fa8e 100644 --- a/novelwriter/gui/docviewer.py +++ b/novelwriter/gui/docviewer.py @@ -44,7 +44,8 @@ from novelwriter.extensions.configlayout import NColourLabel from novelwriter.extensions.eventfilters import WheelEventFilter from novelwriter.extensions.modified import NIconToolButton -from novelwriter.formats.toqdoc import TextDocumentTheme, ToQTextDocument +from novelwriter.formats.shared import TextDocumentTheme +from novelwriter.formats.toqdoc import ToQTextDocument from novelwriter.gui.theme import STYLES_MIN_TOOLBUTTON from novelwriter.types import ( QtAlignCenterTop, QtKeepAnchor, QtMouseLeft, QtMoveAnchor, diff --git a/novelwriter/types.py b/novelwriter/types.py index ab684deef..e9db0876c 100644 --- a/novelwriter/types.py +++ b/novelwriter/types.py @@ -65,6 +65,10 @@ QtMouseOver = QStyle.StateFlag.State_MouseOver QtSelected = QStyle.StateFlag.State_Selected +# Qt Colour Types + +QtHexRgb = QColor.NameFormat.HexRgb + # Qt Tree and Table Types QtDecoration = Qt.ItemDataRole.DecorationRole diff --git a/tests/reference/fmtToDocX_SaveDocument_document.xml b/tests/reference/fmtToDocX_SaveDocument_document.xml index 91dabb463..1ab3dbc87 100644 --- a/tests/reference/fmtToDocX_SaveDocument_document.xml +++ b/tests/reference/fmtToDocX_SaveDocument_document.xml @@ -53,12 +53,19 @@ + Comment: - Exctracted from the lipsum.com website. + + + + + + + Exctracted from the lipsum.com website. @@ -100,12 +107,19 @@ + Synopsis: - Explanation from the lipsum.com website. + + + + + + + Explanation from the lipsum.com website. @@ -176,12 +190,19 @@ + Point of View: - Bod + + + + + + + Bod @@ -192,12 +213,19 @@ + Plot: - Main + + + + + + + Main @@ -208,12 +236,19 @@ + Locations: - Europe + + + + + + + Europe @@ -223,12 +258,19 @@ + 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. @@ -248,12 +290,19 @@ + Point of View: - Bod + + + + + + + Bod @@ -264,12 +313,19 @@ + Plot: - Main + + + + + + + Main @@ -280,12 +336,19 @@ + Locations: - Europe + + + + + + + Europe @@ -295,12 +358,19 @@ + 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. @@ -361,12 +431,19 @@ + Point of View: - Bod + + + + + + + Bod @@ -377,12 +454,19 @@ + Plot: - Main + + + + + + + Main @@ -393,12 +477,19 @@ + Locations: - Europe + + + + + + + Europe @@ -408,12 +499,19 @@ + 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. @@ -495,12 +593,19 @@ + Point of View: - Bod + + + + + + + Bod @@ -511,12 +616,19 @@ + Plot: - Main + + + + + + + Main @@ -527,12 +639,19 @@ + Locations: - Europe + + + + + + + Europe @@ -542,12 +661,19 @@ + 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. @@ -567,12 +693,19 @@ + Point of View: - Bod + + + + + + + Bod @@ -583,12 +716,19 @@ + Plot: - Main + + + + + + + Main @@ -599,12 +739,19 @@ + Locations: - Europe + + + + + + + Europe @@ -614,12 +761,19 @@ + 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. @@ -680,12 +834,19 @@ + Point of View: - Bod + + + + + + + Bod @@ -696,12 +857,19 @@ + Plot: - Main + + + + + + + Main @@ -712,12 +880,19 @@ + Locations: - Europe + + + + + + + Europe @@ -727,12 +902,19 @@ + 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. @@ -812,12 +994,19 @@ + Point of View: - Bod + + + + + + + Bod @@ -828,12 +1017,19 @@ + Plot: - Main + + + + + + + Main @@ -844,12 +1040,19 @@ + Locations: - Europe + + + + + + + Europe @@ -859,12 +1062,19 @@ + 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. @@ -946,12 +1156,29 @@ + Tag: - Bod | Nobody Owens + + + + + + + Bod + + + + | + + + + + + Nobody Owens @@ -962,12 +1189,19 @@ + Plot: - Main + + + + + + + Main @@ -1028,12 +1262,19 @@ + Tag: - Main + + + + + + + Main @@ -1084,12 +1325,29 @@ + Tag: - Europe | Ancient Europe + + + + + + + Europe + + + + | + + + + + + Ancient Europe diff --git a/tests/reference/fmtToDocX_SaveDocument_styles.xml b/tests/reference/fmtToDocX_SaveDocument_styles.xml index a8c8a16fa..534083297 100644 --- a/tests/reference/fmtToDocX_SaveDocument_styles.xml +++ b/tests/reference/fmtToDocX_SaveDocument_styles.xml @@ -50,7 +50,7 @@ - + @@ -65,7 +65,7 @@ - + @@ -80,7 +80,7 @@ - + @@ -95,7 +95,7 @@ - + @@ -121,7 +121,6 @@ - diff --git a/tests/reference/coreToOdt_SaveFlat_document.fodt b/tests/reference/fmtToOdt_SaveFlat_document.fodt similarity index 95% rename from tests/reference/coreToOdt_SaveFlat_document.fodt rename to tests/reference/fmtToOdt_SaveFlat_document.fodt index 14c9e9a43..3beacd02d 100644 --- a/tests/reference/coreToOdt_SaveFlat_document.fodt +++ b/tests/reference/fmtToOdt_SaveFlat_document.fodt @@ -1,13 +1,13 @@ - 2024-10-17T22:22:08 + 2024-10-22T14:19:48 novelWriter/2.6a1 Jane Smith 1234 P42DT12H34M56S Test Project - 2024-10-17T22:22:08 + 2024-10-22T14:19:48 Jane Smith @@ -35,7 +35,7 @@ - + @@ -47,19 +47,19 @@ - + - + - + - + diff --git a/tests/reference/coreToOdt_SaveFull_content.xml b/tests/reference/fmtToOdt_SaveFull_content.xml similarity index 100% rename from tests/reference/coreToOdt_SaveFull_content.xml rename to tests/reference/fmtToOdt_SaveFull_content.xml diff --git a/tests/reference/coreToOdt_SaveFull_manifest.xml b/tests/reference/fmtToOdt_SaveFull_manifest.xml similarity index 100% rename from tests/reference/coreToOdt_SaveFull_manifest.xml rename to tests/reference/fmtToOdt_SaveFull_manifest.xml diff --git a/tests/reference/coreToOdt_SaveFull_meta.xml b/tests/reference/fmtToOdt_SaveFull_meta.xml similarity index 100% rename from tests/reference/coreToOdt_SaveFull_meta.xml rename to tests/reference/fmtToOdt_SaveFull_meta.xml diff --git a/tests/reference/coreToOdt_SaveFull_settings.xml b/tests/reference/fmtToOdt_SaveFull_settings.xml similarity index 100% rename from tests/reference/coreToOdt_SaveFull_settings.xml rename to tests/reference/fmtToOdt_SaveFull_settings.xml diff --git a/tests/reference/coreToOdt_SaveFull_styles.xml b/tests/reference/fmtToOdt_SaveFull_styles.xml similarity index 96% rename from tests/reference/coreToOdt_SaveFull_styles.xml rename to tests/reference/fmtToOdt_SaveFull_styles.xml index 708be3595..aa1f8a94e 100644 --- a/tests/reference/coreToOdt_SaveFull_styles.xml +++ b/tests/reference/fmtToOdt_SaveFull_styles.xml @@ -25,7 +25,7 @@ - + @@ -37,19 +37,19 @@ - + - + - + - + diff --git a/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.htm b/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.htm index 565158a19..2f4b9a3cf 100644 --- a/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.htm +++ b/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.htm @@ -5,22 +5,16 @@ Lorem Ipsum
@@ -28,101 +22,101 @@

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.

-

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.

+

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

-

Synopsis: Explanation from the lipsum.com website.

-

Lorem Ipsum is simply dummy text1 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.

+

Synopsis: Explanation from the lipsum.com website.

+

Lorem Ipsum is simply dummy text1 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.

Part: Act One

“Fusce maximus felis libero”

Chapter: 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.

+

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: Scene One

-

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.

-

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.

+

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.

+

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.

Section: Scene One, Section Two

-

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.

+

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: Scene Two

-

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.

-

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.

+

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.

+

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.

Section: Scene Two, Section Two

-

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.

+

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.

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

+

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: 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.

+

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: 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.

+

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: 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.

-

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.

+

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.

+

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.

Scene: 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.

-

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.

-

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.

+

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.

+

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.

+

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

Nobody Owens

-

Tag: Bod | Nobody Owens

-

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.

+

Tag: Bod | Nobody Owens

+

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

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.

+

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

Ancient Europe

-

Tag: Europe | Ancient 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.

-

Aenean semper turpis quis varius rhoncus. Vivamus ac mi eget felis euismod vulputate. Nam eu tempus velit. Etiam ut est porta, finibus erat sit amet, consectetur felis. Nullam consequat felis ut lacus pharetra, in lobortis urna mollis. Nulla varius eros nec lorem rhoncus, sed venenatis risus ultrices. Phasellus pellentesque laoreet neque, ut ultricies lacus vulputate quis. In malesuada dui sit amet est interdum, eget consectetur mi gravida. Cras vel bibendum purus. Quisque commodo tempor arcu, non lacinia sem blandit eleifend. Quisque at neque gravida, porttitor metus a, suscipit diam. Quisque convallis sodales lacus et condimentum. Donec a suscipit diam. Pellentesque eget cursus neque.

-

Nunc ullamcorper magna quis elit condimentum rhoncus. Aenean dictum pulvinar dolor suscipit interdum. Aliquam elit massa, elementum nec cursus eu, maximus nec ipsum. Donec ullamcorper iaculis dolor eu commodo. Nunc eget tortor quis turpis consectetur varius. Vestibulum nec justo vel tellus venenatis condimentum. Duis auctor iaculis massa. Nunc risus magna, rutrum vitae eros non, tristique mollis enim.

+

Tag: Europe | Ancient 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.

+

Aenean semper turpis quis varius rhoncus. Vivamus ac mi eget felis euismod vulputate. Nam eu tempus velit. Etiam ut est porta, finibus erat sit amet, consectetur felis. Nullam consequat felis ut lacus pharetra, in lobortis urna mollis. Nulla varius eros nec lorem rhoncus, sed venenatis risus ultrices. Phasellus pellentesque laoreet neque, ut ultricies lacus vulputate quis. In malesuada dui sit amet est interdum, eget consectetur mi gravida. Cras vel bibendum purus. Quisque commodo tempor arcu, non lacinia sem blandit eleifend. Quisque at neque gravida, porttitor metus a, suscipit diam. Quisque convallis sodales lacus et condimentum. Donec a suscipit diam. Pellentesque eget cursus neque.

+

Nunc ullamcorper magna quis elit condimentum rhoncus. Aenean dictum pulvinar dolor suscipit interdum. Aliquam elit massa, elementum nec cursus eu, maximus nec ipsum. Donec ullamcorper iaculis dolor eu commodo. Nunc eget tortor quis turpis consectetur varius. Vestibulum nec justo vel tellus venenatis condimentum. Duis auctor iaculis massa. Nunc risus magna, rutrum vitae eros non, tristique mollis enim.

Footnotes

  1. Lorem ipsum is typically a corrupted version of De finibus bonorum et malorum, a 1st-century BC text by the Roman statesman and philosopher Cicero, with words altered, added, and removed to make it nonsensical and improper Latin. (Source: Wikipedia)

  2. diff --git a/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.json b/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.json index 55edb9427..e6e167e90 100644 --- a/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.json +++ b/tests/reference/mBuildDocBuild_HTML5_Lorem_Ipsum.json @@ -2,27 +2,21 @@ "meta": { "projectName": "Lorem Ipsum", "novelAuthor": "lipsum.com", - "buildTime": 1729195330, - "buildTimeStr": "2024-10-17 22:02:10" + "buildTime": 1729624698, + "buildTimeStr": "2024-10-22 21:18:18" }, "text": { "css": [ - "body {font-family: 'Arial'; font-size: 12pt; font-weight: 400; font-style: normal;}", - "p {text-align: justify; line-height: 150%; margin-top: 0.00em; margin-bottom: 0.76em;}", - "h1 {color: rgb(66, 113, 174); page-break-after: avoid; margin-top: 1.85em; margin-bottom: 0.65em;}", - "h2 {color: rgb(66, 113, 174); page-break-after: avoid; margin-top: 2.18em; margin-bottom: 0.65em;}", - "h3 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 1.53em; margin-bottom: 0.65em;}", - "h4 {color: rgb(50, 50, 50); page-break-after: avoid; margin-top: 1.53em; margin-bottom: 0.65em;}", + "body {color: #000000; font-family: 'Arial'; font-size: 12pt; font-weight: 400; font-style: normal;}", + "p {text-align: left; line-height: 150%; margin-top: 0.00em; margin-bottom: 0.76em;}", + "h1 {color: #4271ae; page-break-after: avoid; margin-top: 1.85em; margin-bottom: 0.65em;}", + "h2 {color: #4271ae; page-break-after: avoid; margin-top: 2.18em; margin-bottom: 0.65em;}", + "h3 {color: #4271ae; page-break-after: avoid; margin-top: 1.53em; margin-bottom: 0.65em;}", + "h4 {color: #4271ae; page-break-after: avoid; margin-top: 1.53em; margin-bottom: 0.65em;}", ".title {font-size: 2.5em; margin-top: 1.85em; margin-bottom: 0.65em;}", ".sep, .skip {text-align: center; margin-top: 1.30em; margin-bottom: 1.30em;}", - "a {color: rgb(66, 113, 174);}", - "mark {background: rgb(255, 255, 166);}", - ".keyword {color: rgb(245, 135, 31); font-weight: bold;}", - ".break {text-align: left;}", - ".synopsis {font-style: italic;}", - ".comment {font-style: italic; color: rgb(100, 100, 100);}", - ".dialog {color: rgb(66, 113, 174);}", - ".altdialog {color: rgb(129, 55, 9);}" + "a {color: #4271ae;}", + "mark {background: #ffffa6;}" ], "html": [ [ @@ -32,14 +26,14 @@ "

    \u201cThere is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain\u2026\u201d

    " ], [ - "

    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 \u201cde Finibus Bonorum et Malorum\u201d (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, \u201cLorem ipsum dolor sit amet..\u201d, 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 \u201cde Finibus Bonorum et Malorum\u201d by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.

    " + "

    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 \u201cde Finibus Bonorum et Malorum\u201d (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, \u201cLorem ipsum dolor sit amet..\u201d, 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 \u201cde Finibus Bonorum et Malorum\u201d by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.

    " ], [ "

    Prologue

    ", - "

    Synopsis: Explanation from the lipsum.com website.

    ", - "

    Lorem Ipsum is simply dummy text1 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.

    " + "

    Synopsis: Explanation from the lipsum.com website.

    ", + "

    Lorem Ipsum is simply dummy text1 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.

    " ], [ "

    Part: Act One

    ", @@ -47,118 +41,118 @@ ], [ "

    Chapter: 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.

    " + "

    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: Scene One

    ", - "

    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.

    ", - "

    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.

    ", + "

    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.

    ", + "

    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.

    ", "

    Section: Scene One, Section Two

    ", - "

    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.

    " + "

    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: Scene Two

    ", - "

    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.

    ", - "

    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.

    ", + "

    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.

    ", + "

    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.

    ", "

    Section: Scene Two, Section Two

    ", - "

    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.

    " + "

    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.

    " ], [ "

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

    " + "

    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: 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.

    " + "

    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: 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.

    " + "

    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: 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.

    ", - "

    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.

    " + "

    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.

    ", + "

    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.

    " ], [ "

    Scene: 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.

    ", - "

    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.

    ", - "

    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.

    " + "

    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.

    ", + "

    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.

    ", + "

    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

    " ], [ "

    Nobody Owens

    ", - "

    Tag: Bod | Nobody Owens

    ", - "

    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.

    " + "

    Tag: Bod | Nobody Owens

    ", + "

    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

    " ], [ "

    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.

    " + "

    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

    " ], [ "

    Ancient Europe

    ", - "

    Tag: Europe | Ancient 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.

    ", - "

    Aenean semper turpis quis varius rhoncus. Vivamus ac mi eget felis euismod vulputate. Nam eu tempus velit. Etiam ut est porta, finibus erat sit amet, consectetur felis. Nullam consequat felis ut lacus pharetra, in lobortis urna mollis. Nulla varius eros nec lorem rhoncus, sed venenatis risus ultrices. Phasellus pellentesque laoreet neque, ut ultricies lacus vulputate quis. In malesuada dui sit amet est interdum, eget consectetur mi gravida. Cras vel bibendum purus. Quisque commodo tempor arcu, non lacinia sem blandit eleifend. Quisque at neque gravida, porttitor metus a, suscipit diam. Quisque convallis sodales lacus et condimentum. Donec a suscipit diam. Pellentesque eget cursus neque.

    ", - "

    Nunc ullamcorper magna quis elit condimentum rhoncus. Aenean dictum pulvinar dolor suscipit interdum. Aliquam elit massa, elementum nec cursus eu, maximus nec ipsum. Donec ullamcorper iaculis dolor eu commodo. Nunc eget tortor quis turpis consectetur varius. Vestibulum nec justo vel tellus venenatis condimentum. Duis auctor iaculis massa. Nunc risus magna, rutrum vitae eros non, tristique mollis enim.

    " + "

    Tag: Europe | Ancient 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.

    ", + "

    Aenean semper turpis quis varius rhoncus. Vivamus ac mi eget felis euismod vulputate. Nam eu tempus velit. Etiam ut est porta, finibus erat sit amet, consectetur felis. Nullam consequat felis ut lacus pharetra, in lobortis urna mollis. Nulla varius eros nec lorem rhoncus, sed venenatis risus ultrices. Phasellus pellentesque laoreet neque, ut ultricies lacus vulputate quis. In malesuada dui sit amet est interdum, eget consectetur mi gravida. Cras vel bibendum purus. Quisque commodo tempor arcu, non lacinia sem blandit eleifend. Quisque at neque gravida, porttitor metus a, suscipit diam. Quisque convallis sodales lacus et condimentum. Donec a suscipit diam. Pellentesque eget cursus neque.

    ", + "

    Nunc ullamcorper magna quis elit condimentum rhoncus. Aenean dictum pulvinar dolor suscipit interdum. Aliquam elit massa, elementum nec cursus eu, maximus nec ipsum. Donec ullamcorper iaculis dolor eu commodo. Nunc eget tortor quis turpis consectetur varius. Vestibulum nec justo vel tellus venenatis condimentum. Duis auctor iaculis massa. Nunc risus magna, rutrum vitae eros non, tristique mollis enim.

    " ], [ "

    Footnotes

    ", diff --git a/tests/reference/mBuildDocBuild_OpenDocument_Lorem_Ipsum.fodt b/tests/reference/mBuildDocBuild_OpenDocument_Lorem_Ipsum.fodt index 11de53038..7c6c1f237 100644 --- a/tests/reference/mBuildDocBuild_OpenDocument_Lorem_Ipsum.fodt +++ b/tests/reference/mBuildDocBuild_OpenDocument_Lorem_Ipsum.fodt @@ -1,13 +1,13 @@ - 2024-10-17T22:22:05 + 2024-10-22T21:00:03 novelWriter/2.6a1 lipsum.com 45 P0DT0H36M8S Lorem Ipsum - 2024-10-17T22:22:05 + 2024-10-22T21:00:03 lipsum.com @@ -27,7 +27,7 @@ - + @@ -35,7 +35,7 @@ - + @@ -47,19 +47,19 @@ - + - + - + - + @@ -80,29 +80,59 @@ - + - + + + + - + + + + + + + - + - + - + + + + + + + + + + + + + + + + + + + + + + @@ -133,106 +163,106 @@ 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. - 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 - Synopsis: Explanation from the lipsum.com website. - Lorem Ipsum is simply dummy text + 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 + Synopsis: Explanation from the lipsum.com website. + Lorem Ipsum is simply dummy text 1 - Lorem ipsum is typically a corrupted version of De finibus bonorum et malorum, a 1st-century BC text by the Roman statesman and philosopher Cicero, with words altered, added, and removed to make it nonsensical and improper Latin. (Source: Wikipedia) + Lorem ipsum is typically a corrupted version of De finibus bonorum et malorum, a 1st-century BC text by the Roman statesman and philosopher Cicero, with words altered, added, and removed to make it nonsensical and improper Latin. (Source: Wikipedia) 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. - Part: Act One + Part: Act One “Fusce maximus felis libero” - Chapter: 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. + Chapter: 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: Scene One - 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. - 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. + 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. + 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. Section: Scene One, Section Two - 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. + 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: Scene Two - 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. - 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. + 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. + 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. Section: Scene Two, Section Two - 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. - 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: 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. + 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. + 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: 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: 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. + 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: 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. - 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. + 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. + 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. Scene: 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. - 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. - 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 + 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. + 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. + 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 Nobody Owens - Tag: Bod | Nobody Owens - 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 + Tag: Bod | Nobody Owens + 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 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 + 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 Ancient Europe - Tag: Europe | Ancient 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. - Aenean semper turpis quis varius rhoncus. Vivamus ac mi eget felis euismod vulputate. Nam eu tempus velit. Etiam ut est porta, finibus erat sit amet, consectetur felis. Nullam consequat felis ut lacus pharetra, in lobortis urna mollis. Nulla varius eros nec lorem rhoncus, sed venenatis risus ultrices. Phasellus pellentesque laoreet neque, ut ultricies lacus vulputate quis. In malesuada dui sit amet est interdum, eget consectetur mi gravida. Cras vel bibendum purus. Quisque commodo tempor arcu, non lacinia sem blandit eleifend. Quisque at neque gravida, porttitor metus a, suscipit diam. Quisque convallis sodales lacus et condimentum. Donec a suscipit diam. Pellentesque eget cursus neque. - Nunc ullamcorper magna quis elit condimentum rhoncus. Aenean dictum pulvinar dolor suscipit interdum. Aliquam elit massa, elementum nec cursus eu, maximus nec ipsum. Donec ullamcorper iaculis dolor eu commodo. Nunc eget tortor quis turpis consectetur varius. Vestibulum nec justo vel tellus venenatis condimentum. Duis auctor iaculis massa. Nunc risus magna, rutrum vitae eros non, tristique mollis enim. + Tag: Europe | Ancient 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. + Aenean semper turpis quis varius rhoncus. Vivamus ac mi eget felis euismod vulputate. Nam eu tempus velit. Etiam ut est porta, finibus erat sit amet, consectetur felis. Nullam consequat felis ut lacus pharetra, in lobortis urna mollis. Nulla varius eros nec lorem rhoncus, sed venenatis risus ultrices. Phasellus pellentesque laoreet neque, ut ultricies lacus vulputate quis. In malesuada dui sit amet est interdum, eget consectetur mi gravida. Cras vel bibendum purus. Quisque commodo tempor arcu, non lacinia sem blandit eleifend. Quisque at neque gravida, porttitor metus a, suscipit diam. Quisque convallis sodales lacus et condimentum. Donec a suscipit diam. Pellentesque eget cursus neque. + Nunc ullamcorper magna quis elit condimentum rhoncus. Aenean dictum pulvinar dolor suscipit interdum. Aliquam elit massa, elementum nec cursus eu, maximus nec ipsum. Donec ullamcorper iaculis dolor eu commodo. Nunc eget tortor quis turpis consectetur varius. Vestibulum nec justo vel tellus venenatis condimentum. Duis auctor iaculis massa. Nunc risus magna, rutrum vitae eros non, tristique mollis enim. diff --git a/tests/test_formats/test_fmt_todocx.py b/tests/test_formats/test_fmt_todocx.py index 6a4ac9784..22df9e1c2 100644 --- a/tests/test_formats/test_fmt_todocx.py +++ b/tests/test_formats/test_fmt_todocx.py @@ -31,6 +31,7 @@ from novelwriter.core.docbuild import NWBuildDocument from novelwriter.core.project import NWProject from novelwriter.enum import nwBuildFmt +from novelwriter.formats.shared import BlockFmt, BlockTyp from novelwriter.formats.todocx import ( S_FNOTE, S_HEAD1, S_HEAD2, S_HEAD3, S_HEAD4, S_META, S_NORM, S_SEP, S_TITLE, ToDocX, _mkTag, _wTag @@ -70,7 +71,7 @@ def testFmtToDocX_ParagraphStyles(mockGUI): # Normal Text xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_TEXT, 0, "Hello World", [], doc.A_NONE)] + doc._blocks = [(BlockTyp.TEXT, 0, "Hello World", [], BlockFmt.NONE)] doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( @@ -80,7 +81,7 @@ def testFmtToDocX_ParagraphStyles(mockGUI): # Title xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_TITLE, 0, "Hello World", [], doc.A_NONE)] + doc._blocks = [(BlockTyp.TITLE, 0, "Hello World", [], BlockFmt.NONE)] doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( @@ -90,7 +91,7 @@ def testFmtToDocX_ParagraphStyles(mockGUI): # Heading Level 1 xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_HEAD1, 0, "Hello World", [], doc.A_NONE)] + doc._blocks = [(BlockTyp.HEAD1, 0, "Hello World", [], BlockFmt.NONE)] doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( @@ -100,7 +101,7 @@ def testFmtToDocX_ParagraphStyles(mockGUI): # Heading Level 2 xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_HEAD2, 0, "Hello World", [], doc.A_NONE)] + doc._blocks = [(BlockTyp.HEAD2, 0, "Hello World", [], BlockFmt.NONE)] doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( @@ -110,7 +111,7 @@ def testFmtToDocX_ParagraphStyles(mockGUI): # Heading Level 3 xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_HEAD3, 0, "Hello World", [], doc.A_NONE)] + doc._blocks = [(BlockTyp.HEAD3, 0, "Hello World", [], BlockFmt.NONE)] doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( @@ -120,7 +121,7 @@ def testFmtToDocX_ParagraphStyles(mockGUI): # Heading Level 4 xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_HEAD4, 0, "Hello World", [], doc.A_NONE)] + doc._blocks = [(BlockTyp.HEAD4, 0, "Hello World", [], BlockFmt.NONE)] doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( @@ -130,7 +131,7 @@ def testFmtToDocX_ParagraphStyles(mockGUI): # Separator xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_SEP, 0, "* * *", [], doc.A_NONE)] + doc._blocks = [(BlockTyp.SEP, 0, "* * *", [], BlockFmt.NONE)] doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( @@ -140,7 +141,7 @@ def testFmtToDocX_ParagraphStyles(mockGUI): # Empty Paragraph xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_SKIP, 0, "* * *", [], doc.A_NONE)] + doc._blocks = [(BlockTyp.SKIP, 0, "* * *", [], BlockFmt.NONE)] doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( @@ -149,72 +150,83 @@ def testFmtToDocX_ParagraphStyles(mockGUI): # Synopsis xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_SYNOPSIS, 0, "Hello World", [], doc.A_NONE)] + doc._text = "%Synopsis: Hello World\n\n" + doc.tokenizeText() doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( f'' - 'Synopsis:' - ' Hello World' + 'Synopsis:' + ' ' + 'Hello World' '' ) # Short xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_SHORT, 0, "Hello World", [], doc.A_NONE)] + doc._text = "%Short: Hello World\n\n" + doc.tokenizeText() doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( f'' - 'Short Description:' - ' Hello World' + 'Short Description:' + ' ' + 'Hello World' '' ) # Comment xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_COMMENT, 0, "Hello World", [], doc.A_NONE)] + doc._text = "% Hello World\n\n" + doc.tokenizeText() doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( f'' - 'Comment:' - ' Hello World' + 'Comment:' + ' ' + 'Hello World' '' ) # Tags and References (Single) xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_KEYWORD, 0, "tag: Stuff", [], doc.A_NONE)] + doc._text = "@tag: Stuff" + doc.tokenizeText() doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( f'' - 'Tag:' - ' Stuff' + 'Tag:' + ' ' + 'Stuff' '' ) # Tags and References (Multiple) xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_KEYWORD, 0, "char: Jane, John", [], doc.A_NONE)] + doc._text = "@char: Jane, John" + doc.tokenizeText() doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( f'' - 'Characters:' - ' Jane, John' + 'Characters:' + ' ' + 'Jane' + ', ' + 'John' '' ) # Tags and References (Invalid) xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_KEYWORD, 0, "stuff: Stuff", [], doc.A_NONE)] + doc._text = "@stuff: Stuff" + doc._pars = [] + doc.tokenizeText() doc.doConvert() - doc._pars[-1].toXml(xTest) - assert xmlToText(xTest) == ( - f'' - ) + assert doc._pars == [] @pytest.mark.core @@ -229,7 +241,7 @@ def testFmtToDocX_ParagraphFormatting(mockGUI): # Left Align xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_TEXT, 0, "Hello World", [], doc.A_LEFT)] + doc._blocks = [(BlockTyp.TEXT, 0, "Hello World", [], BlockFmt.LEFT)] doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( @@ -239,7 +251,7 @@ def testFmtToDocX_ParagraphFormatting(mockGUI): # Right Align xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_TEXT, 0, "Hello World", [], doc.A_RIGHT)] + doc._blocks = [(BlockTyp.TEXT, 0, "Hello World", [], BlockFmt.RIGHT)] doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( @@ -249,7 +261,7 @@ def testFmtToDocX_ParagraphFormatting(mockGUI): # Center Align xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_TEXT, 0, "Hello World", [], doc.A_CENTRE)] + doc._blocks = [(BlockTyp.TEXT, 0, "Hello World", [], BlockFmt.CENTRE)] doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( @@ -259,7 +271,7 @@ def testFmtToDocX_ParagraphFormatting(mockGUI): # Justify xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_TEXT, 0, "Hello World", [], doc.A_JUSTIFY)] + doc._blocks = [(BlockTyp.TEXT, 0, "Hello World", [], BlockFmt.JUSTIFY)] doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( @@ -269,7 +281,7 @@ def testFmtToDocX_ParagraphFormatting(mockGUI): # Page Break Before xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_TEXT, 0, "Hello World", [], doc.A_PBB)] + doc._blocks = [(BlockTyp.TEXT, 0, "Hello World", [], BlockFmt.PBB)] doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( @@ -281,7 +293,7 @@ def testFmtToDocX_ParagraphFormatting(mockGUI): # Page Break After xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_TEXT, 0, "Hello World", [], doc.A_PBA)] + doc._blocks = [(BlockTyp.TEXT, 0, "Hello World", [], BlockFmt.PBA)] doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( @@ -293,7 +305,7 @@ def testFmtToDocX_ParagraphFormatting(mockGUI): # Zero Margins xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_TEXT, 0, "Hello World", [], doc.A_Z_TOPMRG | doc.A_Z_BTMMRG)] + doc._blocks = [(BlockTyp.TEXT, 0, "Hello World", [], BlockFmt.Z_TOPMRG | BlockFmt.Z_BTMMRG)] doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( @@ -304,7 +316,7 @@ def testFmtToDocX_ParagraphFormatting(mockGUI): # Indent xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_TEXT, 0, "Hello World", [], doc.A_IND_L | doc.A_IND_R)] + doc._blocks = [(BlockTyp.TEXT, 0, "Hello World", [], BlockFmt.IND_L | BlockFmt.IND_R)] doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( @@ -315,7 +327,7 @@ def testFmtToDocX_ParagraphFormatting(mockGUI): # First Line Indent xTest = ET.Element(_wTag("body")) - doc._tokens = [(doc.T_TEXT, 0, "Hello World", [], doc.A_IND_T)] + doc._blocks = [(BlockTyp.TEXT, 0, "Hello World", [], BlockFmt.IND_T)] doc.doConvert() doc._pars[-1].toXml(xTest) assert xmlToText(xTest) == ( diff --git a/tests/test_formats/test_fmt_tohtml.py b/tests/test_formats/test_fmt_tohtml.py index c14675663..246545919 100644 --- a/tests/test_formats/test_fmt_tohtml.py +++ b/tests/test_formats/test_fmt_tohtml.py @@ -26,6 +26,7 @@ from novelwriter import CONFIG from novelwriter.core.project import NWProject +from novelwriter.formats.shared import BlockFmt, BlockTyp from novelwriter.formats.tohtml import ToHtml @@ -34,6 +35,7 @@ def testFmtToHtml_ConvertHeaders(mockGUI): """Test header formats in the ToHtml class.""" project = NWProject() html = ToHtml(project) + html.initDocument() # Novel Files Headers # =================== @@ -136,6 +138,7 @@ def testFmtToHtml_ConvertParagraphs(mockGUI): """Test paragraph formats in the ToHtml class.""" project = NWProject() html = ToHtml(project) + html.initDocument() html._isNovel = True html._isFirst = True @@ -184,7 +187,10 @@ def testFmtToHtml_ConvertParagraphs(mockGUI): html.tokenizeText() html.doConvert() assert html.result == ( - "

    Synopsis: The synopsis ...

    \n" + "

    " + "Synopsis: " + "The synopsis ..." + "

    \n" ) html.setSynopsis(True) @@ -192,7 +198,10 @@ def testFmtToHtml_ConvertParagraphs(mockGUI): html.tokenizeText() html.doConvert() assert html.result == ( - "

    Short Description: A short description ...

    \n" + "

    " + "Short Description: " + "A short description ..." + "

    \n" ) # Comment @@ -206,7 +215,10 @@ def testFmtToHtml_ConvertParagraphs(mockGUI): html.tokenizeText() html.doConvert() assert html.result == ( - "

    Comment: A comment ...

    \n" + "

    " + "Comment: " + "A comment ..." + "

    \n" ) # Keywords @@ -220,9 +232,9 @@ def testFmtToHtml_ConvertParagraphs(mockGUI): html.tokenizeText() html.doConvert() assert html.result == ( - "

    Characters: " - "Bod, " - "Jane

    \n" + "

    Characters: " + "Bod, " + "Jane

    \n" ) # Tags @@ -230,16 +242,17 @@ def testFmtToHtml_ConvertParagraphs(mockGUI): html.tokenizeText() html.doConvert() assert html.result == ( - "

    Tag: " - "Bod

    \n" + "

    Tag: " + "Bod

    \n" ) html._text = "@tag: Bod | Nobody Owens\n" html.tokenizeText() html.doConvert() assert html.result == ( - "

    Tag: " - "Bod | Nobody Owens

    \n" + "

    Tag: " + "Bod | " + "Nobody Owens

    \n" ) # Multiple Keywords @@ -250,15 +263,15 @@ def testFmtToHtml_ConvertParagraphs(mockGUI): html.doConvert() assert html.result == ( "

    Chapter

    \n" - "

    " - "Point of View: " - "Bod

    \n" - "

    " - "Plot: " - "Main

    \n" - "

    " - "Locations: " - "Europe

    \n" + "

    " + "Point of View: " + "Bod

    \n" + "

    " + "Plot: " + "Main

    \n" + "

    " + "Locations: " + "Europe

    \n" ) # Dialogue @@ -268,7 +281,7 @@ def testFmtToHtml_ConvertParagraphs(mockGUI): html.doConvert() assert html.result == ( "

    Chapter

    \n" - "

    This text \u201chas dialogue\u201d in it.

    \n" + "

    This text “has dialogue” in it.

    \n" ) # Alt. Dialogue @@ -280,7 +293,7 @@ def testFmtToHtml_ConvertParagraphs(mockGUI): html.doConvert() assert html.result == ( "

    Chapter

    \n" - "

    This text ::has alt dialogue:: in it.

    \n" + "

    This text ::has alt dialogue:: in it.

    \n" ) # Footnotes @@ -313,6 +326,7 @@ def testFmtToHtml_CloseTags(mockGUI): """Test automatic closing of HTML tags for shortcodes.""" project = NWProject() html = ToHtml(project) + html.initDocument() html._isNovel = True html._isFirst = True @@ -349,6 +363,7 @@ def testFmtToHtml_ConvertDirect(mockGUI): """Test the converter directly using the ToHtml class.""" project = NWProject() html = ToHtml(project) + html.initDocument() html._isNovel = True html._handle = "0000000000000" @@ -358,8 +373,8 @@ def testFmtToHtml_ConvertDirect(mockGUI): # ============== # Title - html._tokens = [ - (html.T_TITLE, 1, "A Title", [], html.A_PBB | html.A_CENTRE), + html._blocks = [ + (BlockTyp.TITLE, 1, "A Title", [], BlockFmt.PBB | BlockFmt.CENTRE), ] html.doConvert() assert html.result == ( @@ -368,8 +383,8 @@ def testFmtToHtml_ConvertDirect(mockGUI): ) # Unnumbered - html._tokens = [ - (html.T_HEAD2, 1, "Prologue", [], html.A_PBB), + html._blocks = [ + (BlockTyp.HEAD2, 1, "Prologue", [], BlockFmt.PBB), ] html.doConvert() assert html.result == ( @@ -381,15 +396,15 @@ def testFmtToHtml_ConvertDirect(mockGUI): # ========== # Separator - html._tokens = [ - (html.T_SEP, 1, "* * *", [], html.A_CENTRE), + html._blocks = [ + (BlockTyp.SEP, 1, "* * *", [], BlockFmt.CENTRE), ] html.doConvert() assert html.result == "

    * * *

    \n" # Skip - html._tokens = [ - (html.T_SKIP, 1, "", [], html.A_NONE), + html._blocks = [ + (BlockTyp.SKIP, 1, "", [], BlockFmt.NONE), ] html.doConvert() assert html.result == "

     

    \n" @@ -401,8 +416,8 @@ def testFmtToHtml_ConvertDirect(mockGUI): # Align Left html.setStyles(False) - html._tokens = [ - (html.T_HEAD1, 1, "A Title", [], html.A_LEFT), + html._blocks = [ + (BlockTyp.HEAD1, 1, "A Title", [], BlockFmt.LEFT), ] html.doConvert() assert html.result == ( @@ -412,8 +427,8 @@ def testFmtToHtml_ConvertDirect(mockGUI): html.setStyles(True) # Align Left - html._tokens = [ - (html.T_HEAD1, 1, "A Title", [], html.A_LEFT), + html._blocks = [ + (BlockTyp.HEAD1, 1, "A Title", [], BlockFmt.LEFT), ] html.doConvert() assert html.result == ( @@ -421,8 +436,8 @@ def testFmtToHtml_ConvertDirect(mockGUI): ) # Align Right - html._tokens = [ - (html.T_HEAD1, 1, "A Title", [], html.A_RIGHT), + html._blocks = [ + (BlockTyp.HEAD1, 1, "A Title", [], BlockFmt.RIGHT), ] html.doConvert() assert html.result == ( @@ -430,8 +445,8 @@ def testFmtToHtml_ConvertDirect(mockGUI): ) # Align Centre - html._tokens = [ - (html.T_HEAD1, 1, "A Title", [], html.A_CENTRE), + html._blocks = [ + (BlockTyp.HEAD1, 1, "A Title", [], BlockFmt.CENTRE), ] html.doConvert() assert html.result == ( @@ -439,8 +454,8 @@ def testFmtToHtml_ConvertDirect(mockGUI): ) # Align Justify - html._tokens = [ - (html.T_HEAD1, 1, "A Title", [], html.A_JUSTIFY), + html._blocks = [ + (BlockTyp.HEAD1, 1, "A Title", [], BlockFmt.JUSTIFY), ] html.doConvert() assert html.result == ( @@ -451,8 +466,8 @@ def testFmtToHtml_ConvertDirect(mockGUI): # ========== # Page Break Always - html._tokens = [ - (html.T_HEAD1, 1, "A Title", [], html.A_PBB | html.A_PBA), + html._blocks = [ + (BlockTyp.HEAD1, 1, "A Title", [], BlockFmt.PBB | BlockFmt.PBA), ] html.doConvert() assert html.result == ( @@ -464,8 +479,8 @@ def testFmtToHtml_ConvertDirect(mockGUI): # ====== # Indent Left - html._tokens = [ - (html.T_TEXT, 1, "Some text ...", [], html.A_IND_L), + html._blocks = [ + (BlockTyp.TEXT, 1, "Some text ...", [], BlockFmt.IND_L), ] html.doConvert() assert html.result == ( @@ -473,8 +488,8 @@ def testFmtToHtml_ConvertDirect(mockGUI): ) # Indent Right - html._tokens = [ - (html.T_TEXT, 1, "Some text ...", [], html.A_IND_R), + html._blocks = [ + (BlockTyp.TEXT, 1, "Some text ...", [], BlockFmt.IND_R), ] html.doConvert() assert html.result == ( @@ -482,8 +497,8 @@ def testFmtToHtml_ConvertDirect(mockGUI): ) # Text Indent - html._tokens = [ - (html.T_TEXT, 1, "Some text ...", [], html.A_IND_T), + html._blocks = [ + (BlockTyp.TEXT, 1, "Some text ...", [], BlockFmt.IND_T), ] html.doConvert() assert html.result == ( @@ -496,6 +511,7 @@ def testFmtToHtml_SpecialCases(mockGUI): """Test some special cases that have caused errors in the past.""" project = NWProject() html = ToHtml(project) + html.initDocument() html._isNovel = True # Greater/Lesser than symbols @@ -539,7 +555,9 @@ def testFmtToHtml_SpecialCases(mockGUI): html.doConvert() assert html.result == ( "

    " - "Comment: Test > text <bold> and more." + "Comment: " + "Test > text <bold> " + "and more." "

    \n" ) @@ -568,6 +586,7 @@ def testFmtToHtml_Save(mockGUI, fncPath): """Test the save method of the ToHtml class.""" project = NWProject() html = ToHtml(project) + html.initDocument() html._isNovel = True # Build Project @@ -664,6 +683,7 @@ def testFmtToHtml_Methods(mockGUI): """Test all the other methods of the ToHtml class.""" project = NWProject() html = ToHtml(project) + html.initDocument() # Auto-Replace, keep Unicode docText = "Text with & short–dash, long—dash …\n" @@ -697,40 +717,5 @@ def testFmtToHtml_Methods(mockGUI): assert "p {text-align: left;" in " ".join(html.getStyleSheet()) assert "p {text-align: justify;" not in " ".join(html.getStyleSheet()) - html.setJustify(True) - assert "p {text-align: left;" not in " ".join(html.getStyleSheet()) - assert "p {text-align: justify;" in " ".join(html.getStyleSheet()) - html.setStyles(False) assert html.getStyleSheet() == [] - - -@pytest.mark.core -def testFmtToHtml_Format(mockGUI): - """Test all the formatters for the ToHtml class.""" - project = NWProject() - html = ToHtml(project) - - # Export Mode - # =========== - - assert html._formatSynopsis("synopsis text", True) == ( - "

    Synopsis: synopsis text

    \n" - ) - assert html._formatSynopsis("short text", False) == ( - "

    Short Description: short text

    \n" - ) - assert html._formatComments("comment text") == ( - "

    Comment: comment text

    \n" - ) - - assert html._formatKeywords("") == ("", "") - assert html._formatKeywords("tag: Jane") == ( - "tag", "Tag: Jane" - ) - assert html._formatKeywords("char: Bod, Jane") == ( - "char", - "Characters: " - "Bod, " - "Jane" - ) diff --git a/tests/test_formats/test_fmt_tokenizer.py b/tests/test_formats/test_fmt_tokenizer.py index 224918319..2b4944989 100644 --- a/tests/test_formats/test_fmt_tokenizer.py +++ b/tests/test_formats/test_fmt_tokenizer.py @@ -29,7 +29,9 @@ from novelwriter import CONFIG from novelwriter.constants import nwHeadFmt, nwStyles from novelwriter.core.project import NWProject -from novelwriter.formats.tokenizer import HeadingFormatter, Tokenizer, stripEscape +from novelwriter.enum import nwComment +from novelwriter.formats.shared import BlockFmt, BlockTyp, TextFmt, stripEscape +from novelwriter.formats.tokenizer import COMMENT_STYLE, HeadingFormatter, Tokenizer from novelwriter.formats.tomarkdown import ToMarkdown from novelwriter.formats.toraw import ToRaw @@ -198,23 +200,23 @@ def testFmtToken_TextOps(monkeypatch, mockGUI, mockRnd, fncPath): assert project.saveProject() # Root Heading - assert len(tokens._tokens) == 0 + assert len(tokens._blocks) == 0 tokens.addRootHeading("stuff") tokens.addRootHeading(C.hSceneDoc) - assert len(tokens._tokens) == 0 + assert len(tokens._blocks) == 0 # First Page tokens.addRootHeading(C.hPlotRoot) assert tokens.allMarkdown[-1] == "#! Notes: Plot\n\n" - assert tokens._tokens[-1] == ( - Tokenizer.T_TITLE, 1, "Notes: Plot", [], Tokenizer.A_CENTRE + assert tokens._blocks[-1] == ( + BlockTyp.TITLE, 1, "Notes: Plot", [], BlockFmt.CENTRE ) # Not First Page tokens.addRootHeading(C.hPlotRoot) assert tokens.allMarkdown[-1] == "#! Notes: Plot\n\n" - assert tokens._tokens[-1] == ( - Tokenizer.T_TITLE, 1, "Notes: Plot", [], Tokenizer.A_CENTRE | Tokenizer.A_PBB + assert tokens._blocks[-1] == ( + BlockTyp.TITLE, 1, "Notes: Plot", [], BlockFmt.CENTRE | BlockFmt.PBB ) # Set Text @@ -273,8 +275,8 @@ def testFmtToken_HeaderFormat(mockGUI): tokens._text = "#! Novel Title\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_TITLE, 1, "Novel Title", [], Tokenizer.A_CENTRE), + assert tokens._blocks == [ + (BlockTyp.TITLE, 1, "Novel Title", [], BlockFmt.CENTRE), ] assert tokens.allMarkdown[-1] == "#! Novel Title\n\n" @@ -284,8 +286,8 @@ def testFmtToken_HeaderFormat(mockGUI): tokens._text = "#! Note Title\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_TITLE, 1, "Note Title", [], Tokenizer.A_CENTRE), + assert tokens._blocks == [ + (BlockTyp.TITLE, 1, "Note Title", [], BlockFmt.CENTRE), ] assert tokens.allMarkdown[-1] == "#! Note Title\n\n" @@ -298,8 +300,8 @@ def testFmtToken_HeaderFormat(mockGUI): tokens._text = "# Novel Title\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD1, 1, "Novel Title", [], Tokenizer.A_CENTRE), + assert tokens._blocks == [ + (BlockTyp.HEAD1, 1, "Novel Title", [], BlockFmt.CENTRE), ] assert tokens.allMarkdown[-1] == "# Novel Title\n\n" @@ -309,8 +311,8 @@ def testFmtToken_HeaderFormat(mockGUI): tokens._text = "# Note Title\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD1, 1, "Note Title", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.HEAD1, 1, "Note Title", [], BlockFmt.NONE), ] assert tokens.allMarkdown[-1] == "# Note Title\n\n" @@ -322,8 +324,8 @@ def testFmtToken_HeaderFormat(mockGUI): tokens._text = "## Chapter One\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD2, 1, "Chapter One", [], Tokenizer.A_PBB), + assert tokens._blocks == [ + (BlockTyp.HEAD2, 1, "Chapter One", [], BlockFmt.PBB), ] assert tokens.allMarkdown[-1] == "## Chapter One\n\n" @@ -332,8 +334,8 @@ def testFmtToken_HeaderFormat(mockGUI): tokens._text = "## Heading 2\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD2, 1, "Heading 2", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.HEAD2, 1, "Heading 2", [], BlockFmt.NONE), ] assert tokens.allMarkdown[-1] == "## Heading 2\n\n" @@ -345,8 +347,8 @@ def testFmtToken_HeaderFormat(mockGUI): tokens._text = "### Scene One\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD3, 1, "Scene One", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.HEAD3, 1, "Scene One", [], BlockFmt.NONE), ] assert tokens.allMarkdown[-1] == "### Scene One\n\n" @@ -355,8 +357,8 @@ def testFmtToken_HeaderFormat(mockGUI): tokens._text = "### Heading 3\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD3, 1, "Heading 3", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.HEAD3, 1, "Heading 3", [], BlockFmt.NONE), ] assert tokens.allMarkdown[-1] == "### Heading 3\n\n" @@ -368,8 +370,8 @@ def testFmtToken_HeaderFormat(mockGUI): tokens._text = "#### A Section\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD4, 1, "A Section", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.HEAD4, 1, "A Section", [], BlockFmt.NONE), ] assert tokens.allMarkdown[-1] == "#### A Section\n\n" @@ -378,8 +380,8 @@ def testFmtToken_HeaderFormat(mockGUI): tokens._text = "#### Heading 4\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD4, 1, "Heading 4", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.HEAD4, 1, "Heading 4", [], BlockFmt.NONE), ] assert tokens.allMarkdown[-1] == "#### Heading 4\n\n" @@ -392,8 +394,8 @@ def testFmtToken_HeaderFormat(mockGUI): tokens._text = "#! Title\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_TITLE, 1, "Title", [], Tokenizer.A_PBB | Tokenizer.A_CENTRE), + assert tokens._blocks == [ + (BlockTyp.TITLE, 1, "Title", [], BlockFmt.PBB | BlockFmt.CENTRE), ] assert tokens.allMarkdown[-1] == "#! Title\n\n" @@ -403,8 +405,8 @@ def testFmtToken_HeaderFormat(mockGUI): tokens._text = "#! Title\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_TITLE, 1, "Title", [], Tokenizer.A_PBB | Tokenizer.A_CENTRE), + assert tokens._blocks == [ + (BlockTyp.TITLE, 1, "Title", [], BlockFmt.PBB | BlockFmt.CENTRE), ] assert tokens.allMarkdown[-1] == "#! Title\n\n" @@ -416,8 +418,8 @@ def testFmtToken_HeaderFormat(mockGUI): tokens._text = "##! Prologue\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD2, 1, "Prologue", [], Tokenizer.A_PBB), + assert tokens._blocks == [ + (BlockTyp.HEAD2, 1, "Prologue", [], BlockFmt.PBB), ] assert tokens.allMarkdown[-1] == "##! Prologue\n\n" @@ -426,8 +428,8 @@ def testFmtToken_HeaderFormat(mockGUI): tokens._text = "##! Prologue\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD2, 1, "Prologue", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.HEAD2, 1, "Prologue", [], BlockFmt.NONE), ] assert tokens.allMarkdown[-1] == "##! Prologue\n\n" @@ -438,11 +440,11 @@ def testFmtToken_HeaderStyle(mockGUI): project = NWProject() tokens = BareTokenizer(project) - def processStyle(text: str, first: bool) -> int: + def processStyle(text: str, first: bool) -> BlockFmt: tokens._text = text tokens._isFirst = first tokens.tokenizeText() - return tokens._tokens[0][4] + return tokens._blocks[0][4] # No Styles # ========= @@ -451,47 +453,47 @@ def processStyle(text: str, first: bool) -> int: tokens.setChapterStyle(False, False) tokens.setSceneStyle(False, False) - assert tokens._partStyle == Tokenizer.A_NONE - assert tokens._chapterStyle == Tokenizer.A_NONE - assert tokens._sceneStyle == Tokenizer.A_NONE + assert tokens._partStyle == BlockFmt.NONE + assert tokens._chapterStyle == BlockFmt.NONE + assert tokens._sceneStyle == BlockFmt.NONE # Novel Docs tokens._isNovel = True # First Document is False - assert processStyle("# Title\n", False) == Tokenizer.A_NONE - assert processStyle("## Chapter\n", False) == Tokenizer.A_NONE - assert processStyle("### Scene\n", False) == Tokenizer.A_NONE - assert processStyle("#### Section\n", False) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert processStyle("##! Prologue\n", False) == Tokenizer.A_NONE + assert processStyle("# Title\n", False) == BlockFmt.NONE + assert processStyle("## Chapter\n", False) == BlockFmt.NONE + assert processStyle("### Scene\n", False) == BlockFmt.NONE + assert processStyle("#### Section\n", False) == BlockFmt.NONE + assert processStyle("#! My Novel\n", False) == BlockFmt.CENTRE | BlockFmt.PBB + assert processStyle("##! Prologue\n", False) == BlockFmt.NONE # First Document is True - assert processStyle("# Title\n", True) == Tokenizer.A_NONE - assert processStyle("## Chapter\n", True) == Tokenizer.A_NONE - assert processStyle("### Scene\n", True) == Tokenizer.A_NONE - assert processStyle("#### Section\n", True) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", True) == Tokenizer.A_CENTRE - assert processStyle("##! Prologue\n", True) == Tokenizer.A_NONE + assert processStyle("# Title\n", True) == BlockFmt.NONE + assert processStyle("## Chapter\n", True) == BlockFmt.NONE + assert processStyle("### Scene\n", True) == BlockFmt.NONE + assert processStyle("#### Section\n", True) == BlockFmt.NONE + assert processStyle("#! My Novel\n", True) == BlockFmt.CENTRE + assert processStyle("##! Prologue\n", True) == BlockFmt.NONE # Note Docs tokens._isNovel = False # First Document is False - assert processStyle("# Title\n", False) == Tokenizer.A_NONE - assert processStyle("## Chapter\n", False) == Tokenizer.A_NONE - assert processStyle("### Scene\n", False) == Tokenizer.A_NONE - assert processStyle("#### Section\n", False) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert processStyle("##! Prologue\n", False) == Tokenizer.A_NONE + assert processStyle("# Title\n", False) == BlockFmt.NONE + assert processStyle("## Chapter\n", False) == BlockFmt.NONE + assert processStyle("### Scene\n", False) == BlockFmt.NONE + assert processStyle("#### Section\n", False) == BlockFmt.NONE + assert processStyle("#! My Novel\n", False) == BlockFmt.CENTRE | BlockFmt.PBB + assert processStyle("##! Prologue\n", False) == BlockFmt.NONE # First Document is True - assert processStyle("# Title\n", True) == Tokenizer.A_NONE - assert processStyle("## Chapter\n", True) == Tokenizer.A_NONE - assert processStyle("### Scene\n", True) == Tokenizer.A_NONE - assert processStyle("#### Section\n", True) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", True) == Tokenizer.A_CENTRE - assert processStyle("##! Prologue\n", True) == Tokenizer.A_NONE + assert processStyle("# Title\n", True) == BlockFmt.NONE + assert processStyle("## Chapter\n", True) == BlockFmt.NONE + assert processStyle("### Scene\n", True) == BlockFmt.NONE + assert processStyle("#### Section\n", True) == BlockFmt.NONE + assert processStyle("#! My Novel\n", True) == BlockFmt.CENTRE + assert processStyle("##! Prologue\n", True) == BlockFmt.NONE # Center Headers # ============== @@ -500,47 +502,47 @@ def processStyle(text: str, first: bool) -> int: tokens.setChapterStyle(True, False) tokens.setSceneStyle(True, False) - assert tokens._partStyle == Tokenizer.A_CENTRE - assert tokens._chapterStyle == Tokenizer.A_CENTRE - assert tokens._sceneStyle == Tokenizer.A_CENTRE + assert tokens._partStyle == BlockFmt.CENTRE + assert tokens._chapterStyle == BlockFmt.CENTRE + assert tokens._sceneStyle == BlockFmt.CENTRE # Novel Docs tokens._isNovel = True # First Document is False - assert processStyle("# Title\n", False) == Tokenizer.A_CENTRE - assert processStyle("## Chapter\n", False) == Tokenizer.A_CENTRE - assert processStyle("### Scene\n", False) == Tokenizer.A_CENTRE - assert processStyle("#### Section\n", False) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert processStyle("##! Prologue\n", False) == Tokenizer.A_CENTRE + assert processStyle("# Title\n", False) == BlockFmt.CENTRE + assert processStyle("## Chapter\n", False) == BlockFmt.CENTRE + assert processStyle("### Scene\n", False) == BlockFmt.CENTRE + assert processStyle("#### Section\n", False) == BlockFmt.NONE + assert processStyle("#! My Novel\n", False) == BlockFmt.CENTRE | BlockFmt.PBB + assert processStyle("##! Prologue\n", False) == BlockFmt.CENTRE # First Document is True - assert processStyle("# Title\n", True) == Tokenizer.A_CENTRE - assert processStyle("## Chapter\n", True) == Tokenizer.A_CENTRE - assert processStyle("### Scene\n", True) == Tokenizer.A_CENTRE - assert processStyle("#### Section\n", True) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", True) == Tokenizer.A_CENTRE - assert processStyle("##! Prologue\n", True) == Tokenizer.A_CENTRE + assert processStyle("# Title\n", True) == BlockFmt.CENTRE + assert processStyle("## Chapter\n", True) == BlockFmt.CENTRE + assert processStyle("### Scene\n", True) == BlockFmt.CENTRE + assert processStyle("#### Section\n", True) == BlockFmt.NONE + assert processStyle("#! My Novel\n", True) == BlockFmt.CENTRE + assert processStyle("##! Prologue\n", True) == BlockFmt.CENTRE # Note Docs tokens._isNovel = False # First Document is False - assert processStyle("# Title\n", False) == Tokenizer.A_NONE - assert processStyle("## Chapter\n", False) == Tokenizer.A_NONE - assert processStyle("### Scene\n", False) == Tokenizer.A_NONE - assert processStyle("#### Section\n", False) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert processStyle("##! Prologue\n", False) == Tokenizer.A_NONE + assert processStyle("# Title\n", False) == BlockFmt.NONE + assert processStyle("## Chapter\n", False) == BlockFmt.NONE + assert processStyle("### Scene\n", False) == BlockFmt.NONE + assert processStyle("#### Section\n", False) == BlockFmt.NONE + assert processStyle("#! My Novel\n", False) == BlockFmt.CENTRE | BlockFmt.PBB + assert processStyle("##! Prologue\n", False) == BlockFmt.NONE # First Document is True - assert processStyle("# Title\n", True) == Tokenizer.A_NONE - assert processStyle("## Chapter\n", True) == Tokenizer.A_NONE - assert processStyle("### Scene\n", True) == Tokenizer.A_NONE - assert processStyle("#### Section\n", True) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", True) == Tokenizer.A_CENTRE - assert processStyle("##! Prologue\n", True) == Tokenizer.A_NONE + assert processStyle("# Title\n", True) == BlockFmt.NONE + assert processStyle("## Chapter\n", True) == BlockFmt.NONE + assert processStyle("### Scene\n", True) == BlockFmt.NONE + assert processStyle("#### Section\n", True) == BlockFmt.NONE + assert processStyle("#! My Novel\n", True) == BlockFmt.CENTRE + assert processStyle("##! Prologue\n", True) == BlockFmt.NONE # Page Break Headers # ================== @@ -549,47 +551,47 @@ def processStyle(text: str, first: bool) -> int: tokens.setChapterStyle(False, True) tokens.setSceneStyle(False, True) - assert tokens._partStyle == Tokenizer.A_PBB - assert tokens._chapterStyle == Tokenizer.A_PBB - assert tokens._sceneStyle == Tokenizer.A_PBB + assert tokens._partStyle == BlockFmt.PBB + assert tokens._chapterStyle == BlockFmt.PBB + assert tokens._sceneStyle == BlockFmt.PBB # Novel Docs tokens._isNovel = True # First Document is False - assert processStyle("# Title\n", False) == Tokenizer.A_PBB - assert processStyle("## Chapter\n", False) == Tokenizer.A_PBB - assert processStyle("### Scene\n", False) == Tokenizer.A_PBB - assert processStyle("#### Section\n", False) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert processStyle("##! Prologue\n", False) == Tokenizer.A_PBB + assert processStyle("# Title\n", False) == BlockFmt.PBB + assert processStyle("## Chapter\n", False) == BlockFmt.PBB + assert processStyle("### Scene\n", False) == BlockFmt.PBB + assert processStyle("#### Section\n", False) == BlockFmt.NONE + assert processStyle("#! My Novel\n", False) == BlockFmt.CENTRE | BlockFmt.PBB + assert processStyle("##! Prologue\n", False) == BlockFmt.PBB # First Document is True - assert processStyle("# Title\n", True) == Tokenizer.A_NONE - assert processStyle("## Chapter\n", True) == Tokenizer.A_NONE - assert processStyle("### Scene\n", True) == Tokenizer.A_NONE - assert processStyle("#### Section\n", True) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", True) == Tokenizer.A_CENTRE - assert processStyle("##! Prologue\n", True) == Tokenizer.A_NONE + assert processStyle("# Title\n", True) == BlockFmt.NONE + assert processStyle("## Chapter\n", True) == BlockFmt.NONE + assert processStyle("### Scene\n", True) == BlockFmt.NONE + assert processStyle("#### Section\n", True) == BlockFmt.NONE + assert processStyle("#! My Novel\n", True) == BlockFmt.CENTRE + assert processStyle("##! Prologue\n", True) == BlockFmt.NONE # Note Docs tokens._isNovel = False # First Document is False - assert processStyle("# Title\n", False) == Tokenizer.A_NONE - assert processStyle("## Chapter\n", False) == Tokenizer.A_NONE - assert processStyle("### Scene\n", False) == Tokenizer.A_NONE - assert processStyle("#### Section\n", False) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert processStyle("##! Prologue\n", False) == Tokenizer.A_NONE + assert processStyle("# Title\n", False) == BlockFmt.NONE + assert processStyle("## Chapter\n", False) == BlockFmt.NONE + assert processStyle("### Scene\n", False) == BlockFmt.NONE + assert processStyle("#### Section\n", False) == BlockFmt.NONE + assert processStyle("#! My Novel\n", False) == BlockFmt.CENTRE | BlockFmt.PBB + assert processStyle("##! Prologue\n", False) == BlockFmt.NONE # First Document is True - assert processStyle("# Title\n", True) == Tokenizer.A_NONE - assert processStyle("## Chapter\n", True) == Tokenizer.A_NONE - assert processStyle("### Scene\n", True) == Tokenizer.A_NONE - assert processStyle("#### Section\n", True) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", True) == Tokenizer.A_CENTRE - assert processStyle("##! Prologue\n", True) == Tokenizer.A_NONE + assert processStyle("# Title\n", True) == BlockFmt.NONE + assert processStyle("## Chapter\n", True) == BlockFmt.NONE + assert processStyle("### Scene\n", True) == BlockFmt.NONE + assert processStyle("#### Section\n", True) == BlockFmt.NONE + assert processStyle("#! My Novel\n", True) == BlockFmt.CENTRE + assert processStyle("##! Prologue\n", True) == BlockFmt.NONE # Page Break and Centre Headers # ============================= @@ -598,47 +600,47 @@ def processStyle(text: str, first: bool) -> int: tokens.setChapterStyle(True, True) tokens.setSceneStyle(True, True) - assert tokens._partStyle == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert tokens._chapterStyle == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert tokens._sceneStyle == Tokenizer.A_CENTRE | Tokenizer.A_PBB + assert tokens._partStyle == BlockFmt.CENTRE | BlockFmt.PBB + assert tokens._chapterStyle == BlockFmt.CENTRE | BlockFmt.PBB + assert tokens._sceneStyle == BlockFmt.CENTRE | BlockFmt.PBB # Novel Docs tokens._isNovel = True # First Document is False - assert processStyle("# Title\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert processStyle("## Chapter\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert processStyle("### Scene\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert processStyle("#### Section\n", False) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert processStyle("##! Prologue\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB + assert processStyle("# Title\n", False) == BlockFmt.CENTRE | BlockFmt.PBB + assert processStyle("## Chapter\n", False) == BlockFmt.CENTRE | BlockFmt.PBB + assert processStyle("### Scene\n", False) == BlockFmt.CENTRE | BlockFmt.PBB + assert processStyle("#### Section\n", False) == BlockFmt.NONE + assert processStyle("#! My Novel\n", False) == BlockFmt.CENTRE | BlockFmt.PBB + assert processStyle("##! Prologue\n", False) == BlockFmt.CENTRE | BlockFmt.PBB # First Document is True - assert processStyle("# Title\n", True) == Tokenizer.A_CENTRE - assert processStyle("## Chapter\n", True) == Tokenizer.A_CENTRE - assert processStyle("### Scene\n", True) == Tokenizer.A_CENTRE - assert processStyle("#### Section\n", True) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", True) == Tokenizer.A_CENTRE - assert processStyle("##! Prologue\n", True) == Tokenizer.A_CENTRE + assert processStyle("# Title\n", True) == BlockFmt.CENTRE + assert processStyle("## Chapter\n", True) == BlockFmt.CENTRE + assert processStyle("### Scene\n", True) == BlockFmt.CENTRE + assert processStyle("#### Section\n", True) == BlockFmt.NONE + assert processStyle("#! My Novel\n", True) == BlockFmt.CENTRE + assert processStyle("##! Prologue\n", True) == BlockFmt.CENTRE # Note Docs tokens._isNovel = False # First Document is False - assert processStyle("# Title\n", False) == Tokenizer.A_NONE - assert processStyle("## Chapter\n", False) == Tokenizer.A_NONE - assert processStyle("### Scene\n", False) == Tokenizer.A_NONE - assert processStyle("#### Section\n", False) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert processStyle("##! Prologue\n", False) == Tokenizer.A_NONE + assert processStyle("# Title\n", False) == BlockFmt.NONE + assert processStyle("## Chapter\n", False) == BlockFmt.NONE + assert processStyle("### Scene\n", False) == BlockFmt.NONE + assert processStyle("#### Section\n", False) == BlockFmt.NONE + assert processStyle("#! My Novel\n", False) == BlockFmt.CENTRE | BlockFmt.PBB + assert processStyle("##! Prologue\n", False) == BlockFmt.NONE # First Document is True - assert processStyle("# Title\n", True) == Tokenizer.A_NONE - assert processStyle("## Chapter\n", True) == Tokenizer.A_NONE - assert processStyle("### Scene\n", True) == Tokenizer.A_NONE - assert processStyle("#### Section\n", True) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", True) == Tokenizer.A_CENTRE - assert processStyle("##! Prologue\n", True) == Tokenizer.A_NONE + assert processStyle("# Title\n", True) == BlockFmt.NONE + assert processStyle("## Chapter\n", True) == BlockFmt.NONE + assert processStyle("### Scene\n", True) == BlockFmt.NONE + assert processStyle("#### Section\n", True) == BlockFmt.NONE + assert processStyle("#! My Novel\n", True) == BlockFmt.CENTRE + assert processStyle("##! Prologue\n", True) == BlockFmt.NONE # Check Separation # ================ @@ -649,48 +651,48 @@ def processStyle(text: str, first: bool) -> int: tokens.setChapterStyle(False, False) tokens.setSceneStyle(False, False) - assert tokens._partStyle == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert tokens._chapterStyle == Tokenizer.A_NONE - assert tokens._sceneStyle == Tokenizer.A_NONE + assert tokens._partStyle == BlockFmt.CENTRE | BlockFmt.PBB + assert tokens._chapterStyle == BlockFmt.NONE + assert tokens._sceneStyle == BlockFmt.NONE - assert processStyle("# Title\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert processStyle("## Chapter\n", False) == Tokenizer.A_NONE - assert processStyle("### Scene\n", False) == Tokenizer.A_NONE - assert processStyle("#### Section\n", False) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert processStyle("##! Prologue\n", False) == Tokenizer.A_NONE + assert processStyle("# Title\n", False) == BlockFmt.CENTRE | BlockFmt.PBB + assert processStyle("## Chapter\n", False) == BlockFmt.NONE + assert processStyle("### Scene\n", False) == BlockFmt.NONE + assert processStyle("#### Section\n", False) == BlockFmt.NONE + assert processStyle("#! My Novel\n", False) == BlockFmt.CENTRE | BlockFmt.PBB + assert processStyle("##! Prologue\n", False) == BlockFmt.NONE # Chapter Styles tokens.setPartitionStyle(False, False) tokens.setChapterStyle(True, True) tokens.setSceneStyle(False, False) - assert tokens._partStyle == Tokenizer.A_NONE - assert tokens._chapterStyle == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert tokens._sceneStyle == Tokenizer.A_NONE + assert tokens._partStyle == BlockFmt.NONE + assert tokens._chapterStyle == BlockFmt.CENTRE | BlockFmt.PBB + assert tokens._sceneStyle == BlockFmt.NONE - assert processStyle("# Title\n", False) == Tokenizer.A_NONE - assert processStyle("## Chapter\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert processStyle("### Scene\n", False) == Tokenizer.A_NONE - assert processStyle("#### Section\n", False) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert processStyle("##! Prologue\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB + assert processStyle("# Title\n", False) == BlockFmt.NONE + assert processStyle("## Chapter\n", False) == BlockFmt.CENTRE | BlockFmt.PBB + assert processStyle("### Scene\n", False) == BlockFmt.NONE + assert processStyle("#### Section\n", False) == BlockFmt.NONE + assert processStyle("#! My Novel\n", False) == BlockFmt.CENTRE | BlockFmt.PBB + assert processStyle("##! Prologue\n", False) == BlockFmt.CENTRE | BlockFmt.PBB # Scene Styles tokens.setPartitionStyle(False, False) tokens.setChapterStyle(False, False) tokens.setSceneStyle(True, True) - assert tokens._partStyle == Tokenizer.A_NONE - assert tokens._chapterStyle == Tokenizer.A_NONE - assert tokens._sceneStyle == Tokenizer.A_CENTRE | Tokenizer.A_PBB + assert tokens._partStyle == BlockFmt.NONE + assert tokens._chapterStyle == BlockFmt.NONE + assert tokens._sceneStyle == BlockFmt.CENTRE | BlockFmt.PBB - assert processStyle("# Title\n", False) == Tokenizer.A_NONE - assert processStyle("## Chapter\n", False) == Tokenizer.A_NONE - assert processStyle("### Scene\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert processStyle("#### Section\n", False) == Tokenizer.A_NONE - assert processStyle("#! My Novel\n", False) == Tokenizer.A_CENTRE | Tokenizer.A_PBB - assert processStyle("##! Prologue\n", False) == Tokenizer.A_NONE + assert processStyle("# Title\n", False) == BlockFmt.NONE + assert processStyle("## Chapter\n", False) == BlockFmt.NONE + assert processStyle("### Scene\n", False) == BlockFmt.CENTRE | BlockFmt.PBB + assert processStyle("#### Section\n", False) == BlockFmt.NONE + assert processStyle("#! My Novel\n", False) == BlockFmt.CENTRE | BlockFmt.PBB + assert processStyle("##! Prologue\n", False) == BlockFmt.NONE @pytest.mark.core @@ -699,85 +701,123 @@ def testFmtToken_MetaFormat(mockGUI): project = NWProject() tokens = ToRaw(project) + # Ignore Text + tokens._text = "%~ Some text\n" + tokens.tokenizeText() + assert tokens._blocks == [] + assert tokens.allMarkdown[-1] == "\n" + # Comment + tokens.setComments(False) tokens._text = "% A comment\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_COMMENT, 0, "A comment", [], Tokenizer.A_NONE), - ] + assert tokens._blocks == [] assert tokens.allMarkdown[-1] == "\n" tokens.setComments(True) + tokens._text = "% A comment\n" tokens.tokenizeText() + assert tokens._blocks == [( + BlockTyp.COMMENT, 0, "Comment: A comment", [ + (0, TextFmt.B_B, ""), (0, TextFmt.COL_B, "comment"), (8, TextFmt.B_E, ""), + (8, TextFmt.COL_E, ""), (9, TextFmt.COL_B, "comment"), (18, TextFmt.COL_E, ""), + ], BlockFmt.NONE + )] assert tokens.allMarkdown[-1] == "% A comment\n\n" - # Ignore Text - tokens._text = "%~ Some text\n" - tokens.tokenizeText() - assert tokens._tokens == [] - assert tokens.allMarkdown[-1] == "\n" - # Synopsis + tokens.setSynopsis(False) tokens._text = "%synopsis: The synopsis\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_SYNOPSIS, 0, "The synopsis", [], Tokenizer.A_NONE), - ] - tokens._text = "% synopsis: The synopsis\n" - tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_SYNOPSIS, 0, "The synopsis", [], Tokenizer.A_NONE), - ] + assert tokens._blocks == [] assert tokens.allMarkdown[-1] == "\n" tokens.setSynopsis(True) + tokens._text = "% synopsis: The synopsis\n" tokens.tokenizeText() + assert tokens._blocks == [( + BlockTyp.COMMENT, 0, "Synopsis: The synopsis", [ + (0, TextFmt.B_B, ""), (0, TextFmt.COL_B, "modifier"), (9, TextFmt.B_E, ""), + (9, TextFmt.COL_E, ""), (10, TextFmt.COL_B, "synopsis"), (22, TextFmt.COL_E, "") + ], BlockFmt.NONE + )] assert tokens.allMarkdown[-1] == "% synopsis: The synopsis\n\n" # Short tokens.setSynopsis(False) tokens._text = "% short: A short description\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_SHORT, 0, "A short description", [], Tokenizer.A_NONE), - ] + assert tokens._blocks == [] assert tokens.allMarkdown[-1] == "\n" tokens.setSynopsis(True) + tokens._text = "% short: A short description\n" tokens.tokenizeText() + assert tokens._blocks == [( + BlockTyp.COMMENT, 0, "Short Description: A short description", [ + (0, TextFmt.B_B, ""), (0, TextFmt.COL_B, "modifier"), (18, TextFmt.B_E, ""), + (18, TextFmt.COL_E, ""), (19, TextFmt.COL_B, "synopsis"), (38, TextFmt.COL_E, ""), + ], BlockFmt.NONE + )] assert tokens.allMarkdown[-1] == "% short: A short description\n\n" # Keyword + tokens.setKeywords(False) tokens._text = "@char: Bod\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_KEYWORD, 0, "char: Bod", [], Tokenizer.A_NONE), - ] + assert tokens._blocks == [] assert tokens.allMarkdown[-1] == "\n" tokens.setKeywords(True) tokens.tokenizeText() + assert tokens._blocks == [( + BlockTyp.KEYWORD, 0, "Characters: Bod", [ + (0, TextFmt.B_B, ""), (0, TextFmt.COL_B, "keyword"), + (11, TextFmt.B_E, ""), (11, TextFmt.COL_E, ""), + (12, TextFmt.COL_B, "tag"), (12, TextFmt.HRF_B, "#tag_bod"), + (15, TextFmt.HRF_E, ""), (15, TextFmt.COL_E, ""), + ], BlockFmt.NONE + )] assert tokens.allMarkdown[-1] == "@char: Bod\n\n" tokens._text = "@pov: Bod\n@plot: Main\n@location: Europe\n" tokens.tokenizeText() - styTop = Tokenizer.A_NONE | Tokenizer.A_Z_BTMMRG - styMid = Tokenizer.A_NONE | Tokenizer.A_Z_BTMMRG | Tokenizer.A_Z_TOPMRG - styBtm = Tokenizer.A_NONE | Tokenizer.A_Z_TOPMRG - assert tokens._tokens == [ - (Tokenizer.T_KEYWORD, 0, "pov: Bod", [], styTop), - (Tokenizer.T_KEYWORD, 0, "plot: Main", [], styMid), - (Tokenizer.T_KEYWORD, 0, "location: Europe", [], styBtm), - ] + assert tokens._blocks == [( + BlockTyp.KEYWORD, 0, "Point of View: Bod", [ + (0, TextFmt.B_B, ""), (0, TextFmt.COL_B, "keyword"), + (14, TextFmt.B_E, ""), (14, TextFmt.COL_E, ""), + (15, TextFmt.COL_B, "tag"), (15, TextFmt.HRF_B, "#tag_bod"), + (18, TextFmt.HRF_E, ""), (18, TextFmt.COL_E, ""), + ], BlockFmt.Z_BTMMRG + ), ( + BlockTyp.KEYWORD, 0, "Plot: Main", [ + (0, TextFmt.B_B, ""), (0, TextFmt.COL_B, "keyword"), + (5, TextFmt.B_E, ""), (5, TextFmt.COL_E, ""), + (6, TextFmt.COL_B, "tag"), (6, TextFmt.HRF_B, "#tag_main"), + (10, TextFmt.HRF_E, ""), (10, TextFmt.COL_E, ""), + ], BlockFmt.Z_TOPMRG | BlockFmt.Z_BTMMRG + ), ( + BlockTyp.KEYWORD, 0, "Locations: Europe", [ + (0, TextFmt.B_B, ""), (0, TextFmt.COL_B, "keyword"), + (10, TextFmt.B_E, ""), (10, TextFmt.COL_E, ""), + (11, TextFmt.COL_B, "tag"), (11, TextFmt.HRF_B, "#tag_europe"), + (17, TextFmt.HRF_E, ""), (17, TextFmt.COL_E, ""), + ], BlockFmt.Z_TOPMRG + )] assert tokens.allMarkdown[-1] == "@pov: Bod\n@plot: Main\n@location: Europe\n\n" # Ignored keywords tokens._text = "@pov: Bod\n@plot: Main\n@location: Europe\n" tokens.setIgnoredKeywords("@plot, @location") tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_KEYWORD, 0, "pov: Bod", [], Tokenizer.A_NONE), - ] + assert tokens._blocks == [( + BlockTyp.KEYWORD, 0, "Point of View: Bod", [ + (0, TextFmt.B_B, ""), (0, TextFmt.COL_B, "keyword"), + (14, TextFmt.B_E, ""), (14, TextFmt.COL_E, ""), + (15, TextFmt.COL_B, "tag"), (15, TextFmt.HRF_B, "#tag_bod"), + (18, TextFmt.HRF_E, ""), (18, TextFmt.COL_E, ""), + ], BlockFmt.NONE + )] @pytest.mark.core @@ -787,8 +827,8 @@ def testFmtToken_MarginFormat(mockGUI): tokens = ToRaw(project) # Alignment and Indentation - dblIndent = Tokenizer.A_IND_L | Tokenizer.A_IND_R - rIndAlign = Tokenizer.A_RIGHT | Tokenizer.A_IND_R + dblIndent = BlockFmt.IND_L | BlockFmt.IND_R + rIndAlign = BlockFmt.RIGHT | BlockFmt.IND_R tokens._text = ( "Some regular text\n\n" "Some left-aligned text <<\n\n" @@ -800,15 +840,15 @@ def testFmtToken_MarginFormat(mockGUI): ">> Right-indent, right-aligned <\n\n" ) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_TEXT, 0, "Some regular text", [], Tokenizer.A_NONE), - (Tokenizer.T_TEXT, 0, "Some left-aligned text", [], Tokenizer.A_LEFT), - (Tokenizer.T_TEXT, 0, "Some right-aligned text", [], Tokenizer.A_RIGHT), - (Tokenizer.T_TEXT, 0, "Some centered text", [], Tokenizer.A_CENTRE), - (Tokenizer.T_TEXT, 0, "Left-indented block", [], Tokenizer.A_IND_L), - (Tokenizer.T_TEXT, 0, "Right-indented block", [], Tokenizer.A_IND_R), - (Tokenizer.T_TEXT, 0, "Double-indented block", [], dblIndent), - (Tokenizer.T_TEXT, 0, "Right-indent, right-aligned", [], rIndAlign), + assert tokens._blocks == [ + (BlockTyp.TEXT, 0, "Some regular text", [], BlockFmt.NONE), + (BlockTyp.TEXT, 0, "Some left-aligned text", [], BlockFmt.LEFT), + (BlockTyp.TEXT, 0, "Some right-aligned text", [], BlockFmt.RIGHT), + (BlockTyp.TEXT, 0, "Some centered text", [], BlockFmt.CENTRE), + (BlockTyp.TEXT, 0, "Left-indented block", [], BlockFmt.IND_L), + (BlockTyp.TEXT, 0, "Right-indented block", [], BlockFmt.IND_R), + (BlockTyp.TEXT, 0, "Double-indented block", [], dblIndent), + (BlockTyp.TEXT, 0, "Right-indent, right-aligned", [], rIndAlign), ] assert tokens.allMarkdown[-1] == ( "Some regular text\n\n" @@ -834,31 +874,31 @@ def testFmtToken_ExtractFormats(mockGUI): # Plain bold text, fmt = tokens._extractFormats("Text with **bold** in it.") assert text == "Text with bold in it." - assert fmt == [(10, tokens.FMT_B_B, ""), (14, tokens.FMT_B_E, "")] + assert fmt == [(10, TextFmt.B_B, ""), (14, TextFmt.B_E, "")] # Plain italics text, fmt = tokens._extractFormats("Text with _italics_ in it.") assert text == "Text with italics in it." - assert fmt == [(10, tokens.FMT_I_B, ""), (17, tokens.FMT_I_E, "")] + assert fmt == [(10, TextFmt.I_B, ""), (17, TextFmt.I_E, "")] # Plain strikethrough text, fmt = tokens._extractFormats("Text with ~~strikethrough~~ in it.") assert text == "Text with strikethrough in it." - assert fmt == [(10, tokens.FMT_D_B, ""), (23, tokens.FMT_D_E, "")] + assert fmt == [(10, TextFmt.D_B, ""), (23, TextFmt.D_E, "")] # Nested bold/italics text, fmt = tokens._extractFormats("Text with **bold and _italics_** in it.") assert text == "Text with bold and italics in it." assert fmt == [ - (10, tokens.FMT_B_B, ""), (19, tokens.FMT_I_B, ""), - (26, tokens.FMT_I_E, ""), (26, tokens.FMT_B_E, ""), + (10, TextFmt.B_B, ""), (19, TextFmt.I_B, ""), + (26, TextFmt.I_E, ""), (26, TextFmt.B_E, ""), ] # Bold with overlapping italics # Here, bold is ignored because it is not on word boundary text, fmt = tokens._extractFormats("Text with **bold and overlapping _italics**_ in it.") assert text == "Text with **bold and overlapping italics** in it." - assert fmt == [(33, tokens.FMT_I_B, ""), (42, tokens.FMT_I_E, "")] + assert fmt == [(33, TextFmt.I_B, ""), (42, TextFmt.I_E, "")] # Shortcodes # ========== @@ -866,44 +906,44 @@ def testFmtToken_ExtractFormats(mockGUI): # Plain bold text, fmt = tokens._extractFormats("Text with [b]bold[/b] in it.") assert text == "Text with bold in it." - assert fmt == [(10, tokens.FMT_B_B, ""), (14, tokens.FMT_B_E, "")] + assert fmt == [(10, TextFmt.B_B, ""), (14, TextFmt.B_E, "")] # Plain italics text, fmt = tokens._extractFormats("Text with [i]italics[/i] in it.") assert text == "Text with italics in it." - assert fmt == [(10, tokens.FMT_I_B, ""), (17, tokens.FMT_I_E, "")] + assert fmt == [(10, TextFmt.I_B, ""), (17, TextFmt.I_E, "")] # Plain strikethrough text, fmt = tokens._extractFormats("Text with [s]strikethrough[/s] in it.") assert text == "Text with strikethrough in it." - assert fmt == [(10, tokens.FMT_D_B, ""), (23, tokens.FMT_D_E, "")] + assert fmt == [(10, TextFmt.D_B, ""), (23, TextFmt.D_E, "")] # Plain underline text, fmt = tokens._extractFormats("Text with [u]underline[/u] in it.") assert text == "Text with underline in it." - assert fmt == [(10, tokens.FMT_U_B, ""), (19, tokens.FMT_U_E, "")] + assert fmt == [(10, TextFmt.U_B, ""), (19, TextFmt.U_E, "")] # Plain mark text, fmt = tokens._extractFormats("Text with [m]highlight[/m] in it.") assert text == "Text with highlight in it." - assert fmt == [(10, tokens.FMT_M_B, ""), (19, tokens.FMT_M_E, "")] + assert fmt == [(10, TextFmt.M_B, ""), (19, TextFmt.M_E, "")] # Plain superscript text, fmt = tokens._extractFormats("Text with super[sup]script[/sup] in it.") assert text == "Text with superscript in it." - assert fmt == [(15, tokens.FMT_SUP_B, ""), (21, tokens.FMT_SUP_E, "")] + assert fmt == [(15, TextFmt.SUP_B, ""), (21, TextFmt.SUP_E, "")] # Plain subscript text, fmt = tokens._extractFormats("Text with sub[sub]script[/sub] in it.") assert text == "Text with subscript in it." - assert fmt == [(13, tokens.FMT_SUB_B, ""), (19, tokens.FMT_SUB_E, "")] + assert fmt == [(13, TextFmt.SUB_B, ""), (19, TextFmt.SUB_E, "")] # Nested bold/italics text, fmt = tokens._extractFormats("Text with [b]bold and [i]italics[/i][/b] in it.") assert text == "Text with bold and italics in it." assert fmt == [ - (10, tokens.FMT_B_B, ""), (19, tokens.FMT_I_B, ""), - (26, tokens.FMT_I_E, ""), (26, tokens.FMT_B_E, ""), + (10, TextFmt.B_B, ""), (19, TextFmt.I_B, ""), + (26, TextFmt.I_E, ""), (26, TextFmt.B_E, ""), ] # Bold with overlapping italics @@ -913,8 +953,8 @@ def testFmtToken_ExtractFormats(mockGUI): ) assert text == "Text with bold and overlapping italics in it." assert fmt == [ - (10, tokens.FMT_B_B, ""), (31, tokens.FMT_I_B, ""), - (38, tokens.FMT_B_E, ""), (38, tokens.FMT_I_E, ""), + (10, TextFmt.B_B, ""), (31, TextFmt.I_B, ""), + (38, TextFmt.B_E, ""), (38, TextFmt.I_E, ""), ] # So does this @@ -923,8 +963,8 @@ def testFmtToken_ExtractFormats(mockGUI): ) assert text == "Text with bold and overlapping italics in it." assert fmt == [ - (10, tokens.FMT_B_B, ""), (31, tokens.FMT_I_B, ""), - (38, tokens.FMT_B_E, ""), (41, tokens.FMT_I_E, ""), + (10, TextFmt.B_B, ""), (31, TextFmt.I_B, ""), + (38, TextFmt.B_E, ""), (41, TextFmt.I_E, ""), ] @@ -937,42 +977,42 @@ def testFmtToken_Paragraphs(mockGUI): # Collapse empty lines tokens._text = "First paragraph\n\n\nSecond paragraph\n\n\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_TEXT, 0, "First paragraph", [], Tokenizer.A_NONE), - (Tokenizer.T_TEXT, 0, "Second paragraph", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.TEXT, 0, "First paragraph", [], BlockFmt.NONE), + (BlockTyp.TEXT, 0, "Second paragraph", [], BlockFmt.NONE), ] # Combine multi-line paragraphs, keep breaks tokens._text = "This is text\nspanning multiple\nlines" tokens.setKeepLineBreaks(True) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_TEXT, 0, "This is text\nspanning multiple\nlines", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.TEXT, 0, "This is text\nspanning multiple\nlines", [], BlockFmt.NONE), ] # Combine multi-line paragraphs, remove breaks tokens._text = "This is text\nspanning multiple\nlines" tokens.setKeepLineBreaks(False) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_TEXT, 0, "This is text spanning multiple lines", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.TEXT, 0, "This is text spanning multiple lines", [], BlockFmt.NONE), ] # Combine multi-line paragraphs, remove breaks, with formatting tokens._text = "This **is text**\nspanning _multiple_\nlines" tokens.setKeepLineBreaks(False) tokens.tokenizeText() - assert tokens._tokens == [ + assert tokens._blocks == [ ( - Tokenizer.T_TEXT, 0, + BlockTyp.TEXT, 0, "This is text spanning multiple lines", [ - (5, Tokenizer.FMT_B_B, ""), - (12, Tokenizer.FMT_B_E, ""), - (22, Tokenizer.FMT_I_B, ""), - (30, Tokenizer.FMT_I_E, ""), + (5, TextFmt.B_B, ""), + (12, TextFmt.B_E, ""), + (22, TextFmt.I_B, ""), + (30, TextFmt.I_E, ""), ], - Tokenizer.A_NONE + BlockFmt.NONE ), ] @@ -980,22 +1020,22 @@ def testFmtToken_Paragraphs(mockGUI): tokens._text = "# Title\nText _on_\ntwo lines.\n## Chapter\nMore **text**\n_here_.\n\n\n" tokens.setKeepLineBreaks(False) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD1, 1, "Title", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.HEAD1, 1, "Title", [], BlockFmt.NONE), ( - Tokenizer.T_TEXT, 1, "Text on two lines.", [ - (5, Tokenizer.FMT_I_B, ""), - (7, Tokenizer.FMT_I_E, ""), - ], Tokenizer.A_NONE + BlockTyp.TEXT, 1, "Text on two lines.", [ + (5, TextFmt.I_B, ""), + (7, TextFmt.I_E, ""), + ], BlockFmt.NONE ), - (Tokenizer.T_HEAD2, 2, "Chapter", [], Tokenizer.A_NONE), + (BlockTyp.HEAD2, 2, "Chapter", [], BlockFmt.NONE), ( - Tokenizer.T_TEXT, 2, "More text here.", [ - (5, Tokenizer.FMT_B_B, ""), - (9, Tokenizer.FMT_B_E, ""), - (10, Tokenizer.FMT_I_B, ""), - (14, Tokenizer.FMT_I_E, ""), - ], Tokenizer.A_NONE + BlockTyp.TEXT, 2, "More text here.", [ + (5, TextFmt.B_B, ""), + (9, TextFmt.B_E, ""), + (10, TextFmt.I_B, ""), + (14, TextFmt.I_E, ""), + ], BlockFmt.NONE ), ] @@ -1009,81 +1049,81 @@ def testFmtToken_TextFormat(mockGUI): # Text tokens._text = "Some plain text\non two lines\n\n\n" tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_TEXT, 0, "Some plain text\non two lines", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.TEXT, 0, "Some plain text\non two lines", [], BlockFmt.NONE), ] assert tokens.allMarkdown[-1] == "Some plain text\non two lines\n\n\n\n" tokens.setBodyText(False) tokens.tokenizeText() - assert tokens._tokens == [] + assert tokens._blocks == [] assert tokens.allMarkdown[-1] == "\n\n\n" tokens.setBodyText(True) # Text Emphasis tokens._text = "Some **bolded text** on this lines\n" tokens.tokenizeText() - assert tokens._tokens == [( - Tokenizer.T_TEXT, 0, "Some bolded text on this lines", + assert tokens._blocks == [( + BlockTyp.TEXT, 0, "Some bolded text on this lines", [ - (5, Tokenizer.FMT_B_B, ""), - (16, Tokenizer.FMT_B_E, ""), + (5, TextFmt.B_B, ""), + (16, TextFmt.B_E, ""), ], - Tokenizer.A_NONE + BlockFmt.NONE )] assert tokens.allMarkdown[-1] == "Some **bolded text** on this lines\n\n" tokens._text = "Some _italic text_ on this lines\n" tokens.tokenizeText() - assert tokens._tokens == [( - Tokenizer.T_TEXT, 0, "Some italic text on this lines", + assert tokens._blocks == [( + BlockTyp.TEXT, 0, "Some italic text on this lines", [ - (5, Tokenizer.FMT_I_B, ""), - (16, Tokenizer.FMT_I_E, ""), + (5, TextFmt.I_B, ""), + (16, TextFmt.I_E, ""), ], - Tokenizer.A_NONE + BlockFmt.NONE )] assert tokens.allMarkdown[-1] == "Some _italic text_ on this lines\n\n" tokens._text = "Some **_bold italic text_** on this lines\n" tokens.tokenizeText() - assert tokens._tokens == [( - Tokenizer.T_TEXT, 0, "Some bold italic text on this lines", + assert tokens._blocks == [( + BlockTyp.TEXT, 0, "Some bold italic text on this lines", [ - (5, Tokenizer.FMT_B_B, ""), - (5, Tokenizer.FMT_I_B, ""), - (21, Tokenizer.FMT_I_E, ""), - (21, Tokenizer.FMT_B_E, ""), + (5, TextFmt.B_B, ""), + (5, TextFmt.I_B, ""), + (21, TextFmt.I_E, ""), + (21, TextFmt.B_E, ""), ], - Tokenizer.A_NONE + BlockFmt.NONE )] assert tokens.allMarkdown[-1] == "Some **_bold italic text_** on this lines\n\n" tokens._text = "Some ~~strikethrough text~~ on this lines\n" tokens.tokenizeText() - assert tokens._tokens == [( - Tokenizer.T_TEXT, 0, "Some strikethrough text on this lines", + assert tokens._blocks == [( + BlockTyp.TEXT, 0, "Some strikethrough text on this lines", [ - (5, Tokenizer.FMT_D_B, ""), - (23, Tokenizer.FMT_D_E, ""), + (5, TextFmt.D_B, ""), + (23, TextFmt.D_E, ""), ], - Tokenizer.A_NONE + BlockFmt.NONE )] assert tokens.allMarkdown[-1] == "Some ~~strikethrough text~~ on this lines\n\n" tokens._text = "Some **nested bold and _italic_ and ~~strikethrough~~ text** here\n" tokens.tokenizeText() - assert tokens._tokens == [( - Tokenizer.T_TEXT, 0, "Some nested bold and italic and strikethrough text here", + assert tokens._blocks == [( + BlockTyp.TEXT, 0, "Some nested bold and italic and strikethrough text here", [ - (5, Tokenizer.FMT_B_B, ""), - (21, Tokenizer.FMT_I_B, ""), - (27, Tokenizer.FMT_I_E, ""), - (32, Tokenizer.FMT_D_B, ""), - (45, Tokenizer.FMT_D_E, ""), - (50, Tokenizer.FMT_B_E, ""), + (5, TextFmt.B_B, ""), + (21, TextFmt.I_B, ""), + (27, TextFmt.I_E, ""), + (32, TextFmt.D_B, ""), + (45, TextFmt.D_E, ""), + (50, TextFmt.B_E, ""), ], - Tokenizer.A_NONE + BlockFmt.NONE )] assert tokens.allMarkdown[-1] == ( "Some **nested bold and _italic_ and ~~strikethrough~~ text** here\n\n" @@ -1111,61 +1151,61 @@ def testFmtToken_Dialogue(mockGUI): # Single quotes tokens._text = "Text with \u2018dialogue one,\u2019 and \u2018dialogue two.\u2019\n" tokens.tokenizeText() - assert tokens._tokens == [( - Tokenizer.T_TEXT, 0, + assert tokens._blocks == [( + BlockTyp.TEXT, 0, "Text with \u2018dialogue one,\u2019 and \u2018dialogue two.\u2019", [ - (10, Tokenizer.FMT_DL_B, ""), - (25, Tokenizer.FMT_DL_E, ""), - (30, Tokenizer.FMT_DL_B, ""), - (45, Tokenizer.FMT_DL_E, ""), + (10, TextFmt.COL_B, "dialog"), + (25, TextFmt.COL_E, ""), + (30, TextFmt.COL_B, "dialog"), + (45, TextFmt.COL_E, ""), ], - Tokenizer.A_NONE + BlockFmt.NONE )] # Double quotes tokens._text = "Text with \u201cdialogue one,\u201d and \u201cdialogue two.\u201d\n" tokens.tokenizeText() - assert tokens._tokens == [( - Tokenizer.T_TEXT, 0, + assert tokens._blocks == [( + BlockTyp.TEXT, 0, "Text with \u201cdialogue one,\u201d and \u201cdialogue two.\u201d", [ - (10, Tokenizer.FMT_DL_B, ""), - (25, Tokenizer.FMT_DL_E, ""), - (30, Tokenizer.FMT_DL_B, ""), - (45, Tokenizer.FMT_DL_E, ""), + (10, TextFmt.COL_B, "dialog"), + (25, TextFmt.COL_E, ""), + (30, TextFmt.COL_B, "dialog"), + (45, TextFmt.COL_E, ""), ], - Tokenizer.A_NONE + BlockFmt.NONE )] # Alt quotes tokens._text = "Text with ::dialogue one,:: and ::dialogue two.::\n" tokens.tokenizeText() - assert tokens._tokens == [( - Tokenizer.T_TEXT, 0, + assert tokens._blocks == [( + BlockTyp.TEXT, 0, "Text with ::dialogue one,:: and ::dialogue two.::", [ - (10, Tokenizer.FMT_ADL_B, ""), - (27, Tokenizer.FMT_ADL_E, ""), - (32, Tokenizer.FMT_ADL_B, ""), - (49, Tokenizer.FMT_ADL_E, ""), + (10, TextFmt.COL_B, "altdialog"), + (27, TextFmt.COL_E, ""), + (32, TextFmt.COL_B, "altdialog"), + (49, TextFmt.COL_E, ""), ], - Tokenizer.A_NONE + BlockFmt.NONE )] # Dialogue line with narrator break tokens._text = "\u2013 Dialogue with a narrator break, \u2013he said,\u2013 see?\n" tokens.tokenizeText() - assert tokens._tokens == [( - Tokenizer.T_TEXT, 0, + assert tokens._blocks == [( + BlockTyp.TEXT, 0, "\u2013 Dialogue with a narrator break, \u2013he said,\u2013 see?", [ - (0, Tokenizer.FMT_DL_B, ""), - (34, Tokenizer.FMT_DL_E, ""), - (44, Tokenizer.FMT_DL_B, ""), - (49, Tokenizer.FMT_DL_E, ""), + (0, TextFmt.COL_B, "dialog"), + (34, TextFmt.COL_E, ""), + (44, TextFmt.COL_B, "dialog"), + (49, TextFmt.COL_E, ""), ], - Tokenizer.A_NONE + BlockFmt.NONE )] # Special Cases @@ -1174,16 +1214,16 @@ def testFmtToken_Dialogue(mockGUI): # Dialogue + formatting on same index (Issue #2012) tokens._text = "[i]\u201cDialogue text.\u201d[/i]\n" tokens.tokenizeText() - assert tokens._tokens == [( - Tokenizer.T_TEXT, 0, + assert tokens._blocks == [( + BlockTyp.TEXT, 0, "\u201cDialogue text.\u201d", [ - (0, Tokenizer.FMT_I_B, ""), - (0, Tokenizer.FMT_DL_B, ""), - (16, Tokenizer.FMT_I_E, ""), - (16, Tokenizer.FMT_DL_E, ""), + (0, TextFmt.I_B, ""), + (0, TextFmt.COL_B, "dialog"), + (16, TextFmt.I_E, ""), + (16, TextFmt.COL_E, ""), ], - Tokenizer.A_NONE + BlockFmt.NONE )] @@ -1199,8 +1239,8 @@ def testFmtToken_SpecialFormat(mockGUI): # ======== correctResp = [ - (Tokenizer.T_HEAD1, 1, "Title One", [], Tokenizer.A_CENTRE), - (Tokenizer.T_HEAD1, 2, "Title Two", [], Tokenizer.A_CENTRE | Tokenizer.A_PBB), + (BlockTyp.HEAD1, 1, "Title One", [], BlockFmt.CENTRE), + (BlockTyp.HEAD1, 2, "Title Two", [], BlockFmt.CENTRE | BlockFmt.PBB), ] # Command wo/Space @@ -1211,7 +1251,7 @@ def testFmtToken_SpecialFormat(mockGUI): "# Title Two\n\n" ) tokens.tokenizeText() - assert tokens._tokens == correctResp + assert tokens._blocks == correctResp # Command w/Space tokens._isFirst = True @@ -1221,7 +1261,7 @@ def testFmtToken_SpecialFormat(mockGUI): "# Title Two\n\n" ) tokens.tokenizeText() - assert tokens._tokens == correctResp + assert tokens._blocks == correctResp # Trailing Spaces tokens._isFirst = True @@ -1231,7 +1271,7 @@ def testFmtToken_SpecialFormat(mockGUI): "# Title Two\n\n" ) tokens.tokenizeText() - assert tokens._tokens == correctResp + assert tokens._blocks == correctResp # Single Empty Paragraph # ====================== @@ -1242,10 +1282,10 @@ def testFmtToken_SpecialFormat(mockGUI): "Some text to go here ...\n\n" ) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD1, 1, "Title One", [], Tokenizer.A_PBB | Tokenizer.A_CENTRE), - (Tokenizer.T_SKIP, 1, "", [], Tokenizer.A_NONE), - (Tokenizer.T_TEXT, 1, "Some text to go here ...", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.HEAD1, 1, "Title One", [], BlockFmt.PBB | BlockFmt.CENTRE), + (BlockTyp.SKIP, 1, "", [], BlockFmt.NONE), + (BlockTyp.TEXT, 1, "Some text to go here ...", [], BlockFmt.NONE), ] # Multiple Empty Paragraphs @@ -1258,10 +1298,10 @@ def testFmtToken_SpecialFormat(mockGUI): "Some text to go here ...\n\n" ) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD1, 1, "Title One", [], Tokenizer.A_PBB | Tokenizer.A_CENTRE), - (Tokenizer.T_SKIP, 1, "", [], Tokenizer.A_NONE), - (Tokenizer.T_TEXT, 1, "Some text to go here ...", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.HEAD1, 1, "Title One", [], BlockFmt.PBB | BlockFmt.CENTRE), + (BlockTyp.SKIP, 1, "", [], BlockFmt.NONE), + (BlockTyp.TEXT, 1, "Some text to go here ...", [], BlockFmt.NONE), ] # Three Skips @@ -1271,12 +1311,12 @@ def testFmtToken_SpecialFormat(mockGUI): "Some text to go here ...\n\n" ) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD1, 1, "Title One", [], Tokenizer.A_PBB | Tokenizer.A_CENTRE), - (Tokenizer.T_SKIP, 1, "", [], Tokenizer.A_NONE), - (Tokenizer.T_SKIP, 1, "", [], Tokenizer.A_NONE), - (Tokenizer.T_SKIP, 1, "", [], Tokenizer.A_NONE), - (Tokenizer.T_TEXT, 1, "Some text to go here ...", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.HEAD1, 1, "Title One", [], BlockFmt.PBB | BlockFmt.CENTRE), + (BlockTyp.SKIP, 1, "", [], BlockFmt.NONE), + (BlockTyp.SKIP, 1, "", [], BlockFmt.NONE), + (BlockTyp.SKIP, 1, "", [], BlockFmt.NONE), + (BlockTyp.TEXT, 1, "Some text to go here ...", [], BlockFmt.NONE), ] # Malformed Command, Case 1 @@ -1286,9 +1326,9 @@ def testFmtToken_SpecialFormat(mockGUI): "Some text to go here ...\n\n" ) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD1, 1, "Title One", [], Tokenizer.A_PBB | Tokenizer.A_CENTRE), - (Tokenizer.T_TEXT, 1, "Some text to go here ...", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.HEAD1, 1, "Title One", [], BlockFmt.PBB | BlockFmt.CENTRE), + (BlockTyp.TEXT, 1, "Some text to go here ...", [], BlockFmt.NONE), ] # Malformed Command, Case 2 @@ -1298,9 +1338,9 @@ def testFmtToken_SpecialFormat(mockGUI): "Some text to go here ...\n\n" ) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD1, 1, "Title One", [], Tokenizer.A_PBB | Tokenizer.A_CENTRE), - (Tokenizer.T_TEXT, 1, "Some text to go here ...", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.HEAD1, 1, "Title One", [], BlockFmt.PBB | BlockFmt.CENTRE), + (BlockTyp.TEXT, 1, "Some text to go here ...", [], BlockFmt.NONE), ] # Malformed Command, Case 3 @@ -1310,9 +1350,9 @@ def testFmtToken_SpecialFormat(mockGUI): "Some text to go here ...\n\n" ) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD1, 1, "Title One", [], Tokenizer.A_PBB | Tokenizer.A_CENTRE), - (Tokenizer.T_TEXT, 1, "Some text to go here ...", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.HEAD1, 1, "Title One", [], BlockFmt.PBB | BlockFmt.CENTRE), + (BlockTyp.TEXT, 1, "Some text to go here ...", [], BlockFmt.NONE), ] # Empty Paragraph and Page Break @@ -1326,10 +1366,10 @@ def testFmtToken_SpecialFormat(mockGUI): "Some text to go here ...\n\n" ) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD1, 1, "Title One", [], Tokenizer.A_PBB | Tokenizer.A_CENTRE), - (Tokenizer.T_SKIP, 1, "", [], Tokenizer.A_PBB), - (Tokenizer.T_TEXT, 1, "Some text to go here ...", [], 0), + assert tokens._blocks == [ + (BlockTyp.HEAD1, 1, "Title One", [], BlockFmt.PBB | BlockFmt.CENTRE), + (BlockTyp.SKIP, 1, "", [], BlockFmt.PBB), + (BlockTyp.TEXT, 1, "Some text to go here ...", [], BlockFmt.NONE), ] # Multiple Skip @@ -1340,12 +1380,12 @@ def testFmtToken_SpecialFormat(mockGUI): "Some text to go here ...\n\n" ) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD1, 1, "Title One", [], Tokenizer.A_PBB | Tokenizer.A_CENTRE), - (Tokenizer.T_SKIP, 1, "", [], Tokenizer.A_PBB), - (Tokenizer.T_SKIP, 1, "", [], Tokenizer.A_NONE), - (Tokenizer.T_SKIP, 1, "", [], Tokenizer.A_NONE), - (Tokenizer.T_TEXT, 1, "Some text to go here ...", [], 0), + assert tokens._blocks == [ + (BlockTyp.HEAD1, 1, "Title One", [], BlockFmt.PBB | BlockFmt.CENTRE), + (BlockTyp.SKIP, 1, "", [], BlockFmt.PBB), + (BlockTyp.SKIP, 1, "", [], BlockFmt.NONE), + (BlockTyp.SKIP, 1, "", [], BlockFmt.NONE), + (BlockTyp.TEXT, 1, "Some text to go here ...", [], BlockFmt.NONE), ] @@ -1354,6 +1394,7 @@ def testFmtToken_TextIndent(mockGUI): """Test the handling of text indent in the Tokenizer class.""" project = NWProject() tokens = BareTokenizer(project) + tokens.setSynopsis(True) # No First Indent tokens.setFirstLineIndent(True, 1.0, False) @@ -1372,11 +1413,11 @@ def testFmtToken_TextIndent(mockGUI): "Second paragraph.\n\n" ) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD1, 1, "Title One", [], Tokenizer.A_NONE), - (Tokenizer.T_HEAD3, 2, "Scene One", [], Tokenizer.A_NONE), - (Tokenizer.T_TEXT, 2, "First paragraph.", [], Tokenizer.A_NONE), - (Tokenizer.T_TEXT, 2, "Second paragraph.", [], Tokenizer.A_IND_T), + assert tokens._blocks == [ + (BlockTyp.HEAD1, 1, "Title One", [], BlockFmt.NONE), + (BlockTyp.HEAD3, 2, "Scene One", [], BlockFmt.NONE), + (BlockTyp.TEXT, 2, "First paragraph.", [], BlockFmt.NONE), + (BlockTyp.TEXT, 2, "Second paragraph.", [], BlockFmt.IND_T), ] assert tokens._noIndent is False @@ -1387,9 +1428,13 @@ def testFmtToken_TextIndent(mockGUI): "%Synopsis: Stuff happens.\n\n" ) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD3, 1, "Scene Two", [], Tokenizer.A_NONE), - (Tokenizer.T_SYNOPSIS, 1, "Stuff happens.", [], Tokenizer.A_NONE), + tFmt = [ + (0, TextFmt.B_B, ""), (0, TextFmt.COL_B, "modifier"), (9, TextFmt.B_E, ""), + (9, TextFmt.COL_E, ""), (10, TextFmt.COL_B, "synopsis"), (24, TextFmt.COL_E, ""), + ] + assert tokens._blocks == [ + (BlockTyp.HEAD3, 1, "Scene Two", [], BlockFmt.NONE), + (BlockTyp.COMMENT, 1, "Synopsis: Stuff happens.", tFmt, BlockFmt.NONE), ] assert tokens._noIndent is True @@ -1400,9 +1445,9 @@ def testFmtToken_TextIndent(mockGUI): "Second paragraph.\n\n" ) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_TEXT, 0, "First paragraph.", [], Tokenizer.A_NONE), - (Tokenizer.T_TEXT, 0, "Second paragraph.", [], Tokenizer.A_IND_T), + assert tokens._blocks == [ + (BlockTyp.TEXT, 0, "First paragraph.", [], BlockFmt.NONE), + (BlockTyp.TEXT, 0, "Second paragraph.", [], BlockFmt.IND_T), ] assert tokens._noIndent is False @@ -1423,11 +1468,11 @@ def testFmtToken_TextIndent(mockGUI): "Second paragraph.\n\n" ) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD1, 1, "Title One", [], Tokenizer.A_NONE), - (Tokenizer.T_HEAD3, 2, "Scene One", [], Tokenizer.A_NONE), - (Tokenizer.T_TEXT, 2, "First paragraph.", [], Tokenizer.A_IND_T), - (Tokenizer.T_TEXT, 2, "Second paragraph.", [], Tokenizer.A_IND_T), + assert tokens._blocks == [ + (BlockTyp.HEAD1, 1, "Title One", [], BlockFmt.NONE), + (BlockTyp.HEAD3, 2, "Scene One", [], BlockFmt.NONE), + (BlockTyp.TEXT, 2, "First paragraph.", [], BlockFmt.IND_T), + (BlockTyp.TEXT, 2, "Second paragraph.", [], BlockFmt.IND_T), ] assert tokens._noIndent is False @@ -1449,8 +1494,8 @@ def testFmtToken_ProcessHeaders(mockGUI): tokens._text = "# Part One\n" tokens.setPartitionFormat(f"T: {nwHeadFmt.TITLE}") tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD1, 1, "T: Part One", [], Tokenizer.A_CENTRE), + assert tokens._blocks == [ + (BlockTyp.HEAD1, 1, "T: Part One", [], BlockFmt.CENTRE), ] # H1: Title, Not First Page @@ -1458,8 +1503,8 @@ def testFmtToken_ProcessHeaders(mockGUI): tokens._text = "# Part One\n" tokens.setPartitionFormat(f"T: {nwHeadFmt.TITLE}") tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD1, 1, "T: Part One", [], Tokenizer.A_PBB | Tokenizer.A_CENTRE), + assert tokens._blocks == [ + (BlockTyp.HEAD1, 1, "T: Part One", [], BlockFmt.PBB | BlockFmt.CENTRE), ] # Chapters @@ -1469,16 +1514,16 @@ def testFmtToken_ProcessHeaders(mockGUI): tokens._text = "## Chapter One\n" tokens.setChapterFormat(f"C: {nwHeadFmt.TITLE}") tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD2, 1, "C: Chapter One", [], Tokenizer.A_PBB), + assert tokens._blocks == [ + (BlockTyp.HEAD2, 1, "C: Chapter One", [], BlockFmt.PBB), ] # H2: Unnumbered Chapter tokens._text = "##! Prologue\n" tokens.setUnNumberedFormat(f"U: {nwHeadFmt.TITLE}") tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD2, 1, "U: Prologue", [], Tokenizer.A_PBB), + assert tokens._blocks == [ + (BlockTyp.HEAD2, 1, "U: Prologue", [], BlockFmt.PBB), ] # H2: Chapter Word Number @@ -1486,24 +1531,24 @@ def testFmtToken_ProcessHeaders(mockGUI): tokens.setChapterFormat(f"Chapter {nwHeadFmt.CH_WORD}") tokens._hFormatter._chCount = 0 tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD2, 1, "Chapter One", [], Tokenizer.A_PBB), + assert tokens._blocks == [ + (BlockTyp.HEAD2, 1, "Chapter One", [], BlockFmt.PBB), ] # H2: Chapter Roman Number Upper Case tokens._text = "## Chapter\n" tokens.setChapterFormat(f"Chapter {nwHeadFmt.CH_ROMU}") tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD2, 1, "Chapter II", [], Tokenizer.A_PBB), + assert tokens._blocks == [ + (BlockTyp.HEAD2, 1, "Chapter II", [], BlockFmt.PBB), ] # H2: Chapter Roman Number Lower Case tokens._text = "## Chapter\n" tokens.setChapterFormat(f"Chapter {nwHeadFmt.CH_ROML}") tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD2, 1, "Chapter iii", [], Tokenizer.A_PBB), + assert tokens._blocks == [ + (BlockTyp.HEAD2, 1, "Chapter iii", [], BlockFmt.PBB), ] # Scenes @@ -1513,30 +1558,30 @@ def testFmtToken_ProcessHeaders(mockGUI): tokens._text = "### Scene One\n" tokens.setSceneFormat(f"S: {nwHeadFmt.TITLE}", False) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD3, 1, "S: Scene One", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.HEAD3, 1, "S: Scene One", [], BlockFmt.NONE), ] # H3: Scene Hidden wo/Format tokens._text = "### Scene One\n" tokens.setSceneFormat("", True) tokens.tokenizeText() - assert tokens._tokens == [] + assert tokens._blocks == [] # H3: Scene wo/Format, first tokens._text = "### Scene One\n" tokens.setSceneFormat("", False) tokens._noSep = True tokens.tokenizeText() - assert tokens._tokens == [] + assert tokens._blocks == [] # H3: Scene wo/Format, not first tokens._text = "### Scene One\n" tokens.setSceneFormat("", False) tokens._noSep = False tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_SKIP, 1, "", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.SKIP, 1, "", [], BlockFmt.NONE), ] # H3: Scene Separator, first @@ -1544,15 +1589,15 @@ def testFmtToken_ProcessHeaders(mockGUI): tokens.setSceneFormat("* * *", False) tokens._noSep = True tokens.tokenizeText() - assert tokens._tokens == [] + assert tokens._blocks == [] # H3: Scene Separator, not first tokens._text = "### Scene One\n" tokens.setSceneFormat("* * *", False) tokens._noSep = False tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_SEP, 1, "* * *", [], Tokenizer.A_CENTRE), + assert tokens._blocks == [ + (BlockTyp.SEP, 1, "* * *", [], BlockFmt.CENTRE), ] # H3: Scene w/Absolute Number @@ -1561,8 +1606,8 @@ def testFmtToken_ProcessHeaders(mockGUI): tokens._hFormatter._scAbsCount = 0 tokens._hFormatter._scChCount = 0 tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD3, 1, "Scene 1", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.HEAD3, 1, "Scene 1", [], BlockFmt.NONE), ] # H3: Scene w/Chapter Number @@ -1571,8 +1616,8 @@ def testFmtToken_ProcessHeaders(mockGUI): tokens._hFormatter._scAbsCount = 0 tokens._hFormatter._scChCount = 1 tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD3, 1, "Scene 3.2", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.HEAD3, 1, "Scene 3.2", [], BlockFmt.NONE), ] # Sections @@ -1582,30 +1627,30 @@ def testFmtToken_ProcessHeaders(mockGUI): tokens._text = "#### A Section\n" tokens.setSectionFormat("", True) tokens.tokenizeText() - assert tokens._tokens == [] + assert tokens._blocks == [] # H4: Section Visible wo/Format tokens._text = "#### A Section\n" tokens.setSectionFormat("", False) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_SKIP, 1, "", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.SKIP, 1, "", [], BlockFmt.NONE), ] # H4: Section w/Format tokens._text = "#### A Section\n" tokens.setSectionFormat(f"X: {nwHeadFmt.TITLE}", False) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_HEAD4, 1, "X: A Section", [], Tokenizer.A_NONE), + assert tokens._blocks == [ + (BlockTyp.HEAD4, 1, "X: A Section", [], BlockFmt.NONE), ] # H4: Section Separator tokens._text = "#### A Section\n" tokens.setSectionFormat("* * *", False) tokens.tokenizeText() - assert tokens._tokens == [ - (Tokenizer.T_SEP, 1, "* * *", [], Tokenizer.A_CENTRE), + assert tokens._blocks == [ + (BlockTyp.SEP, 1, "* * *", [], BlockFmt.CENTRE), ] # Check the first scene detector, plain text @@ -1621,6 +1666,65 @@ def testFmtToken_ProcessHeaders(mockGUI): assert tokens._noSep is False +@pytest.mark.core +def testFmtToken_FormatComment(mockGUI): + """Test note and comment formatting.""" + project = NWProject() + project.data.setLanguage("en") + project._loadProjectLocalisation() + tokens = BareTokenizer(project) + + # Comment, No Formatting + style = COMMENT_STYLE[nwComment.PLAIN] + assert tokens._formatComment(style, "", "Hello world!") == ( + "Comment: Hello world!", [ + (0, TextFmt.B_B, ""), (0, TextFmt.COL_B, "comment"), + (8, TextFmt.B_E, ""), (8, TextFmt.COL_E, ""), + (9, TextFmt.COL_B, "comment"), (21, TextFmt.COL_E, ""), + ] + ) + + # Synopsis, No Formatting + style = COMMENT_STYLE[nwComment.SYNOPSIS] + assert tokens._formatComment(style, "", "Hello world!") == ( + "Synopsis: Hello world!", [ + (0, TextFmt.B_B, ""), (0, TextFmt.COL_B, "modifier"), + (9, TextFmt.B_E, ""), (9, TextFmt.COL_E, ""), + (10, TextFmt.COL_B, "synopsis"), (22, TextFmt.COL_E, ""), + ] + ) + + +@pytest.mark.core +def testFmtToken_FormatMeta(mockGUI): + """Test meta formatting.""" + project = NWProject() + project.data.setLanguage("en") + project._loadProjectLocalisation() + tokens = BareTokenizer(project) + + assert tokens._formatMeta("@tag: Jane | Jane Smith") == ( + "Tag: Jane | Jane Smith", [ + (0, TextFmt.B_B, ""), (0, TextFmt.COL_B, "keyword"), + (4, TextFmt.B_E, ""), (4, TextFmt.COL_E, ""), + (5, TextFmt.COL_B, "tag"), (5, TextFmt.ANM_B, "tag_jane"), + (9, TextFmt.ANM_E, ""), (9, TextFmt.COL_E, ""), + (12, TextFmt.COL_B, "optional"), (22, TextFmt.COL_E, ""), + ] + ) + + assert tokens._formatMeta("@char: Jane, John") == ( + "Characters: Jane, John", [ + (0, TextFmt.B_B, ""), (0, TextFmt.COL_B, "keyword"), + (11, TextFmt.B_E, ""), (11, TextFmt.COL_E, ""), + (12, TextFmt.COL_B, "tag"), (12, TextFmt.HRF_B, "#tag_jane"), + (16, TextFmt.HRF_E, ""), (16, TextFmt.COL_E, ""), + (18, TextFmt.COL_B, "tag"), (18, TextFmt.HRF_B, "#tag_john"), + (22, TextFmt.HRF_E, ""), (22, TextFmt.COL_E, ""), + ] + ) + + @pytest.mark.core def testFmtToken_BuildOutline(mockGUI, ipsumText): """Test stats counter of the Tokenizer class.""" @@ -1702,7 +1806,7 @@ def testFmtToken_CountStats(mockGUI, ipsumText): tokens._counts = {} tokens.tokenizeText() tokens.countStats() - assert tokens._tokens[0][2] == "A Chapter Title" + assert tokens._blocks[0][2] == "A Chapter Title" assert tokens.textStats == { "titleCount": 1, "paragraphCount": 0, "allWords": 3, "textWords": 0, "titleWords": 3, @@ -1717,7 +1821,7 @@ def testFmtToken_CountStats(mockGUI, ipsumText): tokens._hFormatter.resetAll() tokens.tokenizeText() tokens.countStats() - assert tokens._tokens[0][2] == "C 1: A Chapter Title" + assert tokens._blocks[0][2] == "C 1: A Chapter Title" assert tokens.textStats == { "titleCount": 1, "paragraphCount": 0, "allWords": 5, "textWords": 0, "titleWords": 5, @@ -1745,7 +1849,7 @@ def testFmtToken_CountStats(mockGUI, ipsumText): tokens.setSceneFormat("* * *", False) tokens.tokenizeText() tokens.countStats() - assert [t[2] for t in tokens._tokens] == ["Chapter", "Text", "* * *", "Text"] + assert [t[2] for t in tokens._blocks] == ["Chapter", "Text", "* * *", "Text"] assert tokens.textStats == { "titleCount": 1, "paragraphCount": 2, "allWords": 6, "textWords": 2, "titleWords": 1, @@ -1762,7 +1866,7 @@ def testFmtToken_CountStats(mockGUI, ipsumText): tokens.setSynopsis(True) tokens.tokenizeText() tokens.countStats() - assert [t[2] for t in tokens._tokens] == ["Chapter", "Stuff", "Text"] + assert [t[2] for t in tokens._blocks] == ["Chapter", "Synopsis: Stuff", "Text"] assert tokens.textStats == { "titleCount": 1, "paragraphCount": 1, "allWords": 4, "textWords": 1, "titleWords": 1, @@ -1779,7 +1883,7 @@ def testFmtToken_CountStats(mockGUI, ipsumText): tokens.setSynopsis(True) tokens.tokenizeText() tokens.countStats() - assert [t[2] for t in tokens._tokens] == ["Chapter", "Stuff", "Text"] + assert [t[2] for t in tokens._blocks] == ["Chapter", "Short Description: Stuff", "Text"] assert tokens.textStats == { "titleCount": 1, "paragraphCount": 1, "allWords": 5, "textWords": 1, "titleWords": 1, @@ -1796,7 +1900,7 @@ def testFmtToken_CountStats(mockGUI, ipsumText): tokens.setComments(True) tokens.tokenizeText() tokens.countStats() - assert [t[2] for t in tokens._tokens] == ["Chapter", "Stuff", "Text"] + assert [t[2] for t in tokens._blocks] == ["Chapter", "Comment: Stuff", "Text"] assert tokens.textStats == { "titleCount": 1, "paragraphCount": 1, "allWords": 4, "textWords": 1, "titleWords": 1, @@ -1813,7 +1917,7 @@ def testFmtToken_CountStats(mockGUI, ipsumText): tokens.setKeywords(True) tokens.tokenizeText() tokens.countStats() - assert [t[2] for t in tokens._tokens] == ["Chapter", "pov: Jane", "Text"] + assert [t[2] for t in tokens._blocks] == ["Chapter", "Point of View: Jane", "Text"] assert tokens.textStats == { "titleCount": 1, "paragraphCount": 1, "allWords": 6, "textWords": 1, "titleWords": 1, diff --git a/tests/test_formats/test_fmt_tomarkdown.py b/tests/test_formats/test_fmt_tomarkdown.py index 177a2b5b6..6d9a2e35b 100644 --- a/tests/test_formats/test_fmt_tomarkdown.py +++ b/tests/test_formats/test_fmt_tomarkdown.py @@ -23,6 +23,7 @@ import pytest from novelwriter.core.project import NWProject +from novelwriter.formats.shared import BlockFmt, BlockTyp from novelwriter.formats.tomarkdown import ToMarkdown @@ -219,8 +220,8 @@ def testFmtToMarkdown_ConvertDirect(mockGUI): # ============== # Title - toMD._tokens = [ - (toMD.T_TITLE, 1, "A Title", [], toMD.A_PBB | toMD.A_CENTRE), + toMD._blocks = [ + (BlockTyp.TITLE, 1, "A Title", [], BlockFmt.PBB | BlockFmt.CENTRE), ] toMD.doConvert() assert toMD.result == "# A Title\n\n" @@ -229,15 +230,15 @@ def testFmtToMarkdown_ConvertDirect(mockGUI): # ========== # Separator - toMD._tokens = [ - (toMD.T_SEP, 1, "* * *", [], toMD.A_CENTRE), + toMD._blocks = [ + (BlockTyp.SEP, 1, "* * *", [], BlockFmt.CENTRE), ] toMD.doConvert() assert toMD.result == "* * *\n\n" # Skip - toMD._tokens = [ - (toMD.T_SKIP, 1, "", [], toMD.A_NONE), + toMD._blocks = [ + (BlockTyp.SKIP, 1, "", [], BlockFmt.NONE), ] toMD.doConvert() assert toMD.result == "\n\n" @@ -292,15 +293,3 @@ def testFmtToMarkdown_Save(mockGUI, fncPath): saveFile = fncPath / "outFile.md" toMD.saveDocument(saveFile) assert saveFile.read_text(encoding="utf-8") == "".join(resText) - - -@pytest.mark.core -def testFmtToMarkdown_Format(mockGUI): - """Test all the formatters for the ToMarkdown class.""" - project = NWProject() - toMD = ToMarkdown(project, False) - - assert toMD._formatKeywords("", toMD.A_NONE) == "" - assert toMD._formatKeywords("tag: Jane", toMD.A_NONE) == "**Tag:** Jane\n\n" - assert toMD._formatKeywords("tag: Jane, John", toMD.A_NONE) == "**Tag:** Jane, John\n\n" - assert toMD._formatKeywords("tag: Jane", toMD.A_Z_BTMMRG) == "**Tag:** Jane \n" diff --git a/tests/test_formats/test_fmt_toodt.py b/tests/test_formats/test_fmt_toodt.py index dda51c0fb..ba7946b66 100644 --- a/tests/test_formats/test_fmt_toodt.py +++ b/tests/test_formats/test_fmt_toodt.py @@ -27,9 +27,12 @@ import pytest +from PyQt5.QtGui import QColor + from novelwriter.common import xmlIndent from novelwriter.constants import nwHeadFmt from novelwriter.core.project import NWProject +from novelwriter.formats.shared import BlockFmt, BlockTyp, TextFmt from novelwriter.formats.toodt import ODTParagraphStyle, ODTTextStyle, ToOdt, XMLParagraph, _mkTag from tests.tools import ODT_IGNORE, cmpFiles @@ -183,7 +186,7 @@ def testFmtToOdt_TextFormatting(mockGUI): # Formatted Text text = "A bold word" - fmt = [(2, odt.FMT_B_B, ""), (6, odt.FMT_B_E, "")] + fmt = [(2, TextFmt.B_B, ""), (6, TextFmt.B_E, "")] xTest = ET.Element(_mkTag("office", "text")) odt._addTextPar(xTest, "Standard", oStyle, text, tFmt=fmt) assert odt.errData == [] @@ -196,10 +199,9 @@ def testFmtToOdt_TextFormatting(mockGUI): # Incorrectly Formatted Text text = "A few words" - fmt = [(2, odt.FMT_B_B, ""), (5, odt.FMT_B_E, ""), (7, 99999, "")] + fmt = [(2, TextFmt.B_B, ""), (5, TextFmt.B_E, ""), (7, 99999, "")] xTest = ET.Element(_mkTag("office", "text")) odt._addTextPar(xTest, "Standard", oStyle, text, tFmt=fmt) - assert odt.errData == ["Unknown format tag encountered"] assert xmlToText(xTest) == ( '' 'A few ' @@ -210,7 +212,7 @@ def testFmtToOdt_TextFormatting(mockGUI): # Unclosed format text = "A bold word" - fmt = [(2, odt.FMT_B_B, "")] + fmt = [(2, TextFmt.B_B, "")] xTest = ET.Element(_mkTag("office", "text")) odt._addTextPar(xTest, "Standard", oStyle, text, tFmt=fmt) assert odt.errData == [] @@ -245,7 +247,7 @@ def testFmtToOdt_DialogueFormatting(mockGUI): # Regular dialogue text = "Text with 'dialogue in it.'" - fmt = [(10, odt.FMT_DL_B, ""), (27, odt.FMT_DL_E, "")] + fmt = [(10, TextFmt.COL_B, "dialog"), (27, TextFmt.COL_E, "")] xTest = ET.Element(_mkTag("office", "text")) odt._addTextPar(xTest, "Standard", oStyle, text, tFmt=fmt) assert odt.errData == [] @@ -258,7 +260,7 @@ def testFmtToOdt_DialogueFormatting(mockGUI): # Alternative dialogue text = "Text with ::dialogue in it.::" - fmt = [(10, odt.FMT_ADL_B, ""), (29, odt.FMT_ADL_E, "")] + fmt = [(10, TextFmt.COL_B, "altdialog"), (29, TextFmt.COL_E, "")] xTest = ET.Element(_mkTag("office", "text")) odt._addTextPar(xTest, "Standard", oStyle, text, tFmt=fmt) assert odt.errData == [] @@ -518,14 +520,17 @@ def getStyle(styleName): assert xmlToText(odt._xText) == ( '' 'Scene' - '' - 'Point of View: Jane' - '' - 'Synopsis: So it begins' - '' - 'Short Description: Then what' - '' - 'Comment: A plain comment' + '' + 'Point of View: Jane' + '' + 'Synopsis: ' + 'So it begins' + '' + 'Short Description: ' + 'Then what' + '' + 'Comment: ' + 'A plain comment' '' ) @@ -585,12 +590,12 @@ def getStyle(styleName): assert xmlToText(odt._xText) == ( '' 'Scene' - '' - 'Point of View: Jane' - '' - 'Characters: John' - '' - 'Plot: Main' + '' + 'Point of View: Jane' + '' + 'Characters: John' + '' + 'Plot: Main' 'Right align' 'Left Align' 'Centered' @@ -618,16 +623,17 @@ def getStyle(styleName): odt.initDocument() odt.doConvert() odt.closeDocument() + odt.setJustify(False) assert odt.errData == [] assert xmlToText(odt._xText) == ( '' 'Scene' - 'Regular paragraph' - 'withbreak' - 'Left Align' + 'Regular paragraph' + 'withbreak' + 'Left Align' '' ) - assert getStyle("P7")._pAttr["text-align"] == ["fo", "left"] # type: ignore + assert getStyle("P7")._pAttr["text-align"] == ["fo", "justify"] # type: ignore # Page Breaks odt._text = ( @@ -699,7 +705,7 @@ def getStyle(styleName): assert odt.errData == [] assert xmlToText(odt._xText) == ( '' - 'Test text **' + 'Test text **' 'bold** and more.' '' ) @@ -717,8 +723,8 @@ def testFmtToOdt_ConvertDirect(mockGUI): # Justified doc = ToOdt(project, isFlat=True) - doc._tokens = [ - (doc.T_TEXT, 1, "This is a paragraph", [], doc.A_JUSTIFY), + doc._blocks = [ + (BlockTyp.TEXT, 1, "This is a paragraph", [], BlockFmt.JUSTIFY), ] doc.initDocument() doc.doConvert() @@ -737,8 +743,8 @@ def testFmtToOdt_ConvertDirect(mockGUI): # Page Break After doc = ToOdt(project, isFlat=True) - doc._tokens = [ - (doc.T_TEXT, 1, "This is a paragraph", [], doc.A_PBA), + doc._blocks = [ + (BlockTyp.TEXT, 1, "This is a paragraph", [], BlockFmt.PBA), ] doc.initDocument() doc.doConvert() @@ -799,8 +805,8 @@ def testFmtToOdt_SaveFlat(mockGUI, fncPath, tstPaths): odt.closeDocument() flatFile = fncPath / "document.fodt" - testFile = tstPaths.outDir / "coreToOdt_SaveFlat_document.fodt" - compFile = tstPaths.refDir / "coreToOdt_SaveFlat_document.fodt" + testFile = tstPaths.outDir / "fmtToOdt_SaveFlat_document.fodt" + compFile = tstPaths.refDir / "fmtToOdt_SaveFlat_document.fodt" odt.saveDocument(flatFile) assert flatFile.exists() @@ -841,19 +847,19 @@ def testFmtToOdt_SaveFull(mockGUI, fncPath, tstPaths): assert fullFile.exists() assert zipfile.is_zipfile(fullFile) - maniFile = tstPaths.outDir / "coreToOdt_SaveFull_manifest.xml" - settFile = tstPaths.outDir / "coreToOdt_SaveFull_settings.xml" - contFile = tstPaths.outDir / "coreToOdt_SaveFull_content.xml" - metaFile = tstPaths.outDir / "coreToOdt_SaveFull_meta.xml" - stylFile = tstPaths.outDir / "coreToOdt_SaveFull_styles.xml" + maniFile = tstPaths.outDir / "fmtToOdt_SaveFull_manifest.xml" + settFile = tstPaths.outDir / "fmtToOdt_SaveFull_settings.xml" + contFile = tstPaths.outDir / "fmtToOdt_SaveFull_content.xml" + metaFile = tstPaths.outDir / "fmtToOdt_SaveFull_meta.xml" + stylFile = tstPaths.outDir / "fmtToOdt_SaveFull_styles.xml" - maniComp = tstPaths.refDir / "coreToOdt_SaveFull_manifest.xml" - settComp = tstPaths.refDir / "coreToOdt_SaveFull_settings.xml" - contComp = tstPaths.refDir / "coreToOdt_SaveFull_content.xml" - metaComp = tstPaths.refDir / "coreToOdt_SaveFull_meta.xml" - stylComp = tstPaths.refDir / "coreToOdt_SaveFull_styles.xml" + maniComp = tstPaths.refDir / "fmtToOdt_SaveFull_manifest.xml" + settComp = tstPaths.refDir / "fmtToOdt_SaveFull_settings.xml" + contComp = tstPaths.refDir / "fmtToOdt_SaveFull_content.xml" + metaComp = tstPaths.refDir / "fmtToOdt_SaveFull_meta.xml" + stylComp = tstPaths.refDir / "fmtToOdt_SaveFull_styles.xml" - extaxtTo = tstPaths.outDir / "coreToOdt_SaveFull" + extaxtTo = tstPaths.outDir / "fmtToOdt_SaveFull" with zipfile.ZipFile(fullFile, mode="r") as zipObj: zipObj.extract("META-INF/manifest.xml", extaxtTo) @@ -862,11 +868,11 @@ def testFmtToOdt_SaveFull(mockGUI, fncPath, tstPaths): zipObj.extract("meta.xml", extaxtTo) zipObj.extract("styles.xml", extaxtTo) - maniOut = tstPaths.outDir / "coreToOdt_SaveFull" / "META-INF" / "manifest.xml" - settOut = tstPaths.outDir / "coreToOdt_SaveFull" / "settings.xml" - contOut = tstPaths.outDir / "coreToOdt_SaveFull" / "content.xml" - metaOut = tstPaths.outDir / "coreToOdt_SaveFull" / "meta.xml" - stylOut = tstPaths.outDir / "coreToOdt_SaveFull" / "styles.xml" + maniOut = tstPaths.outDir / "fmtToOdt_SaveFull" / "META-INF" / "manifest.xml" + settOut = tstPaths.outDir / "fmtToOdt_SaveFull" / "settings.xml" + contOut = tstPaths.outDir / "fmtToOdt_SaveFull" / "content.xml" + metaOut = tstPaths.outDir / "fmtToOdt_SaveFull" / "meta.xml" + stylOut = tstPaths.outDir / "fmtToOdt_SaveFull" / "styles.xml" def prettifyXml(inFile, outFile): with open(outFile, mode="wb") as fStream: @@ -887,37 +893,6 @@ def prettifyXml(inFile, outFile): assert cmpFiles(stylFile, stylComp) -@pytest.mark.core -def testFmtToOdt_SpecialFormats(mockGUI): - """Test the special formatters for the ToOdt class.""" - project = NWProject() - odt = ToOdt(project, isFlat=True) - - assert odt._formatSynopsis("synopsis text", [(9, ToOdt.FMT_STRIP, "")], True) == ( - "Synopsis: synopsis text", [ - (0, ToOdt.FMT_B_B, ""), (9, ToOdt.FMT_B_E, ""), (19, ToOdt.FMT_STRIP, "") - ] - ) - assert odt._formatSynopsis("short text", [(6, ToOdt.FMT_STRIP, "")], False) == ( - "Short Description: short text", [ - (0, ToOdt.FMT_B_B, ""), (18, ToOdt.FMT_B_E, ""), (25, ToOdt.FMT_STRIP, "") - ] - ) - assert odt._formatComments("comment text", [(8, ToOdt.FMT_STRIP, "")]) == ( - "Comment: comment text", [ - (0, ToOdt.FMT_B_B, ""), (8, ToOdt.FMT_B_E, ""), (17, ToOdt.FMT_STRIP, "") - ] - ) - - assert odt._formatKeywords("") == ("", []) - assert odt._formatKeywords("tag: Jane") == ( - "Tag: Jane", [(0, ToOdt.FMT_B_B, ""), (4, ToOdt.FMT_B_E, "")] - ) - assert odt._formatKeywords("char: Bod, Jane") == ( - "Characters: Bod, Jane", [(0, ToOdt.FMT_B_B, ""), (11, ToOdt.FMT_B_E, "")] - ) - - @pytest.mark.core def testFmtToOdt_ODTParagraphStyle(): """Test the ODTParagraphStyle class.""" @@ -1104,11 +1079,15 @@ def testFmtToOdt_ODTParagraphStyle(): assert parStyle._tAttr["color"] == ["fo", None] assert parStyle._tAttr["opacity"] == ["loext", None] - parStyle.setColour("#000000") - parStyle.setOpacity("1.00") + parStyle.setColor(QColor(0, 0, 0, 128)) assert parStyle._tAttr["color"] == ["fo", "#000000"] - assert parStyle._tAttr["opacity"] == ["loext", "1.00"] + assert parStyle._tAttr["opacity"] == ["loext", "50%"] + + parStyle.setColor(None) + + assert parStyle._tAttr["color"] == ["fo", None] + assert parStyle._tAttr["opacity"] == ["loext", None] # Pack XML # ======== @@ -1122,27 +1101,11 @@ def testFmtToOdt_ODTParagraphStyle(): 'fo:margin-left="0.000cm" fo:margin-right="0.000cm" fo:text-indent="0.000cm" ' 'fo:line-height="1.15" />' '' + 'fo:font-size="12pt" />' '' '' ) - # Override Justify - # ================ - - aStyle = ODTParagraphStyle("test") - - # When not set, override is possible - assert aStyle._pAttr["text-align"][1] is None - aStyle.overrideJustify("left") - assert aStyle._pAttr["text-align"][1] == "left" - - # When explicitly set, not override - aStyle.setTextAlign("right") - assert aStyle._pAttr["text-align"][1] == "right" - aStyle.overrideJustify("left") - assert aStyle._pAttr["text-align"][1] == "right" - # Changes # ======= @@ -1165,8 +1128,8 @@ def testFmtToOdt_ODTParagraphStyle(): aStyle = ODTParagraphStyle("test") oStyle = ODTParagraphStyle("test") - aStyle.setColour("#000000") - oStyle.setColour("#111111") + aStyle.setColor(QColor(0, 0, 0)) + oStyle.setColor(QColor(42, 42, 42)) assert aStyle.checkNew(oStyle) is True assert aStyle.getID() != oStyle.getID() @@ -1220,24 +1183,20 @@ def testFmtToOdt_ODTTextStyle(): # Text Color assert txtStyle._tAttr["color"] == ["fo", None] - txtStyle.setColour("stuff") - assert txtStyle._tAttr["color"] == ["fo", None] - txtStyle.setColour("012345") + txtStyle.setColor("#012345") # type: ignore assert txtStyle._tAttr["color"] == ["fo", None] - txtStyle.setColour("#012345") - assert txtStyle._tAttr["color"] == ["fo", "#012345"] - txtStyle.setColour("stuff") + txtStyle.setColor(QColor(255, 128, 0)) + assert txtStyle._tAttr["color"] == ["fo", "#ff8000"] + txtStyle.setColor(None) assert txtStyle._tAttr["color"] == ["fo", None] # Background Color assert txtStyle._tAttr["background-color"] == ["fo", None] - txtStyle.setBackgroundColour("stuff") - assert txtStyle._tAttr["background-color"] == ["fo", None] - txtStyle.setBackgroundColour("012345") + txtStyle.setBackgroundColor("#012345") # type: ignore assert txtStyle._tAttr["background-color"] == ["fo", None] - txtStyle.setBackgroundColour("#012345") - assert txtStyle._tAttr["background-color"] == ["fo", "#012345"] - txtStyle.setBackgroundColour("stuff") + txtStyle.setBackgroundColor(QColor(255, 128, 0)) + assert txtStyle._tAttr["background-color"] == ["fo", "#ff8000"] + txtStyle.setBackgroundColor(None) assert txtStyle._tAttr["background-color"] == ["fo", None] # Text Position @@ -1297,11 +1256,11 @@ def testFmtToOdt_ODTTextStyle(): # Underline Colour assert txtStyle._tAttr["text-underline-color"] == ["style", None] - txtStyle.setUnderlineColour("stuff") + txtStyle.setUnderlineColor("stuff") assert txtStyle._tAttr["text-underline-color"] == ["style", None] - txtStyle.setUnderlineColour("font-color") + txtStyle.setUnderlineColor("font-color") assert txtStyle._tAttr["text-underline-color"] == ["style", "font-color"] - txtStyle.setUnderlineColour("stuff") + txtStyle.setUnderlineColor("stuff") assert txtStyle._tAttr["text-underline-color"] == ["style", None] # Pack XML diff --git a/tests/test_formats/test_fmt_toqdoc.py b/tests/test_formats/test_fmt_toqdoc.py index fc5170f46..48c3b6cb3 100644 --- a/tests/test_formats/test_fmt_toqdoc.py +++ b/tests/test_formats/test_fmt_toqdoc.py @@ -27,7 +27,8 @@ from novelwriter import CONFIG from novelwriter.constants import nwUnicode from novelwriter.core.project import NWProject -from novelwriter.formats.toqdoc import TextDocumentTheme, ToQTextDocument +from novelwriter.formats.shared import BlockFmt, BlockTyp, TextDocumentTheme +from novelwriter.formats.toqdoc import ToQTextDocument from novelwriter.types import ( QtAlignAbsolute, QtAlignCenter, QtAlignJustify, QtAlignLeft, QtAlignRight, QtPageBreakAfter, QtTransparent, QtVAlignNormal, QtVAlignSub, QtVAlignSuper @@ -47,76 +48,75 @@ def charFmtInBlock(block: QTextBlock, pos: int) -> QTextCharFormat: def testFmtToQTextDocument_ConvertHeaders(mockGUI): """Test header formats in the ToQTextDocument class.""" project = NWProject() - qdoc = ToQTextDocument(project) - qdoc.initDocument() - # qdoc.saveDocument("") # Doesn't do anything for this format + doc = ToQTextDocument(project) + doc.initDocument() - qdoc._isNovel = True - qdoc._isFirst = True - qdoc._text = ( + doc._isNovel = True + doc._isFirst = True + doc._text = ( "#! Title\n" "# Partition\n" "## Chapter\n" "### Scene\n" "#### Section\n" ) - qdoc.tokenizeText() - qdoc.doConvert() - assert qdoc.document.blockCount() == 5 + doc.tokenizeText() + doc.doConvert() + assert doc.document.blockCount() == 5 # Title - block = qdoc.document.findBlockByNumber(0) + block = doc.document.findBlockByNumber(0) assert block.text() == "Title" bFmt = block.blockFormat() - assert bFmt.topMargin() == qdoc._mHead[qdoc.T_TITLE][0] - assert bFmt.bottomMargin() == qdoc._mHead[qdoc.T_TITLE][1] + assert bFmt.topMargin() == doc._mHead[BlockTyp.TITLE][0] + assert bFmt.bottomMargin() == doc._mHead[BlockTyp.TITLE][1] cFmt = charFmtInBlock(block, 1) - assert cFmt.fontWeight() == qdoc._bold - assert cFmt.fontPointSize() == qdoc._sHead[qdoc.T_TITLE] + assert cFmt.fontWeight() == doc._bold + assert cFmt.fontPointSize() == doc._sHead[BlockTyp.TITLE] assert cFmt.foreground().color() == THEME.text # Partition - block = qdoc.document.findBlockByNumber(1) + block = doc.document.findBlockByNumber(1) assert block.text() == "Partition" bFmt = block.blockFormat() - assert bFmt.topMargin() == qdoc._mHead[qdoc.T_HEAD1][0] - assert bFmt.bottomMargin() == qdoc._mHead[qdoc.T_HEAD1][1] + assert bFmt.topMargin() == doc._mHead[BlockTyp.HEAD1][0] + assert bFmt.bottomMargin() == doc._mHead[BlockTyp.HEAD1][1] cFmt = charFmtInBlock(block, 1) - assert cFmt.fontWeight() == qdoc._bold - assert cFmt.fontPointSize() == qdoc._sHead[qdoc.T_HEAD1] + assert cFmt.fontWeight() == doc._bold + assert cFmt.fontPointSize() == doc._sHead[BlockTyp.HEAD1] assert cFmt.foreground().color() == THEME.head # Chapter - block = qdoc.document.findBlockByNumber(2) + block = doc.document.findBlockByNumber(2) assert block.text() == "Chapter" bFmt = block.blockFormat() - assert bFmt.topMargin() == qdoc._mHead[qdoc.T_HEAD2][0] - assert bFmt.bottomMargin() == qdoc._mHead[qdoc.T_HEAD2][1] + assert bFmt.topMargin() == doc._mHead[BlockTyp.HEAD2][0] + assert bFmt.bottomMargin() == doc._mHead[BlockTyp.HEAD2][1] cFmt = charFmtInBlock(block, 1) - assert cFmt.fontWeight() == qdoc._bold - assert cFmt.fontPointSize() == qdoc._sHead[qdoc.T_HEAD2] + assert cFmt.fontWeight() == doc._bold + assert cFmt.fontPointSize() == doc._sHead[BlockTyp.HEAD2] assert cFmt.foreground().color() == THEME.head # Scene - block = qdoc.document.findBlockByNumber(3) + block = doc.document.findBlockByNumber(3) assert block.text() == "Scene" bFmt = block.blockFormat() - assert bFmt.topMargin() == qdoc._mHead[qdoc.T_HEAD3][0] - assert bFmt.bottomMargin() == qdoc._mHead[qdoc.T_HEAD3][1] + assert bFmt.topMargin() == doc._mHead[BlockTyp.HEAD3][0] + assert bFmt.bottomMargin() == doc._mHead[BlockTyp.HEAD3][1] cFmt = charFmtInBlock(block, 1) - assert cFmt.fontWeight() == qdoc._bold - assert cFmt.fontPointSize() == qdoc._sHead[qdoc.T_HEAD3] + assert cFmt.fontWeight() == doc._bold + assert cFmt.fontPointSize() == doc._sHead[BlockTyp.HEAD3] assert cFmt.foreground().color() == THEME.head # Section - block = qdoc.document.findBlockByNumber(4) + block = doc.document.findBlockByNumber(4) assert block.text() == "Section" bFmt = block.blockFormat() - assert bFmt.topMargin() == qdoc._mHead[qdoc.T_HEAD4][0] - assert bFmt.bottomMargin() == qdoc._mHead[qdoc.T_HEAD4][1] + assert bFmt.topMargin() == doc._mHead[BlockTyp.HEAD4][0] + assert bFmt.bottomMargin() == doc._mHead[BlockTyp.HEAD4][1] cFmt = charFmtInBlock(block, 1) - assert cFmt.fontWeight() == qdoc._bold - assert cFmt.fontPointSize() == qdoc._sHead[qdoc.T_HEAD4] + assert cFmt.fontWeight() == doc._bold + assert cFmt.fontPointSize() == doc._sHead[BlockTyp.HEAD4] assert cFmt.foreground().color() == THEME.head @@ -124,12 +124,12 @@ def testFmtToQTextDocument_ConvertHeaders(mockGUI): def testFmtToQTextDocument_SeparatorSkip(mockGUI): """Test separator and skip in the ToQTextDocument class.""" project = NWProject() - qdoc = ToQTextDocument(project) - qdoc.initDocument() + doc = ToQTextDocument(project) + doc.initDocument() - qdoc._isNovel = True - qdoc._isFirst = True - qdoc._text = ( + doc._isNovel = True + doc._isFirst = True + doc._text = ( "#! Title\n" "## Chapter\n" "### Scene 1\n" @@ -139,50 +139,50 @@ def testFmtToQTextDocument_SeparatorSkip(mockGUI): "#### Section\n" "Text 3\n" ) - qdoc.setSceneFormat("* * *", False) - qdoc.setSectionFormat("", False) - qdoc.tokenizeText() - qdoc.doConvert() - assert qdoc.document.blockCount() == 7 + doc.setSceneFormat("* * *", False) + doc.setSectionFormat("", False) + doc.tokenizeText() + doc.doConvert() + assert doc.document.blockCount() == 7 # 0: Title - block = qdoc.document.findBlockByNumber(0) + block = doc.document.findBlockByNumber(0) assert block.text() == "Title" # 1: Chapter - block = qdoc.document.findBlockByNumber(1) + block = doc.document.findBlockByNumber(1) assert block.text() == "Chapter" # Hidden: Scene 1 # 2: Text 1 - block = qdoc.document.findBlockByNumber(2) + block = doc.document.findBlockByNumber(2) assert block.text() == "Text 1" # 3: Scene 2 - block = qdoc.document.findBlockByNumber(3) + block = doc.document.findBlockByNumber(3) assert block.text() == "* * *" bFmt = block.blockFormat() - assert bFmt.topMargin() == qdoc._mSep[0] - assert bFmt.bottomMargin() == qdoc._mSep[1] + assert bFmt.topMargin() == doc._mSep[0] + assert bFmt.bottomMargin() == doc._mSep[1] cFmt = charFmtInBlock(block, 1) assert cFmt.foreground().color() == THEME.text # 4: Text 2 - block = qdoc.document.findBlockByNumber(4) + block = doc.document.findBlockByNumber(4) assert block.text() == "Text 2" # 5: Section - block = qdoc.document.findBlockByNumber(5) + block = doc.document.findBlockByNumber(5) assert block.text() == nwUnicode.U_NBSP bFmt = block.blockFormat() - assert bFmt.topMargin() == qdoc._mText[0] - assert bFmt.bottomMargin() == qdoc._mText[1] + assert bFmt.topMargin() == doc._mText[0] + assert bFmt.bottomMargin() == doc._mText[1] cFmt = charFmtInBlock(block, 1) assert cFmt.foreground().color() == THEME.text # 6: Text 3 - block = qdoc.document.findBlockByNumber(6) + block = doc.document.findBlockByNumber(6) assert block.text() == "Text 3" @@ -190,15 +190,15 @@ def testFmtToQTextDocument_SeparatorSkip(mockGUI): def testFmtToQTextDocument_NovelMeta(mockGUI): """Test novel meta formats in the ToQTextDocument class.""" project = NWProject() - qdoc = ToQTextDocument(project) - qdoc.initDocument() - - qdoc._isNovel = True - qdoc._isFirst = True - qdoc.setComments(True) - qdoc.setSynopsis(True) - qdoc.setKeywords(True) - qdoc._text = ( + doc = ToQTextDocument(project) + doc.initDocument() + + doc._isNovel = True + doc._isFirst = True + doc.setComments(True) + doc.setSynopsis(True) + doc.setKeywords(True) + doc._text = ( "### Scene\n\n" "@pov: Jane\n" "@char: John, Bob\n\n" @@ -206,19 +206,19 @@ def testFmtToQTextDocument_NovelMeta(mockGUI): "% A regular comment\n\n" "Text\n\n" ) - qdoc.tokenizeText() - qdoc.doConvert() - assert qdoc.document.blockCount() == 6 + doc.tokenizeText() + doc.doConvert() + assert doc.document.blockCount() == 6 # 0: Scene - block = qdoc.document.findBlockByNumber(0) + block = doc.document.findBlockByNumber(0) assert block.text() == "Scene" # 1: Jane - block = qdoc.document.findBlockByNumber(1) + block = doc.document.findBlockByNumber(1) assert block.text() == "Point of View: Jane" bFmt = block.blockFormat() - assert bFmt.topMargin() == qdoc._mMeta[0] + assert bFmt.topMargin() == doc._mMeta[0] assert bFmt.bottomMargin() == 0.0 cFmt = charFmtInBlock(block, 1) assert cFmt.foreground().color() == THEME.keyword @@ -226,40 +226,40 @@ def testFmtToQTextDocument_NovelMeta(mockGUI): assert cFmt.foreground().color() == THEME.tag # 2: John, Bob - block = qdoc.document.findBlockByNumber(2) + block = doc.document.findBlockByNumber(2) assert block.text() == "Characters: John, Bob" bFmt = block.blockFormat() assert bFmt.topMargin() == 0.0 - assert bFmt.bottomMargin() == qdoc._mMeta[1] + assert bFmt.bottomMargin() == doc._mMeta[1] cFmt = charFmtInBlock(block, 1) assert cFmt.foreground().color() == THEME.keyword cFmt = charFmtInBlock(block, 13) assert cFmt.foreground().color() == THEME.tag # 3: Synopsis - block = qdoc.document.findBlockByNumber(3) + block = doc.document.findBlockByNumber(3) assert block.text() == "Synopsis: Stuff that happened" bFmt = block.blockFormat() - assert bFmt.topMargin() == qdoc._mText[0] - assert bFmt.bottomMargin() == qdoc._mText[1] + assert bFmt.topMargin() == doc._mText[0] + assert bFmt.bottomMargin() == doc._mText[1] cFmt = charFmtInBlock(block, 1) assert cFmt.foreground().color() == THEME.modifier cFmt = charFmtInBlock(block, 11) assert cFmt.foreground().color() == THEME.note # 4: Comment - block = qdoc.document.findBlockByNumber(4) + block = doc.document.findBlockByNumber(4) assert block.text() == "Comment: A regular comment" bFmt = block.blockFormat() - assert bFmt.topMargin() == qdoc._mText[0] - assert bFmt.bottomMargin() == qdoc._mText[1] + assert bFmt.topMargin() == doc._mText[0] + assert bFmt.bottomMargin() == doc._mText[1] cFmt = charFmtInBlock(block, 1) assert cFmt.foreground().color() == THEME.comment cFmt = charFmtInBlock(block, 10) assert cFmt.foreground().color() == THEME.comment # 5: Text - block = qdoc.document.findBlockByNumber(5) + block = doc.document.findBlockByNumber(5) assert block.text() == "Text" @@ -267,34 +267,34 @@ def testFmtToQTextDocument_NovelMeta(mockGUI): def testFmtToQTextDocument_NoteMeta(mockGUI): """Test note meta formats in the ToQTextDocument class.""" project = NWProject() - qdoc = ToQTextDocument(project) - qdoc.initDocument() - - qdoc._isNovel = False - qdoc._isFirst = True - qdoc.setComments(True) - qdoc.setSynopsis(True) - qdoc.setKeywords(True) - qdoc._text = ( + doc = ToQTextDocument(project) + doc.initDocument() + + doc._isNovel = False + doc._isFirst = True + doc.setComments(True) + doc.setSynopsis(True) + doc.setKeywords(True) + doc._text = ( "# Jane Smith\n\n" "@tag: Jane | Jane Smith\n" "%Short: All about Jane\n\n" "Text\n\n" ) - qdoc.tokenizeText() - qdoc.doConvert() - assert qdoc.document.blockCount() == 4 + doc.tokenizeText() + doc.doConvert() + assert doc.document.blockCount() == 4 # 0: Title - block = qdoc.document.findBlockByNumber(0) + block = doc.document.findBlockByNumber(0) assert block.text() == "Jane Smith" # 1: Tag - block = qdoc.document.findBlockByNumber(1) + block = doc.document.findBlockByNumber(1) assert block.text() == "Tag: Jane | Jane Smith" bFmt = block.blockFormat() - assert bFmt.topMargin() == qdoc._mMeta[0] - assert bFmt.bottomMargin() == qdoc._mMeta[1] + assert bFmt.topMargin() == doc._mMeta[0] + assert bFmt.bottomMargin() == doc._mMeta[1] cFmt = charFmtInBlock(block, 1) assert cFmt.foreground().color() == THEME.keyword cFmt = charFmtInBlock(block, 6) @@ -305,18 +305,18 @@ def testFmtToQTextDocument_NoteMeta(mockGUI): assert cFmt.foreground().color() == THEME.optional # 2: Short - block = qdoc.document.findBlockByNumber(2) + block = doc.document.findBlockByNumber(2) assert block.text() == "Short Description: All about Jane" bFmt = block.blockFormat() - assert bFmt.topMargin() == qdoc._mText[0] - assert bFmt.bottomMargin() == qdoc._mText[1] + assert bFmt.topMargin() == doc._mText[0] + assert bFmt.bottomMargin() == doc._mText[1] cFmt = charFmtInBlock(block, 1) assert cFmt.foreground().color() == THEME.modifier cFmt = charFmtInBlock(block, 20) assert cFmt.foreground().color() == THEME.note # 3: Text - block = qdoc.document.findBlockByNumber(3) + block = doc.document.findBlockByNumber(3) assert block.text() == "Text" @@ -324,18 +324,18 @@ def testFmtToQTextDocument_NoteMeta(mockGUI): def testFmtToQTextDocument_TextBlockFormats(mockGUI): """Test text block formats in the ToQTextDocument class.""" project = NWProject() - qdoc = ToQTextDocument(project) - qdoc.setFirstLineIndent(True, 2.0, False) - qdoc.initDocument() + doc = ToQTextDocument(project) + doc.setFirstLineIndent(True, 2.0, False) + doc.initDocument() - qdoc._isNovel = True - qdoc._isFirst = True + doc._isNovel = True + doc._isFirst = True # Alignment & Indent # ================== - qdoc.document.clear() + doc.document.clear() - qdoc._text = ( + doc._text = ( "### Scene\n\n" "Left <<\n\n" ">> Center <<\n\n" @@ -345,85 +345,85 @@ def testFmtToQTextDocument_TextBlockFormats(mockGUI): "> Double Indent <\n\n" "Text Indent\n\n" ) - qdoc.tokenizeText() - qdoc.doConvert() - assert qdoc.document.blockCount() == 8 + doc.tokenizeText() + doc.doConvert() + assert doc.document.blockCount() == 8 # 0: Scene - block = qdoc.document.findBlockByNumber(0) + block = doc.document.findBlockByNumber(0) assert block.text() == "Scene" # 1: Left - block = qdoc.document.findBlockByNumber(1) + block = doc.document.findBlockByNumber(1) assert block.text() == "Left" bFmt = block.blockFormat() assert bFmt.alignment() == QtAlignLeft # 2: Center - block = qdoc.document.findBlockByNumber(2) + block = doc.document.findBlockByNumber(2) assert block.text() == "Center" bFmt = block.blockFormat() assert bFmt.alignment() == QtAlignCenter # 3: Right - block = qdoc.document.findBlockByNumber(3) + block = doc.document.findBlockByNumber(3) assert block.text() == "Right" bFmt = block.blockFormat() assert bFmt.alignment() == QtAlignRight # 4: Left Indent - block = qdoc.document.findBlockByNumber(4) + block = doc.document.findBlockByNumber(4) assert block.text() == "Left Indent" bFmt = block.blockFormat() assert bFmt.alignment() == QtAlignAbsolute - assert bFmt.leftMargin() == qdoc._mIndent + assert bFmt.leftMargin() == doc._mIndent assert bFmt.rightMargin() == 0.0 # 5: Right Indent - block = qdoc.document.findBlockByNumber(5) + block = doc.document.findBlockByNumber(5) assert block.text() == "Right Indent" bFmt = block.blockFormat() assert bFmt.alignment() == QtAlignAbsolute assert bFmt.leftMargin() == 0.0 - assert bFmt.rightMargin() == qdoc._mIndent + assert bFmt.rightMargin() == doc._mIndent # 6: Double Indent - block = qdoc.document.findBlockByNumber(6) + block = doc.document.findBlockByNumber(6) assert block.text() == "Double Indent" bFmt = block.blockFormat() assert bFmt.alignment() == QtAlignAbsolute - assert bFmt.leftMargin() == qdoc._mIndent - assert bFmt.rightMargin() == qdoc._mIndent + assert bFmt.leftMargin() == doc._mIndent + assert bFmt.rightMargin() == doc._mIndent # 7: Text Indent - block = qdoc.document.findBlockByNumber(7) + block = doc.document.findBlockByNumber(7) assert block.text() == "Text Indent" bFmt = block.blockFormat() assert bFmt.alignment() == QtAlignAbsolute - assert bFmt.textIndent() == qdoc._tIndent + assert bFmt.textIndent() == doc._tIndent assert bFmt.leftMargin() == 0.0 assert bFmt.rightMargin() == 0.0 # Unreachable # =========== # Some formatting markers are currently not reachable - qdoc.document.clear() + doc.document.clear() - qdoc._tokens = [ - (qdoc.T_TEXT, 1, "This is justified", [], qdoc.A_JUSTIFY), - (qdoc.T_TEXT, 1, "This has a page break", [], qdoc.A_PBA), + doc._blocks = [ + (BlockTyp.TEXT, 1, "This is justified", [], BlockFmt.JUSTIFY), + (BlockTyp.TEXT, 1, "This has a page break", [], BlockFmt.PBA), ] - qdoc.doConvert() - assert qdoc.document.blockCount() == 2 + doc.doConvert() + assert doc.document.blockCount() == 2 # 0: Justify - block = qdoc.document.findBlockByNumber(0) + block = doc.document.findBlockByNumber(0) assert block.text() == "This is justified" bFmt = block.blockFormat() assert bFmt.alignment() == QtAlignJustify # 1: Page Break After - block = qdoc.document.findBlockByNumber(1) + block = doc.document.findBlockByNumber(1) assert block.text() == "This has a page break" bFmt = block.blockFormat() assert bFmt.pageBreakPolicy() == QtPageBreakAfter @@ -438,22 +438,22 @@ def testFmtToQTextDocument_TextCharFormats(mockGUI): CONFIG.altDialogClose = ">|" project = NWProject() - qdoc = ToQTextDocument(project) + doc = ToQTextDocument(project) # Convert before init - qdoc._text = "Blabla" - qdoc.setDialogueHighlight(True) - qdoc.doConvert() - qdoc.tokenizeText() - assert qdoc.document.toPlainText() == "" + doc._text = "Blabla" + doc.setDialogueHighlight(True) + doc.doConvert() + doc.tokenizeText() + assert doc.document.toPlainText() == "" # Init - qdoc.initDocument() + doc.initDocument() - qdoc._isNovel = True - qdoc._isFirst = True + doc._isNovel = True + doc._isFirst = True - qdoc._text = ( + doc._text = ( "### Scene\n\n" "With [b]bold[/b] text\n\n" "With [i]italic[/i] text\n\n" @@ -465,26 +465,26 @@ def testFmtToQTextDocument_TextCharFormats(mockGUI): "With \u201cdialog\u201d text\n\n" "With || text\n\n" ) - qdoc.tokenizeText() - qdoc.doConvert() - assert qdoc.document.blockCount() == 10 + doc.tokenizeText() + doc.doConvert() + assert doc.document.blockCount() == 10 # 0: Scene - block = qdoc.document.findBlockByNumber(0) + block = doc.document.findBlockByNumber(0) assert block.text() == "Scene" # 1: Bold - block = qdoc.document.findBlockByNumber(1) + block = doc.document.findBlockByNumber(1) assert block.text() == "With bold text" cFmt = charFmtInBlock(block, 1) - assert cFmt.fontWeight() == qdoc._normal + assert cFmt.fontWeight() == doc._normal cFmt = charFmtInBlock(block, 6) - assert cFmt.fontWeight() == qdoc._bold + assert cFmt.fontWeight() == doc._bold cFmt = charFmtInBlock(block, 10) - assert cFmt.fontWeight() == qdoc._normal + assert cFmt.fontWeight() == doc._normal # 2: Italic - block = qdoc.document.findBlockByNumber(2) + block = doc.document.findBlockByNumber(2) assert block.text() == "With italic text" cFmt = charFmtInBlock(block, 1) assert cFmt.fontItalic() is False @@ -494,7 +494,7 @@ def testFmtToQTextDocument_TextCharFormats(mockGUI): assert cFmt.fontItalic() is False # 3: Deleted - block = qdoc.document.findBlockByNumber(3) + block = doc.document.findBlockByNumber(3) assert block.text() == "With deleted text" cFmt = charFmtInBlock(block, 1) assert cFmt.fontStrikeOut() is False @@ -504,7 +504,7 @@ def testFmtToQTextDocument_TextCharFormats(mockGUI): assert cFmt.fontStrikeOut() is False # 4: Underlined - block = qdoc.document.findBlockByNumber(4) + block = doc.document.findBlockByNumber(4) assert block.text() == "With underlined text" cFmt = charFmtInBlock(block, 1) assert cFmt.fontUnderline() is False @@ -514,7 +514,7 @@ def testFmtToQTextDocument_TextCharFormats(mockGUI): assert cFmt.fontUnderline() is False # 5: Highlighted - block = qdoc.document.findBlockByNumber(5) + block = doc.document.findBlockByNumber(5) assert block.text() == "With highlighted text" cFmt = charFmtInBlock(block, 1) assert cFmt.background() == QtTransparent @@ -524,7 +524,7 @@ def testFmtToQTextDocument_TextCharFormats(mockGUI): assert cFmt.background() == QtTransparent # 6: Superscript - block = qdoc.document.findBlockByNumber(6) + block = doc.document.findBlockByNumber(6) assert block.text() == "With superscript text" cFmt = charFmtInBlock(block, 1) assert cFmt.verticalAlignment() == QtVAlignNormal @@ -534,7 +534,7 @@ def testFmtToQTextDocument_TextCharFormats(mockGUI): assert cFmt.verticalAlignment() == QtVAlignNormal # 7: Subscript - block = qdoc.document.findBlockByNumber(7) + block = doc.document.findBlockByNumber(7) assert block.text() == "With subscript text" cFmt = charFmtInBlock(block, 1) assert cFmt.verticalAlignment() == QtVAlignNormal @@ -544,7 +544,7 @@ def testFmtToQTextDocument_TextCharFormats(mockGUI): assert cFmt.verticalAlignment() == QtVAlignNormal # 8: Dialogue - block = qdoc.document.findBlockByNumber(8) + block = doc.document.findBlockByNumber(8) assert block.text() == "With \u201cdialog\u201d text" cFmt = charFmtInBlock(block, 1) assert cFmt.foreground() == THEME.text @@ -554,7 +554,7 @@ def testFmtToQTextDocument_TextCharFormats(mockGUI): assert cFmt.foreground() == THEME.text # 9: Alt. Dialogue - block = qdoc.document.findBlockByNumber(9) + block = doc.document.findBlockByNumber(9) assert block.text() == "With || text" cFmt = charFmtInBlock(block, 1) assert cFmt.foreground() == THEME.text @@ -568,34 +568,34 @@ def testFmtToQTextDocument_TextCharFormats(mockGUI): def testFmtToQTextDocument_Footnotes(mockGUI): """Test footnotes in the ToQTextDocument class.""" project = NWProject() - qdoc = ToQTextDocument(project) - qdoc.initDocument() + doc = ToQTextDocument(project) + doc.initDocument() - qdoc._isNovel = True - qdoc._isFirst = True + doc._isNovel = True + doc._isFirst = True - qdoc._text = ( + doc._text = ( "### Scene\n\n" "Text with valid[footnote:fn1] and invalid[footnote:fn2] footnotes.\n\n" "%Footnote.fn1: Here's the first note.\n\n" ) - qdoc.tokenizeText() - qdoc.doConvert() - qdoc.appendFootnotes() - assert qdoc.document.blockCount() == 4 + doc.tokenizeText() + doc.doConvert() + doc.appendFootnotes() + assert doc.document.blockCount() == 4 # 0: Scene - block = qdoc.document.findBlockByNumber(0) + block = doc.document.findBlockByNumber(0) assert block.text() == "Scene" # 1: Text - block = qdoc.document.findBlockByNumber(1) + block = doc.document.findBlockByNumber(1) assert block.text() == "Text with valid[1] and invalid[ERR] footnotes." # 2: Footnotes - block = qdoc.document.findBlockByNumber(2) + block = doc.document.findBlockByNumber(2) assert block.text() == "Footnotes" # 3: Footnote 1 - block = qdoc.document.findBlockByNumber(3) + block = doc.document.findBlockByNumber(3) assert block.text() == "1. Here's the first note."