novelWriter 2.4.3__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.
Files changed (109) hide show
  1. {novelWriter-2.4.3.dist-info → novelWriter-2.5b1.dist-info}/METADATA +4 -5
  2. {novelWriter-2.4.3.dist-info → novelWriter-2.5b1.dist-info}/RECORD +109 -101
  3. novelwriter/__init__.py +33 -39
  4. novelwriter/assets/i18n/project_en_GB.json +1 -0
  5. novelwriter/assets/icons/typicons_dark/icons.conf +2 -0
  6. novelwriter/assets/icons/typicons_dark/nw_font.svg +4 -0
  7. novelwriter/assets/icons/typicons_dark/nw_quote.svg +4 -0
  8. novelwriter/assets/icons/typicons_light/icons.conf +2 -0
  9. novelwriter/assets/icons/typicons_light/nw_font.svg +4 -0
  10. novelwriter/assets/icons/typicons_light/nw_quote.svg +4 -0
  11. novelwriter/assets/manual.pdf +0 -0
  12. novelwriter/assets/sample.zip +0 -0
  13. novelwriter/assets/syntax/cyberpunk_night.conf +5 -3
  14. novelwriter/assets/syntax/default_dark.conf +32 -18
  15. novelwriter/assets/syntax/default_light.conf +24 -10
  16. novelwriter/assets/syntax/dracula.conf +44 -0
  17. novelwriter/assets/syntax/grey_dark.conf +5 -4
  18. novelwriter/assets/syntax/grey_light.conf +5 -4
  19. novelwriter/assets/syntax/light_owl.conf +7 -6
  20. novelwriter/assets/syntax/night_owl.conf +7 -6
  21. novelwriter/assets/syntax/snazzy.conf +42 -0
  22. novelwriter/assets/syntax/solarized_dark.conf +4 -3
  23. novelwriter/assets/syntax/solarized_light.conf +4 -3
  24. novelwriter/assets/syntax/tango.conf +27 -11
  25. novelwriter/assets/syntax/tomorrow.conf +6 -5
  26. novelwriter/assets/syntax/tomorrow_night.conf +7 -6
  27. novelwriter/assets/syntax/tomorrow_night_blue.conf +6 -5
  28. novelwriter/assets/syntax/tomorrow_night_bright.conf +6 -5
  29. novelwriter/assets/syntax/tomorrow_night_eighties.conf +6 -5
  30. novelwriter/assets/text/credits_en.htm +4 -1
  31. novelwriter/assets/themes/cyberpunk_night.conf +2 -0
  32. novelwriter/assets/themes/default_dark.conf +1 -0
  33. novelwriter/assets/themes/default_light.conf +1 -0
  34. novelwriter/assets/themes/dracula.conf +47 -0
  35. novelwriter/assets/themes/solarized_dark.conf +1 -0
  36. novelwriter/assets/themes/solarized_light.conf +1 -0
  37. novelwriter/common.py +31 -9
  38. novelwriter/config.py +118 -84
  39. novelwriter/constants.py +40 -26
  40. novelwriter/core/buildsettings.py +63 -66
  41. novelwriter/core/coretools.py +2 -22
  42. novelwriter/core/docbuild.py +51 -40
  43. novelwriter/core/document.py +3 -5
  44. novelwriter/core/index.py +115 -45
  45. novelwriter/core/item.py +8 -19
  46. novelwriter/core/options.py +2 -4
  47. novelwriter/core/project.py +23 -57
  48. novelwriter/core/projectdata.py +1 -3
  49. novelwriter/core/projectxml.py +12 -15
  50. novelwriter/core/sessions.py +3 -5
  51. novelwriter/core/spellcheck.py +4 -9
  52. novelwriter/core/status.py +211 -164
  53. novelwriter/core/storage.py +0 -8
  54. novelwriter/core/tohtml.py +94 -100
  55. novelwriter/core/tokenizer.py +199 -112
  56. novelwriter/core/{tomd.py → tomarkdown.py} +97 -78
  57. novelwriter/core/toodt.py +212 -148
  58. novelwriter/core/toqdoc.py +403 -0
  59. novelwriter/core/tree.py +5 -7
  60. novelwriter/dialogs/about.py +3 -5
  61. novelwriter/dialogs/docmerge.py +1 -3
  62. novelwriter/dialogs/docsplit.py +1 -3
  63. novelwriter/dialogs/editlabel.py +0 -2
  64. novelwriter/dialogs/preferences.py +111 -88
  65. novelwriter/dialogs/projectsettings.py +216 -180
  66. novelwriter/dialogs/quotes.py +3 -4
  67. novelwriter/dialogs/wordlist.py +3 -9
  68. novelwriter/enum.py +31 -25
  69. novelwriter/error.py +8 -15
  70. novelwriter/extensions/circularprogress.py +5 -6
  71. novelwriter/extensions/configlayout.py +18 -18
  72. novelwriter/extensions/eventfilters.py +1 -5
  73. novelwriter/extensions/modified.py +50 -13
  74. novelwriter/extensions/novelselector.py +1 -3
  75. novelwriter/extensions/pagedsidebar.py +9 -12
  76. novelwriter/extensions/simpleprogress.py +1 -3
  77. novelwriter/extensions/statusled.py +1 -3
  78. novelwriter/extensions/switch.py +4 -6
  79. novelwriter/extensions/switchbox.py +7 -6
  80. novelwriter/extensions/versioninfo.py +3 -9
  81. novelwriter/gui/doceditor.py +98 -126
  82. novelwriter/gui/dochighlight.py +237 -183
  83. novelwriter/gui/docviewer.py +46 -94
  84. novelwriter/gui/docviewerpanel.py +3 -10
  85. novelwriter/gui/editordocument.py +1 -3
  86. novelwriter/gui/itemdetails.py +7 -11
  87. novelwriter/gui/mainmenu.py +11 -7
  88. novelwriter/gui/noveltree.py +11 -24
  89. novelwriter/gui/outline.py +11 -23
  90. novelwriter/gui/projtree.py +26 -43
  91. novelwriter/gui/search.py +1 -3
  92. novelwriter/gui/sidebar.py +2 -6
  93. novelwriter/gui/statusbar.py +6 -10
  94. novelwriter/gui/theme.py +23 -48
  95. novelwriter/guimain.py +50 -71
  96. novelwriter/shared.py +30 -15
  97. novelwriter/tools/dictionaries.py +8 -12
  98. novelwriter/tools/lipsum.py +2 -4
  99. novelwriter/tools/manusbuild.py +1 -3
  100. novelwriter/tools/manuscript.py +66 -145
  101. novelwriter/tools/manussettings.py +67 -73
  102. novelwriter/tools/noveldetails.py +6 -11
  103. novelwriter/tools/welcome.py +2 -16
  104. novelwriter/tools/writingstats.py +6 -9
  105. novelwriter/types.py +45 -3
  106. {novelWriter-2.4.3.dist-info → novelWriter-2.5b1.dist-info}/LICENSE.md +0 -0
  107. {novelWriter-2.4.3.dist-info → novelWriter-2.5b1.dist-info}/WHEEL +0 -0
  108. {novelWriter-2.4.3.dist-info → novelWriter-2.5b1.dist-info}/entry_points.txt +0 -0
  109. {novelWriter-2.4.3.dist-info → novelWriter-2.5b1.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 = 50, 100, 50
15
- emphasis = 150, 110, 30
16
- straightquotes = 200, 0, 0
17
- doublequotes = 0, 0, 200
18
- singlequotes = 0, 0, 200
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
- value = 50, 150, 50
35
+ tag = 0, 100, 0
36
+ value = 0, 0, 200
23
37
  optional = 0, 100, 0
24
- spellcheckline = 200, 0, 0
25
- errorline = 0, 150, 0
26
- replacetag = 0, 150, 0
27
- modifier = 150, 110, 30
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
- straightquotes = 200, 200, 200
17
- doublequotes = 200, 200, 200
18
- singlequotes = 200, 200, 200
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
- straightquotes = 20, 20, 20
17
- doublequotes = 20, 20, 20
18
- singlequotes = 20, 20, 20
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
- straightquotes = 222, 61, 58
37
- doublequotes = 8, 145, 106
38
- singlequotes = 255, 235, 149
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
- value = 150, 74, 193
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 = 224, 175, 5
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
- straightquotes = 247, 140, 108
37
- doublequotes = 173, 219, 103
38
- singlequotes = 255, 235, 149
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
- value = 199, 146, 234
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 = 236, 196, 141
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
- straightquotes = 211, 54, 130
17
- doublequotes = 42, 161, 152
18
- singlequotes = 42, 161, 152
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
- straightquotes = 211, 54, 130
17
- doublequotes = 42, 161, 152
18
- singlequotes = 42, 161, 152
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 = 115, 159, 207
9
- headertext = 115, 159, 207
10
- headertag = 52, 101, 164
22
+ link = 114, 159, 207
23
+ headertext = 114, 159, 207
24
+ headertag = 114, 159, 207, 160
11
25
  emphasis = 196, 160, 0
12
- straightquotes = 239, 41, 41
13
- doublequotes = 138, 226, 52
14
- singlequotes = 252, 233, 79
26
+ dialog = 138, 226, 52
27
+ altdialog = 252, 233, 79
28
+ note = 252, 242, 164
15
29
  hidden = 143, 143, 141
16
- shortcode = 115, 159, 207
30
+ shortcode = 114, 159, 207
17
31
  keyword = 239, 41, 41
18
- value = 173, 127, 168
19
- optional = 115, 159, 207
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 = 51, 226, 226
23
- modifier = 196, 160, 0
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
- straightquotes = 240, 40, 41
37
- doublequotes = 113, 140, 0
38
- singlequotes = 234, 183, 0
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
- value = 137, 89, 168
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 = 129, 162, 190
32
+ link = 197, 200, 198, 160
33
33
  headertext = 129, 162, 190
34
- headertag = 129, 162, 190
34
+ headertag = 94, 119, 139
35
35
  emphasis = 222, 147, 95
36
- straightquotes = 204, 102, 102
37
- doublequotes = 181, 189, 104
38
- singlequotes = 240, 198, 116
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
- value = 178, 148, 187
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
- straightquotes = 255, 157, 164
37
- doublequotes = 209, 241, 169
38
- singlequotes = 255, 238, 173
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
- value = 235, 187, 255
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
- straightquotes = 213, 78, 83
37
- doublequotes = 185, 202, 74
38
- singlequotes = 231, 197, 71
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
- value = 195, 151, 216
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
- straightquotes = 242, 119, 122
37
- doublequotes = 153, 204, 153
38
- singlequotes = 255, 204, 102
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
- value = 204, 153, 204
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
  &nbsp;&bull;&nbsp;<a href="https://github.com/stephenhutchings/typicons.font">Typicons</a> icons by Stephen Hutchings (CC BY-SA 4.0)<br>
61
61
  &nbsp;&bull;&nbsp;<a href="https://github.com/chriskempson/base16">Tomorrow</a> syntax themes by Chris Kempson (MIT License)<br>
62
62
  &nbsp;&bull;&nbsp;<a href="https://github.com/sdras/night-owl-vscode-theme">Owl</a> syntax themes by Sarah Drasner (MIT License)<br>
63
- &nbsp;&bull;&nbsp;<a href="https://github.com/altercation/solarized">Solarized</a> themes by Ethan Schoonover (MIT License)
63
+ &nbsp;&bull;&nbsp;<a href="https://github.com/altercation/solarized">Solarized</a> themes by Ethan Schoonover (MIT License)<br>
64
+ &nbsp;&bull;&nbsp;<a href="https://github.com/alemvigh">Cyberpunk Night</a> theme by Anders Lemvigh (CC BY-SA 4.0)<br>
65
+ &nbsp;&bull;&nbsp;<a href="https://draculatheme.com">Dracula</a> theme by Zeno Rocha (MIT License)<br>
66
+ &nbsp;&bull;&nbsp;<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>
@@ -24,6 +24,8 @@ link = 77, 77, 255
24
24
  linkvisited = 50, 0, 80
25
25
 
26
26
  [GUI]
27
+ helptext = 97, 97, 97
28
+ errortext = 255, 77, 77
27
29
  statusnone = 50, 50, 50
28
30
  statussaved = 77, 255, 77
29
31
  statusunsaved = 255, 77, 77
@@ -26,6 +26,7 @@ linkvisited = 102, 153, 204
26
26
 
27
27
  [GUI]
28
28
  helptext = 164, 164, 164
29
+ errortext = 255, 164, 164
29
30
  statusnone = 150, 152, 150
30
31
  statussaved = 39, 135, 78
31
32
  statusunsaved = 138, 32, 32
@@ -26,6 +26,7 @@ linkvisited = 66, 113, 174
26
26
 
27
27
  [GUI]
28
28
  helptext = 92, 92, 92
29
+ errortext = 255, 92, 92
29
30
  statusnone = 120, 120, 120
30
31
  statussaved = 200, 15, 39
31
32
  statusunsaved = 2, 133, 37
@@ -0,0 +1,47 @@
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
+ errortext = 255, 85, 85
45
+ statusnone = 98, 114, 164
46
+ statussaved = 80, 250, 123
47
+ statusunsaved = 255, 85, 85
@@ -25,6 +25,7 @@ linkvisited = 38, 139, 210
25
25
 
26
26
  [GUI]
27
27
  helptext = 166, 161, 149
28
+ errortext = 255, 161, 149
28
29
  statusnone = 88, 110, 117
29
30
  statussaved = 42, 161, 152
30
31
  statusunsaved = 203, 75, 22
@@ -25,6 +25,7 @@ linkvisited = 38, 139, 210
25
25
 
26
26
  [GUI]
27
27
  helptext = 78, 91, 95
28
+ errortext = 255, 91, 95
28
29
  statusnone = 88, 110, 117
29
30
  statussaved = 42, 161, 152
30
31
  statusunsaved = 203, 75, 22
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
  ##
@@ -589,5 +613,3 @@ class NWConfigParser(ConfigParser):
589
613
  for i in range(min(len(data), len(result))):
590
614
  result[i] = checkInt(data[i].strip(), result[i])
591
615
  return result
592
-
593
- # END Class NWConfigParser