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

Allow customization the content of pagination #175

Merged
merged 6 commits into from
Jul 11, 2019
Merged

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Jul 10, 2019

Marpit could not modify the content of pagination via content declaration in section::after. This PR makes it possible.

Theme CSS and tweaked style must contain attr(data-marpit-pagination) in content declaration of section::after because user expects to show the page number by paginate: true directive. Marpit will still ignore the whole of content declaration if the reference to that attribute is not contained.

Also we added data-marpit-pagination-total attribute, indicates the total page number of rendered slides , to section element. Of course, it can use in the content.

---
paginate: true
style: |
  /* Add "Page" prefix and total page number */
  section::after {
    content: 'Page ' attr(data-marpit-pagination) ' / ' attr(data-marpit-pagination-total);
  }
---

![bg 70%](marp.png)

---

# Second page

This idea is came from yhatt/marp#263.

@yhatt yhatt merged commit 55d87f6 into master Jul 11, 2019
@yhatt yhatt deleted the paginate-with-total branch July 11, 2019 09:30
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.

1 participant