Compare commits
309 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09018d1214 | ||
|
|
de12b22c97 | ||
|
|
d1ae7f5fe2 | ||
|
|
6a441b1c6b | ||
|
|
0afa15f2db | ||
|
|
e4acfb4831 | ||
|
|
a8101c2231 | ||
|
|
2dbd3e2534 | ||
|
|
f871a51e5b | ||
|
|
6ab3c68ebb | ||
|
|
7243ccd44c | ||
|
|
2a96fa1a2d | ||
|
|
a3ed079828 | ||
|
|
976ce16ac2 | ||
|
|
5faeb12a74 | ||
|
|
acc463eb76 | ||
|
|
3b7459ffbc | ||
|
|
cfb19a697a | ||
|
|
ceec43db67 | ||
|
|
229fa39436 | ||
|
|
d0a45bceca | ||
|
|
e1a1b5980e | ||
|
|
0092b3ece6 | ||
|
|
d01c1e867d | ||
|
|
dd3c8dfac8 | ||
|
|
7c9c5a9a76 | ||
|
|
8f9a55c5ca | ||
|
|
d3c9168ebf | ||
|
|
4d153b8d99 | ||
|
|
cb94be5b3c | ||
|
|
af3e2fc6ce | ||
|
|
795007f3f8 | ||
|
|
ea3c5fa758 | ||
|
|
30acf11055 | ||
|
|
d846811fb9 | ||
|
|
175b6747ea | ||
|
|
466eb65a44 | ||
|
|
ef85b2109f | ||
|
|
8cfeb2ce7d | ||
|
|
35563373a6 | ||
|
|
f23164a17b | ||
|
|
52b27b6e56 | ||
|
|
99ec268dd9 | ||
|
|
d304c0919f | ||
|
|
6f3a11ade3 | ||
|
|
52ffa0b675 | ||
|
|
03ee8edda1 | ||
|
|
6dc3e29535 | ||
|
|
d35db6e925 | ||
|
|
fbf0839c73 | ||
|
|
6f885efb7f | ||
|
|
df5b391f27 | ||
|
|
524b965665 | ||
|
|
a3ebe24eb7 | ||
|
|
cae0977a01 | ||
|
|
ecf94d812d | ||
|
|
807a50dae4 | ||
|
|
d574b2796f | ||
|
|
1cae0503e7 | ||
|
|
e4d3e609f8 | ||
|
|
4c86c1a75a | ||
|
|
2f55055c75 | ||
|
|
3e711ebe7f | ||
|
|
61e634a86c | ||
|
|
afd4aa5d1f | ||
|
|
4b5383f1c7 | ||
|
|
95d91562ec | ||
|
|
a43c351e25 | ||
|
|
77a90256ed | ||
|
|
6393ae7621 | ||
|
|
6b3742fa56 | ||
|
|
6b9c81e8c4 | ||
|
|
ab33312872 | ||
|
|
1345bc8fe6 | ||
|
|
5d3a5a335f | ||
|
|
4d877d411b | ||
|
|
c1154682b5 | ||
|
|
99c4b0acd0 | ||
|
|
80520c075d | ||
|
|
17cf9f006a | ||
|
|
a8034b2fb5 | ||
|
|
7999251353 | ||
|
|
2111af8c0c | ||
|
|
6f7745c46a | ||
|
|
a7cf236ba5 | ||
|
|
f22197d494 | ||
|
|
af8af45f39 | ||
|
|
4b112cf9c0 | ||
|
|
733bc89a47 | ||
|
|
17baceb807 | ||
|
|
86487ace10 | ||
|
|
a7422e5bb3 | ||
|
|
b64418c2e9 | ||
|
|
8e895bd797 | ||
|
|
6562f645fe | ||
|
|
80ebf60ec5 | ||
|
|
d569001f32 | ||
|
|
12318b5c31 | ||
|
|
de55106961 | ||
|
|
edca735f2a | ||
|
|
b076de6f81 | ||
|
|
6ddc59bc5b | ||
|
|
ba4a3c16f3 | ||
|
|
de0fb2eba8 | ||
|
|
e40a0ff4aa | ||
|
|
5b126716f7 | ||
|
|
df3f4e2ef7 | ||
|
|
a081a63ba1 | ||
|
|
3a631449ed | ||
|
|
c01c8b2023 | ||
|
|
f7736b87bb | ||
|
|
5b8212f2fa | ||
|
|
dd539be64e | ||
|
|
53e5756745 | ||
|
|
d0d6da3436 | ||
|
|
c6423ffc21 | ||
|
|
cf9a141dc7 | ||
|
|
2480c7ae9f | ||
|
|
8fff376076 | ||
|
|
20c5993e2d | ||
|
|
46c5f1c10d | ||
|
|
f95bbb8760 | ||
|
|
c8fe5e6620 | ||
|
|
2744fb2fd4 | ||
|
|
7fb771eba4 | ||
|
|
760b2dbf0c | ||
|
|
751d0ed857 | ||
|
|
55e1233ca5 | ||
|
|
b83042e456 | ||
|
|
c0fd1f1466 | ||
|
|
03cb6ccb2b | ||
|
|
3fb5d12487 | ||
|
|
b44072a9fa | ||
|
|
24e45fb661 | ||
|
|
c3467d89c2 | ||
|
|
468a0e7416 | ||
|
|
1eafa1c8b6 | ||
|
|
c000307f14 | ||
|
|
cfde84f851 | ||
|
|
d261aee1d0 | ||
|
|
c05463f0ae | ||
|
|
247cd65bb6 | ||
|
|
7149e363b1 | ||
|
|
536e828cc6 | ||
|
|
821e3c4be5 | ||
|
|
a06144730f | ||
|
|
d162b77234 | ||
|
|
ec5352c13c | ||
|
|
4e5a08d3dd | ||
|
|
2d9b57b534 | ||
|
|
3e66968387 | ||
|
|
1771dd2130 | ||
|
|
b0a4ac055a | ||
|
|
8bb0588b2b | ||
|
|
147d6b95d7 | ||
|
|
6a7262b817 | ||
|
|
738f022212 | ||
|
|
9081380255 | ||
|
|
e64fb28d89 | ||
|
|
eb0fac8a43 | ||
|
|
bdc1f0a5d4 | ||
|
|
8a12b03a1f | ||
|
|
01a4ec8d76 | ||
|
|
16954c3bba | ||
|
|
c6944876f1 | ||
|
|
33e0895cdf | ||
|
|
a4d8c22cd0 | ||
|
|
becb404203 | ||
|
|
026aeb3d82 | ||
|
|
9153707075 | ||
|
|
0feac3163f | ||
|
|
7ddb1819f2 | ||
|
|
9ddbe2f789 | ||
|
|
102885da6e | ||
|
|
ded03e10c5 | ||
|
|
991e4fd3e2 | ||
|
|
c0b1d0ad3d | ||
|
|
5befd244e6 | ||
|
|
144ba66d9d | ||
|
|
46c8bedd66 | ||
|
|
d42074f8ea | ||
|
|
bcadc40998 | ||
|
|
ace1df7336 | ||
|
|
3a2e2ff478 | ||
|
|
cd1f19355a | ||
|
|
05174cd84c | ||
|
|
7247d4dc76 | ||
|
|
239ca55ba9 | ||
|
|
523aef38cc | ||
|
|
294bf51f8a | ||
|
|
8133e374d1 | ||
|
|
6bb9ec0dc1 | ||
|
|
c26cfd5372 | ||
|
|
8afe3ed039 | ||
|
|
b156eee209 | ||
|
|
add499af89 | ||
|
|
ca3337914c | ||
|
|
5453d2ada1 | ||
|
|
c3aa8fec56 | ||
|
|
cfcf05fdad | ||
|
|
423bde0c03 | ||
|
|
c254581a3f | ||
|
|
ca27dc65b7 | ||
|
|
cdb84851b2 | ||
|
|
227c30cce3 | ||
|
|
b1c6021545 | ||
|
|
aed843a4f2 | ||
|
|
101c595a48 | ||
|
|
cdaae3fb46 | ||
|
|
0ae7694954 | ||
|
|
f79c0b93ab | ||
|
|
439938ba58 | ||
|
|
85cb93b396 | ||
|
|
8ef5eea825 | ||
|
|
b8af6d3990 | ||
|
|
f78f59dc2a | ||
|
|
4defc1d4a3 | ||
|
|
fb7bf6fb98 | ||
|
|
c0f48b91e6 | ||
|
|
9da99e3183 | ||
|
|
beaa583bc8 | ||
|
|
c7e953fc24 | ||
|
|
44a0d21b35 | ||
|
|
70f748efac | ||
|
|
6e2c5be14e | ||
|
|
7d9040005e | ||
|
|
dc2c6d2a0d | ||
|
|
370116718a | ||
|
|
9a9b2c6d2f | ||
|
|
37c935d027 | ||
|
|
1279834849 | ||
|
|
ea50ae3279 | ||
|
|
f51720dbd8 | ||
|
|
d090230b67 | ||
|
|
6a3f6048c2 | ||
|
|
1bd82954c2 | ||
|
|
44721fc797 | ||
|
|
66cf7cce78 | ||
|
|
c5c9726794 | ||
|
|
8f25be8cb2 | ||
|
|
78958ed5cf | ||
|
|
bdff3b4ee2 | ||
|
|
459a8e5cde | ||
|
|
0869f209ab | ||
|
|
d15e4ebb17 | ||
|
|
d6fae17b3b | ||
|
|
dd82c935e5 | ||
|
|
bc414246d2 | ||
|
|
27ea697b90 | ||
|
|
f38f25f65a | ||
|
|
3edb76abbf | ||
|
|
91c6e13cbc | ||
|
|
c6aa6d575d | ||
|
|
569cb68cca | ||
|
|
fcd94326ef | ||
|
|
ee97dce900 | ||
|
|
72ba4ae74d | ||
|
|
58a7dc0a5a | ||
|
|
7799e9f253 | ||
|
|
d97ce592f8 | ||
|
|
8859fc7b6b | ||
|
|
57b3aa2032 | ||
|
|
79513bcbe5 | ||
|
|
ef9e84f2ce | ||
|
|
9270550364 | ||
|
|
2af1d60480 | ||
|
|
5b5134148b | ||
|
|
210c1079cd | ||
|
|
20c996e87e | ||
|
|
37f56a34f4 | ||
|
|
24ea5f2f2b | ||
|
|
53a4725d62 | ||
|
|
d932beb37d | ||
|
|
868526e806 | ||
|
|
bce4a164b8 | ||
|
|
aea4192213 | ||
|
|
415d46d659 | ||
|
|
c6cbe4cc0d | ||
|
|
82349d39b7 | ||
|
|
3e3335be39 | ||
|
|
44adc42fa6 | ||
|
|
ef1fc0943d | ||
|
|
bb2c2bb7fe | ||
|
|
fa8a954bc0 | ||
|
|
45ab705175 | ||
|
|
acf8170f29 | ||
|
|
6e57bc0fc0 | ||
|
|
b3fb1db07c | ||
|
|
cca309d7d7 | ||
|
|
dccc442852 | ||
|
|
9f7fc90f2d | ||
|
|
c3415ade1b | ||
|
|
30bedb29d6 | ||
|
|
29e83da077 | ||
|
|
2a2b12f0a5 | ||
|
|
3bd67b4f1d | ||
|
|
3c4673724e | ||
|
|
a87a94ffeb | ||
|
|
f1ac1f7c21 | ||
|
|
eda054ae11 | ||
|
|
5fa6c2ad99 | ||
|
|
a6647a0f4f | ||
|
|
fc75bdbebb | ||
|
|
ac549f75b0 | ||
|
|
a2b2f70671 | ||
|
|
23bd5dfc41 | ||
|
|
0566fc38af | ||
|
|
69bf6a64aa | ||
|
|
3ca2c6de66 |
5
.flake8
Normal file
@@ -0,0 +1,5 @@
|
||||
[flake8]
|
||||
ignore = E133,E221,E226,E228,E241,W503,ANN101,ANN102,ANN401
|
||||
per-file-ignores=tests/*:ANN
|
||||
max-line-length = 99
|
||||
exclude = docs/*
|
||||
47
.github/workflows/build.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
- name: Python Setup
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
python-version: "3.12"
|
||||
architecture: x64
|
||||
|
||||
- name: Install Packages (apt)
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
novelwriter/assets/manual.pdf
|
||||
novelwriter/assets/i18n/*.qm
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
retention-days: 14
|
||||
|
||||
buildLinux:
|
||||
needs: buildAssets
|
||||
@@ -72,11 +72,16 @@ jobs:
|
||||
name: AppImage-${{ matrix.python-version }}-${{ matrix.linux-tag }}
|
||||
path: dist_appimage
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
retention-days: 14
|
||||
|
||||
buildMac:
|
||||
buildMac-AMD64:
|
||||
needs: buildAssets
|
||||
# Stay on macos-12 due to https://github.com/create-dmg/create-dmg/issues/143
|
||||
runs-on: macos-12
|
||||
env:
|
||||
PYTHON_VERSION: "3.12"
|
||||
PACKAGE_ARCH: x86_64
|
||||
MINICONDA_ARCH: x86_64
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -88,12 +93,40 @@ jobs:
|
||||
path: novelwriter/assets
|
||||
|
||||
- name: Build App Bundle
|
||||
run: ./setup/macos/build.sh
|
||||
run: ./setup/macos/build.sh $PYTHON_VERSION $PACKAGE_ARCH $MINICONDA_ARCH
|
||||
|
||||
- name: Upload DMG
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: MacOS-DMG
|
||||
name: MacOS-AMD64-DMG
|
||||
path: dist_macos
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
retention-days: 14
|
||||
|
||||
buildMac-M1:
|
||||
needs: buildAssets
|
||||
runs-on: macos-14
|
||||
env:
|
||||
PYTHON_VERSION: "3.12"
|
||||
PACKAGE_ARCH: aarch64
|
||||
MINICONDA_ARCH: arm64
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: nw-assets
|
||||
path: novelwriter/assets
|
||||
|
||||
- name: Build App Bundle
|
||||
run: ./setup/macos/build.sh $PYTHON_VERSION $PACKAGE_ARCH $MINICONDA_ARCH
|
||||
|
||||
- name: Upload DMG
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: MacOS-M1-DMG
|
||||
path: dist_macos
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
|
||||
32
.github/workflows/i18n.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: i18n
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- i18n/*
|
||||
|
||||
jobs:
|
||||
buildI18n:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Python Setup
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
architecture: x64
|
||||
- name: Install Packages (apt)
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install qttools5-dev-tools
|
||||
- name: Checkout Source
|
||||
uses: actions/checkout@v4
|
||||
- name: Build Assets
|
||||
run: python pkgutils.py qtlrelease
|
||||
- name: Upload Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: nw-i18n
|
||||
path: |
|
||||
novelwriter/assets/i18n/*.qm
|
||||
if-no-files-found: error
|
||||
retention-days: 7
|
||||
8
.github/workflows/syntax.yml
vendored
@@ -4,11 +4,11 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
- release
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
- release
|
||||
|
||||
jobs:
|
||||
checkSyntax:
|
||||
@@ -22,9 +22,9 @@ jobs:
|
||||
- name: Checkout Source
|
||||
uses: actions/checkout@v4
|
||||
- name: Install flake8
|
||||
run: pip install flake8 flake8-pep585
|
||||
run: pip install -r requirements-dev.txt
|
||||
- name: Syntax Check
|
||||
run: |
|
||||
flake8 --version
|
||||
flake8 novelwriter --count --show-source --statistics
|
||||
flake8 tests --count --show-source --statistics
|
||||
flake8 tests --count --show-source --statistics --extend-ignore ANN
|
||||
|
||||
8
.github/workflows/test_linux.yml
vendored
@@ -4,11 +4,11 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
- release
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
- release
|
||||
|
||||
jobs:
|
||||
testLinux:
|
||||
@@ -38,4 +38,6 @@ jobs:
|
||||
export QT_QPA_PLATFORM=offscreen
|
||||
pytest -v --cov=novelwriter --timeout=60
|
||||
- name: Upload to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
uses: codecov/codecov-action@v4
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
12
.github/workflows/test_mac.yml
vendored
@@ -4,20 +4,20 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
- release
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
- release
|
||||
|
||||
jobs:
|
||||
testMac:
|
||||
runs-on: macos-latest
|
||||
runs-on: macos-13
|
||||
steps:
|
||||
- name: Python Setup
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
python-version: "3.12"
|
||||
architecture: x64
|
||||
- name: Install Packages (brew)
|
||||
run: |
|
||||
@@ -32,4 +32,6 @@ jobs:
|
||||
export QT_QPA_PLATFORM=offscreen
|
||||
pytest -v --cov=novelwriter --timeout=60
|
||||
- name: Upload to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
uses: codecov/codecov-action@v4
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
10
.github/workflows/test_win.yml
vendored
@@ -4,11 +4,11 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
- release
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
- release
|
||||
|
||||
jobs:
|
||||
testWin:
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
- name: Python Setup
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
python-version: "3.12"
|
||||
architecture: x64
|
||||
- name: Checkout Source
|
||||
uses: actions/checkout@v4
|
||||
@@ -28,4 +28,6 @@ jobs:
|
||||
run: |
|
||||
pytest -v --cov=novelwriter --timeout=60
|
||||
- name: Upload to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
uses: codecov/codecov-action@v4
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
3
.gitignore
vendored
@@ -50,3 +50,6 @@ ToC.txt
|
||||
# Coverage
|
||||
/.coverage
|
||||
/coverage.*
|
||||
|
||||
# Other
|
||||
/test.py
|
||||
|
||||
231
CHANGELOG.md
@@ -1,5 +1,236 @@
|
||||
# novelWriter Changelog
|
||||
|
||||
## Version 2.4.2 [2024-05-18]
|
||||
|
||||
### Release Notes
|
||||
|
||||
This is a patch release that fixes two minor font issues and updates the Dutch and Chinese
|
||||
translations.
|
||||
|
||||
### Detailed Changelog
|
||||
|
||||
**Bugfixes**
|
||||
|
||||
* Change the preview widget in the Manuscript Build tool to use the document font only for the
|
||||
document itself, not the yellow heading stating the age of the previewed text. PR #1863.
|
||||
* Fixes the syntax highlighter so that it is re-initialised when the document editor is
|
||||
re-initialised, so that changes to document font size regenerates the heading font sizes as well.
|
||||
Issue #1865. PR #1866.
|
||||
|
||||
**Internationalisation**
|
||||
|
||||
* Dutch translation updated by Martijn van der Kleijn (@mvdkleijn). PR #1872.
|
||||
* Chinese translation updated by @longqzh. PR #1872.
|
||||
|
||||
----
|
||||
|
||||
## Version 2.4.1 [2024-05-06]
|
||||
|
||||
### Release Notes
|
||||
|
||||
This is a patch release that fixes a number of minor issues with the Manuscript Build tool. The
|
||||
only critical fix is related to a potential crash when deleting a build entry when its settings
|
||||
dialog is still open.
|
||||
|
||||
### Detailed Changelog
|
||||
|
||||
**Bugfixes**
|
||||
|
||||
* Fixed an issue that could crash novelWriter if a build settings entry was deleted from the
|
||||
Manuscript tool while its settings window was open. PR #1845.
|
||||
|
||||
**Improvements**
|
||||
|
||||
* Changed the font used for the document editor and viewer header and footer from the one used for
|
||||
the document text to the one used for the user interface. Issue #1842. PR #1843.
|
||||
* Added a save document step in the editor before running a manuscript build or a preview job. This
|
||||
ensures that the text in the editor is included in the manuscript. Issue #1835. PR #1846.
|
||||
* Restore preview panel scroll bar position after updating the preview on the Manuscript tool.
|
||||
Issue #1837. PR #1846.
|
||||
* Close all non-modal dialogs when a project is closed. PR #1848.
|
||||
|
||||
**Code Improvements**
|
||||
|
||||
* Fixed an issue with the Build Settings dialog that blocks the garbage collector from deleting the
|
||||
dialog after it's been closed. PR #1843.
|
||||
* Remove some deprecated translation entries from the translation files. PR #1850.
|
||||
|
||||
----
|
||||
|
||||
## Version 2.4 [2024-04-20]
|
||||
|
||||
### Release Notes
|
||||
|
||||
This release adds a new global search feature. The tool is still relatively basic, and will likely
|
||||
be extended in later releases.
|
||||
|
||||
Among new text editing features is the ability to highlight text using `[m]text[/m]` shortcodes.
|
||||
The code `[m]` is for "mark", which is the equivalent code in HTML.
|
||||
|
||||
A second feature added for text editing is the ability to add an alternatively formatted scene
|
||||
heading by adding a `!` to the markup, like for chapters and main titles. This allows to
|
||||
distinguish between two scene formatting styles, `### Title` and `###! Title`, which can for
|
||||
instance be used for soft and hard scene breaks.
|
||||
|
||||
The **Manuscript Build** tool has also been extended with multiple new formatting options.
|
||||
|
||||
See the website for complete [Release Notes](https://novelwriter.io/releases/release_2_4.html).
|
||||
|
||||
### Detailed Changelog
|
||||
|
||||
**Bugfixes**
|
||||
|
||||
* Fixed background colour on some widgets on the new Project Search tool. PR #1800.
|
||||
* Fixed a bug when using bold/italic/strike through toggle on an existing text selection in the
|
||||
editor. Issue #1807. PR #1808.
|
||||
* An index out of bounds error in the word counter has been fixed. It could only be triggered by a
|
||||
single line only containing a ">" character. Issues #1816 and #1825. PR #1817.
|
||||
* Fixed an issue where not all theme colours were completely reset before changing theme. PR #1820.
|
||||
* Shortcodes are no longer passed to the spell checker. PR #1823.
|
||||
|
||||
**Improvements**
|
||||
|
||||
* Made placeholder text for search read as "Search for" and "Replace with". PR #1799.
|
||||
* The initial count for adding chapter and scenes to new project in the Welcome dialog has been
|
||||
changed to 0. The user must now select to add chapters and scenes. Issue #1811. PR #1815.
|
||||
|
||||
**Documentation**
|
||||
|
||||
* Updated the documentation for 2.4 features. PR #1818.
|
||||
|
||||
**Internationalisation**
|
||||
|
||||
* Norwegian and US English translations updated by Veronica Berglyd Olsen (@vkbo).
|
||||
PRs #1799 and #1814.
|
||||
* Latin American Spanish translation updated by Tommy Marplatt (@tmarplatt). PR #1814.
|
||||
* Italian translation updated by Lou Cyper (loucyper1). PR #1814.
|
||||
* Japanese translation updated by @hebekeg. PR #1814.
|
||||
* French translation updated by Albert Aribaud (@aaribaud). PR #1821.
|
||||
* German translation updated by Myian (@HeyMyian). PR #1821.
|
||||
|
||||
----
|
||||
|
||||
## Version 2.4 RC 1 [2024-04-06]
|
||||
|
||||
### Release Notes
|
||||
|
||||
This is a release candidate of the next release version, and is intended for testing purposes.
|
||||
Please be careful when using this version on writing projects, and make frequent backups.
|
||||
|
||||
### Detailed Changelog
|
||||
|
||||
**Bugfixes**
|
||||
|
||||
* A number of issues GUI icon scaling has been fixed. Icons and buttons are supposed to scale
|
||||
relative to the GUI font size, but several of them were not. Issue #1787. PR #1788.
|
||||
* The persistence of button state for the editor search box has been improved. The present state
|
||||
was only saved when the search box was actively closed, and there were several scenarios where
|
||||
this didn't happen. The button states are now tracked in the central config, and will always be
|
||||
preserved. Issue #1794. PR #1795.
|
||||
|
||||
**Other Improvements**
|
||||
|
||||
* A placeholder icon has been added for cases where users have their own icon theme, and icons are
|
||||
missing. Issue #1780. PR #1781.
|
||||
* The project search now refreshes the search results for the currently open document when it's
|
||||
being edited. PR #1782.
|
||||
* When activating project search from the editor while text is selected, the search box is
|
||||
populated with this text. Issue #1789. PR #1790.
|
||||
|
||||
**Packaging**
|
||||
|
||||
* The project has moved from using a `setup.cfg` to only using the `pyproject.toml` meta data file
|
||||
for packaging. This is the preferred file format now. PR #1791.
|
||||
|
||||
**Code Improvements**
|
||||
|
||||
* The part of the code related to Qt widgets and flags has been updated and refactored in
|
||||
preparation for the eventual move to the Qt6 framework. Part of issue #1142. PR #1792.
|
||||
* The Open Document writer class has been refactored and improved. PR #1796.
|
||||
|
||||
----
|
||||
|
||||
## Version 2.4 Beta 1 [2024-03-26]
|
||||
|
||||
### Release Notes
|
||||
|
||||
This is a beta release of the next release version, and is intended for testing purposes. Please be
|
||||
careful when using this version on live writing projects, and make sure you take frequent backups.
|
||||
|
||||
### Detailed Changelog
|
||||
|
||||
**Major Features**
|
||||
|
||||
* A global search feature has been added to the main sidebar. The search panel replaces the project
|
||||
and novel tree when activated. PR #1775. Issue #894.
|
||||
* A new shortcode to highlight text has been added. PR #1715. Issue #705.
|
||||
* A new heading format for hard scene breaks has been added. It uses `###!` heading markup. The
|
||||
only affect this has in the GUI is that these headings can be independently formatted in the
|
||||
Manuscript tool. PR #1753. Issue #1050.
|
||||
* The document editor and viewer now have a dropdown menu in the header listing all headings of the
|
||||
current document for quick navigation. The list is capped at 30 entries. PR #1764. issue #1059.
|
||||
|
||||
**Build Tool Improvements**
|
||||
|
||||
* The Manuscript Build Tool now has a word stats section below the preview that shows a number of
|
||||
word and character counts for the previewed text. PR #1717. Issues #1114 and #1116.
|
||||
* The Manuscript Build Tool now shows an outline of the previewed document as a tab next to the
|
||||
build settings list. PR #1768. Issue #1765.
|
||||
* Tabs handling in HTML output now has a separate setting from the other format. PR #1723.
|
||||
* Hard line breaks can now be excluded from Markdown builds. PR #1723. Issue #944.
|
||||
* It is now possible to control the centring and page breaks of partition, chapter and scene
|
||||
headings. PR #1723. Issues #1117 and #1661.
|
||||
* Special titles (`#!`) can now be used in notes as well. PR #1723.
|
||||
* Meta data categories can be filtered out from the manuscript. PR #1723. issue #1132.
|
||||
* Any heading in a novel document can now be hidden in the manuscript. PR #1759. Issue #1756.
|
||||
* First line of a paragraph can now be indented in the manuscript. PR #1761. Issue #906.
|
||||
* Each meta data entry in HTML builds have a new class assigned to it that matches the tag used in
|
||||
the text. PR #1767. Issue #1134.
|
||||
|
||||
**Other Improvements**
|
||||
|
||||
* The percentage progress counter in the editor document footer now counts progress per character
|
||||
instead of per line. This is only noticeable on short documents. PR #1725.
|
||||
* Some improvements have been made to terms on the GUI and some strings have been simplified in
|
||||
order to be easier to understand and to translate. PR #1727. Issue #1726.
|
||||
* Dates are now formatted according to the selected locale, if such a locale is available. If not,
|
||||
it falls back to the local system locale. PR #1755. Issue #1739.
|
||||
|
||||
**Code Improvements**
|
||||
|
||||
* The tokenization of the novelWriter markup format has been refactored and improved. PR #1724.
|
||||
* A way to read project documents fast has been added. It is useful many places in the code where
|
||||
only the text is needed, not the meta data. PR #1777.
|
||||
|
||||
----
|
||||
|
||||
## Version 2.3.1 [2024-03-17]
|
||||
|
||||
### Release Notes
|
||||
|
||||
This is a patch release that fixes several issues with translations into other languages than the
|
||||
default English, and adds completed translations for French.
|
||||
|
||||
### Detailed Changelog
|
||||
|
||||
**Internationalisation**
|
||||
|
||||
* Fix untranslated text on the "Project Word List" dialog. PR #1744. Issue #1746.
|
||||
* Fix untranslated text on the dialog that pops up after an upgrade, PR #1754. Issue #1749.
|
||||
* Fix error in Norwegian translation. PR #1744.
|
||||
* Allow the translated text for adding chapter and scenes on the Welcome dialog to flow around the
|
||||
number selector since the number is inserted into the sentence, and not all languages will split
|
||||
the sentence around the number like is done in English. PR #1754. Issue #1750.
|
||||
* French translation updated by Albert Aribaud (@aaribaud). PR #1760.
|
||||
* Minor updates to other translations for the 2.3.1 fixes by other contributors. PR #1760.
|
||||
|
||||
**Other Changes**
|
||||
|
||||
* Bump the revision of the project file format to 1.5 Revision 3 from Revision 2. This should have
|
||||
been done in the 2.3 release due to the addition of the Templates root folder type. PR #1748.
|
||||
|
||||
----
|
||||
|
||||
## Version 2.3 [2024-03-10]
|
||||
|
||||
### Release Notes
|
||||
|
||||
@@ -1,45 +1,44 @@
|
||||
# Contributing Guide
|
||||
|
||||
When contributing to this repository, please first discuss the change you wish to make via the
|
||||
issue tracker or the discussions page with the owner of this repository. Especially if it is
|
||||
regarding new features. If you just want to make a minor correction, like fix a typo or similar,
|
||||
feel free to just make a pull request directly.
|
||||
When contributing to this repository, please first discuss the change you wish to make with the
|
||||
owner. Either via the issue tracker or on the discussions page. Especially if it is regarding new
|
||||
features. If you just want to make a minor correction, like fix a typo or similar, feel free to
|
||||
just make a pull request directly.
|
||||
|
||||
The following contributions are welcome:
|
||||
**The following contributions are welcome:**
|
||||
|
||||
* Bugfixes for new or existing bugs. Please also report new bugs in the issue tracker even if you
|
||||
also provide a fix. It makes it easier to keep track of what has been fixed and when.
|
||||
* Translations via the [crowdin project page](https://crowdin.com/project/novelwriter).
|
||||
* Translations made via the [Crowdin project page](https://crowdin.com/project/novelwriter).
|
||||
* Improvements to the documentation. Particularly if the documentation is unclear. Please don't
|
||||
make any larger changes to the documentation without discussing if with the maintainer first.
|
||||
* Adaptations, installation or packaging features targeting specific operating systems.
|
||||
|
||||
Please do not:
|
||||
**Please do not:**
|
||||
|
||||
* Make a pull request that restructures or reformats existing code. If you think some parts of the
|
||||
* Make a pull request that restructures or reformats existing code. If you think some part of the
|
||||
code could be improved, please make an issue thread or start a discussion. The same applies to
|
||||
any text document in the repository.
|
||||
|
||||
## Pull Requests
|
||||
## Picking the Correct Branch for a Pull Request
|
||||
|
||||
This project follows the [OneFlow](https://www.endoflineblog.com/oneflow-a-git-branching-model-and-workflow)
|
||||
model. The `main` branch is the default branch. For general changes, please make a new branch in
|
||||
your own fork from the current `main` branch. Do not make pull requests from your own `main`
|
||||
branch.
|
||||
The `main` branch is the default branch. For general changes, please make a new branch in your own
|
||||
fork from the current `main` branch. Do not make pull requests from your copy of the `main` branch.
|
||||
|
||||
**Note:** If your contribution is a bugfix for a specific version, please make a bugfix branch from
|
||||
the tag you want the fix to be applied to, not directly from the `main` branch. This is important.
|
||||
As of April 2024, releases are made from the `release` branch. If you are submitting a fix to a
|
||||
current release you must do so from the `release` branch. If you make such a fix on the `main`
|
||||
branch, **it cannot be included in a patch release**. This also applies to the documentation for
|
||||
the latest release published on the main website.
|
||||
|
||||
Also check the following:
|
||||
**Also check the following:**
|
||||
|
||||
* Make sure your code passes all tests and conforms to the style guide. You can check that the
|
||||
code generally conforms by running the Python linting tool `flake8` from the root of the project
|
||||
folder, although it doesn't check everything. The same check is also run on pull requests by the
|
||||
maintainer.
|
||||
folder, although it doesn't check everything. The same check is also run on pull requests.
|
||||
* Please provide a description of the changes in the pull request under the summary section of the
|
||||
pull request template, and reference any related issues by providing the issue number.
|
||||
* Do not change the version number.
|
||||
* Do not submit files that were not actively changed but have otherwise been modifed. This is
|
||||
* Do not submit files that were not actively changed but have otherwise been modified. This is
|
||||
mostly an issue with translation files. The language tool may update all files in the `i18n`
|
||||
folder.
|
||||
|
||||
@@ -68,14 +67,14 @@ style guide, but with a few exceptions. Some key points are listed below.
|
||||
is the recommended line length in PEP8, but this is often too restrictive. 99 characters are
|
||||
acceptable when that is more practical. Readability has priority. Generally, if a code statement
|
||||
requires multiple lines, the lines should wrap at 79 characters if possible. If wrapping can be
|
||||
avoided by going to 99, then that is generally preferrable.
|
||||
avoided by going to 99, then that is generally preferable.
|
||||
* For text files, the text should be wrapped at 99 character. The exception is markdown image tags
|
||||
and urls which can run past that limit.
|
||||
|
||||
**Variable and Function Names**
|
||||
|
||||
* PEP8 allows for camelCase for consistency with existing code. The Qt library uses camelCase, so
|
||||
the Python source code does too.
|
||||
the novelWriter source code does too.
|
||||
* The exception to the above is for constants. They should always be in upper snake case, like PEP8
|
||||
states.
|
||||
|
||||
@@ -83,19 +82,29 @@ style guide, but with a few exceptions. Some key points are listed below.
|
||||
|
||||
* Only indentation by multiples of 4 spaces is allowed.
|
||||
* No trailing spaces should occur on any line in the source code, including empty lines.
|
||||
* Ideally, a function should end on the same indention level as it started. Exceptions are allowed
|
||||
if it makes the code easier to follow.
|
||||
* All common line wrapping methods are allowed in the code, but avoid deep indentations.
|
||||
* Aligning operators and attributes in columns with multiple spaces is not allowed by PEP8. The
|
||||
rule is relaxed a bit here. Alignment is allowed when populating large dictionaries or setting
|
||||
many class attributes. It does improve readability in such cases, but should not be overused.
|
||||
|
||||
**Type Annotation**
|
||||
|
||||
* All functions must be properly type annotated, and a return type stated in all cases.
|
||||
* Do not use `List`, `Dict`, `Tuple`, etc, annotations that were deprecated in Python 3.9. You can
|
||||
install the `flake8-pep585` extension to make sure you don't forget. This is also checked by the
|
||||
syntax action run on pull requests.
|
||||
* If annotations require a more recent Python version than the minimum version stated in the
|
||||
project's `pyproject.toml`, hide it under an `if TYPE_CHECKING` condition so that the code can
|
||||
still run on older versions. It's OK to require a more recent version for development.
|
||||
|
||||
### Linting with `flake8`
|
||||
|
||||
A good tool for checking Python code for errors and code style is `flake8`. The documentation is
|
||||
available [here](https://flake8.pycqa.org/en/latest/).
|
||||
|
||||
The `setup.cfg` file in the root of this project has the following settings for `flake8` that
|
||||
matches the above code style:
|
||||
The `.flake8` file in the root of this project has the following settings for that matches the
|
||||
required code style:
|
||||
|
||||
```conf
|
||||
[flake8]
|
||||
ignore = E133,E221,E226,E228,E241,W503
|
||||
@@ -115,7 +124,7 @@ command will give you a detailed description of the code lines that do not confo
|
||||
Two of the ignored errors are due to the relaxed restriction on column alignment, these are the
|
||||
E221 and E241 error codes.
|
||||
|
||||
The code E226 is ignored becuse it doesn't actually follow the
|
||||
The code E226 is ignored because it doesn't actually follow the
|
||||
[PEP8 recommendation](https://www.python.org/dev/peps/pep-0008/#other-recommendations)
|
||||
of grouping longer equations by operator precedence like `2*a + 3*b` instead of `a * a + 3 * b`.
|
||||
Generally, don't use spaces around `*`, `/` and `**`, but _do_ use spaces around `+` and `-`.
|
||||
|
||||
@@ -58,9 +58,11 @@ Some of the assets bundled with novelWriter were adapted from the following sour
|
||||
|
||||
## Fonts
|
||||
|
||||
The font used for the main novelWriter logo, mimetype and text banners is:
|
||||
The font used for the main novelWriter logo, mimetype and text banners is Pridi. Other fonts are
|
||||
used on buttons and icons.
|
||||
|
||||
* Pridi by Cadson Demak (Open Font License, Version 1.1)
|
||||
* Source Sans Pro by Paul D. Hunt (SIL Open Font License)
|
||||
|
||||
## Special Mentions
|
||||
|
||||
|
||||
@@ -49,6 +49,10 @@ code, please also read the full
|
||||
|
||||
Project credits are available in [CREDITS.md](https://github.com/vkbo/novelWriter/blob/main/CREDITS.md).
|
||||
|
||||
**Note:** As of April 2024 only pre-releases are made from the `main` branch. Full releases are
|
||||
made from the `release` branch. So if you're submitting a fix to a current release, **including
|
||||
changes to documentation**, they must be made to the `release` branch.
|
||||
|
||||
### Translations
|
||||
|
||||
New translations are always welcome. This project uses Crowdin to maintain translations, and you
|
||||
|
||||
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 154 KiB After Width: | Height: | Size: 152 KiB |
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 103 KiB |
BIN
docs/source/images/fig_manuscript_build_outline.png
Normal file
|
After Width: | Height: | Size: 151 KiB |
|
Before Width: | Height: | Size: 241 KiB After Width: | Height: | Size: 243 KiB |
|
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 273 KiB After Width: | Height: | Size: 280 KiB |
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 123 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 542 KiB After Width: | Height: | Size: 530 KiB |
|
Before Width: | Height: | Size: 562 KiB |
BIN
docs/source/images/screenshot_light.png
Normal file
|
After Width: | Height: | Size: 540 KiB |
@@ -17,14 +17,12 @@ storage for robustness.
|
||||
:width: 500
|
||||
|
||||
The project storage is suitable for version control software, and also well suited for file
|
||||
synchronisation tools. All text is saved as plain text files with a meta data header. The core
|
||||
project structure is stored in a single project XML file. Other meta data is saved as JSON files.
|
||||
See the :ref:`a_breakdown_storage` section for more details.
|
||||
synchronisation tools. All text is saved as plain text files, and your project data as standard
|
||||
data formats in XML and JSON. See :ref:`a_storage` for more details.
|
||||
|
||||
Any operating system that can run Python 3 and has the Qt 5 libraries should be able to run
|
||||
novelWriter. It runs fine on Linux, Windows and MacOS, and users have tested it on other platforms
|
||||
as well. novelWriter can be run directly from the Python source, or installed from packages or with
|
||||
pip. See :ref:`a_started` for more details.
|
||||
Any operating system that has Python 3 and the Qt 5 libraries should be able to run novelWriter.
|
||||
It runs fine on Linux, Windows and MacOS, and users have tested it on other platforms as well.
|
||||
See :ref:`a_started` for more details.
|
||||
|
||||
**Useful Links**
|
||||
|
||||
@@ -53,7 +51,6 @@ pip. See :ref:`a_started` for more details.
|
||||
int_overview
|
||||
int_started
|
||||
int_howto
|
||||
int_customise
|
||||
int_glossary
|
||||
|
||||
.. toctree::
|
||||
@@ -83,6 +80,7 @@ pip. See :ref:`a_started` for more details.
|
||||
:caption: Additional Details
|
||||
:hidden:
|
||||
|
||||
more_customise
|
||||
more_projectformat
|
||||
more_counting
|
||||
|
||||
|
||||
@@ -16,13 +16,21 @@ This is a list of hopefully helpful little tips on how to get the most out of no
|
||||
Managing the Project
|
||||
====================
|
||||
|
||||
.. dropdown:: Create a Project from a Template
|
||||
:animate: fade-in-slide-down
|
||||
|
||||
On the Welcome dialog's **Create New Project** form, you can select to "Prefill Project" from
|
||||
the content of a different project. This feature is most useful if you copy a project you have
|
||||
dedicated to be a template project. If you have a structure and settings you want to use for
|
||||
every new project, this is the best solution.
|
||||
|
||||
.. dropdown:: Merge Multiple Documents Into One
|
||||
:animate: fade-in-slide-down
|
||||
|
||||
If you need to merge a set of documents in your project into a single document, you can achieve
|
||||
this by first making a new folder for just that purpose, and drag all the files you want merged
|
||||
into this folder. Then you can right click the folder, select :guilabel:`Transform` and
|
||||
:guilabel:`Merge Documents in Folder`.
|
||||
If you need to merge a selection of documents in your project into a single document, you can
|
||||
achieve this by first making a new folder for just that purpose, and drag all the documents you
|
||||
want merged into this folder. Then you can right click the folder, select :guilabel:`Transform`
|
||||
and :guilabel:`Merge Documents in Folder`.
|
||||
|
||||
In the dialog that pops up, the documents will be in the same order as in the folder, but you
|
||||
can rearrange them here of you wish. See :ref:`a_ui_tree_split_merge` for more details.
|
||||
@@ -36,7 +44,7 @@ Layout Tricks
|
||||
|
||||
The formatting tools available in novelWriter don't allow for complex structures like tables.
|
||||
However, the editor does render tabs in a similar way that regular word processors do. You can
|
||||
set the width of a tab in :guilabel:`Preferences`.
|
||||
set the width of a tab in **Preferences**.
|
||||
|
||||
The tab key should have the same distance in the editor as in the viewer, so you can align text
|
||||
in columns using the tab key, and it should look the same when viewed next to the editor.
|
||||
@@ -58,22 +66,19 @@ Organising Your Text
|
||||
such text. Separating chapter and scene files also allows you to make scene files child
|
||||
documents of the chapter.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
.. dropdown:: Distinguishing Soft and Hard Scene Breaks
|
||||
:animate: fade-in-slide-down
|
||||
|
||||
Depending on your writing style, you may need to separate between soft and hard scene breaks
|
||||
within chapters. Like for instance if you switch point-of-view character often.
|
||||
|
||||
In such cases you may want to use a scene heading for hard scene breaks and a section heading
|
||||
for soft scene breaks. The :guilabel:`Build Manuscript` tool will let you add separate
|
||||
formatting for the two when you generate your manuscript. You can for instance add the common
|
||||
"``* * *``" for hard breaks and select to hide section breaks, which will just insert an empty
|
||||
paragraph in their place. See :ref:`a_manuscript_settings` for more details.
|
||||
In such cases you may want to use different scene headings for hard and soft scene breaks. The
|
||||
**Build Manuscript** tool will let you define a different format for scenes using the ``###``
|
||||
and ``###!`` heading codes when you generate your manuscript. You can for instance add the
|
||||
common "``* * *``" for hard breaks and select to soft scene breaks, which will just insert an
|
||||
empty paragraph in their place. See :ref:`a_manuscript_settings` for more details.
|
||||
|
||||
Keep in mind that this is not what the section heading is intended for, so the app will not
|
||||
understand the section heading as a scene, but it will be formatted correctly in the manuscript.
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
Other Tools
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
.. _a_intro:
|
||||
|
||||
************
|
||||
Key Features
|
||||
************
|
||||
********
|
||||
Overview
|
||||
********
|
||||
|
||||
.. _Snowflake: https://www.advancedfictionwriting.com/articles/snowflake-method/
|
||||
.. _Markdown: https://en.wikipedia.org/wiki/Markdown
|
||||
|
||||
At its core, novelWriter is a multi-document plain text editor. It uses a markup syntax inspired by
|
||||
Markdown_ to apply simple formatting to the text. It also allows for some extended formatting codes
|
||||
using a shortcode format. See :ref:`a_fmt_shortcodes` for more details.
|
||||
At its core, novelWriter is a multi-document plain text editor. The idea is to let you edit your
|
||||
text without having to deal with formatting until you generate a draft document or manuscript.
|
||||
Instead, you can focus on the writing right from the start.
|
||||
|
||||
Of course, you probably need *some* formatting for your text. At the very least you need emphasis.
|
||||
Most people are familiar with adding emphasis using underscores and asterisks. This formatting
|
||||
standard comes from Markdown_ and is supported by novelWriter. It also uses Markdown formatting for
|
||||
defining document headings. If you need more specialised formatting, additional formatting options
|
||||
are available using a shortcode format. See :ref:`a_fmt_shortcodes` for more details.
|
||||
|
||||
.. admonition:: Limitations
|
||||
|
||||
@@ -17,22 +23,28 @@ using a shortcode format. See :ref:`a_fmt_shortcodes` for more details.
|
||||
those relevant for this purpose. It is **not** suitable for technical writing, and it is **not**
|
||||
a full-featured Markdown editor.
|
||||
|
||||
It is also not intended as a tool to organise research for writing, and therefore lacks
|
||||
It is also not intended as a tool for organising research for writing, and therefore lacks
|
||||
formatting features you may need for this purpose. The notes feature in novelWriter is mainly
|
||||
intended for character profiles and plot outlines.
|
||||
|
||||
Your novel project is organised as a collection of separate plain text documents instead of a
|
||||
single, large document. The idea is to make it easier to reorganise your project structure without
|
||||
having to cut and paste text between chapters.
|
||||
Your novel project in novelWriter is organised as a collection of separate plain text documents
|
||||
instead of a single, large document. The idea is to make it easier to reorganise your project
|
||||
structure without having to cut and paste text between chapters and scenes.
|
||||
|
||||
There are two kinds of documents in your project: :term:`Novel Documents` are documents that are
|
||||
part of your story. The other kind of documents are :term:`Project Notes`. These are intended for
|
||||
your notes about your characters, your world building, and so on.
|
||||
|
||||
You can at any point split the individual documents by their headings up into multiple documents,
|
||||
or merge multiple documents into single documents. This makes it easier to use variations of the
|
||||
or merge multiple documents into a single document. This makes it easier to use variations of the
|
||||
Snowflake_ method for writing. You can start by writing larger structure-focused documents, like
|
||||
one per act for instance, and later effortlessly split these up into chapters or scenes.
|
||||
for instance one document per act, and later effortlessly split these up into chapters or scenes.
|
||||
|
||||
|
||||
.. _a_intro_features:
|
||||
|
||||
Key Features
|
||||
============
|
||||
|
||||
Below are some key features of novelWriter.
|
||||
|
||||
@@ -40,12 +52,12 @@ Below are some key features of novelWriter.
|
||||
The aim of the user interface is to let you focus on writing instead of spending time formatting
|
||||
text. Formatting is therefore limited to a small set of formatting tags for simple things like
|
||||
text emphasis and paragraph alignment. When you really want to focus on just writing, you can
|
||||
switch the editor into :guilabel:`Focus Mode` where only the text editor panel itself is
|
||||
visible, and the project structure view is hidden away.
|
||||
switch the editor into **Focus Mode** where only the text editor panel itself is visible, and
|
||||
the project structure view is hidden away.
|
||||
|
||||
**Keep an eye on your notes**
|
||||
The main window can optionally show a document viewer to the right of the editor. This view
|
||||
panel is intended for displaying another scene document, your character notes, plot notes, or any
|
||||
The main window can optionally show a document viewer to the right of the editor. The viewer
|
||||
is intended for displaying another scene document, your character notes, plot notes, or any
|
||||
other document you may need to reference while writing. It is not intended as a preview panel
|
||||
for the document you're editing, but if you wish, you can also use it for this purpose.
|
||||
|
||||
@@ -58,32 +70,35 @@ Below are some key features of novelWriter.
|
||||
later split them into multiple documents based on chapter and scene headings.
|
||||
|
||||
**Multi-novel project support**
|
||||
You can have multiple Novel type root folders in a project. This allows you to keep a series of
|
||||
individual novels with the same characters and world building in the same project, and create
|
||||
manuscripts for them individually.
|
||||
The main parts of your project is split up into top level special folders called "Root" folders.
|
||||
Your main story text lives in the "Novel" root folder. You can have multiple such folders in a
|
||||
project. This allows you to keep a series of individual novels with the same characters and
|
||||
world building in the same project, and create manuscripts for them individually.
|
||||
|
||||
**Keep track of your story elements**
|
||||
All notes in your project can be assigned a :term:`tag` that you can :term:`reference` from any
|
||||
other document or note. In fact, you can add a new tag under each heading of a note if you need
|
||||
to be able to reference specific sections of it.
|
||||
All notes in your project can be assigned a :term:`tag` that you can then :term:`reference` from
|
||||
any other document or note. In fact, you can add a new tag under each heading of a note if you
|
||||
need to be able to reference specific sections of it.
|
||||
|
||||
**Get an overview of your story**
|
||||
In the :guilabel:`Outline View` on the main window you can see an outline of all the chapters,
|
||||
scenes, and sections of your project. If they have any references in them, these are listed in
|
||||
additional columns. You can also add a synopsis to each chapter or scene, which can be listed
|
||||
here as well. You have the option to add or remove columns of information from this outline. A
|
||||
subset of the outline information is also available in the :guilabel:`Novel View` as an
|
||||
alternative view to the project tree.
|
||||
It is not the documents themselves that define the chapters and scenes of your story, but the
|
||||
headings that separate them. In the **Outline View** on the main window you can see an outline
|
||||
of all the chapter and scene headings of your project. If they have any references in them, like
|
||||
which character is in what chapter and scene, these are listed in additional columns.
|
||||
|
||||
You can also add a synopsis to each chapter or scene, which can be listed here as well. You have
|
||||
the option to add or remove columns of information from this outline. A subset of the outline
|
||||
information is also available in the **Novel View** as an alternative view to the project tree.
|
||||
|
||||
**Get an overview of your story elements**
|
||||
Under the document viewer panel you will find a series of tabs that shows the different story
|
||||
elements you have created tags for. The tabs are sorted into Characters, Plots, etc, depending
|
||||
on which categories you are using in your story. This panel can be hidden to free up space when
|
||||
you don't need it.
|
||||
Under the document viewer panel you will find a series of tabs that show the different story
|
||||
elements you have created tags for. The tabs are sorted into **Characters**, **Plots**, etc,
|
||||
depending on which categories you are using in your story. This panel can be hidden to free up
|
||||
space when you don't need it.
|
||||
|
||||
**Assembling your manuscript**
|
||||
Whether you want to assemble a manuscript, or export all your notes, or generate an outline of
|
||||
your chapters and scenes with a synopsis, you can use the :guilabel:`Build Manuscript` tool to
|
||||
your chapters and scenes with a synopsis included, you can use the **Build Manuscript** tool to
|
||||
do so. The tool lets you select what information you want to include in the generated document,
|
||||
and how it is formatted. You can send the result to a printer, a PDF, or to an Open Document
|
||||
file that can be opened by most office type word processors. You can also generate the result
|
||||
@@ -95,7 +110,7 @@ Below are some key features of novelWriter.
|
||||
Screenshots
|
||||
===========
|
||||
|
||||
.. figure:: images/screenshot_default.png
|
||||
.. figure:: images/screenshot_light.png
|
||||
:class: dark-light
|
||||
|
||||
novelWriter with light colour theme
|
||||
|
||||
@@ -1,28 +1,22 @@
|
||||
.. _a_overview:
|
||||
.. _a_reading:
|
||||
|
||||
********
|
||||
Overview
|
||||
********
|
||||
******************
|
||||
What to Read First
|
||||
******************
|
||||
|
||||
.. only:: html
|
||||
The documentation of novelWriter is quite extensive. There are a lot of features to get used to,
|
||||
but you don't need all of them to get started.
|
||||
|
||||
.. image:: images/python_powered.png
|
||||
:align: right
|
||||
:width: 220
|
||||
The chapters below labelled "Essential Information" are the ones you need to know to use the
|
||||
application correctly. By "correctly", it is meant: in a way so novelWriter understands the basic
|
||||
structure of your text. It collects a lot of information from your text and uses it to display the
|
||||
structure of it in various ways to help you get an overview of your project.
|
||||
|
||||
novelWriter is built as a cross-platform application using `Python 3 <https://www.python.org/>`_ as
|
||||
the programming language, and `Qt 5 <https://www.qt.io/>`_ framework for the user interface.
|
||||
The chapters labelled "Recommended Reading" includes additional information on how the different
|
||||
parts if the application work and what the features do.
|
||||
|
||||
novelWriter is built for Linux first, so this is where it works best. However, it also runs fine
|
||||
on Windows and MacOS due to the cross-platform framework it's built on. The author of the
|
||||
application doesn't own a Mac, so on-going Mac support is dependent on user feedback and user
|
||||
contributions.
|
||||
|
||||
Spell checking in novelWriter is provided by a third party library called
|
||||
`Enchant <https://abiword.github.io/enchant/>`_. Please see the section on :ref:`a_custom_dict` for
|
||||
how to install spell checking languages.
|
||||
|
||||
For install instructions for novelWriter, see :ref:`a_started`.
|
||||
The "Optional" and "Lookup" chapters contain additional information or lookup tables that are not
|
||||
essential for using the application.
|
||||
|
||||
|
||||
Using novelWriter
|
||||
@@ -82,8 +76,8 @@ meta data for it to extract.
|
||||
the application interface.
|
||||
|
||||
:ref:`a_manuscript` - Recommended Reading
|
||||
This chapter explains how the :guilabel:`Manuscript Build` tool works, how you can control the
|
||||
way chapter titles are formatted, and how scene and section breaks are handled.
|
||||
This chapter explains how the **Manuscript Build** tool works, how you can control the way
|
||||
chapter titles are formatted, and how scene and section breaks are handled.
|
||||
|
||||
|
||||
Additional Details & Technical Topics
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
.. _a_started:
|
||||
|
||||
***************
|
||||
Getting Started
|
||||
***************
|
||||
**********************
|
||||
Setup and Installation
|
||||
**********************
|
||||
|
||||
.. _Enchant: https://abiword.github.io/enchant/
|
||||
.. _GitHub: https://github.com/vkbo/novelWriter
|
||||
@@ -15,8 +15,8 @@ Getting Started
|
||||
.. _AppImage: https://appimage.org/
|
||||
|
||||
Ready-made packages and installers for novelWriter are available for all major platforms, including
|
||||
Linux, Windows and MacOS, from the `Downloads page`_. See below for install instructions for each
|
||||
platform.
|
||||
Linux, Windows and MacOS, from the `Downloads page`_. See below for install additional instructions
|
||||
for each platform.
|
||||
|
||||
You can also install novelWriter from the Python Package Index (PyPi_). See :ref:`a_started_pip`.
|
||||
Installing from PyPi does not set up icon launchers, so you will either have to do this yourself,
|
||||
@@ -44,7 +44,7 @@ multiple installations has been known to cause problems.
|
||||
The novelWriter installer is not signed because Microsoft doesn't currently provide a way for
|
||||
non-profit open source projects to properly sign their installers. The novelWriter project
|
||||
doesn't have the funding to pay for commercial software signing certificates. You will therefore
|
||||
see an additional warning about this when you download the installer.
|
||||
see an additional warning about this when you download and run the installer.
|
||||
|
||||
|
||||
.. _a_started_linux:
|
||||
@@ -56,6 +56,7 @@ A Debian package can be downloaded from the `Downloads page`_, or from the Relea
|
||||
GitHub_. This package should work on both Debian, Ubuntu and Linux Mint, at least.
|
||||
|
||||
If you prefer, you can also add the novelWriter repository on Launchpad to your package manager.
|
||||
The Launchpad packages `are signed by the author <https://launchpad.net/~vkbo>`__.
|
||||
|
||||
|
||||
Ubuntu
|
||||
|
||||
@@ -5,8 +5,11 @@ Word and Text Counts
|
||||
********************
|
||||
|
||||
This is an overview of how words and other counts of your text are performed. The counting rules
|
||||
should be relatively standard, and are compared to LibreOffice Writer rules. The counts provided in
|
||||
the app on the raw text are only meant to be approximate.
|
||||
should be relatively standard, and are compared to Libre Office Writer rules.
|
||||
|
||||
The counts provided in the app on the raw text is meant to be approximate. For more accurate
|
||||
counts, you need to build your manuscript in the **Manuscript Tool** and check the counts on the
|
||||
generated preview.
|
||||
|
||||
|
||||
Text Word Counts and Stats
|
||||
@@ -28,12 +31,68 @@ After the above preparation of the text, the following counts are available.
|
||||
**Character Count**
|
||||
The character count is the sum of characters per line, including leading and in-text white space
|
||||
characters, but excluding trailing white space characters. Shortcodes in the text are not
|
||||
included, but Markdown codes are. Only headers and text are counted.
|
||||
included, but Markdown codes are. Only headings and text are counted.
|
||||
|
||||
**Word Count**
|
||||
The words count is the sum of blocks of continuous character per line separated by any number of
|
||||
white space characters or dashes. Only headers and text are counted.
|
||||
white space characters or dashes. Only headings and text are counted.
|
||||
|
||||
**Paragraph Count**
|
||||
The paragraph count is the number of text blocks separated by one or more empty line. A line
|
||||
consisting only of white spaces is considered empty.
|
||||
|
||||
|
||||
Manuscript Counts
|
||||
=================
|
||||
|
||||
These are the rules for the counts available for a manuscript in the **Manuscript Tool**. The rules
|
||||
have been tuned to agree with LibreOffice Writer, but will vary slightly depending on the content
|
||||
of your text. LibreOffice Writer also counts the text in the page header, which the **Manuscript
|
||||
Tool** does not.
|
||||
|
||||
The content of each line is counted after all formatting has been processed, so the result will be
|
||||
more accurate than the counts for text documents elsewhere in the app. The following rules apply:
|
||||
|
||||
#. Short (–) and long (—) dashes are considered word separators.
|
||||
#. Leading and trailing white spaces are generally included, but paragraph breaks are not.
|
||||
#. Hard line breaks within paragraph are considered white space characters.
|
||||
#. All formatting codes are ignored, including shortcodes, commands and Markdown.
|
||||
#. Scene and section separators are counted.
|
||||
#. Comments and meta data lines are counted after they are formatted.
|
||||
#. Headers are counted after they are formatted with custom formats.
|
||||
|
||||
The following counts are available:
|
||||
|
||||
**Headings**
|
||||
The number of headings in the manuscript.
|
||||
|
||||
**Paragraphs**
|
||||
The number of body text paragraphs in the manuscript.
|
||||
|
||||
**Words**
|
||||
The number of words in the manuscript, including any comments and meta data text.
|
||||
|
||||
**Words in Text**
|
||||
The number of words in body text paragraphs, excluding all other text.
|
||||
|
||||
**Words in Headings**
|
||||
The number of words in headings, including inserted formatting like chapter numbers, etc.
|
||||
|
||||
**Characters**
|
||||
The number of characters in all lines, including any comments and meta data text. Paragraph
|
||||
breaks are not counted, but in-paragraph hard line breaks are.
|
||||
|
||||
**Character in Text**
|
||||
The number of characters in body text paragraphs. Paragraph breaks are not counted, but
|
||||
in-paragraph hard line breaks are.
|
||||
|
||||
**Characters in Headings**
|
||||
The number of characters in headings.
|
||||
|
||||
**Character in Text, No Spaces**
|
||||
The number of characters in body text paragraphs considered part of a word or punctuation. That
|
||||
is, white space characters are not counted.
|
||||
|
||||
**Character in Headings, No Spaces**
|
||||
The number of characters in headings considered part of a word or punctuation. That is, white
|
||||
space characters are not counted.
|
||||
|
||||
@@ -34,10 +34,10 @@ and add dictionaries yourself.
|
||||
|
||||
**Install Tool**
|
||||
|
||||
A small tool to assist with this can be found under :guilabel:`Tools > Add Dictionaries`. It will
|
||||
import spell checking dictionaries from Free Office or Libre Office extensions. The dictionaries
|
||||
are then installed in the install location for the Enchant library and should thus work for any
|
||||
application that uses Enchant for spell checking.
|
||||
A small tool to assist with this can be found under **Tools > Add Dictionaries**. It will import
|
||||
spell checking dictionaries from Free Office or Libre Office extensions. The dictionaries are then
|
||||
installed in the install location for the Enchant library and should thus work for any application
|
||||
that uses Enchant for spell checking.
|
||||
|
||||
**Manual Install**
|
||||
|
||||
@@ -81,14 +81,14 @@ modify it as you like.
|
||||
`novelwriter/assets/icons <https://github.com/vkbo/novelWriter/tree/main/novelwriter/assets/icons>`_.
|
||||
|
||||
Remember to also change the name of your theme by modifying the ``name`` setting at the top of the
|
||||
file, otherwise you may not be able to distinguish them in :guilabel:`Preferences`.
|
||||
file, otherwise you may not be able to distinguish them in **Preferences**.
|
||||
|
||||
For novelWriter to be able to locate the custom theme files, you must copy them to the
|
||||
:ref:`a_locations_data` location in your home or user area. There should be a folder there named
|
||||
``syntax`` for syntax themes, just ``themes`` for GUI themes, and ``icons`` for icon themes. These
|
||||
folders are created the first time you start novelWriter.
|
||||
|
||||
Once the files are copied there, they should show up in :guilabel:`Preferences` with the label you
|
||||
Once the files are copied there, they should show up in **Preferences** with the label you
|
||||
set as ``name`` inside the file.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
@@ -180,15 +180,20 @@ A syntax theme ``.conf`` file consists of the following settings:
|
||||
errorline = 0, 0, 0
|
||||
replacetag = 0, 0, 0
|
||||
modifier = 0, 0, 0
|
||||
texthighlight = 255, 255, 255, 128
|
||||
|
||||
In the Main section, you must define at least the ``name`` setting. The Syntax colour values are
|
||||
RGB(A) numbers of the format ``r, g, b, a`` where each is an integer ``0`` from to ``255``. The
|
||||
fourth value is the alpha channel (transparency), which can be omitted.
|
||||
RGB(A) numbers of the format ``r, g, b, a`` where each is an integer from ``0`` to ``255``. The
|
||||
fourth value is the alpha channel, which can be omitted.
|
||||
|
||||
Omitted syntax colours default to black, except ``background`` which defaults to white.
|
||||
Omitted syntax colours default to black, except ``background`` which defaults to white, and
|
||||
``texthighlight`` which defaults to white with half transparency.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
The `shortcode` syntax colour entry was added.
|
||||
The ``shortcode`` syntax colour entry was added.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
The `optional` syntax colour entry was added.
|
||||
The ``optional`` syntax colour entry was added.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
The ``texthighlight`` syntax colour entry was added.
|
||||
@@ -4,9 +4,11 @@
|
||||
Building the Manuscript
|
||||
***********************
|
||||
|
||||
.. _Pandoc: https://pandoc.org/
|
||||
|
||||
You can at any time build a manuscript, an outline of your notes, or any other type of document
|
||||
from the text in your project. All of this is handled by the :guilabel:`Manuscript Build` tool.
|
||||
You can activate it from the sidebar, the :guilabel:`Tools` menu, or by pressing :kbd:`F5`.
|
||||
from the text in your project. All of this is handled by the **Manuscript Build** tool. You can
|
||||
activate it from the sidebar, the **Tools** menu, or by pressing :kbd:`F5`.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
This tool is new for version 2.1. A simpler tool was used for earlier versions. The simpler tool
|
||||
@@ -20,40 +22,60 @@ The Manuscript Build Tool
|
||||
=========================
|
||||
|
||||
.. figure:: images/fig_manuscript_build.png
|
||||
:width: 80%
|
||||
|
||||
The :guilabel:`Manuscript Build` tool main window.
|
||||
The **Manuscript Build** tool main window.
|
||||
|
||||
The main window of the :guilabel:`Manuscript Build` tool contains a list of all the builds you have
|
||||
The main window of the **Manuscript Build** tool contains a list of all the builds you have
|
||||
defined, a selection of settings, and a few buttons to generate preview, open the print dialog, or
|
||||
run the build to create a manuscript document.
|
||||
|
||||
|
||||
Outline and Word Counts
|
||||
-----------------------
|
||||
|
||||
.. figure:: images/fig_manuscript_build_outline.png
|
||||
:width: 80%
|
||||
|
||||
The **Manuscript Build** tool main window with the **Outline** visible.
|
||||
|
||||
The **Outline** tab on the left lets you navigate the headings in the preview document. It will
|
||||
show up to scene level headings for novel documents, and level 2 headings for notes.
|
||||
|
||||
A collapsible panel of word and character counts are also available below the preview document.
|
||||
These are calculated from the text you have included in the document, and are more accurate counts
|
||||
than what's available in the project tree since they are counted *after formatting*.
|
||||
|
||||
For a detailed description on how they are counted, see :ref:`a_counting`.
|
||||
|
||||
|
||||
.. _a_manuscript_settings:
|
||||
|
||||
Build Settings
|
||||
==============
|
||||
|
||||
Each build definition can be edited by opening it in the :guilabel:`Manuscript Build Settings`
|
||||
dialog, either by double-clicking or by selecting it and pressing the edit button in the toolbar.
|
||||
Each build definition can be edited by opening it in the **Manuscript Build Settings** dialog,
|
||||
either by double-clicking or by selecting it and pressing the edit button in the toolbar.
|
||||
|
||||
.. tip::
|
||||
You can keep the :guilabel:`Manuscript Build Settings` dialog open while testing the different
|
||||
options, and just hit the :guilabel:`Apply` button. You can test the result of your settings
|
||||
by pressing the :guilabel:`Preview` button in the main :guilabel:`Manuscript Build` window.
|
||||
When you're happy with the result, you can close the settings.
|
||||
You can keep the **Manuscript Build Settings** dialog open while testing the different options,
|
||||
and just hit the :guilabel:`Apply` button. You can test the result of your settings by pressing
|
||||
the :guilabel:`Preview` button in the main **Manuscript Build** window. When you're happy with
|
||||
the result, you can close the settings.
|
||||
|
||||
|
||||
Document Selection
|
||||
------------------
|
||||
|
||||
.. figure:: images/fig_build_settings_selections.png
|
||||
:width: 80%
|
||||
|
||||
The :guilabel:`Selections` page of the :guilabel:`Manuscript Build Settings` dialog.
|
||||
The **Selections** page of the **Manuscript Build Settings** dialog.
|
||||
|
||||
The :guilabel:`Selections` page of the :guilabel:`Manuscript Build Settings` dialog allows you to
|
||||
fine tune which documents are included in the build. They are indicated by a green arrow icon in
|
||||
the last column. On the right you have some filter options for selecting content of a specific
|
||||
type, and a set of switches for which root folders to include.
|
||||
The **Selections** page of the **Manuscript Build Settings** dialog allows you to fine tune which
|
||||
documents are included in the build. They are indicated by a green arrow icon in the last column.
|
||||
On the right you have some filter options for selecting content of a specific type, and a set of
|
||||
switches for which root folders to include.
|
||||
|
||||
You can override the result of these filters by marking one or more documents and selecting to
|
||||
explicitly include or exclude them by using the buttons below the tree view. The last button can be
|
||||
@@ -63,17 +85,20 @@ In the figure, the green arrow icon and the blue pin icon indicates which docume
|
||||
and the red forbidden icon indicates that a document is explicitly excluded.
|
||||
|
||||
|
||||
.. _a_manuscript_settings_head:
|
||||
|
||||
Formatting Headings
|
||||
-------------------
|
||||
|
||||
.. figure:: images/fig_build_settings_headings.png
|
||||
:width: 80%
|
||||
|
||||
The :guilabel:`Headings` page of the :guilabel:`Manuscript Build Settings` dialog.
|
||||
The **Headings** page of the **Manuscript Build Settings** dialog.
|
||||
|
||||
The :guilabel:`Headings` page of the :guilabel:`Manuscript Build Settings` dialog allows you to set
|
||||
how the headings in your :term:`Novel Documents` are formatted. By default, the title is just
|
||||
copied as-is, indicated by the ``{Title}`` format. You can change this to for instance add chapter
|
||||
numbers and scene numbers, or insert character names, like shown in the figure above.
|
||||
The **Headings** page of the **Manuscript Build Settings** dialog allows you to set how the
|
||||
headings in your :term:`Novel Documents` are formatted. By default, the title is just copied as-is,
|
||||
indicated by the ``{Title}`` format. You can change this to for instance add chapter numbers and
|
||||
scene numbers, or insert character names, like shown in the figure above.
|
||||
|
||||
Clicking the edit button next to a format will copy the formatting string into the edit box where
|
||||
it can be modified, and where a syntax highlighter will help indicate which parts are automatically
|
||||
@@ -84,7 +109,8 @@ Any text you add that isn't highlighted in colours will remain in your formatted
|
||||
``{Title}`` will always be replaced by the text in the heading from your documents.
|
||||
|
||||
You can preview the result of these format strings by clicking :guilabel:`Apply`, and then clicking
|
||||
:guilabel:`Preview` in the :guilabel:`Manuscript Build` tool main window.
|
||||
:guilabel:`Preview` in the **Manuscript Build** tool main window.
|
||||
|
||||
|
||||
Scene Separators
|
||||
^^^^^^^^^^^^^^^^
|
||||
@@ -99,13 +125,24 @@ the desired separator text as the format. If the format is any piece of static t
|
||||
be treated as a separator.
|
||||
|
||||
|
||||
.. _a_manuscript_settings_head_hard:
|
||||
|
||||
Hard and Soft Scenes
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If you wish to distinguish between so-called soft and hard scene breaks, you can use the
|
||||
alternative scene heading format in your text. You can then give these headings a different
|
||||
formatting in the **Headings** settings.
|
||||
|
||||
See :ref:`a_fmt_head` for more info on how to format headings in your text.
|
||||
|
||||
|
||||
Output Settings
|
||||
---------------
|
||||
|
||||
The :guilabel:`Content`, :guilabel:`Format` and :guilabel:`Output` pages of the
|
||||
:guilabel:`Manuscript Build Settings` dialog control a number of other settings for the output.
|
||||
Some of these only apply to specific output formats, which is indicated by the section headings on
|
||||
the settings pages.
|
||||
The **Content**, **Format** and **Output** pages of the **Manuscript Build Settings** dialog
|
||||
control a number of other settings for the output. Some of these only apply to specific output
|
||||
formats, which is indicated by the section headings on the settings pages.
|
||||
|
||||
|
||||
.. _a_manuscript_build:
|
||||
@@ -114,12 +151,13 @@ Building Manuscript Documents
|
||||
=============================
|
||||
|
||||
.. figure:: images/fig_build_build.png
|
||||
:width: 80%
|
||||
|
||||
The :guilabel:`Manuscript Build` dialog used for writing the actual manuscript documents.
|
||||
The **Manuscript Build** dialog used for writing the actual manuscript documents.
|
||||
|
||||
When you press the :guilabel:`Build` button on the :guilabel:`Build Manuscript` tool main window, a
|
||||
special file dialog opens up. This is where you pick your desired output format and where to write
|
||||
the file.
|
||||
When you press the :guilabel:`Build` button on the **Build Manuscript** tool main window, a special
|
||||
file dialog opens up. This is where you pick your desired output format and where to write the
|
||||
file.
|
||||
|
||||
On the left side of the dialog is a list of all the available file formats, and on the right, a
|
||||
list of the documents which are included based on the build definition you selected. You can choose
|
||||
@@ -141,7 +179,7 @@ Open Document Format
|
||||
|
||||
novelWriter HTML
|
||||
The HTML format writes a single ``.htm`` file with minimal style formatting. The HTML document
|
||||
is suitable for further processing by document conversion tools like Pandoc, for importing in
|
||||
is suitable for further processing by document conversion tools like Pandoc_, for importing in
|
||||
word processors, or for printing from browser.
|
||||
|
||||
novelWriter Markup
|
||||
@@ -182,4 +220,4 @@ on the print dialog.
|
||||
|
||||
.. note::
|
||||
The paper format should in all cases default to whatever your system default is. If you want to
|
||||
change it, you have to select it from the :guilabel:`Print Preview` dialog.
|
||||
change it, you have to select it from the **Print Preview** dialog.
|
||||
|
||||
@@ -1,96 +1,122 @@
|
||||
.. _a_proj:
|
||||
|
||||
**************
|
||||
Novel Projects
|
||||
**************
|
||||
*****************
|
||||
Managing Projects
|
||||
*****************
|
||||
|
||||
New projects can be created from the :guilabel:`Project` menu by selecting
|
||||
:guilabel:`Create or Open Project`. This will open the :guilabel:`Welcome` dialog, where you can
|
||||
select the :guilabel:`New` button that will assist you in creating a new project.
|
||||
Your text in novelWriter is organised into projects. Each project is meant to contain one novel
|
||||
and associated notes. If you have multiple novels in a series, with the same characters and shared
|
||||
notes, it is also possible to keep all of them in the same project.
|
||||
|
||||
.. _a_proj_new:
|
||||
|
||||
Creating Project
|
||||
================
|
||||
|
||||
New projects can be created from the **Project** menu by selecting **Create or Open Project**. This
|
||||
will open the **Welcome** dialog, where you can select the :guilabel:`New` button that will assist
|
||||
you in creating a new project. This dialog is also displayed when you start novelWriter.
|
||||
|
||||
A novelWriter project requires a dedicated folder for storing its files on the local file system.
|
||||
If you're interested in the details, you can have a look at the chapter :ref:`a_storage`.
|
||||
|
||||
A list of recently opened projects is maintained, and displayed in the :guilabel:`Welcome`
|
||||
dialog. A project can be removed from this list by selecting it and pressing the :kbd:`Del` key or
|
||||
by right-clicking it and selecting the :guilabel:`Remove Project` option.
|
||||
A list of recently opened projects is maintained, and displayed in the **Welcome** dialog. A
|
||||
project can be removed from this list by selecting it and pressing the :kbd:`Del` key or by
|
||||
right-clicking it and selecting the **Remove Project** option.
|
||||
|
||||
.. figure:: images/fig_welcome.jpg
|
||||
|
||||
The project list (left) and new project form (right) of the :guilabel:`Welcome` dialog.
|
||||
|
||||
Project-specific settings are available in :guilabel:`Project Settings` in the :guilabel:`Project`
|
||||
menu. See further details below in the :ref:`a_proj_settings` section. Details about the project's
|
||||
novel text, including word counts, and a table of contents with word and page counts, is available
|
||||
through the :guilabel:`Novel Details` dialog.
|
||||
Project-specific settings are available in **Project Settings** in the **Project** menu. See
|
||||
further details below in the :ref:`a_proj_settings` section.
|
||||
|
||||
Details about the project's novel text, including word counts, and a table of contents with word
|
||||
and page counts, is available through the **Novel Details** dialog. Statistics about the project
|
||||
is also available in the **Manuscript Build** tool.
|
||||
|
||||
|
||||
Template Projects
|
||||
-----------------
|
||||
|
||||
From the Welcome dialog you can also create a new from another existing project. If you have a
|
||||
specific structure you want to use for all your new projects, you can create a dedicated project to
|
||||
be used as a template, and select to copy an existing project from the :guilabel:"Prefill Project"
|
||||
option from the **New Project** form.
|
||||
|
||||
|
||||
.. _a_proj_roots:
|
||||
|
||||
Project Roots
|
||||
=============
|
||||
Project Structure
|
||||
=================
|
||||
|
||||
Projects are structured into a set of top level folders called "Root Folders". They are visible in
|
||||
the project tree at the left side of the main window.
|
||||
|
||||
The :term:`novel documents` go into a root folder of type :guilabel:`Novel`. :term:`Project notes`
|
||||
go into the other root folders. These other root folder types are intended for your notes on the
|
||||
various elements of your story. Using them is of course entirely optional.
|
||||
The :term:`novel documents` go into a root folder of type **Novel**. :term:`Project notes` go into
|
||||
the other root folders. These other root folder types are intended for your notes on the various
|
||||
elements of your story. Using them is of course entirely optional.
|
||||
|
||||
A new project may not have all of the root folders present, but you can add the ones you want from
|
||||
the project tree tool bar.
|
||||
|
||||
Each root folder has one or more :term:`reference` :term:`keyword` associated with it that is used
|
||||
to reference them from other documents and notes. The intended usage of each type of root folder is
|
||||
listed below. However, aside from the :guilabel:`Novel` folder, no restrictions are applied by the
|
||||
listed below. However, aside from the **Novel** folder, no restrictions are applied by the
|
||||
application on what you put in them. You can use them however you want.
|
||||
|
||||
The root folder system is closely connected to how the Tags and References system works. For more
|
||||
details, see the :ref:`a_references` chapter.
|
||||
|
||||
:guilabel:`Novel`
|
||||
|
||||
Root Folder Types
|
||||
-----------------
|
||||
|
||||
**Novel**
|
||||
This is the root folder type for text that goes into the final novel or novels. This class of
|
||||
documents have other rules and features than the project notes. See :ref:`a_struct` for more
|
||||
details.
|
||||
|
||||
:guilabel:`Plot`
|
||||
**Plot**
|
||||
This is the root folder type where main plots can be outlined. It is optional, but adding at
|
||||
least brief notes can be useful in order to tag plot elements for the :guilabel:`Outline View`.
|
||||
Tags in this folder can be references using the ``@plot`` keyword.
|
||||
least brief notes can be useful in order to tag plot elements for the **Outline View**. Tags in
|
||||
this folder can be references using the ``@plot`` keyword.
|
||||
|
||||
:guilabel:`Characters`
|
||||
**Characters**
|
||||
Character notes go in this root folder type. These are especially important if you want to use
|
||||
the :guilabel:`Outline View` to see which character appears where, which part of the story is
|
||||
told from a specific character's point-of-view, or focusing on a particular character's
|
||||
storyline. The character names can also be inserted into for instance chapter titles when you
|
||||
create your manuscript. Tags in this type of folder can be referenced using the ``@pov`` keyword
|
||||
for point-of-view characters, ``@focus`` for a focus character, or the ``@char`` keyword for any
|
||||
the **Outline View** to see which character appears where, which part of the story is told from
|
||||
a specific character's point-of-view, or focusing on a particular character's storyline.
|
||||
|
||||
The character names can also be inserted into for instance chapter titles when you create your
|
||||
manuscript. Tags in this type of folder can be referenced using the ``@pov`` keyword for
|
||||
point-of-view characters, ``@focus`` for a focus character, or the ``@char`` keyword for any
|
||||
other character present.
|
||||
|
||||
:guilabel:`Locations`
|
||||
**Locations**
|
||||
The locations folder type is for various scene locations that you want to track. Tags in this
|
||||
folder can be references using the ``@location`` keyword.
|
||||
|
||||
:guilabel:`Timeline`
|
||||
**Timeline**
|
||||
If the story has multiple plot timelines or jumps in time within the same plot, this folder type
|
||||
can be used to track this. Tags in this type of folder can be references using the ``@time``
|
||||
keyword.
|
||||
|
||||
:guilabel:`Objects`
|
||||
Important objects in the story, for instance objects that change hands often, can be tracked
|
||||
here. Tags in this type of folder can be references using the ``@object`` keyword.
|
||||
**Objects**
|
||||
Important objects in the story, for instance physical objects that change hands often, can be
|
||||
tracked here. Tags in this type of folder can be references using the ``@object`` keyword.
|
||||
|
||||
:guilabel:`Entities`
|
||||
**Entities**
|
||||
Does your plot have many powerful organisations or companies? Or other entities that are part of
|
||||
the plot? They can be organised here. Tags in this type of folder can be references using the
|
||||
``@entity`` keyword.
|
||||
|
||||
:guilabel:`Custom`
|
||||
**Custom**
|
||||
The custom root folder type can be used for tracking anything else not covered by the above
|
||||
options. Tags in this folder type can be references using the ``@custom`` keyword.
|
||||
|
||||
The root folders correspond to the categories of tags that can be used to reference them. For more
|
||||
information about the tags listed, see :ref:`a_references_references`.
|
||||
The root folders are closely tied to the tags and reference system. Each folder type corresponds to
|
||||
the categories of tags that can be used to reference them. For more information about the tags
|
||||
listed, see :ref:`a_references_references`.
|
||||
|
||||
.. note::
|
||||
You can rename root folders to whatever you want. However, this doesn't change the reference
|
||||
@@ -105,12 +131,11 @@ information about the tags listed, see :ref:`a_references_references`.
|
||||
Deleted Documents
|
||||
-----------------
|
||||
|
||||
Deleted documents will be moved into a special :guilabel:`Trash` root folder. Documents in the
|
||||
trash folder can then be deleted permanently, either individually, or by emptying the trash from
|
||||
the menu. Documents in the trash folder are removed from the :term:`project index` and cannot be
|
||||
referenced.
|
||||
Deleted documents are moved into a special **Trash** root folder. Documents in the trash folder can
|
||||
then be deleted permanently, either individually, or by emptying the trash from the menu. Documents
|
||||
in the trash folder are removed from the :term:`project index` and cannot be referenced.
|
||||
|
||||
A document or a folder can be moved to trash from the :guilabel:`Project` menu, or by pressing
|
||||
A document or a folder can be moved to trash from the **Project** menu, or by pressing
|
||||
:kbd:`Ctrl+Shift+Del`. Root folders can only be removed when they are empty.
|
||||
|
||||
|
||||
@@ -119,13 +144,34 @@ A document or a folder can be moved to trash from the :guilabel:`Project` menu,
|
||||
Archived Documents
|
||||
------------------
|
||||
|
||||
If you don't want to delete a document, or put it in the :guilabel:`Trash` folder where it may be
|
||||
deleted accidentally, but still want it out of your main project tree, you can create an
|
||||
:guilabel:`Archive` root folder and move it there.
|
||||
If you don't want to delete a document, or put it in the **Trash** folder where it may be deleted
|
||||
accidentally, but still want it out of your main project tree, you can create an **Archive** root
|
||||
folder instead and move it there. It has the same effect as moving it to **Trash**, but it is safe
|
||||
from deletion.
|
||||
|
||||
You can drag any document to this folder and preserve its settings. The document will always be
|
||||
excluded from the :guilabel:`Build Manuscript` tool. It is also removed from the
|
||||
:term:`project index`, so the tags and references defined in it will not show up anywhere else.
|
||||
excluded from the **Build Manuscript** tool. It is also removed from the :term:`project index`, so
|
||||
the tags and references defined in it will not show up anywhere else.
|
||||
|
||||
|
||||
.. _a_proj_roots_dirs:
|
||||
|
||||
Using Folders in the Project Tree
|
||||
---------------------------------
|
||||
|
||||
Regular folders, those that are not root folders, have no structural significance to the project.
|
||||
When novelWriter is processing the documents in a project, like for instance when you create a
|
||||
manuscript from it, these folders are ignored. Only the order of the documents themselves matter.
|
||||
|
||||
The folders are there purely as a way for you to organise the documents in meaningful sections and
|
||||
to be able to collapse and hide them in the project tree when you're not working on those
|
||||
documents.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
As of version 2.0 it is possible to add child documents to other documents. This is particularly
|
||||
useful when you create chapters and scenes. If you add separate scene documents, you should also
|
||||
add separate chapter documents, even if they only contain a chapter heading. You can then add
|
||||
scene documents as child items to the chapters.
|
||||
|
||||
|
||||
.. _a_proj_roots_orphaned:
|
||||
@@ -143,8 +189,8 @@ previously have been located in the project. The project loading routine will tr
|
||||
as close as possible to this location, if it still exists. Generally, it will be appended to the
|
||||
end of the folder where it previously was located. If that folder doesn't exist, it will try to add
|
||||
it to the correct root folder type. If it cannot figure out which root folder is correct, the
|
||||
document will be added to the :guilabel:`Novel` root folder. Finally, if the :guilabel:`Novel`
|
||||
folder is missing, one will be created.
|
||||
document will be added to the **Novel** root folder. Finally, if a **Novel** does not exist, one
|
||||
will be created.
|
||||
|
||||
If the title of the document can be recovered, the word "Recovered:" will be added as a prefix to
|
||||
indicate that it may need further attention. If the title cannot be determined, the document will
|
||||
@@ -157,15 +203,16 @@ Project Lockfile
|
||||
----------------
|
||||
|
||||
To prevent lost documents caused by file conflicts when novelWriter projects are synchronised via
|
||||
file synchronisation tools, a project lockfile is written to the project storage folder. If you try
|
||||
to open a project which has such a file present, you will be presented with a warning, and some
|
||||
information about where else novelWriter thinks the project is also open. You will be given the
|
||||
option to ignore this warning, and continue opening the project at your own risk.
|
||||
file synchronisation tools, a project lockfile is written to the project storage folder when a
|
||||
project is open. If you try to open a project which already has such a file present, you will be
|
||||
presented with a warning, and some information about where else novelWriter thinks the project is
|
||||
also open. You will be given the option to ignore this warning, and continue opening the project at
|
||||
your own risk.
|
||||
|
||||
.. note::
|
||||
If, for some reason, novelWriter crashes, the lock file may remain even if there are no other
|
||||
instances keeping the project open. In such a case it is safe to ignore the lock file warning
|
||||
when re-opening the project.
|
||||
If, for some reason, novelWriter or your computer crashes, the lock file may remain even if
|
||||
there are no other instances keeping the project open. In such a case it is safe to ignore the
|
||||
lock file warning when re-opening the project.
|
||||
|
||||
.. warning::
|
||||
If you choose to ignore the warning and continue opening the project, and multiple instances of
|
||||
@@ -175,52 +222,31 @@ option to ignore this warning, and continue opening the project at your own risk
|
||||
novelWriter will try to resolve project inconsistencies the next time you open the project.
|
||||
|
||||
|
||||
.. _a_proj_roots_dirs:
|
||||
|
||||
Using Folders in the Project Tree
|
||||
---------------------------------
|
||||
|
||||
Folders, aside from root folders, have no structural significance to the project. When novelWriter
|
||||
is processing the documents in a project, like for instance when you create a manuscript from it,
|
||||
these folders are ignored. Only the order of the documents themselves matter.
|
||||
|
||||
The folders are there purely as a way for you to organise the documents in meaningful sections and
|
||||
to be able to collapse and hide them in the project tree when you're not working on those
|
||||
documents.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
As of version 2.0 it is possible to add child documents to other documents. This is particularly
|
||||
useful when you create chapters and scenes. If you add separate scene documents, you should also
|
||||
add separate chapter documents, even if they only contain a chapter heading. You can then add
|
||||
scene documents as child items to the chapters.
|
||||
|
||||
|
||||
.. _a_proj_files:
|
||||
|
||||
Project Documents
|
||||
=================
|
||||
|
||||
New documents can be created from the toolbar in the :guilabel:`Project Tree`, or by pressing
|
||||
:kbd:`Ctrl+N`. This will open the create new item menu and let you choose between a number of
|
||||
pre-defined documents and folders. You will be prompted for a label for the new item.
|
||||
New documents can be created from the toolbar in the project tree, or by pressing :kbd:`Ctrl+N`.
|
||||
This will open the create new item menu and let you choose between a number of pre-defined
|
||||
documents and folders. You will be prompted for a label for the new item.
|
||||
|
||||
You can always rename an item by selecting :guilabel:`Rename Item` from the :guilabel:`Project`
|
||||
menu, or by pressing :kbd:`F2`.
|
||||
You can always rename an item by selecting **Rename Item** from the **Project** menu, or by
|
||||
pressing :kbd:`F2` when a document or folder is selected.
|
||||
|
||||
Other settings for project items are available from the context menu that you can activate by
|
||||
right-clicking on an item in the tree. The :guilabel:`Transform` submenu includes options for
|
||||
converting, splitting, or merging items. See :ref:`a_ui_tree_split_merge` for more details on the
|
||||
latter two.
|
||||
Other settings for project documents and folders are available from the context menu that you can
|
||||
activate by right-clicking on an it in the tree. The **Transform** submenu includes options for
|
||||
converting, splitting, or merging documents. See :ref:`a_ui_tree_split_merge` for more details on
|
||||
the latter two.
|
||||
|
||||
|
||||
Document Templates
|
||||
------------------
|
||||
|
||||
If you wish to create template documents to be used when creating new project documents, like for
|
||||
instance a character note template, you can add a :guilabel:`Templates` root folder to your
|
||||
project. Any document added to this root folder will show up in the :guilabel:`Add Item` menu in
|
||||
the project tree toolbar. When selected, a new document is created with its content copied from the
|
||||
chosen template.
|
||||
instance a character note template, you can add a **Templates** root folder to your project. Any
|
||||
document added to this root folder will show up in the **Add Item** menu in the project tree
|
||||
toolbar. When selected, a new document is created with its content copied from the chosen template.
|
||||
|
||||
.. versionadded:: 2.3
|
||||
|
||||
@@ -233,8 +259,8 @@ Word Counts
|
||||
A character, word and paragraph count is maintained for each document, as well as for each section
|
||||
of a document following a :term:`heading<headings>`. The word count and change of words in the
|
||||
current session is displayed in the footer of any document open in the editor, and all stats are
|
||||
shown in the details panel below the :guilabel:`Project Tree` for any document selected in the
|
||||
project or novel trees.
|
||||
shown in the details panel below the project tree for any document selected in the project or novel
|
||||
trees.
|
||||
|
||||
The word counts are not updated in real time, but run in the background every few seconds for as
|
||||
long as the document is being actively edited.
|
||||
@@ -242,7 +268,7 @@ long as the document is being actively edited.
|
||||
A total project word count is displayed in the status bar. The total count depends on the sum of
|
||||
the values in the project tree, which again depend on an up to date :term:`project index`. If the
|
||||
counts seem wrong, a full project word recount can be initiated by rebuilding the project's index.
|
||||
Either from the :guilabel:`Tools` menu, or by pressing :kbd:`F9`.
|
||||
Either from the **Tools** menu, or by pressing :kbd:`F9`.
|
||||
|
||||
The rules for how the counts are made is covered in more detail in :ref:`a_counting`.
|
||||
|
||||
@@ -252,33 +278,35 @@ The rules for how the counts are made is covered in more detail in :ref:`a_count
|
||||
Project Settings
|
||||
================
|
||||
|
||||
The :guilabel:`Project Settings` can be accessed from the :guilabel:`Project` menu, or by pressing
|
||||
The **Project Settings** can be accessed from the **Project** menu, or by pressing
|
||||
:kbd:`Ctrl+Shift+,`. This will open a dialog box, with a set of tabs.
|
||||
|
||||
|
||||
Settings Tab
|
||||
------------
|
||||
|
||||
The :guilabel:`Settings` tab holds the project name, title, and author settings.
|
||||
The **Settings** tab holds the project name, author, and language settings.
|
||||
|
||||
The :guilabel:`Project Name` can be edited here. It is used for the GUI (main window title) and for
|
||||
generating backup files. So keep in mind that if you do change this setting, the backup file names
|
||||
will change too.
|
||||
The **Project Name** can be edited here. It is used for the main window title and for generating
|
||||
backup files. So keep in mind that if you do change this setting, the backup file names will change
|
||||
too.
|
||||
|
||||
You can also change the :guilabel:`Authors` and :guilabel:`Project Language` setting. These are
|
||||
only used when building the manuscript, for some formats.
|
||||
You can also change the **Authors** and **Project Language** setting. These are only used when
|
||||
building the manuscript, for some formats. The language setting is also used when inserting text
|
||||
into documents in the viewer, like for instance labels for keywords and special comments.
|
||||
|
||||
If your project is in a different language than your main spell checking language is set to, you
|
||||
can override the default setting here. The project language can also be changed from the
|
||||
:guilabel:`Tools` menu. You can also override the automatic backup setting if you wish.
|
||||
can override the default setting here. The project language can also be changed from the **Tools**
|
||||
menu.
|
||||
|
||||
You can also override the automatic backup setting for the project if you wish.
|
||||
|
||||
|
||||
Status and Importance Tabs
|
||||
--------------------------
|
||||
|
||||
Each document or folder of type :guilabel:`Novel` can be given a "Status" label accompanied by a
|
||||
coloured icon, and each document or folder of the remaining types can be given an "Importance"
|
||||
label.
|
||||
Each document or folder of type **Novel** can be given a "Status" label accompanied by a coloured
|
||||
icon, and each document or folder of the remaining types can be given an "Importance" label.
|
||||
|
||||
These labels are there purely for your convenience, and you are not required to use them for any
|
||||
other features to work. No other part of novelWriter accesses this information. The intention is to
|
||||
@@ -316,22 +344,22 @@ Backup
|
||||
======
|
||||
|
||||
An automatic backup system is built into novelWriter. In order to use it, a backup path to where
|
||||
the backup files are to be stored must be provided in :guilabel:`Preferences`.
|
||||
the backup files are to be stored must be provided in **Preferences**. The path defaults to a
|
||||
folder named "Backups" in your home directory.
|
||||
|
||||
Backups can be run automatically when a project is closed, which also implies it is run when the
|
||||
application itself is closed. Backups are date stamped zip files of the project files in the
|
||||
project folder (files not strictly a part of the project are ignored). The zip archives are stored
|
||||
in a subfolder of the backup path. The subfolder will have the same name as the
|
||||
:guilabel:`Project Name` as defined in :ref:`a_proj_settings`.
|
||||
in a subfolder of the backup path. The subfolder will have the same name as the **Project Name** as
|
||||
defined in :ref:`a_proj_settings`.
|
||||
|
||||
The backup feature, when configured, can also be run manually from the :guilabel:`Tools` menu.
|
||||
It is also possible to disable automated backups for a given project in
|
||||
:guilabel:`Project Settings`.
|
||||
The backup feature, when configured, can also be run manually from the **Tools** menu. It is also
|
||||
possible to disable automated backups for a given project in **Project Settings**.
|
||||
|
||||
.. note::
|
||||
For the backup to be able to run, the :guilabel:`Project Name` must be set in
|
||||
:guilabel:`Project Settings`. This value is used to generate the name and path of the backups.
|
||||
Without it, the backup will not run at all, but it will produce a warning message.
|
||||
For the backup to be able to run, the **Project Name** must be set in **Project Settings**. This
|
||||
value is used to generate the name and path of the backups. Without it, the backup will not run
|
||||
at all, but it will produce a warning message.
|
||||
|
||||
|
||||
.. _a_proj_stats:
|
||||
@@ -344,9 +372,8 @@ total word counts of your novel documents and notes at the end of the session, p
|
||||
session lasted either more than 5 minutes, or that the total word count changed. For more details
|
||||
about the log file, see :ref:`a_storage`.
|
||||
|
||||
A tool to view the content of the log file is available in the :guilabel:`Tools` menu under
|
||||
:guilabel:`Writing Statistics`. You can also launch it by pressing :kbd:`F6`, or find it on the
|
||||
sidebar.
|
||||
A tool to view the content of the log file is available in the **Tools** menu under **Writing
|
||||
Statistics**. You can also launch it by pressing :kbd:`F6`, or find it on the sidebar.
|
||||
|
||||
The tool will show a list of all your sessions, and a set of filters to apply to the data. You can
|
||||
also export the filtered data to a JSON file or to a CSV file that can be opened by a spreadsheet
|
||||
@@ -356,4 +383,4 @@ application like for instance Libre Office Calc or Excel.
|
||||
As of version 1.2, the log file also stores how much of the session time was spent idle. The
|
||||
definition of idle here is that the novelWriter main window loses focus, or the user hasn't made
|
||||
any changes to the currently open document in five minutes. The number of minutes can be altered
|
||||
in :guilabel:`Preferences`.
|
||||
in **Preferences**.
|
||||
|
||||
@@ -16,9 +16,9 @@ this chapter hopes to explain in more detail how to use this tags and references
|
||||
|
||||
.. tip::
|
||||
If you find the Tags and Reference system difficult to follow just from reading this chapter,
|
||||
you can create a new project in the :guilabel:`Welcome` dialog's New project form and select
|
||||
"Create an example project" from the "Pre-fill project" option. The example project contains
|
||||
several examples of tags and references.
|
||||
you can create a new project in the **Welcome** dialog's New project form and select "Create an
|
||||
example project" from the "Pre-fill project" option. The example project contains several
|
||||
examples of tags and references.
|
||||
|
||||
|
||||
.. _a_references_metadata:
|
||||
@@ -68,7 +68,7 @@ You can only set **one** tag per heading, and the tag has to be unique across **
|
||||
the project.
|
||||
|
||||
After a tag has been defined, it can be referenced in novel documents, or cross-referenced in other
|
||||
notes. Tags will also show up in the :guilabel:`Outline View` and in the references panel under the
|
||||
notes. Tags will also show up in the **Outline View** and in the references panel under the
|
||||
document viewer when a document is open in the viewer.
|
||||
|
||||
The syntax highlighter will indicate to you that the keyword is correctly used and that the tag is
|
||||
@@ -79,7 +79,7 @@ that valid tags do.
|
||||
The tag is the only part of these notes that novelWriter uses. The rest of the document content is
|
||||
there for you to use in whatever way you wish. Of course, the content of the documents can be added
|
||||
to the manuscript, or an outline document. If you want to compile a single document of all your
|
||||
notes, you can do this from the :guilabel:`Manuscript Build` tool.
|
||||
notes, you can do this from the **Manuscript Build** tool.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
Tags are no longer case sensitive. The tags are by default displayed with the capitalisation you
|
||||
@@ -117,8 +117,8 @@ How to Use References
|
||||
=====================
|
||||
|
||||
Each heading of any level in your project can contain references to tags set in project notes. The
|
||||
references are gathered by the indexer and used to generate the :guilabel:`Outline View`, among
|
||||
other things.
|
||||
references are gathered by the indexer and used to generate the **Outline View**, among other
|
||||
things.
|
||||
|
||||
References are set as a :term:`keyword` and a list of corresponding tags. The valid keywords are
|
||||
listed below. The format of a reference line is ``@keyword: value1, [value2] ... [valueN]``. All
|
||||
@@ -126,70 +126,69 @@ reference keywords allow multiple values.
|
||||
|
||||
``@pov``
|
||||
The point-of-view character for the current section. The target must be a note tag in a
|
||||
:guilabel:`Character` type root folder.
|
||||
**Character** type root folder.
|
||||
|
||||
``@focus``
|
||||
The character that has the focus for the current section. This can be used in cases where the
|
||||
focus is not a point-of-view character. The target must be a note tag in a :guilabel:`Character`
|
||||
type root folder.
|
||||
focus is not a point-of-view character. The target must be a note tag in a **Character** type
|
||||
root folder.
|
||||
|
||||
``@char``
|
||||
Other characters in the current section. The target must be a note tag in a
|
||||
:guilabel:`Character` type root folder. This should not include the point-of-view or focus
|
||||
character if those references are used.
|
||||
Other characters in the current section. The target must be a note tag in a **Character** type
|
||||
root folder. This should not include the point-of-view or focus character if those references
|
||||
are used.
|
||||
|
||||
``@plot``
|
||||
The plot or subplot advanced in the current section. The target must be a note tag in a
|
||||
:guilabel:`Plot` type root folder.
|
||||
The plot or subplot advanced in the current section. The target must be a note tag in a **Plot**
|
||||
type root folder.
|
||||
|
||||
``@time``
|
||||
The timelines touched by the current section. The target must be a note tag in a
|
||||
:guilabel:`Timeline` type root folder.
|
||||
The timelines touched by the current section. The target must be a note tag in a **Timeline**
|
||||
type root folder.
|
||||
|
||||
``@location``
|
||||
The location the current section takes place in. The target must be a note tag in a
|
||||
:guilabel:`Locations` type root folder.
|
||||
**Locations** type root folder.
|
||||
|
||||
``@object``
|
||||
Objects present in the current section. The target must be a note tag in a :guilabel:`Object`
|
||||
type root folder.
|
||||
Objects present in the current section. The target must be a note tag in a **Object** type root
|
||||
folder.
|
||||
|
||||
``@entity``
|
||||
Entities present in the current section. The target must be a note tag in a
|
||||
:guilabel:`Entities` type root folder.
|
||||
Entities present in the current section. The target must be a note tag in an **Entities** type
|
||||
root folder.
|
||||
|
||||
``@custom``
|
||||
Custom references in the current section. The target must be a note tag in a :guilabel:`Custom`
|
||||
type root folder. The custom folder are for any other category of notes you may want to use.
|
||||
Custom references in the current section. The target must be a note tag in a **Custom** type
|
||||
root folder. The custom folder are for any other category of notes you may want to use.
|
||||
|
||||
The syntax highlighter will alert the user that the tags and references are used correctly, and
|
||||
that the tags referenced exist.
|
||||
|
||||
.. note::
|
||||
The highlighter may be mistaken if the index of defined tags is out of date. If so, press
|
||||
:kbd:`F9` to regenerate it, or select :guilabel:`Rebuild Index` from the :guilabel:`Tools` menu.
|
||||
In general, the index for a document is regenerated when it is saved, so this shouldn't normally
|
||||
be necessary.
|
||||
:kbd:`F9` to regenerate it, or select **Rebuild Index** from the **Tools** menu. In general, the
|
||||
index for a document is regenerated when it is saved, so this shouldn't normally be necessary.
|
||||
|
||||
.. tip::
|
||||
If you add a reference in the editor to a tag that doesn't yet exist, you can right-click it and
|
||||
select :guilabel:`Create Note for Tag`. This will generate a new project note automatically with
|
||||
the new tag defined. In order for this to be possible, a root folder for that category of
|
||||
references must already exist.
|
||||
select **Create Note for Tag**. This will generate a new project note automatically with the new
|
||||
tag defined. In order for this to be possible, a root folder for that category of references
|
||||
must already exist.
|
||||
|
||||
One note can also reference another note in the same way novel documents do. When the note is
|
||||
opened in the document viewer, the references become clickable links, making it easier to follow
|
||||
connections in the plot. You can follow links in the document editor by clicking them with the
|
||||
mouse while holding down the :kbd:`Ctrl` key. Clicked links are always opened in the view panel.
|
||||
|
||||
Project notes don't show up in the :guilabel:`Outline View`, so referencing between notes is only
|
||||
Project notes don't show up in the **Outline View**, so referencing between notes is only
|
||||
meaningful if you want to be able to click-navigate between them, or of course if you just want to
|
||||
highlight that two notes are related.
|
||||
|
||||
.. tip::
|
||||
If you cross-reference between notes and export your project as an HTML document using the
|
||||
:guilabel:`Manuscript Build` tool, the cross-references become clickable links in the exported
|
||||
HTML document as well.
|
||||
**Manuscript Build** tool, the cross-references become clickable links in the exported HTML
|
||||
document as well.
|
||||
|
||||
Example of a novel document with references to characters and plots:
|
||||
|
||||
@@ -217,7 +216,7 @@ character ``@`` on a new line. It will first suggest tag or reference keywords f
|
||||
after the ``:`` has been added, suggest references from the list of tags you have already defined.
|
||||
|
||||
You can use the auto-completer to add multiple references with a ``,`` between them, and even type
|
||||
new ones. New references can be created by right-clicking on them and selecting
|
||||
:guilabel:`Create Note for Tag` from the menu.
|
||||
new ones. New references can be created by right-clicking on them and selecting **Create Note for
|
||||
Tag** from the menu.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
@@ -6,14 +6,13 @@ Novel Structure
|
||||
|
||||
This chapter covers the structure of a novel project.
|
||||
|
||||
There are two different types of documents in a project, :guilabel:`Novel Documents` and
|
||||
:guilabel:`Project Notes`. Active novel documents can only live in a :guilabel:`Novel` type root
|
||||
folder. You can also move them to :guilabel:`Archive` and :guilabel:`Trash` of course, where they
|
||||
become inactive.
|
||||
There are two different types of documents in a project, **Novel Documents** and **Project Notes**.
|
||||
Active novel documents can only live in a **Novel** type root folder. You can also move them to
|
||||
**Archive** and **Trash** of course, where they become inactive.
|
||||
|
||||
The :guilabel:`Project Tree` can distinguish between the different heading levels of the novel
|
||||
documents using coloured icons, and optionally add emphasis on the label, set in
|
||||
:guilabel:`Preferences`.
|
||||
The project tree can distinguish between the different heading levels of the novel documents using
|
||||
coloured icons, and optionally add emphasis on the label, set in **Preferences** for easier
|
||||
identification.
|
||||
|
||||
|
||||
.. _a_struct_heads:
|
||||
@@ -29,40 +28,41 @@ title. See also the :ref:`a_fmt` section for more details about the markup synta
|
||||
|
||||
.. note::
|
||||
The heading levels are not only important when generating the manuscript, they are also used by
|
||||
the indexer when building the outline tree in the :guilabel:`Outline View` as well as in the
|
||||
:guilabel:`Novel Tree`. Each heading also starts a new region where new Tags and References
|
||||
can be defined. See :ref:`a_references` for more details.
|
||||
the indexer when building the outline tree in the **Outline View** as well as in the **Novel
|
||||
Tree**. Each heading also starts a new region where new Tags and References can be defined. See
|
||||
:ref:`a_references` for more details.
|
||||
|
||||
The syntax for the four basic heading types, and the two special types, is listed in section
|
||||
The syntax for the four basic heading types, and the three special types, is listed in section
|
||||
:ref:`a_fmt_head`. The meaning of the four levels for the structure of your novel is as follows:
|
||||
|
||||
**Heading Level 1: Partition**
|
||||
This heading level signifies that the text refers to a top level partition. This is useful when
|
||||
This heading level signifies that the text refers to a top level heading. This is useful when
|
||||
you want to split the manuscript up into books, parts, or acts. These headings are not required.
|
||||
The novel title itself should use the special heading level ``#!`` covered in :ref:`a_fmt_head`.
|
||||
|
||||
**Heading Level 2: Chapter**
|
||||
This heading level signifies a chapter level partition. Each time you want to start a new
|
||||
chapter, you must add such a heading. If you choose to split your manuscript up into one
|
||||
document per scene, you need a single chapter document with just the heading. You can of course
|
||||
also add a synopsis and reference keywords to the chapter document. If you want to open the
|
||||
chapter with a quote or other introductory text that isn't part of a scene, this is also where
|
||||
you'd put that text.
|
||||
This heading level signifies a chapter. Each time you want to start a new chapter, you must add
|
||||
such a heading. If you choose to split your manuscript up into one document per scene, you need
|
||||
a single chapter document with just the heading. You can of course also add a synopsis and
|
||||
reference keywords to the chapter document. If you want to open the chapter with a quote or
|
||||
other introductory text that isn't part of a scene, this is also where you'd put that text.
|
||||
|
||||
**Heading Level 3: Scene**
|
||||
This heading level signifies a scene level partition. You must provide a title text, but the
|
||||
title text can be replaced with a scene separator or just skipped entirely when you build your
|
||||
manuscript.
|
||||
This heading level signifies a scene. You must provide a title text, but the title text can be
|
||||
replaced with a scene separator or just skipped entirely when you build your manuscript. If you
|
||||
need to distinguish between hard and soft scene breaks, there is an alternative format for
|
||||
scenes you can use for this distinction. The formatting is covered in :ref:`a_fmt_head`. See
|
||||
also :ref:`a_struct_heads_scenes`.
|
||||
|
||||
**Heading Level 4: Section**
|
||||
This heading level signifies a sub-scene level partition, usually called a "section" in the
|
||||
This heading level can be used to split up a scene, usually called a "section" in the
|
||||
documentation and the user interface. These can be useful if you want to change references
|
||||
mid-scene, like if you change the point-of-view character. You are free to use sections as you
|
||||
wish, and you can filter them out of the final manuscript just like with scene titles.
|
||||
wish, and you can filter them out of the final manuscript.
|
||||
|
||||
Page breaks are automatically added before partition and chapter headings when you build your
|
||||
project to a format that supports page breaks. If you want page breaks in other places, you have to
|
||||
specify them manually. See :ref:`a_fmt_break`.
|
||||
Page breaks can be automatically added before partition, chapter and scene headings from the
|
||||
**Manuscript Build** tool when you build your project to a format that supports page breaks. If you
|
||||
want page breaks in other places, you have to specify them manually. See :ref:`a_fmt_break`.
|
||||
|
||||
.. tip::
|
||||
There are multiple options of how to process novel headings when building the manuscript. For
|
||||
@@ -76,9 +76,9 @@ specify them manually. See :ref:`a_fmt_break`.
|
||||
Novel Title and Front Matter
|
||||
----------------------------
|
||||
|
||||
It is recommended that you add a document at the very top of each Novel root folder with the novel
|
||||
title as the first line. You should modify the level 1 heading format code with an ``!`` in order
|
||||
to render it as a document title that is excluded from any automatic Table of Content in a
|
||||
It is recommended that you add a document at the very top of each **Novel** root folder with the
|
||||
novel title as the first line. You should modify the level 1 heading format code with an ``!`` in
|
||||
order to render it as a document title that is excluded from any automatic Table of Content in a
|
||||
manuscript build document, like so:
|
||||
|
||||
.. code-block:: md
|
||||
@@ -102,7 +102,7 @@ Unnumbered Chapter Headings
|
||||
|
||||
If you use the automatic numbering feature for your chapters, but you want to keep some special
|
||||
chapters separate from this, you can add an ``!`` to the level 2 heading formatting code to tell
|
||||
the build tool to skip these chapters.
|
||||
the build tool to skip these chapters when adding numbers.
|
||||
|
||||
.. code-block:: md
|
||||
|
||||
@@ -110,13 +110,31 @@ the build tool to skip these chapters.
|
||||
|
||||
Chapter Text
|
||||
|
||||
There is a separate formatting feature for such chapter titles in the :guilabel:`Manuscript Build`
|
||||
tool as well. See the :ref:`a_manuscript` page for more details. When building a document of a
|
||||
format that supports page breaks, also unnumbered chapters will have a page break added just like
|
||||
for normal chapters.
|
||||
There is a separate formatting feature for such chapter titles in the **Manuscript Build** tool as
|
||||
well. See the :ref:`a_manuscript` page for more details. When building a document of a format that
|
||||
supports page breaks, also unnumbered chapters can have a page break added just like for normal
|
||||
chapters.
|
||||
|
||||
.. Note::
|
||||
Previously, you could also disable the automatic numbering of a chapter by adding an ``*`` as
|
||||
the first character of the chapter title itself. This feature has been dropped in favour of the
|
||||
current format in order to keep level 1 and 2 headers consistent. Please update your chapter
|
||||
headings if you've used this syntax.
|
||||
|
||||
.. _a_struct_heads_scenes:
|
||||
|
||||
Hard and Soft Scene Breaks
|
||||
--------------------------
|
||||
|
||||
If you need two different ways to style scenes in your manuscript, like if you want to insert
|
||||
different scene separators for soft and hard scene breaks, there is an alternative scene format
|
||||
available for scene headings with a ``!`` added to the formatting code.
|
||||
|
||||
.. code-block:: md
|
||||
|
||||
### Soft Scene Transition
|
||||
|
||||
A soft scene break.
|
||||
|
||||
###! Hard Scene Transition
|
||||
|
||||
A hard scene break.
|
||||
|
||||
There is a separate formatting feature for these titles in the **Manuscript Build** tool.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
@@ -15,10 +15,9 @@ file locations are described in this chapter.
|
||||
Configuration
|
||||
=============
|
||||
|
||||
The general configuration of novelWriter, including everything that is in :guilabel:`Preferences`,
|
||||
is saved in one central configuration file. The location of this file depends on your operating
|
||||
system. The system paths are provided by the Qt QStandardPaths_ class and its ``ConfigLocation``
|
||||
value.
|
||||
The general configuration of novelWriter, including everything that is in **Preferences**, is saved
|
||||
in one central configuration file. The location of this file depends on your operating system. The
|
||||
system paths are provided by the Qt QStandardPaths_ class and its ``ConfigLocation`` value.
|
||||
|
||||
The standard paths are:
|
||||
|
||||
@@ -40,9 +39,8 @@ Application Data
|
||||
================
|
||||
|
||||
novelWriter also stores a bit of data that is generated by the user's actions. This includes the
|
||||
list of recent projects form the :guilabel:`Open Project` dialog. Custom themes should also be
|
||||
saved here. The system paths are provided by the Qt QStandardPaths_ class and its
|
||||
``AppDataLocation`` value.
|
||||
list of recent projects form the **Welcome** dialog. Custom themes should also be saved here. The
|
||||
system paths are provided by the Qt QStandardPaths_ class and its ``AppDataLocation`` value.
|
||||
|
||||
The standard paths are:
|
||||
|
||||
@@ -56,3 +54,12 @@ user's username on Windows.
|
||||
.. note::
|
||||
These are the standard operating system defined locations. If your system has been set up in a
|
||||
different way, these locations may also be different.
|
||||
|
||||
The Application Data location also holds several folders:
|
||||
|
||||
``cache``
|
||||
This folder is used to save the preview data for the **Manuscript Build** tool.
|
||||
|
||||
``icons``, ``syntax`` and ``themes``
|
||||
These folders are empty by default, but this is where the user can store custom theme files.
|
||||
See :ref:`a_custom` for more details.
|
||||
|
||||
@@ -159,6 +159,5 @@ You can also build a PDF manual from the documentation using the ``pkgutils.py``
|
||||
python pkgutils.py manual
|
||||
|
||||
This will build the documentation as a PDF using LaTeX. The file will then be copied into the
|
||||
assets folder and made available in the :guilabel:`Help` menu in novelWriter. The Sphinx build
|
||||
system has a few extra dependencies when building the PDF. Please check the `Sphinx Docs`_ for more
|
||||
details.
|
||||
assets folder and made available in the **Help** menu in novelWriter. The Sphinx build system has a
|
||||
few extra dependencies when building the PDF. Please check the `Sphinx Docs`_ for more details.
|
||||
|
||||
@@ -55,10 +55,10 @@ string. The documents are saved with a filename assembled from this handle and t
|
||||
``.nwd``.
|
||||
|
||||
If you wish to find the file system location of a document in the project, you can either look it
|
||||
up in the project XML file, select :guilabel:`Show File Details` from the :guilabel:`Document` menu
|
||||
when having the document open in the editor, or look in the ``ToC.txt`` file in the root of the
|
||||
project folder. The ``ToC.txt`` file has a list of all documents in the project, referenced by
|
||||
their label, and where they are saved.
|
||||
up in the project XML file, select **Show File Details** from the **Document** menu when having the
|
||||
document open in the editor, or look in the ``ToC.txt`` file in the root of the project folder. The
|
||||
``ToC.txt`` file has a list of all documents in the project, referenced by their label, and where
|
||||
they are saved.
|
||||
|
||||
The reason for this cryptic file naming is to avoid issues with file naming conventions and
|
||||
restrictions on different operating systems, and also to have a file name that does not depend on
|
||||
@@ -109,7 +109,7 @@ The Project Index
|
||||
|
||||
Between writing sessions, the project index is saved in a JSON file in ``meta/index.json``.
|
||||
This file is not critical. If it is lost, it can be completely rebuilt from within novelWriter from
|
||||
the :guilabel:`Tools` menu.
|
||||
the **Tools** menu.
|
||||
|
||||
The index is maintained and updated whenever a document or note is saved in the editor. It contains
|
||||
all references and tags in documents and notes, as well as the location of all headers in the
|
||||
@@ -125,8 +125,8 @@ the index. If this too fails, you have likely encountered a bug.
|
||||
Build Definitions
|
||||
-----------------
|
||||
|
||||
The build definitions from the :guilabel:`Manuscript Build` tool are kept in the
|
||||
``meta/builds.json`` file. If this file is lost, all custom build definitions are lost too.
|
||||
The build definitions from the **Manuscript Build** tool are kept in the ``meta/builds.json`` file.
|
||||
If this file is lost, all custom build definitions are lost too.
|
||||
|
||||
|
||||
Cached GUI Options
|
||||
@@ -144,17 +144,17 @@ Custom Word List
|
||||
----------------
|
||||
|
||||
A file named ``meta/userdict.json`` contains all the custom words you've added to the project for
|
||||
spell checking purposes. The content of the file can be edited from the :guilabel:`Tools` menu. If
|
||||
you lose this file, all your custom spell check words will be lost too.
|
||||
spell checking purposes. The content of the file can be edited from the **Tools** menu. If you lose
|
||||
this file, all your custom spell check words will be lost too.
|
||||
|
||||
|
||||
Session Stats
|
||||
-------------
|
||||
|
||||
The writing progress is saved in the ``meta/sessions.jsonl`` file. This file records the length
|
||||
and word counts of each writing session on the given project. The file is used by the
|
||||
:guilabel:`Writing Statistics` tool. If this file is lost, the history it contains is also lost,
|
||||
but it has otherwise no impact on the project.
|
||||
and word counts of each writing session on the given project. The file is used by the **Writing
|
||||
Statistics** tool. If this file is lost, the history it contains is also lost, but it has otherwise
|
||||
no impact on the project.
|
||||
|
||||
Each session is recorded as a JSON object on a single line of the file. Each session record is
|
||||
appended tot he file.
|
||||
|
||||
@@ -21,14 +21,15 @@ GUI Layout and Design
|
||||
The user interface of novelWriter is intended to be as minimalistic as practically possible, while
|
||||
at the same time provide useful features needed for writing a novel.
|
||||
|
||||
The main window does not have an editor toolbar like many other applications do. This reduces
|
||||
clutter, and since the documents are formatted with style tags, it is more or less redundant.
|
||||
Still, a small formatting toolbar can be popped out by clicking the three dots in the header of the
|
||||
document editor to give quick access to standard formatting codes.
|
||||
The main window does not by default have an editor toolbar like many other applications do. This
|
||||
reduces clutter, and since the documents are formatted with style tags, it is not needed most of
|
||||
the time. Still, a small formatting toolbar can be popped out by clicking the left-most button in
|
||||
the header of the document editor. It gives quick access to standard formatting codes.
|
||||
|
||||
Most formatting features supported are available through convenient keyboard shortcuts. They are
|
||||
also available in the main menu, so you don't have to look up formatting codes every time you need
|
||||
them. For reference, a list of all shortcuts can be found in the :ref:`a_kb` chapter.
|
||||
also available in the main menu under **Format**, so you don't have to look up formatting codes
|
||||
every time you need them. For reference, a list of all shortcuts can be found in the :ref:`a_kb`
|
||||
chapter.
|
||||
|
||||
.. note::
|
||||
novelWriter is not intended to be a full office type word processor. It doesn't support images,
|
||||
@@ -37,13 +38,13 @@ them. For reference, a list of all shortcuts can be found in the :ref:`a_kb` cha
|
||||
simple features.
|
||||
|
||||
On the left side of the main window, you will find a sidebar. This bar has buttons for the standard
|
||||
views you can switch between, a quick link to the :guilabel:`Build Manuscript` tool, and a set of
|
||||
views you can switch between, a quick link to the **Build Manuscript** tool, and a set of
|
||||
project-related tools and quick access to settings at the bottom.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
A number of new formatting options were added in 2.2 to allow for some special formatting cases.
|
||||
At the same time, a small formatting toolbar was added in the editor. It is hidden by default,
|
||||
but can be opened by pressing the three dots icon in the top right corner.
|
||||
but can be opened by pressing the icon button in the top right corner.
|
||||
|
||||
|
||||
Project Tree and Editor View
|
||||
@@ -53,19 +54,19 @@ Project Tree and Editor View
|
||||
|
||||
A screenshot of the Project Tree and Editor View.
|
||||
|
||||
When in :guilabel:`Project Tree View` mode, the main work area of the main window is split in two,
|
||||
or optionally three, panels. The left-most panel contains the project tree and all the documents in
|
||||
your project. The second panel is the document editor.
|
||||
When the application is in **Project Tree View** mode, the main work area of the main window is
|
||||
split in two, or optionally three, panels. The left-most panel contains the project tree and all
|
||||
the documents in your project. The second panel is the document editor.
|
||||
|
||||
An optional third panel on the right side contains a document viewer which can view any document in
|
||||
your project independently of what is open in the document editor. This panel is not intended as a
|
||||
preview window, although you can use it for this purpose if you wish if you need to check that the
|
||||
formatting tags behave as you expected. The main purpose of the viewer is for viewing your notes
|
||||
next to your editor while you're writing.
|
||||
preview window, although you can use it for this purpose if you wish. For instance if you need to
|
||||
check that the formatting tags behave as you expect. However, the main purpose of the viewer is for
|
||||
viewing your notes next to your editor while you're writing.
|
||||
|
||||
The editor also has a :guilabel:`Focus Mode` you can toggle either from the menu, from the icon in
|
||||
the editor's header, or by pressing :kbd:`F8`. When :guilabel:`Focus Mode` is enabled, all the user
|
||||
interface elements other than the document editor itself are hidden away.
|
||||
The editor also has a **Focus Mode** you can toggle either from the menu, from the icon in the
|
||||
editor's header, or by pressing :kbd:`F8`. When **Focus Mode** is enabled, all the user interface
|
||||
elements other than the document editor itself are hidden away.
|
||||
|
||||
|
||||
Novel View and Editor View
|
||||
@@ -73,31 +74,32 @@ Novel View and Editor View
|
||||
|
||||
.. figure:: images/fig_novel_tree_view.png
|
||||
|
||||
A screenshot of the Novel Tree View.
|
||||
A screenshot of the Novel Tree and Editor View.
|
||||
|
||||
When in :guilabel:`Novel Tree View` mode, the project tree is replaced by an overview of your novel
|
||||
structure for a specific Novel :term:`root folder`. Instead of showing individual documents, the
|
||||
tree now shows all headings of your novel text. This includes multiple headings within the same
|
||||
document.
|
||||
When the application is in **Novel Tree View** mode, the project tree is replaced by an overview of
|
||||
your novel structure for a specific Novel :term:`root folder`. Instead of showing individual
|
||||
documents, the tree now shows all headings of your novel text. This includes multiple headings
|
||||
within the same document.
|
||||
|
||||
Each heading is indented according to the heading level. You can open and edit your novel documents
|
||||
from this view as well. All headings contained in the currently open document should be highlighted
|
||||
in the view to indicate which ones belong together in the same document.
|
||||
Each heading is indented according to the heading level, not its parent/child relationship to other
|
||||
elements of your project. You can open and edit your novel documents from this view as well. All
|
||||
headings contained in the currently open document should be highlighted in the view to indicate
|
||||
which ones belong together in the same document.
|
||||
|
||||
If you have multiple "Novel" type root folders, the header of the novel view becomes a dropdown
|
||||
If you have multiple **Novel** type root folders, the header of the novel view becomes a dropdown
|
||||
box. You can then switch between them by clicking the :guilabel:`Outline of ...` text. You can also
|
||||
click the novel icon button next to it.
|
||||
|
||||
Generally, the novel view should update when you make changes to the novel structure, including
|
||||
edits of the current document in the editor. The information is only updated when the automatic
|
||||
save of the document is triggered, or you manually press :kbd:`Ctrl+S` to save changes. (You can
|
||||
adjust the auto-save interval in :guilabel:`Preferences`.) You can also regenerate the whole novel
|
||||
view by pressing the refresh button in the novel view header.
|
||||
adjust the auto-save interval in **Preferences**.) You can also regenerate the whole novel view by
|
||||
pressing the refresh button in the novel view header.
|
||||
|
||||
It is possible to show an optional third column in the novel view. The settings are available from
|
||||
the menu button in the toolbar.
|
||||
|
||||
If you click the arrow icon to the right of each item, a tooltip will pop out showing you all the
|
||||
If you click the triangular icon to the right of each item, a tooltip will pop out showing all the
|
||||
meta data collected for that heading.
|
||||
|
||||
|
||||
@@ -108,9 +110,9 @@ Novel Outline View
|
||||
|
||||
A screenshot of the Novel Outline View.
|
||||
|
||||
When in :guilabel:`Novel Outline View` mode, the tree, editor and viewer will be replaced by a
|
||||
large table that shows the entire novel structure with all the tags and references listed. Pretty
|
||||
much all collected meta data is available here in different columns.
|
||||
When the application is in **Novel Outline View** mode, the tree, editor and viewer will be
|
||||
replaced by a large table that shows the entire novel structure with all the tags and references
|
||||
listed. Pretty much all collected meta data is available here in different columns.
|
||||
|
||||
You can select which novel root folder to display from the dropdown box, and you can select which
|
||||
columns to show or hide from the menu button. You can also rearrange the columns by drag and drop.
|
||||
@@ -122,18 +124,30 @@ Colour Themes
|
||||
|
||||
By default, novelWriter will use the colour theme provided by the Qt library, which is determined
|
||||
by the Fusion_ style setting. You can also choose between a standard dark and light theme that have
|
||||
neutral colours from :guilabel:`Preferences`. Other colour themes are also available. More themes
|
||||
can be contributed to novelWriter on GitHub.
|
||||
neutral colours from **Preferences**.
|
||||
|
||||
If you wish, you *can* create your own colour themes, and even have them added to the application.
|
||||
See :ref:`a_custom_theme` for more details.
|
||||
|
||||
Switching the GUI colour theme does not affect the colours of the editor and viewer. They have
|
||||
separate colour selectable from the "Document colour theme" setting in :guilabel:`Preferences`.
|
||||
They are separated because there are a lot more options to choose from for the editor and viewer.
|
||||
separate colour selectable from the "Document colour theme" setting in **Preferences**. They are
|
||||
separated because there are a lot more options to choose from for the editor and viewer.
|
||||
|
||||
.. note::
|
||||
If you switch between light and dark mode on the GUI, you should also switch editor theme to
|
||||
match, otherwise icons may be hard to see in the editor and viewer.
|
||||
|
||||
|
||||
Project Search
|
||||
--------------
|
||||
|
||||
A global search tool is available from the side bar. It allows you to search through your entire
|
||||
project. The tool does not provide a replace feature. There is a search and replace tool available
|
||||
in the document editor that acts on the open document.
|
||||
|
||||
.. versionadded:: 2.4
|
||||
|
||||
|
||||
.. _a_breakdown_project:
|
||||
|
||||
Project Layout
|
||||
@@ -152,12 +166,12 @@ within those documents.
|
||||
|
||||
An illustration of how heading levels correspond to the novel structure.
|
||||
|
||||
The four heading levels (**H1** to **H4**) are treated as follows:
|
||||
The four heading levels, **Level 1** to **Level 4**, are treated as follows:
|
||||
|
||||
* **H1** is used for the novel title, and for partitions.
|
||||
* **H2** is used for chapter tiles.
|
||||
* **H3** is used for scene titles -- optionally replaced by separators.
|
||||
* **H4** is for section titles within scenes, if such granularity is needed.
|
||||
* **Level 1** is used for the novel title, and for partitions.
|
||||
* **Level 2** is used for chapter tiles.
|
||||
* **Level 3** is used for scene titles -- optionally replaced by separators.
|
||||
* **Level 4** is for section titles within scenes, if such granularity is needed.
|
||||
|
||||
The project tree will select an icon for the document based on the first heading in it.
|
||||
|
||||
@@ -178,25 +192,25 @@ Building a Manuscript
|
||||
=====================
|
||||
|
||||
The project can at any time be assembled into a range of different formats through the
|
||||
:guilabel:`Build Manuscript` tool. Natively, novelWriter supports `Open Document`_, HTML5, and
|
||||
**Build Manuscript** tool. Natively, novelWriter supports `Open Document`_, HTML5, and
|
||||
various flavours of Markdown.
|
||||
|
||||
The HTML5 format is suitable for conversion by a number of other tools like Pandoc_, or for
|
||||
importing into word processors if the Open Document format isn't suitable. The Open Document format
|
||||
is supported by most Office type applications. In addition, printing is also possible. Print to PDF
|
||||
is supported by most office type applications. In addition, printing is also possible. Print to PDF
|
||||
is available from the print dialog.
|
||||
|
||||
In addition, you can export the content of the project to a JSON file. This is useful if you want
|
||||
to write your own custom processing script in for instance Python, as the entire novel can be read
|
||||
into a Python dictionary with a couple of lines of code. The JSON file can be populated with either
|
||||
HTML formatted text, or with the raw text as typed into the novel documents.
|
||||
For advanced processing, you can export the content of the project to a JSON file. This is useful
|
||||
if you want to write your own custom processing script in for instance Python, as the entire novel
|
||||
can be read into a Python dictionary with a couple of lines of code. The JSON file can be populated
|
||||
with either HTML formatted text, or with the raw text as typed into the novel documents.
|
||||
|
||||
See :ref:`a_manuscript` for more details.
|
||||
|
||||
.. versionadded:: 2.1
|
||||
You can now define multiple build definitions in the :guilabel:`Build Manuscript` tool. This
|
||||
allows you to define specific settings for various types of draft documents, outline documents,
|
||||
and manuscript formats. See :ref:`a_manuscript` for more details.
|
||||
You can now define multiple build definitions in the **Build Manuscript** tool. This allows you
|
||||
to define specific settings for various types of draft documents, outline documents, and
|
||||
manuscript formats. See :ref:`a_manuscript` for more details.
|
||||
|
||||
|
||||
.. _a_breakdown_storage:
|
||||
|
||||
@@ -10,7 +10,7 @@ values and allowing for some text formatting. The syntax is based on Markdown, b
|
||||
(bold) and strike through text, as well as four levels of headings. For some further complex
|
||||
formatting needs, a set of shortcodes can be used.
|
||||
|
||||
In addition to formatting codes, novelWriter allows for comments, a synopsis tag, and a set of
|
||||
In addition to formatting codes, novelWriter allows for comments, a synopsis tag, and a number of
|
||||
keyword and value sets used for :term:`tags<tag>` and :term:`references<reference>`. There are also
|
||||
some codes that apply to whole paragraphs. See :ref:`a_fmt_text` for more details.
|
||||
|
||||
@@ -35,7 +35,7 @@ have a distinct colour, and the references themselves will get a colour if they
|
||||
references will get a squiggly error line underneath. The same applies to duplicate tags.
|
||||
|
||||
There are a number of syntax highlighter colour themes available, both for light and dark GUIs. You
|
||||
can select them from :guilabel:`Preferences`.
|
||||
can select them from **Preferences**.
|
||||
|
||||
|
||||
.. _a_fmt_head:
|
||||
@@ -54,6 +54,9 @@ correctly to produce the intended result. See :ref:`a_struct_heads` for more det
|
||||
|
||||
``# Title Text``
|
||||
Heading level one. For novel documents, the level indicates the start of a new partition.
|
||||
Partitions are for when you want to split your story into "Part 1", "Part 2", etc. You can also
|
||||
choose to use them for splitting the text up into acts, and then hide these headings in your
|
||||
manuscript.
|
||||
|
||||
``## Title Text``
|
||||
Heading level two. For novel documents, the level indicates the start of a new chapter. Chapter
|
||||
@@ -62,16 +65,17 @@ correctly to produce the intended result. See :ref:`a_struct_heads` for more det
|
||||
``### Title Text``
|
||||
Heading level three. For novel documents, the level indicates the start of a new scene. Scene
|
||||
numbers or scene separators can be inserted automatically when building the manuscript, so you
|
||||
can use the title field as a working title for your scenes if you wish.
|
||||
can use the title field as a working title for your scenes if you wish, but you must provide a
|
||||
minimal title.
|
||||
|
||||
``#### Title Text``
|
||||
Heading level four. For novel documents, the level indicates the start of a new section. Section
|
||||
titles can be replaced by separators or ignored completely when building the manuscript.
|
||||
|
||||
For headings level one and two, adding a ``!`` modifies its meaning:
|
||||
For headings level one through three, adding a ``!`` modifies the meaning of the heading:
|
||||
|
||||
``#! Title Text``
|
||||
This tells the build tool that the level one heading is intended to be used for the novel's or
|
||||
This tells the build tool that the level one heading is intended to be used for the novel or
|
||||
notes folder's main title, like for instance on the front page. When building the manuscript,
|
||||
this will use a different styling and will exclude the title from, for instance, a Table of
|
||||
Contents in Libre Office.
|
||||
@@ -81,6 +85,12 @@ For headings level one and two, adding a ``!`` modifies its meaning:
|
||||
chapter numbers are being used. Such titles are useful for a prologue for instance. See
|
||||
:ref:`a_struct_heads_unnum` for more details.
|
||||
|
||||
``###! Title Text``
|
||||
This is an alternative scene heading that can be formatted differently in the **Manuscript
|
||||
Build** tool. It is intended for separating "soft" and "hard" scene breaks. Aside from this, it
|
||||
behaves identically to a regular scene heading. See :ref:`a_struct_heads_scenes` for more
|
||||
details.
|
||||
|
||||
.. note::
|
||||
The space after the ``#`` or ``!`` character is mandatory. The syntax highlighter will change
|
||||
colour and font size when the heading is correctly formatted.
|
||||
@@ -101,8 +111,8 @@ In addition, the editor supports a few additional types of white spaces:
|
||||
* Thin spaces are also supported, and can be inserted with :kbd:`Ctrl+K`, :kbd:`Shift+Space`.
|
||||
* Non-breaking thin space can be inserted with :kbd:`Ctrl+K`, :kbd:`Ctrl+Space`.
|
||||
|
||||
These are all insert features, and the :guilabel:`Insert` menu has more. The keyboard shortcuts for
|
||||
them are also listed in :ref:`a_kb_ins`.
|
||||
These are all insert features, and the **Insert** menu has more. The keyboard shortcuts for them
|
||||
are also listed in :ref:`a_kb_ins`.
|
||||
|
||||
Non-breaking spaces are highlighted by the syntax highlighter with an alternate coloured
|
||||
background, depending on the selected theme.
|
||||
@@ -124,12 +134,12 @@ A minimal set of Markdown text emphasis styles are supported for text paragraphs
|
||||
The text is rendered as emphasised text (italicised).
|
||||
|
||||
``**text**``
|
||||
The text is rendered as strongly important text (bold).
|
||||
The text is rendered as strongly emphasised text (bold).
|
||||
|
||||
``~~text~~``
|
||||
Strike through text.
|
||||
|
||||
In Markdown guides it is often recommended to differentiate between strong importance and emphasis
|
||||
In Markdown guides it is often recommended to differentiate between strong emphasis and emphasis
|
||||
by using ``**`` for strong and ``_`` for emphasis, although Markdown generally also supports ``__``
|
||||
for strong and ``*`` for emphasis. However, since the differentiation makes the highlighting and
|
||||
conversion significantly simpler and faster, in novelWriter this is a rule, not just a
|
||||
@@ -177,14 +187,15 @@ solved with simple Markdown-like formatting codes. Available shortcodes are list
|
||||
"``[i]text[/i]``", "Text is rendered as italicised text."
|
||||
"``[s]text[/s]``", "Text is rendered as strike through text."
|
||||
"``[u]text[/u]``", "Text is rendered as underlined text."
|
||||
"``[m]text[/m]``", "Text is rendered as highlighted text."
|
||||
"``[sup]text[/sup]``", "Text is rendered as superscript text."
|
||||
"``[sub]text[/sub]``", "Text is rendered as subscript text."
|
||||
|
||||
Unlike Markdown style codes, these can be used anywhere within a paragraph. Even in the middle of a
|
||||
word if you need to. You can also freely combine them to form more complex formatting.
|
||||
|
||||
The shortcodes are available from the :guilabel:`Format` menu and in the editor toolbar, which can
|
||||
be activated by clicking the three dots in the editor header.
|
||||
The shortcodes are available from the **Format** menu and in the editor toolbar, which can be
|
||||
activated by clicking the left-most icon button in the editor header.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
@@ -194,30 +205,39 @@ be activated by clicking the three dots in the editor header.
|
||||
Comments and Synopsis
|
||||
=====================
|
||||
|
||||
In addition to these standard Markdown features, novelWriter also allows for comments in documents.
|
||||
The text of a comment is ignored by the word counter. The text can also be filtered out when
|
||||
building the manuscript or viewing the document.
|
||||
In addition to the above formatting features, novelWriter also allows for comments in documents.
|
||||
The text of a comment is always ignored by the word counter. The text can also be filtered out
|
||||
when building the manuscript or viewing the document.
|
||||
|
||||
If the first word of a comment is ``Synopsis:`` (with the colon included), the comment is treated
|
||||
in a special manner and will show up in the :ref:`a_ui_outline` in a dedicated column. The word
|
||||
``synopsis`` is not case sensitive. If it is correctly formatted, the syntax highlighter will
|
||||
indicate this by altering the colour of the word.
|
||||
The first word of a comment, followed by a colon, can be one of a small set of modifiers that
|
||||
indicates the comment is intended for a specific purpose. For instance, if the comment starts with
|
||||
``Synopsis:``, the comment is treated in a special manner and will show up in the
|
||||
:ref:`a_ui_outline` in a dedicated column. The word ``synopsis`` is not case sensitive. If it is
|
||||
correctly formatted, the syntax highlighter will indicate this by altering the colour of the word.
|
||||
|
||||
``% text ...``
|
||||
The different styles of comments are as follows:
|
||||
|
||||
``% Comment text ...``
|
||||
This is a comment. The text is not rendered by default (this can be overridden), seen in the
|
||||
document viewer, or counted towards word counts.
|
||||
document viewer, or counted towards word counts. It is intended for you to make notes in your
|
||||
text for your own sake, whatever that may be, that isn't part of the story text. This is the
|
||||
general format of a comment.
|
||||
|
||||
``%Synopsis: text ...``
|
||||
``%Synopsis: Comment text ...``
|
||||
This is a synopsis comment. It is generally treated in the same way as a regular comment, except
|
||||
that it is also captured by the indexing algorithm and displayed in the :ref:`a_ui_outline`. It
|
||||
can also be filtered separately when building the project to for instance generate an outline
|
||||
document of the whole project.
|
||||
|
||||
``%Short: text ...``
|
||||
``%Short: Comment text ...``
|
||||
This is a short description comment. It is identical to the synopsis comment (they are
|
||||
interchangeable), but is intended to be used for project notes. The text shows up in the
|
||||
Reference panel below the document viewer in the last column labelled
|
||||
:guilabel:`Short Description`.
|
||||
Reference panel below the document viewer in the last column labelled **Short Description**.
|
||||
|
||||
``%~ Comment text ...``
|
||||
This can be used to exclude story text from your manuscript without having to delete it from
|
||||
your text. Comments with the ``~`` will *never* be included in the manuscript, even if you have
|
||||
chosen to include comments in it. That is the main difference between these two formats.
|
||||
|
||||
.. note::
|
||||
Only one comment can be flagged as a synopsis or short comment for each heading. If multiple
|
||||
@@ -240,14 +260,14 @@ heading. Setting it multiple times under the same heading will just override the
|
||||
A tag keyword followed by the tag value, like for instance the name of a character.
|
||||
|
||||
References can be set anywhere within a section, and are collected according to their category.
|
||||
References are in the form:
|
||||
References are on the form:
|
||||
|
||||
``@keyword: value``
|
||||
``@keyword: value1, value2, ..., valueN``
|
||||
A reference keyword followed by a value, or a comma separated list of values.
|
||||
|
||||
Tags and references are covered in detail in the :ref:`a_references` chapter. The keywords can be
|
||||
inserted at the cursor position in the editor via the :guilabel:`Insert` menu. If you start typing
|
||||
an ``@`` on a new line, and auto-complete menu will also pop up suggesting keywords.
|
||||
inserted at the cursor position in the editor via the **Insert** menu. If you start typing an ``@``
|
||||
on a new line, and auto-complete menu will also pop up suggesting keywords.
|
||||
|
||||
|
||||
.. _a_fmt_align:
|
||||
@@ -255,8 +275,8 @@ an ``@`` on a new line, and auto-complete menu will also pop up suggesting keywo
|
||||
Paragraph Alignment and Indentation
|
||||
===================================
|
||||
|
||||
All documents have the text by default aligned to the left or justified, depending on your
|
||||
settings in :guilabel:`Preferences`.
|
||||
All documents have the text by default aligned to the left or justified, depending on your setting
|
||||
in **Preferences**.
|
||||
|
||||
You can override the default text alignment on individual paragraphs by specifying alignment tags.
|
||||
These tags are double angle brackets. Either ``>>`` or ``<<``. You put them either before or after
|
||||
@@ -291,6 +311,10 @@ Examples:
|
||||
Vertical Space and Page Breaks
|
||||
==============================
|
||||
|
||||
You can apply page breaks to partition, chapter and scene headings for novel documents from the
|
||||
**Manuscript Build** tool. If you need to add a page break or additional vertical spacing in other
|
||||
places, there are special codes available for this purpose.
|
||||
|
||||
Adding more than one line break between paragraphs will **not** increase the space between those
|
||||
paragraphs when building the project. To add additional space between paragraphs, add the text
|
||||
``[vspace]`` on a line of its own, and the build tool will insert a blank paragraph in its place.
|
||||
@@ -298,13 +322,8 @@ paragraphs when building the project. To add additional space between paragraphs
|
||||
If you need multiple blank paragraphs just add a colon and a number to the above code. For
|
||||
instance, writing ``[vspace:3]`` will insert three blank paragraphs.
|
||||
|
||||
Normally, the manuscript build tool will insert a page break before all headings of level one and
|
||||
for all headings of level two for novel documents, i.e. chapters, but not for project notes.
|
||||
|
||||
If you need to add a page break somewhere else, put the text ``[new page]`` on a line by itself
|
||||
before the text you wish to start on a new page.
|
||||
|
||||
If you want page breaks for scenes and sections, you must add them manually.
|
||||
If you need to add a page break somewhere, put the text ``[new page]`` on a line by itself before
|
||||
the text you wish to start on a new page.
|
||||
|
||||
.. note::
|
||||
The page break code is applied to the text that follows it. It adds a "page break before" mark
|
||||
@@ -320,8 +339,8 @@ If you want page breaks for scenes and sections, you must add them manually.
|
||||
[vspace:2]
|
||||
|
||||
This is another text paragraph, but there will be two empty paragraphs
|
||||
in-between them.
|
||||
between them.
|
||||
|
||||
[new page]
|
||||
|
||||
This text will always start on a new page if the build format has pages.
|
||||
This text will start on a new page if the build format has pages.
|
||||
|
||||
@@ -8,7 +8,7 @@ This chapter covers in more detail the different project views available in nove
|
||||
|
||||
.. figure:: images/fig_project_tree_detailed.png
|
||||
|
||||
The Project Tree as it appears when loading a sample project.
|
||||
The **Project Content** tree as it appears when loading a sample project.
|
||||
|
||||
|
||||
.. _a_ui_tree:
|
||||
@@ -21,33 +21,32 @@ the project, and has four columns.
|
||||
|
||||
**Column 1**
|
||||
The first column shows the icon and label of each folder, document, or note in your project. The
|
||||
label is not the same as the title you set inside the document. However, the document's label
|
||||
will appear in the header above the document text itself so you know where in the project an
|
||||
open document belongs. The icon is selected based on the type of item, and for novel documents,
|
||||
the level of the first header in the document text.
|
||||
label is not the same as the heading title you set inside the document. However, the document's
|
||||
label will appear in the header above the document text itself so you know where in the project
|
||||
an open document belongs. The icon is selected based on the type of item, and for novel
|
||||
documents, the level of the first heading in the document text.
|
||||
|
||||
**Column 2**
|
||||
The second column shows the word count of the document, or the sum of words of the child items
|
||||
for folders and documents with sub-documents. If the counts seem incorrect, they can be updated
|
||||
by rebuilding the :term:`project index` from the :guilabel:`Tools` menu, or by pressing
|
||||
:kbd:`F9`.
|
||||
by rebuilding the :term:`project index` from the **Tools** menu, or by pressing :kbd:`F9`.
|
||||
|
||||
**Column 3**
|
||||
The third column indicates whether the document is considered active or inactive in the project.
|
||||
You can use this flag to indicate that a document is still in the project, but should not be
|
||||
considered an active part of it. When you run the :guilabel:`Build Manuscript` tool, you can
|
||||
include or exclude documents based on this flag. You can change this value from the
|
||||
considered an active part of it. When you run the **Build Manuscript** tool, you can include or
|
||||
exclude documents based on this flag. You can change this value from the right-click
|
||||
:term:`context menu`.
|
||||
|
||||
**Column 4**
|
||||
The fourth column shows the user-defined status or importance labels you've assigned to each
|
||||
project item. See :ref:`a_ui_tree_status` for more details on how to uses these labels. You can
|
||||
change these labels from the :term:`context menu`.
|
||||
select these labels from the :term:`context menu`, and define them in **Project Settings**.
|
||||
|
||||
Right-clicking an item in the project tree will open a context menu under the cursor, displaying
|
||||
a selection of actions that can be performed on the selected item.
|
||||
|
||||
At the top of the tree, you will find a set of buttons.
|
||||
At the top of the project tree, you will find a set of buttons.
|
||||
|
||||
* The first button is a quick links button that will show you a dropdown menu of all the
|
||||
:term:`root folders<root folder>` in your project. Selecting one will move to that position in
|
||||
@@ -73,10 +72,10 @@ addition to the word count.
|
||||
Splitting and Merging Documents
|
||||
-------------------------------
|
||||
|
||||
Under the :guilabel:`Transform` submenu in the context menu of an item in the project tree, you
|
||||
will find several options on how to change a document or folder. This includes changing between
|
||||
document and note, but also splitting them into multiple documents, or merging child items into a
|
||||
single document.
|
||||
Under the **Transform** submenu in the context menu of an item in the project tree, you will find
|
||||
several options on how to change a document or folder. This includes changing between document and
|
||||
note, but also splitting them into multiple documents, or merging child items into a single
|
||||
document.
|
||||
|
||||
|
||||
Splitting Documents
|
||||
@@ -84,12 +83,12 @@ Splitting Documents
|
||||
|
||||
.. figure:: images/fig_project_split_tool.png
|
||||
|
||||
The :guilabel:`Split Document` dialog.
|
||||
The **Split Document** dialog.
|
||||
|
||||
The :guilabel:`Split Document by Heading` option will open a dialog that allows you to split the
|
||||
selected document into multiple new documents based on the headings it contains. You can select at
|
||||
which heading level the split is to be performed from the dropdown box. The list box will preview
|
||||
which headings will be split into new documents.
|
||||
The **Split Document by Headings** option will open a dialog that allows you to split the selected
|
||||
document into multiple new documents based on the headings it contains. You can select at which
|
||||
heading level the split is to be performed from the dropdown box. The list box will preview which
|
||||
headings will be split into new documents.
|
||||
|
||||
You are given the option to create a folder for these new documents, and whether or not to create a
|
||||
hierarchy of documents. That is, put sections under scenes, and scenes under chapters.
|
||||
@@ -103,18 +102,18 @@ Merging Documents
|
||||
|
||||
.. figure:: images/fig_project_merge_tool.png
|
||||
|
||||
The :guilabel:`Merge Documents` dialog.
|
||||
The **Merge Documents** dialog.
|
||||
|
||||
You have two options for merging documents that are child elements of another document. You can
|
||||
either :guilabel:`Merge Child Items into Self` and :guilabel:`Merge Child Items into New`. The
|
||||
first option will pull all content of child items and merge them into the parent document, while
|
||||
the second option will create a new document in the process.
|
||||
either **Merge Child Items into Self** and **Merge Child Items into New**. The first option will
|
||||
pull all content of child items and merge them into the parent document, while the second option
|
||||
will create a new document in the process.
|
||||
|
||||
When merging documents in a folder, you only have the latter process is possible, so only the
|
||||
choice :guilabel:`Merge Documents in Folder` is available.
|
||||
choice **Merge Documents in Folder** is available.
|
||||
|
||||
In either case, the :guilabel:`Merge Documents` dialog will let you exclude documents you don't
|
||||
want to include, and it also lets you reorder them if you wish.
|
||||
In either case, the **Merge Documents** dialog will let you exclude documents you don't want to
|
||||
include, and it also lets you reorder them if you wish.
|
||||
|
||||
|
||||
.. _a_ui_tree_status:
|
||||
@@ -124,14 +123,14 @@ Document Importance and Status
|
||||
|
||||
Each document or folder in your project can have either a "Status" or "Importance" flag set. These
|
||||
are flags that you control and define yourself, and novelWriter doesn't use them for anything. To
|
||||
modify the labels, go to their respective tabs in :guilabel:`Project Settings`.
|
||||
modify the labels, go to their respective tabs in **Project Settings**.
|
||||
|
||||
The "Status" flag is intended to tag a :term:`novel document<novel documents>` as for instance a
|
||||
draft or as completed, and the "Importance" flag is intended to tag character notes, or other
|
||||
:term:`project notes`, as for instance a main, major, or minor character or story element.
|
||||
|
||||
Whether a document uses a "Status" or "Importance" flag depends on which :term:`root folder` it
|
||||
lives in. If it's in a Novel type folder, it uses the "Status" flag, otherwise it uses an
|
||||
lives in. If it's in a **Novel** type folder, it uses the "Status" flag, otherwise it uses an
|
||||
"Importance" flag.
|
||||
|
||||
|
||||
@@ -142,7 +141,7 @@ Project Tree Drag & Drop
|
||||
|
||||
The project tree allows drag & drop to a certain extent to allow you to reorder your documents and
|
||||
folders. Moving a document in the project tree will affect the text's position when you assemble
|
||||
your manuscript in the :guilabel:`Manuscript Build` tool.
|
||||
your manuscript in the **Manuscript Build** tool.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
You can now select multiple items in the project tree by holding down the :kbd:`Ctrl` or
|
||||
@@ -150,14 +149,15 @@ your manuscript in the :guilabel:`Manuscript Build` tool.
|
||||
|
||||
You can drag and drop documents and regular folders, but not root folders. If you select multiple
|
||||
items, they can only be dragged and dropped if they are siblings. That is, they have the same
|
||||
parent item in the project. This is due to the way drag and drop is implemented in the user
|
||||
interface framework novelWriter is built upon.
|
||||
parent item in the project. This limitation is due to the way drag and drop is implemented in the
|
||||
user interface framework novelWriter is built upon.
|
||||
|
||||
Documents and their folders can be rearranged freely within their root folders. If you move a Novel
|
||||
document out of a Novel folder, it will be converted to a project note. Notes can be moved freely
|
||||
between all root folders, but keep in mind that if you move a note into a Novel type root folder,
|
||||
its "Importance" setting will be switched with a "Status" setting. See :ref:`a_ui_tree_status`. The
|
||||
old value will not be overwritten though, and should be restored if you move it back at some point.
|
||||
Documents and their folders can be rearranged freely within their root folders. If you move a
|
||||
**Novel Document** out of a **Novel** folder, it will be converted to a **Project Note**. Notes can
|
||||
be moved freely between all root folders, but keep in mind that if you move a note into a **Novel**
|
||||
type root folder, its "Importance" setting will be switched with a "Status" setting. See
|
||||
:ref:`a_ui_tree_status`. The old value will not be overwritten though, and should be restored if
|
||||
you move it back at some point.
|
||||
|
||||
Root folders in the project tree cannot be dragged and dropped at all. If you want to reorder them,
|
||||
you can move them up or down with respect to each other from the arrow buttons at the top of the
|
||||
@@ -175,8 +175,8 @@ The Novel Tree View
|
||||
|
||||
An alternative way to view the project structure is the novel view. You can switch to this view by
|
||||
selecting the :guilabel:`Novel View` button in the sidebar. This view is a simplified version of
|
||||
the view in the :guilabel:`Outline View`. It is convenient when you want to browse the structure
|
||||
of the story itself rather than the document files.
|
||||
the view in the **Outline View**. It is convenient when you want to browse the structure of the
|
||||
story itself rather than the document files.
|
||||
|
||||
.. note::
|
||||
You cannot reorganise the entries in the novel view, or add any new documents, as that would
|
||||
@@ -194,14 +194,14 @@ The Novel Outline View
|
||||
|
||||
A screenshot of the Novel Outline View.
|
||||
|
||||
The project's :guilabel:`Novel Outline View` is available as another view option from the sidebar.
|
||||
The outline provides an overview of the novel structure, displaying a tree hierarchy of the
|
||||
elements of the novel, that is, the level 1 to 4 headings representing partitions, chapters, scenes
|
||||
and sections.
|
||||
The project's **Novel Outline View** is available as another view option from the sidebar. The
|
||||
outline provides an overview of the novel structure, displaying a tree hierarchy of the elements of
|
||||
the novel, that is, the level 1 to 4 headings representing partitions, chapters, scenes and
|
||||
sections.
|
||||
|
||||
The document containing the heading can also be displayed as a separate column, as well as the line
|
||||
number where the heading is defined. Double-clicking an entry will open the corresponding document
|
||||
in the editor and switch to :guilabel:`Project Tree View` mode.
|
||||
in the editor and switch to **Project Tree View** mode.
|
||||
|
||||
You can select which novel folder to display from the dropdown menu. You can optionally also choose
|
||||
to show a combination of all novel folders.
|
||||
@@ -217,7 +217,7 @@ the menu button in the toolbar. The order of the columns can also be rearranged
|
||||
a different position. You column settings are saved between sessions on a per-project basis.
|
||||
|
||||
.. note::
|
||||
The :guilabel:`Title` column cannot be disabled or moved.
|
||||
The **Title** column cannot be disabled or moved.
|
||||
|
||||
The information viewed in the outline is based on the :term:`project index`. While novelWriter does
|
||||
its best to keep the index up to date when contents change, you can always rebuild it manually by
|
||||
@@ -226,5 +226,5 @@ pressing :kbd:`F9` if something isn't right.
|
||||
The outline view itself can be regenerated by pressing the refresh button. By default, the content
|
||||
is refreshed each time you switch to this view.
|
||||
|
||||
The :guilabel:`Synopsis` column of the outline view takes its information from a specially
|
||||
formatted comment. See :ref:`a_fmt_comm`.
|
||||
The **Synopsis** column of the outline view takes its information from a specially formatted
|
||||
comment. See :ref:`a_fmt_comm`.
|
||||
|
||||
@@ -20,22 +20,22 @@ Main Window Shortcuts
|
||||
:header: "Shortcut", "Description"
|
||||
|
||||
":kbd:`F1`", "Open the online user manual"
|
||||
":kbd:`F5`", "Open the :guilabel:`Build Manuscript` tool"
|
||||
":kbd:`F6`", "Open the :guilabel:`Writing Statistics` tool"
|
||||
":kbd:`F8`", "Toggle :guilabel:`Focus Mode`"
|
||||
":kbd:`F5`", "Open the **Build Manuscript** tool"
|
||||
":kbd:`F6`", "Open the **Writing Statistics** tool"
|
||||
":kbd:`F8`", "Toggle **Focus Mode**"
|
||||
":kbd:`F9`", "Re-build the project's index"
|
||||
":kbd:`F11`", "Toggle full screen mode"
|
||||
":kbd:`Ctrl+,`", "Open the :guilabel:`Preferences` dialog"
|
||||
":kbd:`Ctrl+,`", "Open the **Preferences** dialog"
|
||||
":kbd:`Ctrl+E`", "Switch focus to the document editor"
|
||||
":kbd:`Ctrl+T`", "Switch or toggle focus for the project tree or novel view"
|
||||
":kbd:`Ctrl+Q`", "Exit novelWriter"
|
||||
":kbd:`Ctrl+Shift+,`", "Open the :guilabel:`Project Settings` dialog"
|
||||
":kbd:`Ctrl+Shift+,`", "Open the **Project Settings** dialog"
|
||||
":kbd:`Ctrl+Shift+O`", "Open the Welcome dialog to open or create a project"
|
||||
":kbd:`Ctrl+Shift+S`", "Save the current project"
|
||||
":kbd:`Ctrl+Shift+T`", "Switch focus to the outline view"
|
||||
":kbd:`Ctrl+Shift+W`", "Close the current project"
|
||||
":kbd:`Shift+F1`", "Open the local user manual (PDF) if it is available"
|
||||
":kbd:`Shift+F6`", "Open the :guilabel:`Project Details` dialog"
|
||||
":kbd:`Shift+F6`", "Open the **Project Details** dialog"
|
||||
|
||||
|
||||
.. _a_kb_tree:
|
||||
@@ -53,8 +53,8 @@ Project Tree Shortcuts
|
||||
":kbd:`Alt+Left`", "Jump to the parent item in the tree"
|
||||
":kbd:`Alt+Right`", "Jump to the first child item in the project tree"
|
||||
":kbd:`Ctrl+.`", "Open the context menu on the selected item"
|
||||
":kbd:`Ctrl+L`", "Open the :guilabel:`Quick Links` menu"
|
||||
":kbd:`Ctrl+N`", "Open the :guilabel:`Create New Item` menu"
|
||||
":kbd:`Ctrl+L`", "Open the **Quick Links** menu"
|
||||
":kbd:`Ctrl+N`", "Open the **Create New Item** menu"
|
||||
":kbd:`Ctrl+O`", "Open the selected document in the editor"
|
||||
":kbd:`Ctrl+R`", "Open the selected document in the viewer"
|
||||
":kbd:`Ctrl+Up`", "Move selected item one step up in the tree"
|
||||
@@ -75,11 +75,12 @@ Text Search Shortcuts
|
||||
:header: "Shortcut", "Description"
|
||||
|
||||
":kbd:`F3`", "Find the next occurrence of the search word"
|
||||
":kbd:`Ctrl+F`", "Open the search bar and search for the selected word, if any is selected"
|
||||
":kbd:`Ctrl+F`", "Open search and look for the selected word"
|
||||
":kbd:`Ctrl+G`", "Find the next occurrence of the search word"
|
||||
":kbd:`Ctrl+H`", "Open the search tool and populate with the selected word (Mac :kbd:`Cmd+=`)"
|
||||
":kbd:`Ctrl+Shift+1`", "Replace selected occurrence of the search word, and move to the next"
|
||||
":kbd:`Ctrl+H`", "Open replace and look for the selected word (Mac :kbd:`Cmd+=`)"
|
||||
":kbd:`Ctrl+Shift+1`", "Replace selected occurrence, and move to the next"
|
||||
":kbd:`Ctrl+Shift+G`", "Find the previous occurrence of the search word"
|
||||
":kbd:`Ctrl+Shift+F`", "Open project search and look for the selected word"
|
||||
":kbd:`Shift+F3`", "Find the previous occurrence of the search word"
|
||||
|
||||
|
||||
@@ -91,8 +92,8 @@ Text Formatting Shortcuts
|
||||
|
||||
":kbd:`Ctrl+'`", "Wrap selected text, or word under cursor, in single quotes"
|
||||
":kbd:`Ctrl+""`", "Wrap selected text, or word under cursor, in double quotes"
|
||||
":kbd:`Ctrl+/`", "Toggle block format as comment for block under cursor, or selected text"
|
||||
":kbd:`Ctrl+0`", "Remove block formatting for block under cursor, or selected text"
|
||||
":kbd:`Ctrl+/`", "Toggle comment format for block or selected text"
|
||||
":kbd:`Ctrl+0`", "Remove format for block or selected text"
|
||||
":kbd:`Ctrl+1`", "Change block format to heading level 1"
|
||||
":kbd:`Ctrl+2`", "Change block format to heading level 2"
|
||||
":kbd:`Ctrl+3`", "Change block format to heading level 3"
|
||||
@@ -102,11 +103,11 @@ Text Formatting Shortcuts
|
||||
":kbd:`Ctrl+7`", "Change block alignment to right-aligned"
|
||||
":kbd:`Ctrl+8`", "Add a left margin to the block"
|
||||
":kbd:`Ctrl+9`", "Add a right margin to the block"
|
||||
":kbd:`Ctrl+B`", "Format selected text, or word under cursor, with strong emphasis (bold)"
|
||||
":kbd:`Ctrl+B`", "Format selected text, or word under cursor, with bold"
|
||||
":kbd:`Ctrl+D`", "Format selected text, or word under cursor, with strike through"
|
||||
":kbd:`Ctrl+I`", "Format selected text, or word under cursor, with emphasis (italic)"
|
||||
":kbd:`Ctrl+Shift+/`", "Remove block formatting for block under cursor, or selected text"
|
||||
":kbd:`Ctrl+Shift+D`", "Toggle block format as ignored text for block under cursor, or selected text"
|
||||
":kbd:`Ctrl+I`", "Format selected text, or word under cursor, with italic"
|
||||
":kbd:`Ctrl+Shift+/`", "Remove format for block or selected text"
|
||||
":kbd:`Ctrl+Shift+D`", "Toggle ignored text format for block or selected text"
|
||||
|
||||
|
||||
Other Editor Shortcuts
|
||||
|
||||
@@ -11,7 +11,7 @@ Typographical Notes
|
||||
|
||||
novelWriter has some support for typographical symbols that are not usually easily available in
|
||||
many text editors. This includes for instance the proper unicode quotation marks, dashes, ellipsis,
|
||||
thin spaces, etc. All these symbols are available from the :guilabel:`Insert` menu, and via
|
||||
thin spaces, etc. All these symbols are available from the **Insert** menu, and via
|
||||
keyboard shortcuts. See :ref:`a_kb_ins`.
|
||||
|
||||
This chapter provides some additional information on how novelWriter handles these symbols.
|
||||
@@ -43,22 +43,22 @@ Single and Double Quotes
|
||||
|
||||
All the different quotation marks listed on the `Quotation Mark`_ Wikipedia page are available, and
|
||||
can be selected as auto-replaced symbols for straight single and double quote key strokes. The
|
||||
settings can be found in :guilabel:`Preferences`.
|
||||
settings can be found in **Preferences**.
|
||||
|
||||
Ordinarily, text wrapped in quotes are highlighted by the editor. This is meant as a convenience
|
||||
for highlighting dialogue between characters. This feature can be disabled in
|
||||
:guilabel:`Preferences` if this feature isn't wanted.
|
||||
**Preferences** if this feature isn't wanted.
|
||||
|
||||
The editor distinguishes between text wrapped in regular straight double quotes and the
|
||||
user-selected double quote symbols. This is to help the writer recognise which parts of the text
|
||||
are not using the chosen quote symbols. Two convenience functions in the :guilabel:`Format` menu
|
||||
are not using the chosen quote symbols. Two convenience functions in the **Format** menu
|
||||
can be used to re-format a selected section of text with the correct quote symbols.
|
||||
|
||||
|
||||
Single and Double Prime
|
||||
------------------------
|
||||
|
||||
Both single and double prime symbols are available in the :guilabel:`Insert` menu. These symbols
|
||||
Both single and double prime symbols are available in the **Insert** menu. These symbols
|
||||
are the correct symbols to use for unit symbols for feet, inches, minutes, and seconds. The usage
|
||||
of these is described in more detail on the Wikipedia Prime_ page. They look very similar to single
|
||||
and double straight quotes, and may be rendered similarly by the font, but they have different
|
||||
@@ -79,7 +79,7 @@ right single quotation marks, depending on the font. There is a Wikipedia articl
|
||||
`Modifier letter apostrophe`_ with more details.
|
||||
|
||||
.. note::
|
||||
On export with the :guilabel:`Build Manuscript` tool, these apostrophes will be replaced
|
||||
On export with the **Build Manuscript** tool, these apostrophes will be replaced
|
||||
automatically with the corresponding right hand single quote symbol as is generally recommended.
|
||||
Therefore it doesn't really matter if you only use them to correct syntax highlighting.
|
||||
|
||||
|
||||
@@ -23,13 +23,14 @@ having it selected. This will open the document in the document editor. The edit
|
||||
Markdown-like syntax for some features, and a novelWriter-specific syntax for others. The syntax
|
||||
format is described in the :ref:`a_fmt` chapter.
|
||||
|
||||
The editor has a maximise button (toggles the :guilabel:`Focus Mode`) and a close button in the
|
||||
The editor has a maximise button, which toggles the **Focus Mode**, and a close button in the
|
||||
top--right corner. On the top--left side you will find a tools button that opens a toolbar with a
|
||||
few buttons for applying text formatting, and a search button to open the search dialog.
|
||||
few buttons for applying text formatting, a drop down menu for navigating between headings, and a
|
||||
search button to open the search dialog.
|
||||
|
||||
Both the document editor and viewer will show the label of the currently open document in the
|
||||
header at the top of the edit or view panel. Optionally, the full project path to the document can
|
||||
be shown. This can be set in :guilabel:`Preferences`.
|
||||
be shown. This can be set in **Preferences**.
|
||||
|
||||
.. tip::
|
||||
Clicking on the document title bar will select the document in the project tree and thus reveal
|
||||
@@ -42,10 +43,10 @@ the label and pressing :kbd:`Ctrl+Return`. You can also control-click them with
|
||||
Editor Auto-Completer
|
||||
---------------------
|
||||
|
||||
If you type the character ``@`` on a new line, a menu will appear showing the different available
|
||||
keywords. The list will shorten as you type. Once a keyword command has been selected or typed, the
|
||||
editor may suggest further content based on your project content. See :ref:`a_references_completer`
|
||||
for more details.
|
||||
If you type the character ``@`` on a new line, a pop-up menu will appear showing the different
|
||||
available keywords. The list will shorten as you type. Once a keyword command has been selected or
|
||||
typed, the editor may suggest further options based on your project content. See
|
||||
:ref:`a_references_completer` for more details.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
|
||||
@@ -60,9 +61,9 @@ Viewing a Document
|
||||
A screenshot of the Document Viewer panel.
|
||||
|
||||
Any document in the project tree can also be viewed in parallel in a right hand side document
|
||||
viewer. To view a document, press :kbd:`Ctrl+R`, or select :guilabel:`View Document` in the menu or
|
||||
context menu. If you have a middle mouse button, middle-clicking on the document will also open it
|
||||
in the viewer.
|
||||
viewer. To view a document, press :kbd:`Ctrl+R`, or select **View Document** in the menu or context
|
||||
menu. If you have a middle mouse button, middle-clicking on the document will also open it in the
|
||||
viewer.
|
||||
|
||||
The document viewed does not have to be the same document as the one currently being edited.
|
||||
However, If you *are* viewing the same document, pressing :kbd:`Ctrl+R` again will update the
|
||||
@@ -75,19 +76,20 @@ content of the viewer with the content of the document the reference points to.
|
||||
The document viewer keeps a history of viewed documents, which you can navigate with the arrow
|
||||
buttons in the top--left corner of the viewer. If your mouse has backward and forward navigation
|
||||
buttons, these can be used as well. They work just like the backward and forward features in a
|
||||
browser.
|
||||
browser. The left-most button is a dropdown menu for quickly navigation between headings in the
|
||||
document.
|
||||
|
||||
At the bottom of the view panel there is a :guilabel:`References` panel. (If it is hidden, click
|
||||
the button on the left side of the footer area to reveal it.) This panel contains a References tab
|
||||
with links to all documents referring back to the one you're currently viewing, if any has been
|
||||
defined. If you have created root folders and tags for various story elements like characters and
|
||||
plot points, these will appear as additional tabs in this panel.
|
||||
At the bottom of the view panel there is a **References** panel. (If it is hidden, click the button
|
||||
on the left side of the footer area to reveal it.) This panel contains a References tab with links
|
||||
to all documents referring back to the one you're currently viewing, if any has been defined. If
|
||||
you have created root folders and tags for various story elements like characters and plot points,
|
||||
these will appear as additional tabs in this panel.
|
||||
|
||||
.. note::
|
||||
The :guilabel:`References` panel relies on an up-to-date :term:`index<project index>` of the
|
||||
project. The index is maintained automatically. However, if anything is missing, or seems wrong,
|
||||
the index can always be rebuilt by selecting :guilabel:`Rebuild Index` from the
|
||||
:guilabel:`Tools` menu, or by pressing :kbd:`F9`.
|
||||
The **References** panel relies on an up-to-date :term:`index<project index>` of the project.
|
||||
The index is maintained automatically. However, if anything is missing, or seems wrong, the
|
||||
index can always be rebuilt by selecting **Rebuild Index** from the **Tools** menu, or by
|
||||
pressing :kbd:`F9`.
|
||||
|
||||
.. versionadded:: 2.2
|
||||
The reference panel was redesigned and the additional tabs added.
|
||||
@@ -131,8 +133,7 @@ Auto-Replace as You Type
|
||||
========================
|
||||
|
||||
A few auto-replace features are supported by the editor. You can control every aspect of the
|
||||
auto-replace feature from :guilabel:`Preferences`. You can also disable this feature entirely if
|
||||
you wish.
|
||||
auto-replace feature from **Preferences**. You can also disable this feature entirely if you wish.
|
||||
|
||||
.. tip::
|
||||
If you don't like auto-replacement, all symbols inserted by this feature are also available in
|
||||
|
||||
2077
i18n/nw_base.ts
1965
i18n/nw_de_DE.ts
1967
i18n/nw_en_US.ts
1969
i18n/nw_es_419.ts
4003
i18n/nw_fr_FR.ts
1953
i18n/nw_it_IT.ts
2067
i18n/nw_ja_JP.ts
1959
i18n/nw_nb_NO.ts
1957
i18n/nw_nl_NL.ts
4494
i18n/nw_pt_BR.ts
4015
i18n/nw_zh_CN.ts
@@ -47,19 +47,3 @@ QT_TRANSLATE_NOOP("QPlatformTheme", "Help")
|
||||
QT_TRANSLATE_NOOP("QPlatformTheme", "Apply")
|
||||
QT_TRANSLATE_NOOP("QPlatformTheme", "Reset")
|
||||
QT_TRANSLATE_NOOP("QPlatformTheme", "Restore Defaults")
|
||||
|
||||
# QWizard
|
||||
# =======
|
||||
|
||||
QT_TRANSLATE_NOOP("QWizard", "Go Back")
|
||||
QT_TRANSLATE_NOOP("QWizard", "< &Back")
|
||||
QT_TRANSLATE_NOOP("QWizard", "Continue")
|
||||
QT_TRANSLATE_NOOP("QWizard", "&Next")
|
||||
QT_TRANSLATE_NOOP("QWizard", "&Next >")
|
||||
QT_TRANSLATE_NOOP("QWizard", "Commit")
|
||||
QT_TRANSLATE_NOOP("QWizard", "Done")
|
||||
QT_TRANSLATE_NOOP("QWizard", "&Finish")
|
||||
QT_TRANSLATE_NOOP("QWizard", "Cancel")
|
||||
QT_TRANSLATE_NOOP("QWizard", "Cancel")
|
||||
QT_TRANSLATE_NOOP("QWizard", "Help")
|
||||
QT_TRANSLATE_NOOP("QWizard", "&Help")
|
||||
|
||||
@@ -23,16 +23,21 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
import getopt
|
||||
import logging
|
||||
import sys
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from PyQt5.QtWidgets import QApplication, QErrorMessage
|
||||
|
||||
from novelwriter.error import exceptionHandler, logException
|
||||
from novelwriter.config import Config
|
||||
from novelwriter.error import exceptionHandler, logException
|
||||
from novelwriter.shared import SharedData
|
||||
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
from novelwriter.guimain import GuiMain
|
||||
|
||||
# Package Meta
|
||||
# ============
|
||||
|
||||
@@ -42,9 +47,9 @@ __license__ = "GPLv3"
|
||||
__author__ = "Veronica Berglyd Olsen"
|
||||
__maintainer__ = "Veronica Berglyd Olsen"
|
||||
__email__ = "code@vkbo.net"
|
||||
__version__ = "2.3"
|
||||
__hexversion__ = "0x020300f0"
|
||||
__date__ = "2024-03-10"
|
||||
__version__ = "2.4.2"
|
||||
__hexversion__ = "0x020402f0"
|
||||
__date__ = "2024-05-18"
|
||||
__status__ = "Stable"
|
||||
__domain__ = "novelwriter.io"
|
||||
|
||||
@@ -60,7 +65,7 @@ CONFIG = Config()
|
||||
SHARED = SharedData()
|
||||
|
||||
|
||||
def main(sysArgs: list | None = None):
|
||||
def main(sysArgs: list | None = None) -> GuiMain | None:
|
||||
"""Parse command line, set up logging, and launch main GUI."""
|
||||
if sysArgs is None:
|
||||
sysArgs = sys.argv[1:]
|
||||
@@ -187,7 +192,7 @@ def main(sysArgs: list | None = None):
|
||||
))
|
||||
for errLine in errorData:
|
||||
logger.critical(errLine)
|
||||
errApp.exec_()
|
||||
errApp.exec()
|
||||
sys.exit(errorCode)
|
||||
|
||||
# Finish initialising config
|
||||
@@ -195,7 +200,7 @@ def main(sysArgs: list | None = None):
|
||||
|
||||
if CONFIG.osDarwin:
|
||||
try:
|
||||
from Foundation import NSBundle
|
||||
from Foundation import NSBundle # type: ignore
|
||||
bundle = NSBundle.mainBundle()
|
||||
info = bundle.localizedInfoDictionary() or bundle.infoDictionary()
|
||||
info["CFBundleName"] = "novelWriter"
|
||||
@@ -207,7 +212,7 @@ def main(sysArgs: list | None = None):
|
||||
try:
|
||||
import ctypes
|
||||
appID = f"io.novelwriter.{__version__}"
|
||||
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(appID)
|
||||
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(appID) # type: ignore
|
||||
except Exception:
|
||||
logger.error("Failed to set application name")
|
||||
logException()
|
||||
@@ -237,6 +242,8 @@ def main(sysArgs: list | None = None):
|
||||
nwGUI = GuiMain()
|
||||
nwGUI.postLaunchTasks(cmdOpen)
|
||||
|
||||
sys.exit(nwApp.exec_())
|
||||
sys.exit(nwApp.exec())
|
||||
|
||||
return None
|
||||
|
||||
# END Function main
|
||||
|
||||
4
novelwriter/assets/icons/none.svg
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m0 0v4l8 8-8 8v4h4l8-8 8 8h4v-4l-8-8 8-8v-4h-4l-8 8-8-8h-4z" fill="#f00" stroke-width=".70711"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 251 B |
@@ -53,6 +53,7 @@ fmt_bold = nw_tb-bold.svg
|
||||
fmt_bold-md = nw_tb-bold-md.svg
|
||||
fmt_italic = nw_tb-italic.svg
|
||||
fmt_italic-md = nw_tb-italic-md.svg
|
||||
fmt_mark = nw_tb-mark.svg
|
||||
fmt_strike = nw_tb-strike.svg
|
||||
fmt_strike-md = nw_tb-strike-md.svg
|
||||
fmt_subscript = nw_tb-subscript.svg
|
||||
@@ -99,12 +100,15 @@ status_time = typ_stopwatch-grey.svg
|
||||
sticky-off = typ_pin-outline.svg
|
||||
sticky-on = typ_pin.svg
|
||||
unchecked = mixed_input-unchecked.svg
|
||||
unfold-hide = typ_unfold-hidden.svg
|
||||
unfold-show = typ_unfold-visible.svg
|
||||
up = typ_chevron-up.svg
|
||||
view = typ_eye.svg
|
||||
view_build = typ_export-grey.svg
|
||||
view_editor = mixed_edit.svg
|
||||
view_novel = typ_book-grey.svg
|
||||
view_outline = typ_puzzle-outline.svg
|
||||
view_search = typ_search-grey.svg
|
||||
|
||||
deco_doc_h0 = nw_deco-h0.svg
|
||||
deco_doc_h0_n = nw_deco-h0.svg
|
||||
|
||||
7
novelwriter/assets/icons/typicons_dark/nw_tb-mark.svg
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24" height="24" version="1.1" viewBox="0 0 6.35 6.35" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x=".26458" y=".79375" width="5.8208" height="4.7625" fill="#ffff84" fill-opacity=".8" stroke-linecap="round" stroke-width=".1354"/>
|
||||
<path d="m1.3229 5.2917v-4.2333h0.98087l0.6397 1.8829q0.060924 0.18829 0.11576 0.38957 0.054831 0.19479 0.11576 0.38957h0.024369q0.060924-0.19479 0.10966-0.38957 0.054831-0.20128 0.11576-0.38957l0.62752-1.8829h0.97478v4.2333h-0.81638v-1.5518q0-0.15583 0.012185-0.34412 0.012185-0.18829 0.030462-0.37658 0.018277-0.19479 0.036554-0.37658 0.018277-0.18829 0.036554-0.34412h-0.02437l-0.3229 1.0064-0.56659 1.6167h-0.49348l-0.56659-1.6167-0.3168-1.0064h-0.024369q0.018277 0.15583 0.036554 0.34412 0.018277 0.1818 0.036554 0.37658 0.018277 0.18829 0.030462 0.37658 0.012185 0.18829 0.012185 0.34412v1.5518z" fill="#808080" stroke-linecap="round" stroke-width=".11793"/>
|
||||
<path d="m4.9555 5.5562v-0.43195h0.54619v-3.8986h-0.54619v-0.43195h1.1299v4.7624z" fill="#69c" stroke-width="1.1186"/>
|
||||
<path d="m0.26458 5.5562v-4.7624h1.1299v0.43195h-0.54083v3.8986h0.54083v0.43195z" fill="#69c" stroke-width="1.1186"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m10.837 12.256h-6.8373v-6.8347c0.010667-1.5131 0.89467-1.877 1.964-0.80652l1.5387 1.5437c1.3533-1.0598 3.0093-1.6397 4.7547-1.6397 2.0667 0 4.012 0.80518 5.472 2.2676 1.4653 1.4557 2.2707 3.4034 2.2707 5.4696 0 2.0703-0.80533 4.0153-2.268 5.475-1.4627 1.4624-3.4067 2.2689-5.4747 2.2689-2.0667 0-4.012-0.80652-5.4747-2.2702-0.39467-0.39593-0.744-0.82784-1.04-1.2864-0.46267-0.7212-0.25333-1.6797 0.46667-2.1396 0.71867-0.46125 1.6773-0.25195 2.1387 0.46658 0.17733 0.27595 0.38933 0.53323 0.624 0.77319 0.87867 0.87717 2.0453 1.3597 3.2853 1.3597s2.4067-0.48124 3.2853-1.3597c0.876-0.87717 1.36-2.0436 1.36-3.2861 0-1.2398-0.48267-2.4062-1.36-3.2807-0.87867-0.87717-2.0453-1.3611-3.2853-1.3611-0.91733 0-1.7947 0.26795-2.5453 0.76252l1.9307 1.9343c1.0707 1.0691 0.70667 1.9436-0.80533 1.9436z" fill="#9c9" stroke-width="1.3332"/>
|
||||
<path d="m10.692 12.288h-7.692v-7.689c0.012-1.7022 1.0065-2.1116 2.2095-0.90734l1.731 1.7367c1.5225-1.1923 3.3855-1.8447 5.349-1.8447 2.325 0 4.5135 0.90583 6.156 2.5511 1.6485 1.6377 2.5545 3.8288 2.5545 6.1533 0 2.3291-0.906 4.5172-2.5515 6.1594-1.6455 1.6452-3.8325 2.5525-6.159 2.5525-2.325 0-4.5135-0.90734-6.159-2.554-0.444-0.44542-0.837-0.93132-1.17-1.4472-0.5205-0.81135-0.285-1.8897 0.525-2.4071 0.8085-0.51891 1.887-0.28344 2.406 0.5249 0.1995 0.31044 0.438 0.59988 0.702 0.86984 0.9885 0.98682 2.301 1.5297 3.696 1.5297 1.395 0 2.7075-0.5414 3.696-1.5297 0.9855-0.98682 1.53-2.2991 1.53-3.6969 0-1.3948-0.543-2.707-1.53-3.6908-0.9885-0.98682-2.301-1.5312-3.696-1.5312-1.032 0-2.019 0.30144-2.8635 0.85784l2.172 2.1761c1.2045 1.2027 0.795 2.1866-0.906 2.1866z" fill="#9c9" stroke-width="1.3332"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 984 B After Width: | Height: | Size: 952 B |
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m13.163 12.256h6.8373v-6.8347c-0.010667-1.5131-0.89467-1.877-1.964-0.80652l-1.5387 1.5437c-1.3533-1.0598-3.0093-1.6397-4.7547-1.6397-2.0667 0-4.012 0.80518-5.472 2.2676-1.4653 1.4557-2.2707 3.4034-2.2707 5.4696 0 2.0703 0.80533 4.0153 2.268 5.475 1.4627 1.4624 3.4067 2.2689 5.4747 2.2689 2.0667 0 4.012-0.80652 5.4747-2.2702 0.39467-0.39593 0.744-0.82784 1.04-1.2864 0.46267-0.7212 0.25333-1.6797-0.46667-2.1396-0.71867-0.46125-1.6773-0.25195-2.1387 0.46658-0.17733 0.27595-0.38933 0.53323-0.624 0.77319-0.87867 0.87717-2.0453 1.3597-3.2853 1.3597s-2.4067-0.48124-3.2853-1.3597c-0.876-0.87717-1.36-2.0436-1.36-3.2861 0-1.2398 0.48267-2.4062 1.36-3.2807 0.87867-0.87717 2.0453-1.3611 3.2853-1.3611 0.91733 0 1.7947 0.26795 2.5453 0.76252l-1.9307 1.9343c-1.0707 1.0691-0.70667 1.9436 0.80533 1.9436z" fill="#9c9" stroke-width="1.3332"/>
|
||||
<path d="m13.308 12.288h7.692v-7.689c-0.012-1.7022-1.0065-2.1116-2.2095-0.90734l-1.731 1.7367c-1.5225-1.1923-3.3855-1.8447-5.349-1.8447-2.325 0-4.5135 0.90583-6.156 2.5511-1.6485 1.6377-2.5545 3.8288-2.5545 6.1533 0 2.3291 0.906 4.5172 2.5515 6.1594 1.6455 1.6452 3.8325 2.5525 6.159 2.5525 2.325 0 4.5135-0.90734 6.159-2.554 0.444-0.44542 0.837-0.93132 1.17-1.4472 0.5205-0.81135 0.285-1.8897-0.525-2.4071-0.8085-0.51891-1.887-0.28344-2.406 0.5249-0.1995 0.31044-0.438 0.59988-0.702 0.86984-0.9885 0.98682-2.301 1.5297-3.696 1.5297-1.395 0-2.7075-0.5414-3.696-1.5297-0.9855-0.98682-1.53-2.2991-1.53-3.6969 0-1.3948 0.543-2.707 1.53-3.6908 0.9885-0.98682 2.301-1.5312 3.696-1.5312 1.032 0 2.019 0.30144 2.8635 0.85784l-2.172 2.1761c-1.2045 1.2027-0.795 2.1866 0.906 2.1866z" fill="#9c9" stroke-width="1.3332"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 990 B After Width: | Height: | Size: 956 B |
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m20.547 14.707-0.7017-0.703-0.98054-0.98185c0.29717-0.90068 0.46343-1.859 0.46343-2.8578 0-5.0519-4.112-9.1639-9.1639-9.1639s-9.1639 4.112-9.1639 9.1639c0 5.0519 4.112 9.1639 9.1639 9.1639 0.99887 0 1.9585-0.16626 2.8591-0.46343l0.98185 0.98054 1.9794 1.9768 0.07986 0.07986 0.08378 0.072c0.78679 0.66242 1.7647 1.0264 2.7544 1.0264 2.2596 0 4.0976-1.838 4.0976-4.0989 0-1.0997-0.4294-2.1313-1.2096-2.9037zm-16.93-4.5427c0-3.6093 2.9364-6.5457 6.5457-6.5457s6.5457 2.9364 6.5457 6.5457-2.9364 6.5457-6.5457 6.5457-6.5457-2.9364-6.5457-6.5457z" fill="#aeaeae" stroke-width="1.3091"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 737 B |
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m19.041 4.9586c-1.0144-1.0157-2.6635-1.0157-3.678 0l-3.3632 3.3632-3.3632-3.3632c-1.0144-1.0157-2.6635-1.0157-3.678 0-1.0157 1.0157-1.0157 2.6622 0 3.678l3.3619 3.3632-3.3619 3.3632c-1.0157 1.0157-1.0157 2.6622 0 3.678 0.50722 0.50852 1.1731 0.76212 1.839 0.76212 0.66588 0 1.3318-0.25361 1.839-0.76212l3.3632-3.3632 3.3632 3.3632c0.50722 0.50852 1.1731 0.76212 1.839 0.76212 0.66588 0 1.3318-0.25361 1.839-0.76212 1.0157-1.0157 1.0157-2.6622 0-3.678l-3.3619-3.3632 3.3619-3.3632c1.0157-1.0157 1.0157-2.6622 0-3.678z" fill="#d64848" stroke-width="1.3006"/>
|
||||
<path d="m20.121 3.8786c-1.17-1.1715-3.072-1.1715-4.2421 0l-3.879 3.8791-3.879-3.8791c-1.17-1.1715-3.072-1.1715-4.2421 0-1.1715 1.1715-1.1715 3.0705 0 4.2421l3.8776 3.879-3.8776 3.879c-1.1715 1.1715-1.1715 3.0705 0 4.2421 0.58502 0.58652 1.353 0.87902 2.1211 0.87902 0.76801 0 1.5361-0.29251 2.1211-0.87902l3.879-3.879 3.879 3.879c0.58502 0.58652 1.353 0.87902 2.1211 0.87902 0.76801 0 1.5361-0.29251 2.1211-0.87902 1.1715-1.1715 1.1715-3.0705 0-4.2421l-3.8776-3.879 3.8776-3.879c1.1715-1.1715 1.1715-3.0705 0-4.2421z" fill="#d64848" stroke-width="1.5001"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 711 B After Width: | Height: | Size: 703 B |
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m9.8767 17.723 5.8157-5.723-5.8157-5.723c-0.18462-0.18462-0.46155-0.27693-0.64616-0.27693-0.18462 0-0.46155 0.092309-0.64616 0.27693-0.18462 0.18462-0.27693 0.36924-0.27693 0.64616v10.154c0 0.27693 0.092309 0.46154 0.27693 0.64616 0.18462 0.18462 0.46155 0.27693 0.64616 0.27693 0.18462 0 0.46155-0.09231 0.64616-0.27693z" fill="#aeaeae" stroke-width=".92309"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 516 B |
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m6.277 9.8767 5.723 5.8157 5.723-5.8157c0.18462-0.18462 0.27693-0.46155 0.27693-0.64616 0-0.18462-0.092309-0.46155-0.27693-0.64616-0.18462-0.18462-0.36924-0.27693-0.64616-0.27693h-10.154c-0.27693 0-0.46155 0.092309-0.64616 0.27693-0.18462 0.18462-0.27693 0.46155-0.27693 0.64616 0 0.18462 0.092309 0.46155 0.27693 0.64616z" fill="#aeaeae" stroke-width=".92309"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 517 B |
@@ -53,6 +53,7 @@ fmt_bold = nw_tb-bold.svg
|
||||
fmt_bold-md = nw_tb-bold-md.svg
|
||||
fmt_italic = nw_tb-italic.svg
|
||||
fmt_italic-md = nw_tb-italic-md.svg
|
||||
fmt_mark = nw_tb-mark.svg
|
||||
fmt_strike = nw_tb-strike.svg
|
||||
fmt_strike-md = nw_tb-strike-md.svg
|
||||
fmt_subscript = nw_tb-subscript.svg
|
||||
@@ -99,12 +100,15 @@ status_time = typ_stopwatch-grey.svg
|
||||
sticky-off = typ_pin-outline.svg
|
||||
sticky-on = typ_pin.svg
|
||||
unchecked = mixed_input-unchecked.svg
|
||||
unfold-hide = typ_unfold-hidden.svg
|
||||
unfold-show = typ_unfold-visible.svg
|
||||
up = typ_chevron-up.svg
|
||||
view = typ_eye.svg
|
||||
view_build = typ_export-grey.svg
|
||||
view_editor = mixed_edit.svg
|
||||
view_novel = typ_book-grey.svg
|
||||
view_outline = typ_puzzle-outline.svg
|
||||
view_search = typ_search-grey.svg
|
||||
|
||||
deco_doc_h0 = nw_deco-h0.svg
|
||||
deco_doc_h0_n = nw_deco-h0.svg
|
||||
|
||||
7
novelwriter/assets/icons/typicons_light/nw_tb-mark.svg
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24" height="24" version="1.1" viewBox="0 0 6.35 6.35" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x=".26458" y=".79375" width="5.8208" height="4.7625" fill="#ad8700" fill-opacity=".8" stroke-linecap="round" stroke-width=".1354"/>
|
||||
<path d="m1.3229 5.2917v-4.2333h0.98087l0.6397 1.8829q0.060924 0.18829 0.11576 0.38957 0.054831 0.19479 0.11576 0.38957h0.024369q0.060924-0.19479 0.10966-0.38957 0.054831-0.20128 0.11576-0.38957l0.62752-1.8829h0.97478v4.2333h-0.81638v-1.5518q0-0.15583 0.012185-0.34412 0.012185-0.18829 0.030462-0.37658 0.018277-0.19479 0.036554-0.37658 0.018277-0.18829 0.036554-0.34412h-0.02437l-0.3229 1.0064-0.56659 1.6167h-0.49348l-0.56659-1.6167-0.3168-1.0064h-0.024369q0.018277 0.15583 0.036554 0.34412 0.018277 0.1818 0.036554 0.37658 0.018277 0.18829 0.030462 0.37658 0.012185 0.18829 0.012185 0.34412v1.5518z" fill-opacity=".78039" stroke-linecap="round" stroke-width=".11793"/>
|
||||
<path d="m4.9555 5.5562v-0.43195h0.54619v-3.8986h-0.54619v-0.43195h1.1299v4.7624z" fill="#4271ae" stroke-width="1.1186"/>
|
||||
<path d="m0.26458 5.5562v-4.7624h1.1299v0.43195h-0.54083v3.8986h0.54083v0.43195z" fill="#4271ae" stroke-width="1.1186"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m10.837 12.256h-6.8373v-6.8347c0.010667-1.5131 0.89467-1.877 1.964-0.80652l1.5387 1.5437c1.3533-1.0598 3.0093-1.6397 4.7547-1.6397 2.0667 0 4.012 0.80518 5.472 2.2676 1.4653 1.4557 2.2707 3.4034 2.2707 5.4696 0 2.0703-0.80533 4.0153-2.268 5.475-1.4627 1.4624-3.4067 2.2689-5.4747 2.2689-2.0667 0-4.012-0.80652-5.4747-2.2702-0.39467-0.39593-0.744-0.82784-1.04-1.2864-0.46267-0.7212-0.25333-1.6797 0.46667-2.1396 0.71867-0.46125 1.6773-0.25195 2.1387 0.46658 0.17733 0.27595 0.38933 0.53323 0.624 0.77319 0.87867 0.87717 2.0453 1.3597 3.2853 1.3597s2.4067-0.48124 3.2853-1.3597c0.876-0.87717 1.36-2.0436 1.36-3.2861 0-1.2398-0.48267-2.4062-1.36-3.2807-0.87867-0.87717-2.0453-1.3611-3.2853-1.3611-0.91733 0-1.7947 0.26795-2.5453 0.76252l1.9307 1.9343c1.0707 1.0691 0.70667 1.9436-0.80533 1.9436z" fill="#718c00" stroke-width="1.3332"/>
|
||||
<path d="m10.692 12.288h-7.692v-7.689c0.012-1.7022 1.0065-2.1116 2.2095-0.90734l1.731 1.7367c1.5225-1.1923 3.3855-1.8447 5.349-1.8447 2.325 0 4.5135 0.90583 6.156 2.5511 1.6485 1.6377 2.5545 3.8288 2.5545 6.1533 0 2.3291-0.906 4.5172-2.5515 6.1594-1.6455 1.6452-3.8325 2.5525-6.159 2.5525-2.325 0-4.5135-0.90734-6.159-2.554-0.444-0.44542-0.837-0.93132-1.17-1.4472-0.5205-0.81135-0.285-1.8897 0.525-2.4071 0.8085-0.51891 1.887-0.28344 2.406 0.5249 0.1995 0.31044 0.438 0.59988 0.702 0.86984 0.9885 0.98682 2.301 1.5297 3.696 1.5297 1.395 0 2.7075-0.5414 3.696-1.5297 0.9855-0.98682 1.53-2.2991 1.53-3.6969 0-1.3948-0.543-2.707-1.53-3.6908-0.9885-0.98682-2.301-1.5312-3.696-1.5312-1.032 0-2.019 0.30144-2.8635 0.85784l2.172 2.1761c1.2045 1.2027 0.795 2.1866-0.906 2.1866z" fill="#718c00" stroke-width="1.4998"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 987 B After Width: | Height: | Size: 955 B |
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m13.163 12.256h6.8373v-6.8347c-0.010667-1.5131-0.89467-1.877-1.964-0.80652l-1.5387 1.5437c-1.3533-1.0598-3.0093-1.6397-4.7547-1.6397-2.0667 0-4.012 0.80518-5.472 2.2676-1.4653 1.4557-2.2707 3.4034-2.2707 5.4696 0 2.0703 0.80533 4.0153 2.268 5.475 1.4627 1.4624 3.4067 2.2689 5.4747 2.2689 2.0667 0 4.012-0.80652 5.4747-2.2702 0.39467-0.39593 0.744-0.82784 1.04-1.2864 0.46267-0.7212 0.25333-1.6797-0.46667-2.1396-0.71867-0.46125-1.6773-0.25195-2.1387 0.46658-0.17733 0.27595-0.38933 0.53323-0.624 0.77319-0.87867 0.87717-2.0453 1.3597-3.2853 1.3597s-2.4067-0.48124-3.2853-1.3597c-0.876-0.87717-1.36-2.0436-1.36-3.2861 0-1.2398 0.48267-2.4062 1.36-3.2807 0.87867-0.87717 2.0453-1.3611 3.2853-1.3611 0.91733 0 1.7947 0.26795 2.5453 0.76252l-1.9307 1.9343c-1.0707 1.0691-0.70667 1.9436 0.80533 1.9436z" fill="#718c00" stroke-width="1.3332"/>
|
||||
<path d="m13.308 12.288h7.692v-7.689c-0.012001-1.7022-1.0065-2.1116-2.2095-0.90734l-1.731 1.7367c-1.5225-1.1923-3.3855-1.8447-5.349-1.8447-2.325 0-4.5135 0.90583-6.156 2.5511-1.6485 1.6377-2.5545 3.8288-2.5545 6.1533 0 2.3291 0.906 4.5172 2.5515 6.1594 1.6455 1.6452 3.8325 2.5525 6.159 2.5525 2.325 0 4.5135-0.90734 6.159-2.554 0.444-0.44542 0.837-0.93132 1.17-1.4472 0.5205-0.81135 0.285-1.8897-0.525-2.4071-0.8085-0.51891-1.887-0.28344-2.406 0.5249-0.1995 0.31044-0.438 0.59988-0.702 0.86984-0.9885 0.98682-2.301 1.5297-3.696 1.5297-1.395 0-2.7075-0.5414-3.696-1.5297-0.9855-0.98682-1.53-2.2991-1.53-3.6969 0-1.3948 0.543-2.707 1.53-3.6908 0.9885-0.98682 2.301-1.5312 3.696-1.5312 1.032 0 2.019 0.30144 2.8635 0.85784l-2.172 2.1761c-1.2045 1.2027-0.795 2.1866 0.906 2.1866z" fill="#718c00" stroke-width="1.4998"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 993 B After Width: | Height: | Size: 962 B |
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m20.547 14.707-0.7017-0.703-0.98054-0.98185c0.29717-0.90068 0.46343-1.859 0.46343-2.8578 0-5.0519-4.112-9.1639-9.1639-9.1639s-9.1639 4.112-9.1639 9.1639c0 5.0519 4.112 9.1639 9.1639 9.1639 0.99887 0 1.9585-0.16626 2.8591-0.46343l0.98185 0.98054 1.9794 1.9768 0.07986 0.07986 0.08378 0.072c0.78679 0.66242 1.7647 1.0264 2.7544 1.0264 2.2596 0 4.0976-1.838 4.0976-4.0989 0-1.0997-0.4294-2.1313-1.2096-2.9037zm-16.93-4.5427c0-3.6093 2.9364-6.5457 6.5457-6.5457s6.5457 2.9364 6.5457 6.5457-2.9364 6.5457-6.5457 6.5457-6.5457-2.9364-6.5457-6.5457z" fill-opacity=".78039" stroke-width="1.3091"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 744 B |
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m19.041 4.9586c-1.0144-1.0157-2.6635-1.0157-3.678 0l-3.3632 3.3632-3.3632-3.3632c-1.0144-1.0157-2.6635-1.0157-3.678 0-1.0157 1.0157-1.0157 2.6622 0 3.678l3.3619 3.3632-3.3619 3.3632c-1.0157 1.0157-1.0157 2.6622 0 3.678 0.50722 0.50852 1.1731 0.76212 1.839 0.76212 0.66588 0 1.3318-0.25361 1.839-0.76212l3.3632-3.3632 3.3632 3.3632c0.50722 0.50852 1.1731 0.76212 1.839 0.76212 0.66588 0 1.3318-0.25361 1.839-0.76212 1.0157-1.0157 1.0157-2.6622 0-3.678l-3.3619-3.3632 3.3619-3.3632c1.0157-1.0157 1.0157-2.6622 0-3.678z" fill="#c82829" stroke-width="1.3006"/>
|
||||
<path d="m20.121 3.8786c-1.17-1.1715-3.072-1.1715-4.2421 0l-3.879 3.8791-3.879-3.8791c-1.17-1.1715-3.072-1.1715-4.2421 0-1.1715 1.1715-1.1715 3.0705 0 4.2421l3.8776 3.879-3.8776 3.879c-1.1715 1.1715-1.1715 3.0705 0 4.2421 0.58502 0.58652 1.353 0.87902 2.1211 0.87902 0.76801 0 1.5361-0.29251 2.1211-0.87902l3.879-3.879 3.879 3.879c0.58502 0.58652 1.353 0.87902 2.1211 0.87902 0.76801 0 1.5361-0.29251 2.1211-0.87902 1.1715-1.1715 1.1715-3.0705 0-4.2421l-3.8776-3.879 3.8776-3.879c1.1715-1.1715 1.1715-3.0705 0-4.2421z" fill="#c82829" stroke-width="1.5001"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 711 B After Width: | Height: | Size: 703 B |
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m9.8767 17.723 5.8157-5.723-5.8157-5.723c-0.18462-0.18462-0.46155-0.27693-0.64616-0.27693-0.18462 0-0.46155 0.092309-0.64616 0.27693-0.18462 0.18462-0.27693 0.36924-0.27693 0.64616v10.154c0 0.27693 0.092309 0.46154 0.27693 0.64616 0.18462 0.18462 0.46155 0.27693 0.64616 0.27693 0.18462 0 0.46155-0.09231 0.64616-0.27693z" fill-opacity=".78039" stroke-width="1.6923"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 523 B |
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24" height="24" version="1.2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m6.277 9.8767 5.723 5.8157 5.723-5.8157c0.18462-0.18462 0.27693-0.46155 0.27693-0.64616 0-0.18462-0.09231-0.46155-0.27693-0.64616-0.18462-0.18462-0.36924-0.27693-0.64616-0.27693h-10.154c-0.27693 0-0.46155 0.092309-0.64616 0.27693-0.18462 0.18462-0.27693 0.46155-0.27693 0.64616 0 0.18462 0.092309 0.46155 0.27693 0.64616z" fill-opacity=".78039" stroke-width="1.6923"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 523 B |
@@ -25,3 +25,4 @@ spellcheckline = 200, 46, 0
|
||||
errorline = 46, 200, 0
|
||||
replacetag = 0, 184, 46
|
||||
modifier = 200, 120, 0
|
||||
texthighlight = 136, 200, 0, 96
|
||||
|
||||
@@ -25,3 +25,4 @@ spellcheckline = 200, 0, 0
|
||||
errorline = 0, 150, 0
|
||||
replacetag = 0, 150, 0
|
||||
modifier = 150, 110, 30
|
||||
texthighlight = 150, 150, 0, 96
|
||||
|
||||
@@ -25,3 +25,4 @@ spellcheckline = 200, 46, 0
|
||||
errorline = 46, 200, 0
|
||||
replacetag = 225, 225, 225
|
||||
modifier = 225, 225, 225
|
||||
texthighlight = 255, 255, 255, 64
|
||||
|
||||
@@ -25,3 +25,4 @@ spellcheckline = 200, 0, 0
|
||||
errorline = 0, 150, 0
|
||||
replacetag = 0, 0, 0
|
||||
modifier = 0, 0, 0
|
||||
texthighlight = 0, 0, 0, 64
|
||||
|
||||
@@ -45,3 +45,4 @@ spellcheckline = 222, 61, 58
|
||||
errorline = 8, 145, 106
|
||||
replacetag = 42, 162, 152
|
||||
modifier = 224, 175, 5
|
||||
texthighlight = 218, 170, 1, 96
|
||||
|
||||
@@ -45,3 +45,4 @@ spellcheckline = 247, 140, 108
|
||||
errorline = 173, 219, 103
|
||||
replacetag = 127, 219, 202
|
||||
modifier = 236, 196, 141
|
||||
texthighlight = 255, 235, 149, 96
|
||||
|
||||
@@ -25,3 +25,4 @@ spellcheckline = 203, 75, 22
|
||||
errorline = 220, 50, 47
|
||||
replacetag = 133, 153, 0
|
||||
modifier = 181, 137, 0
|
||||
texthighlight = 181, 137, 0, 96
|
||||
|
||||
@@ -25,3 +25,4 @@ spellcheckline = 203, 75, 22
|
||||
errorline = 220, 50, 47
|
||||
replacetag = 133, 153, 0
|
||||
modifier = 181, 137, 0
|
||||
texthighlight = 181, 137, 0, 96
|
||||
|
||||
@@ -45,3 +45,4 @@ spellcheckline = 240, 40, 41
|
||||
errorline = 113, 140, 0
|
||||
replacetag = 62, 153, 159
|
||||
modifier = 245, 135, 31
|
||||
texthighlight = 234, 183, 0, 96
|
||||
|
||||
@@ -45,3 +45,4 @@ spellcheckline = 204, 102, 102
|
||||
errorline = 181, 189, 104
|
||||
replacetag = 138, 190, 183
|
||||
modifier = 222, 147, 95
|
||||
texthighlight = 240, 198, 116, 96
|
||||
|
||||
@@ -45,3 +45,4 @@ spellcheckline = 255, 157, 164
|
||||
errorline = 209, 241, 169
|
||||
replacetag = 153, 255, 255
|
||||
modifier = 255, 197, 143
|
||||
texthighlight = 255, 238, 173, 96
|
||||
|
||||
@@ -45,3 +45,4 @@ spellcheckline = 213, 78, 83
|
||||
errorline = 185, 202, 74
|
||||
replacetag = 112, 192, 177
|
||||
modifier = 231, 140, 69
|
||||
texthighlight = 231, 197, 71, 128
|
||||
|
||||
@@ -45,3 +45,4 @@ spellcheckline = 242, 119, 122
|
||||
errorline = 153, 204, 153
|
||||
replacetag = 102, 204, 204
|
||||
modifier = 249, 145, 57
|
||||
texthighlight = 255, 204, 102, 96
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
<h3>Contributors</h3>
|
||||
|
||||
<p>
|
||||
<b>Concept:</b> Marian Lückhof (<a href="https://github.com/Number042">@Number042</a>)<br>
|
||||
<b>Internationalisation:</b> Bruno Meneguello (<a href="https://github.com/bkmeneguello">@bkmeneguello</a>)<br>
|
||||
<b>Setup and Packaging:</b> Rachel Powers (<a href="https://github.com/Ryex">@Ryex</a>)
|
||||
• <b>Concept:</b> Marian Lückhof (<a href="https://github.com/Number042">@Number042</a>)<br>
|
||||
• <b>Internationalisation:</b> Bruno Meneguello (<a href="https://github.com/bkmeneguello">@bkmeneguello</a>)<br>
|
||||
• <b>Setup and Packaging:</b> Rachel Powers (<a href="https://github.com/Ryex">@Ryex</a>)
|
||||
</p>
|
||||
<p>For other contributions, see the project's
|
||||
<a href="https://github.com/vkbo/novelWriter/graphs/contributors">Contributors</a> page.</p>
|
||||
@@ -24,20 +24,20 @@
|
||||
<p>The default language is English (UK) with English (US) as an option. These are the original
|
||||
translators for the languages currently available:</p>
|
||||
<p>
|
||||
<b>Dutch:</b> Martijn van der Kleijn (<a href="https://github.com/mvdkleijn">@mvdkleijn</a>)<br>
|
||||
<b>French:</b> Jan Lüdke (<a href="https://github.com/jyhelle">@jyhelle</a>)<br>
|
||||
<b>German:</b> Myian (<a href="https://github.com/heymyian">@heymyian</a>)<br>
|
||||
<b>Italian:</b> Riccardo Mangili<br>
|
||||
<b>Japanese:</b> hebekeg (<a href="https://github.com/hebekeg">@hebekeg</a>)<br>
|
||||
<b>Latin American Spanish:</b> Tommy Marplatt (<a href="https://github.com/tmarplatt">@tmarplatt</a>)<br>
|
||||
<b>Norwegian:</b> Veronica Berglyd Olsen (<a href="https://github.com/vkbo">@vkbo</a>)<br>
|
||||
<b>Portuguese:</b> Bruno Meneguello (<a href="https://github.com/bkmeneguello">@bkmeneguello</a>)<br>
|
||||
<b>Simplified Chinese:</b> Qianzhi Long (<a href="https://github.com/longqzh">@longqzh</a>)
|
||||
• <b>Dutch:</b> Martijn van der Kleijn (<a href="https://github.com/mvdkleijn">@mvdkleijn</a>)<br>
|
||||
• <b>French:</b> Jan Lüdke (<a href="https://github.com/jyhelle">@jyhelle</a>)<br>
|
||||
• <b>German:</b> Myian (<a href="https://github.com/heymyian">@heymyian</a>)<br>
|
||||
• <b>Italian:</b> Riccardo Mangili<br>
|
||||
• <b>Japanese:</b> hebekeg (<a href="https://github.com/hebekeg">@hebekeg</a>)<br>
|
||||
• <b>Latin American Spanish:</b> Tommy Marplatt (<a href="https://github.com/tmarplatt">@tmarplatt</a>)<br>
|
||||
• <b>Norwegian:</b> Veronica Berglyd Olsen (<a href="https://github.com/vkbo">@vkbo</a>)<br>
|
||||
• <b>Portuguese:</b> Bruno Meneguello (<a href="https://github.com/bkmeneguello">@bkmeneguello</a>)<br>
|
||||
• <b>Simplified Chinese:</b> Qianzhi Long (<a href="https://github.com/longqzh">@longqzh</a>)
|
||||
</p>
|
||||
|
||||
<p>Additional larger translation contributions:</p>
|
||||
<p>
|
||||
<b>French:</b> Albert Aribaud (<a href="https://github.com/aaribaud">@aaribaud</a>)
|
||||
• <b>French:</b> Albert Aribaud (<a href="https://github.com/aaribaud">@aaribaud</a>)
|
||||
</p>
|
||||
|
||||
<p>Translations are managed on <a href="https://crowdin.com/project/novelwriter">Crowdin</a>, and
|
||||
@@ -47,27 +47,29 @@ more contributions are listed on the project's <a href="https://crowdin.com/proj
|
||||
|
||||
<p>The following libraries are dependencies of novelWriter:</p>
|
||||
<p>
|
||||
<a href="https://www.qt.io">Qt5</a> by Qt Company<br>
|
||||
<a href="https://www.riverbankcomputing.com/software/pyqt">PyQt5</a> by Riverbank Computing<br>
|
||||
<a href="https://abiword.github.io/enchant">Enchant</a> by Dom Lachowicz<br>
|
||||
<a href="https://pyenchant.github.io/pyenchant">PyEnchant</a> by Dimitri Merejkowsky
|
||||
• <a href="https://www.qt.io">Qt5</a> by Qt Company<br>
|
||||
• <a href="https://www.riverbankcomputing.com/software/pyqt">PyQt5</a> by Riverbank Computing<br>
|
||||
• <a href="https://abiword.github.io/enchant">Enchant</a> by Dom Lachowicz<br>
|
||||
• <a href="https://pyenchant.github.io/pyenchant">PyEnchant</a> by Dimitri Merejkowsky
|
||||
</p>
|
||||
|
||||
<h3>Assets</h3>
|
||||
|
||||
<p>Some of the assets bundled with novelWriter were adapted from the following sources:</p>
|
||||
<p>
|
||||
<a href="https://github.com/stephenhutchings/typicons.font">Typicons</a> icons by Stephen Hutchings (CC BY-SA 4.0)<br>
|
||||
<a href="https://github.com/chriskempson/base16">Tomorrow</a> syntax themes by Chris Kempson (MIT License)<br>
|
||||
<a href="https://github.com/sdras/night-owl-vscode-theme">Owl</a> syntax themes by Sarah Drasner (MIT License)<br>
|
||||
<a href="https://github.com/altercation/solarized">Solarized</a> themes by Ethan Schoonover (MIT License)
|
||||
• <a href="https://github.com/stephenhutchings/typicons.font">Typicons</a> icons by Stephen Hutchings (CC BY-SA 4.0)<br>
|
||||
• <a href="https://github.com/chriskempson/base16">Tomorrow</a> syntax themes by Chris Kempson (MIT License)<br>
|
||||
• <a href="https://github.com/sdras/night-owl-vscode-theme">Owl</a> syntax themes by Sarah Drasner (MIT License)<br>
|
||||
• <a href="https://github.com/altercation/solarized">Solarized</a> themes by Ethan Schoonover (MIT License)
|
||||
</p>
|
||||
|
||||
<h3>Fonts</h3>
|
||||
|
||||
<p>The font used for the main novelWriter logo, mimetype and text banners is:</p>
|
||||
<p>The font used for the main novelWriter logo, mimetype and text banners is Pridi. Other fonts are
|
||||
used on buttons and icons.</p>
|
||||
<p>
|
||||
Pridi by Cadson Demak (Open Font License, Version 1.1)
|
||||
• Pridi by Cadson Demak (Open Font License, Version 1.1)<br>
|
||||
• Source Sans Pro by Paul D. Hunt (SIL Open Font License)
|
||||
</p>
|
||||
|
||||
<h3>Special Mentions</h3>
|
||||
|
||||
@@ -36,7 +36,7 @@ from configparser import ConfigParser
|
||||
from urllib.parse import urljoin
|
||||
from urllib.request import pathname2url
|
||||
|
||||
from PyQt5.QtGui import QDesktopServices
|
||||
from PyQt5.QtGui import QColor, QDesktopServices
|
||||
from PyQt5.QtCore import QCoreApplication, QUrl
|
||||
|
||||
from novelwriter.enum import nwItemClass, nwItemType, nwItemLayout
|
||||
@@ -255,7 +255,7 @@ def formatFileFilter(extensions: list[str | tuple[str, str]]) -> str:
|
||||
result = []
|
||||
for ext in extensions:
|
||||
if isinstance(ext, str):
|
||||
result.append(f"{trConst(nwLabels.FILE_FILTERS.get(ext))} ({ext})")
|
||||
result.append(f"{trConst(nwLabels.FILE_FILTERS.get(ext, 'ERR'))} ({ext})")
|
||||
elif isinstance(ext, tuple) and len(ext) == 2:
|
||||
result.append(f"{ext[0]} ({ext[1]})")
|
||||
return ";;".join(result)
|
||||
@@ -382,6 +382,11 @@ def numberToRoman(value: int, toLower: bool = False) -> str:
|
||||
return roman.lower() if toLower else roman
|
||||
|
||||
|
||||
def cssCol(col: QColor, alpha: int | None = None) -> str:
|
||||
"""Convert a QColor object to an rgba entry to use in CSS."""
|
||||
return f"rgba({col.red()}, {col.green()}, {col.blue()}, {alpha or col.alpha()})"
|
||||
|
||||
|
||||
##
|
||||
# Encoder Functions
|
||||
##
|
||||
@@ -444,7 +449,7 @@ def xmlIndent(tree: ET.Element | ET.ElementTree) -> None:
|
||||
|
||||
indentations = ["\n"]
|
||||
|
||||
def indentChildren(elem, level):
|
||||
def indentChildren(elem: ET.Element, level: int) -> None:
|
||||
chLevel = level + 1
|
||||
try:
|
||||
chIndent = indentations[chLevel]
|
||||
@@ -467,6 +472,8 @@ def xmlIndent(tree: ET.Element | ET.ElementTree) -> None:
|
||||
if last is not None:
|
||||
last.tail = indentations[level]
|
||||
|
||||
return
|
||||
|
||||
if len(tree):
|
||||
indentChildren(tree, 0)
|
||||
tree.tail = "\n"
|
||||
@@ -529,8 +536,9 @@ class NWConfigParser(ConfigParser):
|
||||
helper functions, and support for lists.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
return
|
||||
|
||||
def rdStr(self, section: str, option: str, default: str) -> str:
|
||||
"""Read string value."""
|
||||
|
||||
@@ -30,6 +30,7 @@ import logging
|
||||
|
||||
from time import time
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
|
||||
from PyQt5.QtGui import QFontDatabase
|
||||
from PyQt5.QtCore import (
|
||||
@@ -60,8 +61,12 @@ class Config:
|
||||
self.appHandle = "novelwriter"
|
||||
|
||||
# Set Paths
|
||||
confRoot = Path(QStandardPaths.writableLocation(QStandardPaths.ConfigLocation))
|
||||
dataRoot = Path(QStandardPaths.writableLocation(QStandardPaths.AppDataLocation))
|
||||
confRoot = Path(QStandardPaths.writableLocation(
|
||||
QStandardPaths.StandardLocation.ConfigLocation)
|
||||
)
|
||||
dataRoot = Path(QStandardPaths.writableLocation(
|
||||
QStandardPaths.StandardLocation.AppDataLocation)
|
||||
)
|
||||
|
||||
self._confPath = confRoot.absolute() / self.appHandle # The user config location
|
||||
self._dataPath = dataRoot.absolute() / self.appHandle # The user data location
|
||||
@@ -82,10 +87,13 @@ class Config:
|
||||
# Localisation
|
||||
# Note that these paths must be strings
|
||||
self._nwLangPath = self._appPath / "assets" / "i18n"
|
||||
self._qtLangPath = QLibraryInfo.location(QLibraryInfo.TranslationsPath)
|
||||
self._qtLangPath = QLibraryInfo.location(QLibraryInfo.LibraryLocation.TranslationsPath)
|
||||
|
||||
wantedLocale = self._nwLangPath / f"nw_{QLocale.system().name()}.qm"
|
||||
self._qLocale = QLocale.system() if wantedLocale.exists() else QLocale("en_GB")
|
||||
hasLocale = (self._nwLangPath / f"nw_{QLocale.system().name()}.qm").exists()
|
||||
self._qLocale = QLocale.system() if hasLocale else QLocale("en_GB")
|
||||
self._dLocale = QLocale.system()
|
||||
self._dShortDate = self._dLocale.dateFormat(QLocale.FormatType.ShortFormat)
|
||||
self._dShortDateTime = self._dLocale.dateTimeFormat(QLocale.FormatType.ShortFormat)
|
||||
self._qtTrans = {}
|
||||
|
||||
# PDF Manual
|
||||
@@ -179,17 +187,19 @@ class Config:
|
||||
# State
|
||||
self.showViewerPanel = True # The panel for the viewer is visible
|
||||
self.showEditToolBar = False # The document editor toolbar visibility
|
||||
self.useShortcodes = False # Use shortcodes for basic formatting
|
||||
self.viewComments = True # Comments are shown in the viewer
|
||||
self.viewSynopsis = True # Synopsis is shown in the viewer
|
||||
|
||||
# Search Bar Switches
|
||||
self.searchCase = False
|
||||
self.searchWord = False
|
||||
self.searchRegEx = False
|
||||
self.searchLoop = False
|
||||
self.searchNextFile = False
|
||||
self.searchMatchCap = False
|
||||
# Search Box States
|
||||
self.searchCase = False
|
||||
self.searchWord = False
|
||||
self.searchRegEx = False
|
||||
self.searchLoop = False
|
||||
self.searchNextFile = False
|
||||
self.searchMatchCap = False
|
||||
self.searchProjCase = False
|
||||
self.searchProjWord = False
|
||||
self.searchProjRegEx = False
|
||||
|
||||
# System and App Information
|
||||
# ==========================
|
||||
@@ -363,7 +373,7 @@ class Config:
|
||||
elif self.osDarwin and "Helvetica" in fontFam:
|
||||
self.textFont = "Helvetica"
|
||||
else:
|
||||
self.textFont = fontDB.systemFont(QFontDatabase.GeneralFont).family()
|
||||
self.textFont = fontDB.systemFont(QFontDatabase.SystemFont.GeneralFont).family()
|
||||
else:
|
||||
self.textFont = family
|
||||
return
|
||||
@@ -380,6 +390,10 @@ class Config:
|
||||
"""Un-scale fixed gui sizes by the screen scale factor."""
|
||||
return int(value/self.guiScale)
|
||||
|
||||
def homePath(self) -> Path:
|
||||
"""The user's home folder."""
|
||||
return self._homePath
|
||||
|
||||
def dataPath(self, target: str | None = None) -> Path:
|
||||
"""Return a path in the data folder."""
|
||||
if isinstance(target, str):
|
||||
@@ -414,6 +428,14 @@ class Config:
|
||||
self._errData = []
|
||||
return message
|
||||
|
||||
def localDate(self, value: datetime) -> str:
|
||||
"""Return a localised date format."""
|
||||
return self._dLocale.toString(value, self._dShortDate)
|
||||
|
||||
def localDateTime(self, value: datetime) -> str:
|
||||
"""Return a localised datetime format."""
|
||||
return self._dLocale.toString(value, self._dShortDateTime)
|
||||
|
||||
def listLanguages(self, lngSet: int) -> list[tuple[str, str]]:
|
||||
"""List localisation files in the i18n folder. The default GUI
|
||||
language is British English (en_GB).
|
||||
@@ -496,6 +518,11 @@ class Config:
|
||||
QLocale.setDefault(self._qLocale)
|
||||
self._qtTrans = {}
|
||||
|
||||
hasLocale = (self._nwLangPath / f"nw_{self._qLocale.name()}.qm").exists()
|
||||
self._dLocale = self._qLocale if hasLocale else QLocale.system()
|
||||
self._dShortDate = self._dLocale.dateFormat(QLocale.FormatType.ShortFormat)
|
||||
self._dShortDateTime = self._dLocale.dateTimeFormat(QLocale.FormatType.ShortFormat)
|
||||
|
||||
langList = [
|
||||
(self._qtLangPath, "qtbase"), # Qt 5.x
|
||||
(str(self._nwLangPath), "nw"), # novelWriter
|
||||
@@ -602,7 +629,6 @@ class Config:
|
||||
sec = "State"
|
||||
self.showViewerPanel = conf.rdBool(sec, "showviewerpanel", self.showViewerPanel)
|
||||
self.showEditToolBar = conf.rdBool(sec, "showedittoolbar", self.showEditToolBar)
|
||||
self.useShortcodes = conf.rdBool(sec, "useshortcodes", self.useShortcodes)
|
||||
self.viewComments = conf.rdBool(sec, "viewcomments", self.viewComments)
|
||||
self.viewSynopsis = conf.rdBool(sec, "viewsynopsis", self.viewSynopsis)
|
||||
self.searchCase = conf.rdBool(sec, "searchcase", self.searchCase)
|
||||
@@ -611,6 +637,9 @@ class Config:
|
||||
self.searchLoop = conf.rdBool(sec, "searchloop", self.searchLoop)
|
||||
self.searchNextFile = conf.rdBool(sec, "searchnextfile", self.searchNextFile)
|
||||
self.searchMatchCap = conf.rdBool(sec, "searchmatchcap", self.searchMatchCap)
|
||||
self.searchProjCase = conf.rdBool(sec, "searchprojcase", self.searchProjCase)
|
||||
self.searchProjWord = conf.rdBool(sec, "searchprojword", self.searchProjWord)
|
||||
self.searchProjRegEx = conf.rdBool(sec, "searchprojregex", self.searchProjRegEx)
|
||||
|
||||
# Check Values
|
||||
# ============
|
||||
@@ -708,7 +737,6 @@ class Config:
|
||||
conf["State"] = {
|
||||
"showviewerpanel": str(self.showViewerPanel),
|
||||
"showedittoolbar": str(self.showEditToolBar),
|
||||
"useshortcodes": str(self.useShortcodes),
|
||||
"viewcomments": str(self.viewComments),
|
||||
"viewsynopsis": str(self.viewSynopsis),
|
||||
"searchcase": str(self.searchCase),
|
||||
@@ -717,6 +745,9 @@ class Config:
|
||||
"searchloop": str(self.searchLoop),
|
||||
"searchnextfile": str(self.searchNextFile),
|
||||
"searchmatchcap": str(self.searchMatchCap),
|
||||
"searchprojcase": str(self.searchProjCase),
|
||||
"searchprojword": str(self.searchProjWord),
|
||||
"searchprojregex": str(self.searchProjRegEx),
|
||||
}
|
||||
|
||||
# Write config file
|
||||
|
||||
@@ -23,8 +23,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
|
||||
from PyQt5.QtCore import QCoreApplication, QT_TRANSLATE_NOOP
|
||||
|
||||
from novelwriter.enum import nwBuildFmt, nwItemClass, nwItemLayout, nwOutline
|
||||
@@ -55,6 +53,7 @@ class nwConst:
|
||||
|
||||
# Gui Settings
|
||||
STATUS_MSG_TIMEOUT = 15000 # milliseconds
|
||||
MAX_SEARCH_RESULT = 1000
|
||||
|
||||
# Dialogs
|
||||
DLG_FINISHED = 2
|
||||
@@ -67,12 +66,9 @@ class nwRegEx:
|
||||
FMT_EI = r"(?<![\w\\])(_)(?![\s_])(.+?)(?<![\s\\])(\1)(?!\w)"
|
||||
FMT_EB = r"(?<![\w\\])([\*]{2})(?![\s\*])(.+?)(?<![\s\\])(\1)(?!\w)"
|
||||
FMT_ST = r"(?<![\w\\])([~]{2})(?![\s~])(.+?)(?<![\s\\])(\1)(?!\w)"
|
||||
FMT_SC = r"(?i)(?<!\\)(\[[\/\!]?(?:i|b|s|u|sup|sub)\])"
|
||||
FMT_SC = r"(?i)(?<!\\)(\[[\/\!]?(?:i|b|s|u|m|sup|sub)\])"
|
||||
FMT_SV = r"(?<!\\)(\[(?i)(?:fn|footnote):)(.+?)(?<!\\)(\])"
|
||||
|
||||
# Pre-Compiled RegEx
|
||||
RX_SC = re.compile(FMT_SC)
|
||||
|
||||
# END Class nwRegEx
|
||||
|
||||
|
||||
@@ -86,6 +82,8 @@ class nwShortcode:
|
||||
STRIKE_C = "[/s]"
|
||||
ULINE_O = "[u]"
|
||||
ULINE_C = "[/u]"
|
||||
MARK_O = "[m]"
|
||||
MARK_C = "[/m]"
|
||||
SUP_O = "[sup]"
|
||||
SUP_C = "[/sup]"
|
||||
SUB_O = "[sub]"
|
||||
@@ -408,6 +406,7 @@ class nwUnicode:
|
||||
U_THNBSP = "\u202f" # Thin non-breaking space
|
||||
U_ENSP = "\u2002" # Short (en) space
|
||||
U_EMSP = "\u2003" # Long (em) space
|
||||
U_MMSP = "\u205f" # Medium mathematical space
|
||||
U_LSEP = "\u2028" # Line separator
|
||||
U_PSEP = "\u2029" # Paragraph separator
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
"""
|
||||
novelWriter – Core Init File
|
||||
"""
|
||||
@@ -49,39 +49,54 @@ logger = logging.getLogger(__name__)
|
||||
# (type, default, [min value, max value])
|
||||
|
||||
SETTINGS_TEMPLATE = {
|
||||
"filter.includeNovel": (bool, True),
|
||||
"filter.includeNotes": (bool, False),
|
||||
"filter.includeInactive": (bool, False),
|
||||
"headings.fmtTitle": (str, nwHeadFmt.TITLE),
|
||||
"headings.fmtChapter": (str, nwHeadFmt.TITLE),
|
||||
"headings.fmtUnnumbered": (str, nwHeadFmt.TITLE),
|
||||
"headings.fmtScene": (str, "* * *"),
|
||||
"headings.fmtSection": (str, ""),
|
||||
"headings.hideScene": (bool, False),
|
||||
"headings.hideSection": (bool, True),
|
||||
"text.includeSynopsis": (bool, False),
|
||||
"text.includeComments": (bool, False),
|
||||
"text.includeKeywords": (bool, False),
|
||||
"text.includeBodyText": (bool, True),
|
||||
"text.addNoteHeadings": (bool, True),
|
||||
"format.textFont": (str, CONFIG.textFont),
|
||||
"format.textSize": (int, 12),
|
||||
"format.lineHeight": (float, 1.15, 0.75, 3.0),
|
||||
"format.justifyText": (bool, False),
|
||||
"format.stripUnicode": (bool, False),
|
||||
"format.replaceTabs": (bool, False),
|
||||
"format.pageUnit": (str, "cm"),
|
||||
"format.pageSize": (str, "A4"),
|
||||
"format.pageWidth": (float, 21.0),
|
||||
"format.pageHeight": (float, 29.7),
|
||||
"format.topMargin": (float, 2.0),
|
||||
"format.bottomMargin": (float, 2.0),
|
||||
"format.leftMargin": (float, 2.0),
|
||||
"format.rightMargin": (float, 2.0),
|
||||
"odt.addColours": (bool, True),
|
||||
"odt.pageHeader": (str, nwHeadFmt.ODT_AUTO),
|
||||
"odt.pageCountOffset": (int, 0),
|
||||
"html.addStyles": (bool, True),
|
||||
"filter.includeNovel": (bool, True),
|
||||
"filter.includeNotes": (bool, False),
|
||||
"filter.includeInactive": (bool, False),
|
||||
"headings.fmtTitle": (str, nwHeadFmt.TITLE),
|
||||
"headings.fmtChapter": (str, nwHeadFmt.TITLE),
|
||||
"headings.fmtUnnumbered": (str, nwHeadFmt.TITLE),
|
||||
"headings.fmtScene": (str, "* * *"),
|
||||
"headings.fmtAltScene": (str, ""),
|
||||
"headings.fmtSection": (str, ""),
|
||||
"headings.hideTitle": (bool, False),
|
||||
"headings.hideChapter": (bool, False),
|
||||
"headings.hideUnnumbered": (bool, False),
|
||||
"headings.hideScene": (bool, False),
|
||||
"headings.hideAltScene": (bool, False),
|
||||
"headings.hideSection": (bool, True),
|
||||
"headings.centerTitle": (bool, True),
|
||||
"headings.centerChapter": (bool, False),
|
||||
"headings.centerScene": (bool, False),
|
||||
"headings.breakTitle": (bool, True),
|
||||
"headings.breakChapter": (bool, True),
|
||||
"headings.breakScene": (bool, False),
|
||||
"text.includeSynopsis": (bool, False),
|
||||
"text.includeComments": (bool, False),
|
||||
"text.includeKeywords": (bool, False),
|
||||
"text.includeBodyText": (bool, True),
|
||||
"text.ignoredKeywords": (str, ""),
|
||||
"text.addNoteHeadings": (bool, True),
|
||||
"format.textFont": (str, CONFIG.textFont),
|
||||
"format.textSize": (int, 12),
|
||||
"format.lineHeight": (float, 1.15, 0.75, 3.0),
|
||||
"format.justifyText": (bool, False),
|
||||
"format.stripUnicode": (bool, False),
|
||||
"format.replaceTabs": (bool, False),
|
||||
"format.pageUnit": (str, "cm"),
|
||||
"format.pageSize": (str, "A4"),
|
||||
"format.pageWidth": (float, 21.0),
|
||||
"format.pageHeight": (float, 29.7),
|
||||
"format.topMargin": (float, 2.0),
|
||||
"format.bottomMargin": (float, 2.0),
|
||||
"format.leftMargin": (float, 2.0),
|
||||
"format.rightMargin": (float, 2.0),
|
||||
"odt.addColours": (bool, True),
|
||||
"odt.pageHeader": (str, nwHeadFmt.ODT_AUTO),
|
||||
"odt.pageCountOffset": (int, 0),
|
||||
"odt.firstLineIndent": (bool, False),
|
||||
"md.preserveBreaks": (bool, True),
|
||||
"html.addStyles": (bool, True),
|
||||
"html.preserveTabs": (bool, False),
|
||||
}
|
||||
|
||||
SETTINGS_LABELS = {
|
||||
@@ -91,19 +106,19 @@ SETTINGS_LABELS = {
|
||||
"filter.includeInactive": QT_TRANSLATE_NOOP("Builds", "Inactive Documents"),
|
||||
|
||||
"headings": QT_TRANSLATE_NOOP("Builds", "Headings"),
|
||||
"headings.fmtTitle": QT_TRANSLATE_NOOP("Builds", "Title Headings"),
|
||||
"headings.fmtChapter": QT_TRANSLATE_NOOP("Builds", "Chapter Headings"),
|
||||
"headings.fmtUnnumbered": QT_TRANSLATE_NOOP("Builds", "Unnumbered Headings"),
|
||||
"headings.fmtScene": QT_TRANSLATE_NOOP("Builds", "Scene Headings"),
|
||||
"headings.fmtSection": QT_TRANSLATE_NOOP("Builds", "Section Headings"),
|
||||
"headings.hideScene": QT_TRANSLATE_NOOP("Builds", "Hide Scene Headings"),
|
||||
"headings.hideSection": QT_TRANSLATE_NOOP("Builds", "Hide Section Headings"),
|
||||
"headings.fmtTitle": QT_TRANSLATE_NOOP("Builds", "Partition Format"),
|
||||
"headings.fmtChapter": QT_TRANSLATE_NOOP("Builds", "Chapter Format"),
|
||||
"headings.fmtUnnumbered": QT_TRANSLATE_NOOP("Builds", "Unnumbered Format"),
|
||||
"headings.fmtScene": QT_TRANSLATE_NOOP("Builds", "Scene Format"),
|
||||
"headings.fmtAltScene": QT_TRANSLATE_NOOP("Builds", "Alt. Scene Format"),
|
||||
"headings.fmtSection": QT_TRANSLATE_NOOP("Builds", "Section Format"),
|
||||
|
||||
"text.grpContent": QT_TRANSLATE_NOOP("Builds", "Text Content"),
|
||||
"text.includeSynopsis": QT_TRANSLATE_NOOP("Builds", "Include Synopsis"),
|
||||
"text.includeComments": QT_TRANSLATE_NOOP("Builds", "Include Comments"),
|
||||
"text.includeKeywords": QT_TRANSLATE_NOOP("Builds", "Include Keywords"),
|
||||
"text.includeBodyText": QT_TRANSLATE_NOOP("Builds", "Include Body Text"),
|
||||
"text.ignoredKeywords": QT_TRANSLATE_NOOP("Builds", "Ignore These Keywords"),
|
||||
"text.grpInsert": QT_TRANSLATE_NOOP("Builds", "Insert Content"),
|
||||
"text.addNoteHeadings": QT_TRANSLATE_NOOP("Builds", "Add Titles for Notes"),
|
||||
|
||||
@@ -129,9 +144,14 @@ SETTINGS_LABELS = {
|
||||
"odt.addColours": QT_TRANSLATE_NOOP("Builds", "Add Highlight Colours"),
|
||||
"odt.pageHeader": QT_TRANSLATE_NOOP("Builds", "Page Header"),
|
||||
"odt.pageCountOffset": QT_TRANSLATE_NOOP("Builds", "Page Counter Offset"),
|
||||
"odt.firstLineIndent": QT_TRANSLATE_NOOP("Builds", "First Line Indent"),
|
||||
|
||||
"md": QT_TRANSLATE_NOOP("Builds", "Markdown (.md)"),
|
||||
"md.preserveBreaks": QT_TRANSLATE_NOOP("Builds", "Preserve Hard Line Breaks"),
|
||||
|
||||
"html": QT_TRANSLATE_NOOP("Builds", "HTML (.html)"),
|
||||
"html.addStyles": QT_TRANSLATE_NOOP("Builds", "Add CSS Styles"),
|
||||
"html.preserveTabs": QT_TRANSLATE_NOOP("Builds", "Preserve Tab Characters"),
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +178,7 @@ class BuildSettings:
|
||||
def __init__(self) -> None:
|
||||
self._name = ""
|
||||
self._uuid = str(uuid.uuid4())
|
||||
self._path = Path.home()
|
||||
self._path = CONFIG.homePath()
|
||||
self._build = ""
|
||||
self._order = 0
|
||||
self._format = nwBuildFmt.ODT
|
||||
@@ -200,7 +220,7 @@ class BuildSettings:
|
||||
"""The last used build path."""
|
||||
if self._path.is_dir():
|
||||
return self._path
|
||||
return Path.home()
|
||||
return CONFIG.homePath()
|
||||
|
||||
@property
|
||||
def lastBuildName(self) -> str:
|
||||
@@ -277,7 +297,7 @@ class BuildSettings:
|
||||
if isinstance(path, Path) and path.is_dir():
|
||||
self._path = path
|
||||
else:
|
||||
self._path = Path.home()
|
||||
self._path = CONFIG.homePath()
|
||||
self._changed = True
|
||||
return
|
||||
|
||||
@@ -362,7 +382,7 @@ class BuildSettings:
|
||||
|
||||
postponed = []
|
||||
|
||||
def allowRoot(rHandle):
|
||||
def allowRoot(rHandle: str | None) -> None:
|
||||
if rHandle in postponed and rHandle in result and rHandle is not None:
|
||||
result[rHandle] = (True, FilterMode.ROOT)
|
||||
postponed.remove(rHandle)
|
||||
|
||||
@@ -26,19 +26,19 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import shutil
|
||||
import logging
|
||||
import shutil
|
||||
|
||||
from pathlib import Path
|
||||
from functools import partial
|
||||
from zipfile import ZipFile, is_zipfile
|
||||
from collections.abc import Iterable
|
||||
from functools import partial
|
||||
from pathlib import Path
|
||||
from zipfile import ZipFile, is_zipfile
|
||||
|
||||
from PyQt5.QtCore import QCoreApplication
|
||||
from PyQt5.QtCore import QCoreApplication, QRegularExpression
|
||||
|
||||
from novelwriter import CONFIG, SHARED
|
||||
from novelwriter.common import isHandle, minmax, simplified
|
||||
from novelwriter.constants import nwFiles, nwItemClass
|
||||
from novelwriter.constants import nwConst, nwFiles, nwItemClass
|
||||
from novelwriter.core.item import NWItem
|
||||
from novelwriter.core.project import NWProject
|
||||
from novelwriter.core.storage import NWStorageCreate
|
||||
@@ -101,9 +101,7 @@ class DocMerger:
|
||||
if srcItem is None:
|
||||
return False
|
||||
|
||||
inDoc = self._project.storage.getDocument(srcHandle)
|
||||
docText = (inDoc.readDocument() or "").rstrip("\n")
|
||||
|
||||
docText = self._project.storage.getDocumentText(srcHandle).rstrip("\n")
|
||||
if addComment:
|
||||
docInfo = srcItem.describeMe()
|
||||
docSt, _ = srcItem.getImportStatus(incIcon=False)
|
||||
@@ -122,9 +120,8 @@ class DocMerger:
|
||||
return False
|
||||
|
||||
outDoc = self._project.storage.getDocument(self._targetDoc)
|
||||
docText = (outDoc.readDocument() or "").rstrip("\n")
|
||||
if docText:
|
||||
self._targetText.insert(0, docText)
|
||||
if text := (outDoc.readDocument() or "").rstrip("\n"):
|
||||
self._targetText.insert(0, text)
|
||||
|
||||
status = outDoc.writeDocument("\n\n".join(self._targetText) + "\n\n")
|
||||
if not status:
|
||||
@@ -292,11 +289,10 @@ class DocDuplicator:
|
||||
newItem.setParent(hMap[newItem.itemParent])
|
||||
self._project.tree.updateItemData(newItem.itemHandle)
|
||||
if newItem.isFileType():
|
||||
oldDoc = self._project.storage.getDocument(tHandle)
|
||||
newDoc = self._project.storage.getDocument(newItem.itemHandle)
|
||||
if newDoc.fileExists():
|
||||
return
|
||||
newDoc.writeDocument(oldDoc.readDocument() or "")
|
||||
newDoc.writeDocument(self._project.storage.getDocumentText(tHandle))
|
||||
yield newItem.itemHandle, nHandle
|
||||
nHandle = None
|
||||
return
|
||||
@@ -304,6 +300,94 @@ class DocDuplicator:
|
||||
# END Class DocDuplicator
|
||||
|
||||
|
||||
class DocSearch:
|
||||
|
||||
def __init__(self) -> None:
|
||||
self._regEx = QRegularExpression()
|
||||
self.setCaseSensitive(False)
|
||||
self._words = False
|
||||
self._escape = True
|
||||
return
|
||||
|
||||
##
|
||||
# Methods
|
||||
##
|
||||
|
||||
def setCaseSensitive(self, state: bool) -> None:
|
||||
"""Set the case sensitive search flag."""
|
||||
opts = QRegularExpression.PatternOption.UseUnicodePropertiesOption
|
||||
if not state:
|
||||
opts |= QRegularExpression.PatternOption.CaseInsensitiveOption
|
||||
self._regEx.setPatternOptions(opts)
|
||||
return
|
||||
|
||||
def setWholeWords(self, state: bool) -> None:
|
||||
"""Set the whole words search flag."""
|
||||
self._words = state
|
||||
return
|
||||
|
||||
def setUserRegEx(self, state: bool) -> None:
|
||||
"""Set the escape flag to the opposite state."""
|
||||
self._escape = not state
|
||||
return
|
||||
|
||||
def iterSearch(
|
||||
self, project: NWProject, search: str
|
||||
) -> Iterable[tuple[NWItem, list[tuple[int, int, str]], bool]]:
|
||||
"""Iteratively search through documents in a project."""
|
||||
self._regEx.setPattern(self._buildPattern(search))
|
||||
logger.debug("Searching with pattern '%s'", self._regEx.pattern())
|
||||
storage = project.storage
|
||||
for item in project.tree:
|
||||
if item.isFileType():
|
||||
results, capped = self.searchText(storage.getDocumentText(item.itemHandle))
|
||||
yield item, results, capped
|
||||
return
|
||||
|
||||
def searchText(self, text: str) -> tuple[list[tuple[int, int, str]], bool]:
|
||||
"""Search a piece of text for RegEx matches."""
|
||||
rxItt = self._regEx.globalMatch(text)
|
||||
count = 0
|
||||
capped = False
|
||||
results = []
|
||||
while rxItt.hasNext():
|
||||
rxMatch = rxItt.next()
|
||||
pos = rxMatch.capturedStart()
|
||||
num = rxMatch.capturedLength()
|
||||
context = text[pos:pos+100].partition("\n")[0]
|
||||
if context:
|
||||
results.append((pos, num, context))
|
||||
count += 1
|
||||
if count >= nwConst.MAX_SEARCH_RESULT:
|
||||
capped = True
|
||||
break
|
||||
return results, capped
|
||||
|
||||
##
|
||||
# Internal Functions
|
||||
##
|
||||
|
||||
def _buildPattern(self, search: str) -> str:
|
||||
"""Build the search pattern string."""
|
||||
if self._escape:
|
||||
if CONFIG.verQtValue >= 0x050f00:
|
||||
search = QRegularExpression.escape(search)
|
||||
else:
|
||||
# For older Qt versions, we escape manually
|
||||
escaped = ""
|
||||
for c in search:
|
||||
if c.isalnum() or c == "_":
|
||||
escaped += c
|
||||
else:
|
||||
escaped += f"\\{c}"
|
||||
search = escaped
|
||||
if self._words:
|
||||
search = f"(?:^|\\b){search}(?:$|\\b)"
|
||||
return search
|
||||
|
||||
# END Class DocSearch
|
||||
|
||||
|
||||
class ProjectBuilder:
|
||||
"""A class to build a new project from a set of user-defined
|
||||
parameter provided by the New Project Wizard.
|
||||
|
||||
@@ -52,7 +52,10 @@ class NWBuildDocument:
|
||||
manuscript, based on a build definition object (BuildSettings).
|
||||
"""
|
||||
|
||||
__slots__ = ("_project", "_build", "_queue", "_error", "_cache")
|
||||
__slots__ = (
|
||||
"_project", "_build", "_queue", "_error", "_cache", "_count",
|
||||
"_outline", "_preview"
|
||||
)
|
||||
|
||||
def __init__(self, project: NWProject, build: BuildSettings) -> None:
|
||||
self._project = project
|
||||
@@ -60,6 +63,9 @@ class NWBuildDocument:
|
||||
self._queue = []
|
||||
self._error = None
|
||||
self._cache = None
|
||||
self._count = False
|
||||
self._outline = False
|
||||
self._preview = False
|
||||
return
|
||||
|
||||
##
|
||||
@@ -79,6 +85,29 @@ class NWBuildDocument:
|
||||
"""
|
||||
return self._cache
|
||||
|
||||
##
|
||||
# Setters
|
||||
##
|
||||
|
||||
def setCountEnabled(self, state: bool) -> None:
|
||||
"""Turn on/off stats for builds."""
|
||||
self._count = state
|
||||
return
|
||||
|
||||
def setBuildOutline(self, state: bool) -> None:
|
||||
"""Turn on/off outline for builds."""
|
||||
self._outline = state
|
||||
return
|
||||
|
||||
def setPreviewMode(self, state: bool) -> None:
|
||||
"""Set the preview mode of the build. This also enables stats
|
||||
count and outline mode.
|
||||
"""
|
||||
self._preview = state
|
||||
self._outline = state
|
||||
self._count = state
|
||||
return
|
||||
|
||||
##
|
||||
# Special Methods
|
||||
##
|
||||
@@ -153,6 +182,8 @@ class NWBuildDocument:
|
||||
makeObj = ToHtml(self._project)
|
||||
filtered = self._setupBuild(makeObj)
|
||||
|
||||
makeObj.setPreview(self._preview)
|
||||
makeObj.setLinkHeadings(self._preview)
|
||||
for i, tHandle in enumerate(self._queue):
|
||||
self._error = None
|
||||
if filtered.get(tHandle, (False, 0))[0]:
|
||||
@@ -160,7 +191,7 @@ class NWBuildDocument:
|
||||
else:
|
||||
yield i, False
|
||||
|
||||
if self._build.getBool("format.replaceTabs"):
|
||||
if not (self._build.getBool("html.preserveTabs") or self._preview):
|
||||
makeObj.replaceTabs()
|
||||
|
||||
self._error = None
|
||||
@@ -191,6 +222,8 @@ class NWBuildDocument:
|
||||
if self._build.getBool("format.replaceTabs"):
|
||||
makeObj.replaceTabs(nSpaces=4, spaceChar=" ")
|
||||
|
||||
makeObj.setPreserveBreaks(self._build.getBool("md.preserveBreaks"))
|
||||
|
||||
for i, tHandle in enumerate(self._queue):
|
||||
self._error = None
|
||||
if filtered.get(tHandle, (False, 0))[0]:
|
||||
@@ -256,26 +289,52 @@ class NWBuildDocument:
|
||||
fontInfo = QFontInfo(bldFont)
|
||||
textFixed = fontInfo.fixedPitch()
|
||||
|
||||
bldObj.setTitleFormat(self._build.getStr("headings.fmtTitle"))
|
||||
bldObj.setChapterFormat(self._build.getStr("headings.fmtChapter"))
|
||||
bldObj.setUnNumberedFormat(self._build.getStr("headings.fmtUnnumbered"))
|
||||
bldObj.setTitleFormat(
|
||||
self._build.getStr("headings.fmtTitle"),
|
||||
self._build.getBool("headings.hideTitle")
|
||||
)
|
||||
bldObj.setChapterFormat(
|
||||
self._build.getStr("headings.fmtChapter"),
|
||||
self._build.getBool("headings.hideChapter")
|
||||
)
|
||||
bldObj.setUnNumberedFormat(
|
||||
self._build.getStr("headings.fmtUnnumbered"),
|
||||
self._build.getBool("headings.hideUnnumbered")
|
||||
)
|
||||
bldObj.setSceneFormat(
|
||||
self._build.getStr("headings.fmtScene"),
|
||||
self._build.getBool("headings.hideScene")
|
||||
)
|
||||
bldObj.setHardSceneFormat(
|
||||
self._build.getStr("headings.fmtAltScene"),
|
||||
self._build.getBool("headings.hideAltScene")
|
||||
)
|
||||
bldObj.setSectionFormat(
|
||||
self._build.getStr("headings.fmtSection"),
|
||||
self._build.getBool("headings.hideSection")
|
||||
)
|
||||
bldObj.setTitleStyle(
|
||||
self._build.getBool("headings.centerTitle"),
|
||||
self._build.getBool("headings.breakTitle")
|
||||
)
|
||||
bldObj.setChapterStyle(
|
||||
self._build.getBool("headings.centerChapter"),
|
||||
self._build.getBool("headings.breakChapter")
|
||||
)
|
||||
bldObj.setSceneStyle(
|
||||
self._build.getBool("headings.centerScene"),
|
||||
self._build.getBool("headings.breakScene")
|
||||
)
|
||||
|
||||
bldObj.setFont(fontFamily, textSize, textFixed)
|
||||
bldObj.setJustify(self._build.getBool("format.justifyText"))
|
||||
bldObj.setLineHeight(self._build.getFloat("format.lineHeight"))
|
||||
|
||||
bldObj.setBodyText(self._build.getBool("text.includeBodyText"))
|
||||
bldObj.setSynopsis(self._build.getBool("text.includeSynopsis"))
|
||||
bldObj.setComments(self._build.getBool("text.includeComments"))
|
||||
bldObj.setKeywords(self._build.getBool("text.includeKeywords"))
|
||||
bldObj.setBodyText(self._build.getBool("text.includeBodyText"))
|
||||
bldObj.setIgnoredKeywords(self._build.getStr("text.ignoredKeywords"))
|
||||
|
||||
if isinstance(bldObj, ToHtml):
|
||||
bldObj.setStyles(self._build.getBool("html.addStyles"))
|
||||
@@ -287,6 +346,7 @@ class NWBuildDocument:
|
||||
bldObj.setHeaderFormat(
|
||||
self._build.getStr("odt.pageHeader"), self._build.getInt("odt.pageCountOffset")
|
||||
)
|
||||
bldObj.setFirstLineIndent(self._build.getBool("odt.firstLineIndent"))
|
||||
|
||||
scale = nwLabels.UNIT_SCALE.get(self._build.getStr("format.pageUnit"), 1.0)
|
||||
pW, pH = nwLabels.PAPER_SIZE.get(self._build.getStr("format.pageSize"), (-1.0, -1.0))
|
||||
@@ -314,11 +374,18 @@ class NWBuildDocument:
|
||||
bldObj.addRootHeading(tHandle)
|
||||
if convert:
|
||||
bldObj.doConvert()
|
||||
if self._count:
|
||||
bldObj.countStats()
|
||||
if self._outline:
|
||||
bldObj.buildOutline()
|
||||
elif tItem.isFileType():
|
||||
bldObj.setText(tHandle)
|
||||
bldObj.doPreProcessing()
|
||||
bldObj.tokenizeText()
|
||||
bldObj.doHeaders()
|
||||
if self._count:
|
||||
bldObj.countStats()
|
||||
if self._outline:
|
||||
bldObj.buildOutline()
|
||||
if convert:
|
||||
bldObj.doConvert()
|
||||
else:
|
||||
|
||||
@@ -31,7 +31,7 @@ from typing import TYPE_CHECKING
|
||||
from pathlib import Path
|
||||
|
||||
from novelwriter.enum import nwItemLayout, nwItemClass
|
||||
from novelwriter.error import formatException
|
||||
from novelwriter.error import formatException, logException
|
||||
from novelwriter.common import formatTimeStamp, isHandle
|
||||
from novelwriter.core.item import NWItem
|
||||
|
||||
@@ -106,7 +106,28 @@ class NWDocument:
|
||||
return self._item
|
||||
|
||||
##
|
||||
# Class Methods
|
||||
# Static Methods
|
||||
##
|
||||
|
||||
@staticmethod
|
||||
def quickReadText(content: Path, tHandle: str) -> str:
|
||||
"""Return the text of a document in a fast and efficient way."""
|
||||
if (path := content / f"{tHandle}.nwd").is_file():
|
||||
try:
|
||||
with open(path, mode="r", encoding="utf-8") as inFile:
|
||||
line = ""
|
||||
for _ in range(10):
|
||||
if not (line := inFile.readline()).startswith(r"%%~"):
|
||||
break
|
||||
return line + inFile.read()
|
||||
except Exception:
|
||||
logger.error("Cannot read document with handle '%s'", tHandle)
|
||||
logException()
|
||||
return ""
|
||||
return ""
|
||||
|
||||
##
|
||||
# Methods
|
||||
##
|
||||
|
||||
def fileExists(self) -> bool:
|
||||
@@ -155,7 +176,7 @@ class NWDocument:
|
||||
try:
|
||||
with open(docPath, mode="r", encoding="utf-8") as inFile:
|
||||
# Check the first <= 10 lines for metadata
|
||||
for i in range(10):
|
||||
for _ in range(10):
|
||||
line = inFile.readline()
|
||||
if line.startswith(r"%%~"):
|
||||
self._parseMeta(line)
|
||||
|
||||
@@ -3,7 +3,6 @@ novelWriter – Project Index
|
||||
===========================
|
||||
|
||||
File History:
|
||||
Created: 2019-04-22 [0.0.1] countWords
|
||||
Created: 2019-05-27 [0.1.4] NWIndex
|
||||
Created: 2022-05-28 [2.0rc1] IndexItem
|
||||
Created: 2022-05-28 [2.0rc1] IndexHeading
|
||||
@@ -34,13 +33,14 @@ import logging
|
||||
from time import time
|
||||
from typing import TYPE_CHECKING
|
||||
from pathlib import Path
|
||||
from collections.abc import ItemsView, Iterable, Iterator
|
||||
from collections.abc import ItemsView, Iterable
|
||||
|
||||
from novelwriter import SHARED
|
||||
from novelwriter.enum import nwComment, nwItemClass, nwItemType, nwItemLayout
|
||||
from novelwriter.error import logException
|
||||
from novelwriter.common import checkInt, isHandle, isItemClass, isTitleTag, jsonEncode
|
||||
from novelwriter.constants import nwFiles, nwKeyWords, nwRegEx, nwUnicode, nwHeaders
|
||||
from novelwriter.constants import nwFiles, nwKeyWords, nwHeaders
|
||||
from novelwriter.text.counting import standardCounter
|
||||
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
from novelwriter.core.item import NWItem
|
||||
@@ -122,9 +122,8 @@ class NWIndex:
|
||||
self.clearIndex()
|
||||
for nwItem in self._project.tree:
|
||||
if nwItem.isFileType():
|
||||
tHandle = nwItem.itemHandle
|
||||
doc = self._project.storage.getDocument(tHandle)
|
||||
self.scanText(tHandle, doc.readDocument() or "", blockSignal=True)
|
||||
text = self._project.storage.getDocumentText(nwItem.itemHandle)
|
||||
self.scanText(nwItem.itemHandle, text, blockSignal=True)
|
||||
self._indexBroken = False
|
||||
SHARED.indexSignalProxy({"event": "buildIndex"})
|
||||
return
|
||||
@@ -142,17 +141,15 @@ class NWIndex:
|
||||
})
|
||||
return
|
||||
|
||||
def reIndexHandle(self, tHandle: str | None) -> bool:
|
||||
def reIndexHandle(self, tHandle: str | None) -> None:
|
||||
"""Put a file back into the index. This is used when files are
|
||||
moved from the archive or trash folders back into the active
|
||||
project.
|
||||
"""
|
||||
if tHandle and self._project.tree.checkType(tHandle, nwItemType.FILE):
|
||||
logger.debug("Re-indexing item '%s'", tHandle)
|
||||
doc = self._project.storage.getDocument(tHandle)
|
||||
self.scanText(tHandle, doc.readDocument() or "")
|
||||
return True
|
||||
return False
|
||||
self.scanText(tHandle, self._project.storage.getDocumentText(tHandle))
|
||||
return
|
||||
|
||||
def indexChangedSince(self, checkTime: int | float) -> bool:
|
||||
"""Check if the index has changed since a given time."""
|
||||
@@ -266,7 +263,7 @@ class NWIndex:
|
||||
self._itemIndex.add(tHandle, tItem)
|
||||
|
||||
# Run word counter for the whole text
|
||||
cC, wC, pC = countWords(text)
|
||||
cC, wC, pC = standardCounter(text)
|
||||
tItem.setCharCount(cC)
|
||||
tItem.setWordCount(wC)
|
||||
tItem.setParaCount(pC)
|
||||
@@ -307,7 +304,7 @@ class NWIndex:
|
||||
nTitle = 0 # Line Number of the previous title
|
||||
cTitle = TT_NONE # Tag of the current title
|
||||
pTitle = TT_NONE # Tag of the previous title
|
||||
canSetHeader = True # First header has not yet been set
|
||||
canSetHead = True # First heading has not yet been set
|
||||
|
||||
lines = text.splitlines()
|
||||
for n, line in enumerate(lines, start=1):
|
||||
@@ -320,9 +317,9 @@ class NWIndex:
|
||||
if hDepth == "H0":
|
||||
continue
|
||||
|
||||
if canSetHeader:
|
||||
if canSetHead:
|
||||
nwItem.setMainHeading(hDepth)
|
||||
canSetHeader = False
|
||||
canSetHead = False
|
||||
|
||||
cTitle = self._itemIndex.addItemHeading(tHandle, n, hDepth, hText)
|
||||
if cTitle != TT_NONE:
|
||||
@@ -383,7 +380,7 @@ class NWIndex:
|
||||
return
|
||||
|
||||
def _splitHeading(self, line: str) -> tuple[str, str]:
|
||||
"""Split a heading into its header level and text value."""
|
||||
"""Split a heading into its heading level and text value."""
|
||||
if line.startswith("# "):
|
||||
return "H1", line[2:].strip()
|
||||
elif line.startswith("## "):
|
||||
@@ -396,11 +393,13 @@ class NWIndex:
|
||||
return "H1", line[3:].strip()
|
||||
elif line.startswith("##! "):
|
||||
return "H2", line[4:].strip()
|
||||
elif line.startswith("###! "):
|
||||
return "H3", line[5:].strip()
|
||||
return "H0", ""
|
||||
|
||||
def _indexWordCounts(self, tHandle: str, text: str, sTitle: str) -> None:
|
||||
"""Count text stats and save the counts to the index."""
|
||||
cC, wC, pC = countWords(text)
|
||||
cC, wC, pC = standardCounter(text)
|
||||
self._itemIndex.setHeadingCounts(tHandle, sTitle, cC, wC, pC)
|
||||
return
|
||||
|
||||
@@ -515,16 +514,21 @@ class NWIndex:
|
||||
"""Get the index data for a given item."""
|
||||
return self._itemIndex[tHandle]
|
||||
|
||||
def getItemHeader(self, tHandle: str, sTitle: str) -> IndexHeading | None:
|
||||
"""Get the header entry for a specific item and heading."""
|
||||
tItem = self._itemIndex[tHandle]
|
||||
if isinstance(tItem, IndexItem):
|
||||
def getItemHeading(self, tHandle: str, sTitle: str) -> IndexHeading | None:
|
||||
"""Get the heading entry for a specific item and heading."""
|
||||
if tItem := self._itemIndex[tHandle]:
|
||||
return tItem[sTitle]
|
||||
return None
|
||||
|
||||
def iterItemHeadings(self, tHandle: str) -> Iterable[tuple[str, IndexHeading]]:
|
||||
"""Get all headings for a specific item."""
|
||||
if tItem := self._itemIndex[tHandle]:
|
||||
yield from tItem.items()
|
||||
return []
|
||||
|
||||
def novelStructure(
|
||||
self, rootHandle: str | None = None, activeOnly: bool = True
|
||||
) -> Iterator[tuple[str, str, str, IndexHeading]]:
|
||||
) -> Iterable[tuple[str, str, str, IndexHeading]]:
|
||||
"""Iterate over all titles in the novel, in the correct order as
|
||||
they appear in the tree view and in the respective document
|
||||
files, but skipping all note files.
|
||||
@@ -666,7 +670,7 @@ class NWIndex:
|
||||
|
||||
def getTagsData(
|
||||
self, activeOnly: bool = True
|
||||
) -> Iterator[tuple[str, str, str, IndexItem | None, IndexHeading | None]]:
|
||||
) -> Iterable[tuple[str, str, str, IndexItem | None, IndexHeading | None]]:
|
||||
"""Return all known tags."""
|
||||
for tag, data in self._tagsIndex.items():
|
||||
iItem = self._itemIndex[data.get("handle")]
|
||||
@@ -825,7 +829,7 @@ class ItemIndex:
|
||||
class around a single storage dictionary with a set of utility
|
||||
functions for setting and accessing the index data. Each indexed
|
||||
item is stored in an IndexItem object, which again holds an
|
||||
IndexHeading object for each header of the text.
|
||||
IndexHeading object for each heading of the text.
|
||||
"""
|
||||
|
||||
__slots__ = ("_project", "_items")
|
||||
@@ -898,13 +902,11 @@ class ItemIndex:
|
||||
|
||||
if rHandle is None:
|
||||
for sTitle in self._items[tHandle].headings():
|
||||
hItem = self._items[tHandle][sTitle]
|
||||
if hItem:
|
||||
if hItem := self._items[tHandle][sTitle]:
|
||||
yield tHandle, sTitle, hItem
|
||||
elif tItem.itemRoot == rHandle:
|
||||
for sTitle in self._items[tHandle].headings():
|
||||
hItem = self._items[tHandle][sTitle]
|
||||
if hItem:
|
||||
if hItem := self._items[tHandle][sTitle]:
|
||||
yield tHandle, sTitle, hItem
|
||||
|
||||
return
|
||||
@@ -1200,7 +1202,7 @@ class IndexHeading:
|
||||
##
|
||||
|
||||
def setLevel(self, level: str) -> None:
|
||||
"""Set the level of the header if it's a valid value."""
|
||||
"""Set the level of the heading if it's a valid value."""
|
||||
if level in nwHeaders.H_VALID:
|
||||
self._level = level
|
||||
return
|
||||
@@ -1315,86 +1317,3 @@ def processComment(text: str) -> tuple[nwComment, str, int]:
|
||||
if content and (clean := classifier.strip().lower()) in CLASSIFIERS:
|
||||
return CLASSIFIERS[clean], content.strip(), text.find(":") + 1
|
||||
return nwComment.PLAIN, check, 0
|
||||
|
||||
|
||||
def countWords(text: str) -> tuple[int, int, int]:
|
||||
"""Count words in a piece of text, skipping special syntax and
|
||||
comments.
|
||||
"""
|
||||
charCount = 0
|
||||
wordCount = 0
|
||||
paraCount = 0
|
||||
prevEmpty = True
|
||||
|
||||
if not isinstance(text, str):
|
||||
return charCount, wordCount, paraCount
|
||||
|
||||
# We need to treat dashes as word separators for counting words.
|
||||
# The check+replace approach is much faster than direct replace for
|
||||
# large texts, and a bit slower for small texts, but in the latter
|
||||
# case it doesn't really matter.
|
||||
if nwUnicode.U_ENDASH in text:
|
||||
text = text.replace(nwUnicode.U_ENDASH, " ")
|
||||
if nwUnicode.U_EMDASH in text:
|
||||
text = text.replace(nwUnicode.U_EMDASH, " ")
|
||||
|
||||
# Strip shortcodes
|
||||
if "[" in text:
|
||||
text = nwRegEx.RX_SC.sub("", text)
|
||||
|
||||
for line in text.splitlines():
|
||||
|
||||
countPara = True
|
||||
|
||||
if not line:
|
||||
prevEmpty = True
|
||||
continue
|
||||
|
||||
if line[0] == "@" or line[0] == "%":
|
||||
continue
|
||||
|
||||
if line[0] == "[":
|
||||
check = line.lower()
|
||||
if check.startswith(("[newpage]", "[new page]", "[vspace]")):
|
||||
continue
|
||||
elif check.startswith("[vspace:") and line.endswith("]"):
|
||||
continue
|
||||
|
||||
elif line[0] == "#":
|
||||
if line[:5] == "#### ":
|
||||
line = line[5:]
|
||||
countPara = False
|
||||
elif line[:4] == "### ":
|
||||
line = line[4:]
|
||||
countPara = False
|
||||
elif line[:3] == "## ":
|
||||
line = line[3:]
|
||||
countPara = False
|
||||
elif line[:2] == "# ":
|
||||
line = line[2:]
|
||||
countPara = False
|
||||
elif line[:3] == "#! ":
|
||||
line = line[3:]
|
||||
countPara = False
|
||||
elif line[:4] == "##! ":
|
||||
line = line[4:]
|
||||
countPara = False
|
||||
|
||||
elif line[0] == ">" or line[-1] == "<":
|
||||
if line[:2] == ">>":
|
||||
line = line[2:].lstrip(" ")
|
||||
elif line[:1] == ">":
|
||||
line = line[1:].lstrip(" ")
|
||||
if line[-2:] == "<<":
|
||||
line = line[:-2].rstrip(" ")
|
||||
elif line[-1:] == "<":
|
||||
line = line[:-1].rstrip(" ")
|
||||
|
||||
wordCount += len(line.split())
|
||||
charCount += len(line)
|
||||
if countPara and prevEmpty:
|
||||
paraCount += 1
|
||||
|
||||
prevEmpty = not countPara
|
||||
|
||||
return charCount, wordCount, paraCount
|
||||
|
||||