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

How to except title slide from total number of pages of pagination? #218

Closed
moco-rocket opened this issue Jan 8, 2020 · 4 comments · Fixed by #359
Closed

How to except title slide from total number of pages of pagination? #218

moco-rocket opened this issue Jan 8, 2020 · 4 comments · Fixed by #359
Assignees

Comments

@moco-rocket
Copy link

Hello, I love this tool.
Is it possible to skip the title slide and appendix slides in the sum of page counts data-marpit-pagination-total? And how can I do so?

the pagination style of my css thema is this:

section::after {
    font-size: 1.1em;
    content: attr(data-marpit-pagination) ' / ' attr(data-marpit-pagination-total);
  }

And I wrote <!-- paginate: false --> at the title slide and <!-- paginate: true --> at the second slide, so the second slide' s pagination was "2/10." I want to change it to "1/9."

@yhatt yhatt transferred this issue from marp-team/marp-core Jan 8, 2020
@yhatt
Copy link
Member

yhatt commented Jan 10, 2020

Unfortunately it cannot. data-marpit-pagination and data-marpit-pagination-total are determined from the count of actually rendered pages.

At a glance using CSS3 calc() function in theme looks like to be good, but content declaration is not supporting calc().

/* 🚫 This will not work */
section::after {
  font-size: 1.1em;
  content: calc(attr(data-marpit-pagination) - 1) ' / ' calc(attr(data-marpit-pagination-total) - 1);
}

Even if data-marpit-pagination could change the starting number through directive like <!-- paginate: 1 -->, the count of total pages can never change. You have to specify the number of total pages for your deck manually via inline <style> tag in Markdown.

We are welcome any ideas to implement for it.

@zwkcoding
Copy link

I really need it !

@yhatt
Copy link
Member

yhatt commented Sep 20, 2020

I've assigned myself to get this in the next milestone, (modified) Marpit v2.

Proposal

paginate local directive is going to accept the extra value skip. Placing <!-- paginate: skip --> can skip increment of page number by the slide page.

---
paginate: true
---

Expect to render page number 1

---

Expect to render page number 2

---

<!-- paginate: skip -->

Skipped

---

<!-- paginate: true -->

Expect to render page number 3

Page number will not render in skipped pages as same as <!-- paginate: false -->.

It following the common rule of local directives so can skip multiple pages by one definition of <!-- paginate: skip -->

<!-- paginate: skip -->

Skipped

---

Skipped too

---

and more

---

<!-- paginate: true -->

Starting from page number 1

You can use spot directive by adding underscore prefix <!-- _paginate: skip --> to skip exactly single page.

---
paginate: true
---

Page 1

---

<!-- _paginate: skip -->

Skipped

---

Page 2

---

Page 3

data-marpit-pagination-total attribute will point out the page number shown in the end of slide as the total page. That's taking skipped pages into account, but it may be debatable.

@yhatt yhatt added this to the Marpit v2 (modified) milestone Sep 20, 2020
@moco-rocket
Copy link
Author

Sweet!! I'm looking forword to it!

@yhatt yhatt self-assigned this Sep 20, 2020
@yhatt yhatt removed this from the Marpit v2 (modified) milestone Mar 25, 2021
@yhatt yhatt moved this to Todo in Marp Roadmap Oct 17, 2021
@yhatt yhatt moved this from Todo to In Progress in Marp Roadmap Mar 27, 2022
@yhatt yhatt linked a pull request Jun 6, 2023 that will close this issue
@yhatt yhatt closed this as completed in #359 Jun 6, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done ✅ in Marp Roadmap Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants