mgwidmann / scrivener_html

HTML view helpers for Scrivener
MIT License
125 stars 206 forks source link

Add option to hide pagination for single page result #86

Closed shulhi closed 5 years ago

shulhi commented 5 years ago

I need to hide pagination when total pages are one/zero. There is also related issue here, https://github.com/mgwidmann/scrivener_html/issues/75.

This PR adds a global option with key hide_single or you can set it as an option in pagination_links function i.e. pagination_links(conn, page, hide_single: true). (also open to change the option to a different name, can't think of a better name at the moment).

All tests are passing. Let me know if this is something you like or don't like. I'm okay with either decision. I can definitely hide the pagination in the template, but it's probably convenient to have it as an option.

shulhi commented 5 years ago

Tests are failing. I'll fix them.

mgwidmann commented 5 years ago

I'd like to merge after the documentation is additionally updated.

shulhi commented 5 years ago

I'll try to resolve this within a day or two.

shulhi commented 5 years ago

@mgwidmann I think I fixed them based on the feedback.