Skip to content
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

Add a document builder for previews #1882

Closed
vkbo opened this issue May 20, 2024 · 1 comment · Fixed by #1892
Closed

Add a document builder for previews #1882

vkbo opened this issue May 20, 2024 · 1 comment · Fixed by #1892
Labels
enhancement Request: New feature or improvement next release Note: Features planned for next release

Comments

@vkbo
Copy link
Owner

vkbo commented May 20, 2024

As pointed out in #1858 by @zxygentoo, the HTML pathway currently used to generate content for the document viewer as well as the build tool preview is not sufficiently capable of showing all the formatting novelWriter supports. This can be bypassed by just generating a QTextDocument directly from the Tokenizer-generated data arrays.

The document itself is capable of displaying a lot more. The serialisation/deserialisation features built into the Qt library are very limited. The HTML support is very outdated as HTML4 and even there only supports a subset. Generating the formatted document using the QTextCursor object is reasonably fast, so it's good enough for the viewer, and the manuscript preview is not time critical anyway.

@vkbo vkbo added the enhancement Request: New feature or improvement label May 20, 2024
@vkbo vkbo added this to the Release 2.5 Beta 1 milestone May 23, 2024
@vkbo
Copy link
Owner Author

vkbo commented May 23, 2024

Got a working version in #1892 that is currently a drop-in replacement for the HTML in PREVIEW mode for the document viewer. It will also work for the Manuscript preview, but since the preview also uses a file cache for the preview doc between sessions, I need to add a way to serialise/deserialise the data to/from disk. Since the token array contains all the info needed, it's a good candidate.

@vkbo vkbo added the next release Note: Features planned for next release label May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request: New feature or improvement next release Note: Features planned for next release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant