New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reconsidering Document Export #197
Comments
I've started writing the new export tool. It currently lives in the branch In the process, I've extended the novelWriter doc to HTML converter quite a bit, and added a number of formatting and selection options. For instance, you can no export in "Outline Mode", which will export headings in a descriptive format, and the Synopsis comment of each heading. The body text is not exported. Experience So Far
ScreenshotThe tool currently looks like this: Tagging: @johnblommers and @Number042 for feedback, if you have the time. |
Since the changes I want to make for version 0.6 are relatively big, I am merging them into an off-master branch until they're ready for release. If you want to test the new export tool, checkout the Printing should now be working, and I've dropped the "Outline Mode" switch in favour of an "Exclude body text" option instead, which gives the user the freedom to assemble the Outline as they wish. I've noticed that the Qt widget I use to preview the document, and from which I run the print job, strips page breaks. So even though page breaks are added before chapters, they aren't printed. The best way, currently, to get those page breaks is to save as html, and print from the browser. The browser does not strip the page breaks. I haven't decided yet how to solve this. Either I implement the QWebEngine as the widget for displaying the preview, and print from that, or I make my own print preview dialog and assemble the document myself from the individual document files in the project. |
I've merged these changes to master, but not yet released them. Will release 0.6 within a few days. |
I am reconsidering the Export tool currently implemented in novelWriter. Qt5 actually has a decent tool already for generating various file outputs, including Plain Text, Open Document ODF, HTML and Markdown through the standard QTextDocumentWriter class, as well as printing to physical printer and to PDF from the QPrinter object.
Both of these pathways are available through the QTextEdit that is currently used for the main editing window. but I will probably not apply these tools directly to the main editor.
What it Will Look Like
What I propose is a "Compile Novel" feature that either is another tab in the main view, or a dialog modal tool. I tend towards the former, as it is consistent with the current layout, though it's dependant on resource overhead since all tabs are built even if they're not used.
In either case, the functionality in the Export tool will be ported over to the new tool, and also have the item selection list I never got around to implement there. That is, a treeview of the project structure with a checkbox column to include/exclude single documents.
The tool will have the controls on the left, and on the right a black on white non-editable rich text document which can be built on the fly and scrolled through, with proper page size & separation and such. There will then be a button for saving to various formats, or printing it.
Consequences
This will effectively mean that I will drop support for Pandoc exports, and in the process, we will also lose LaTeX export. However, since we will have HTML and Markdown export, Pandoc can still be used independently for further conversions.
The current export feature is a bit daunting to maintain. It is better to pass the handling of formats and non-English character issues to libraries and tools that already have the ability to handle these. I am also not a big fan of Pandoc as it produces fairly ugly results and strips a lot of formatting. The Qt export path should produce better results considering this is text only documents.
Additional Benefits
The main benefit, aside from the extra features already mentioned, a number of package dependencies can be dropped. That is, at present, the
pypandoc
andlatexcodec
packages. I am also considering replacing thelxml
package with Qt's own XML parser, which will effectively make novelWriter fully free of dependencies aside from thePyQt5
bundle.The text was updated successfully, but these errors were encountered: