imports/pyggish.rb in livetext-0.9.24 vs imports/pyggish.rb in livetext-0.9.25

- old
+ new

@@ -81,25 +81,25 @@ result = "<!-- colorized code -->\n" + text2 result end def fragment - lang = @_args.empty? ? :elixir : @_args.first.to_sym # ruby or elixir - @_args = [] + lang = api.args.empty? ? :elixir : api.args.first.to_sym # ruby or elixir + api.args = [] send(lang) - _out "\n" + api.out "\n" end def code # FIXME ? text = "" - _body {|line| _out " " + line } + api.body {|line| api.out " " + line } end def mono - _out "<pre>" - _body {|line| _out " " + line } - _out "</pre>" + api.out "<pre>" + api.body {|line| api.out " " + line } + api.out "</pre>" end def create_code_styles dir = @_outdir || "." theme, back = "Github", "white" @@ -143,30 +143,30 @@ text = "<div class=ex_highlight>#{body}</div>" text end def ruby - file = @_args.first + file = api.args.first if file.nil? code = " # Ruby code\n\n" - _body {|line| code << " " + line + "\n" } + api.body {|line| code << " " + line + "\n" } else code = "# Ruby code\n\n" + ::File.read(file) end html = format_ruby(code) - _out html + api.out html end def elixir - file = @_args.first + file = api.args.first if file.nil? code = "" - _body {|line| code << " " + line + "\n" } + api.body {|line| code << " " + line + "\n" } else code = ::File.read(file) end html = format_elixir(code) - _out html + api.out html end end