Skip to content

Template class persistence#4593

Open
dbolack-ab wants to merge 7 commits intonaturalcrit:masterfrom
dbolack-ab:V4_Persistant_Templates
Open

Template class persistence#4593
dbolack-ab wants to merge 7 commits intonaturalcrit:masterfrom
dbolack-ab:V4_Persistant_Templates

Conversation

@dbolack-ab
Copy link
Copy Markdown
Collaborator

@dbolack-ab dbolack-ab commented Jan 20, 2026

Description

This adds the concept of Template class persistence at the \page level.

If a \page has a {} block, the parsed attributes are examined. If one is named hbtemplate the value is stored in a lookup table.

If a page lacks a Template , the lookup table is walked backwards until a template name is found or the beginning of the document is found.

If a template name is found, it is added to the attributes for the page.

examples:

\page {hbtemplate=colophon}

This page would use the colophon template.

\page {hbtemplate=chapter}
\page

Both of these pages will use the chapter template.

*Reviewers, refer to this list when testing features, or suggest new items *

  • Verify new features are functional
    • Adding hbtemplate=foo shows in the page div classes.
    • Adding hbtemplate=foo shows in pages following that do not have an hbtemplate set
    • Adding hbtemplate=foo shows in pages following that do not have an hbtemplate set until a page adds its own hbtemplate
  • Verify old features have not broken
    • If no hbtemplate attribute is used, behaves as before.
  • Test for edge cases / try to break things
  • Identify opportunities for simplification and refactoring
  • Check for code legibility and appropriate comments

@dbolack-ab
Copy link
Copy Markdown
Collaborator Author

Needs tests

@dbolack-ab dbolack-ab added 🔍 R0 - Needs first review 👀 PR ready but has not been reviewed Orphan This project's original dev is not going to finish this, feel free to pick it up labels Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Orphan This project's original dev is not going to finish this, feel free to pick it up 🔍 R0 - Needs first review 👀 PR ready but has not been reviewed

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

3 participants