Skip to content

Enhance simple book title page to list on toc#2368

Open
dave-khuon wants to merge 4 commits into
gramps-project:masterfrom
dave-khuon:Enhance-Simple-Book-Title-page-to-list-on-TOC
Open

Enhance simple book title page to list on toc#2368
dave-khuon wants to merge 4 commits into
gramps-project:masterfrom
dave-khuon:Enhance-Simple-Book-Title-page-to-list-on-TOC

Conversation

@dave-khuon

@dave-khuon dave-khuon commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

This enhancement is to make this title page more flexible, as it can be used not just at the beginning of the book, but throughout it, as chapter separators for different sections of the families.

The appearance of the page on the TOC is controlled by a check button. Its Subject is determined by the presence of Title, or Subtitle, Image filename, or a "Not Provide" if all the above fail.

Add to TOC if Title is not empty.
Conditionally Title, SubTitle, and Footer if they are not empty.
Use a slightly bigger image size, if both the last 2 fields are empty, otherwise, use the original image size.
Add Developer name in the change log
@dave-khuon

Copy link
Copy Markdown
Contributor Author

This updated code has been successfully tested: see output above.
sample_book.pdf

To avoid confusion between PR features, it is a lot easier for me to start a new branch from scratch (=master). This new PR is totally independent. The old PR 2365 will be closed (= abandoned), since it was stacked against an uncleaned PR 2300, which also was stacked against another uncleaned PR 1873.

I have implemented all changes as suggested by DSBank for PR 2365.
DSBank recommendations (PR2365):
<<
simplebooktitle.py
self.toc_title is unnecessary — self.title_string is already available; the alias adds nothing.

Verbose emptiness checks — len(self.subtitle_string.strip()) > 0 should be just self.subtitle_string.strip().

The core change (skipping empty subtitle/footer paragraphs and adding the TOC mark) is correct and a good improvement.

Thanks, and sorry for all the confusions.

@dsblank

dsblank commented Jun 11, 2026

Copy link
Copy Markdown
Member

@dave-khuon can you add a description?

@dave-khuon

Copy link
Copy Markdown
Contributor Author

Just did. Thanks.

Add a check button to control whether to add this Title Page to the TOC.  Just to respect the old behavior, if required.
Allow either Title or SubTitle to be used for TOC Title.  If both not present, use filename of the image.

If none of the above are present, allow the Title Page Subject to be listed as "not provided", and this page will produced a blank page.  We do not touch of the book driver logics which provide the current behavior.

If both SubTitle and Footer are not present, we can use more room for the image.
@dave-khuon

Copy link
Copy Markdown
Contributor Author

Here is the resulting Book output, using this book item list:
image
sample_book.pdf

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants