diff --git a/docs/source/conf.py b/docs/source/conf.py index 20a8c2ab..176c13b8 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -35,7 +35,7 @@ os.environ["TZ"] = "Europe/Oslo" time.tzset() needs_sphinx = "5.0" -extensions = [] +extensions = ["sphinx_design"] templates_path = ["_templates"] source_suffix = ".rst" master_doc = "index" diff --git a/docs/source/images/fig_build_build.png b/docs/source/images/fig_build_build.png new file mode 100644 index 00000000..72650672 Binary files /dev/null and b/docs/source/images/fig_build_build.png differ diff --git a/docs/source/images/fig_build_settings_headings.png b/docs/source/images/fig_build_settings_headings.png new file mode 100644 index 00000000..4eb54c5e Binary files /dev/null and b/docs/source/images/fig_build_settings_headings.png differ diff --git a/docs/source/images/fig_build_settings_selections.png b/docs/source/images/fig_build_settings_selections.png new file mode 100644 index 00000000..9dc82d49 Binary files /dev/null and b/docs/source/images/fig_build_settings_selections.png differ diff --git a/docs/source/images/fig_editor.png b/docs/source/images/fig_editor.png new file mode 100644 index 00000000..ba7181be Binary files /dev/null and b/docs/source/images/fig_editor.png differ diff --git a/docs/source/images/fig_editor_search.png b/docs/source/images/fig_editor_search.png new file mode 100644 index 00000000..020ef0e1 Binary files /dev/null and b/docs/source/images/fig_editor_search.png differ diff --git a/docs/source/images/fig_header_levels.png b/docs/source/images/fig_header_levels.png new file mode 100644 index 00000000..e427e3a2 Binary files /dev/null and b/docs/source/images/fig_header_levels.png differ diff --git a/docs/source/images/fig_manuscript_build.png b/docs/source/images/fig_manuscript_build.png new file mode 100644 index 00000000..8a3e1ae8 Binary files /dev/null and b/docs/source/images/fig_manuscript_build.png differ diff --git a/docs/source/images/fig_novel_tree_view.png b/docs/source/images/fig_novel_tree_view.png new file mode 100644 index 00000000..f2938842 Binary files /dev/null and b/docs/source/images/fig_novel_tree_view.png differ diff --git a/docs/source/images/fig_outline_view.png b/docs/source/images/fig_outline_view.png new file mode 100644 index 00000000..467fa89a Binary files /dev/null and b/docs/source/images/fig_outline_view.png differ diff --git a/docs/source/images/fig_project_merge_tool.png b/docs/source/images/fig_project_merge_tool.png new file mode 100644 index 00000000..a49ae226 Binary files /dev/null and b/docs/source/images/fig_project_merge_tool.png differ diff --git a/docs/source/images/fig_project_split_tool.png b/docs/source/images/fig_project_split_tool.png new file mode 100644 index 00000000..5d122f66 Binary files /dev/null and b/docs/source/images/fig_project_split_tool.png differ diff --git a/docs/source/images/fig_project_tree_detailed.png b/docs/source/images/fig_project_tree_detailed.png new file mode 100644 index 00000000..e46c5d30 Binary files /dev/null and b/docs/source/images/fig_project_tree_detailed.png differ diff --git a/docs/source/images/fig_project_tree_view.png b/docs/source/images/fig_project_tree_view.png new file mode 100644 index 00000000..667229ca Binary files /dev/null and b/docs/source/images/fig_project_tree_view.png differ diff --git a/docs/source/images/fig_references.png b/docs/source/images/fig_references.png new file mode 100644 index 00000000..3ffb9afa Binary files /dev/null and b/docs/source/images/fig_references.png differ diff --git a/docs/source/images/fig_viewer.png b/docs/source/images/fig_viewer.png new file mode 100644 index 00000000..05d4c459 Binary files /dev/null and b/docs/source/images/fig_viewer.png differ diff --git a/docs/source/images/python_win_install.png b/docs/source/images/python_win_install.png deleted file mode 100644 index 320305d0..00000000 Binary files a/docs/source/images/python_win_install.png and /dev/null differ diff --git a/docs/source/index.rst b/docs/source/index.rst index c7c1180f..1495d713 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -18,18 +18,13 @@ storage for robustness. 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 primarily saved as -JSON files. See the :ref:`a_breakdown_storage` section for more details. +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. 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 +novelWriter. It runs fine on Linux, Windows and MacOS, and users have tested it on other platforms as well. novelWriter can also be run directly from the Python source, or installed from packages or -the pip tool. See :ref:`a_started` for more details. - -.. note:: - Release 1.5 introduced a few changes that will require you to make some minor modifications to - some of the headings in your project. It should be fairly quick and straightforward. Please see - the :ref:`a_prjfmt_1_3` section for more details. +with pip. See :ref:`a_started` for more details. **Useful Links** @@ -56,9 +51,9 @@ the pip tool. See :ref:`a_started` for more details. int_introduction int_overview int_started - int_source int_howto int_customise + int_glossary .. toctree:: :maxdepth: 1 @@ -66,7 +61,8 @@ the pip tool. See :ref:`a_started` for more details. :hidden: usage_breakdown - usage_interface + usage_project + usage_writing usage_format usage_shortcuts usage_typography @@ -79,14 +75,15 @@ the pip tool. See :ref:`a_started` for more details. project_overview project_structure - project_notes - project_export + project_references + project_manuscript .. toctree:: :maxdepth: 1 - :caption: Under the Hood + :caption: Additional Topics :hidden: tech_locations tech_storage + tech_source tech_tests diff --git a/docs/source/int_customise.rst b/docs/source/int_customise.rst index 9cb4819c..9098db7d 100644 --- a/docs/source/int_customise.rst +++ b/docs/source/int_customise.rst @@ -17,14 +17,14 @@ Spell Check Dictionaries ======================== novelWriter uses Enchant_ as the spell checking tool. Depending on your operating system, it may or -may not load installed spell check dictionaries. +may not load all installed spell check dictionaries automatically. Linux and MacOS --------------- On Linux and MacOS, you generally only have to install hunspell or aspell dictionaries on your system like you do for other applications. See your distro or OS documentation for how to do this. -These dictionaries should then show up as available spell check languages in novelWriter. +These dictionaries should show up as available spell check languages in novelWriter. Windows ------- @@ -40,7 +40,6 @@ This assumes your user profile is stored at ``C:\Users\``. The last one or not exist, so you may need to create them. .. note:: - The Free Desktop link points to a repository, and what may look like file links inside the dictionary folder are actually links to web pages. If you right-click and download those, you get HTML files, not dictionaries! @@ -54,8 +53,9 @@ not exist, so you may need to create them. Syntax and GUI Themes ===================== -Adding your own GUI and syntax themes is relatively easy. The themes are defined by simple plain -text config files with meta data and colour settings. +Adding your own GUI and syntax themes is relatively easy, altough it requires that you manually +edit config files with colour values. The themes are defined by simple plain text config files with +meta data and colour settings. In order to make your own versions, first copy one of the existing files to your local computer and modify it as you like. @@ -78,16 +78,16 @@ 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 set as ``name`` inside the file. -.. note:: - In novelWriter 2.0 the ``icontheme`` value was added to GUI themes. Make sure you set this value - in existing custom themes. Otherwise it defaults to ``typicons_light``, which may not match your - theme colour scheme. +.. versionadded:: 2.0 + The ``icontheme`` value was added to GUI themes. Make sure you set this value in existing custom + themes. Otherwise, novelWriter will try to guess your icon theme, and may not pick the most + suitable one. Gustom GUI and Icons Theme -------------------------- -A GUI theme conf file consists of the follwing settings: +A GUI theme ``.conf`` file consists of the follwing settings: .. code-block:: cfg @@ -136,7 +136,7 @@ Omitted values are not loaded and will use default values. Custom Syntax Theme ------------------- -A syntax theme conf file consists of the follwing settings: +A syntax theme ``.conf`` file consists of the follwing settings: .. code-block:: cfg @@ -166,7 +166,6 @@ A syntax theme conf file consists of the follwing settings: replacetag = 0, 0, 0 modifier = 0, 0, 0 - In the Main section, you must define at least the ``name`` setting. The Syntax colour values are -RGB numbers on the format ``r, g, b`` where each is an integer from to 255. Omitted values are set +RGB numbers on the format ``r, g, b`` where each is an integer from to 255. Omitted values default to black, except ``background`` which defaults to white, diff --git a/docs/source/int_glossary.rst b/docs/source/int_glossary.rst new file mode 100644 index 00000000..a57ac414 --- /dev/null +++ b/docs/source/int_glossary.rst @@ -0,0 +1,64 @@ +.. _a_glossary: + +******** +Glossary +******** + +.. glossary:: + :sorted: + + Root Folder + A "Root Folder" is a top level folder of the project tree in novelWriter. Each type of root + folder has a specific icon to identify it. For an overview of available root folder types, + see :ref:`a_proj_roots`. + + Novel Documents + These are documents that are created under a "Novel" :term:`root folder`. They behave + differently than :term:`Project Notes`, and have some more restrictions. For instance, they + can not exist in folders intended only for project notes. See the :ref:`a_struct` chapter for + more details. + + Project Notes + Project Notes are unrestricted documents that can be placed anywhere in your project. You + should not use these documents for story elements, only for notes. Project notes are the + source files used by the Tags and References system. See the :ref:`a_references` chapter for + more details on how to use them. + + Tag + A tag is a user defined value assigned as a tag to a section of your :term:`Project Notes`. + It is optional, and can be defined once per heading. It is set using the :term:`keyword` + syntax ``@tag: value``, where ``value`` is the user defined part. Each tag can be referenced + in another file using one of the :term:`reference` keywords. See :ref:`a_references` chapter + for more details. + + Reference + A references is one of a set of :term:`keywords` that can be used to link to a + :term:`tag` in another document. The reference keywords are specific to the different + :term:`root folder` types. A full overview is available in the :ref:`a_references` chapter. + + Project Index + The project index is a record of all headings in a project, with all their meta data like + synopsis comments, :term:`tags` and :term:`references`. The project index is + kept up to date automatically, but can also be regenerated manually from the + :guilabel:`Tools` menu or by pressing :kbd:`F9`. + + Context Menu + A context menu is a menu that pops up when you right click something in the user interface. + In novelWriter, you can often also open a context menu by pressing the keyboard shortcut + :kbd:`Ctrl+.`. + + Headings + Each level of headings in :term:`Novel Documents` have a specific meaning in terms of the + structure of the story. That is, they determine what novelWriter considers a partition, a + chapter, a scene or a text section. For :term:`Project Notes`, the header levels don't + matter. For more details on headings in novel documents, see :ref:`a_struct_heads`. + + Keyword + A keyword in novelWriter is a special command you put in the text of your documents. They are + not standard Markdown, but is used in novelWriter to add information that is interpreted by + the application. For instance, keywords are used for :term:`tags` and + :term:`references`. + + Keywords must always be on their own line, and the first character of the line must always be + the ``@`` character. The keyword must also always be followed by a ``:`` character, and the + values passed to the command are added after this, separated by commas. diff --git a/docs/source/int_howto.rst b/docs/source/int_howto.rst index cccdf99d..95a83876 100644 --- a/docs/source/int_howto.rst +++ b/docs/source/int_howto.rst @@ -9,117 +9,75 @@ Tips & Tricks This is a list of hopefully helpful little tips on how to get the most out of novelWriter. .. note:: - - This section will be expanded over time, and if you would like to have something added, feel - free to contribute, or start a discussion on the project's `Discussions Page`_ - - -Overview -======== - -**Managing the Project** - -* :ref:`a_howto_merge_documents` - -**Layout Tricks** - -* :ref:`a_howto_simple_table` - -**Organising Your Text** - -* :ref:`a_howto_chapter_intro` -* :ref:`a_howto_soft_hard_breaks` - -**Other Tools** - -* :ref:`a_howto_convert_ywriter` - - -How-Tos -======= + This section will be expanded over time, and if you would like to have something added, feel + free to contribute, or start a discussion on the project's `Discussions Page`_. Managing the Project --------------------- +==================== +.. dropdown:: Merge Multiple Documents Into One + :animate: fade-in-slide-down -.. _a_howto_merge_documents: + 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`. -Merge Multiple Documents Into One -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -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`. - -In the dialog that pops up, the documents will be in the same order as in the folder, but you can -also rearrange them here of you wish. + In the dialog that pops up, the documents will be in the same order as in the folder, but you + can also rearrange them here of you wish. See :ref:`a_ui_tree_split_merge` for more details. Layout Tricks -------------- +============= +.. dropdown:: Create a Simple Table + :animate: fade-in-slide-down -.. _a_howto_simple_table: + 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`. -Create a Simple Table -^^^^^^^^^^^^^^^^^^^^^ + 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. -The formatting tools available in novelWriter don't allow for complex structures like tables. -However, the editor does render tabs in a similar way to regular word processors. You can set the -width of a tab in :guilabel:`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. - -This is most suitable for your notes, as the result in exported documents cannot be guaranteed to -match. + This is most suitable for your notes, as the result in exported documents cannot be guaranteed + to match. Organising Your Text --------------------- +==================== +.. dropdown:: Add Introductory Text to Chapters + :animate: fade-in-slide-down -.. _a_howto_chapter_intro: + Sometimes chapters have a short preface, like a brief piece of text or a quote to set the stage + before the first scene begins. -Add Introductory Text to Chapters -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + If you add separate files for chapters and scenes, the chapter file is the perfect place to add + such text. Separating chapter and scene files also allows you to make scene files child + documents of the chapter (added in novelWriter 2.0). -Sometimes chapters have a short preface, like a brief piece of text or a quote to set the stage -before the first scene -- Some text that may not be a part of the actual following scene. +.. dropdown:: Distinguishing Soft and Hard Scene Breaks + :animate: fade-in-slide-down -If you add separate files for chapters and scenes, this is the perfect place to add such text. -Separating chapter and scene files also allows you to set meta data for the whole chapter. Like -list all characters present in the chapter, etc. + 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. - -.. _a_howto_soft_hard_breaks: - -Distinguishing Soft and Hard Scene Breaks -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -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 the scene heading for hard scene breaks and section headings for -soft scene breaks. the :guilabel:`Project Build 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. + In such cases you may want to use the scene heading for hard scene breaks and section headings + 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. Other Tools ------------ +=========== +.. dropdown:: Convert Project to/from yWriter Format + :animate: fade-in-slide-down -.. _a_howto_convert_ywriter: + There is a tool available that lets you convert a `yWriter `_ + project to a novelWriter project, and vice versa. -Convert Project to/from yWriter Format -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. _yWriter: http://spacejock.com/yWriter7.html - -There is a tool available that lets you convert a yWriter_ project to a novelWriter project, and -vice versa. - -The tool is available at `peter88213.github.io/yw2nw `__ + The tool is available at `peter88213.github.io/yw2nw `__ diff --git a/docs/source/int_introduction.rst b/docs/source/int_introduction.rst index 9b3bc4cf..d4c99188 100644 --- a/docs/source/int_introduction.rst +++ b/docs/source/int_introduction.rst @@ -4,19 +4,26 @@ Key Features ************ -.. _Snowflake : https://www.advancedfictionwriting.com/articles/snowflake-method/ +.. _Snowflake: https://www.advancedfictionwriting.com/articles/snowflake-method/ +.. _Markdown: https://en.wikipedia.org/wiki/Markdown -At the 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 is designed for writing fiction, so the -formatting features are limited to those relevant for this purpose. It is not suitable for -technical writing. +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 is designed for writing fiction, so the +formatting features available are limited to those relevant for this purpose. It is *not* suitable +for technical writing, and it is *not* a full-feature Markdown editor. Your novel project is organised as a collection of separate plain text documents instead of a single, large document. The idea here is to make it easier to reorganise your project structure -without having to cut and paste text. +without having to cut and paste text between chapters. -You can at any point split documents by their header, or merge multiple documents into single -documents. This makes it easier to use variations of the popular Snowflake_ method for writing. +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 headers up into multiple documents, or +merge multiple documents into single documents. This makes it easier to use variations of the +Snowflake_ method for writing. You can focus on writing larger structure-focused documents, like +one per act for instance, and later effortlessly split these up into scenes by their headers. Below are some key features of novelWriter. @@ -24,43 +31,48 @@ Below are some key features of novelWriter. The aim of the user interface is to let the user 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 window - itself is vissible. + writing, you can switch the editor into :guilabel:`Focus Mode` where only the text editor panel + itself is vissible, 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, you character notes, plot notes, or any - other document you may need to reference while writing. + 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. **Organise your documents how you like** You can split your novel project up into as many individual documents as you want to. When you - build the project, they are all glued together in the top-to-bottom order in which they appear - in the project tree. You can use as few text documents as you like, but splitting the project up - into chapters and scenes means you can easily reorder them using the drag and drop feature. You - can start out with a few documents and then later split the document into multiple documents - based on its headers. + build the project into a manuscript, they are all glued together in the top-to-bottom order in + which they appear in the project tree. You can use as few text documents as you like, but + splitting the project up into chapters and scenes means you can easily reorder them using the + drag-and-drop feature. You can also start out with a few documents and then later split them + into multiple documents based on their headers. + +**Multi-novel project support** + As of novelWriter 2.0, 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. **Keep track of your plot elements** - All notes in your project can be assigned a *tag* you can *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 a specific section. Note tags are organised into categories with specific reference - keywords. + 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 ot. **Get an overview of your plot elements** 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 document, 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 a replacement for the - main project tree. + 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. **Building your manuscript** - Whether you want to compile 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 Novel Project` tool. - 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 as HTML, or - Markdown, both suitable for further conversion to other formats. + 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 + 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 + as HTML, or Markdown, both suitable for further conversion to other formats. .. _a_intro_screenshots: diff --git a/docs/source/int_overview.rst b/docs/source/int_overview.rst index 7cbb146d..09d8358f 100644 --- a/docs/source/int_overview.rst +++ b/docs/source/int_overview.rst @@ -10,59 +10,59 @@ Overview :align: right :width: 220 -novelWriter is built on `Python 3 `_, a cross platform programming -language that doesn't require a compiler to build and run. That means that the code can run on your -computer right out of the box, or from a zip file. +novelWriter is built as a cross-platform application using `Python 3 `_ as +the programming language, and `Qt 5 `_ for the user interface. -While it is developed for Linux primarily, it runs just fine on Windows as well. It also works fine -on macOS, but the author is not a mac user, so support for mac is dependant on user feedback and +novelWriter is built for Linux first, and this is where it works best. However, it also runs fine +on Windows and MacOS due to the cross-platform framework it's build on. The author of the +application doesn't own a Mac, so on-going Mac support is dependant on user feedback and user contributions. -In order to run novelWriter, you also need a few additional packages. The user interface is built -with `Qt 5 `_, a cross platform library for building graphical user interface -applications. It also uses a third party XML package. If you want spell checking, you also need the -spell check package Enchant developed for AbiWord +Spell checking in novelWriter is provided by a third party library called +`Enchant `_. Please see the section on :ref:`a_custom_dict` for +how to install spell checking languages. For install instructions, see :ref:`a_started`. -For information on how to add spell check dictionaries, see :ref:`a_custom_dict`. - Using novelWriter ================= In order to use novelWriter effectively, you need to know the basics of how it works. The following -sections will explain the main principles. It starts with the basics, and gets more detailed as you +chapters will explain the main principles. It starts with the basics, and gets more detailed as you read on. :ref:`a_breakdown` – Essential Information - This section explains the basics of how the application works and what it can and cannot do. + This chapter explains the basics of how the application works and what it can and cannot do. -:ref:`a_ui` – Recommended Reading - This section will give you a more detailed explanation of what the various elements on the user - interface do and how you can use them more effectively. +:ref:`a_ui_project` – Recommended Reading + This chapter will give you a more detailed explanation of how you the user interface components + to organise and view your project work. + +:ref:`a_ui_writing` – Recommended Reading + This chapter will give you a more detailed explanation of how the text editor and viewer work. :ref:`a_fmt` – Essential Information - This section covers how you should format your text. The editor is plain text, so text + This chapter covers how you should format your text. The editor is plain text, so text formatting requires some basic markup. The structure of your novel is also inferred by how you - use headings. Tags and references are implemented by simple codes. + use headings. Tags and references are implemented by special keywords. :ref:`a_kb` – Optional / Lookup - This section lists all the keyboard shortcuts in novelWriter and what they do. Most of the - shortcuts are also listed next to the menu items inside the app, or in tool tips, so this - section is mostly for reference. + This chapter lists all the keyboard shortcuts in novelWriter and what they do. Most of the + shortcuts are also listed next to their menu entries inside the app, or in tool tips. This + chapter is mostly for reference. :ref:`a_typ` – Optional - This section gives you an overview of the special typographical symbols available in + This chapter gives you an overview of the special typographical symbols available in novelWriter. The auto-replace feature can handle the insertion of standard quote symbols for your language, and other special characters. If you use any symbols aside from these. their intended use is explained here. :ref:`a_prjfmt` – Optional - This section is more technical and has an overview of changes made to the way your project data + This chapter is more technical and has an overview of changes made to the way your project data is stored. The format has changed a bit from time to time, and sometimes the changes require that you make small modifications to your project. Everything you need to know is listed in this - section. + chapter. Organising Your Projects @@ -74,19 +74,19 @@ to take advantage of these features, you must structure your text in a specific meta data for it to extract. :ref:`a_proj` – Essential Information - This section explains how you organise the content of your project, and how to set up automated + This chapter explains how you organise the content of your project, and how to set up automated backups of your work. :ref:`a_struct` – Essential Information - This section covers the way your novel's structure is encoded into the text documents. It - explains how the different levels of headings are used, and how you can include information - about characters, plot elements, and other meta data in your text. + This chapter covers the way your novel's structure is encoded into the text documents. It + explains how the different levels of headings are used, and some special formatting for + different kinds of headings. -:ref:`a_notes` - Recommended Reading - This section briefly describes what novelWriter does with the note files you add to your - project. Generally, the application doesn't do much with them at all aside from looking through - them for tags you've set so that it knows which file to open when you click on a reference. +:ref:`a_references` - Recommended Reading + This chapter explains how you organise your notes, and how the Tags and References system works. + This system lets you cross-link your documents in your project, and display these references in + the application interface. -:ref:`a_export` - Recommended Reading - This section explains in more detail how the build tool works. In particular how you can - control the way chapter titles are formatted, and how scene and section breaks are handled. +: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. diff --git a/docs/source/int_started.rst b/docs/source/int_started.rst index 2db89a96..402ec687 100644 --- a/docs/source/int_started.rst +++ b/docs/source/int_started.rst @@ -10,16 +10,16 @@ Getting Started .. _PPA: https://launchpad.net/~vkbo/+archive/ubuntu/novelwriter .. _Pre-Release PPA: https://launchpad.net/~vkbo/+archive/ubuntu/novelwriter-pre .. _PyPi: https://pypi.org/project/novelWriter/ -.. _python.org: https://www.python.org/downloads/windows +.. _python.org: https://www.python.org/downloads/ .. _Releases: https://github.com/vkbo/novelWriter/releases .. _AppImage: https://appimage.org/ -Package installers are available for all major platforms, including Linux, Windows and MacOS. See -below for install instructions for each platform. +Package installers for novelWriter are available for all major platforms, including Linux, Windows +and MacOS. See below for install 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, -or start novelWriter from command line. +or start novelWriter from the command line. Spell checking in novelWriter is provided by a third party library called Enchant_. Generally, it should pull dictionaries from your operating system automatically. However, on Windows they must be @@ -36,7 +36,14 @@ Installer (setup.exe) file from the `main website`_, or from the Releases_ page Installing it should be straightforward. If you have any issues, try uninstalling the previous version and making a fresh install. If you -already had a version installed via a different method, you should uninstall that first. +already had a version installed via a different method, you should uninstall that first as having +multiple installations has been known to cause problems. + +.. note:: + 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. .. _a_started_linux: @@ -68,7 +75,7 @@ Debian and Mint --------------- Since this is a pure Python package, the Launchpad PPA can in principle also be used on Debian or -Mint. However, the above command will fail to add the signing key. +Mint. However, the above command will fail to add the signing key, as it is Ubuntu-specific. Instead, run the following commands to add the repository and key: @@ -85,12 +92,10 @@ Then run the update and install commands as for Ubuntu: sudo apt install novelwriter .. note:: - You may need to use the Ubuntu 20.04 (focal) packages for Debian 11 or earlier. The newer Ubuntu packages use a different compression algorithm that may not be supported. .. tip:: - If you get an error message like ``gpg: failed to create temporary file`` when importing the key from the Ubuntu keyserver, try creating the folder it fails on, and import the key again: @@ -106,6 +111,11 @@ For other Linux distros than the ones mentioned above, the primary option is App completely standalone images for the app that include the necessary environment to run novelWriter. They can of course be run on any Linux distro, if you prefer this to native packages. +.. note:: + novelWriter generally don't support Python versions that have reached end of life. If your Linux + distro still uses older Python versions and novelWriter won't run, you may want to try the + AppImage instead. + .. _a_started_macos: @@ -127,6 +137,11 @@ it should be straightforward. The context menu can also be accessed by option-clicking if you have a one button mouse. This is done by holding down the option key on your keyboard and clicking on the application in Finder. +.. note:: + The novelWriter DMG is not signed because Apple 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. + .. _a_started_pip: @@ -137,8 +152,9 @@ novelWriter is also available on the Python Package Index, or PyPi_. This instal all supported operating systems. To install from PyPi you must first have the ``python`` and ``pip`` commands available on your -system. If you are on Windows, and don't have Python installed, see :ref:`a_started_win_py` for -help. +system. You can download Python from `python.org`_. It is recommended that you install the latest +version. If you are on Windows, also make sure to select the "Add Python to PATH" option during +installation. To install novelWriter from PyPi, use the following command: @@ -159,38 +175,4 @@ When installing via pip, novelWriter can be launched from command line with: novelwriter Make sure the install location for pip is in your PATH variable. This is not always the case by -default. - -.. note:: - - On systems with both Python 2 and 3, you may have to replace the ``pip`` command with ``pip3``. - - -.. _a_started_win_py: - -Installing Python on Windows ----------------------------- - -In order to run novelWriter from source, or install from PyPi, you need to have Python set up on -your system. Unlike Linux and MacOS, Windows does not come with Python pre-installed. - -You can download Python from `python.org`_. Python 3.8 or higher is required for running -novelWriter, but it is recommended that you install the latest version. - -Make sure you select the "Add Python to PATH" option during installation, otherwise the ``python`` -command will not work in the command line window. - -.. figure:: images/python_win_install.png - :align: center - :width: 500 - - Screenshot of the Python installer on Windows. - -When Python is installed, you should be able to run Python commands from the Command Prompt or -from PowerShell. You can verify this by running: - -.. code-block:: bash - - python --version - -This should print out the version number of the Python installation. +default, and then you may get a "Not Found" error when running the ``novelwriter`` command. diff --git a/docs/source/project_export.rst b/docs/source/project_export.rst deleted file mode 100644 index ea29fa15..00000000 --- a/docs/source/project_export.rst +++ /dev/null @@ -1,159 +0,0 @@ -.. _a_export: - -*********************** -Building the Manuscript -*********************** - -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:`Build Novel Project` tool. -You can activate it from the sidebar, the :guilabel:`Tools` menu, or by pressing :kbd:`F5`. - -.. note:: - This tool is scheduled to receive a full update in novelWriter 2.1, adding many new features - requested by users. See the `2.1 Milestone `_ - for an overview. - - -.. _a_export_headers: - -Header Formatting -================= - -The titles for the five types of headings (the chapter headings come in a numbered and unnumbered -version) of story structure can be formatted collectively in the build tool. This is done through -a series of keyword–replace steps. They are all on the format ``%keyword%``. - -``%title%`` - This keyword will always be replaced with the title text you put after the ``#`` characters in - your document. - -``%ch%`` - This will be replaced by a chapter number. The number is incremented by one each time the build - tool sees a new heading of level two in a document, unless the heading formatting code has the - added ``!``. In the latter case, the counter is *not* incremented. This is useful for for - instance Prologue and Epilogue chapters. - -``%chw%`` - Behaves like ``%ch%``, but the number is represented as a number word. You can select between a - number of different languages. - -``%chi%`` - Begaves like ``%ch%``, but represented as a lower case Roman number from 1 to 4999. - -``%chI%`` - Behaves like ``%ch%``, but represented as an upper case Roman number from 1 to 4999. - -``%sc%`` - This is the number counter equivalent for scenes. These are incremented each time a heading of - level three is encountered, but reset to 1 each time a chapter is encountered. They can thus be - used for counting scenes within a chapter. - -``%sca%`` - Behaves like ``%sc%``, but the number is *not* reset to 1 for each chapter. Instead it runs from - 1 from the beginning of the novel to produce an absolute scene count. - -``\\`` - This inserts a line break within the title. - -.. note:: - Header formatting only applies to novel documents. Headings in notes will be left as-is. - -**Example** - -* The format ``%title%`` just reproduces the title you set in the document. -* The format ``Chapter %ch%: %title%`` produces something like "Chapter 1: My Chapter Title". -* The format ``Scene %ch%.%sc%`` produces something like "Scene 1.2" for scene 2 in chapter 1. - - -.. _a_export_scenes: - -Scene Separators -================ - -If you don't want any titles for your scenes (or for your sections if you have them), you can leave -the formatting boxes empty. If so, an empty paragraph will be inserted between the scenes or -sections instead, resulting in a gap in the text. - -Alternatively, if you want a separator between them, like the common ``* * *``, you can enter the -desired separator text in the formatting box. In fact, if the format is a piece of static text, it -will always be treated as a separator. - - -.. _a_export_files: - -File Selection -============== - -Which documents and notes are selected for the build can be controlled from the options on the left -side of the dialog window. In addition, you can select to include the synopsis comments, regular -comments, keywords, and even exclude the body text itself if you just want an outline. - -.. tip:: - 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 documents from your exports, like draft documents or documents you -want to take out of your manuscript, but don't want to delete, you can set the documents as -"inactive" in the project tree. :guilabel:`Build Novel Project` tool has a switch to collectively -exclude inactive documents. - - -.. _a_export_print: - -Printing -======== - -The print button allows you to print the content in the preview window. You can either print to one -of your system's printers, or print directly to a file as PDF. You can also print to file from the -regular print dialog. The direct to file option is just a shortcut. - -.. note:: - The paper format should in all cases default to whatever your system default is. Of you want to - change it, you have to select it from the :guilabel:`Print Preview`` dialog. - - -.. _a_export_formats: - -Export Formats -============== - -Currently, six formats are supported. - -Open Document Format - The Build tool can produce either an ``.odt`` file, or an ``.fodt`` file. The latter is just a - flat version of the document format as a single XML file. Most rich text editors support the - former, and a few the latter. - -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 - word processors, or for printing from browser. - -novelWriter Markdown - This is simply a concatenation of the project documents selected by the filters. The documents - are stacked together in the order they appear in the project tree, 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/GitHub Markdown - The Markdown format comes in both Standard and GitHub flavour. The *only* difference in terms of - novelWriter functionality is the support for strikethrough text, which is not supported by the - Standard flavour, but *is* supported by the GitHub flavour. - - -.. _a_export_options: - -Additional Formats -================== - -In addition to the above document formats, the novelWriter HTML and Markdown formats can also be -wrapped in a JSON file. These files will have a meta data entry and a body entry. For HTML, also -the accompanying css styles are included. - -The text body is saved in a two-level list. The outer list contains one entry per document, in the -order they appear in the project tree. Each document is then split up into a list as well, with one -entry per paragraph it contains. - -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. diff --git a/docs/source/project_manuscript.rst b/docs/source/project_manuscript.rst new file mode 100644 index 00000000..0818e864 --- /dev/null +++ b/docs/source/project_manuscript.rst @@ -0,0 +1,185 @@ +.. _a_manuscript: + +*********************** +Building the Manuscript +*********************** + +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`. + +.. versionadded:: 2.1 + This tool is new for version 2.1. A simpler tool was used for earlier versions. The simpler tool + only allows you to define a single set of options for the build, but otherwise has much the same + functionality. + + +.. _a_manuscript_main: + +The Manuscript Build Tool +========================= + +.. figure:: images/fig_manuscript_build.png + + The :guilabel:`Manuscript Build` tool main window. + +The main window of the :guilabel:`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. + + +.. _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. + +.. 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. + + +Document Selection +------------------ + +.. figure:: images/fig_build_settings_selections.png + + The :guilabel:`Selections` page of the :guilabel:`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. + +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 +used to reset the override and return control to the filter settings. + +In the figure, the green arrow icon and the blue pin icon indicates which documents are included, +and the red forbidden icon indicates that a document is explicitly excluded. + + +Formatting Headings +------------------- + +.. figure:: images/fig_build_settings_headings.png + + The :guilabel:`Headings` page of the :guilabel:`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 like shown int he 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 +generated by the build tool. The :guilabel:`Insert` button is a dropdown list of these formats, and +selecting one will insert it at the position of the cursor. + +Any text you add that isn't highlighted in colours will remain in your formatted titles. +``{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. + +Scene Separators +^^^^^^^^^^^^^^^^ + +If you don't want any titles for your scenes (or for your sections if you have them), you can leave +the formatting boxes empty. If so, an empty paragraph will be inserted between the scenes or +sections instead, resulting in a gap in the text. You can also switch on the :guilabel:`Hide` +setting, which will ignore them completely. That is, there won't even be an extra gap inserted. + +Alternatively, if you want a separator text between them, like the common ``* * *``, you can enter +the desired separator text as the format. If the format is any piece of static text, it will always +be treated as a separator. + + +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. + + +.. _a_manuscript_build: + +Building Manuscript Documents +============================= + +.. figure:: images/fig_build_build.png + + The :guilabel:`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. + +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 +an output path, and set a base file name as well. The file extension will be added automatically. + +To generate the manuscript document, press the :guilabel:`Build` button. A small progress bar will +show the build progress, but for small projects it may pass very fast. + + +File Formats +------------ + +Currently, four document formats are supported. + +Open Document Format + The Build tool can produce either an ``.odt`` file, or an ``.fodt`` file. The latter is just a + flat version of the document format as a single XML file. Most rich text editors support the + former, and only a few the latter. + +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 + word processors, or for printing from browser. + +novelWriter Markup + This is simply a concatenation of the project documents selected by the filters into a ``.txt`` + file. The documents are stacked together in the order they appear in the project tree, 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/Extended Markdown + The Markdown format comes in both Standard and Extended flavour. The *only* difference in terms + of novelWriter functionality is the support for strikethrough text, which is not supported by + the Standard flavour. + + +Additional Formats +------------------ + +In addition to the above document formats, the novelWriter HTML and Markup formats can also be +wrapped in a JSON file. These files will have a meta data entry and a body entry. For HTML, also +the accompanying CSS styles used by the preview are included. + +The text body is saved in a two-level list. The outer list contains one entry per document, in the +order they appear in the project tree. Each document is then split up into a list as well, with one +entry per paragraph it contains. + +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. + + +.. _a_manuscript_print: + +Print and PDF +============= + +The :guilabel:`Print` button allows you to print the content in the preview window. You can either +print to one of your system's printers, or select PDF as your output format from the printer icon +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. diff --git a/docs/source/project_notes.rst b/docs/source/project_notes.rst deleted file mode 100644 index 2536225e..00000000 --- a/docs/source/project_notes.rst +++ /dev/null @@ -1,72 +0,0 @@ -.. _a_notes: - -************* -Project Notes -************* - -novelWriter doesn't have a database and complicated forms for filling in details about plot -elements, characters, and all sorts of additional information that isn't a part of the novel text -itself. Instead, all such information is saved in notes that are written and maintained just like -all other text in your project. - -The relation between all these additional elements is extracted from the documents and notes by the -project indexer, based on the tags and references you set within them. - -Using notes is not required, but making at least minimal notes for each plot element, and adding a -tag to them, makes it possible to use the Outline View to see how each element intersects with each -section of the novel itself, and adds clickable cross-references between documents in the editor -and viewer. - - -.. _a_notes_tags: - -Tags in Notes -============= - -Each new heading in a note can have a tag associated with it. The format of a tag is -``@tag: tagname``, where tagname is a unique identifier of your choosing. Tags can then be -referenced in the novel documents, or cross-referenced in other notes, and will show up in the -Outline View and in the back-reference panel when a document is opened in the viewer. See -:ref:`a_struct_tags` for how to reference notes. - -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. An invalid tag should have a green wiggly line under it, and will not receive the syntax -colour that valid tags do. - -The tag is the only part of these notes that the application uses. The rest of the document content -is there for the writer to use in whatever way they 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:`Build Novel Project` tool. - -One note can also reference another note in the same way novel documents do. When the note is -opened in the view panel, the references become clickable links, making it easier to follow -connections in the plot. Notes don't show up in the Outline View though, 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:`Build Novel Project` tool, the cross-references become clickable links in the - exported HTML document. - -Example of a project note with two headers, with separate tags, and with references to other notes: - -.. code-block:: none - :linenos: - - # Main Characters - - ## Jane Doe - - @tag: Jane - @location: Earth - - Something about Jane ... - - ## John Doh - - @tag: John - @location: Mars - - Something about John ... diff --git a/docs/source/project_overview.rst b/docs/source/project_overview.rst index b272f3f4..54467990 100644 --- a/docs/source/project_overview.rst +++ b/docs/source/project_overview.rst @@ -9,7 +9,7 @@ This will open the :guilabel:`New Project Wizard` that will assist you in creati project suited to your needs. A novelWriter project requires a dedicated folder for storing its files on the local file system. -See :ref:`a_storage` for further details on how files are organised. +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:`Open Project` dialog. A project can be removed from this list by selecting it and pressing the :kbd:`Del` key or @@ -29,92 +29,70 @@ Project Roots 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 novel documents go into a root folder of type :guilabel:`Novel`. 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 :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. 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 reference 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 +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 application on what you put in them. You can use them however you want. -.. tip:: - You can make multiple root folders of each kind if you wish to split up your notes. - -.. note:: - It is not the notes themselves that are referenced by the listed reference keywords, but tags - set within the notes. See the examples below and in :ref:`a_struct_tags`. +The root folder system is closesly connected to how the Tags and References system works. For more +details, see the :ref:`a_references` chapter. :guilabel:`Novel` - This is the root folder of all text that goes into the final novel or novels. This class of + 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` - This is the root folder 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 Outline View. Tags in this - folder can be references using the ``@plot`` keyword. + 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. :guilabel:`Characters` - Character notes go in this root folder. These are especially important if you want 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, or focusing on a particular character's storyline. Tags in - this 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 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. 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` - The locations folder is for various scene locations that you want to track. Tags in this folder - can be references using the ``@location`` keyword. + 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` - If the story has multiple plot timelines or jumps in time within the same plot, this class of - notes can be used to track this. Tags in this folder can be references using the ``@time`` + 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 important objects that change hands often, can be - tracked here. Tags in this folder can be references using the ``@object`` keyword. + 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. :guilabel:`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 folder can be references using the + the plot? They can be organised here. Tags in this type of folder can be references using the ``@entity`` keyword. :guilabel:`Custom` - The custom root folder can be used for tracking anything else not covered by the above options. - Tags in this folder can be references using the ``@custom`` keyword. + 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_struct_tags`. +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 - keyword. + keyword or what they do. -Example of a character note: - -.. code-block:: none - :linenos: - - # Jane Doe - - @tag: Jane - - Some information about the character Jane Doe. - -Example of a novel scene referencing the above character: - -.. code-block:: none - :linenos: - - ### Chapter 1, Scene 1 - - @pov: Jane - - When Jane woke up that morning ... +.. versionadded:: 2.0 + As of version 2.0, you can make multiple root folders of each kind to split up your project. .. _a_proj_roots_del: @@ -124,11 +102,11 @@ 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 project index and cannot be +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 deleted from the :guilabel:`Project` menu, or by pressing -:kbd:`Ctrl`:kbd:`Shift`:kbd:`Del`. Root folders can only be deleted when they are empty. +:kbd:`Ctrl+Shift+Del`. Root folders can only be deleted when they are empty. .. _a_proj_roots_out: @@ -137,15 +115,15 @@ Archived Documents ------------------ If you don't want to delete a document, or put it in the :guilabel:`Trash` folder where it may be -deleted, but still want it out of your main project tree, you can create an :guilabel:`Archive` -root folder. +deleted accidentally, but still want it out of your main project tree, you can create an +:guilabel:`Archive` root folder and move it there. You can drag any document to this folder and preserve its settings. The document will always be -excluded from the :guilabel:`Build Novel Project` builds. It is also removed from the project -index, so the tags and references defined in it will not show up anywhere else. +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. -.. _a_proj_roots_orph: +.. _a_proj_roots_orphaned: Recovered Documents ------------------- @@ -153,19 +131,19 @@ Recovered Documents If novelWriter crashes or otherwise exits without saving the project state, or if you're using a file synchronisation tool that runs out of sync, there may be files in the project folder that aren't tracked in the core project file. These files, when discovered, are recovered and added back -into the project if possible. +into the project. -The discovered files are scanned for meta information that give clues as to where the document may -previously have been located in the project. The project loading routines will try to put them back +The discovered files are scanned for metadata that give clues as to where the document may +previously have been located in the project. The project loading routine will try to put them back 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. If it cannot figure out which root folder is correct, the document -will be added to the :guilabel:`Novel` root folder. Only if the :guilabel:`Novel` folder is -missing will it give up. +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. -If the title of the document can be recovered, the word "Recovered:" will be added as a prefix. If -the title cannot be determined, the document will be named "Recovered File N" where N is a -sequential number. +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 +be named after its internal key, which is a string of characters and numbers. .. _a_proj_roots_lock: @@ -173,11 +151,11 @@ sequential number. Project Lockfile ---------------- -To prevent lost documents 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 present, you will be presented with a warning, and some information -about where else novelWriter thinks the project is also open. You will be give the option to ignore -this warning, and continue opening the project at your own risk. +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 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. .. note:: If, for some reason, novelWriter crashes, the lock file may remain even if there are no other @@ -198,18 +176,18 @@ 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 the novel, like for instance during export, these folders are -ignored. Only the order of the documents themselves matter. +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 the user 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 +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. -.. tip:: - You can 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. +.. 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: @@ -217,15 +195,17 @@ documents. Project Documents ================= -New documents can be created from the tool bar in the Project Tree, or by pressing -:kbd:`Ctrl`:kbd:`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`. +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. + +You can always rename an item by selecting :guilabel:`Rename Item` from the :guilabel:`Project` +menu, or by pressing :kbd:`F2`. Other settings for project items are available from the context menu that you can activate by -right-clicking on an item in the Project Tree. The :guilabel:`Transform` submenu includes options -for converting, splitting, or merging items. +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. .. _a_proj_files_counts: @@ -234,17 +214,18 @@ Word Counts ----------- A character, word and paragraph count is maintained for each document, as well as for each section -of a document following a header. 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 project tree for any document selected in the project or novel tree. +of a document following a :term:`heading`. 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. 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. 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 index. If the counts seem -wrong, a full project word recount can be initiated by rebuilding the project's index. Either form -the :guilabel:`Tools` menu, or by pressing :kbd:`F9`. +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`. .. _a_proj_settings: @@ -253,7 +234,7 @@ Project Settings ================ The :guilabel:`Project Settings` can be accessed from the :guilabel:`Project` menu, or by pressing -:kbd:`Ctrl`:kbd:`Shift`:kbd:`,`. This will open a dialog box, with a set of tabs. +:kbd:`Ctrl+Shift+,`. This will open a dialog box, with a set of tabs. Settings Tab @@ -263,26 +244,26 @@ The :guilabel:`Settings` tab holds the project name, title, and author settings. The :guilabel:`Project Name` can be set to a different value than the :guilabel:`Novel Title`. The difference between them is simply that the :guilabel:`Project Name` is used for the GUI (main -window title) and for generating the backup files. The intention is that the -:guilabel:`Project Name` should remain unchanged throughout the project's lifetime, otherwise the -name of exported files and backup files may change too. +window title) and for generating backup files. The intention is that the :guilabel:`Project Name` +should remain unchanged throughout the project's lifetime, otherwise the name of exported files and +backup files may change too. The :guilabel:`Novel Title` and :guilabel:`Authors` settings are used when building the manuscript, for some formats. -If your project is in a different language than your main spell checking is set to, you can -override the default spell checking language here. You can also override the automatic backup -setting. +If your project is in a different language than your main spell checking language is set to, you +can override the default setting here. You can also override the automatic backup setting. The +project language can also be changed from the :guilabel:`Tools` menu. Status and Importance Tabs -------------------------- -Each document or folder of type :guilabel:`Novel` can be given a *Status*_* label accompanied by a +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. -These are purely there for the user's convenience, and you are not required to use them for any +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 use these to indicate at what stage of completion each novel document is, or how important the content of a note is to the story. You don't have to use them this way, that's just what they were @@ -302,7 +283,7 @@ A set of automatically replaced keywords can be added in this tab. The keywords will be replaced by the text in the right column when documents are opened in the viewer. They will also be applied to manuscript builds. -The auto-replace feature will replace text in angle brackets that are in this list. The syntax +The auto-replace feature will replace text in angle brackets that is in this list. The syntax highlighter will add an alternate colour to text matching the syntax, but it doesn't check if the text is in this list. @@ -332,7 +313,7 @@ It is also possible to disable automated backups for a given project in .. 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 folder name for the zip files. + :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. @@ -343,19 +324,19 @@ Writing Statistics When you work on a project, a log file records when you opened it, when you closed it, and the total word counts of your novel documents and notes at the end of the session, provided that the -session lasted either more than 5 minutes, or that the total word count changed. You can view this -file in the ``meta`` folder in the directory where you saved your project. The file is named -``sessionStats.log``. +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 this file is available in the :guilabel:`Tools` menu under +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. +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 -application like for instance Libre Office Calc. +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`. +.. versionadded:: 1.2 + 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`. diff --git a/docs/source/project_references.rst b/docs/source/project_references.rst new file mode 100644 index 00000000..5a5ef85e --- /dev/null +++ b/docs/source/project_references.rst @@ -0,0 +1,178 @@ +.. _a_references: + +******************* +Tags and References +******************* + +In novelWriter there are no forms or tables to fill in to define the characters, locations and +other elements of your story. Instead, you can mark your :term:`project notes` as representing +these story elements by creating a :term:`tag`. Whenever you want to link a piece of your story to +a note defining a story element, like a character, you create a :term:`reference` back to that tag. +You can also cross-link your project notes in the same way. + +This is perhaps one of the features that makes novelWriter different from other, similar +applications. It is therefore not always obvious to new users how this is supposed to work, so +this chapter hopes to explains in more detail how to use the tags and references system. + +.. tip:: + If you find the Tags and Reference system difficult to follow just from reading this chapter, + you can create a new project in novelWriter and select to "Fill the project with example files" + in the :guilabel:`New Project Wizard`. The example project contains several examples of tags and + references. + + +.. _a_references_metadata: + +Metadata in novelWriter +======================= + +The structure of your novelWriter project is inferred from the :term:`headings` within the +documents, not the documents themselves. See :ref:`a_struct_heads` for more details. Therefore, +metadata is also associated with headings, and not documents. + +If you split your project into separate documents for each scene, this distinction may not matter. +However, there are several benefits to using documents at a larger structural scale when starting +your project. For instance, it may make more sense to define all your scenes, and even chapters, in +a single document at first, or perhaps a document per act. You can later split these documents up +using the document split feature. See :ref:`a_ui_tree_split_merge` for more details. + +The implication here is that you can treat each heading as an independent element of your notes +that can be referenced somewhere else. In order to make it possible to reference a header section, +you need to assign it a tag. + + +.. _a_references_tags: + +How to Use Tags +=============== + +A "tag" in novelWriter is a word or phrase that you define as belonging to a heading. Tags are set +by using the ``@tags`` :term:`keyword`. The full format of a tag is ``@tag: tagname``, where +``tagname`` is an identifier of your choosing. You can only set *one* tag per heading, and the tag +has to be unique across all documents in the project. + +.. note:: + In version 2.2, tags will be made case insensitive, but as of novelWriter 2.1 they are not. You + should however avoid using tags that are only distinguished by case. + +After the tags have been defined, they can then be referenced in the novel documents, or +cross-referenced in other notes. they will also show up in the :guilabel:`Outline View` and in the +back-reference panel when a document is opened in the viewer. + +The syntax highlighter will indicate to you 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. An invalid tag should have a green wiggly line under it, and will not receive the syntax +colour that valid tags do. + +The tag is the only part of these notes that the novelWriter uses. The rest of the document content +is there for the writer to use in whatever way they 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. + +Example of a heading with a tag for a character of the story: + +.. code-block:: none + + # Jane Doe + + @tag: Jane + + Some information about the character Jane Doe. + +When this is done in a document in a :term:`Root Folder` of type "Characters", the tag is +automatically treated as an available character in your project, and you will be able to reference +it in any of your other documents using the reference keywords for characters. + +It is the root folder type that defines what category of story elements the tag is indexed under. +See the :ref:`a_proj_roots` section for an overview of availabe root folder types. They are also +covered in the next section. + + +.. _a_references_references: + +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 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 +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. + +``@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. + +``@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. + +``@plot`` + The plot or subplot advanced in the current section. The target must be a note tag in a + :guilabel:`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. + +``@location`` + The location the current section takes place in. The target must be a note tag in a + :guilabel:`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. + +``@entity`` + Entities present in the current section. The target must be a note tag in a + :guilabel:`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. + +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. + +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 +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. + +Example of a novel document with references to characters and plots: + +.. code-block:: none + + ## Chapter 1 + + @pov: Jane + + ### Scene 1 + + @char: John, Sam + @plot: Main + + Once upon a time ... diff --git a/docs/source/project_structure.rst b/docs/source/project_structure.rst index 35cc861e..7787d784 100644 --- a/docs/source/project_structure.rst +++ b/docs/source/project_structure.rst @@ -4,10 +4,15 @@ Novel Structure *************** -This section covers the structure of a novel project. +This chapter covers the structure of a novel project. -It concerns documents under the :guilabel:`Novel` type root folder only. There are some -restrictions and features that only apply to these types of documents. +There are two different types of documents in a project, :guilabel:`Novel Documents` and +:guilabel:`Project Notes`. 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. + +The :guilabel:`Project Tree` can distinguish between the different header levels of the novel +documents using coloured icons, and optionally add emphasis on the label, set in +:guilabel:`Preferences`. .. _a_struct_heads: @@ -16,15 +21,16 @@ Importance of Headings ====================== Subfolders under root folders have no impact on the structure of the novel itself. The structure is -instead dictated by the heading level of the headers within the documents. +instead dictated by the heading level of the headings within the documents. Four levels of headings are supported, signified by the number of hashes (``#``) preceding the -title. See also the :ref:`a_fmt` section for more details about the markdown syntax. +title. See also the :ref:`a_fmt` section for more details about the markup syntax. .. note:: The header levels are not only important when generating the manuscript, they are also used by - the indexer when building the outline tree in the Outline as well as the Novel Tree. Each - heading also starts a new region where new references and tags can be defined. + 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 syntax for the four basic header types, and the two special header types, is listed in section :ref:`a_fmt_head`. The meaning of the four levels for the structure of your novel is as follows: @@ -32,7 +38,7 @@ The syntax for the four basic header types, and the two special header types, is **Header Level 1: Partition** This header level signifies that the text refers to a top level partition. 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 header level explained in :ref:`a_fmt_head`. + The novel title itself should use the special header level ``#!`` covered in :ref:`a_fmt_head`. **Header Level 2: Chapter** This header level signifies a chapter level partition. Each time you want to start a new @@ -49,18 +55,19 @@ The syntax for the four basic header types, and the two special header types, is **Header Level 4: Section** This header level signifies a sub-scene level partition, usually called a "section" in the - documentation and the user interface. These can be useful if you want to change tag references + 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. Page breaks are automatically added before level 1 and 2 headers when you build your project to a -format that supports page breaks, or when you print the document directly from the build tool. If -you want page breaks in other places, you have to specify them manually. See :ref:`a_fmt_break`. +format that supports page breaks, or when you print the document directly from the +:guilabel:`Manuscript Build` tool. 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 titles when building the manuscript. For instance, chapter numbers can be applied automatically, and so can scene numbers if you want - them in a draft manuscript. See the :ref:`a_export` page for more details. + them in a draft manuscript. See the :ref:`a_manuscript` page for more details. .. _a_struct_heads_title: @@ -89,13 +96,13 @@ 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 cam add a ``!`` to the level 2 header formatting code to tell the +chapters separate from this, you cam add an ``!`` to the level 2 header formatting code to tell the build tool to skip these chapters. ``##! Unnumbered Chapter Title`` -There is a separate formatting feature for such chapters in the :guilabel:`Build Novel Project` -tool as well. See the :ref:`a_export` page for more details. When building a document of a format +There is a separate formatting feature for such chapters 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. @@ -104,105 +111,3 @@ normal chapters. 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_tags: - -Note References -=============== - -Each text partition, indicated by a heading of any level, can contain references to tags set in the -project notes of the project. The references are gathered by the indexer and used to generate the -Outline View. This section covers how to make references to tags. See :ref:`a_notes_tags` for how -to define tags the references can point to. - -References and tags are also clickable in the document editor and viewer, making it easy to -navigate between reference notes while writing. Clicked links are always opened in the view panel. - -References are set as a 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 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. - -``@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. - -``@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. - -``@plot`` - The plot or subplot advanced in the current section. The target must be a note tag in a - :guilabel:`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. - -``@location`` - The location the current section takes place in. The target must be a note tag in a - :guilabel:`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. - -``@entity`` - Entities present in the current section. The target must be a note tag in a - :guilabel:`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. - -The syntax highlighter will alert the user that the tags and references are used correctly, and -that the tags referenced exist. - -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. - -Example of a novel document with references to characters and plots: - -.. code-block:: none - :linenos: - - ## Chapter 1 - - @pov: Jane - - ### Scene 1 - - @char: John, Sam - @plot: Main - - Once upon a time ... - - -.. _a_struct_layout: - -Document Layout -=============== - -All documents in the project can have a layout format set. Previously, there were multiple layouts -available to change how the documents where formatted on export. These have now been reduced to -just two layouts: :guilabel:`Novel Document` and :guilabel:`Project Note`. - -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. Project notes can be added anywhere in the -project. - -The project tree can distinguish between the different layouts and header levels of the documents -using coloured icons, and optionally add emphasis on the label (See the :guilabel:`Preferences`.) -For novel documents, the heading level of the first heading is recorded, and indicated by the icon. - -.. tip:: - You can always start writing with a coarse setup with one or a few documents, and then later use - the split tool to split the documents into separate chapter and scene documents. You can split a - document on any of the four header levels. diff --git a/docs/source/requirements.txt b/docs/source/requirements.txt index 19fc1423..ad8c84ca 100644 --- a/docs/source/requirements.txt +++ b/docs/source/requirements.txt @@ -1,5 +1,6 @@ sphinx-book-theme sphinx>=5.0 sphinx-favicon +sphinx-design pygments>=2.7 docutils>=0.17.1 diff --git a/docs/source/tech_locations.rst b/docs/source/tech_locations.rst index 29edfb3d..da199292 100644 --- a/docs/source/tech_locations.rst +++ b/docs/source/tech_locations.rst @@ -7,7 +7,7 @@ File Locations .. _QStandardPaths: https://doc.qt.io/qt-5/qstandardpaths.html novelWriter will create a few files on your system outside of the application folder itself. These -file locations are described in this document. +file locations are described in this chapter. .. _a_locations_conf: @@ -17,15 +17,16 @@ 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. +system. The system paths are provided by the Qt QStandardPaths_ class and its ``ConfigLocation`` +value. The standard paths are: * Linux: ``~/.config/novelwriter/novelwriter.conf`` -* macOS: ``~/Library/Preferences/novelwriter/novelwriter.conf`` +* MacOS: ``~/Library/Preferences/novelwriter/novelwriter.conf`` * Windows: ``C:\Users\\AppData\Local\novelwriter\novelwriter.conf`` - -Here, ``~`` corresponds to the user's home directory on Linux and macOS, and ```` is the + +Here, ``~`` corresponds to the user's home directory on Linux and MacOS, and ```` is the user's username on Windows. .. note:: @@ -40,15 +41,16 @@ 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. +saved here. The system paths are provided by the Qt QStandardPaths_ class and its +``AppDataLocation`` value. The standard paths are: * Linux: ``~/.local/share/novelwriter/`` -* macOS: ``~/Library/Application Support/novelwriter/`` +* MacOS: ``~/Library/Application Support/novelwriter/`` * Windows: ``C:\Users\\AppData\Roaming\novelwriter\`` - -Here, ``~`` corresponds to the user's home directory on Linux and macOS, and ```` is the + +Here, ``~`` corresponds to the user's home directory on Linux and MacOS, and ```` is the user's username on Windows. .. note:: diff --git a/docs/source/int_source.rst b/docs/source/tech_source.rst similarity index 83% rename from docs/source/int_source.rst rename to docs/source/tech_source.rst index 42009995..8c23463e 100644 --- a/docs/source/int_source.rst +++ b/docs/source/tech_source.rst @@ -8,13 +8,13 @@ Running from Source .. _PyPi: https://pypi.org/project/novelWriter/ .. _Sphinx Docs: https://www.sphinx-doc.org/ -This section describes various ways of running novelWriter directly from the source code, and how +This chapter describes various ways of running novelWriter directly from the source code, and how to build the various components like the translation files and documentation. .. note:: The text below assumes the command ``python`` corresponds to a Python 3 executable. Python 2 is - now deprecated, but many systems still have both Python 2 and 3. For such systems, the command - ``python3`` may be needed instead. Likewise, ``pip`` may need to be replaced with ``pip3``. + now deprecated, but on many systems the command ``python3`` may be needed instead. Likewise, + ``pip`` may need to be replaced with ``pip3``. Most of the custom commands for building packages of novelWriter, or building assets, are contained in the ``pkgutils.py`` script in the root of the source code. You can list the available commands @@ -30,11 +30,11 @@ by running: Dependencies ============ -novelWriter has been designed to rely on as few dependencies as possible. Aside from the packages -needed to communicate with the Qt GUI libraries, only one package is required for handling the XML -format of the main project file. Everything else is handled with standard Python libraries. +novelWriter has been designed to rely on as few dependencies as possible. Only the Python wrapper +for the Qt GUI libraries is required. The package for spell checking is optional, but recommended. +Everything else is handled with standard Python libraries. -The following Python packages are needed to run novelWriter: +The following Python packages are needed to run all features of novelWriter: * ``PyQt5`` – needed for connecting with the Qt5 libraries. * ``PyEnchant`` – needed for spell checking (optional). @@ -53,7 +53,6 @@ source, dependencies can still be installed from PyPi with: pip install -r requirements.txt .. note:: - On Linux distros, the Qt library is usually split up into multiple packages. In some cases, secondary dependencies may not be installed automatically. For novelWriter, the library files for renderring the SVG icons may be left out and needs to be installed manually. This is the @@ -70,7 +69,7 @@ build the package using the Python Packaging Authority's build tool. It can be i .. code-block:: bash - pip install --upgrade build + pip install build On Debian-based systems the tool can also be installed with: @@ -82,11 +81,11 @@ With the tool installed, run the following command from the root of the novelWri .. code-block:: bash - python -m build + python -m build --wheel -This should generate two files in the ``dist/`` folder at your current location. One with file -extension ``.tar.gz`` and one with extension ``.whl``. The latter is the package you want to -install, here with example version number 2.0.7, but yours may be different: +This should generate a ``.whl`` file in the ``dist/`` folder at your current location. The wheel +file can then be installed on your system. Here with example version number 2.0.7, but yours may be +different: .. code-block:: bash @@ -124,7 +123,8 @@ Building the Example Project ============================ In order to be able to create new projects from example files, you need a ``sample.zip`` file in -the ``assets`` folder of the source. This file can be built from setup script by running: +the ``assets`` folder of the source. This file can be built from the ``pkgutils.py`` script by +running: .. code-block:: bash @@ -152,7 +152,7 @@ The documentation can then be built from the root folder in the source code by r If successful, the documentation should be available in the ``docs/build/html`` folder and you can open the ``index.html`` file in your browser. -You can also build a PDF manual from the documentation using the setup script: +You can also build a PDF manual from the documentation using the ``pkgutils.py`` script: .. code-block:: bash diff --git a/docs/source/tech_storage.rst b/docs/source/tech_storage.rst index 10eb9cc8..66a8b12d 100644 --- a/docs/source/tech_storage.rst +++ b/docs/source/tech_storage.rst @@ -6,7 +6,7 @@ How Data is Stored .. _documentation: https://docs.novelwriter.io/ -This section contains details of how novelWriter stores and handles the project data. +This chapter contains details of how novelWriter stores and handles the project data. Project Structure @@ -23,20 +23,15 @@ 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. +its own "file system" where the project's 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 (except the index data), and a +number of related project settings. If this file is lost or corrupted, the structure of the project is lost, although not the text itself. It is important to keep this file backed up, either through the built-in backup tool, or your own backup solution. -.. tip:: - The novelWriter project folder is structured so that it can easily be added to a version control - system like git. If you do 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 and - are generally large files that change often. - The project XML file is indent-formatted, and is suitable for diff tools and version control since most of the file will stay static, although a timesetamp is set in the meta section on line 2, and various meta data entries incremented, on each save. @@ -54,34 +49,35 @@ various meta data entries incremented, on each save. Project Documents ================= -All the project documents are saved in a folder in the main project folder named ``content``. Each -document has a file handle based on a 52 bit random number, represented as a hexadecimal string. -The documents are saved with a filename assembled from this handle and the file extension ``.nwd``. +All the project documents are saved in a subfolder of the main project folder named ``content``. +Each document has a file handle based on a 52 bit random number, represented as a hexadecimal +string. The documents are saved with a filename assembled from this handle and the file extension +``.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, 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. +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 -what the user names the document within the project, or changes it to. This is particularly useful -when using a versioning system. +what you name the document within the project, or changes it to. This is particularly useful when +using a versioning system. 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 characters may become mangled when the file is opened in novelWriter again. -Editing these files is generally not recommended outside of special circumstances, whatever they -may be. The reason for this is that the index will not be automatically updated when doing so, -which means novelWriter doesn't know you've altered the file. If you do edit a file in this manner, -you should rebuild the index when you next open the project in novelWriter. +Editing these files is generally not recommended. The reason for this is that the index will not be +automatically updated when doing so, which means novelWriter doesn't know you've altered the file. +If you *do* edit a file in this manner, you should rebuild the index when you next open the project +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 +lines are mainly there to restore some information if the file is lost from the main 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. @@ -91,9 +87,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 then 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 to the storage medium. +If successful, the old data file is then removed, and the temporary file replaces it. This ensures +that the previously saved data is only replaced when the new data has been successfully saved to +the storage medium. 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. @@ -106,19 +102,19 @@ Project Meta Data The project folder contains a subfolder named ``meta``, containing a number of files. The meta folder contains semi-important files. That is, they can be lost with only minor impact to the -project. +project. All files in this folder are JSON or JSON Lines files, although some other files may +remain from earlier versions of novelWriter as they haven't all been JSON files in the past. If you use version control software on your project, you can exclude this folder, although you may -want to track the session log file and the custom words list. The JSON files within this folder can -safely be ignored as they will be automatically regenerated if lost. +want to track the session log file and the custom words list. The Project Index ----------------- -Between writing sessions, the project index is saved in a JSON file in ``meta/tagsIndex.json``. -This file is not critical. If it is lost, it can be rebuilt from within novelWriter from the -:guilabel:`Tools` menu. +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 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 @@ -131,10 +127,17 @@ check somehow fails and novelWriter keeps crashing, you can delete the file manu 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. + + Cached GUI Options ------------------ -A file named ``meta/guiOptions.json`` contains the latest state of various GUI buttons, switches, +A file named ``meta/options.json`` contains the latest state of various GUI buttons, switches, dialog window sizes, column sizes, etc, from the GUI. These are the GUI settings that are specific to the project. Global GUI settings are stored in the main config file. @@ -145,7 +148,7 @@ settings. Custom Word List ---------------- -A file named ``meta/wordlist.txt`` contains all the custom words you've added to the project for +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. @@ -153,18 +156,10 @@ you lose this file, all your custom spell check words will be lost too. Session Stats ------------- -The writing progress is saved in the ``meta/sessionStats.log`` file. This file records the length +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. - -Project Cache -============= - -The project ``cache`` folder contains non-critical files. If these files are lost, there is no -impact on the functionality of novelWriter or the history of the project. It contains temporary -files, like the preview document in the :guilabel:`Build Novel Project` tool. - -It should be excluded from version control tools if such are used. The folder will be removed -entirely in novelWriter 2.1. +Each session is recorded as a JSON object on a single line of the file. Each session record is +appended tot he file. diff --git a/docs/source/tech_tests.rst b/docs/source/tech_tests.rst index ae40e4d4..f4502594 100644 --- a/docs/source/tech_tests.rst +++ b/docs/source/tech_tests.rst @@ -34,12 +34,11 @@ Since several of the tests involve opening up the novelWriter GUI, you may want for the duration of the test run. Moving your mouse while the tests are running may otherwise interfere with the execution of some tests. -You can disable the renderring of the GUI by setting the flag ``export QT_QPA_PLATFORM=offscreen``, -or alternatively run the tests with the ``xvfb`` package, like so: +You can disable the renderring of the GUI by setting the flag ``QT_QPA_PLATFORM=offscreen``: .. code-block:: bash - xvfb-run pytest + export QT_QPA_PLATFORM=offscreen pytest Advanced Options @@ -51,7 +50,7 @@ You can also add coverage report generation. For instance to HTML: .. code-block:: bash - xvfb-run pytest -v --cov=novelwriter --cov-report=html + export QT_QPA_PLATFORM=offscreen pytest -v --cov=novelwriter --cov-report=html Other useful report formats are ``xml``, and ``term`` for terminal output. @@ -60,7 +59,7 @@ subpackage groups are ``base``, ``core``, and ``gui``. Consider for instance: .. code-block:: bash - xvfb-run pytest -v --cov=novelwriter --cov-report=html -m core + export QT_QPA_PLATFORM=offscreen pytest -v --cov=novelwriter --cov-report=html -m core This will only run the tests of the "core" package, that is, all the classes that deal with the project data of a novelWriter project. The "gui" tests, likewise, will run the tests for the GUI @@ -71,7 +70,7 @@ You can also filter the tests with the ``-k`` switch. The following will do the .. code-block:: bash - xvfb-run pytest -v --cov=novelwriter --cov-report=html -k testCore + export QT_QPA_PLATFORM=offscreen pytest -v --cov=novelwriter --cov-report=html -k testCore All tests are named in such a way that you can filter them by adding more bits of the test names. They all start with the word "test". Then comes the group: "Core", "Base", "Dlg", "Tool", or "Gui". @@ -80,6 +79,6 @@ file. For instance, running the following will run all tests for the document ed .. code-block:: bash - xvfb-run pytest -v --cov=novelwriter --cov-report=html -k testGuiEditor + export QT_QPA_PLATFORM=offscreen pytest -v --cov=novelwriter --cov-report=html -k testGuiEditor To run a single test, simply add the full test name to the ``-k`` switch. diff --git a/docs/source/usage_breakdown.rst b/docs/source/usage_breakdown.rst index 5b84b080..b6899f44 100644 --- a/docs/source/usage_breakdown.rst +++ b/docs/source/usage_breakdown.rst @@ -6,12 +6,11 @@ How it Works .. _Fusion: https://doc.qt.io/qt-6/gallery.html .. _Pandoc: https://pandoc.org/ -.. _Typicons: https://github.com/stephenhutchings/typicons.font .. _Open Document: https://en.wikipedia.org/wiki/OpenDocument -The main features of novelWriter are listed in the :ref:`a_intro` section. Here, we go into some -more details on how they are implemented. This is intended as an overview. Later on in this -documentation, these features will be covered in even more detail. +The main features of novelWriter are listed in the :ref:`a_intro` chapter. In this chapter, we go +into some more details on how they are implemented. This is intended as an overview. Later on in +this documentation, these features will be covered in more detail. .. _a_breakdown_design: @@ -20,71 +19,86 @@ GUI Layout and Design ===================== The user interface of novelWriter 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. +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, is more or less redundant. However, -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` section. +clutter, and since the documents are formatted with style tags, it is more or less redundant. +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. .. note:: novelWriter is not intended to be a full office type word processor. It doesn't support images, links, tables, and other complex structures and objects often needed for such documents. Formatting is limited to headers, emphasis, text alignment, and a few other simple features. -On the left edge 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 Novel Project` tool, and a set -of project-related tools as well as quick access to settings at the bottom. +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 +project-related tools and quick access to settings at the bottom. Project Tree View ----------------- +.. figure:: images/fig_project_tree_view.png + + A screenshot of the Project Tree 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. An optional third panel on the right is 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 -if you wish as it will apply the formatting tags you have specified. The main purpose of the viewer -is for viewing your notes next to your editor while you're writing. +your project. The second panel is the document editor. + +An optional third panel on the right 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 as it will apply the +formatting tags you have specified. 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 header, or by pressing :kbd:`F8`. When :guilabel:`Focus Mode` is enabled, all the user +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. Novel Tree View --------------- +.. figure:: images/fig_novel_tree_view.png + + A screenshot of the Novel Tree View. + When in :guilabel:`Novel Tree View` mode, the project tree is replaced by an overview of your novel -structure. Instead of showing individual documents, the tree now shows all headings of your novel -text. This includes multiple headings within the same document. +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 view to indicate which ones belong together in the same document. If you have multiple Novel root folders, the header of the novel view becomes a dropdown box. You -can then switch between them by clicking the "Outline of ..." text. You can also click the novel -icon button next to it. +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 initiated though. You can adjust the aut-save interval in -:guilabel:`Preferences`. You can also regenerate the whole novel view by pressing the refresh -button at the top. +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 at the top of the side panel. It is possible to show an optional third column in the novel view, The settings are available from -the menu button ath the top. +the menu button in the toolbar. -If you click the arrow icon to the right of each item, a tooltip will pop up showing you all the -meta data collected for that heading entry. +If you click the arrow icon to the right of each item, a tooltip will pop out showing you all the +meta data collected for that heading. Novel Outline View ------------------ +.. figure:: images/fig_outline_view.png + + 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. @@ -97,20 +111,18 @@ The app will remember you column order and size between sessions, and for each i Colour Themes ------------- -The default colour theme of the user interface is the default theme from the Qt library. By -default, novelWriter is loaded with the Fusion_ style setting. (You can override this with the -``--style=`` setting when starting novelWriter.) +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. -There is a standard dark theme provided as well, which is similar to the default Qt theme. Some -other light and dark colour themes are also provided. You can select which one you prefer from in -:guilabel:`Preferences` . - -A number of syntax highlighting themes are also available in :guilabel:`Preferences`. These are -separate settings because there are a lot more options for syntax highlighting. +Switching the GUI colour theme does not affect the colours of the editor and viewer. They have +separate colour themes called :guilabel:`Editor Themes`. They are separated because there are a lot +more options to choose from for the editor and viewer. .. note:: - If you switch to dark mode on the GUI, you should also switch syntax highlighting theme to - match, otherwise icons may be hard to see in the editor and viewer. + If you switch to 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. .. _a_breakdown_project: @@ -127,23 +139,28 @@ you. All that matters to novelWriter is the linear order the documents appear at tree (top to bottom). The chapters, scenes and sections of the novel are determined by the headings within those documents. +.. figure:: images/fig_header_levels.png + + An illustration of how header levels correspond to the novel structure. + The four heading levels (**H1** to **H4**) are treated as follows: -* **H1** is used for the book title, and for partitions. +* **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. +* **H3** is used for scene titles -- optionally replaced by separators. * **H4** 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. -This header level structure is only taken into account for novel documents. For the project notes, -the header levels have no structural meaning, and the user is free to do whatever they want. See -:ref:`a_struct` and :ref:`a_notes` for more details. +This header level structure is only taken into account for :term:`novel documents`. For +:term:`project notes`, the header levels have no structural meaning, and the user is free to do +whatever they want. See :ref:`a_struct` and :ref:`a_references` for more details. -.. note:: - You can add documents as child items of other documents if you wish. This is often more useful - than adding folders, since you anyway may want to have the chapter heading in a separate - document from your individual scene documents. +.. versionadded:: 2.0 + You can add documents as child items of other documents. This is often more useful than adding + folders, since you anyway may want to have the chapter heading in a separate document from your + individual scene documents so that you can rearrange scene documents freely without affecting + chapter placement. .. _a_breakdown_export: @@ -152,23 +169,24 @@ Building the Manuscript ======================= The project can at any time be assembled into a range of different formats through the -:guilabel:`Build Novel Project` tool. Natively, novelWriter supports `Open Document`_, HTML5, and +:guilabel:`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. In addition, printing -and printing to PDF is also possible. +is also possible. Print to PDF is available from the print dialog. -You can also export the content of the project to a JSON file. This is useful if you want to write -your own 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 either with HTML -formatted text, or with the raw text as typed into the novel documents. See :ref:`a_export_options` -for more details. +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. -A number of filter options can be applied to the :guilabel:`Build Novel Project` tool, allowing you -to make a draft manuscript, a reference document of notes, an outline based on chapter and scene -titles with a synopsis each, and so on. See :ref:`a_export` for more details on build features and -formats. +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. .. _a_breakdown_storage: @@ -178,32 +196,35 @@ Project Storage The files of a novelWriter project are stored in a dedicated project folder. The project structure is kept in a file at the root of this folder called ``nwProject.nwx``. All the document files and -associated meta data is stored in the other folders below the project folder. For more technical +associated meta data is stored in other folders below the project folder. For more technical details about what all the files mean and how they're organised, see the :ref:`a_storage` section. -This way of storing data was chosen for several reasons. Firstly, all the text you add to your -project is saved directly to your project folder in separate files. Only the project structure and -the text you are currently editing is stored in memory at any given time. Secondly, having multiple -small files means it is very easy to sync them between computers with standard file synchronisation -tools. Thirdly, if you use version control software to track the changes to your project, the file -formats used for the files are well suited. Also the JSON documents have line breaks and indents, -which makes it easier to track them with version control software. +This way of storing data was chosen for several reasons. + +Firstly, all the text you add to your project is saved directly to your project folder in separate +files. Only the project structure and the text you are currently editing is stored in memory at any +given time, which means there is a smaller risk of losing data if the application or your computer +crashes. + +Secondly, having multiple small files means it is very easy to synchronise them between computers +with standard file synchronisation tools. + +Thirdly, if you use version control software to track the changes to your project, the file formats +used for the files are well suited. Also the JSON documents have line breaks and indents, which +makes it easier to track them with version control software. .. note:: - Since novelWriter has to keep track of a bunch of files and folders when a project is open, it may not run well on some virtual file systems. A file or folder must be accessible with exactly the path it was saved or created with. An example where this is not the case is the way Google Drive is mapped on Linux Gnome desktops using gvfs/gio. .. caution:: + You should not add additional files to the project folder yourself. Nor should you,a s a rule, + manually edit files within it. If you really must manually edit the text files, e.g. with some + automated task you want to perform, you need to rebuild the :term:`Project Index` when you open + the project again. - You should not add additional files to the project folder yourself. Nor should you manually edit - files within it as a general rule. If you really must manually edit the text files, e.g. with - some automated task you want to perform, you need to rebuild the index when you open the project - again. - - Editing text files in the ``content`` folder is less risky as they are just plain text. Editing + Editing text files in the ``content`` folder is less risky as these are just plain text. Editing the main project XML file, however, may make the project file unreadable and you may crash novelWriter and lose project structure information and project settings. - diff --git a/docs/source/usage_format.rst b/docs/source/usage_format.rst index 63a860c9..4b159491 100644 --- a/docs/source/usage_format.rst +++ b/docs/source/usage_format.rst @@ -10,8 +10,8 @@ values and allowing for some text formatting. The syntax is based on Markdown, b (bold) and strikethrough text, as well as four levels of headings. In addition to formatting codes, novelWriter allows for comments, a synopsis tag, and a set of -keyword and value sets used for tags and references. There are also some codes that apply two whole -paragraphs. See :ref:`a_fmt_text` below for more details. +keyword and value sets used for :term:`tags` and :term:`references`. There are also +some codes that apply to whole paragraphs. See :ref:`a_fmt_text` for more details. .. _a_fmt_hlight: @@ -24,8 +24,13 @@ formtatting tags or other features correctly. It will change the colour and font headings, change the text colour of emphasised text, and it can also show you where you have dialogue in your text. +.. figure:: images/fig_references.png + + An example of the colour highlighting of references. "Bob" is not defined, and "@blabla" is not + a valid reference type. + When you use the commands to set tags and references, these also change colour. Correct commands -have a dedicated colour, and the references themselves will get a colour if they are valid. Invalid +have a distinct colour, and the references themselves will get a colour if they are valid. Invalid 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 @@ -37,10 +42,14 @@ can select them for :guilabel:`Preferences`. Headings ======== -Four levels of headings are allowed. For project notes, they are free to be used as you see fit. -That is, novelWriter doesn't assign the different headings any particular meaning. However, for -novel documents they indicate the structural level of the novel and must be used correctly to -produce the intended result. See :ref:`a_struct_heads` for more details. +.. figure:: images/fig_header_levels.png + + An illustration of how header levels correspond to the novel structure. + +Four levels of headings are allowed. For :term:`project notes`, they are free to be used as you see +fit. That is, novelWriter doesn't assign the different headings any particular meaning. However, +for :term:`novel documents` they indicate the structural level of the novel and must be used +correctly to produce the intended result. See :ref:`a_struct_heads` for more details. ``# Title Text`` Heading level one. For novel documents, the header level indicates the start of a new partition. @@ -56,7 +65,7 @@ produce the intended result. See :ref:`a_struct_heads` for more details. ``#### Title Text`` Heading level four. For novel documents, the header level indicates the start of a new section. - Section titles can be replaced by separators or removed completely when building the manuscript. + Section titles can be replaced by separators or ignored completely when building the manuscript. For headers level one and two, adding a ``!`` modifies the behaviour of the heading: @@ -87,10 +96,9 @@ paragraph. In addition, the editor supports a few additional types of whitespaces: -* A non-breaking space can be inserted with :kbd:`Ctrl`:kbd:`K`, :kbd:`Space`. -* Thin spaces are also supported, and can be inserted with :kbd:`Ctrl`:kbd:`K`, - :kbd:`Shift`:kbd:`Space`. -* Non-breaking thin space can be inserted with :kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`Space`. +* A non-breaking space can be inserted with :kbd:`Ctrl+K`, :kbd:`Space`. +* 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. They are also listed in :ref:`a_kb_ins`. @@ -141,7 +149,6 @@ In addition, the following rules apply: allow for formatting, and any formatting markup will be renderred as-is. .. tip:: - novelWriter supports standard escape syntax for the emphasis markup characters in case the editor misunderstands your intended usage of them. That is, ``\*``, ``\_`` and ``\~`` will generate a plain ``*``, ``_`` and ``~``, respectively, without interpreting them as part of the @@ -158,9 +165,9 @@ The text of a comment is ignored by the word counter. The text can also be filte building the manuscript or viewing the document. If the first word of a comment is ``Synopsis:`` (with the colon included), the comment is treated -specially 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. +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...`` This is a comment. The text is not renderred by default (this can be overridden), seen in the @@ -183,15 +190,22 @@ Tags and References =================== The document editor supports a set of keywords used for setting tags, and making references between -documents. The tag can be set once per section defined by a heading. Setting it multiple times -under the same heading will just override the previous setting. References can be set anywhere -within a section, and are collected according to their category. +documents. + +Tags use the command ``@tag:`` to define a tag. The tag can be set once per section defined by a +heading. Setting it multiple times under the same heading will just override the previous setting. + +``@tag: value`` + A tag commad 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 on the form: ``@keyword: value`` - A keyword argument followed by a value, or a comma separated list of values. + A reference keyword followed by a value, or a comma separated list of values. -The available tag and reference keywords are listed in the :ref:`a_struct_tags` section. They can -also be inserted at the cursor position in the editor via the :guilabel:`Insert` menu. +Tags andreferences 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. .. _a_fmt_align: @@ -200,7 +214,7 @@ Paragraph Alignment and Indentation =================================== All documents have the text by default aligned to the left or justified, depending on your -Preferences. +settings in :guilabel:`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 @@ -248,10 +262,24 @@ headers of level two for novel documents, i.e. chapters, but not for project not 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. -Page breaks are automatically added to partition, chapter and unnumbered chapter headers of novel -documents. If you want such breaks for scenes and sections, you must add them manually. +If you want page breaks for scenes and sections, you must add them manually. .. note:: The page break code is applied to the text that follows it. It adds a "page break before" mark to the text when exporting to HTML or Open Document. This means that a ``[NEW PAGE]`` which has no text following it, it will not result in a page break. + +**Example:** + +.. code-block:: markdown + + This is a text paragraph. + + [VSPACE:2] + + This is another text paragraph, but there will be two empty paragraphs + in-between them. + + [NEWPAGE] + + This text will always start on a new page if the build format has pages. diff --git a/docs/source/usage_interface.rst b/docs/source/usage_interface.rst deleted file mode 100644 index 1b560743..00000000 --- a/docs/source/usage_interface.rst +++ /dev/null @@ -1,277 +0,0 @@ -.. _a_ui: - -****************** -The User Interface -****************** - -.. _Compose Key: https://en.wikipedia.org/wiki/Compose_key - -This sections covers in more detail what all the information on the user interface is for, and how -you can organise your project, and how you use the editor, viewer and outline panel. - - -.. _a_ui_tree: - -The Project Tree -================ - -The main window contains a project tree in the left-most panel. It shows the entire structure of -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. - -**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 subdocuments. If the counts seem incorrect, they can be updated - by rebuilding the project index from the :guilabel:`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 Novel Project` tool, you can - filter based on this flag. You can change this value from the 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. You can change these labels from the - context menu. - -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. - -* The first button is a quick links button that will show you a dropdown menu of all the root - folders in your project. Selecting one will move to that position in the tree. You can also - activate this menu by pressing :kbd:`Ctrl`:kbd:`L`. -* The next two buttons can be used to move items up and down in the project tree. This is the only - way to move root folders. -* The next button opens a dropdown menu for adding new items to the tree. This includes root - folders. You can also activate this dropdown menu by pressing :kbd:`Ctrl`:kbd:`N`. -* The last button is a menu of further actions on the entire project tree. - -.. tip:: - Under the :guilabel:`Transform` submenu in the context menu of an item, you will find several - options on how to change a document or folder. This includes changing between document and note, - splitting them into multiple documents, or merging child items into a single document. - -Below the project tree you will find a small details panel showing the full information of the -currently selected item. This panel also includes the latest paragraph and character counts in -addition to the word count. - - -.. _a_ui_tree_novel: - -The Novel Tree --------------- - -An alternative way to view the project structure is the novel tree. You can switch to this view by -selecting the :guilabel:`Novel Tree View` button in the sidebar. This view is a simplified version -of the view in the :guilabel:`Outline`. 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 tree, or add any new documents, as that would - imply restructuring the content of the document files. Any editing must be done in the project - tree. However, you can add new headings to existing documents, or change references, which will - be updated in this view. - - -.. _a_ui_tree_status: - -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. The app doesn't do anything with them at all. To -modify the labels, go to their respective tabs in :guilabel:`Project Settings`. - -The "Status" flag is intended to tag a Novel document as for instance a draft or as completed, and -the "Importance" flag is intended to tag character notes, or other notes, as for instance a main, -major or minor character. - -Whether a document uses a "Status" or "Importance" flag depends on which root folder it lives in. -If it's in the :guilabel:`Novel` folder, it uses the "Status" flag, otherwise it uses an -"Importance" flag. Some folders, like :guilabel:`Trash` and :guilabel:`Archive` allow both. - - -.. _a_ui_tree_dnd: - -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 build tool. - -Drag & drop has only limited support for moving documents. In general, bulk actions are not -allowed. This is deliberate to avoid accidentally messing up your project. If you make a mistake, -the last move action can be undone by pressing :kbd:`Ctrl`:kbd:`Shift`:kbd:`Z`. - -Documents and their folders can be rearranged freely within their root folders. If you move a Novel -documents 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 :guilabel:`Novel` 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 & dropped at all. If you want to reorder them, -you can move them up or down with respect to eachother from the arrow buttons at the top of the -project tree, or by pressing :kbd:`Ctrl`:kbd:`Shift` and the :kbd:`Up` or :kbd:`Down` key. - - -.. _a_ui_edit: - -Editing and Viewing Documents -============================= - -To edit a document, double-click it in the project tree, or press the :kbd:`Return` key while -having it selected. This will open the document in the document editor. The editor uses a -Markdown-like syntax for some features, and a novelWriter-specific syntax for others. The syntax -format is described in the :ref:`a_fmt` section. - -The editor has a maximise button (toggles the :guilabel:`Focus Mode`) and a close button in the -top–right corner. On the top–left side you will find an edit button that opens the -:guilabel:`Item Label` dialog for the currently open document, and a search button to open the -search dialog. - -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`:kbd:`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. - -The document viewed does not have to be the same document as currently being edited. However, If -you *are* viewing the same document, pressing :kbd:`Ctrl`:kbd:`R` again will update the document -with your latest changes. You can also press the reload button in the top–right corner of the view -panel, next to the close button, to achieve the same thing. - -Both the document editor and viewer will show the label of the 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`. - -.. tip:: - Clicking on the document title bar will select the document in the project tree and reveal its - location, making it easier to locate in a large project. - -Any tag reference in the editor can be opened in the viewer by moving the cursor to the label and -pressing :kbd:`Ctrl`:kbd:`Return`. You can also control-click them with your mouse. In the viewer, -the references become clickable links. Clicking them will replace the 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. - -At the bottom of the view panel there is a :guilabel:`References` panel. (If it is hidden, click -the icon to reveal it.) This panel will show links to all documents referring back to the one -you're currently viewing, if any has been defined. The :guilabel:`Sticky` button will freeze the -content of the panel to the current document, even if you navigate to another document. This is -convenient if you want to quickly look through all documents in the list in the -:guilabel:`References` panel without losing the list in the process. - -.. note:: - The :guilabel:`References` panel relies on an up-to-date 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`. - - -.. _a_ui_edit_search: - -Search & Replace ----------------- - -The document editor has a search and replace tool that can be activated with :kbd:`Ctrl`:kbd:`F` -for search mode or :kbd:`Ctrl`:kbd:`H` for search and replace mode. - -Pressing :kbd:`Return` while in the search box will search for the next occurrence of the word, and -:kbd:`Shift`:kbd:`Return` for the previous. Pressing :kbd:`Return` in the replace box, will replace -the highlighted text and move to the next result. - -There are a number of settings for the search tool available as toggle switches above the search -box. They allow you to search for, in order: matched case only, whole word results only, search -using regular expressions, loop search when reaching the end of the document, and move to the next -document when reaching the end. There is also a switch that will try to match the case of the word -when the replacement is made. That is, it will try to keep the word upper, lower, or capitalised to -match the word being replaced. - -The regular expression search is somewhat dependant on which version of Qt your system has. If you -have Qt 5.13 or higher, there is better support for unicode symbols in the search. - -.. seealso:: - - For more information on the capabilities of the Regular Expression option, see the Qt - documentation for the `QRegularExpression `_ - class. - - -.. _a_ui_edit_auto: - -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. - -.. tip:: - If you don't like auto-replacement, all symbols inserted by this feature are also available in - the :guilabel:`Insert` menu, and via convenient :ref:`a_kb_ins`. You may also be using a - `Compose Key`_ setup, which means you may not need the auto-replace feature. - -The editor is able to replace two and three hyphens with short and long dashes, triple points with -ellipsis, and replace straight single and double quotes with user-defined quote symbols. It will -also try to determine whether to use the opening or closing symbol, although this feature isn't -always accurate. Especially distinguishing between closing single quote and apostrophe can be -tricky for languages that use the same symbol for these, like English does. - -.. tip:: - If the auto-replace feature changes a symbol when you did not want it to change, pressing - :kbd:`Ctrl`:kbd:`Z` immediately after the auto-replacement will undo it without undoing the - character you typed. - - -.. _a_ui_outline: - -Project Outline View -==================== - -The project's Outline view is available as another view option from the views bar. 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 it occurs. Double-clicking an entry will open the corresponding document in the -editor. - -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. - -.. note:: - Since the internal structure of the novel does not depend directly on the folder and document - structure of the project tree, these will not necessarily look the same, depending on how you - choose to organise your documents. See the :ref:`a_struct` page for more details. - -Various meta data and information extracted from tags can be displayed in columns in the outline. -A default set of such columns is visible, but you can turn on or off more columns from the menu -button in the toolbar. The order of the columns can also be rearranged by dragging them to 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 information viewed in the outline is based on the project's main index. While novelWriter does -its best to keep the index up to date when contents change, you can always rebuild it manually by -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`. diff --git a/docs/source/usage_project.rst b/docs/source/usage_project.rst new file mode 100644 index 00000000..4229b6eb --- /dev/null +++ b/docs/source/usage_project.rst @@ -0,0 +1,220 @@ +.. _a_ui_project: + +************* +Project Views +************* + +This chapter covers in more detail the different project views available in novelWriter. + +.. figure:: images/fig_project_tree_detailed.png + + The Project Tree as it appears when loading a sample project. + + +.. _a_ui_tree: + +The Project Tree +================ + +The main window contains a project tree in the left-most panel. It shows the entire structure of +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. + +**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 subdocuments. 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`. + +**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 + :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`. + +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. + +* The first button is a quick links button that will show you a dropdown menu of all the + :term:`root folders` in your project. Selecting one will move to that position in + the tree. You can also activate this menu by pressing :kbd:`Ctrl+L`. +* The next two buttons can be used to move items up and down in the project tree. This is the only + way to move root folders. +* The next button opens a dropdown menu for adding new items to the tree. This includes root + folders. You can also activate this dropdown menu by pressing :kbd:`Ctrl+N`. +* The last button is a menu of further actions you can apply to the project tree. + +Below the project tree you will find a small details panel showing the full information of the +currently selected item. This panel also includes the latest paragraph and character counts in +addition to the word count. + + +.. _a_ui_tree_split_merge: + +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. + +Splitting Documents +^^^^^^^^^^^^^^^^^^^ + +.. figure:: images/fig_project_split_tool.png + + The :guilabel:`Split Document` dialog. + +The :guilabel:`Split Document by Header` 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. + +The source document *is not* deleted in the process, but you have the option to let the tool move +the source document to the :guilabel:`Trash` folder. + +Merging Documents +^^^^^^^^^^^^^^^^^ + +.. figure:: images/fig_project_merge_tool.png + + The :guilabel:`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. + +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. + +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. + + +.. _a_ui_tree_status: + +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. novelWriter doesn't do anything with them at all. +To modify the labels, go to their respective tabs in :guilabel:`Project Settings`. + +The "Status" flag is intended to tag a :term:`novel document` 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 :guilabel:`Novel` folder, it uses the "Status" flag, otherwise it uses an +"Importance" flag. Some folders, like :guilabel:`Trash` and :guilabel:`Archive` allow both. + + +.. _a_ui_tree_dnd: + +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. + +Drag & drop has only limited support for moving documents. In general, bulk actions are not +allowed. This is deliberate to avoid accidentally messing up your project. If you make a mistake, +the last move action can be undone by pressing :kbd:`Ctrl+Shift+Z` or from the menu icon in the +project tree's toolbar. + +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 :guilabel:`Novel` 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 & dropped at all. If you want to reorder them, +you can move them up or down with respect to eachother from the arrow buttons at the top of the +project tree, or by pressing :kbd:`Ctrl+Shift+Up` or :kbd:`Ctrl+Shift+Down` when they are selected. + + +.. _a_ui_tree_novel: + +The Novel Tree +============== + +.. figure:: images/fig_novel_tree_view.png + + A screenshot of the Novel Tree View. + +An alternative way to view the project structure is the novel tree. You can switch to this view by +selecting the :guilabel:`Novel Tree 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. + +.. note:: + You cannot reorganise the entries in the novel tree, or add any new documents, as that would + imply restructuring the content of the document files themselves. Any such editing must be done + in the project tree. However, you can add new headings to existing documents, or change + references, which will be updated in this view when the document is saved. + + +.. _a_ui_outline: + +Project Outline View +==================== + +.. figure:: images/fig_outline_view.png + + A screenshot of the Novel Outline View. + +The project's :guilabel:`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. + +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. + +.. note:: + Since the internal structure of the novel does not depend directly on the folder and document + structure of the project tree, this view will not necessarily look the same, depending on how + you choose to organise your documents. See the :ref:`a_struct` page for more details. + +Various meta data and information extracted from :term:`tags` can be displayed in columns in +the outline. A default set of such columns is visible, but you can turn on or off more columns from +the menu button in the toolbar. The order of the columns can also be rearranged by dragging them to +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 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 +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`. diff --git a/docs/source/usage_projectformat.rst b/docs/source/usage_projectformat.rst index 6d357a69..58f8525e 100644 --- a/docs/source/usage_projectformat.rst +++ b/docs/source/usage_projectformat.rst @@ -8,18 +8,17 @@ Project Format Changes .. _documentation: https://docs.novelwriter.io/ Most of the changes to the file formats over the history of novelWriter have no impact on the -user-side of things. The project files are generally updated automatically. However, some of the +user side of things. The project files are generally updated automatically. However, some of the changes require minor actions from the user. -The key changes in the formats are listed below, as well as the user actions required, where -applicable. +The key changes in the formats are listed in this chapter, as well as the user actions required, +where applicable. .. only:: not html A full project file format specification is available in the online documentation_. .. caution:: - When you update a project from one format version to the next, the project can no longer be opened by a version of novelWriter prior to the version where the new file format was introduced. You will get a notification about any updates to your project file format and will @@ -71,7 +70,7 @@ Format 1.3 Changes This project format was introduced in novelWriter version 1.5. -With this format, the number of document layouts was reduced from 8 to 2. The conversion of +With this format, the number of document layouts was reduced from eight to two. The conversion of document layouts is performed automatically when the project is opened. Due to the reduction of layouts, some features that were previously controlled by these layouts @@ -85,7 +84,7 @@ should be used only a few places in any given project. These are as follows: * The formatting of the level one title on the title page must be changed from ``# Title Text`` to ``#! Title Text`` in order to retain the previous functionality. See :ref:`a_fmt_head`. -* Any text that was previously centred on the page must be manually centred using the new text +* Any text that was previously centred on the page must be manually centred using the text alignment feature. See :ref:`a_fmt_align`. **Unnumbered Chapters** diff --git a/docs/source/usage_shortcuts.rst b/docs/source/usage_shortcuts.rst index 3eda423d..764b5240 100644 --- a/docs/source/usage_shortcuts.rst +++ b/docs/source/usage_shortcuts.rst @@ -5,10 +5,10 @@ Keyboard Shortcuts ****************** Most features in novelWriter are available as keyboard shortcuts. This is a reference list if these -shortcuts. Most of them are also listed in the application. +shortcuts. Most of them are also listed in the application's user interface. .. note:: - On macOS, replace :kbd:`Ctrl` with :kbd:`Cmd`. + On MacOS, replace :kbd:`Ctrl` with :kbd:`Cmd`. .. _a_kb_main: @@ -19,24 +19,24 @@ Main Window Shortcuts .. csv-table:: :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:`F9`", "Re-build the project index" - ":kbd:`F11`", "Toggle full screen mode" - ":kbd:`Alt`:kbd:`1`", "Switch focus to the project tree (Windows :kbd:`Ctrl`:kbd:`Alt`:kbd:`1`)" - ":kbd:`Alt`:kbd:`2`", "Switch focus to document editor (Windows :kbd:`Ctrl`:kbd:`Alt`:kbd:`2`)" - ":kbd:`Alt`:kbd:`3`", "Switch focus to document viewer (Windows :kbd:`Ctrl`:kbd:`Alt`:kbd:`3`)" - ":kbd:`Alt`:kbd:`4`", "Switch focus to outline view (Windows :kbd:`Ctrl`:kbd:`Alt`:kbd:`4`)" - ":kbd:`Ctrl`:kbd:`,`", "Open the :guilabel:`Preferences` dialog" - ":kbd:`Ctrl`:kbd:`Q`", "Exit novelWriter" - ":kbd:`Ctrl`:kbd:`Shift`:kbd:`,`", "Open the :guilabel:`Project Settings` dialog" - ":kbd:`Ctrl`:kbd:`Shift`:kbd:`O`", "Open a project" - ":kbd:`Ctrl`:kbd:`Shift`:kbd:`S`", "Save the current project" - ":kbd:`Ctrl`:kbd:`Shift`:kbd:`W`", "Close the current project" - ":kbd:`Shift`:kbd:`F1`", "Open the local user manual (PDF) if it is available" - ":kbd:`Shift`:kbd:`F6`", "Open the :guilabel:`Project Details` dialog" + ":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:`F9`", "Re-build the project index" + ":kbd:`F11`", "Toggle full screen mode" + ":kbd:`Alt+1`", "Switch focus to the project tree (Windows :kbd:`Ctrl+Alt+1`)" + ":kbd:`Alt+2`", "Switch focus to document editor (Windows :kbd:`Ctrl+Alt+2`)" + ":kbd:`Alt+3`", "Switch focus to document viewer (Windows :kbd:`Ctrl+Alt+3`)" + ":kbd:`Alt+4`", "Switch focus to outline view (Windows :kbd:`Ctrl+Alt+4`)" + ":kbd:`Ctrl+,`", "Open the :guilabel:`Preferences` dialog" + ":kbd:`Ctrl+Q`", "Exit novelWriter" + ":kbd:`Ctrl+Shift+,`", "Open the :guilabel:`Project Settings` dialog" + ":kbd:`Ctrl+Shift+O`", "Open a project" + ":kbd:`Ctrl+Shift+S`", "Save the current project" + ":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" .. _a_kb_tree: @@ -46,21 +46,21 @@ Project Tree Shortcuts .. csv-table:: :header: "Shortcut", "Description" - ":kbd:`F2`", "Edit the label of the selected item" - ":kbd:`Return`", "Open the selected document in the editor" - ":kbd:`Alt`:kbd:`Up`", "Jump or go to the previous item at same level in the tree" - ":kbd:`Alt`:kbd:`Down`", "Jump or go to the next item at same level in the tree" - ":kbd:`Alt`:kbd:`Left`", "Jump to the parent item in the tree" - ":kbd:`Alt`:kbd:`Right`", "Jump to the first child item in the project tree" - ":kbd:`Ctrl`:kbd:`.`", "Open the context menu on the selected item" - ":kbd:`Ctrl`:kbd:`L`", "Open the :guilabel:`Quick Links` menu" - ":kbd:`Ctrl`:kbd:`N`", "Open the :guilabel:`Create New Item` menu" - ":kbd:`Ctrl`:kbd:`O`", "Open selected document" - ":kbd:`Ctrl`:kbd:`R`", "Open the selected document in the viewer" - ":kbd:`Ctrl`:kbd:`Up`", "Move selected item one step up in the tree" - ":kbd:`Ctrl`:kbd:`Down`", "Move selected item one step down in the tree" - ":kbd:`Ctrl`:kbd:`Shift`:kbd:`Z`", "Undo the last move of a project item, if possible" - ":kbd:`Ctrl`:kbd:`Shift`:kbd:`Del`", "Move the selected item to Trash" + ":kbd:`F2`", "Edit the label of the selected item" + ":kbd:`Return`", "Open the selected document in the editor" + ":kbd:`Alt+Up`", "Jump or go to the previous item at same level in the tree" + ":kbd:`Alt+Down`", "Jump or go to the next item at same level in the tree" + ":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+O`", "Open selected document" + ":kbd:`Ctrl+R`", "Open the selected document in the viewer" + ":kbd:`Ctrl+Up`", "Move selected item one step up in the tree" + ":kbd:`Ctrl+Down`", "Move selected item one step down in the tree" + ":kbd:`Ctrl+Shift+Z`", "Undo the last move of a project item, if possible" + ":kbd:`Ctrl+Shift+Del`", "Move the selected item to Trash" .. _a_kb_editor: @@ -75,13 +75,13 @@ Text Search Shortcuts .. csv-table:: :header: "Shortcut", "Description" - ":kbd:`F3`", "Find the next occurrence of the search word" - ":kbd:`Ctrl`:kbd:`F`", "Open the search bar and search for the selected word, if any is selected" - ":kbd:`Ctrl`:kbd:`G`", "Find next occurrence of search word in current document" - ":kbd:`Ctrl`:kbd:`H`", "Open the search tool and populate with the selected word (Mac :kbd:`Cmd`:kbd:`=`)" - ":kbd:`Ctrl`:kbd:`Shift`:kbd:`1`", "Replace selected occurrence of the search word, and move to the next" - ":kbd:`Ctrl`:kbd:`Shift`:kbd:`G`", "Find previous occurrence of the search word" - ":kbd:`Shift`:kbd:`F3`", "Find the previous occurrence of the search word" + ":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+G`", "Find next occurrence of search word in current document" + ":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+Shift+G`", "Find previous occurrence of the search word" + ":kbd:`Shift+F3`", "Find the previous occurrence of the search word" Text Formatting Shortcuts @@ -90,23 +90,23 @@ Text Formatting Shortcuts .. csv-table:: :header: "Shortcut", "Description" - ":kbd:`Ctrl`:kbd:`/`", "Toggle block format as comment" - ":kbd:`Ctrl`:kbd:`0`", "Remove block formatting for block under cursor" - ":kbd:`Ctrl`:kbd:`1`", "Change block format to header level 1" - ":kbd:`Ctrl`:kbd:`2`", "Change block format to header level 2" - ":kbd:`Ctrl`:kbd:`3`", "Change block format to header level 3" - ":kbd:`Ctrl`:kbd:`4`", "Change block format to header level 4" - ":kbd:`Ctrl`:kbd:`5`", "Change block alignment to left-aligned" - ":kbd:`Ctrl`:kbd:`6`", "Change block alignment to centred" - ":kbd:`Ctrl`:kbd:`7`", "Change block alignment to right-aligned" - ":kbd:`Ctrl`:kbd:`8`", "Add a left margin to the block" - ":kbd:`Ctrl`:kbd:`9`", "Add a right margin to the block" - ":kbd:`Ctrl`:kbd:`B`", "Format selected text, or word under cursor, with strong emphasis (bold)" - ":kbd:`Ctrl`:kbd:`D`", "Strikethrough selected text, or word under cursor" - ":kbd:`Ctrl`:kbd:`I`", "Format selected text, or word under cursor, with emphasis (italic)" - ":kbd:`Ctrl`:kbd:`'`", "Wrap selected text, or word under cursor, in single quotes" - ":kbd:`Ctrl`:kbd:`""`", "Wrap selected text, or word under cursor, in double quotes" - ":kbd:`Ctrl`:kbd:`Shift`:kbd:`/`", "Remove block formatting for block under cursor" + ":kbd:`Ctrl+/`", "Toggle block format as comment" + ":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+5`", "Change block alignment to left-aligned" + ":kbd:`Ctrl+6`", "Change block alignment to centred" + ":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+D`", "Strikethrough selected text, or word under cursor" + ":kbd:`Ctrl+I`", "Format selected text, or word under cursor, with emphasis (italic)" + ":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+Shift+/`", "Remove block formatting for block under cursor" Other Editor Shortcuts @@ -115,24 +115,24 @@ Other Editor Shortcuts .. csv-table:: :header: "Shortcut", "Description" - ":kbd:`F7`", "Re-run the spell checker" - ":kbd:`Ctrl`:kbd:`.`", "Open the context menu at the current cursor location" - ":kbd:`Ctrl`:kbd:`A`", "Select all text in the document" - ":kbd:`Ctrl`:kbd:`C`", "Copy selected text to clipboard" - ":kbd:`Ctrl`:kbd:`K`", "Activate the insert commands (see list in :ref:`a_kb_ins`)" - ":kbd:`Ctrl`:kbd:`R`", "Open or reload the current document in the viewer" - ":kbd:`Ctrl`:kbd:`S`", "Save the current document" - ":kbd:`Ctrl`:kbd:`V`", "Paste text from clipboard to cursor position" - ":kbd:`Ctrl`:kbd:`W`", "Close the current document" - ":kbd:`Ctrl`:kbd:`X`", "Cut selected text to clipboard" - ":kbd:`Ctrl`:kbd:`Y`", "Redo latest undo" - ":kbd:`Ctrl`:kbd:`Z`", "Undo latest changes" - ":kbd:`Ctrl`:kbd:`Del`", "Delete the word after the cursor" - ":kbd:`Ctrl`:kbd:`Backspace`", "Delete the word before the cursor" - ":kbd:`Ctrl`:kbd:`Return`", "Open the tag or reference under the cursor in the viewer" - ":kbd:`Ctrl`:kbd:`F7`", "Toggle spell checking" - ":kbd:`Ctrl`:kbd:`Shift`:kbd:`A`", "Select all text in the current paragraph" - ":kbd:`Ctrl`:kbd:`Shift`:kbd:`I`", "Import text to the current document from a text file" + ":kbd:`F7`", "Re-run the spell checker" + ":kbd:`Ctrl+.`", "Open the context menu at the current cursor location" + ":kbd:`Ctrl+A`", "Select all text in the document" + ":kbd:`Ctrl+C`", "Copy selected text to clipboard" + ":kbd:`Ctrl+K`", "Activate the insert commands (see list in :ref:`a_kb_ins`)" + ":kbd:`Ctrl+R`", "Open or reload the current document in the viewer" + ":kbd:`Ctrl+S`", "Save the current document" + ":kbd:`Ctrl+V`", "Paste text from clipboard to cursor position" + ":kbd:`Ctrl+W`", "Close the current document" + ":kbd:`Ctrl+X`", "Cut selected text to clipboard" + ":kbd:`Ctrl+Y`", "Redo latest undo" + ":kbd:`Ctrl+Z`", "Undo latest changes" + ":kbd:`Ctrl+Del`", "Delete the word after the cursor" + ":kbd:`Ctrl+Backspace`", "Delete the word before the cursor" + ":kbd:`Ctrl+Return`", "Open the tag or reference under the cursor in the viewer" + ":kbd:`Ctrl+F7`", "Toggle spell checking" + ":kbd:`Ctrl+Shift+A`", "Select all text in the current paragraph" + ":kbd:`Ctrl+Shift+I`", "Import text to the current document from a text file" .. _a_kb_ins: @@ -140,45 +140,45 @@ Insert Shortcuts ---------------- A set of insert features are also available through shortcuts, but they require a double -combination of key sequences. The insert feature is activated with :kbd:`Ctrl`:kbd:`K`, followed by +combination of key sequences. The insert feature is activated with :kbd:`Ctrl+K`, followed by a key or key combination for the inserted content. .. csv-table:: :header: "Shortcut", "Description" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`−`", "Insert a short dash (en dash)" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`_`", "Insert a long dash (em dash)" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`_`", "Insert a horizontal bar (quotation dash)" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`~`", "Insert a figure dash (same width as a number)" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`1`", "Insert a left single quote" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`2`", "Insert a right single quote" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`3`", "Insert a left double quote" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`4`", "Insert a right double quote" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`'`", "Insert a modifier apostrophe" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`.`", "Insert an ellipsis" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`'`", "Insert a prime" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`""`", "Insert a double prime" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`Space`", "Insert a non-breaking space" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`Shift`:kbd:`Space`", "Insert a thin space" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`Space`", "Insert a thin non-breaking space" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`*`", "Insert a list bullet" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`−`", "Insert a hyphen bullet (alternative bullet)" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`*`", "Insert a flower mark (alternative bullet)" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`%`", "Insert a per mille symbol" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`O`", "Insert a degree symbol" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`X`", "Insert a times sign" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`Ctrl`:kbd:`D`", "Insert a division sign" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`G`", "Insert a ``@tag`` keyword" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`V`", "Insert a ``@pov`` keyword" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`F`", "Insert a ``@focus`` keyword" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`C`", "Insert a ``@char`` keyword" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`P`", "Insert a ``@plot`` keyword" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`S`", "Insert a synopsis comment" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`T`", "Insert a ``@time`` keyword" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`L`", "Insert a ``@location`` keyword" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`O`", "Insert an ``@object`` keyword" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`E`", "Insert an ``@entity`` keyword" - ":kbd:`Ctrl`:kbd:`K`, :kbd:`X`", "Insert a ``@custom`` keyword" + ":kbd:`Ctrl+K`, :kbd:`−`", "Insert a short dash (en dash)" + ":kbd:`Ctrl+K`, :kbd:`_`", "Insert a long dash (em dash)" + ":kbd:`Ctrl+K`, :kbd:`Ctrl+_`", "Insert a horizontal bar (quotation dash)" + ":kbd:`Ctrl+K`, :kbd:`~`", "Insert a figure dash (same width as a number)" + ":kbd:`Ctrl+K`, :kbd:`1`", "Insert a left single quote" + ":kbd:`Ctrl+K`, :kbd:`2`", "Insert a right single quote" + ":kbd:`Ctrl+K`, :kbd:`3`", "Insert a left double quote" + ":kbd:`Ctrl+K`, :kbd:`4`", "Insert a right double quote" + ":kbd:`Ctrl+K`, :kbd:`'`", "Insert a modifier apostrophe" + ":kbd:`Ctrl+K`, :kbd:`.`", "Insert an ellipsis" + ":kbd:`Ctrl+K`, :kbd:`Ctrl+'`", "Insert a prime" + ":kbd:`Ctrl+K`, :kbd:`Ctrl+""`", "Insert a double prime" + ":kbd:`Ctrl+K`, :kbd:`Space`", "Insert a non-breaking space" + ":kbd:`Ctrl+K`, :kbd:`Shift+Space`", "Insert a thin space" + ":kbd:`Ctrl+K`, :kbd:`Ctrl+Space`", "Insert a thin non-breaking space" + ":kbd:`Ctrl+K`, :kbd:`*`", "Insert a list bullet" + ":kbd:`Ctrl+K`, :kbd:`Ctrl+−`", "Insert a hyphen bullet (alternative bullet)" + ":kbd:`Ctrl+K`, :kbd:`Ctrl+*`", "Insert a flower mark (alternative bullet)" + ":kbd:`Ctrl+K`, :kbd:`%`", "Insert a per mille symbol" + ":kbd:`Ctrl+K`, :kbd:`Ctrl+O`", "Insert a degree symbol" + ":kbd:`Ctrl+K`, :kbd:`Ctrl+X`", "Insert a times sign" + ":kbd:`Ctrl+K`, :kbd:`Ctrl+D`", "Insert a division sign" + ":kbd:`Ctrl+K`, :kbd:`G`", "Insert a ``@tag`` keyword" + ":kbd:`Ctrl+K`, :kbd:`V`", "Insert a ``@pov`` keyword" + ":kbd:`Ctrl+K`, :kbd:`F`", "Insert a ``@focus`` keyword" + ":kbd:`Ctrl+K`, :kbd:`C`", "Insert a ``@char`` keyword" + ":kbd:`Ctrl+K`, :kbd:`P`", "Insert a ``@plot`` keyword" + ":kbd:`Ctrl+K`, :kbd:`S`", "Insert a synopsis comment" + ":kbd:`Ctrl+K`, :kbd:`T`", "Insert a ``@time`` keyword" + ":kbd:`Ctrl+K`, :kbd:`L`", "Insert a ``@location`` keyword" + ":kbd:`Ctrl+K`, :kbd:`O`", "Insert an ``@object`` keyword" + ":kbd:`Ctrl+K`, :kbd:`E`", "Insert an ``@entity`` keyword" + ":kbd:`Ctrl+K`, :kbd:`X`", "Insert a ``@custom`` keyword" .. _a_kb_viewer: @@ -189,8 +189,8 @@ Document Viewer Shortcuts .. csv-table:: :header: "Shortcut", "Description" - ":kbd:`Alt`:kbd:`Left`", "Move backward in the view history" - ":kbd:`Alt`:kbd:`Right`", "Move forward in the view history" - ":kbd:`Ctrl`:kbd:`C`", "Copy selected text to clipboard" - ":kbd:`Ctrl`:kbd:`Shift`:kbd:`A`", "Select all text in the current paragraph" - ":kbd:`Ctrl`:kbd:`Shift`:kbd:`R`", "Close the document viewer" + ":kbd:`Alt+Left`", "Move backward in the view history" + ":kbd:`Alt+Right`", "Move forward in the view history" + ":kbd:`Ctrl+C`", "Copy selected text to clipboard" + ":kbd:`Ctrl+Shift+A`", "Select all text in the current paragraph" + ":kbd:`Ctrl+Shift+R`", "Close the document viewer" diff --git a/docs/source/usage_typography.rst b/docs/source/usage_typography.rst index 66910e75..95585195 100644 --- a/docs/source/usage_typography.rst +++ b/docs/source/usage_typography.rst @@ -30,8 +30,8 @@ Dashes and Ellipsis With the auto-replace feature enabled (see :ref:`a_ui_edit_auto`), multiple hyphens are converted automatically to short and long dashes, and three dots to ellipsis. The last auto-replace can -always be reverted with the undo command :kbd:`Ctrl`:kbd:`Z`, reverting the text to what you typed -before the automatic replacement occurred. +always be reverted with the undo command :kbd:`Ctrl+Z`, reverting the text to what you typed before +the automatic replacement occurred. In addition, "Figure Dash" is available. The Figure Dash is a dash that has the same width as the numbers of the same font, for most fonts. It helps to align numbers nicely in columns when you need @@ -59,8 +59,8 @@ Single and Double Prime ------------------------ Both single and double prime symbols are available in the :guilabel:`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 +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 renderred similarly by the font, but they have different codes. Using these correctly will also prevent the auto-replace and dialogue highlighting features misunderstanding their meaning in the text. @@ -79,9 +79,9 @@ 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 Novel Project` tool, these apostrophes will be replaced + On export with the :guilabel:`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 highlighting. + Therefore it doesn't really matter if you only use them to correct syntax highlighting. Special Space Symbols diff --git a/docs/source/usage_writing.rst b/docs/source/usage_writing.rst new file mode 100644 index 00000000..56c2ff78 --- /dev/null +++ b/docs/source/usage_writing.rst @@ -0,0 +1,139 @@ +.. _a_ui_writing: + +********************* +The Editor and Viewer +********************* + +.. _Compose Key: https://en.wikipedia.org/wiki/Compose_key + +This chapter covers in more detail how the document editor and viewer panels work. + + +.. _a_ui_edit: + +Editing a Document +================== + +.. figure:: images/fig_editor.png + + A screenshot of the Document Editor panel. + +To edit a document, double-click it in the project tree, or press the :kbd:`Return` key while +having it selected. This will open the document in the document editor. The editor uses a +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 +top--right corner. On the top--left side you will find an edit button that opens the +:guilabel:`Item Label` dialog for the currently open document, 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`. + +.. tip:: + Clicking on the document title bar will select the document in the project tree and thus reveal + its location there, making it easier to find in a large project. + +Any :term:`references` in the editor can be opened in the viewer by moving the cursor to +the label and pressing :kbd:`Ctrl+Return`. You can also control-click them with your mouse. + + +.. _a_ui_view: + +Viewing a Document +================== + +.. figure:: images/fig_viewer.png + + 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. + +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 +document with your latest changes. You can also press the reload button in the top--right corner of +the viewer panel, next to the close button, to achieve the same thing. + +In the viewer :term:`references` become clickable links. Clicking them will replace the +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. + +At the bottom of the view panel there is a :guilabel:`References` panel. (If it is hidden, click +the icon next to it to reveal it.) This panel will show links to all documents referring back to +the one you're currently viewing, if any has been defined. The :guilabel:`Sticky` button will +freeze the content of the panel to the current document, even if you navigate to another document. +This is convenient if you want to quickly look through all documents in the list in the +:guilabel:`References` panel without losing the list in the process. + +.. note:: + The :guilabel:`References` panel relies on an up-to-date :term:`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`. + + +.. _a_ui_edit_search: + +Search & Replace +================ + +.. figure:: images/fig_editor_search.png + + A screenshot of the Document Editor search box. + +The document editor has a search and replace tool that can be activated with :kbd:`Ctrl+F` for +search mode or :kbd:`Ctrl+H` for search and replace mode. + +Pressing :kbd:`Return` while in the search box will search for the next occurrence of the word, and +:kbd:`Shift+Return` for the previous. Pressing :kbd:`Return` in the replace box, will replace the +highlighted text and move to the next result. + +There are a number of settings for the search tool available as toggle switches above the search +box. They allow you to search for, in order: matched case only, whole word results only, search +using regular expressions, loop search when reaching the end of the document, and move to the next +document when reaching the end. There is also a switch that will try to match the case of the word +when the replacement is made. That is, it will try to keep the word upper, lower, or capitalised to +match the word being replaced. + +The regular expression search is somewhat dependant on which version of Qt your system has. If you +have Qt 5.13 or higher, there is better support for Unicode symbols in the search. + +.. seealso:: + For more information on the capabilities of the Regular Expression option, see the Qt + documentation for the `QRegularExpression `_ + class. + + +.. _a_ui_edit_auto: + +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. + +.. tip:: + If you don't like auto-replacement, all symbols inserted by this feature are also available in + the :guilabel:`Insert` menu, and via :ref:`a_kb_ins`. You may also be using a `Compose Key`_ + setup, which means you may not need the auto-replace feature at all. + +The editor is able to replace two and three hyphens with short and long dashes, triple points with +ellipsis, and replace straight single and double quotes with user-defined quote symbols. It will +also try to determine whether to use the opening or closing symbol, although this feature isn't +always accurate. Especially distinguishing between closing single quote and apostrophe can be +tricky for languages that use the same symbol for these, like English does. + +.. tip:: + If the auto-replace feature changes a symbol when you did not want it to change, pressing + :kbd:`Ctrl+Z` once after the auto-replacement will undo it without undoing the character + you typed before it.