Wednesday 5 June 2013

Adding MarkDown support to TeamMentor using MarkDownDeep

After adding ASP.NET MVC 4.0 in TeamMentor (with simple Controller, View and master Layout) I was ready to add Markdown support to TeamMentor.

I chose MarkdownDeep after reviewing the multiple Markdown C# and JavaScript APIs currently available (for more details see the references section at the end of this post)

My first step was to go NuGet and choose the MarkDownDeep - .NET Only Edition package:

image

Which just adds the MarkdownDeep.dll to the solution:

image 

One important note to mention at this stage, is that I also have opened in another instance of VisualStudio, the MarkdownDeep example described in the blog post Adding Markdown Support to ASP.NET MVC projects with MarkdownDeep and NuGet:

image

Back in TM's VisualStudio process, and based on the example provided in that MarkdownDeep demo app (shown above), I added a variation the HtmlHelper Extension Method to TM’s App_Code folder (shown below):

image

... modified the index.cshtml to consume this extension method and display the Markdown transformation as Raw Html :

image

... added some markdown text to the controller:

image

.. and that's it :)

The Markdown transformation PoC is complete

Here is what it looks like:

image

For reference here is the source markdown side-by-side with its transformation:

image


MarkdownDeep References:
See also TeamMentor’s Issue #235 Implement Markdown support in TM for more details on the issue that triggered this new TM feature