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] report_py3o_index: Update TOC and other indices in Py3o reports #907

Open
wants to merge 2 commits into
base: 12.0
Choose a base branch
from

Conversation

len-foss
Copy link

This module fills in the document indexes (e.g. a Table of Content) in a generated py3o document.

This is to work around the missing feature first reported in 2012: https://bugs.documentfoundation.org/show_bug.cgi?id=44448

It uses the workaround given in https://ask.libreoffice.org/t/update-toc-via-command-line/52518 and other similar threads.

Note that to work, the macro has to be installed in libreoffice first.
This is done at module install.
It assumes the macro files are stored at ~/.config/libreoffice/4/user/basic/Standard.
If it fails, the function can be manually called with the real path using:
self.env["py3o.report"]._install_update_index_macro(real_path)
Make sure that this is correct as most failure paths of the macro application are silent.

Once this is done, py3o templates have an "has index" boolean.
If set, the macro is applied after generation (and before pdf conversion) to update all indices.

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.

None yet

2 participants