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

exports: add qute template for horizon europe #116

Draft
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

rekt-hard
Copy link
Collaborator

@rekt-hard rekt-hard commented Sep 27, 2023

First try of resolving #114

This shows a basic implementation of

  • having html template
  • render with qute
  • convert to to .docx for the export

As can be seen, the code required for a new template would be more concise than the current implementation. It also allows to track the changes made to the template.

The template is not complete. Converting html to .docx comes with some issues:

  • Styling: Not everything supported in html will also be supported in .docx.
  • Enumerations: Padding and styling is not converted correctly from html. Probably needs additional XML.
  • Header/Footer per page: Requires additional XML in the template.
  • Table of contents: Easy to link to certain parts/sections but getting the page number could be difficult.

Screenshot of the exported document:
image

@rekt-hard
Copy link
Collaborator Author

Might have tackled this the wrong way.
Another possibility is to create .xml templates for each section. Then render these section in the export and put them in the document with docx4j. This way, we retain the file changes via git and get all the functionality of the layout possibilities - no need to convert from .html to .docx.

Writing the correct xml is not straight forward. A possible way to achieve this is to create a certain part of the finished document (i.e. section or table) in a document processing tool (i.e. microsoft word, libreoffice writer) and then inspect the corresponding xml output in the .docx archive. The xml will then have to be adapted in the template.

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.

1 participant