lib/polytexnic/postprocessors/polytex.rb
# Writes the PolyTeX code environments based on the code cache.
# I.e., code that looks like
# {lang="ruby"}
#     def foo
#       "bar"
#     end
# becomes
# %= lang:ruby
# \begin{code}
# def foo
#   "bar"
# end
# \end{code}
# which reduces syntax highlighting to a previously solved problem.
Writes the PolyTeX code environments based on the code cache.
Writes the PolyTeX code environments based on the code cache .
def write_polytex_code
        code_cache.each do |key, (code, lang, in_codelisting, options)|
          latex = "%= lang:#{lang}#{options}\n" +
                  "\\begin{code}\n" + escape_hack(code) + "\n\\end{code}"
          @source.gsub!(key, latex)
        end
      end
def write_polytex_code code_cache . each do | key , ( code , lang , in_codelisting , options ) | latex = "%= lang:#{lang}#{options}\n" + "\\begin{code}\n" + escape_hack ( code ) + "\n\\end{code}" @source . gsub! ( key , latex ) end end
Writes the PolyTeX code environments based on the code cache.
Writes the PolyTeX code environments based on the code cache .
# puts '*********' # puts @source.inspect # raise code.inspect