Sha256: 4584f94535355098ddbd56ac491dc77f0469b3b0b6737feb11cc9a6db6c65deb
Contents?: true
Size: 1.24 KB
Versions: 3
Compression:
Stored size: 1.24 KB
Contents
require 'uv' # These module monkey patches the original Spox's Ultraviolet, in order # to override defaults. module Uv @@set_table_columns = true Uv.syntax_path = File.join(File.dirname(__FILE__), 'syntax') Uv.render_path = File.join(File.dirname(__FILE__), 'render') Uv.theme_path = File.join(File.dirname(__FILE__), 'render', 'latex') Uv.default_style ||= 'made_of_code' def Uv.themes Dir.glob( File.join(@theme_path, '*.render') ).collect do |f| File.basename(f, '.render') end end def start_parsing name @stack = [name] @string = "" @line = nil @line_number = 0 if @@set_table_columns print @render_options["document"]["begin"] if @headers print @render_options["listing"]["begin"] end end def end_parsing name if @line print escape(@line[@position..-1].gsub(/\n|\r/, '')) while @stack.size > 1 opt = options @stack print opt["end"] if opt @stack.pop end print @render_options["line"]["end"] print "\n" end @stack.pop if @@set_table_columns print @render_options["listing"]["end"] print @render_options["document"]["end"] if @headers else @@set_table_columns = false end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
code_rippa-1.0.1 | lib/code_rippa/uv_overrides.rb |
code_rippa-1.0.0 | lib/code_rippa/uv_overrides.rb |
code_rippa-0.0.7 | lib/code_rippa/uv_overrides.rb |