novelWriter 2.4.3__py3-none-any.whl → 2.5__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 (123) hide show
  1. {novelWriter-2.4.3.dist-info → novelWriter-2.5.dist-info}/METADATA +4 -5
  2. {novelWriter-2.4.3.dist-info → novelWriter-2.5.dist-info}/RECORD +122 -112
  3. {novelWriter-2.4.3.dist-info → novelWriter-2.5.dist-info}/WHEEL +1 -1
  4. novelwriter/__init__.py +33 -39
  5. novelwriter/assets/i18n/nw_de_DE.qm +0 -0
  6. novelwriter/assets/i18n/nw_en_US.qm +0 -0
  7. novelwriter/assets/i18n/nw_es_419.qm +0 -0
  8. novelwriter/assets/i18n/nw_fr_FR.qm +0 -0
  9. novelwriter/assets/i18n/nw_it_IT.qm +0 -0
  10. novelwriter/assets/i18n/nw_ja_JP.qm +0 -0
  11. novelwriter/assets/i18n/nw_nb_NO.qm +0 -0
  12. novelwriter/assets/i18n/nw_nl_NL.qm +0 -0
  13. novelwriter/assets/i18n/nw_pl_PL.qm +0 -0
  14. novelwriter/assets/i18n/nw_pt_BR.qm +0 -0
  15. novelwriter/assets/i18n/nw_zh_CN.qm +0 -0
  16. novelwriter/assets/i18n/project_en_GB.json +1 -0
  17. novelwriter/assets/i18n/project_pl_PL.json +116 -0
  18. novelwriter/assets/i18n/project_pt_BR.json +74 -74
  19. novelwriter/assets/icons/typicons_dark/icons.conf +2 -0
  20. novelwriter/assets/icons/typicons_dark/nw_font.svg +4 -0
  21. novelwriter/assets/icons/typicons_dark/nw_quote.svg +4 -0
  22. novelwriter/assets/icons/typicons_light/icons.conf +2 -0
  23. novelwriter/assets/icons/typicons_light/nw_font.svg +4 -0
  24. novelwriter/assets/icons/typicons_light/nw_quote.svg +4 -0
  25. novelwriter/assets/manual.pdf +0 -0
  26. novelwriter/assets/sample.zip +0 -0
  27. novelwriter/assets/syntax/cyberpunk_night.conf +5 -3
  28. novelwriter/assets/syntax/default_dark.conf +32 -18
  29. novelwriter/assets/syntax/default_light.conf +24 -10
  30. novelwriter/assets/syntax/dracula.conf +44 -0
  31. novelwriter/assets/syntax/grey_dark.conf +5 -4
  32. novelwriter/assets/syntax/grey_light.conf +5 -4
  33. novelwriter/assets/syntax/light_owl.conf +7 -6
  34. novelwriter/assets/syntax/night_owl.conf +7 -6
  35. novelwriter/assets/syntax/snazzy.conf +42 -0
  36. novelwriter/assets/syntax/solarized_dark.conf +4 -3
  37. novelwriter/assets/syntax/solarized_light.conf +4 -3
  38. novelwriter/assets/syntax/tango.conf +27 -11
  39. novelwriter/assets/syntax/tomorrow.conf +6 -5
  40. novelwriter/assets/syntax/tomorrow_night.conf +7 -6
  41. novelwriter/assets/syntax/tomorrow_night_blue.conf +6 -5
  42. novelwriter/assets/syntax/tomorrow_night_bright.conf +6 -5
  43. novelwriter/assets/syntax/tomorrow_night_eighties.conf +6 -5
  44. novelwriter/assets/text/credits_en.htm +52 -41
  45. novelwriter/assets/themes/cyberpunk_night.conf +3 -0
  46. novelwriter/assets/themes/default_dark.conf +2 -0
  47. novelwriter/assets/themes/default_light.conf +2 -0
  48. novelwriter/assets/themes/dracula.conf +48 -0
  49. novelwriter/assets/themes/solarized_dark.conf +2 -0
  50. novelwriter/assets/themes/solarized_light.conf +2 -0
  51. novelwriter/common.py +33 -12
  52. novelwriter/config.py +184 -98
  53. novelwriter/constants.py +47 -35
  54. novelwriter/core/buildsettings.py +68 -69
  55. novelwriter/core/coretools.py +5 -23
  56. novelwriter/core/docbuild.py +52 -40
  57. novelwriter/core/document.py +3 -5
  58. novelwriter/core/index.py +115 -45
  59. novelwriter/core/item.py +8 -19
  60. novelwriter/core/options.py +2 -4
  61. novelwriter/core/project.py +37 -61
  62. novelwriter/core/projectdata.py +1 -3
  63. novelwriter/core/projectxml.py +12 -15
  64. novelwriter/core/sessions.py +3 -5
  65. novelwriter/core/spellcheck.py +4 -9
  66. novelwriter/core/status.py +211 -164
  67. novelwriter/core/storage.py +0 -8
  68. novelwriter/core/tohtml.py +139 -105
  69. novelwriter/core/tokenizer.py +278 -122
  70. novelwriter/core/{tomd.py → tomarkdown.py} +97 -78
  71. novelwriter/core/toodt.py +257 -166
  72. novelwriter/core/toqdoc.py +419 -0
  73. novelwriter/core/tree.py +5 -7
  74. novelwriter/dialogs/about.py +11 -18
  75. novelwriter/dialogs/docmerge.py +17 -19
  76. novelwriter/dialogs/docsplit.py +17 -19
  77. novelwriter/dialogs/editlabel.py +6 -10
  78. novelwriter/dialogs/preferences.py +200 -164
  79. novelwriter/dialogs/projectsettings.py +225 -189
  80. novelwriter/dialogs/quotes.py +12 -9
  81. novelwriter/dialogs/wordlist.py +9 -15
  82. novelwriter/enum.py +35 -30
  83. novelwriter/error.py +8 -15
  84. novelwriter/extensions/configlayout.py +55 -21
  85. novelwriter/extensions/eventfilters.py +1 -5
  86. novelwriter/extensions/modified.py +70 -14
  87. novelwriter/extensions/novelselector.py +1 -3
  88. novelwriter/extensions/pagedsidebar.py +9 -12
  89. novelwriter/extensions/{circularprogress.py → progressbars.py} +30 -8
  90. novelwriter/extensions/statusled.py +40 -26
  91. novelwriter/extensions/switch.py +4 -6
  92. novelwriter/extensions/switchbox.py +7 -6
  93. novelwriter/extensions/versioninfo.py +3 -9
  94. novelwriter/gui/doceditor.py +120 -139
  95. novelwriter/gui/dochighlight.py +231 -186
  96. novelwriter/gui/docviewer.py +69 -108
  97. novelwriter/gui/docviewerpanel.py +3 -10
  98. novelwriter/gui/editordocument.py +1 -3
  99. novelwriter/gui/itemdetails.py +7 -11
  100. novelwriter/gui/mainmenu.py +22 -18
  101. novelwriter/gui/noveltree.py +11 -24
  102. novelwriter/gui/outline.py +15 -26
  103. novelwriter/gui/projtree.py +39 -65
  104. novelwriter/gui/search.py +10 -3
  105. novelwriter/gui/sidebar.py +2 -6
  106. novelwriter/gui/statusbar.py +29 -37
  107. novelwriter/gui/theme.py +26 -48
  108. novelwriter/guimain.py +162 -160
  109. novelwriter/shared.py +36 -19
  110. novelwriter/text/patterns.py +113 -0
  111. novelwriter/tools/dictionaries.py +10 -20
  112. novelwriter/tools/lipsum.py +10 -16
  113. novelwriter/tools/manusbuild.py +9 -11
  114. novelwriter/tools/manuscript.py +75 -149
  115. novelwriter/tools/manussettings.py +74 -76
  116. novelwriter/tools/noveldetails.py +16 -21
  117. novelwriter/tools/welcome.py +21 -26
  118. novelwriter/tools/writingstats.py +9 -12
  119. novelwriter/types.py +49 -4
  120. novelwriter/extensions/simpleprogress.py +0 -55
  121. {novelWriter-2.4.3.dist-info → novelWriter-2.5.dist-info}/LICENSE.md +0 -0
  122. {novelWriter-2.4.3.dist-info → novelWriter-2.5.dist-info}/entry_points.txt +0 -0
  123. {novelWriter-2.4.3.dist-info → novelWriter-2.5.dist-info}/top_level.txt +0 -0
