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 QTextDocument format class for previews #1892

Merged
merged 15 commits into from
May 25, 2024
Merged

Conversation

vkbo
Copy link
Owner

@vkbo vkbo commented May 23, 2024

Summary:

This PR adds a new class based on the Tokenizer that generates a QTextDocument directly without going via the HTML generator. This gives a lot more control of the format as we are no longer restricted to the limited HTML4 subset implemented by Qt a very long time ago.

This is also intended to be used for the Manuscript build preview, but since the document cannot be serialised to a cache, it is not a straight drop-in replacement for the HTML. The class may need a pack/unpack method for that, which can probably be written from the token array.

Related Issue(s):

Closes #1882

Reviewer's Checklist:

  • The header of all files contain a reference to the repository license
  • The overall test coverage is increased or remains the same as before
  • All tests are passing
  • All flake8 checks are passing and the style guide is followed
  • Documentation (as docstrings) is complete and understandable
  • Only files that have been actively changed are committed

@vkbo vkbo added this to the Release 2.5 Beta 1 milestone May 23, 2024
@vkbo vkbo merged commit f23bd38 into main May 25, 2024
8 checks passed
@vkbo vkbo deleted the feature/preview_generator branch May 25, 2024 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a document builder for previews
1 participant