Print Extending RedCloth

Redcloth3-title_thumb

RedCloth is Ruby’s Textile module. Textile is a lightweight markup language originally developed by Dean Allen that allows a user to create well-formed styled XHTML. This site employes the RedCloth Textile module through the acts_as_textiled plugin. The nice thing about RedCloth is it is faily easy to extend the markup which it recognies. In this tutorial, I am going to show you how to render [latex]\LaTeX{}[/latex] in your site by extending RedCloth.

Print Syntax Highlighting with RedCloth

Keyboard_thumb

After I implemented LaTeX rendering into my views, I was quite satisfied with how it came out. LaTeX can now be effortless inserted into a field that is textile enabled with very good results. But then I began to look at the code snippits and I realized how ugly they look when compared to the rest of the site. I did a quick web search for ways to incorporate syntax highlighting in Rails applications, but I wasn’t really satisfied with what I found. Then the solution smacked me in the face. Just extend RedCloth!