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

A system for book sections enabling section labelling and distinct page numbering #3258

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

dbolack-ab
Copy link
Collaborator

@dbolack-ab dbolack-ab commented Jan 19, 2024

This is one take on how to handle the notion of a brew having multiple, distinctly numbered sections in a way that both the CSS and snippets can track the page number resetting.

This system works by adding a single word parameter to the \page token. This value is added to the class list. This allows both a predefined list and the users to create their own.

These classes should hold no CSS properties and exist to act as triggers to reset the page counter ( phb-page-numbers - which should probably be renamed ) and reset the Section Label and the numbering type for the page counter (Roman numerals, decimal, etc - based on the LI numbering types)

This system uses .(sectionname):nth-of-type(1) for counter resets and .(sectionname) to override two global CSS variables where (sectionname) current defaults to one of index, appendix, chapter, frontmatter, and index.

Current design weaknesses that aren't addressed

  • There is no way to track multiple indexes or appendixes and label accordingly ( Appendix A, pg 7 )
  • Assumes each section type is used once
  • Does not enforce section order
  • Behaves the same as the present scheme if the first line of the brew does not set a section style
  • Still requires the user to insert the {{pageNumber }} bug.

Strengths:

  • SHOULD work on both the CSS side of the document and the snippets side by binding the counter resets to a token
  • Requires nothing of users not wanting to use it.
  • Easy extension via themes
  • Allows user extension via the brew styles tab

Solves:

Issue #2826

@dbolack-ab dbolack-ab self-assigned this Jan 19, 2024
@dbolack-ab dbolack-ab added the 🔍 R0 - Needs first review 👀 PR ready but has not been reviewed label Jan 19, 2024
@dbolack-ab dbolack-ab marked this pull request as draft January 19, 2024 04:55
@dbolack-ab dbolack-ab marked this pull request as ready for review March 4, 2024 22:37
@Gazook89
Copy link
Collaborator

The deployment doesn't seem to work at this point. It doesn't load the stylesheet and some other error. Crashes if I type in the editor as well.

I haven't taken a look at the code yet so don't have much more to say, just a heads up.

@dbolack-ab
Copy link
Collaborator Author

The deployment doesn't seem to work at this point. It doesn't load the stylesheet and some other error. Crashes if I type in the editor as well.

I haven't taken a look at the code yet so don't have much more to say, just a heads up.

I haven't updated this one in a bit, I'm not surprised it has some issues. I'm going to move it back to draft until I can catch it back up.

@dbolack-ab dbolack-ab marked this pull request as draft June 1, 2024 05:41
@5e-Cleric 5e-Cleric removed the 🔍 R0 - Needs first review 👀 PR ready but has not been reviewed label Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

None yet

5 participants