# FoldingText Extensions

FoldingText has become my Markdown editor of choise. I use it along side of Marked 2. I use my FoldingText Alfred workflow to control things. While working with FoldingText, I have created some extensions as well. Give them a try and let me know what you think! If you have ideas you would like to see in FoldingText, let me know and maybe I will write it. I love extending applications.

##### Extensions

imath

This extension adds the ability to run calculations in FoldingText. Just add the .imath to the end of a line. If it is a header, then just write math expressions after it. If it is not on a header, then indent math expressions after it. A line ending in => will start evaluating every line up to the extension line, then search for previous .imath section that are not folded, and then evaluates the math. You define variables normally with the = sign.

Since previous .imath sections that are not folded are evaluated, you can keep cases for variables in folded sections. Remember, the last variable definition will be the one used in function evaluation. Therefore, fold the sections that you do not want to evaluate and they will be hidden from the evaluator. This gives a way to do case studies with the math.

I finally have funtion definitions working. You define a function and use it in other areas. See the example below.

Since I am using FoldingText to write this page, the examples above are live from the extension. The extension uses the Math.js JavaScript library for doing all the calculations.

##### Other FoldingText Solutions

If you have not checked it out, you should visit the Alfred Workflow for FoldingText that I wrote. It gives many great features that I use everyday: bookmarking, adding notes to tags, site mapping, etc. It is very useful.

I also have most of it translated to a LaunchBar 6 FoldingText Action.

##### FoldingText Tutorials

I have also written an article on writing FoldingText extensions for Computer Tuts+. It is called: