nerding out a bit with haml

making a custom filter for LaTeX eqnarray divs
This commit is contained in:
Dan Buch
2012-04-04 07:55:10 -04:00
parent 18b6b315f0
commit 4361300838
6 changed files with 217 additions and 310 deletions

View File

@@ -0,0 +1,22 @@
require 'haml/filters'
require 'haml/helpers'
module Haml
module Filters
module Eqnarray
include Base
def render(text)
<<END
<div class="eqnarray">
$$
\\begin{eqnarray}
#{Haml::Helpers.html_escape(text).rstrip.gsub("\n", "\n ")}
\\end{eqnarray}
$$
</div>
END
end
end
end
end