diff --git a/manual/diff.rst b/manual/diff.rst index 4e0f89700f..9b1cb8e93e 100644 --- a/manual/diff.rst +++ b/manual/diff.rst @@ -25,5 +25,66 @@ you the differences in text, styles and images in the chosen books. Understanding the comparison view ---------------------------------- -This page is under construction. +As can be seen in the screenshot above, the comparison view shows the +differences between the two books side by side. Only the differences, with a +few lines of context around them are shown. This makes it easy to see at a +glance only what was changed inside a large document like a book. + +Added text is shown with a green background, removed text with a red background +and changed text with a blue background. + +The line numbers of all changed text are show at the sides, making it easy to +go to a particular change in the editor. When you open the comparison tool from +withing the editor, you can also double click on a line in the right panel to +go to that line in the editor automatically. + +One useful technique when comparing books is to tell the comparison tool to +beautify the text and style files before calculating differences. This can +often result in cleaner and easier to follow differences. To do this, click the +:guilabel:`Options` button in the bottom right and choose :guilabel:`Beautify +files before comapring`. Note that beautifying can sometimes have undesired +effects, as it can cause invalid markup to be altered to make it valid. You can +also change the number of lines of context shown around differences via the +:guilabel:`Options` button. + +You can search for any text in the differences via the search bar at the +bottom. You will need to specify which panel to search, the :guilabel:`Left` or +the :guilabel:`Right`. + +How to launch the comparison tool +----------------------------------- + +The comparison tool is most useful when you have two versions of the same book +and you want to see what is different between them. To that end, there are +several ways to launch the tool. + +Comparing two ebook files +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Open the first file in the :ref:`edit` tool. Now click :guilabel:`File->Comapre +to another book` and choose the second file (it must be in the same format as +the first). The comparison view will open with the file being edited on the +right and the second file on the left. + +Comparing the ORIGINAL_FMT to FMT +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +When you do a conversion in |app| from a FMT to itself, the original file is +saved as ORIGINAL_FMT. You can see what was changed by the conversion, by right +clicking on the ORIGINAL_FMT entry in the :ref:`book_details` panel in the main +|app| window and selecting :guilabel:`Compare to FMT`. The comparison view will +open with ORIGINAL_FMT on the left and FMT on the right. + +Comparing a checkpoint to the current state of the book while editing +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The :ref:`edit` tool has a very useful feature, called :ref:`checkpoints`. This +allows you to save the current state of the book as a named +*checkpoint*, to which you can revert if you do not like the changes you have +made since creating the checkpoint. Checkpoints are also created automatically +when you perform various automated actions int he editor. You can see the list +of checkpoints by going to :guilabel:`View->Checkpoints` and then use the +:guilabel:`Comapre` button to compare the book at the selected checkpoint with +the current state. The comparison tool will show the checkpoint on the left and +the current state on the right. diff --git a/manual/edit.rst b/manual/edit.rst index bc92fb7ff4..727af999aa 100644 --- a/manual/edit.rst +++ b/manual/edit.rst @@ -366,6 +366,8 @@ broken HTML/CSS. Therefore, if you dont want any auto-fixing to be performed, first use the Check Book tool to correct all problems and only then run beautify. Accessed via :guilabel:`Tools->Beautify all files`. +.. _checkpoints: + Checkpoints ------------------------ @@ -383,6 +385,13 @@ mechanism when editing individual files. Checkpoints are particularly useful for when changes are spread over multiple files in the book or when you wish to be able to revert a large group of related changes as a whole. +You can see a list of available checkpoints via :guilabel:`View->Checkpoints`. +You can compare the current state of the book to a specified checkpoint +using the :ref:`diff` tool -- by selecting the checkpoint of interest and clicking +the :guilabel:`Compare` button. The :guilabel:`Revert to` button restores the +book to the selected checkpoint, undoing all changes since that checkpoint was +created. + The Live Preview panel ------------------------