iamgio / iamgio/quarkdown

[Enhancement] Scope .totalpages to last .resetpagenumber via document|section argument

Open
#596 3 comments 0 reactions 1 assignee Claimed by @yuvrajsingh2428 View on GitHub
enhancement good first issue
Dominant language
Kotlin
Stars
16.1k
Forks
499
Avg merge
5h 55m
Merged PRs (30d)
56

Description

### Before submitting

- [x] I am using the latest version of Quarkdown.
- [x] I have checked the [wiki](https://quarkdown.com/wiki) to confirm this feature doesn't already exist.
- [x] I have searched existing [issues](https://github.com/iamgio/quarkdown/issues) for duplicates.

### Description

I would want `.totalpages` to also be affected by `.resetpagenumber`. Consider this scenario where I don't want a numbering on the title page:
```md
.doctype {paged}

.center
#! Title Page
.pagebreak

# First content page
.pagemargin {bottomcenter}
.currentpage / .totalpages
.resetpagenumber

# Second content page

# Third content page
```
I want the page numbering to range from 1/3 to 3/3. Instead it ranges from 1/4 to 3/4.

### Proposed syntax or behavior

A relatively easy and backwards-compatible fix would be to allow `.totalpages` to have an optional argument being one of `document | section` with `document` being the default.
- `document` will act as the `.totalpages`-command just as before
- `section` will be the number of pages starting from either the last `.resetpagenumber`-command (considering the `start` argument there) or the document start

### Additional context

This would actually also mimic the behaviour of Microsoft Word, which uses `{NUMPAGES}` for the total page count of the whole document and `{SECTIONPAGES}` for the total page count only within the current section.

I am using quakdown version 2.3.1.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.