@@ -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
@@ -1,81 +1,92 @@
1
- <!DOCTYPE html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
1
  <html>
3
2
  <body>
4
3
 
5
4
  <h3>Main Developer</h3>
6
- <p>Veronica Berglyd Olsen (<a href="https://github.com/vkbo">@vkbo</a>)</p>
5
+
6
+ <p>Veronica Berglyd Olsen</p>
7
7
 
8
8
  <h3>Contributors</h3>
9
9
 
10
- <p>
11
- &nbsp;&bull;&nbsp;<b>Concept:</b> Marian Lückhof (<a href="https://github.com/Number042">@Number042</a>)<br>
12
- &nbsp;&bull;&nbsp;<b>Internationalisation:</b> Bruno Meneguello (<a href="https://github.com/bkmeneguello">@bkmeneguello</a>)<br>
13
- &nbsp;&bull;&nbsp;<b>Setup and Packaging:</b> Rachel Powers (<a href="https://github.com/Ryex">@Ryex</a>)
14
- </p>
10
+ <ul>
11
+ <li><b>Early Concept:</b> Marian Lückhof</li>
12
+ <li><b>Internationalisation:</b> Bruno Meneguello</li>
13
+ <li><b>Setup and Packaging:</b> Rachel Powers</li>
14
+ </ul>
15
+
15
16
  <p>For other contributions, see the project's
