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 pagebreak control for numbered pagination links #2

Open
bglw opened this issue Sep 3, 2021 · 2 comments
Open

Add pagebreak control for numbered pagination links #2

bglw opened this issue Sep 3, 2021 · 2 comments

Comments

@bglw
Copy link
Contributor

bglw commented Sep 3, 2021

Something along the lines of the following should be an achievable output:

<a href="../2/">Previous Page</a>

<ol>
  <li> <a href="../../">Page 1</a> </li>
  <li> <a href="../2/">Page 2</a>  </li>
  <li> <a href=".">Page 3</a>      </li>
</ol>

<a href="../4">Next Page</a>
@bglw bglw added this to the 1.0 release milestone Sep 3, 2021
@bglw
Copy link
Contributor Author

bglw commented Sep 9, 2021

I don't yet know how to spec this. My initial idea was to have a data-pagebreak-control you can add for Page 1. Pagebreak would then add siblings to this element for subsequent pages.

This doesn't work for the above example, the a tag would logically have a data-pagebreak-control attribute so it can update the text and the URL, but the li tag is the element that needs to be cloned into siblings.

We could do some magic here and try to traverse up to a list element that would logically be cloned. Otherwise just duplicate the <a> tag.

This would make the spec look like:

<ol>
  <li> <a data-pagebreak-control="crumb"> Page <span data-pagebreak-label="crumb">3</span> </a> </li>
</ol>

Where some magic duplicates it on the <li>, and updates the crumb control & label

@bglw bglw removed this from the 1.0 release milestone Sep 21, 2021
@bglw
Copy link
Contributor Author

bglw commented Sep 21, 2021

Leaving this to simmer until the best spec is established. 1.0 is viable without the page crumbs.

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

No branches or pull requests

1 participant