Updated the remaining sections of the docs

This commit is contained in:
Veronica K. B. Olsen
2021-01-01 19:44:17 +01:00
parent 92f44f0aaa
commit 8ad2da30ca
5 changed files with 200 additions and 173 deletions
+26 -23
View File
@@ -10,11 +10,11 @@ This section contains details of how novelWriter stores and handles the project
How Data is Stored
==================
All novelWriter files are written with utf-8 encoding. Since Python automatically converts Unix line
endings to Windows line endings on Windows systems, novelWriter does not make any adaptations to the
formatting on Windows systems. This is handled entirely by the Python standard library. Python also
handles this fairly well when working on the same files on both Windows and Unix-based operating
systems.
All novelWriter files are written with utf-8 encoding. Since Python automatically converts Unix
line endings to Windows line endings on Windows systems, novelWriter does not make any adaptations
to the formatting on Windows systems. This is handled entirely by the Python standard library.
Python also handles this fairly well when working on the same files on both Windows and Unix-based
operating systems.
Main Project File
@@ -44,29 +44,31 @@ Project Documents
The project documents are saved in a folder in the main project folder named ``content``. Each
document has a file handle taken from the first 13 characters of a SHA256 hash of the system time
when the file was first created. The documents are saved with a filename assembled from this hash
and the file extension ``.nwd``.
when the document was first created. The documents are saved with a filename assembled from this
hash and the file extension ``.nwd``.
If you wish to find the physical location of a file 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, or look in the ``ToC.txt`` file in the root of the project folder.
If you wish to find the physical 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, or look in the ``ToC.txt`` file in the root of the project folder.
The ``ToC.txt`` file has a list of all document files in the project 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
what the user names the files, or changes it to. The file meta data in the tree view, except the
file label, is only saved in the project XML file.
what the user names the document within the project, or changes it to. The file meta data in the
project tree is mainly saved in the project XML file, although some basic meta data is added to the
header of each document file.
Each document file contains a plain text version of the text from the editor. The file can in
principle be edited in any text editor, and is suitable for diffing and version control if so
desired. Just make sure the file remains in utf-8 encoding, otherwise unicode chatracters may become
mangled when the file is opened in novelWriter again.
desired. Just make sure the file remains in utf-8 encoding, otherwise unicode chatracters may
become mangled when the file is opened in novelWriter again.
The first line of the file contains some meta data starting with the characters ``%%~``. This line
is mainly there to restore some information if it is lost from the project file, and the information
may be helpful if you do open the file in an external editor as it contains the file label as the
last entry. The line can be deleted without any consequences to the rest of the content of the file,
and will be added back the next time the file is saved in novelWriter.
The first lines of the file may contain some meta data starting with the characters ``%%~``. These
lines are mainly there to restore some information if it is lost from the project file, and the
information may be helpful if you do open the file in an external editor as it contains the
document label and the document class and layout. The lines can be deleted without any consequences
to the rest of the content of the file, and will be added back the next time the document is saved
in novelWriter.
The File Saving Process
@@ -75,8 +77,9 @@ The File Saving Process
When saving the project file, or any of the documents, the data is first saved to a temporary file.
If successful, the old data file is removed, and the temporary file becomes the new file. This
ensures that the previously saved data is only replaced when the new data has been successfully
saved.
saved to the storage medium.
For the project XML file, a ``.bak`` file is kept which will always contain the previous version of
the file, although when auto-save is enabled, they may have the same content. If the opening of a
project file fails, novelWriter will automatically try to open the ``.bak`` file instead.
For the project XML file, a ``.bak`` file is in addition kept, which will always contain the
previous version of the file, although when auto-save is enabled, they may have the same content.
If the opening of a project file fails, novelWriter will automatically try to open the ``.bak``
file instead.