16
17
  <a href="https://github.com/vkbo/novelWriter/graphs/contributors">Contributors</a> page.</p>
17
18
 
18
19
  <h3>Artwork</h3>
19
20
 
20
- <p>The artwork on the Welcome dialog was created by <a href="https://louisdurrant.art">Louis Durrant</a>.</p>
21
+ <p>The artwork on the Welcome dialog was created by Louis Durrant.</p>
21
22
 
22
23
  <h3>Translations</h3>
23
24
 
24
25
  <p>The default language is English (UK) with English (US) as an option. These are the original
25
26
  translators for the languages currently available:</p>
26
- <p>
27
- &nbsp;&bull;&nbsp;<b>Dutch:</b> Martijn van der Kleijn (<a href="https://github.com/mvdkleijn">@mvdkleijn</a>)<br>
28
- &nbsp;&bull;&nbsp;<b>French:</b> Jan Lüdke (<a href="https://github.com/jyhelle">@jyhelle</a>)<br>
29
- &nbsp;&bull;&nbsp;<b>German:</b> Myian (<a href="https://github.com/heymyian">@heymyian</a>)<br>
30
- &nbsp;&bull;&nbsp;<b>Italian:</b> Riccardo Mangili<br>
31
- &nbsp;&bull;&nbsp;<b>Japanese:</b> hebekeg (<a href="https://github.com/hebekeg">@hebekeg</a>)<br>
32
- &nbsp;&bull;&nbsp;<b>Latin American Spanish:</b> Tommy Marplatt (<a href="https://github.com/tmarplatt">@tmarplatt</a>)<br>
33
- &nbsp;&bull;&nbsp;<b>Norwegian:</b> Veronica Berglyd Olsen (<a href="https://github.com/vkbo">@vkbo</a>)<br>
34
- &nbsp;&bull;&nbsp;<b>Portuguese:</b> Bruno Meneguello (<a href="https://github.com/bkmeneguello">@bkmeneguello</a>)<br>
35
- &nbsp;&bull;&nbsp;<b>Simplified Chinese:</b> Qianzhi Long (<a href="https://github.com/longqzh">@longqzh</a>)
36
- </p>
27
+
28
+ <ul>
29
+ <li><b>Dutch:</b> Martijn van der Kleijn (mvdkleijn)</li>
30
+ <li><b>French:</b> Jan Lüdke (jyhelle)</li>
31
+ <li><b>German:</b> Myian (HeyMyian)</li>
32
+ <li><b>Italian:</b> Riccardo Mangili</li>
33
+ <li><b>Japanese:</b> hebekeg</li>
34
+ <li><b>Latin American Spanish:</b> Tommy Marplatt (tmarplatt)</li>
35
+ <li><b>Norwegian:</b> Veronica Berglyd Olsen (vkbo)</li>
36
+ <li><b>Polish:</b> Anna Maria Polak (Nauthiz)</li>
37
+ <li><b>Portuguese:</b> Bruno Meneguello (bkmeneguello)</li>
38
+ <li><b>Simplified Chinese:</b> Qianzhi Long (longqzh)</li>
39
+ </ul>
37
40
 
