fengsp/pypages — pull request #3 by jvanasco (2014-12-08 23:39:56+00:00)
Title: Pageset support

Hi.

I added some new commands that I hope you will consider. They're designed for streamlining integration with the Twitter Bootstrap pagination setup [http://getbootstrap.com/components/#pagination]

What I added:

* `pageset_next`
* `pageset_previous`

These 2 methods calculate the next/prev id for a set of `.pages()`. This enables a developer to just loop the `.pages` array, and not worry about the `.current` variable that affects the existing next/previous methods.

* pageset_centered
* pageset_centered_next
* pageset_centered_previous

`pageset_centered` will create a list like `.pages`, however it will try to center the current page in the list.

This is just the difference on a `start` of 4:

>> print p.pages
[1, 2, 3, 4, 5, 6, 7, 8, 9]
>> print p.pageset_centered
[4, 5, 6, 7, 8, 9, 10, 11, 12, 13]

The `pageset_centered_next` and `pageset_centered_previous` methods will return the start ids for the next centered pagesets.