novelWriter 2.4.4__py3-none-any.whl → 2.5rc1__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.4.dist-info → novelWriter-2.5rc1.dist-info}/METADATA +4 -5
- {novelWriter-2.4.4.dist-info → novelWriter-2.5rc1.dist-info}/RECORD +109 -101
- {novelWriter-2.4.4.dist-info → novelWriter-2.5rc1.dist-info}/WHEEL +1 -1
- 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 +3 -0
- novelwriter/assets/themes/default_dark.conf +2 -0
- novelwriter/assets/themes/default_light.conf +2 -0
- novelwriter/assets/themes/dracula.conf +48 -0
- novelwriter/assets/themes/solarized_dark.conf +2 -0
- novelwriter/assets/themes/solarized_light.conf +2 -0
- novelwriter/common.py +33 -12
- novelwriter/config.py +184 -98
- novelwriter/constants.py +47 -35
- novelwriter/core/buildsettings.py +68 -69
- novelwriter/core/coretools.py +5 -23
- novelwriter/core/docbuild.py +52 -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 +139 -105
- novelwriter/core/tokenizer.py +278 -122
- novelwriter/core/{tomd.py → tomarkdown.py} +97 -78
- novelwriter/core/toodt.py +257 -166
- novelwriter/core/toqdoc.py +419 -0
- novelwriter/core/tree.py +5 -7
- novelwriter/dialogs/about.py +11 -18
- novelwriter/dialogs/docmerge.py +17 -19
- novelwriter/dialogs/docsplit.py +17 -19
- novelwriter/dialogs/editlabel.py +6 -10
- novelwriter/dialogs/preferences.py +193 -144
- novelwriter/dialogs/projectsettings.py +225 -189
- novelwriter/dialogs/quotes.py +12 -9
- novelwriter/dialogs/wordlist.py +9 -15
- novelwriter/enum.py +35 -30
- novelwriter/error.py +8 -15
- novelwriter/extensions/configlayout.py +40 -21
- novelwriter/extensions/eventfilters.py +1 -5
- novelwriter/extensions/modified.py +58 -14
- novelwriter/extensions/novelselector.py +1 -3
- novelwriter/extensions/pagedsidebar.py +9 -12
- novelwriter/extensions/{circularprogress.py → progressbars.py} +30 -8
- novelwriter/extensions/statusled.py +29 -25
- novelwriter/extensions/switch.py +4 -6
- novelwriter/extensions/switchbox.py +7 -6
- novelwriter/extensions/versioninfo.py +3 -9
- novelwriter/gui/doceditor.py +118 -137
- novelwriter/gui/dochighlight.py +231 -186
- novelwriter/gui/docviewer.py +66 -107
- novelwriter/gui/docviewerpanel.py +3 -10
- novelwriter/gui/editordocument.py +1 -3
- novelwriter/gui/itemdetails.py +7 -11
- novelwriter/gui/mainmenu.py +22 -18
- novelwriter/gui/noveltree.py +11 -24
- novelwriter/gui/outline.py +14 -26
- novelwriter/gui/projtree.py +35 -60
- novelwriter/gui/search.py +10 -3
- novelwriter/gui/sidebar.py +2 -6
- novelwriter/gui/statusbar.py +29 -37
- novelwriter/gui/theme.py +26 -48
- novelwriter/guimain.py +134 -148
- novelwriter/shared.py +36 -32
- novelwriter/text/patterns.py +113 -0
- novelwriter/tools/dictionaries.py +10 -20
- novelwriter/tools/lipsum.py +10 -16
- novelwriter/tools/manusbuild.py +9 -11
- novelwriter/tools/manuscript.py +71 -145
- novelwriter/tools/manussettings.py +71 -75
- novelwriter/tools/noveldetails.py +16 -21
- novelwriter/tools/welcome.py +12 -26
- novelwriter/tools/writingstats.py +9 -12
- novelwriter/types.py +49 -4
- novelwriter/extensions/simpleprogress.py +0 -55
- {novelWriter-2.4.4.dist-info → novelWriter-2.5rc1.dist-info}/LICENSE.md +0 -0
- {novelWriter-2.4.4.dist-info → novelWriter-2.5rc1.dist-info}/entry_points.txt +0 -0
- {novelWriter-2.4.4.dist-info → novelWriter-2.5rc1.dist-info}/top_level.txt +0 -0
@@ -6,23 +6,37 @@ url = https://github.com/vkbo/novelWriter
|
|
6
6
|
license = CC BY-SA 4.0
|
7
7
|
licenseurl = https://creativecommons.org/licenses/by-sa/4.0/
|
8
8
|
|
9
|
+
##
|
10
|
+
# Colours:
|
11
|
+
# Background = ffffff : 255, 255, 255
|
12
|
+
# Foreground = 000000 : 0, 0, 0
|
13
|
+
# Comment = 646464 : 100, 100, 100
|
14
|
+
# Red = c83232 : 200, 50, 50
|
15
|
+
# Orange = ae6e1e : 174, 110, 30
|
16
|
+
# Yellow = 969600 : 150, 150, 0
|
17
|
+
# Green = 006400 : 0, 100, 0
|
18
|
+
# Blue = 0000c8 : 0, 0, 200
|
19
|
+
# Purple = 6400ae : 100, 0, 174
|
20
|
+
##
|
21
|
+
|
9
22
|
[Syntax]
|
10
23
|
background = 255, 255, 255
|
11
24
|
text = 0, 0, 0
|
12
25
|
link = 0, 0, 200
|
13
26
|
headertext = 0, 100, 0
|
14
|
-
headertag =
|
15
|
-
emphasis =
|
16
|
-
|
17
|
-
|
18
|
-
|
27
|
+
headertag = 0, 100, 0, 160
|
28
|
+
emphasis = 174, 110, 30
|
29
|
+
dialog = 0, 0, 200
|
30
|
+
altdialog = 0, 0, 200
|
31
|
+
note = 100, 100, 0
|
19
32
|
hidden = 100, 100, 100
|
20
33
|
shortcode = 0, 100, 0
|
21
34
|
keyword = 200, 50, 50
|
22
|
-
|
35
|
+
tag = 0, 100, 0
|
36
|
+
value = 0, 0, 200
|
23
37
|
optional = 0, 100, 0
|
24
|
-
spellcheckline = 200,
|
25
|
-
errorline = 0,
|
26
|
-
replacetag = 0,
|
27
|
-
modifier =
|
38
|
+
spellcheckline = 200, 50, 50
|
39
|
+
errorline = 0, 100, 0
|
40
|
+
replacetag = 0, 100, 0
|
41
|
+
modifier = 0, 100, 0
|
28
42
|
texthighlight = 150, 150, 0, 96
|
@@ -0,0 +1,44 @@
|
|
1
|
+
[Main]
|
2
|
+
name = Dracula
|
3
|
+
author = Veronica Berglyd Olsen (adaptation)
|
4
|
+
credit = Zeno Rocha
|
5
|
+
url = https://draculatheme.com
|
6
|
+
license = MIT
|
7
|
+
licenseurl = https://github.com/dracula/dracula-theme/blob/main/LICENSE
|
8
|
+
|
9
|
+
##
|
10
|
+
# Colours:
|
11
|
+
# Background = 282a36 : 40, 42, 54
|
12
|
+
# Foreground = f8f8f2 : 248, 248, 242
|
13
|
+
# Comment = 6272a4 : 98, 114, 164
|
14
|
+
# Cyan = 8be9fd : 139, 233, 253
|
15
|
+
# Green = 50fa7b : 80, 250, 123
|
16
|
+
# Orange = ffb86c : 255, 184, 108
|
17
|
+
# Pink = ff79c6 : 255, 121, 198
|
18
|
+
# Purple = bd93f9 : 189, 147, 249
|
19
|
+
# Red = ff5555 : 255, 85, 85
|
20
|
+
# Yellow = f1fa8c : 241, 250, 140
|
21
|
+
##
|
22
|
+
|
23
|
+
[Syntax]
|
24
|
+
# See: https://spec.draculatheme.com/
|
25
|
+
background = 40, 42, 54
|
26
|
+
text = 248, 248, 242
|
27
|
+
link = 255, 121, 198
|
28
|
+
headertext = 189, 147, 249
|
29
|
+
headertag = 189, 147, 249, 160
|
30
|
+
emphasis = 255, 184, 108
|
31
|
+
dialog = 80, 250, 123
|
32
|
+
altdialog = 241, 250, 140
|
33
|
+
note = 255, 204, 233
|
34
|
+
hidden = 98, 114, 164
|
35
|
+
shortcode = 139, 233, 253
|
36
|
+
keyword = 255, 121, 198
|
37
|
+
tag = 255, 184, 108
|
38
|
+
value = 255, 184, 108
|
39
|
+
optional = 80, 250, 123
|
40
|
+
spellcheckline = 255, 85, 85
|
41
|
+
errorline = 80, 250, 123
|
42
|
+
replacetag = 241, 250, 140
|
43
|
+
modifier = 139, 233, 253
|
44
|
+
texthighlight = 241, 250, 140, 96
|
@@ -11,14 +11,15 @@ background = 54, 54, 54
|
|
11
11
|
text = 200, 200, 200
|
12
12
|
link = 200, 200, 200
|
13
13
|
headertext = 225, 225, 225
|
14
|
-
headertag = 225, 225, 225
|
14
|
+
headertag = 225, 225, 225, 160
|
15
15
|
emphasis = 200, 200, 200
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
dialog = 200, 200, 200
|
17
|
+
altdialog = 200, 200, 200
|
18
|
+
note = 200, 200, 200
|
19
19
|
hidden = 150, 150, 150
|
20
20
|
shortcode = 225, 225, 225
|
21
21
|
keyword = 225, 225, 225
|
22
|
+
tag = 200, 200, 200
|
22
23
|
value = 200, 200, 200
|
23
24
|
optional = 225, 225, 225
|
24
25
|
spellcheckline = 200, 46, 0
|
@@ -11,14 +11,15 @@ background = 255, 255, 255
|
|
11
11
|
text = 20, 20, 20
|
12
12
|
link = 20, 20, 20
|
13
13
|
headertext = 0, 0, 0
|
14
|
-
headertag = 0, 0, 0
|
14
|
+
headertag = 0, 0, 0, 160
|
15
15
|
emphasis = 20, 20, 20
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
dialog = 20, 20, 20
|
17
|
+
altdialog = 20, 20, 20
|
18
|
+
note = 20, 20, 20
|
19
19
|
hidden = 100, 100, 100
|
20
20
|
shortcode = 0, 0, 0
|
21
21
|
keyword = 0, 0, 0
|
22
|
+
tag = 20, 20, 20
|
22
23
|
value = 20, 20, 20
|
23
24
|
optional = 0, 0, 0
|
24
25
|
spellcheckline = 200, 0, 0
|
@@ -31,18 +31,19 @@ background = 251, 251, 251
|
|
31
31
|
text = 64, 63, 82
|
32
32
|
link = 40, 142, 215
|
33
33
|
headertext = 40, 142, 215
|
34
|
-
headertag = 40, 142, 215
|
34
|
+
headertag = 40, 142, 215, 160
|
35
35
|
emphasis = 224, 175, 5
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
dialog = 8, 145, 106
|
37
|
+
altdialog = 218, 170, 1
|
38
|
+
note = 128, 118, 75
|
39
39
|
hidden = 152, 159, 177
|
40
40
|
shortcode = 40, 142, 215
|
41
41
|
keyword = 222, 61, 58
|
42
|
-
|
42
|
+
tag = 150, 74, 193
|
43
|
+
value = 224, 175, 5
|
43
44
|
optional = 40, 142, 215
|
44
45
|
spellcheckline = 222, 61, 58
|
45
46
|
errorline = 8, 145, 106
|
46
47
|
replacetag = 42, 162, 152
|
47
|
-
modifier =
|
48
|
+
modifier = 8, 145, 106
|
48
49
|
texthighlight = 218, 170, 1, 96
|
@@ -31,18 +31,19 @@ background = 1, 22, 39
|
|
31
31
|
text = 214, 222, 235
|
32
32
|
link = 130, 170, 255
|
33
33
|
headertext = 130, 170, 255
|
34
|
-
headertag = 130, 170, 255
|
34
|
+
headertag = 130, 170, 255, 160
|
35
35
|
emphasis = 236, 196, 141
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
dialog = 173, 219, 103
|
37
|
+
altdialog = 255, 235, 149
|
38
|
+
note = 255, 249, 202
|
39
39
|
hidden = 99, 119, 119
|
40
40
|
shortcode = 130, 170, 255
|
41
41
|
keyword = 247, 140, 108
|
42
|
-
|
42
|
+
tag = 199, 146, 234
|
43
|
+
value = 255, 235, 149
|
43
44
|
optional = 130, 170, 255
|
44
45
|
spellcheckline = 247, 140, 108
|
45
46
|
errorline = 173, 219, 103
|
46
47
|
replacetag = 127, 219, 202
|
47
|
-
modifier =
|
48
|
+
modifier = 173, 219, 103
|
48
49
|
texthighlight = 255, 235, 149, 96
|
@@ -0,0 +1,42 @@
|
|
1
|
+
[Main]
|
2
|
+
name = Snazzy Light
|
3
|
+
author = Veronica Berglyd Olsen (adaptation)
|
4
|
+
credit = Florian Reuschel (color theme)
|
5
|
+
url = https://github.com/loilo/vscode-snazzy-light
|
6
|
+
license = MIT License
|
7
|
+
licenseurl = https://github.com/loilo/vscode-snazzy-light/blob/master/LICENSE
|
8
|
+
|
9
|
+
##
|
10
|
+
# Colours:
|
11
|
+
# Background = fafbfc : 250, 251, 252
|
12
|
+
# Foreground = 565869 : 86, 88, 105
|
13
|
+
# Comment = 9194a2 : 145, 148, 162
|
14
|
+
# Yellow = cf9c00 : 207, 156, 0
|
15
|
+
# Red = ff5c57 : 255, 92, 87
|
16
|
+
# Pink = f767bb : 247, 103, 187
|
17
|
+
# Blue = 09a1ed : 9, 161, 237
|
18
|
+
# Cyan = 13bbb7 : 19, 187, 183
|
19
|
+
# Green = 2dae58 : 45, 174, 88
|
20
|
+
##
|
21
|
+
|
22
|
+
[Syntax]
|
23
|
+
background = 250, 251, 252
|
24
|
+
text = 86, 88, 105
|
25
|
+
link = 9, 161, 237
|
26
|
+
headertext = 45, 174, 88
|
27
|
+
headertag = 45, 174, 88, 160
|
28
|
+
emphasis = 19, 187, 183
|
29
|
+
dialog = 207, 156, 0
|
30
|
+
altdialog = 207, 156, 0
|
31
|
+
note = 120, 187, 185
|
32
|
+
hidden = 145, 148, 162
|
33
|
+
shortcode = 247, 103, 187
|
34
|
+
keyword = 9, 161, 237
|
35
|
+
tag = 45, 174, 88
|
36
|
+
value = 9, 161, 237
|
37
|
+
optional = 207, 156, 0
|
38
|
+
spellcheckline = 255, 92, 87
|
39
|
+
errorline = 45, 174, 88
|
40
|
+
replacetag = 19, 187, 183
|
41
|
+
modifier = 247, 103, 187
|
42
|
+
texthighlight = 207, 156, 0, 96
|
@@ -13,12 +13,13 @@ link = 38, 139, 210
|
|
13
13
|
headertext = 147, 161, 161
|
14
14
|
headertag = 42, 161, 152
|
15
15
|
emphasis = 38, 139, 210
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
dialog = 42, 161, 152
|
17
|
+
altdialog = 42, 161, 152
|
18
|
+
note = 101, 161, 156
|
19
19
|
hidden = 147, 161, 161
|
20
20
|
shortcode = 147, 161, 161
|
21
21
|
keyword = 133, 153, 0
|
22
|
+
tag = 203, 75, 22
|
22
23
|
value = 203, 75, 22
|
23
24
|
optional = 147, 161, 161
|
24
25
|
spellcheckline = 203, 75, 22
|
@@ -13,12 +13,13 @@ link = 38, 139, 210
|
|
13
13
|
headertext = 88, 110, 117
|
14
14
|
headertag = 42, 161, 152
|
15
15
|
emphasis = 38, 139, 210
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
dialog = 42, 161, 152
|
17
|
+
altdialog = 42, 161, 152
|
18
|
+
note = 27, 102, 96
|
19
19
|
hidden = 88, 110, 117
|
20
20
|
shortcode = 88, 110, 117
|
21
21
|
keyword = 133, 153, 0
|
22
|
+
tag = 203, 75, 22
|
22
23
|
value = 203, 75, 22
|
23
24
|
optional = 88, 110, 117
|
24
25
|
spellcheckline = 203, 75, 22
|
@@ -2,22 +2,38 @@
|
|
2
2
|
name = Tango
|
3
3
|
author = Veronica Berglyd Olsen (adaptation)
|
4
4
|
|
5
|
+
##
|
6
|
+
# Colours:
|
7
|
+
# Background = 30302f : 48, 48, 47
|
8
|
+
# Foreground = eeeeec : 238, 238, 236
|
9
|
+
# Comment = 8f8f8d : 143, 143, 141
|
10
|
+
# Red = ef2929 : 239, 41, 41
|
11
|
+
# Orange = c4a000 : 196, 160, 0
|
12
|
+
# Yellow = fce94f : 252, 233, 79
|
13
|
+
# Green = 8ae234 : 138, 226, 52
|
14
|
+
# Cyan = 34e2e2 : 52, 226, 226
|
15
|
+
# Blue = 3465a4 : 114, 159, 207
|
16
|
+
# Purple = ad7fa8 : 173, 127, 168
|
17
|
+
##
|
18
|
+
|
5
19
|
[Syntax]
|
6
20
|
background = 48, 48, 47
|
7
21
|
text = 238, 238, 236
|
8
|
-
link =
|
9
|
-
headertext =
|
10
|
-
headertag =
|
22
|
+
link = 114, 159, 207
|
23
|
+
headertext = 114, 159, 207
|
24
|
+
headertag = 114, 159, 207, 160
|
11
25
|
emphasis = 196, 160, 0
|
12
|
-
|
13
|
-
|
14
|
-
|
26
|
+
dialog = 138, 226, 52
|
27
|
+
altdialog = 252, 233, 79
|
28
|
+
note = 252, 242, 164
|
15
29
|
hidden = 143, 143, 141
|
16
|
-
shortcode =
|
30
|
+
shortcode = 114, 159, 207
|
17
31
|
keyword = 239, 41, 41
|
18
|
-
|
19
|
-
|
32
|
+
tag = 173, 127, 168
|
33
|
+
value = 239, 41, 41
|
34
|
+
optional = 114, 159, 207
|
20
35
|
spellcheckline = 239, 41, 41
|
21
36
|
errorline = 138, 226, 52
|
22
|
-
replacetag =
|
23
|
-
modifier =
|
37
|
+
replacetag = 52, 226, 226
|
38
|
+
modifier = 114, 159, 207
|
39
|
+
texthighlight = 252, 233, 79, 96
|
@@ -31,15 +31,16 @@ background = 255, 255, 255
|
|
31
31
|
text = 77, 77, 76
|
32
32
|
link = 66, 113, 174
|
33
33
|
headertext = 66, 113, 174
|
34
|
-
headertag = 66, 113, 174
|
34
|
+
headertag = 66, 113, 174, 160
|
35
35
|
emphasis = 245, 135, 31
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
dialog = 113, 140, 0
|
37
|
+
altdialog = 234, 183, 0
|
38
|
+
note = 115, 90, 0
|
39
39
|
hidden = 142, 144, 140
|
40
40
|
shortcode = 66, 113, 174
|
41
41
|
keyword = 240, 40, 41
|
42
|
-
|
42
|
+
tag = 137, 89, 168
|
43
|
+
value = 234, 183, 0
|
43
44
|
optional = 66, 113, 174
|
44
45
|
spellcheckline = 240, 40, 41
|
45
46
|
errorline = 113, 140, 0
|
@@ -29,17 +29,18 @@ licenseurl = https://github.com/chriskempson/tomorrow-theme/blob/master/LICENSE.
|
|
29
29
|
[Syntax]
|
30
30
|
background = 29, 31, 33
|
31
31
|
text = 197, 200, 198
|
32
|
-
link =
|
32
|
+
link = 197, 200, 198, 160
|
33
33
|
headertext = 129, 162, 190
|
34
|
-
headertag =
|
34
|
+
headertag = 94, 119, 139
|
35
35
|
emphasis = 222, 147, 95
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
dialog = 181, 189, 104
|
37
|
+
altdialog = 240, 198, 116
|
38
|
+
note = 240, 219, 178
|
39
39
|
hidden = 150, 152, 150
|
40
40
|
shortcode = 129, 162, 190
|
41
41
|
keyword = 204, 102, 102
|
42
|
-
|
42
|
+
tag = 178, 148, 187
|
43
|
+
value = 240, 198, 116
|
43
44
|
optional = 129, 162, 190
|
44
45
|
spellcheckline = 204, 102, 102
|
45
46
|
errorline = 181, 189, 104
|
@@ -31,15 +31,16 @@ background = 0, 36, 81
|
|
31
31
|
text = 255, 255, 255
|
32
32
|
link = 187, 218, 255
|
33
33
|
headertext = 187, 218, 255
|
34
|
-
headertag = 187, 218, 255
|
34
|
+
headertag = 187, 218, 255, 160
|
35
35
|
emphasis = 255, 197, 143
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
dialog = 209, 241, 169
|
37
|
+
altdialog = 255, 238, 173
|
38
|
+
note = 255, 247, 214
|
39
39
|
hidden = 114, 133, 183
|
40
40
|
shortcode = 187, 218, 255
|
41
41
|
keyword = 255, 157, 164
|
42
|
-
|
42
|
+
tag = 235, 187, 255
|
43
|
+
value = 255, 238, 173
|
43
44
|
optional = 187, 218, 255
|
44
45
|
spellcheckline = 255, 157, 164
|
45
46
|
errorline = 209, 241, 169
|
@@ -31,15 +31,16 @@ background = 0, 0, 0
|
|
31
31
|
text = 234, 234, 234
|
32
32
|
link = 122, 166, 218
|
33
33
|
headertext = 122, 166, 218
|
34
|
-
headertag = 122, 166, 218
|
34
|
+
headertag = 122, 166, 218, 160
|
35
35
|
emphasis = 231, 140, 69
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
dialog = 185, 202, 74
|
37
|
+
altdialog = 231, 197, 71
|
38
|
+
note = 231, 214, 150
|
39
39
|
hidden = 150, 152, 150
|
40
40
|
shortcode = 122, 166, 218
|
41
41
|
keyword = 213, 78, 83
|
42
|
-
|
42
|
+
tag = 195, 151, 216
|
43
|
+
value = 231, 197, 71
|
43
44
|
optional = 122, 166, 218
|
44
45
|
spellcheckline = 213, 78, 83
|
45
46
|
errorline = 185, 202, 74
|
@@ -31,15 +31,16 @@ background = 45, 45, 45
|
|
31
31
|
text = 204, 204, 204
|
32
32
|
link = 102, 153, 204
|
33
33
|
headertext = 102, 153, 204
|
34
|
-
headertag = 102, 153, 204
|
34
|
+
headertag = 102, 153, 204, 160
|
35
35
|
emphasis = 249, 145, 57
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
dialog = 153, 204, 153
|
37
|
+
altdialog = 255, 204, 102
|
38
|
+
note = 255, 230, 179
|
39
39
|
hidden = 153, 153, 153
|
40
40
|
shortcode = 102, 153, 204
|
41
41
|
keyword = 242, 119, 122
|
42
|
-
|
42
|
+
tag = 204, 153, 204
|
43
|
+
value = 255, 204, 102
|
43
44
|
optional = 102, 153, 204
|
44
45
|
spellcheckline = 242, 119, 122
|
45
46
|
errorline = 153, 204, 153
|
@@ -60,7 +60,10 @@ more contributions are listed on the project's <a href="https://crowdin.com/proj
|
|
60
60
|
• <a href="https://github.com/stephenhutchings/typicons.font">Typicons</a> icons by Stephen Hutchings (CC BY-SA 4.0)<br>
|
61
61
|
• <a href="https://github.com/chriskempson/base16">Tomorrow</a> syntax themes by Chris Kempson (MIT License)<br>
|
62
62
|
• <a href="https://github.com/sdras/night-owl-vscode-theme">Owl</a> syntax themes by Sarah Drasner (MIT License)<br>
|
63
|
-
• <a href="https://github.com/altercation/solarized">Solarized</a> themes by Ethan Schoonover (MIT License)
|
63
|
+
• <a href="https://github.com/altercation/solarized">Solarized</a> themes by Ethan Schoonover (MIT License)<br>
|
64
|
+
• <a href="https://github.com/alemvigh">Cyberpunk Night</a> theme by Anders Lemvigh (CC BY-SA 4.0)<br>
|
65
|
+
• <a href="https://draculatheme.com">Dracula</a> theme by Zeno Rocha (MIT License)<br>
|
66
|
+
• <a href="https://github.com/loilo/vscode-snazzy-light">Snazzy Light</a> theme by Florian Reuschel (MIT License)
|
64
67
|
</p>
|
65
68
|
|
66
69
|
<h3>Fonts</h3>
|
@@ -0,0 +1,48 @@
|
|
1
|
+
[Main]
|
2
|
+
name = Dracula
|
3
|
+
description = A dark theme with bright colours
|
4
|
+
author = Veronica Berglyd Olsen (adaptation)
|
5
|
+
credit = Zeno Rocha
|
6
|
+
url = https://draculatheme.com
|
7
|
+
license = MIT
|
8
|
+
licenseurl = https://github.com/dracula/dracula-theme/blob/main/LICENSE
|
9
|
+
icontheme = typicons_dark
|
10
|
+
|
11
|
+
##
|
12
|
+
# Colours:
|
13
|
+
# Background = 282a36 : 40, 42, 54
|
14
|
+
# Foreground = f8f8f2 : 248, 248, 242
|
15
|
+
# Current Line = 44475A : 68, 71, 90
|
16
|
+
# Comment = 6272a4 : 98, 114, 164
|
17
|
+
# Cyan = 8be9fd : 139, 233, 253
|
18
|
+
# Green = 50fa7b : 80, 250, 123
|
19
|
+
# Orange = ffb86c : 255, 184, 108
|
20
|
+
# Pink = ff79c6 : 255, 121, 198
|
21
|
+
# Purple = bd93f9 : 189, 147, 249
|
22
|
+
# Red = ff5555 : 255, 85, 85
|
23
|
+
# Yellow = f1fa8c : 241, 250, 140
|
24
|
+
##
|
25
|
+
|
26
|
+
[Palette]
|
27
|
+
window = 68, 71, 90
|
28
|
+
windowtext = 248, 248, 242
|
29
|
+
base = 40, 42, 54
|
30
|
+
alternatebase = 51, 54, 69
|
31
|
+
text = 248, 248, 242
|
32
|
+
tooltipbase = 241, 250, 140
|
33
|
+
tooltiptext = 40, 42, 54
|
34
|
+
button = 80, 83, 105
|
35
|
+
buttontext = 248, 248, 242
|
36
|
+
brighttext = 68, 71, 90
|
37
|
+
highlight = 166, 129, 218
|
38
|
+
highlightedtext = 248, 248, 242
|
39
|
+
link = 139, 233, 253
|
40
|
+
linkvisited = 139, 233, 253
|
41
|
+
|
42
|
+
[GUI]
|
43
|
+
helptext = 204, 172, 249
|
44
|
+
fadedtext = 98, 114, 164
|
45
|
+
errortext = 255, 85, 85
|
46
|
+
statusnone = 98, 114, 164
|
47
|
+
statussaved = 80, 250, 123
|
48
|
+
statusunsaved = 255, 85, 85
|
novelwriter/common.py
CHANGED
@@ -24,30 +24,32 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
24
24
|
from __future__ import annotations
|
25
25
|
|
26
26
|
import json
|
27
|
-
import uuid
|
28
27
|
import logging
|
29
28
|
import unicodedata
|
29
|
+
import uuid
|
30
30
|
import xml.etree.ElementTree as ET
|
31
31
|
|
32
|
-
from typing import TYPE_CHECKING, Any, Literal
|
33
|
-
from pathlib import Path
|
34
|
-
from datetime import datetime
|
35
32
|
from configparser import ConfigParser
|
33
|
+
from datetime import datetime
|
34
|
+
from pathlib import Path
|
35
|
+
from typing import TYPE_CHECKING, Any, Literal, TypeVar
|
36
36
|
from urllib.parse import urljoin
|
37
37
|
from urllib.request import pathname2url
|
38
38
|
|
39
|
-
from PyQt5.QtGui import QColor, QDesktopServices
|
40
39
|
from PyQt5.QtCore import QCoreApplication, QUrl
|
40
|
+
from PyQt5.QtGui import QColor, QDesktopServices, QFont, QFontInfo
|
41
41
|
|
42
|
-
from novelwriter.enum import nwItemClass, nwItemType, nwItemLayout
|
43
|
-
from novelwriter.error import logException
|
44
42
|
from novelwriter.constants import nwConst, nwLabels, nwUnicode, trConst
|
43
|
+
from novelwriter.enum import nwItemClass, nwItemLayout, nwItemType
|
44
|
+
from novelwriter.error import logException
|
45
45
|
|
46
46
|
if TYPE_CHECKING: # pragma: no cover
|
47
47
|
from typing import TypeGuard # Requires Python 3.10
|
48
48
|
|
49
49
|
logger = logging.getLogger(__name__)
|
50
50
|
|
51
|
+
_Type = TypeVar("_Type")
|
52
|
+
|
51
53
|
|
52
54
|
##
|
53
55
|
# Checker Functions
|
@@ -172,6 +174,11 @@ def isItemLayout(value: Any) -> TypeGuard[str]:
|
|
172
174
|
return isinstance(value, str) and value in nwItemLayout.__members__
|
173
175
|
|
174
176
|
|
177
|
+
def isListInstance(data: Any, check: type[_Type]) -> TypeGuard[list[_Type]]:
|
178
|
+
"""Check that all items of a list is of a given type."""
|
179
|
+
return isinstance(data, list) and all(isinstance(item, check) for item in data)
|
180
|
+
|
181
|
+
|
175
182
|
def hexToInt(value: Any, default: int = 0) -> int:
|
176
183
|
"""Convert a hex string to an integer."""
|
177
184
|
if isinstance(value, str):
|
@@ -272,6 +279,13 @@ def simplified(text: str) -> str:
|
|
272
279
|
return " ".join(str(text).strip().split())
|
273
280
|
|
274
281
|
|
282
|
+
def elide(text: str, length: int) -> str:
|
283
|
+
"""Elide a piece of text to a maximum length."""
|
284
|
+
if len(text) > (cut := max(4, length)):
|
285
|
+
return f"{text[:cut-4].rstrip()} ..."
|
286
|
+
return text
|
287
|
+
|
288
|
+
|
275
289
|
def yesNo(value: int | bool | None) -> Literal["yes", "no"]:
|
276
290
|
"""Convert a boolean evaluated variable to a yes or no."""
|
277
291
|
return "yes" if value else "no"
|
@@ -387,6 +401,16 @@ def cssCol(col: QColor, alpha: int | None = None) -> str:
|
|
387
401
|
return f"rgba({col.red()}, {col.green()}, {col.blue()}, {alpha or col.alpha()})"
|
388
402
|
|
389
403
|
|
404
|
+
def describeFont(font: QFont) -> str:
|
405
|
+
"""Describe a font in a way that can be displayed on the GUI."""
|
406
|
+
if isinstance(font, QFont):
|
407
|
+
info = QFontInfo(font)
|
408
|
+
family = info.family()
|
409
|
+
styles = [v for v in info.styleName().split() if v not in family]
|
410
|
+
return " ".join([f"{info.pointSize()} pt", family] + styles)
|
411
|
+
return "Error"
|
412
|
+
|
413
|
+
|
390
414
|
##
|
391
415
|
# Encoder Functions
|
392
416
|
##
|
@@ -499,12 +523,11 @@ def readTextFile(path: str | Path) -> str:
|
|
499
523
|
|
500
524
|
|
501
525
|
def makeFileNameSafe(text: str) -> str:
|
502
|
-
"""Return a filename
|
526
|
+
"""Return a filename-safe string.
|
503
527
|
See: https://unicode.org/reports/tr15/#Norm_Forms
|
504
528
|
"""
|
505
529
|
text = unicodedata.normalize("NFKC", text).strip()
|
506
|
-
|
507
|
-
return "".join(c for c in text if c.isalnum() or c in allowed)
|
530
|
+
return "".join(c for c in text if c.isprintable() and c not in r'\/:*?"<>|')
|
508
531
|
|
509
532
|
|
510
533
|
def getFileSize(path: Path) -> int:
|
@@ -589,5 +612,3 @@ class NWConfigParser(ConfigParser):
|
|
589
612
|
for i in range(min(len(data), len(result))):
|
590
613
|
result[i] = checkInt(data[i].strip(), result[i])
|
591
614
|
return result
|
592
|
-
|
593
|
-
# END Class NWConfigParser
|