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

Replace Jinja2 variables in Document Core Properties #397

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

domwhewell-sage
Copy link

This PR adds the ability to add jinja2 variables in the Document/PowerPoint properties (File > Info >> Properties). #389

You can add jinja2 variables into the Core properties in office documents so they will be replaced upon generation.

The properties dictionary in the _add_office_properties() function represents properties that can be accessed in both word and PowerPoint documents.

Whilst researching this I found there are some document properties in office documents that are not currently accessible to python-docx/python-pptx python-openxml/python-docx#91 but hopefully this PR satisfies the basic properties.

@chrismaddalena
Copy link
Collaborator

Thanks for submitting this! Due to the reporting engine undergoing a complete refactoring last month, we can't merge this as is. We'll need to adapt it for the new reporting library. If you'd like to tackle that, have a look at it here:

https://github.com/GhostManager/Ghostwriter/tree/v4-1-dev/ghostwriter/modules/reportwriter

That's part of the current release candidate. I'm giving it a couple more weeks for feedback. Barring any major issues, I expect to make it the final release the first week of April.

ColonelThirtyTwo added a commit to ColonelThirtyTwo/Ghostwriter that referenced this pull request Mar 29, 2024
Based on code by @domwhewell-sage's PR [1], edited for the report writer
refactoring.

[1]: GhostManager#397
ColonelThirtyTwo added a commit to ColonelThirtyTwo/Ghostwriter that referenced this pull request Apr 5, 2024
Based on code by @domwhewell-sage's PR [1], edited for the report writer
refactoring.

[1]: GhostManager#397
@chrismaddalena chrismaddalena added this to the v4.1.1 milestone Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

None yet

2 participants