38
41
  <p>Additional larger translation contributions:</p>
39
- <p>
40
- &nbsp;&bull;&nbsp;<b>French:</b> Albert Aribaud (<a href="https://github.com/aaribaud">@aaribaud</a>)
41
- </p>
42
+
43
+ <ul>
44
+ <li><b>French:</b> Albert Aribaud (aaribaud)</li>
45
+ <li><b>Portuguese:</b> Oli Maia (olimaia)</li>
46
+ </ul>
42
47
 
43
48
  <p>Translations are managed on <a href="https://crowdin.com/project/novelwriter">Crowdin</a>, and
44
- more contributions are listed on the project's <a href="https://crowdin.com/project/novelwriter/members">Members</a> page.</p>
49
+ more contributions are listed on the project's Members page.</p>
45
50
 
46
51
  <h3>Libraries</h3>
47
52
 
48
53
  <p>The following libraries are dependencies of novelWriter:</p>
49
- <p>
50
- &nbsp;&bull;&nbsp;<a href="https://www.qt.io">Qt5</a> by Qt Company<br>
51
- &nbsp;&bull;&nbsp;<a href="https://www.riverbankcomputing.com/software/pyqt">PyQt5</a> by Riverbank Computing<br>
52
- &nbsp;&bull;&nbsp;<a href="https://abiword.github.io/enchant">Enchant</a> by Dom Lachowicz<br>
53
- &nbsp;&bull;&nbsp;<a href="https://pyenchant.github.io/pyenchant">PyEnchant</a> by Dimitri Merejkowsky
54
- </p>
54
+
55
+ <ul>
56
+ <li><b>Qt5</b> by Qt Company</li>
57
+ <li><b>PyQt5</b> by Riverbank Computing</li>
58
+ <li><b>Enchant</b> by Dom Lachowicz</li>
59
+ <li><b>PyEnchant</b> by Dimitri Merejkowsky</li>
60
+ </ul>
55
61
 
56
62
  <h3>Assets</h3>
57
63
 
58
64
  <p>Some of the assets bundled with novelWriter were adapted from the following sources:</p>
