Sha256: 72418fb1bfade1a53f4422d9fc5493470dce4e477ec9519bafebefb77043c49a

Contents?: true

Size: 883 Bytes

Versions: 2

Compression:

Stored size: 883 Bytes

Contents

begin
  require "webby"
  
  module Webby::Helpers
    module GorgyrellaHelper
      def gorg(filename, section = "1", format = nil, language = nil)
        if !File.exist?(filename)
          filename = File.join(Webby.site.content_dir, @page.dir, filename)
        end
        
        Gorgyrella.render_section(filename, section, format, language)
      end
      
      # LaTeX Helpers
      def gorgl(filename, section = "1", format = "latex", language = nil)
        gorg(filename, section, format, language)
      end

      def pygments_latex_styles(style = 'default')
        command = "pygmentize -S #{style} -f latex"
        $pygments_latex_styles_cache ||= IO.popen(command).read
      end
    end

  register(GorgyrellaHelper)
  end
  
  puts "GorgyrellaHelper registered with Webby."
rescue LoadError
  puts "Webby not available, GorgyrellaHelper not registered."
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gorgyrella-0.0.1 lib/webby/gorgyrella_helper.rb
gorgyrella-0.0.2 lib/webby/gorgyrella_helper.rb