Add a top level widget that contains the entire Outline View.
Move the details panel code to the outline.py file.
Add a toolbar to the top of the Outline view with a dropdown box to select which Novel folder to view.
Add a refresh button to the tool bar.
Move the context menu for changing columns to a menu button on the tool bar.
Remove the Rebuild Outline and Auto-Update Outline options from the main menu.
Rewrites the index class to use objects rather than dictionaries to store indexing information.
Moves the index instance into the main project class instead of the main GUI object.
Makes the project tree and project options classes private to the project class.
* Downgrade rebuild index dialog from warning to info
* Don't flag index as broken if file is missing, just add it again
* Fix log warning
* Drop the return value in the index checker
* Put the status icons in the status object itself
* Allow saving both status and importance values
* Update current tests
* Improve test coverage
* Update sample project file
* Make sure the search loop in the editor cannot run infinitely
* Add test coverage of infinite search case
* Run GitHub actions against the patch branch
* Drop support for Python 3.6
* Remove unused time parsing function
* Use Python 3.7 datetime function for writing stats data conversion
* Test against Python 3.10 on macOS and Windows
* Update the item class with more compact item storage format
* Bump version and file version
* Update tests
* Add explicit test coverage for format conversions for item class
* Update the documentation
* Make sure user-defined themes folders exist in the data path
* Minor cleanup in shortcuts table
* Add details in docs on how to customise GUI and add dictionaries
* Add spell check reference in docs overview
* Change documentation theme to 'furo'
* Update docs source for new theme
* Update index and split introduction
* Add a Getting Started section to the docs
* Rename getting started docs file
* Reorganise setup instructions
* Update usage sections for consistency
* Update docs references in main README
* Show release in sidebar
* Add a package builder for windows install
* Remove old win installer build
* Update setup instructions
* Some minor clarifications to docs and README
* Add try/except to document replace call
* Try the os.replace command 5 times
* Just use else condition on for loop instead
* Make the exceptions explicitly OSError
* Revert the os.replace loop, as this is not the issue
* Remove all statustip entries in the menu
* Prune text in Preferences
* Fix class labels
* Remove some redundant tooltips
* Improve some labels and dialogs
* Remove some more tooltips and fix a typo
* Update base ts file
* Fix typo
* Make some minor translation fixes
* Remove crowdin file and add import function for crowdin zip file
* Rename fallback project lang file to en_GB
* Update all i18n files from crowdin exports
* Fix tests
* Update docs
* Fix bug breaking HTML rendering with angle brackets in other blocks than normal text
* Restore cursor if document viewer fails to load
* Improve test coverage
* Restore colours to dark theme search-replace icon
* Implement a working search result counter
* Disable scroll past end feature and clean up search/replace and update test
* Re-implement scroll past end feature as a static distance
* Stop the search box from resizing on every search
* Better handling of Enter/Return on GUI trees, resolves#913
* Update test
* Generalise open selected handle functions
* Improve test coverage
* Update docstring
* Improve the NWIndex class
* Improve the NWItem and NWDoc classes
* Make some optimisations in projects and update tests
* Minor changes to string formatting in main source file
* Add some more protection to core classes
* Make all converter class attributes private
* Move int range checkers from options class to common file
* Improve error handling and reporting
* Make some minor improvements to init and test suite
* Fix 'trypewriter' to 'typewriter' typo
* Remove menu path description in dialog help text
* Improve the help text for entries in the Format menu
* Reword a couple of dialog messages
* Improve i18n readme.
* Make some minor clarifications and reformatting of the i18n readme file
Co-authored-by: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com>
* Remove page break from title and always allow for partition and chapter
* Move strip of format string into the Tokenizer class
* Fix page breaks in HTML for skip and sep
* Update documentation
* Update tests
* Allow page breaks before scene and section headers
* Never hide the scene header and instead default to skip line
* Fix wrapping of setup help text
* Fix wrong info in help description in setup
* Drop .pro file and generate lupdate arguments on the fly
* Generate lrelease arguments on the fly
* Update i18n readme file
* Fix bug in translation source list and restore lost translations
* Fix shift focus to novel tree on Alt+1 when visible
* Bump version and update changelog and release notes
* Fix bug in early error reporting in main init
* Update docstrings and optimise code in GuiMain
* Update docstrings and optimise code in Config
* Update docstrings and optimise code in common module
* Update docstrings and optimise code in main project classes
* Update the OptionState class
* Update the spell checker class
* Update the file converter classes and extend tests
* Update the about, merge, split and item editor classes and extend tests
* Update item editor test
* Update about dialog tests
* Some minor test cleanup
* Fix typo and add clarification in contributing guide
* Drop the subfolders for GUI themes
* Remove bundled font support
* Add safe file read function
* Allow loading themes from multiple locations
* Clean up unused variables
* Clean up icons class
* Merge icon theme icons
* Update icon theme class
* Remove guiDark config setting
* Fix tests
* Fix handling of default theme
* Update icon readmes
* Add test for getGuiItem common function
* Add sha256sum function
* Add hash check to document class
* Make sha256sum test more thorough
* Handle exceptions in the sha256sum function directly
* Update test coverage
* Clarify title on dialog box
* Don't write blank lines in makeAlert
* Fix some inconsistencies in source file docstrings
* Remove the option to show status text in project tree
* Change how total word counts are calculated and propagated
* Fix tests and improve coverage
* Add setting in preferences
* Add missing word count timer to config file
* Clean up a few things in various setup function
* Add Launchpad-related setting to Debian build function
* Add signature feature to package builder and fix error in debian/copyright
* Update documentation
* Update README
* Fix transparency on some of the icons
* Rewrite the setup clean command
* Clean up setup script and remove no longer needed qthelp command
* Add bash scripts for common make build chains
* Update the description files and change how setup writes generated files
* Reduce the number of setup files added to minimal zip packages
* Delete simple spell checker
* Clean up the spell checker code
* Update tests
* Delete the bundled dictionaries
* Update documentation
* Use set() for user word list
* Fix tests so they pass also without dictionaries installed
* Rename nw folder to novelwriter
* Rename nw to novelwriter in auxiliary files
* Rename nw to novelwriter in main app source
* Rename nw to novelwriter in tests
* Make setup script for pdf docs less spammy
* Link to stable docs for stable release, otherwise latest docs
* Add build command to setup for making HTML docs
* Change the documentation menu entry to open either online or local HTML
* Update docs build instructions in docs
* Improve format menu header descriptions
* Ensure that item status is parsed after item class from XML
* Fix column alignment in ToC.txt file
* Rename test variable and fix outdated docstring
* Fix ToC.txt underline
* Rename the Layout label on the item details panel
* Add option to emphasise H1 and H2 labels in the project tree
* Rename the main column of the novel tree to match project tree
* Use the same document icons in the outline as the project tree
* Move project tree settings to Project section of config file
* Add documentation of the various project file formats
* Add an info box for updating to project format 1.3
* Add information on how to access the documentation
* Add a note on file format and rename a few things
* Fix some typos
* Rename index textCounts to fileMeta and add main header level
* Add new icons for document layouts
* Add function in NWItem to describe the item
* Use the icons and description in the project tree and details panel
* Remove flags column and add status column with optional full text
* Update handling and display of header level in editor
* Fix potential bug in project tree
* Update tests
* Fix issue with additional line breaks in ODT export
* Improve format handling in ToOdt, and remove some unused code
* Add test for tab in format
* Add class to write text formats to XML
* Simplify the XMLParagraph class a bit
* Correct a breach of ODT standard and add error checking
* Make some final corrections
* Merge novel layouts and simplify the Tokenizer class
* Fix core tests
* Delete auto-layout code
* Remove no longer needed item layouts
* Remove references to deleted item layouts in test
* Make some minor changes to Tokenizer class and update tests
* Update test reference files
* Update sample project
* Fix a few issues with the Tokenizer
* Centre some text in the sample documents
* Make some minor changes to how new projects are generated
* Add support for New Page and VSpace commands to the Tokenizer
* Remove Title and Page layouts and add codes for page break and vertical space
* Add document layout and fix some issues in index class with new title formats
* Update tests and reference files
* Bump the project file version and fix a minor issue in items class
* Update tests and test coverage
* Clean up some warnings and issues in tests
* Improve the index keyword checker function
* Implement a more compact indented JSON encoder
* Remove timestamp from reference, novel and note indices
* Remove empty entries in reference index
* Merge novel and note indices into a single file index
* Subclass ConfigParser
* Remove redundant variables and update tests
* Update file description
* Move NWConfigParser class to common.py
* Improve coverage of config class
* Use NWConfigParser also in themes.py
* Update config class file header
* Fix comment
* Update the usage of ConfigParser to recommended practice and extend tests
* Improve logging for info level a bit
* Drop the _qDocument class variables
* Split up the current doceditor test file
* Add tests for editor init, load and save
* Add tests for editor meta functions and actions
* Add tests for editor insert functions
* Add tests for editor text manipulation and block formatting
* Fix code style
* Add text coverage for alignment and indent
* Update instructions and readmes
* Cleanup in base files
* Cleanup in core files
* Cleanup in gui files
* Cleanup in dialog files
* Cleanup in tools files
* Cleanup in test files
* Change the way logger messages are generated by using the printf-like method
* Use single quotes around log values that can be empty strings
* Fix bug in log message
* add translator's name in about dialog
* add new CN.ts
* Update nw_zh_CN.ts
* inital version (CN)
* add project_zh_CN.json
* Update project_zh_CN.json
* Revert changes to otherlanguage files
* Change case of first character in 'novelWriter' in Chinese translation
* Update about.py
Change the entry "Simplified Chinese" from English the local name of the language
Co-authored-by: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com>
novelWriter is a markdown-like text editor designed for writing novels and larger projects of many smaller plain text documents.
It uses its own flavour of markdown that supports a meta data syntax for comments, synopsis and cross-referencing between files.
The idea is to have a simple text editor which allows for easy organisation of text files and notes, built on a plain text file project repository for robustness.
The plain text storage is suitable for version control software, and also well suited for file synchronisation tools.
The core project structure is stored in a project XML file.
No new major features will be added at this time, until the application is stable.
Until then, novelWriter is in a beta state.
Please report any issues you may encounter in the repository issue tracker.
You should be able to use novelWriter for real projects, but as with all software, please make regular backups.
There is a built in backup feature that can pack the entire project into a zip file on close.
Please check the documentation for further details.
## License
This is Open Source software, and novelWriter is licensed under GPLv3.
See the [GNU General Public License website](https://www.gnu.org/licenses/gpl-3.0.en.html) for more details, or consult the [LICENSE](LICENSE.md) file.
Bundled assets have the following licenses:
* The Typicon-based icon themes by Stephen Hutchings are licensed under [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/). The icons have been altered in size and colour for use with novelWriter, and some additional icons added. The original icon set is available at [stephenhutchings/typicons.font](https://github.com/stephenhutchings/typicons.font).
* The Cantarell font by Dave Crossland is licensed under [OPEN FONT LICENSE Version 1.1](http://scripts.sil.org/OFL). It is available at [Google Fonts](https://fonts.google.com/specimen/Cantarell).
* The Tomorrow syntax themes use colour schemes taken from Chris Kempson's collection of code editor themes, licensed with the [MIT License](https://github.com/chriskempson/tomorrow-theme/blob/master/LICENSE.md), and the main repo is available at [chriskempson/tomorrow-theme](https://github.com/chriskempson/tomorrow-theme).
* Likewise, the Owl syntax themes use colours from Sarah Drasner's code editor themes, licensed with the [MIT License](https://github.com/sdras/night-owl-vscode-theme/blob/master/LICENSE), and the main repo is available at [sdras/night-owl-vscode-theme](https://github.com/sdras/night-owl-vscode-theme).
## Markdown Flavour
novelWriter is **not** a full-feature Markdown editor.
It allows for a minimal set of formatting needed for writing text documents for novels.
These are currently limited to:
* Headings level 1 to 4 using the `#` syntax only.
* Emphasised, strongly emphasised, and very strongly emphasised text. These are rendered as italicised, bold, and bold italicised text, respectively.
* Strikethrough text.
* Hard line breaks using two or more spaces at the end of a line.
That is it.
Features not supported in the editor are also not exported when using the export tool.
In addition, novelWriter adds the following, which is otherwise not supported by Markdown:
* A line starting with `%` is treated as a comment and not rendered on exports unless requested.
Comments do not count towards the word count.
* A set of meta data keyword/value sets starting with the character `@`.
This is used for tagging and inter-linking documents.
* Non-breaking spaces are supported as long as your system is using at least Qt 5.9.
For earlier version, non-breaking spaces are converted to normal spaces when saving the document.
This is done by the Qt library.
From Qt 5.9 and on, it is possible to extract the raw text from a document, which preserves non-breaking spaces.
* Tabs may be rendered, depending on export format.
With Qt 5.10 or higher, the width of a tab in pixels can be changed in Preferences.
The core export format of novelWriter is HTML5.
You can also export the entire project as a single novelWriter flavour document.
In addition, other exports to Open Document, PDF, and plain text is offered through the Qt library, although with limitations to formatting.
Even though novelWriter can export to Open Document, the result is actually better when using the HTML output and then importing the HTML document into for instance Libre Office.
The HTML output is also suitable for conversion with tools like Pandoc.
You can also follow novelWriter on Mastodon at [fosstodon.org/@novelwriter](https://fosstodon.org/@novelwriter).
## Implementation
The application is written in Python3 using Qt5 via PyQt5.
It is developed on Linux, but it should in principle work fine on other operating systems as well as long as dependencies are met.
It is regularly tested on Windows 10.
The application is written with Python3 (3.7+) using Qt5 and PyQt5 (5.10+). It is developed on
Linux, but should in principle work fine on other operating systems as well as long as dependencies
are met. It is regularly tested on Debian and Ubuntu Linux, Windows, and macOS.
The application can be started from the source folder with one of the commands:
```
./novelWriter.py
python novelWriter.py
python3 novelWriter.py
```
## Installation
It also takes a few parameters for debugging and such, which can be listed with the switch `--help`.
### Linux Mint, Ubuntu and Debian
In the root assets folder there are icons and scripts and a template for setting up a launcher on Gnome desktops.
You may need to modify those scripts slightly, but as they are, they work on Debian and Ubuntu.
For other operating systems, please consult your operating system documentation for how to make those.
Feel free to submit more if you are able to make them.
The Releases page has a `.deb` package that should install on Mint, Ubuntu and Debian.
You can also use the novelWriter [PPA](https://launchpad.net/~vkbo/+archive/ubuntu/novelwriter).
For more details, check the [Getting Started](https://novelwriter.readthedocs.io/en/latest/int_started.html)
section in the documentation.
## Package Dependencies
### Windows 10+
It is recommended that novelWriter runs with Qt 5.10 or later, and Python 3.6 or later.
Running with Qt as low as 5.2.1 and Python 3.4.3 has been tested, and worked in the past, but there are no guarantees that this will keep working as these are not a part of the test builds.
The Release page has a `setup.exe` file for Windows 10, that should also work on other Windows
versions. The installer includes Python 3.10 and the library dependencies.
For the apt package manager on Debian systems, the following Python3 packages are needed:
### Other Install Options
*`python3-pyqt5` for the GUI
*`python3-pyqt5.qtsvg` may need to be installed separately
*`python3-lxml` for writing project files
You can also download and install one of the minimal zip files from the
[Releases](https://github.com/vkbo/novelWriter/releases) page or the
You can also do them one at a time, skipping the ones you don't need:
```
pip install pyqt5
pip install lxml
pip install pyenchant
```
### Translations
PyQt/Qt should be at least 5.3, but ideally 5.10 or higher for nearly all features to work.
Exporting to markdown requires PyQt/Qt 5.14.
There are no known minimum for lxml, but the code was originally written with 4.2.
The optional spell check library must be at least 3.0.0 to work with Windows.
On Linux, 2.0.0 also works fine.
New translations are always welcome. This project uses Crowdin to maintain translations, and you
can contribute translations at the [Crowdin project page](https://crowdin.com/project/novelwriter).
If you have any questions, feel free to post them to the
[Translations of novelWriter](https://github.com/vkbo/novelWriter/issues/93) issue thread.
If no external spell checking tool is installed, novelWriter will use a basic spell checker based on standard Python package `difflib`.
Currently, only English dictionaries are available for this spell checker, but more can be added to the `nw/assets/dict` folder.
See the [nw/assets/dict/README.md](README.md) file in that folder for how to generate more dictionaries.
Note that the difflib-based option is both slow and limited.
Note: On Windows, make sure Python3 is in your PATH if you want to launch novelWriter from command line.
You can also right click the `novelWriter.py` file, create a shortcut, then right click again, select "Properties" and change the target to your python executable and `novelWriter.py`.
You can also export the entire project as a single novelWriter-markup document. These can later be
imported again into novelWriter. In addition, printing and export to PDF is offered through the Qt
library, although with limitations to formatting.
### Colour Themes
The editor has syntax highlighting for the features it supports, and includes a set of different syntax highlighting themes.
The GUI also has an optional dark theme in addition to the default system theme.
Note that the dark theme may not render all elements of the GUI as dark colours if you are running an early version of Qt5.
This is not due to a bug in novelWriter, but due to the fact that the the styling options in the Qt API in some versions were incomplete.
New themes can easily be added to the `nw/assets/themes` folder.
Have a look in the existing folders for examples of how to define the colours.
### Auto-Saving and Document Stats
Open documents and the project file itself is saved regularly on a timer.
The status of this is indicated by two indicators on the right hand side of the status bar.
Unsaved changes are in yellow, and saved is indicated by green in the default theme.
Latest word count for the document and project is shown next to these indicators in the status bar.
The counts are updated regularly, but not as-you-type.
The editor has syntax highlighting for the features it supports, and includes a set of different
syntax highlighting themes. Optional GUI themes are also available, including dark themes.
### Easy Organising of Project Files
The structure of the project is shown on the left hand side of the main GUI.
Project files are organised into root folders, indicating what class of file they are.
The most important root folder is the Novel folder, which contains all of the files that makes up the finished novel.
Each root folder can have subfolders.
Folders have no impact on the project structure, they are purely tools for organising the files in whatever way the user needs.
The structure of the project is shown on the left hand side of the main window. Project files are
organised into root folders, indicating what class of file they are. The most important root folder
is the `Novel` folder, which contains all of the files that make up the novel itself. Each root
folder can have subfolders. Subfolders have no impact on the final project structure, they are
there for you to organise your files in whatever way you want.
The editor supports four levels of headings, which determines what level the following text belongs to.
Headings of level one signify a book or partition title.
Headings of level two signify the start of a new chapter.
Headings of level three signify the start of a new scene.
Headings of level four can be used internally in each scene to separate sections.
The editor supports four levels of headings, which determine what level the following text belongs
to. Headings of level one signify a book or partition title. Headings of level two signify the
start of a new chapter. Headings of level three signify the start of a new scene. Headings of level
four can be used internally in each scene to create separate sections.
Each novel file can be assigned a layout format, which shows up as a flag next to the item in the project tree.
These are mostly to help the user see what they contain, but they also have some impact on the format of the exported document.
See the documentation for further details.
See the [documentation](https://novelwriter.readthedocs.io) for further details.
#### Project Notes
### Project Notes
Supporting note files can be added for the story plot, characters, locations, story timeline, etc.
These have their separate root folders.
These are optional files.
Supporting notes can be added for the story plot, characters, locations, story timeline, etc. These
have their separate root folders and are optional to use.
### Visualisation of Story Elements
The different notes can be assigned tags, which other files can refer back to using special meta keywords.
This information can be used to display an outline of the story, showing where each scene connects to the plot, and which characters, etc. occur in them.
In addition, the tags themselves are clickable in the document view pane, and control-clickable in the editor.
They make it possible to quickly navigate between the documents while editing.
The different notes can be assigned tags, which other files can refer back to using `@`-prefixed
meta keywords. This information can be used to display an outline of the story, showing where each
scene connects to the plot, and which characters, etc. occur in them. In addition, the tags
themselves are clickable in the document view pane, and control-clickable in the editor. They make
it possible to quickly navigate between the documents while writing.
## Contribution
## Installing or Running from Source
If you want to contribute to novelWriter, please follow the coding convention laid out in the [Style Guide](docs/markdown/style.md).
They broadly follow Python PEP8, but there are a few modifications.
If you want to run novelWriter directly from the source code, you must run the `novelWriter.py`
file from command line.
## Screenshot
Dependencies can generally be installed from PyPi with:
```bash
pip install -r requirements.txt
```
On Linux, the dependencies are generally available in the standard package repository.
For more details on running or installing from source, see
The source code of novelWriter broadly follows the style guide [PEP8](https://www.python.org/dev/peps/pep-0008/), but with a few modifications and exceptions.
### Source Code Exceptions
* Methods are camelCase, not underscore based.
The reason is partially because of the maintainers personal preference, and partially because that is what Qt5 and PyQt5 uses.
The maintainer generally, across multiple programming languages, uses underscores for defining namespaces.
* The maximum length of a code line is 99 characters, not 79.
The reason for this is that novelWriter is almost entirely made up of classes, meaning nearly all lines of code already have 8 leading spaces.
A 79 character limitation is too strict, and causes too many wrapped lines.
99 characters is suitable for GitHub diff readability, and therefore the preferred limit.
It is also permitted under PEP8 as the maximum.
Comments and docstrings should comply with the 72 character limit.
* Aligning code with additional spaces is acceptable in those cases where it improves readability.
Otherwise, the PEP8 standard should be applied.
### Documentation
The documentation does not adhere to the 80 character limit either.
The standard used in documentation is one line break after each sentence.
This is an alternative style that greatly improves readability of diffs as re-wrapping text is not needed when inserting new text in paragraphs.
Instead, the diff will show changes to each sentence.
The novelWriter project can be exported in various formats using the build tool available from :menuselection:`Project --> Build Project` or by pressing :kbd:`F5`.
*****************
Header Formatting
*****************
The titles for the four levels of story structure can be formatted collectively in the export tool.
This is done through a series of keyword–replace steps.
The keyword ``%title%`` will always be replaced by the text you put after the ``#`` characters in your document.
The keywords ``%ch%`` and ``%chw%`` is replaced by a number, or a number word, respectively.
The number is incremented by one each time the build tool sees a new heading of level two in a file with layout "Chapter".
If the file has layout "Unnumbered", the counter is *not* incremented.
The latter is useful for for instance Prologue and Epilogue chapters.
Likewise, the keywords ``%sc%`` and ``%sca%`` are number counters for scene files.
These are incremented each time a heading of level three is encountered.
The former keyword is reset to one for each new chapter, while the latter is not reset but counts from first scene encountered in the project.
If you want to insert a line break in your title format, add two backslashes ``\\``.
..note::
Header formatting only applies to novel files.
Headings in note files will will be left as-is, but heading levels 1 through 4 are converted to the correct heading level in the respective output formats.
****************
Scene Separators
****************
If you don't want any titles for your scenes (and for your sections if you have them), you can leave the boxes empty, and an empty paragraph will be inserted between the scenes or sections instead.
Alternatively, if you want a separator between them, like the common "\*\*\*", you can also enter that in the box.
In fact, if the format is a piece of static text, it will always be treated as a separator.
**************
File Selection
**************
Which files are selected for export can be controlled from the options on the left side of the dialog window.
The switch for "Include novel files" will select any file that isn't classified as a note.
That is, files with layout "Book", "Page", "Partition", "Chapet", "Unnumbered", or "Scene".
The switch for "Include note files" will select any file that is a note.
That is, files with layout "Note".
This is allows for exporting just the novel, just your notes, or both, as you see fit.
In addition, you can select to export the synopsis comments, regular comments, keywords, and even exclude the body text itself.
If you for instance want to export a document with an outline of the novel, you can enable keywords and synopsis export and disable body text, thus getting a document with each heading followed by the tags and references and the synopsis.
If you need to exclude specific files from your exports, like draft files or files you want to take out of your build, but don't want to delete, you can uncheck the "Include when building project" option for each file in the project tree.
An included file has a checkmark after the status icon in the "Flags" column.
The "Build Novel Project" tool has a switch to ignore this flag if you need to collectively override these settings.
**************
Export Formats
**************
Currently, six formats are supported for exporting.
OpenDocument Format
===================
This is produces an open document ``.odt`` file.
The document produced has very little formatting, and may require further editing afterwards.
For a better formatted office document, you may get a better result with exporting to HTML and the import that HTML document in your office word processor.
PDF Format
==========
The PDF export is just a shortcut for print to file.
novelWriter HTML
================
The HTML export format writes a single ``.htm`` file with minimal style formatting.
The exported HTML file is suitable for further processing by document conversion tools like Pandoc, for importing in word processors, or for printing from browser.
novelWriter Markdown
====================
This is simply a concatenation of the files selected by the filters.
The files in the project are stacked together in the order they appear in the tree view, with comments, tags, etc. included if they are selected.
This is a useful format for exporting the project for later import back into novelWriter.
Standard Markdown
=================
If you have Qt 5.14 or higher, the option to export to plain Markdown is available.
This feature uses Qt's own Markdown export feature.
Plain Text
==========
The plain text export format writes a simple ``.txt`` file without any formatting at all.
*************************
Additional Export Options
*************************
In addition to the above document formats, the novelWriter HTML and Markdown formats can also be wrapped in a JSON file.
The files will have a meta data entry and a body entry.
For HTML, also the accompanying css styles are exported.
The text body is saved in a two-level list.
The outer list contains one entry per exported file, in the order they appear in the project tree.
Each file is then split up into a lst as well, with one entry per line.
These files are mainly intended for scripted post-processing for those who want that option.
A JSON file can be imported directly into a Python dict object or a PHP array, to mentions a few options.
The user interface is kept as simple as possible to avoid distractions when writing.
The main window contains a tree view pane with the entire structure of the project, and a small details panel below it to display additional information about the currently selected item.
Edit View
=========
Editing a document can be done by either double-clicking on it, or hitting the return key when a file is selected.
This will open the document editor, which uses a simplified markdown format, described in the section below.
The document currently being edited can also be viewed in parallel in a right hand side view pane.
To view a document, simply press :kbd:`Ctrl-R`, or select a file and go to :menuselection:`Document --> View Document` in the menu.
The document viewed does not need to be the same document currently being edited.
If you are viewing the same document as the one you're editing, pressing :kbd:`Ctrl-R` again will update the document with your last changes.
References to tags can be opened in the view pane from the document editor by moving the cursor to a reference to a tag and hitting :kbd:`Ctrl-Enter`.
In the view panel, the references become clickable links, and the "Referenced By" panel at the bottom will show links to all documents referring back to it.
..note::
The "Referenced By" panel relies on an up-to-date index of the project.
If anything is missing, or seems wrong, the index can always be rebuilt from :menuselection:`Tools --> Rebuild Index` or by pressing :kbd:`F9`.
Both the document editor and the viewer will show the label of the document as set in the Project Tree.
Optionally, the full project path to the file can be shown.
This can be set the Preferences.
Clicking on the document title bar will select and reveal the file in the Project Tree, making it easier to find the project location of the file in a large project.
Markdown Format
===============
The document editor uses a simplified markdown format.
That is, it supports basic formatting like emphasis (italic), strong emphasis (bold) and strikethrough text, as well as four levels of headings.
It is commonly recommended style to differentiate between strong emphasis and emphasis by using ``**`` for strong emphasis and ``_`` for emphasis, although Markdown generally supports also ``__`` for strong emphasis and ``*`` fdr emphasis.
However, since the differentiation makes the highlighting and conversion significantly simpler and faster, in novelWriter this is a rule, not just a recommendation.
In addition to these standard markdown features, the editor also allows for comments, that is text that is ignored by the word counter and not exported or, optionally, hidden in the document viewer.
If the first word of a comment is "Synopsis:" (with the colon), the comment is treated specially, and will show up in the Outline View.
The editor also has a minimal set of keywords used for setting tags and references between files.
..csv-table:: Formatting Syntax
:header:"Format", "Description"
:widths:15, 50
"``# Title``", "Heading level one. The space after the # is mandatory."
"``## Title``", "Heading level two. The space after the # is mandatory."
"``### Title``", "Heading level three. The space after the # is mandatory."
"``#### Title``", "Heading level four. The space after the # is mandatory."
"``_text_``", "The text is rendered as emphasised text (italicised)."
"``**text**``", "The text is rendered as strongly emphasised text (bold)."
"``~~text~~``", "Strikethrough text."
"``% text...``", "A comment. The text is not exported by default, seen in viewer, or counted towards word counts."
"``% Synopsis: text...``", "A synopsis comment. Shows up in the Synopsis column of the Outline View, but is otherwise treated as a comment."
"``@keyword: value``", "A keyword argument followed by a value, or a comma separated list of values."
Some additional rules:
1. The emphasis and strikethrough formatting tags do not allow spaces between the words and the tag itself.
That is, ``**text**`` is valid, ``**text **`` is not.
2. More generally, the delimiters must be on the outer edge of words.
That is, ``some **text in bold** here`` is valid, ``some** text in bold** here`` is not.
3. If using both ``**`` and ``_`` to wrap the same text, the underscore must be the inner wrapper.
This is due to the underscore also being a valid word character, so if they are on the outside, they violate rule 2.
The editor and viewer also supports markdown standard hard line breaks, and preserves non-breaking spaces.
A hard line break is achieved by leaving two or more spaces at the end of the line.
Alternatively, the user can press :kbd:`Ctrl-K, Return` to insert this.
A non-breaking space is inserted with :kbd:`Ctrl-K, Space`.
Thin spaces are also supported, and can be inserted with :kbd:`Ctrl-K, Shift-Space`, and the non-breaking version of it with :kbd:`Ctrl-K, Ctrl-Space`.
Both hard line breaks and non-breaking spaces are highlighted by the syntax highlighter as an alternate coloured background, depending on the selected theme.
Project Outline View
====================
The Project Outline View is available as the second tab on the right hand side of the main window marked "Outline".
The Outline View 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.
Various meta data and information extracted from tags can be displayed in columns in the Outline View.
To turn on or off specific columns, right click the header and select the columns you want to show.
The order of the columns can be rearranged by dragging them to a different position.
..note::
The "Title" columns cannot be disabled or moved.
The information viewed in teh Outline View is based on the Project Index.
While novelWriter does its best to keep the index up-to-date when content changes, you can always rebuild it manually by pressing :kbd:`F9`.
The Outline View itself can be regenerated by pressing :kbd:`F10`.
You can also enable automatic updating in the :menuselection:`Tools` menu, which will trigger an update whenever the index is updated.
You may want to disable this feature if your project is very large,
Synopsis Feature
================
The "Synopsis" column of the Outline View takes its information from a specially formatted comment.
In order to flag a comment as a Synopsis, add the word "Synopsis:" as the first word of the comment.
The ":" is required, and "synopsis" is not case sensitive.
If it is correctly formatted, the syntax highlighter will indicate this by altering the colour of the word.
..note::
Only one comment can be flagged as a synopsis comment for each heading.
If multiple comments are flagged as a synopsis, the last one will be used.
Keyboard Shortcuts
==================
Most features are available as keyboard shortcuts.
These are as following:
..csv-table:: Keyboard Shortcuts
:header:"Shortcut", "Description"
:widths:15, 50
":kbd:`Alt-1`", "Switch focus to tree view pane."
":kbd:`Alt-2`", "Switch focus to document editor pane."
":kbd:`Alt-3`", "Switch focus to document viewer pane."
":kbd:`Ctrl-.`", "Correct word under cursor."
":kbd:`Ctrl-,`", "Open the Preferences dialog."
":kbd:`Ctrl-/`", "Change block format to comment."
":kbd:`Ctrl--`", "Strikethrough selected text, or word under cursor."
":kbd:`Ctrl-0`", "Remove block formatting for block under cursor."
":kbd:`Ctrl-1`", "Change block format to header level 1."
":kbd:`Ctrl-2`", "Change block format to header level 2."
":kbd:`Ctrl-3`", "Change block format to header level 3."
":kbd:`Ctrl-4`", "Change block format to header level 4."
":kbd:`Ctrl-A`", "Select all text in document."
":kbd:`Ctrl-B`", "Format selected text, or word under cursor, with strong emphasis (bold)."
":kbd:`Ctrl-C`", "Copy selected text to clipboard."
":kbd:`Ctrl-D`", "Wrap selected text, or word under cursor, in double quotes."
":kbd:`Ctrl-E`", "If in tree view, edit a document or folder settings. (Same as :kbd:`F2`)"
":kbd:`Ctrl-F`", "Open the search bar and search for selected word, if any is selected."
":kbd:`Ctrl-G`", "Find next occurrence of word in current document. (Same as :kbd:`F3`)"
":kbd:`Ctrl-H`", "Open the search and replace bar and search for selected word, if any is selected. (On Mac, this is :kbd:`Cmd-=`)"
":kbd:`Ctrl-I`", "Format selected text, or word under cursor, with emphasis (italic)."
":kbd:`Ctrl-N`", "Create new document."
":kbd:`Ctrl-O`", "Open selected document."
":kbd:`Ctrl-Q`", "Exit novelWriter."
":kbd:`Ctrl-R`", "If in tree view, open a document for viewing. If editor pane has focus, open current document for viewing."
":kbd:`Ctrl-S`", "Save the current document in the editor."
":kbd:`Ctrl-V`", "Paste text from clipboard to cursor position."
":kbd:`Ctrl-W`", "Close the current document in the editor."
":kbd:`Ctrl-X`", "Cut selected text to clipboard."
":kbd:`Ctrl-Y`", "Redo latest undo."
":kbd:`Ctrl-Z`", "Undo latest changes."
":kbd:`Ctrl-F7`", "Toggle spell checking."
":kbd:`Ctrl-F10`", "Toggle automatic updating of project outline."
":kbd:`Ctrl-Del`", "If in tree view, move a document to trash, or delete a folder."
":kbd:`Ctrl-Enter`", "Open the tag or reference under the cursor in the view panel."
":kbd:`Ctrl-Shift-,`", "Open the Project Settings dialog."
":kbd:`Ctrl-Shift-/`", "Remove block formatting for block under cursor."
":kbd:`Ctrl-Shift-1`", "Replace occurrence of word in current document, and search for next occurrence."
":kbd:`Ctrl-Shift-A`", "Select all text in current paragraph."
":kbd:`Ctrl-Shift-B`", "Format selected text, or word under cursor, with very strong emphasis (bold and italic)."
":kbd:`Ctrl-Shift-D`", "Wrap selected text, or word under cursor, in single quotes."
":kbd:`Ctrl-Shift-G`", "Find previous occurrence of word in current document. (Same as :kbd:`Shift-F3`"
":kbd:`Ctrl-Shift-I`", "Import text to the current document from a text file."
":kbd:`Ctrl-Shift-N`", "Create new folder."
":kbd:`Ctrl-Shift-O`", "Open a project."
":kbd:`Ctrl-Shift-R`", "Close the document view pane."
":kbd:`Ctrl-Shift-S`", "Save the current project."
":kbd:`Ctrl-Shift-W`", "Close the current project."
":kbd:`Ctrl-Shift-Up`", "Move item one step up in the tree view."
":kbd:`Ctrl-Shift-Down`", "Move item one step down in the tree view."
":kbd:`F1`", "Open documentation. This just tries to send the documentation URL ti your browser."
":kbd:`F2`", "If in tree view, edit a document or folder settings. (Same as :kbd:`Ctrl-E`)"
":kbd:`F3`", "Find next occurrence of word in current document. (Same as :kbd:`Ctrl-G`)"
":kbd:`F5`", "Open the Build Novel Project dialog."
":kbd:`F6`", "Open the Writing Statistics dialog."
":kbd:`F7`", "Re-run spell checker."
":kbd:`F8`", "Activate Zen Mode, hiding project tree and view panel."
":kbd:`F9`", "Re-build project index."
":kbd:`F10`", "Re-build project outline."
":kbd:`F11`", "Activate full screen mode."
":kbd:`Shift-F3`", "Find previous occurrence of word in current document. (Same as :kbd:`Ctrl-Shift-G`"
":kbd:`Enter`", "If in tree view, open a document for editing."
..note::
On macOS, replace :kbd:`Ctrl` with :kbd:`Cmd`.
A set of insert features are also available through shortcuts, but they require a double combination of shortcuts.
..csv-table:: Keyboard Shortcuts
:header:"Shortcut", "Description"
:widths:30, 50
":kbd:`Ctrl-K, -`", "Insert a short dash (en dash)."
":kbd:`Ctrl-K, _`", "Insert a long dash (em dash)."
":kbd:`Ctrl-K, .`", "Insert ellipsis."
":kbd:`Ctrl-K, Return`", "Insert a hard line break."
":kbd:`Ctrl-K, Space`", "Insert a non-breaking space."
":kbd:`Ctrl-K, Shift-Space`", "Insert a thin space."
":kbd:`Ctrl-K, Ctrl-Space`", "Insert a thin non-breaking space."
novelWriter is a simple, multi-document plain text editor using a modified markdown syntax to apply simple formatting.
Additional features that are not standard markdown are available through special meta data keywords.
These keywords make it possible to inter-link documents, and generate an overview of the entire novel project and how the various files are interconnected.
Design Philosophy
-----------------
The user interface is intended to be as minimalistic as practically possible, while at the same time provide a complete set of features needed for writing a novel.
..note::
novelWriter is not intended to be a full office type word processor.
It doesn't support images, links, tables, and its formatting is limited to headers, and bold, italicised and underlined text.
Most features are accessible through the menu and through keyboard shortcuts.
The colour scheme of the user interface can be modified with various themes, and new themes are fairly straight forward to add.
The project itself is laid out in a tree view on the left hand side of the main window.
It has various sections, called *root folders*, for the various types of supporting files that the user may want to add to the project.
The novel itself lives under its own root folder.
Project Layout
--------------
The layout of the novel itself is managed through the four supported heading levels, H1 through H4.
H1 is used for the book title, and for partitions.
H2 is used for chapter tiles.
H3 is reserved for scene titles.
H4 is for section titles within scenes, if such granularity is necessary.
For the files designated as project notes, the usage of headers imply no structural meaning, and the user is free to do whatever they want.
Project Export
--------------
The project can at any time be exported to a range of different formats.
Natively, novelWriter supports export to plain text file, HTML document, novelWriter flavoured markdown, standard markdown (requires Qt 5.14), and to a basic Open Document.
In addition, printing and printing to PDF is also possible.
The best supported export format is HTML, which can be imported or converted by a number of other tools like Pandoc, or simply imported into Libre Office and similar.
Supporting files, or notes, are any files stored in root folders that are not the Novel root folder.
These files are intended for summaries and outlines of the various plot elements, characters, locations, and so on, of the novel.
These are not required, but making at least minimal files for each such element, and add a tag to them, makes it possible to use the Outline View feature to see how each element intersects with each section of the novel itself, and add clickable cross-references between document in the editor and viewer.
File Tags
=========
Each new heading in a note file can have a tag associated with it.
The format of a tag is ``@tag: tagname``, where tagname is a unique identifier.
Tags can then be referenced in the novel files, or other note files, and will show up in the Outline View and in the back-reference panel when a document is being viewed.
The syntax highlighter will alert the user that the keyword is correctly used and that the tag is allowed, that is, the tag is unique.
Duplicate tags should be detected as long as the index is up to date.
The tag is the only part of these files that the application uses.
The rest of the file is there for the writer to use in whatever way they wish.
A note file can also reference other note files in the same way novel files do.
When the note file is opened in the view pane, these become clickable links, making it easier to follow connections in the plot.
A novelWriter project requires a dedicated folder for storing its files on the local file system.
See the Technical Information section for further details.
A new project can be created from the Project menu by selecting :menuselection:`Project --> New Project`.
A list of recently opened projects is maintained, and displayed in the "Open Project" dialog.
A project can be removed from this list by selecting it and pressing the :kbd:`Del` key.
The project specific settings are available in :menuselection:`Project --> Project Settings`.
See further details below.
Project Roots
=============
Projects are structured into a set of root folders, visible in the left side tree view panel.
The core novel files go into a root folder of type "Novel".
Other supporting files go into root folders of types "Plot", "Characters", "Locations", "Timeline", "Objects", "Entities", or "Custom".
These other root folder types are intended for your notes on the various elements of your story.
Using these is of course entirely optional.
A new project will not have all of the root folders present, but you can add the ones you want from :menuselection:`Project --> Create Root Folder`.
The root folders are intended for the following use, but aside from the Novel folder, no restrictions are enforced by the application.
You can use them however you want.
..note::
The root folders correspond to the categories of tags that can be used.
See the "Project Structure" section for further details.
***Novel:** The root folder of all text that goes into the final novel.
This class of files have other rules and features than other files in the project.
See the Novel Structure section for more details.
***Plot:** This is the root folder where main plots can be outlined.
It is optional, but adding at least dummy files can be useful in order to tag plot elements for the Outline View.
***Characters:** Character files go in this root folder.
These are especially important if one wants to use the Outline View to see which character appears where, and which part of the story is told from a specific character's point-of-view.
***Locations:** Location is for various scene locations that one wants to track.
***Timeline:** If the story jumps in time within the same plot, this class of files can be used to track this.
***Objects:** Important objects in the story can be tracked here.
***Entities:** Entities, like organisations or companies, that are part of the plot, can be organised here.
***Custom:** The custom root folder can be used for tracking anything else not covered by the above options.
Deleted files will be moved into a special "Trash" root folder.
Files in the Trash folder can be deleted permanently.
Orphaned Documents
------------------
In the event the editor crashes or otherwise exits without saving the project state, files that have been added to the project tree and are saved to disk will appear in a special "Orphaned Items" root folder next time the application is started.
These orphaned files will not have any meta data associated with them, although novelWriter will try to restore the file label it had in the project tree.
Other information will have to be set again, and the files moved back to the correct location in the project.
Project Lockfile
----------------
To prevent orphaned files caused by file conflicts when novelWriter projects are synced with file synchronisation tools, a project lockfile is written to the project folder.
If you try to open a project which has such a file, you will be presented with a warning, and some information about where novelWriter thinks the project is open.
You will be give the option to ignore this warning, and continue opening the project.
However, if multiple instances are in fact editing the same project, you are likely to cause inconsistencies and create diverging project files, potentially resulting in loss of data.
..note::
If, for some reason, novelWriter crashes, the lock file may remain.
In such a case it is safe to ignore the lock file warning when re-opening the project.
Using Folders in the Project Tree
---------------------------------
Folders, aside from root folders, have no structural significance to the project.
They are there purely as a way for the user to organise the files in meaningful sections and to be able to close them in the tree view.
When processing the files in the novel, like for instance during export, the folders are ignored.
Project Settings
================
The project settings can be accessed from the :menuselection:`Project --> Project Settings` menu entry.
This will open a dialog box, with a set of tabs.
Settings Tab
------------
The Settings tab holds the project title and author settings.
Working Title can be set to a different title than the Book Title.
The difference between them is simply that the Working Title is used for the GUI (main window title) and for generating the backup files.
The intention is that the working title should remain unchanged, while changing the final title has no effect on features relying on the project name.
The Book Title is currently not ues for anything, so setting it is just for the benefit of the author.
The Book Authors text box takes one author per line.
Details Tab
-----------
This tab presents an overview of meta data about the project.
It states where on your file system the project is saved, how may times it has been saved, how many folders and files it contains, and how many words exist in the entire project.
Status Tab
----------
Each file of type "Novel" can be given a status level, signified by a coloured icon.
These are purely there for the user's convenience, and you are not required to use them for any other feature to work.
The intention is to use this list to set what stage of writing you are on, although you can in principle make them whatever you want.
..note::
The status levels currently in use by a file cannot be deleted.
Importance Tab
--------------
Each file of types "Plot", "Character", "World", "Timeline", "Object", "Entity", or "Custom", can be given an importance level, signified by a coloured icon like for status level.
These are also purely there for the user's convenience, and you are not required to use them for any other feature to work.
The intention is to use this list to set how important the character, plot element, or otherwise, is for the story.
Again, these can in principle be used for whatever you want.
..note::
The importance levels currently in use by a file cannot be deleted.
Auto-Replace Tab
----------------
A set of automatically replaced keywords can be added in this tab.
The keywords in the left column wile be replaced by the text in the right column when documents are opened in the viewer.
This will also be applied to exports when the feature is added.
Note that a keyword cannot contain any spaces.
The angle brackets are added by default, and when used in the text are a part of the keyword to be replaced.
This is to ensure that parts of the text isn't unintentionally replaced by the content of the list.
Writing Files
=============
New document files can be created from the Document menu, or by pressing :kbd:`Ctrl-N` while in the tree view pane.
This will create a new, empty file, and open the item settings dialog where the filename and various other settings can be set.
This dialog can also be opened again later from either the menu, :menuselection:`Project -> Edit` item, or by pressing :kbd:`Ctrl-E` or :kbd:`F2` with the item selected.
The layout of the file is also defined here.
For Novel files, the full list of layout options are available.
For non-Novel files, only "Note" is available.
You can also select whether the file is by default included when building the project.
This setting can be overridden in the export tool if you wish to include them anyway.
See the Project Structure section for more details.
Backup
======
An automatic backup system is built into novelWriter.
In order to use it, a backup path to where the backups are to be stored must to be provided in :menuselection:`Tools --> Preferences`.
Backups can be run automatically when a project is closed, which also implies it is run when the application is closed.
Backups are date stamped zip files of the entire project folder, and are stored in a subfolder of the backup path with the same name as the project working title set in Project Settings.
The backup feature, when configured, can also be run manually from the :menuselection:`Tools` menu.
It is also possible to dissable automated backup for a given project in Project Settings.
..note::
For the backup to be able to run, the Working Title must be set in Project Settings.
This value is used to generate the folder name for the zip files.
You can download novelWriter from https://github.com/vkbo/novelWriter/releases
Latest version is |version|.
Installing Dependencies
=======================
If you already have Python installed, all you need to do is install the dependencies.
To do this, your need to open your command line tool, find the folder where you extracted novelWriter, and run:
..code-block::console
python -m pip install -r requirements.txt
On some operating systems you need to use ``python3`` instead of ``python``.
The following Python packages are required to run novelWriter:
*``pyqt5`` for the GUI
*``lxml`` for writing project files
..note::
Sometimes the SVG graphics package for pyqt5 must be installed separately.
The following are optional, but recommended:
*``pyenchant`` for spell checking
PyQt/Qt should be at least 5.2.1, but ideally 5.10 or higher for nearly all features to work.
Exporting to standard Markdown requires PyQt/Qt 5.14.
There are no known minimum for package lxml, but the code was originally written with 4.2.
The optional spell check library must be at least 3.0.0 to work with Windows.
On Linux, 2.0.0 also works fine.
Running novelWriter
===================
If all the required dependencies are met, you can run novelWriter from the command line in one of the following ways:
..code-block::console
python novelWriter.py
python3 novelWriter.py
./novelWriter.py
A few switches are supported from the command line, mostly to assist in debugging if an error is encountered.
To list all options, run:
..code-block::console
python novelWriter.py --help
There are also a couple of install scripts in the assets folder which will assist in setting up launch icon and the novelWriter project file mimetype for Gnome desktops on Linux.
Currently, there's one script for Debian and one for Ubuntu.
Building a Standalone Executable
================================
A standalone executable can be built with pyinstaller, using the provided python script "install.py" in the source folder.
This script will automatically try to install all dependencies and build the standalone executable of novelWriter.
You can run the script by typing the following into your command prompt:
..code-block::console
python install.py
If successful, the executable will be in the "dist" folder.
Additional Instructions for Windows
-----------------------------------
If you don't have Python installed, you can download it from the python.org website.
The installers for Windows are available at https://www.python.org/downloads/windows/
novelWriter should work with Python 3.5 or higher, and the executable installer is the easiest to install.
Please note that the `pyenchant` package for spell checking does not currently work with the x86-64 version, so if you want spell checking, you must install the x86 version.
Also, make sure you select the "Add Python to PATH" option.
..image:: images/python_win_install.png
:width:600
Once Python is set up and running, you can either run novelWriter from the folder where you extracted it, or you can build an executable and run that from a desktop icon instead.
Each partition, indicated by a heading, can contain references to tags set in the supporting files of the project.
The references are gathered by the indexer and used to generate the Outline View of how the different parts of the novel are connected.
References and tags are also clickable in the view panel, and makes it easy to navigate reference notes while writing.
The targets of references can also be set per header.
This is covered in the "Supporting Files" section.
References are set as keyword and a list of corresponding tags.
The valid keywords are listed below.
The format of a meta line is ``@keyword: value1, [value2] ... [valueN]``.
All keywords allow multiple values.
*``@pov``: The point-of-view character for the current section.
The target must be a note tag in the character root folder.
*``@char``: Other characters in the current section.
The target must be a note tag in the character root folder.
This should not include the point-of-view character.
*``@plot``: The plot timelines touched by the current section.
The target must be a note tag in the plot root folder.
*``@time``: The timelines touched by the current section.
The target must be a note tag in the timeline root folder.
*``@location``: The location the current section takes place in.
The target must be a note tag in the locations root folder.
*``@object``: Objects present in the current section.
The target must be a note tag in the object root folder.
*``@entity``: Entities present in the current section.
The target must be a note tag in the entities root folder.
*``@custom``: Custom references in the current section.
The target must be a note tag in the custom root folder.
The syntax highlighter will alert the user that only the correct keywords are used, and that the tags referenced exist.
If the index of defined tags is out of date, press :kbd:`F9` to regenerate it, or select :menuselection:`Tools --> Rebuild Index` from the menu.
In general, the index for a file is regenerated when a file is saved, so this shouldn't normally be necessary.
Novel File Layout
=================
Files in a novelWriter project can have a layout format set.
These layouts are important when the project is exported, as they indicate how to treat the content in terms of formatting, headings and page breaks.
The layout for each file is indicated as the last set of characters in the Flags column of the project tree.
They also help to indicate what each file is for in your project.
Some of these layout types are different, some are just cosmetic.
The "Book" layout is a generic novel file layout that in formatting is identical to "Chapter" and "Scene", but may help to indicate what files do in your project.
You can lay out your project using Book files for each act, and then later split those into chapter or scene files by using the "Split Document" tool.
Scenes can also be contained within chapter files, but you lose the drag and drop feature that comes with having them in separate files.
Some layouts have implications on how the project is exported.
Files with layout "Title" and "Partition" have all headings and text centred, while the "Unnumbered" layout disables the automatic chapter numbering feature for everything contained within it.
All of the above layout formats are only usable in the Novel root folder.
Files that are not a part of the novel itself should have the Note layout.
These files are not getting any special formatting, and it is possible to collectively filter them out during export.
Note files can be used anywhere in the project.
Below is an overview of all available layout formats.
***Title Page**: The title page layout.
The title should be formatted as a heading level one.
All text is automatically centred on exports.
***Plain Page**: A plain page layout useful for instance for front matter pages.
Heading levels are ignored for this layout format, and so are formatting options like Justify Text.
The page is exported with a page break before it.
***Book**: This is the generic novel file format that in principle can be used for all novel files.
Since the internal structure of the novel is controlled by the heading levels, this file will produce the same result as a collection of Partition, Chapter and Scene type files.
However, it does not provide the functionality of the Unnumbered layout format.
***Partition**: A partition can be used to split the novel into parts.
Partition titles are indicated with a level one heading.
You can also add text and meta data to the page.
The Partition file layout will in addition force a page break before the heading, and centre all content on the page.
***Chapter**: Signifies the start of a new chapter.
If the text itself is contained in scene files, these files should only contain the title, comments, synopsis, and tag references for characters, plot, etc.
The heading for chapters should be level two.
If you need an opening text, like a quote or other leading text before the first scene, this is also where you'd want to add this text.
***Unnumbered**: Same as Chapter, but when exporting the files and automatic chapter numbering is enabled, this file will not receive a number.
This makes the layout suitable for Prologue and Epilogue type chapters.
***Scene**: A scene file.
This file should have a header of level three.
Further sections can have headers of level four, but there are no file layout specifically for sections.
***Note**: A generic file that is optionally ignored when the novel is exported.
Use these files for descriptions of content in the supporting root folders.
Note files can also be added to the Novel root folder if you need to insert notes there.
Note file headers receive no formatting when building the project.
They are always exported as-is.
..note::
The layout granularity is entirely optional.
In principle, you can write the entire novel in a single file with layout "Book".
This section contains details of how novelWriter stores and handles the project data.
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.
Main Project File
-----------------
The project itself requires a dedicated folder for storing its files, where novelWriter will create its own "file system" where the folder and file hierarchy is described in a project XML file.
This is the main project file in the project's root folder with the name ``nwProject.nwx``.
This file also contains all the meta data required for the project, and a number of related project settings.
If this file is lost or corrupted, the structure of the project is lost.
It is important to keep this file backed up, either through the built-in backup tool, or your own backup solution.
..note::
The novelWriter project folder is structured so that it can easily be added to a version control system like git.
If so, you may want to add a `.gitignore` file to exclude files with the extensions `.json` as JSON files are used to cache the index and various run-time settings.
The project XML file is indent-formatted, suitable for diff tools and version control, although a timesetamp is set in the meta section on line 2 each time the file is saved.
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``.
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, or select :menuselection:`Document --> Show File Details` in the menu when having the document open.
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.
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 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 next time the file is saved in novelWriter.
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.
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.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.