Last active
December 30, 2015 03:29
-
-
Save rubylaser/7769297 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".markdown_link").live("click", function(e) { | |
$(this).next(".markdown_examples").slideToggle(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="formatting"> | |
Use Markdown for formatting. <%= link_to "See examples.", "javascript:void(0)", :class => "markdown_link" %> | |
<div class="markdown_examples" style="display: none"> | |
<table> | |
<tr> | |
<td><pre>[Link](http://example.com/)</pre></td> | |
<td><a href="http://example.com/">Link</a></td> | |
</tr> | |
<tr> | |
<td><pre>*Italic*</pre></td> | |
<td><em>Italic</em></td> | |
</tr> | |
<tr> | |
<td><pre>**Bold**</pre></td> | |
<td><strong>Bold</strong></td> | |
</tr> | |
<tr> | |
<td><pre> | |
* Listed | |
* Items | |
</pre></td> | |
<td><ul><li>Listed</li><li>Items</li></ul></td> | |
</tr> | |
<tr> | |
<td><pre>> Block quote</pre></td> | |
<td><blockquote><p>Block quote</p></blockquote></td> | |
</tr> | |
<tr> | |
<td><pre>`Inline code`</pre></td> | |
<td><code>Inline code</code></td> | |
</tr> | |
<tr> | |
<td> | |
<pre> | |
``` ruby | |
puts "code block" | |
``` | |
</pre> | |
</td> | |
<td><%= markdown("``` ruby\nputs \"code block\"\n```").html_safe %></td> | |
</tr> | |
</table> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.formatting { | |
font-size: 12px; | |
margin: 8px 0; | |
} | |
.markdown_examples { | |
margin-top: 5px; | |
} | |
.markdown_examples table { | |
border-collapse: collapse; | |
} | |
.markdown_examples table td { | |
border: solid 1px #CCC; | |
padding: 2px 10px; | |
} | |
.markdown_examples .code_block { | |
width: 200px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment