@register.tag<EOL>def bootstrap_pager(parser, token):
bits = token.split_contents()<EOL>if len(bits) < <NUM_LIT:2>:<EOL><INDENT>raise TemplateSyntaxError("<STR_LIT>"<EOL>"<STR_LIT>" % bits[<NUM_LIT:0>])<EOL><DEDENT>page = parser.compile_filter(bits[<NUM_LIT:1>])<EOL>kwargs = {}<EOL>bits = bits[<NUM_LIT:2>:]<EOL>kwarg_re = re.compile(r'<STR_LIT>')<EOL>if len(bits):<EOL><INDENT>for bit in bits:<EOL><INDENT>match = kwarg_re.match(bit)<EOL>if not match:<EOL><INDENT>raise TemplateSyntaxError("<STR_LIT>")<EOL><DEDENT>name, value = match.groups()<EOL>kwargs[name] = parser.compile_filter(value)<EOL><DEDENT><DEDENT>return BootstrapPagerNode(page, kwargs)<EOL>
Renders a Page object as a Twitter Bootstrap styled pager bar.
Compatible with Bootstrap 2.x and 3.x only.

Example::

    {% bootstrap_pager page_obj %}


Named Parameters::


    previous_label - The label to show for the Previous link (defaults to "Previous Page")

    next_label - The label to show for the Next link (defualts to "Next Page")

    previous_title - The link title for the previous link (defaults to "Previous Page")

    next_title - The link title for the next link (defaults to "Next Page")

    url_view_name - The named URL to use. Defaults to None. If None, then the
                    default template simply appends the url parameter as a
                    relative URL link, eg: <a href="?page=1">1</a>

    url_param_name - The name of the parameter to use in the URL. If
                     url_view_name is set to None, this string is used as the
                     parameter name in the relative URL path. If a URL
                     name is specified, this string is used as the
                     parameter name passed into the reverse() method for
                     the URL.

    url_extra_args - This is used only in conjunction with url_view_name.
                    When referencing a URL, additional arguments may be
                    passed in as a list.

    url_extra_kwargs - This is used only in conjunction with url_view_name.
                       When referencing a URL, additional named arguments
                       may be passed in as a dictionary.

    url_get_params - The other get parameters to pass, only the page
                     number will be overwritten. Use this to preserve
                     filters.

    url_anchor - The anchor to use in URLs. Defaults to None.

    extra_pager_classes - A space separated list of CSS class names
                          that will be added to the top level <ul>
                          HTML element. This could be  used to,
                          as an example, add a class to prevent
                          the pager from showing up when printing.