+ tag "PAGES", string_of_int pages ^ " Pages";
+ tag "PAGELIST",
+ (let inf = page - additional_pages in
+ let sup = page + additional_pages in
+ let superinf = inf - (sup - pages) in
+ let supersup = sup + (1 - inf) in
+ let n,m =
+ if inf >= 1 && sup <= pages then
+ inf,sup
+ else if inf < 1 then
+ 1, (if supersup <= pages then supersup else pages)
+ else (* sup > pages *)
+ (if superinf >= 1 then superinf else 1),pages
+ in
+ fold_n_to_m
+ (fun n acc -> acc ^ " " ^
+ (if n = page then string_of_int n
+ else page_link (string_of_int n) n))
+ n m "");