novelWriter 2.4.2__py3-none-any.whl → 2.5b1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {novelWriter-2.4.2.dist-info → novelWriter-2.5b1.dist-info}/METADATA +4 -5
- {novelWriter-2.4.2.dist-info → novelWriter-2.5b1.dist-info}/RECORD +109 -101
- novelwriter/__init__.py +33 -39
- novelwriter/assets/i18n/project_en_GB.json +1 -0
- novelwriter/assets/icons/typicons_dark/icons.conf +2 -0
- novelwriter/assets/icons/typicons_dark/nw_font.svg +4 -0
- novelwriter/assets/icons/typicons_dark/nw_quote.svg +4 -0
- novelwriter/assets/icons/typicons_light/icons.conf +2 -0
- novelwriter/assets/icons/typicons_light/nw_font.svg +4 -0
- novelwriter/assets/icons/typicons_light/nw_quote.svg +4 -0
- novelwriter/assets/manual.pdf +0 -0
- novelwriter/assets/sample.zip +0 -0
- novelwriter/assets/syntax/cyberpunk_night.conf +5 -3
- novelwriter/assets/syntax/default_dark.conf +32 -18
- novelwriter/assets/syntax/default_light.conf +24 -10
- novelwriter/assets/syntax/dracula.conf +44 -0
- novelwriter/assets/syntax/grey_dark.conf +5 -4
- novelwriter/assets/syntax/grey_light.conf +5 -4
- novelwriter/assets/syntax/light_owl.conf +7 -6
- novelwriter/assets/syntax/night_owl.conf +7 -6
- novelwriter/assets/syntax/snazzy.conf +42 -0
- novelwriter/assets/syntax/solarized_dark.conf +4 -3
- novelwriter/assets/syntax/solarized_light.conf +4 -3
- novelwriter/assets/syntax/tango.conf +27 -11
- novelwriter/assets/syntax/tomorrow.conf +6 -5
- novelwriter/assets/syntax/tomorrow_night.conf +7 -6
- novelwriter/assets/syntax/tomorrow_night_blue.conf +6 -5
- novelwriter/assets/syntax/tomorrow_night_bright.conf +6 -5
- novelwriter/assets/syntax/tomorrow_night_eighties.conf +6 -5
- novelwriter/assets/text/credits_en.htm +4 -1
- novelwriter/assets/themes/cyberpunk_night.conf +2 -0
- novelwriter/assets/themes/default_dark.conf +1 -0
- novelwriter/assets/themes/default_light.conf +1 -0
- novelwriter/assets/themes/dracula.conf +47 -0
- novelwriter/assets/themes/solarized_dark.conf +1 -0
- novelwriter/assets/themes/solarized_light.conf +1 -0
- novelwriter/common.py +31 -9
- novelwriter/config.py +118 -84
- novelwriter/constants.py +40 -26
- novelwriter/core/buildsettings.py +63 -66
- novelwriter/core/coretools.py +2 -22
- novelwriter/core/docbuild.py +51 -40
- novelwriter/core/document.py +3 -5
- novelwriter/core/index.py +115 -45
- novelwriter/core/item.py +8 -19
- novelwriter/core/options.py +2 -4
- novelwriter/core/project.py +23 -57
- novelwriter/core/projectdata.py +1 -3
- novelwriter/core/projectxml.py +12 -15
- novelwriter/core/sessions.py +3 -5
- novelwriter/core/spellcheck.py +4 -9
- novelwriter/core/status.py +211 -164
- novelwriter/core/storage.py +0 -8
- novelwriter/core/tohtml.py +94 -100
- novelwriter/core/tokenizer.py +199 -112
- novelwriter/core/{tomd.py → tomarkdown.py} +97 -78
- novelwriter/core/toodt.py +212 -148
- novelwriter/core/toqdoc.py +403 -0
- novelwriter/core/tree.py +5 -7
- novelwriter/dialogs/about.py +3 -5
- novelwriter/dialogs/docmerge.py +1 -3
- novelwriter/dialogs/docsplit.py +1 -3
- novelwriter/dialogs/editlabel.py +0 -2
- novelwriter/dialogs/preferences.py +111 -88
- novelwriter/dialogs/projectsettings.py +216 -180
- novelwriter/dialogs/quotes.py +3 -4
- novelwriter/dialogs/wordlist.py +3 -9
- novelwriter/enum.py +31 -25
- novelwriter/error.py +8 -15
- novelwriter/extensions/circularprogress.py +5 -6
- novelwriter/extensions/configlayout.py +18 -18
- novelwriter/extensions/eventfilters.py +1 -5
- novelwriter/extensions/modified.py +50 -13
- novelwriter/extensions/novelselector.py +1 -3
- novelwriter/extensions/pagedsidebar.py +9 -12
- novelwriter/extensions/simpleprogress.py +1 -3
- novelwriter/extensions/statusled.py +1 -3
- novelwriter/extensions/switch.py +4 -6
- novelwriter/extensions/switchbox.py +7 -6
- novelwriter/extensions/versioninfo.py +3 -9
- novelwriter/gui/doceditor.py +132 -133
- novelwriter/gui/dochighlight.py +237 -183
- novelwriter/gui/docviewer.py +61 -97
- novelwriter/gui/docviewerpanel.py +3 -10
- novelwriter/gui/editordocument.py +1 -3
- novelwriter/gui/itemdetails.py +7 -11
- novelwriter/gui/mainmenu.py +11 -7
- novelwriter/gui/noveltree.py +11 -24
- novelwriter/gui/outline.py +11 -23
- novelwriter/gui/projtree.py +26 -43
- novelwriter/gui/search.py +1 -3
- novelwriter/gui/sidebar.py +2 -6
- novelwriter/gui/statusbar.py +6 -10
- novelwriter/gui/theme.py +26 -51
- novelwriter/guimain.py +50 -71
- novelwriter/shared.py +30 -15
- novelwriter/tools/dictionaries.py +12 -15
- novelwriter/tools/lipsum.py +2 -4
- novelwriter/tools/manusbuild.py +1 -3
- novelwriter/tools/manuscript.py +71 -144
- novelwriter/tools/manussettings.py +67 -73
- novelwriter/tools/noveldetails.py +6 -11
- novelwriter/tools/welcome.py +2 -16
- novelwriter/tools/writingstats.py +6 -9
- novelwriter/types.py +45 -3
- {novelWriter-2.4.2.dist-info → novelWriter-2.5b1.dist-info}/LICENSE.md +0 -0
- {novelWriter-2.4.2.dist-info → novelWriter-2.5b1.dist-info}/WHEEL +0 -0
- {novelWriter-2.4.2.dist-info → novelWriter-2.5b1.dist-info}/entry_points.txt +0 -0
- {novelWriter-2.4.2.dist-info → novelWriter-2.5b1.dist-info}/top_level.txt +0 -0
novelwriter/config.py
CHANGED
@@ -24,24 +24,24 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
24
24
|
"""
|
25
25
|
from __future__ import annotations
|
26
26
|
|
27
|
-
import sys
|
28
27
|
import json
|
29
28
|
import logging
|
29
|
+
import sys
|
30
30
|
|
31
|
-
from time import time
|
32
|
-
from pathlib import Path
|
33
31
|
from datetime import datetime
|
32
|
+
from pathlib import Path
|
33
|
+
from time import time
|
34
34
|
|
35
|
-
from PyQt5.QtGui import QFontDatabase
|
36
35
|
from PyQt5.QtCore import (
|
37
36
|
PYQT_VERSION, PYQT_VERSION_STR, QT_VERSION, QT_VERSION_STR, QLibraryInfo,
|
38
37
|
QLocale, QStandardPaths, QSysInfo, QTranslator
|
39
38
|
)
|
39
|
+
from PyQt5.QtGui import QFont, QFontDatabase
|
40
40
|
from PyQt5.QtWidgets import QApplication
|
41
41
|
|
42
|
-
from novelwriter.
|
43
|
-
from novelwriter.common import NWConfigParser, checkInt, checkPath, formatTimeStamp
|
42
|
+
from novelwriter.common import NWConfigParser, checkInt, checkPath, describeFont, formatTimeStamp
|
44
43
|
from novelwriter.constants import nwFiles, nwUnicode
|
44
|
+
from novelwriter.error import formatException, logException
|
45
45
|
|
46
46
|
logger = logging.getLogger(__name__)
|
47
47
|
|
@@ -106,15 +106,15 @@ class Config:
|
|
106
106
|
self._recentObj = RecentProjects(self)
|
107
107
|
|
108
108
|
# General GUI Settings
|
109
|
-
self.guiLocale
|
110
|
-
self.guiTheme
|
111
|
-
self.guiSyntax
|
112
|
-
self.guiFont
|
113
|
-
self.
|
114
|
-
self.
|
115
|
-
self.
|
116
|
-
self.
|
117
|
-
self.
|
109
|
+
self.guiLocale = self._qLocale.name()
|
110
|
+
self.guiTheme = "default" # GUI theme
|
111
|
+
self.guiSyntax = "default_light" # Syntax theme
|
112
|
+
self.guiFont = QFont() # Main GUI font
|
113
|
+
self.guiScale = 1.0 # Set automatically by Theme class
|
114
|
+
self.hideVScroll = False # Hide vertical scroll bars on main widgets
|
115
|
+
self.hideHScroll = False # Hide horizontal scroll bars on main widgets
|
116
|
+
self.lastNotes = "0x0" # The latest release notes that have been shown
|
117
|
+
self.nativeFont = True # Use native font dialog
|
118
118
|
|
119
119
|
# Size Settings
|
120
120
|
self._mainWinSize = [1200, 650] # Last size of the main GUI window
|
@@ -132,40 +132,42 @@ class Config:
|
|
132
132
|
self.askBeforeBackup = True # Flag for asking before running automatic backup
|
133
133
|
|
134
134
|
# Text Editor Settings
|
135
|
-
self.textFont =
|
136
|
-
self.
|
137
|
-
self.
|
138
|
-
self.
|
139
|
-
|
140
|
-
|
141
|
-
self.
|
142
|
-
self.
|
143
|
-
self.
|
144
|
-
|
145
|
-
|
146
|
-
self.
|
147
|
-
self.
|
148
|
-
self.
|
149
|
-
|
150
|
-
|
151
|
-
self.
|
152
|
-
self.
|
153
|
-
self.
|
154
|
-
self.
|
155
|
-
|
156
|
-
|
157
|
-
self.
|
158
|
-
self.
|
159
|
-
|
160
|
-
|
161
|
-
self.
|
162
|
-
self.
|
163
|
-
self.
|
164
|
-
self.
|
165
|
-
|
166
|
-
self.
|
167
|
-
|
168
|
-
self.
|
135
|
+
self.textFont = QFont() # Editor font
|
136
|
+
self.textWidth = 700 # Editor text width
|
137
|
+
self.textMargin = 40 # Editor/viewer text margin
|
138
|
+
self.tabWidth = 40 # Editor tabulator width
|
139
|
+
|
140
|
+
self.focusWidth = 800 # Focus Mode text width
|
141
|
+
self.hideFocusFooter = False # Hide document footer in Focus Mode
|
142
|
+
self.showFullPath = True # Show full document path in editor header
|
143
|
+
self.autoSelect = True # Auto-select word when applying format with no selection
|
144
|
+
|
145
|
+
self.doJustify = False # Justify text
|
146
|
+
self.showTabsNSpaces = False # Show tabs and spaces in editor
|
147
|
+
self.showLineEndings = False # Show line endings in editor
|
148
|
+
self.showMultiSpaces = True # Highlight multiple spaces in the text
|
149
|
+
|
150
|
+
self.doReplace = True # Enable auto-replace as you type
|
151
|
+
self.doReplaceSQuote = True # Smart single quotes
|
152
|
+
self.doReplaceDQuote = True # Smart double quotes
|
153
|
+
self.doReplaceDash = True # Replace multiple hyphens with dashes
|
154
|
+
self.doReplaceDots = True # Replace three dots with ellipsis
|
155
|
+
|
156
|
+
self.autoScroll = False # Typewriter-like scrolling
|
157
|
+
self.autoScrollPos = 30 # Start point for typewriter-like scrolling
|
158
|
+
self.scrollPastEnd = True # Scroll past end of document, and centre cursor
|
159
|
+
|
160
|
+
self.dialogStyle = 2 # Quote type to use for dialogue
|
161
|
+
self.allowOpenDial = True # Allow open-ended dialogue quotes
|
162
|
+
self.narratorBreak = "" # Symbol to use for narrator break
|
163
|
+
self.dialogLine = "" # Symbol to use for dialogue line
|
164
|
+
self.altDialogOpen = "" # Alternative dialog symbol, open
|
165
|
+
self.altDialogClose = "" # Alternative dialog symbol, close
|
166
|
+
self.highlightEmph = True # Add colour to text emphasis
|
167
|
+
|
168
|
+
self.stopWhenIdle = True # Stop the status bar clock when the user is idle
|
169
|
+
self.userIdleTime = 300 # Time of inactivity to consider user idle
|
170
|
+
self.incNotesWCount = True # The status bar word count includes notes
|
169
171
|
|
170
172
|
# User-Selected Symbol Settings
|
171
173
|
self.fmtApostrophe = nwUnicode.U_RSQUO
|
@@ -359,23 +361,53 @@ class Config:
|
|
359
361
|
self._backupPath = checkPath(path, self._backPath)
|
360
362
|
return
|
361
363
|
|
362
|
-
def
|
364
|
+
def setGuiFont(self, value: QFont | str | None) -> None:
|
365
|
+
"""Update the GUI's font style from settings."""
|
366
|
+
if isinstance(value, QFont):
|
367
|
+
self.guiFont = value
|
368
|
+
elif value and isinstance(value, str):
|
369
|
+
self.guiFont = QFont()
|
370
|
+
self.guiFont.fromString(value)
|
371
|
+
else:
|
372
|
+
font = QFont()
|
373
|
+
fontDB = QFontDatabase()
|
374
|
+
if self.osWindows and "Arial" in fontDB.families():
|
375
|
+
# On Windows we default to Arial if possible
|
376
|
+
font.setFamily("Arial")
|
377
|
+
font.setPointSize(10)
|
378
|
+
else:
|
379
|
+
font = fontDB.systemFont(QFontDatabase.SystemFont.GeneralFont)
|
380
|
+
self.guiFont = font
|
381
|
+
logger.debug("GUI font set to: %s", describeFont(font))
|
382
|
+
|
383
|
+
QApplication.setFont(self.guiFont)
|
384
|
+
|
385
|
+
return
|
386
|
+
|
387
|
+
def setTextFont(self, value: QFont | str | None) -> None:
|
363
388
|
"""Set the text font if it exists. If it doesn't, or is None,
|
364
389
|
set to default font.
|
365
390
|
"""
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
391
|
+
if isinstance(value, QFont):
|
392
|
+
self.textFont = value
|
393
|
+
elif value and isinstance(value, str):
|
394
|
+
self.textFont = QFont()
|
395
|
+
self.textFont.fromString(value)
|
396
|
+
else:
|
397
|
+
fontDB = QFontDatabase()
|
398
|
+
fontFam = fontDB.families()
|
371
399
|
if self.osWindows and "Arial" in fontFam:
|
372
|
-
|
400
|
+
font = QFont()
|
401
|
+
font.setFamily("Arial")
|
402
|
+
font.setPointSize(12)
|
373
403
|
elif self.osDarwin and "Helvetica" in fontFam:
|
374
|
-
|
404
|
+
font = QFont()
|
405
|
+
font.setFamily("Helvetica")
|
406
|
+
font.setPointSize(12)
|
375
407
|
else:
|
376
|
-
|
377
|
-
|
378
|
-
|
408
|
+
font = fontDB.systemFont(QFontDatabase.SystemFont.GeneralFont)
|
409
|
+
self.textFont = font
|
410
|
+
logger.debug("Text font set to: %s", describeFont(font))
|
379
411
|
return
|
380
412
|
|
381
413
|
##
|
@@ -499,12 +531,6 @@ class Config:
|
|
499
531
|
(self._dataPath / "syntax").mkdir(exist_ok=True)
|
500
532
|
(self._dataPath / "themes").mkdir(exist_ok=True)
|
501
533
|
|
502
|
-
# Check if config file exists, and load it. If not, we save defaults
|
503
|
-
if (self._confPath / nwFiles.CONF_FILE).is_file():
|
504
|
-
self.loadConfig()
|
505
|
-
else:
|
506
|
-
self.saveConfig()
|
507
|
-
|
508
534
|
self._recentObj.loadCache()
|
509
535
|
self._checkOptionalPackages()
|
510
536
|
|
@@ -545,6 +571,14 @@ class Config:
|
|
545
571
|
|
546
572
|
conf = NWConfigParser()
|
547
573
|
cnfPath = self._confPath / nwFiles.CONF_FILE
|
574
|
+
|
575
|
+
if not cnfPath.exists():
|
576
|
+
# Initial file, so we just create one from defaults
|
577
|
+
self.setGuiFont(None)
|
578
|
+
self.setTextFont(None)
|
579
|
+
self.saveConfig()
|
580
|
+
return True
|
581
|
+
|
548
582
|
try:
|
549
583
|
with open(cnfPath, mode="r", encoding="utf-8") as inFile:
|
550
584
|
conf.read_file(inFile)
|
@@ -558,14 +592,14 @@ class Config:
|
|
558
592
|
|
559
593
|
# Main
|
560
594
|
sec = "Main"
|
595
|
+
self.setGuiFont(conf.rdStr(sec, "font", ""))
|
561
596
|
self.guiTheme = conf.rdStr(sec, "theme", self.guiTheme)
|
562
597
|
self.guiSyntax = conf.rdStr(sec, "syntax", self.guiSyntax)
|
563
|
-
self.guiFont = conf.rdStr(sec, "font", self.guiFont)
|
564
|
-
self.guiFontSize = conf.rdInt(sec, "fontsize", self.guiFontSize)
|
565
598
|
self.guiLocale = conf.rdStr(sec, "localisation", self.guiLocale)
|
566
599
|
self.hideVScroll = conf.rdBool(sec, "hidevscroll", self.hideVScroll)
|
567
600
|
self.hideHScroll = conf.rdBool(sec, "hidehscroll", self.hideHScroll)
|
568
601
|
self.lastNotes = conf.rdStr(sec, "lastnotes", self.lastNotes)
|
602
|
+
self.nativeFont = conf.rdBool(sec, "nativefont", self.nativeFont)
|
569
603
|
self._lastPath = conf.rdPath(sec, "lastpath", self._lastPath)
|
570
604
|
|
571
605
|
# Sizes
|
@@ -588,8 +622,7 @@ class Config:
|
|
588
622
|
|
589
623
|
# Editor
|
590
624
|
sec = "Editor"
|
591
|
-
self.
|
592
|
-
self.textSize = conf.rdInt(sec, "textsize", self.textSize)
|
625
|
+
self.setTextFont(conf.rdStr(sec, "textfont", ""))
|
593
626
|
self.textWidth = conf.rdInt(sec, "width", self.textWidth)
|
594
627
|
self.textMargin = conf.rdInt(sec, "margin", self.textMargin)
|
595
628
|
self.tabWidth = conf.rdInt(sec, "tabwidth", self.tabWidth)
|
@@ -618,9 +651,12 @@ class Config:
|
|
618
651
|
self.showMultiSpaces = conf.rdBool(sec, "showmultispaces", self.showMultiSpaces)
|
619
652
|
self.incNotesWCount = conf.rdBool(sec, "incnoteswcount", self.incNotesWCount)
|
620
653
|
self.showFullPath = conf.rdBool(sec, "showfullpath", self.showFullPath)
|
621
|
-
self.
|
622
|
-
self.
|
623
|
-
self.
|
654
|
+
self.dialogStyle = conf.rdInt(sec, "dialogstyle", self.dialogStyle)
|
655
|
+
self.allowOpenDial = conf.rdBool(sec, "allowopendial", self.allowOpenDial)
|
656
|
+
self.narratorBreak = conf.rdStr(sec, "narratorbreak", self.narratorBreak)
|
657
|
+
self.altDialogOpen = conf.rdStr(sec, "altdialogopen", self.altDialogOpen)
|
658
|
+
self.altDialogClose = conf.rdStr(sec, "altdialogclose", self.altDialogClose)
|
659
|
+
self.dialogLine = conf.rdStr(sec, "dialogline", self.dialogLine)
|
624
660
|
self.highlightEmph = conf.rdBool(sec, "highlightemph", self.highlightEmph)
|
625
661
|
self.stopWhenIdle = conf.rdBool(sec, "stopwhenidle", self.stopWhenIdle)
|
626
662
|
self.userIdleTime = conf.rdInt(sec, "useridletime", self.userIdleTime)
|
@@ -666,14 +702,14 @@ class Config:
|
|
666
702
|
}
|
667
703
|
|
668
704
|
conf["Main"] = {
|
705
|
+
"font": self.guiFont.toString(),
|
669
706
|
"theme": str(self.guiTheme),
|
670
707
|
"syntax": str(self.guiSyntax),
|
671
|
-
"font": str(self.guiFont),
|
672
|
-
"fontsize": str(self.guiFontSize),
|
673
708
|
"localisation": str(self.guiLocale),
|
674
709
|
"hidevscroll": str(self.hideVScroll),
|
675
710
|
"hidehscroll": str(self.hideHScroll),
|
676
711
|
"lastnotes": str(self.lastNotes),
|
712
|
+
"nativefont": str(self.nativeFont),
|
677
713
|
"lastpath": str(self._lastPath),
|
678
714
|
}
|
679
715
|
|
@@ -696,8 +732,7 @@ class Config:
|
|
696
732
|
}
|
697
733
|
|
698
734
|
conf["Editor"] = {
|
699
|
-
"textfont":
|
700
|
-
"textsize": str(self.textSize),
|
735
|
+
"textfont": self.textFont.toString(),
|
701
736
|
"width": str(self.textWidth),
|
702
737
|
"margin": str(self.textMargin),
|
703
738
|
"tabwidth": str(self.tabWidth),
|
@@ -726,9 +761,12 @@ class Config:
|
|
726
761
|
"showmultispaces": str(self.showMultiSpaces),
|
727
762
|
"incnoteswcount": str(self.incNotesWCount),
|
728
763
|
"showfullpath": str(self.showFullPath),
|
729
|
-
"
|
730
|
-
"
|
731
|
-
"
|
764
|
+
"dialogstyle": str(self.dialogStyle),
|
765
|
+
"allowopendial": str(self.allowOpenDial),
|
766
|
+
"narratorbreak": str(self.narratorBreak),
|
767
|
+
"altdialogopen": str(self.altDialogOpen),
|
768
|
+
"altdialogclose": str(self.altDialogClose),
|
769
|
+
"dialogline": str(self.dialogLine),
|
732
770
|
"highlightemph": str(self.highlightEmph),
|
733
771
|
"stopwhenidle": str(self.stopWhenIdle),
|
734
772
|
"useridletime": str(self.userIdleTime),
|
@@ -787,8 +825,6 @@ class Config:
|
|
787
825
|
logger.debug("Checking package 'pyenchant': OK")
|
788
826
|
return
|
789
827
|
|
790
|
-
# END Class Config
|
791
|
-
|
792
828
|
|
793
829
|
class RecentProjects:
|
794
830
|
|
@@ -857,5 +893,3 @@ class RecentProjects:
|
|
857
893
|
logger.debug("Removed recent: %s", path)
|
858
894
|
self.saveCache()
|
859
895
|
return
|
860
|
-
|
861
|
-
# END Class RecentProjects
|
novelwriter/constants.py
CHANGED
@@ -23,9 +23,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
23
23
|
"""
|
24
24
|
from __future__ import annotations
|
25
25
|
|
26
|
-
from PyQt5.QtCore import
|
26
|
+
from PyQt5.QtCore import QT_TRANSLATE_NOOP, QCoreApplication
|
27
27
|
|
28
|
-
from novelwriter.enum import
|
28
|
+
from novelwriter.enum import (
|
29
|
+
nwBuildFmt, nwComment, nwItemClass, nwItemLayout, nwOutline, nwStatusShape
|
30
|
+
)
|
29
31
|
|
30
32
|
|
31
33
|
def trConst(text: str) -> str:
|
@@ -58,8 +60,6 @@ class nwConst:
|
|
58
60
|
# Dialogs
|
59
61
|
DLG_FINISHED = 2
|
60
62
|
|
61
|
-
# END Class nwConst
|
62
|
-
|
63
63
|
|
64
64
|
class nwRegEx:
|
65
65
|
|
@@ -67,9 +67,7 @@ class nwRegEx:
|
|
67
67
|
FMT_EB = r"(?<![\w\\])([\*]{2})(?![\s\*])(.+?)(?<![\s\\])(\1)(?!\w)"
|
68
68
|
FMT_ST = r"(?<![\w\\])([~]{2})(?![\s~])(.+?)(?<![\s\\])(\1)(?!\w)"
|
69
69
|
FMT_SC = r"(?i)(?<!\\)(\[[\/\!]?(?:i|b|s|u|m|sup|sub)\])"
|
70
|
-
FMT_SV = r"(?<!\\)(\[(?i)(?:
|
71
|
-
|
72
|
-
# END Class nwRegEx
|
70
|
+
FMT_SV = r"(?<!\\)(\[(?i)(?:footnote):)(.+?)(?<!\\)(\])"
|
73
71
|
|
74
72
|
|
75
73
|
class nwShortcode:
|
@@ -89,15 +87,19 @@ class nwShortcode:
|
|
89
87
|
SUB_O = "[sub]"
|
90
88
|
SUB_C = "[/sub]"
|
91
89
|
|
92
|
-
|
90
|
+
FOOTNOTE_B = "[footnote:"
|
91
|
+
|
92
|
+
COMMENT_STYLES = {
|
93
|
+
nwComment.FOOTNOTE: "[footnote:{0}]",
|
94
|
+
nwComment.COMMENT: "[comment:{0}]",
|
95
|
+
}
|
93
96
|
|
94
97
|
|
95
98
|
class nwHeaders:
|
96
99
|
|
97
100
|
H_VALID = ("H0", "H1", "H2", "H3", "H4")
|
98
101
|
H_LEVEL = {"H0": 0, "H1": 1, "H2": 2, "H3": 3, "H4": 4}
|
99
|
-
|
100
|
-
# END Class nwHeaders
|
102
|
+
H_SIZES = {0: 2.50, 1: 2.00, 2: 1.75, 3: 1.50, 4: 1.25}
|
101
103
|
|
102
104
|
|
103
105
|
class nwFiles:
|
@@ -118,8 +120,6 @@ class nwFiles:
|
|
118
120
|
DICT_FILE = "userdict.json"
|
119
121
|
SESS_FILE = "sessions.jsonl"
|
120
122
|
|
121
|
-
# END Class nwFiles
|
122
|
-
|
123
123
|
|
124
124
|
class nwKeyWords:
|
125
125
|
|
@@ -153,8 +153,6 @@ class nwKeyWords:
|
|
153
153
|
CUSTOM_KEY: nwItemClass.CUSTOM,
|
154
154
|
}
|
155
155
|
|
156
|
-
# END Class nwKeyWords
|
157
|
-
|
158
156
|
|
159
157
|
class nwLists:
|
160
158
|
|
@@ -168,8 +166,6 @@ class nwLists:
|
|
168
166
|
nwItemClass.CUSTOM,
|
169
167
|
]
|
170
168
|
|
171
|
-
# END Class nwLists
|
172
|
-
|
173
169
|
|
174
170
|
class nwLabels:
|
175
171
|
|
@@ -268,6 +264,34 @@ class nwLabels:
|
|
268
264
|
nwBuildFmt.J_HTML: ".json",
|
269
265
|
nwBuildFmt.J_NWD: ".json",
|
270
266
|
}
|
267
|
+
SHAPES_PLAIN = {
|
268
|
+
nwStatusShape.SQUARE: QT_TRANSLATE_NOOP("Constant", "Square"),
|
269
|
+
nwStatusShape.TRIANGLE: QT_TRANSLATE_NOOP("Constant", "Triangle"),
|
270
|
+
nwStatusShape.NABLA: QT_TRANSLATE_NOOP("Constant", "Nabla"),
|
271
|
+
nwStatusShape.DIAMOND: QT_TRANSLATE_NOOP("Constant", "Diamond"),
|
272
|
+
nwStatusShape.PENTAGON: QT_TRANSLATE_NOOP("Constant", "Pentagon"),
|
273
|
+
nwStatusShape.HEXAGON: QT_TRANSLATE_NOOP("Constant", "Hexagon"),
|
274
|
+
nwStatusShape.STAR: QT_TRANSLATE_NOOP("Constant", "Star"),
|
275
|
+
nwStatusShape.PACMAN: QT_TRANSLATE_NOOP("Constant", "Pacman"),
|
276
|
+
}
|
277
|
+
SHAPES_CIRCLE = {
|
278
|
+
nwStatusShape.CIRCLE_Q: QT_TRANSLATE_NOOP("Constant", "1/4 Circle"),
|
279
|
+
nwStatusShape.CIRCLE_H: QT_TRANSLATE_NOOP("Constant", "Half Circle"),
|
280
|
+
nwStatusShape.CIRCLE_T: QT_TRANSLATE_NOOP("Constant", "3/4 Circle"),
|
281
|
+
nwStatusShape.CIRCLE: QT_TRANSLATE_NOOP("Constant", "Full Circle"),
|
282
|
+
}
|
283
|
+
SHAPES_BARS = {
|
284
|
+
nwStatusShape.BARS_1: QT_TRANSLATE_NOOP("Constant", "1 Bar"),
|
285
|
+
nwStatusShape.BARS_2: QT_TRANSLATE_NOOP("Constant", "2 Bars"),
|
286
|
+
nwStatusShape.BARS_3: QT_TRANSLATE_NOOP("Constant", "3 Bars"),
|
287
|
+
nwStatusShape.BARS_4: QT_TRANSLATE_NOOP("Constant", "4 Bars"),
|
288
|
+
}
|
289
|
+
SHAPES_BLOCKS = {
|
290
|
+
nwStatusShape.BLOCK_1: QT_TRANSLATE_NOOP("Constant", "1 Block"),
|
291
|
+
nwStatusShape.BLOCK_2: QT_TRANSLATE_NOOP("Constant", "2 Blocks"),
|
292
|
+
nwStatusShape.BLOCK_3: QT_TRANSLATE_NOOP("Constant", "3 Blocks"),
|
293
|
+
nwStatusShape.BLOCK_4: QT_TRANSLATE_NOOP("Constant", "4 Blocks"),
|
294
|
+
}
|
271
295
|
FILE_FILTERS = {
|
272
296
|
"*.txt": QT_TRANSLATE_NOOP("Constant", "Text files"),
|
273
297
|
"*.md": QT_TRANSLATE_NOOP("Constant", "Markdown files"),
|
@@ -302,8 +326,6 @@ class nwLabels:
|
|
302
326
|
"Custom": (-1.0, -1.0),
|
303
327
|
}
|
304
328
|
|
305
|
-
# END Class nwLabels
|
306
|
-
|
307
329
|
|
308
330
|
class nwHeadFmt:
|
309
331
|
|
@@ -329,8 +351,6 @@ class nwHeadFmt:
|
|
329
351
|
ODT_PAGE = "{Page}"
|
330
352
|
ODT_AUTO = "{Project} / {Author} / {Page}"
|
331
353
|
|
332
|
-
# END Class nwHeadFmt
|
333
|
-
|
334
354
|
|
335
355
|
class nwQuotes:
|
336
356
|
"""Allowed quotation marks.
|
@@ -361,8 +381,6 @@ class nwQuotes:
|
|
361
381
|
"\u300f": QT_TRANSLATE_NOOP("Constant", "Right white corner bracket"),
|
362
382
|
}
|
363
383
|
|
364
|
-
# END Class nwQuotes
|
365
|
-
|
366
384
|
|
367
385
|
class nwUnicode:
|
368
386
|
"""Supported unicode character constants and their HTML equivalents."""
|
@@ -497,8 +515,6 @@ class nwUnicode:
|
|
497
515
|
H_LTRI = "◀"
|
498
516
|
H_LTRIS = "◂"
|
499
517
|
|
500
|
-
# END Class nwUnicode
|
501
|
-
|
502
518
|
|
503
519
|
class nwHtmlUnicode():
|
504
520
|
|
@@ -554,5 +570,3 @@ class nwHtmlUnicode():
|
|
554
570
|
nwUnicode.U_TIMES: nwUnicode.H_TIMES,
|
555
571
|
nwUnicode.U_DIVIDE: nwUnicode.H_DIVIDE,
|
556
572
|
}
|
557
|
-
|
558
|
-
# END Class nwHtmlUnicode
|