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

Support more advanced customization via template syntax for docx #7256

Closed
mjfs opened this issue Apr 29, 2021 · 2 comments
Closed

Support more advanced customization via template syntax for docx #7256

mjfs opened this issue Apr 29, 2021 · 2 comments

Comments

@mjfs
Copy link
Contributor

mjfs commented Apr 29, 2021

Supporting more advanced customization via template syntax for docx would address many pain points when producing docx format with Pandoc. This would also be a general solution for issues such as #3109.

Microsoft Word supports special content controls that allow marking parts of the document with special tags. This allows for robust XML copy/pasting between the template and the output document in pretty much the same way as with other formats that currently support templating (and interpolated variables).

Content controls also allow for automatic metadata insertion, which is already partially supported in certain cases with Pandoc - e.g. setting certain set of metadata tags and adding a content control to the head of the document allows for special markings to be defined via markdown, such as "Confidential" in the header or "Date" in the footer.

Combining what is already supported with custom segments via content controls would allow for a lot greater flexibility in Pandoc template design (e.g. not forcing metadata output by default as is currently implemented).

@jgm
Copy link
Owner

jgm commented Apr 29, 2021

It's worth exploring....can you link to some documentation on the content controls?

@mjfs
Copy link
Contributor Author

mjfs commented Apr 29, 2021

From Microsoft's developer documentation:

What to look for are the following two controls: Rich Text and Plain Text with the first one enabling marking of practically any content type. In addition to this, metadata of an individual control could also be used (e.g. control's Title and Tag) for templating instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants