https://github.com/joellefkowitz/paginator
Extensible paginator class.
https://github.com/joellefkowitz/paginator
batches pages paginator
Last synced: 3 months ago
JSON representation
Extensible paginator class.
- Host: GitHub
- URL: https://github.com/joellefkowitz/paginator
- Owner: JoelLefkowitz
- License: mit
- Created: 2024-12-13T17:48:27.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2025-02-21T11:18:41.000Z (3 months ago)
- Last Synced: 2025-02-21T12:26:41.401Z (3 months ago)
- Topics: batches, pages, paginator
- Language: C++
- Homepage:
- Size: 729 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Paginator
Extensible paginator class.


## Installing
`paginator` is a header only library and is compatible with C++11.
```bash
conan search paginator
```You can also download the [sources](https://download-directory.github.io?url=https://github.com/JoelLefkowitz/paginator/tree/master/src).
## Documentation
Documentation and more detailed examples are hosted on [Github Pages](https://joellefkowitz.github.io/paginator).
## Usage
```cpp
paginator::Paginator paginator({1, 2, 3, 4, 5}, 2);
``````cpp
paginator.page();
> {1, 2}
``````cpp
paginator.next();
``````cpp
paginator.page();
> {3, 4}
```## Tooling
### Dependencies
To install dependencies:
```bash
yarn install
pip install .[all]
conan install .
```### Tests
To run tests:
```bash
scons test
```### Documentation
To generate the documentation locally:
```bash
scons docs
```### Linters
To run linters:
```bash
scons lint
```### Formatters
To run formatters:
```bash
scons format
```### Publishing
The [ConanCenter](https://conan.io/center) doesn't yet allow users to publish packages independently. Package recipes are submitted to the [conan-center-index](https://github.com/conan-io/conan-center-index). A copy of this recipe is kept in this repository in the `publish` folder. This allows us to test that the recipe is compatible with new versions and makes it easier to submit updates to the conan-center-index.
To test the recipe can build the latest published tag:
```bash
conan create publish/all/conanfile.py --version $(yq -r ".versions | keys | .[0]" publish/config.yml)
```This will fetch the sources and create a locally cached version of the package. This version can also be published to a local remote for testing:
```bash
conan upload / -r
```### Toolchains
Scripts are defined in the `scripts` folder and can be invoked with `toolchains`:
To generate header guards:
```bash
npx toolchains guards
```## Contributing
Please read this repository's [Code of Conduct](CODE_OF_CONDUCT.md) which outlines our collaboration standards and the [Changelog](CHANGELOG.md) for details on breaking changes that have been made.
This repository adheres to semantic versioning standards. For more information on semantic versioning visit [SemVer](https://semver.org).
Bump2version is used to version and tag changes. For example:
```bash
bump2version patch
```### Contributors
- [Joel Lefkowitz](https://github.com/joellefkowitz) - Initial work
## Remarks
Lots of love to the open source community!
![]()
![]()
![]()