59
- <p>
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
- &nbsp;&bull;&nbsp;<a href="https://github.com/chriskempson/base16">Tomorrow</a> syntax themes by Chris Kempson (MIT License)<br>
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)
64
- </p>
65
+
66
+ <ul>
67
+ <li><b>Typicons</b> icons by Stephen Hutchings (CC BY-SA 4.0)</li>
68
+ <li><b>Tomorrow</b> syntax themes by Chris Kempson (MIT License)</li>
69
+ <li><b>Owl</b> syntax themes by Sarah Drasner (MIT License)</li>
70
+ <li><b>Solarized</b> themes by Ethan Schoonover (MIT License)</li>
71
+ <li><b>Cyberpunk Night</b> theme by Anders Lemvigh (CC BY-SA 4.0)</li>
72
+ <li><b>Dracula</b> theme by Zeno Rocha (MIT License)</li>
73
+ <li><b>Snazzy Light</b> theme by Florian Reuschel (MIT License)</li>
74
+ </ul>
65
75
 
66
76
  <h3>Fonts</h3>
67
77
 
68
78
  <p>The font used for the main novelWriter logo, mimetype and text banners is Pridi. Other fonts are
69
79
  used on buttons and icons.</p>
70
- <p>
71
- &nbsp;&bull;&nbsp;Pridi by Cadson Demak (Open Font License, Version 1.1)<br>
72
- &nbsp;&bull;&nbsp;Source Sans Pro by Paul D. Hunt (SIL Open Font License)
73
- </p>
80
+
81
+ <ul>
82
+ <li><b>Pridi</b> by Cadson Demak (Open Font License, Version 1.1)</li>
83
+ <li><b>Source Sans Pro</b> by Paul D. Hunt (SIL Open Font License)</li>
84
+ </ul>
74
85
 
75
86
  <h3>Special Mentions</h3>
76
87
 
77
- <p>Additional thanks to <a href="https://github.com/johnblommers">@johnblommers</a> who was an early user and who has provided a lot
78
- of very useful feedback over the years.</p>
88
+ <p>Additional thanks to John Blommers who was an early user and who has provided a lot of very
89
+ useful feedback over the years.</p>
79
90
 
80
91
  </body>
81
92
  </html>
@@ -24,6 +24,9 @@ link = 77, 77, 255
24
24
  linkvisited = 50, 0, 80
25
25
 
26
26
  [GUI]
27
+ helptext = 97, 97, 97
28
+ fadedtext = 97, 97, 97
29
+ errortext = 255, 77, 77
27
30
  statusnone = 50, 50, 50
28
31
  statussaved = 77, 255, 77
29
32
  statusunsaved = 255, 77, 77
@@ -26,6 +26,8 @@ linkvisited = 102, 153, 204
26
26
 
27
27
  [GUI]
28
28
  helptext = 164, 164, 164
29
+ fadedtext = 148, 148, 148
30
+ errortext = 255, 164, 164
29
31
  statusnone = 150, 152, 150
30
32
  statussaved = 39, 135, 78
31
33
  statusunsaved = 138, 32, 32
@@ -26,6 +26,8 @@ linkvisited = 66, 113, 174
26
26
 
27
27
  [GUI]
28
28
  helptext = 92, 92, 92
29
+ fadedtext = 108, 108, 108
30
+ errortext = 255, 92, 92
29
31
  statusnone = 120, 120, 120
30
32
  statussaved = 200, 15, 39
31
33
  statusunsaved = 2, 133, 37
@@ -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
@@ -25,6 +25,8 @@ linkvisited = 38, 139, 210
25
25
 
26
26
  [GUI]
27
27
  helptext = 166, 161, 149
28
+ fadedtext = 166, 161, 149
29
+ errortext = 255, 161, 149
28
30
  statusnone = 88, 110, 117
29
31
  statussaved = 42, 161, 152
30
32
  statusunsaved = 203, 75, 22
@@ -25,6 +25,8 @@ linkvisited = 38, 139, 210
25
25
 
26
26
  [GUI]
27
27
  helptext = 78, 91, 95
28
+ fadedtext = 78, 91, 95
29
+ errortext = 255, 91, 95
28
30
  statusnone = 88, 110, 117
29
31
  statussaved = 42, 161, 152
30
32
  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
  ##
@@ -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 safe string.
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
- allowed = (" ", ".", "-", "_")
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