This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Ruhoh::Views::Helpers | |
module Paginator | |
# current_page is set via a compiler or previewer | |
# in which it can discern what current_page to serve | |
def paginator | |
per_page = config["paginator"]["per_page"] rescue 5 | |
current_page = master.page_data['current_page'].to_i | |
current_page = current_page.zero? ? 1 : current_page | |
offset = (current_page-1)*per_page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# chcp 65001 | |
require 'rubygems' | |
require 'hpricot' | |
require 'nokogiri' | |
require 'fileutils' | |
require 'yaml' | |
require 'time' | |
require 'pandoc-ruby' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mustache' | |
class Ranger < Mustache | |
self.template = <<-template | |
{{#range_0_to_10}} | |
<option value="{{i}}">{{i}}</option> | |
{{/range_0_to_10}} | |
template | |
def range(first, last) |
NewerOlder