alphasusu/alphasusu — pull request #38 by danpalmer (2014-02-16 21:41:07+00:00)
Title: Mardown Support

This pull request contributes markdown support for all free-form text entries that should be able to be styled.

We're using a modified version of Redcarpet for markdown rendering, with many extensions added. Things like tables, autolinking, code blocks like in GFM, footnotes, etc.

In addition to this, the syntax has been extended to support previews. Putting `~~` in the document allows the author to specify what content should be used as the preview of the document. For example:

```
Hello world.
~~
Lorem ipsum dolor sit amet...
```

In preview mode, using the helper method `render_markdown_preview`, as shown in `home/index.html.erb`, the content above will render to just "Hello world.", but in full document mode, with `render_markdown`, it will render the whole document, without the `~~` characters.

Site areas that display markdown formatted text, but which have not yet been updated from their original scaffolding have not all been converted as these need a full re-write at some point anyway.