liquid_cms 0.2.1.1 → 0.2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. data/CHANGELOG.rdoc +7 -0
  2. data/README.rdoc +15 -1
  3. data/TODO.rdoc +0 -2
  4. data/app/controllers/cms/assets_controller.rb +20 -6
  5. data/app/controllers/cms/components_controller.rb +11 -3
  6. data/app/controllers/cms/pages_controller.rb +15 -4
  7. data/app/helpers/cms/common_helper.rb +31 -31
  8. data/app/liquid/cms_paperclip_extension.rb +75 -3
  9. data/app/models/cms/asset.rb +1 -1
  10. data/app/models/cms/component.rb +3 -3
  11. data/app/views/cms/assets/_form.html.erb +1 -1
  12. data/app/views/cms/assets/update.js.rjs +1 -0
  13. data/app/views/cms/components/update.js.rjs +1 -0
  14. data/app/views/cms/pages/_form.html.erb +1 -1
  15. data/app/views/cms/pages/update.js.rjs +1 -0
  16. data/app/views/layouts/cms.html.erb +4 -3
  17. data/generators/liquid_cms/liquid_cms_generator.rb +1 -0
  18. data/generators/liquid_cms/templates/config/locales/cms/en.yml +4 -0
  19. data/generators/liquid_cms/templates/migration_rev2.rb +13 -0
  20. data/generators/liquid_cms/templates/public/cms/codemirror/LICENSE +16 -20
  21. data/generators/liquid_cms/templates/public/cms/codemirror/lib/codemirror.css +68 -0
  22. data/generators/liquid_cms/templates/public/cms/codemirror/lib/codemirror.js +2197 -0
  23. data/generators/liquid_cms/templates/public/cms/codemirror/lib/overlay.js +51 -0
  24. data/generators/liquid_cms/templates/public/cms/codemirror/lib/runmode.js +27 -0
  25. data/generators/liquid_cms/templates/public/cms/codemirror/mode/clike/clike.js +247 -0
  26. data/generators/liquid_cms/templates/public/cms/codemirror/mode/clike/index.html +102 -0
  27. data/generators/liquid_cms/templates/public/cms/codemirror/mode/clojure/clojure.js +207 -0
  28. data/generators/liquid_cms/templates/public/cms/codemirror/mode/clojure/index.html +85 -0
  29. data/generators/liquid_cms/templates/public/cms/codemirror/mode/coffeescript/LICENSE +22 -0
  30. data/generators/liquid_cms/templates/public/cms/codemirror/mode/coffeescript/coffeescript.js +325 -0
  31. data/generators/liquid_cms/templates/public/cms/codemirror/mode/coffeescript/index.html +722 -0
  32. data/generators/liquid_cms/templates/public/cms/codemirror/mode/css/css.js +124 -0
  33. data/generators/liquid_cms/templates/public/cms/codemirror/mode/css/index.html +56 -0
  34. data/generators/liquid_cms/templates/public/cms/codemirror/mode/diff/diff.css +3 -0
  35. data/generators/liquid_cms/templates/public/cms/codemirror/mode/diff/diff.js +13 -0
  36. data/generators/liquid_cms/templates/public/cms/codemirror/mode/diff/index.html +99 -0
  37. data/generators/liquid_cms/templates/public/cms/codemirror/mode/haskell/haskell.js +242 -0
  38. data/generators/liquid_cms/templates/public/cms/codemirror/mode/haskell/index.html +60 -0
  39. data/generators/liquid_cms/templates/public/cms/codemirror/mode/htmlmixed/htmlmixed.js +79 -0
  40. data/generators/liquid_cms/templates/public/cms/codemirror/mode/htmlmixed/index.html +52 -0
  41. data/generators/liquid_cms/templates/public/cms/codemirror/mode/javascript/index.html +78 -0
  42. data/generators/liquid_cms/templates/public/cms/codemirror/mode/javascript/javascript.js +352 -0
  43. data/generators/liquid_cms/templates/public/cms/codemirror/mode/jinja2/index.html +38 -0
  44. data/generators/liquid_cms/templates/public/cms/codemirror/mode/jinja2/jinja2.js +42 -0
  45. data/generators/liquid_cms/templates/public/cms/codemirror/mode/lua/index.html +72 -0
  46. data/generators/liquid_cms/templates/public/cms/codemirror/mode/lua/lua.js +140 -0
  47. data/generators/liquid_cms/templates/public/cms/codemirror/mode/markdown/index.html +340 -0
  48. data/generators/liquid_cms/templates/public/cms/codemirror/mode/markdown/markdown.css +10 -0
  49. data/generators/liquid_cms/templates/public/cms/codemirror/mode/markdown/markdown.js +230 -0
  50. data/generators/liquid_cms/templates/public/cms/codemirror/mode/ntriples/index.html +33 -0
  51. data/generators/liquid_cms/templates/public/cms/codemirror/mode/ntriples/ntriples.js +172 -0
  52. data/generators/liquid_cms/templates/public/cms/codemirror/mode/pascal/LICENSE +7 -0
  53. data/generators/liquid_cms/templates/public/cms/codemirror/mode/pascal/index.html +49 -0
  54. data/generators/liquid_cms/templates/public/cms/codemirror/mode/pascal/pascal.js +138 -0
  55. data/generators/liquid_cms/templates/public/cms/codemirror/mode/php/index.html +49 -0
  56. data/generators/liquid_cms/templates/public/cms/codemirror/mode/php/php.js +116 -0
  57. data/generators/liquid_cms/templates/public/cms/codemirror/mode/plsql/index.html +63 -0
  58. data/generators/liquid_cms/templates/public/cms/codemirror/mode/plsql/plsql.js +217 -0
  59. data/generators/liquid_cms/templates/public/cms/codemirror/mode/python/LICENSE.txt +21 -0
  60. data/generators/liquid_cms/templates/public/cms/codemirror/mode/python/index.html +123 -0
  61. data/generators/liquid_cms/templates/public/cms/codemirror/mode/python/python.js +320 -0
  62. data/generators/liquid_cms/templates/public/cms/codemirror/mode/r/LICENSE +24 -0
  63. data/generators/liquid_cms/templates/public/cms/codemirror/mode/r/index.html +74 -0
  64. data/generators/liquid_cms/templates/public/cms/codemirror/mode/r/r.js +141 -0
  65. data/generators/liquid_cms/templates/public/cms/codemirror/mode/rst/index.html +526 -0
  66. data/generators/liquid_cms/templates/public/cms/codemirror/mode/rst/rst.css +75 -0
  67. data/generators/liquid_cms/templates/public/cms/codemirror/mode/rst/rst.js +333 -0
  68. data/generators/liquid_cms/templates/public/cms/codemirror/mode/ruby/LICENSE +24 -0
  69. data/generators/liquid_cms/templates/public/cms/codemirror/mode/ruby/index.html +172 -0
  70. data/generators/liquid_cms/templates/public/cms/codemirror/mode/ruby/ruby.js +195 -0
  71. data/generators/liquid_cms/templates/public/cms/codemirror/mode/scheme/index.html +65 -0
  72. data/generators/liquid_cms/templates/public/cms/codemirror/mode/scheme/scheme.js +202 -0
  73. data/generators/liquid_cms/templates/public/cms/codemirror/mode/smalltalk/index.html +56 -0
  74. data/generators/liquid_cms/templates/public/cms/codemirror/mode/smalltalk/smalltalk.js +122 -0
  75. data/generators/liquid_cms/templates/public/cms/codemirror/mode/sparql/index.html +41 -0
  76. data/generators/liquid_cms/templates/public/cms/codemirror/mode/sparql/sparql.js +143 -0
  77. data/generators/liquid_cms/templates/public/cms/codemirror/mode/stex/index.html +96 -0
  78. data/generators/liquid_cms/templates/public/cms/codemirror/mode/stex/stex.js +167 -0
  79. data/generators/liquid_cms/templates/public/cms/codemirror/mode/velocity/index.html +103 -0
  80. data/generators/liquid_cms/templates/public/cms/codemirror/mode/velocity/velocity.js +146 -0
  81. data/generators/liquid_cms/templates/public/cms/codemirror/mode/xml/index.html +42 -0
  82. data/generators/liquid_cms/templates/public/cms/codemirror/mode/xml/xml.js +231 -0
  83. data/generators/liquid_cms/templates/public/cms/codemirror/mode/xmlpure/index.html +60 -0
  84. data/generators/liquid_cms/templates/public/cms/codemirror/mode/xmlpure/xmlpure.js +481 -0
  85. data/generators/liquid_cms/templates/public/cms/codemirror/mode/yaml/index.html +68 -0
  86. data/generators/liquid_cms/templates/public/cms/codemirror/mode/yaml/yaml.js +95 -0
  87. data/generators/liquid_cms/templates/public/cms/codemirror/theme/cobalt.css +17 -0
  88. data/generators/liquid_cms/templates/public/cms/codemirror/theme/default.css +19 -0
  89. data/generators/liquid_cms/templates/public/cms/codemirror/theme/eclipse.css +24 -0
  90. data/generators/liquid_cms/templates/public/cms/codemirror/theme/elegant.css +9 -0
  91. data/generators/liquid_cms/templates/public/cms/codemirror/theme/neat.css +8 -0
  92. data/generators/liquid_cms/templates/public/cms/codemirror/theme/night.css +20 -0
  93. data/generators/liquid_cms/templates/public/cms/javascripts/cms.js +1 -1
  94. data/generators/liquid_cms/templates/public/cms/javascripts/codemirror_custom.js +96 -0
  95. data/generators/liquid_cms/templates/public/cms/stylesheets/codemirror_changes.css +26 -0
  96. data/generators/liquid_cms/templates/public/cms/stylesheets/liquid.css +7 -0
  97. data/generators/liquid_cms/templates/public/cms/stylesheets/simple_form.css +0 -8
  98. data/lib/liquid_cms/version.rb +1 -1
  99. data/liquid_cms.gemspec +0 -1
  100. data/test/functional/assets_controller_test.rb +35 -20
  101. data/test/functional/components_controller_test.rb +15 -5
  102. data/test/functional/pages_controller_test.rb +19 -6
  103. data/test/rails_app/config/environment.rb +1 -1
  104. data/test/rails_app/config/locales/cms/en.yml +19 -4
  105. data/test/rails_app/db/migrate/20110511161859_create_liquid_cms_upgrade_rev2.rb +13 -0
  106. data/test/unit/asset_test.rb +1 -1
  107. metadata +100 -58
  108. data/generators/liquid_cms/templates/public/cms/codemirror/css/csscolors.css +0 -55
  109. data/generators/liquid_cms/templates/public/cms/codemirror/css/docs.css +0 -158
  110. data/generators/liquid_cms/templates/public/cms/codemirror/css/font.js +0 -15
  111. data/generators/liquid_cms/templates/public/cms/codemirror/css/jscolors.css +0 -59
  112. data/generators/liquid_cms/templates/public/cms/codemirror/css/sparqlcolors.css +0 -43
  113. data/generators/liquid_cms/templates/public/cms/codemirror/css/xmlcolors.css +0 -55
  114. data/generators/liquid_cms/templates/public/cms/codemirror/js/codemirror.js +0 -582
  115. data/generators/liquid_cms/templates/public/cms/codemirror/js/editor.js +0 -1671
  116. data/generators/liquid_cms/templates/public/cms/codemirror/js/highlight.js +0 -68
  117. data/generators/liquid_cms/templates/public/cms/codemirror/js/mirrorframe.js +0 -81
  118. data/generators/liquid_cms/templates/public/cms/codemirror/js/parsecss.js +0 -161
  119. data/generators/liquid_cms/templates/public/cms/codemirror/js/parsedummy.js +0 -32
  120. data/generators/liquid_cms/templates/public/cms/codemirror/js/parsehtmlmixed.js +0 -93
  121. data/generators/liquid_cms/templates/public/cms/codemirror/js/parsejavascript.js +0 -359
  122. data/generators/liquid_cms/templates/public/cms/codemirror/js/parsesparql.js +0 -162
  123. data/generators/liquid_cms/templates/public/cms/codemirror/js/parsexml.js +0 -291
  124. data/generators/liquid_cms/templates/public/cms/codemirror/js/select.js +0 -699
  125. data/generators/liquid_cms/templates/public/cms/codemirror/js/stringstream.js +0 -159
  126. data/generators/liquid_cms/templates/public/cms/codemirror/js/tokenize.js +0 -57
  127. data/generators/liquid_cms/templates/public/cms/codemirror/js/tokenizejavascript.js +0 -174
  128. data/generators/liquid_cms/templates/public/cms/codemirror/js/undo.js +0 -413
  129. data/generators/liquid_cms/templates/public/cms/codemirror/js/unittests.js +0 -44
  130. data/generators/liquid_cms/templates/public/cms/codemirror/js/util.js +0 -133
@@ -0,0 +1,140 @@
1
+ // LUA mode. Ported to CodeMirror 2 from Franciszek Wawrzak's
2
+ // CodeMirror 1 mode.
3
+ // highlights keywords, strings, comments (no leveling supported! ("[==[")), tokens, basic indenting
4
+
5
+ CodeMirror.defineMode("lua", function(config, parserConfig) {
6
+ var indentUnit = config.indentUnit;
7
+
8
+ function prefixRE(words) {
9
+ return new RegExp("^(?:" + words.join("|") + ")", "i");
10
+ }
11
+ function wordRE(words) {
12
+ return new RegExp("^(?:" + words.join("|") + ")$", "i");
13
+ }
14
+ var specials = wordRE(parserConfig.specials || []);
15
+
16
+ // long list of standard functions from lua manual
17
+ var builtins = wordRE([
18
+ "_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load",
19
+ "loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require",
20
+ "select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall",
21
+
22
+ "coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield",
23
+
24
+ "debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable",
25
+ "debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable",
26
+ "debug.setupvalue","debug.traceback",
27
+
28
+ "close","flush","lines","read","seek","setvbuf","write",
29
+
30
+ "io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin",
31
+ "io.stdout","io.tmpfile","io.type","io.write",
32
+
33
+ "math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg",
34
+ "math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max",
35
+ "math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh",
36
+ "math.sqrt","math.tan","math.tanh",
37
+
38
+ "os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale",
39
+ "os.time","os.tmpname",
40
+
41
+ "package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload",
42
+ "package.seeall",
43
+
44
+ "string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub",
45
+ "string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper",
46
+
47
+ "table.concat","table.insert","table.maxn","table.remove","table.sort"
48
+ ]);
49
+ var keywords = wordRE(["and","break","elseif","false","nil","not","or","return",
50
+ "true","function", "end", "if", "then", "else", "do",
51
+ "while", "repeat", "until", "for", "in", "local" ]);
52
+
53
+ var indentTokens = wordRE(["function", "if","repeat","for","while", "\\(", "{"]);
54
+ var dedentTokens = wordRE(["end", "until", "\\)", "}"]);
55
+ var dedentPartial = prefixRE(["end", "until", "\\)", "}", "else", "elseif"]);
56
+
57
+ function readBracket(stream) {
58
+ var level = 0;
59
+ while (stream.eat("=")) ++level;
60
+ stream.eat("[");
61
+ return level;
62
+ }
63
+
64
+ function normal(stream, state) {
65
+ var ch = stream.next();
66
+ if (ch == "-" && stream.eat("-")) {
67
+ if (stream.eat("["))
68
+ return (state.cur = bracketed(readBracket(stream), "comment"))(stream, state);
69
+ stream.skipToEnd();
70
+ return "comment";
71
+ }
72
+ if (ch == "\"" || ch == "'")
73
+ return (state.cur = string(ch))(stream, state);
74
+ if (ch == "[" && /[\[=]/.test(stream.peek()))
75
+ return (state.cur = bracketed(readBracket(stream), "string"))(stream, state);
76
+ if (/\d/.test(ch)) {
77
+ stream.eatWhile(/[\w.%]/);
78
+ return "number";
79
+ }
80
+ if (/[\w_]/.test(ch)) {
81
+ stream.eatWhile(/[\w\\\-_.]/);
82
+ return "variable";
83
+ }
84
+ return null;
85
+ }
86
+
87
+ function bracketed(level, style) {
88
+ return function(stream, state) {
89
+ var curlev = null, ch;
90
+ while ((ch = stream.next()) != null) {
91
+ if (curlev == null) {if (ch == "]") curlev = 0;}
92
+ else if (ch == "=") ++curlev;
93
+ else if (ch == "]" && curlev == level) { state.cur = normal; break; }
94
+ else curlev = null;
95
+ }
96
+ return style;
97
+ };
98
+ }
99
+
100
+ function string(quote) {
101
+ return function(stream, state) {
102
+ var escaped = false, ch;
103
+ while ((ch = stream.next()) != null) {
104
+ if (ch == quote && !escaped) break;
105
+ escaped = !escaped && ch == "\\";
106
+ }
107
+ if (!escaped) state.cur = normal;
108
+ return "string";
109
+ };
110
+ }
111
+
112
+ return {
113
+ startState: function(basecol) {
114
+ return {basecol: basecol || 0, indentDepth: 0, cur: normal};
115
+ },
116
+
117
+ token: function(stream, state) {
118
+ if (stream.eatSpace()) return null;
119
+ var style = state.cur(stream, state);
120
+ var word = stream.current();
121
+ if (style == "variable") {
122
+ if (keywords.test(word)) style = "keyword";
123
+ else if (builtins.test(word)) style = "builtin";
124
+ else if (specials.test(word)) style = "variable-2";
125
+ }
126
+ if ((style != "lua-comment") && (style != "lua-string")){
127
+ if (indentTokens.test(word)) ++state.indentDepth;
128
+ else if (dedentTokens.test(word)) --state.indentDepth;
129
+ }
130
+ return style;
131
+ },
132
+
133
+ indent: function(state, textAfter) {
134
+ var closing = dedentPartial.test(textAfter);
135
+ return state.basecol + indentUnit * (state.indentDepth - (closing ? 1 : 0));
136
+ }
137
+ };
138
+ });
139
+
140
+ CodeMirror.defineMIME("text/x-lua", "lua");
@@ -0,0 +1,340 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <title>CodeMirror 2: Markdown mode</title>
5
+ <link rel="stylesheet" href="../../lib/codemirror.css">
6
+ <script src="../../lib/codemirror.js"></script>
7
+ <script src="../xml/xml.js"></script>
8
+ <script src="markdown.js"></script>
9
+ <link rel="stylesheet" href="../../theme/default.css">
10
+ <link rel="stylesheet" href="markdown.css">
11
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
12
+ <link rel="stylesheet" href="../../css/docs.css">
13
+ </head>
14
+ <body>
15
+ <h1>CodeMirror 2: Markdown mode</h1>
16
+
17
+ <!-- source: http://daringfireball.net/projects/markdown/basics.text -->
18
+ <form><textarea id="code" name="code">
19
+ Markdown: Basics
20
+ ================
21
+
22
+ &lt;ul id="ProjectSubmenu"&gt;
23
+ &lt;li&gt;&lt;a href="/projects/markdown/" title="Markdown Project Page"&gt;Main&lt;/a&gt;&lt;/li&gt;
24
+ &lt;li&gt;&lt;a class="selected" title="Markdown Basics"&gt;Basics&lt;/a&gt;&lt;/li&gt;
25
+ &lt;li&gt;&lt;a href="/projects/markdown/syntax" title="Markdown Syntax Documentation"&gt;Syntax&lt;/a&gt;&lt;/li&gt;
26
+ &lt;li&gt;&lt;a href="/projects/markdown/license" title="Pricing and License Information"&gt;License&lt;/a&gt;&lt;/li&gt;
27
+ &lt;li&gt;&lt;a href="/projects/markdown/dingus" title="Online Markdown Web Form"&gt;Dingus&lt;/a&gt;&lt;/li&gt;
28
+ &lt;/ul&gt;
29
+
30
+
31
+ Getting the Gist of Markdown's Formatting Syntax
32
+ ------------------------------------------------
33
+
34
+ This page offers a brief overview of what it's like to use Markdown.
35
+ The [syntax page] [s] provides complete, detailed documentation for
36
+ every feature, but Markdown should be very easy to pick up simply by
37
+ looking at a few examples of it in action. The examples on this page
38
+ are written in a before/after style, showing example syntax and the
39
+ HTML output produced by Markdown.
40
+
41
+ It's also helpful to simply try Markdown out; the [Dingus] [d] is a
42
+ web application that allows you type your own Markdown-formatted text
43
+ and translate it to XHTML.
44
+
45
+ **Note:** This document is itself written using Markdown; you
46
+ can [see the source for it by adding '.text' to the URL] [src].
47
+
48
+ [s]: /projects/markdown/syntax "Markdown Syntax"
49
+ [d]: /projects/markdown/dingus "Markdown Dingus"
50
+ [src]: /projects/markdown/basics.text
51
+
52
+
53
+ ## Paragraphs, Headers, Blockquotes ##
54
+
55
+ A paragraph is simply one or more consecutive lines of text, separated
56
+ by one or more blank lines. (A blank line is any line that looks like
57
+ a blank line -- a line containing nothing but spaces or tabs is
58
+ considered blank.) Normal paragraphs should not be indented with
59
+ spaces or tabs.
60
+
61
+ Markdown offers two styles of headers: *Setext* and *atx*.
62
+ Setext-style headers for `&lt;h1&gt;` and `&lt;h2&gt;` are created by
63
+ "underlining" with equal signs (`=`) and hyphens (`-`), respectively.
64
+ To create an atx-style header, you put 1-6 hash marks (`#`) at the
65
+ beginning of the line -- the number of hashes equals the resulting
66
+ HTML header level.
67
+
68
+ Blockquotes are indicated using email-style '`&gt;`' angle brackets.
69
+
70
+ Markdown:
71
+
72
+ A First Level Header
73
+ ====================
74
+
75
+ A Second Level Header
76
+ ---------------------
77
+
78
+ Now is the time for all good men to come to
79
+ the aid of their country. This is just a
80
+ regular paragraph.
81
+
82
+ The quick brown fox jumped over the lazy
83
+ dog's back.
84
+
85
+ ### Header 3
86
+
87
+ &gt; This is a blockquote.
88
+ &gt;
89
+ &gt; This is the second paragraph in the blockquote.
90
+ &gt;
91
+ &gt; ## This is an H2 in a blockquote
92
+
93
+
94
+ Output:
95
+
96
+ &lt;h1&gt;A First Level Header&lt;/h1&gt;
97
+
98
+ &lt;h2&gt;A Second Level Header&lt;/h2&gt;
99
+
100
+ &lt;p&gt;Now is the time for all good men to come to
101
+ the aid of their country. This is just a
102
+ regular paragraph.&lt;/p&gt;
103
+
104
+ &lt;p&gt;The quick brown fox jumped over the lazy
105
+ dog's back.&lt;/p&gt;
106
+
107
+ &lt;h3&gt;Header 3&lt;/h3&gt;
108
+
109
+ &lt;blockquote&gt;
110
+ &lt;p&gt;This is a blockquote.&lt;/p&gt;
111
+
112
+ &lt;p&gt;This is the second paragraph in the blockquote.&lt;/p&gt;
113
+
114
+ &lt;h2&gt;This is an H2 in a blockquote&lt;/h2&gt;
115
+ &lt;/blockquote&gt;
116
+
117
+
118
+
119
+ ### Phrase Emphasis ###
120
+
121
+ Markdown uses asterisks and underscores to indicate spans of emphasis.
122
+
123
+ Markdown:
124
+
125
+ Some of these words *are emphasized*.
126
+ Some of these words _are emphasized also_.
127
+
128
+ Use two asterisks for **strong emphasis**.
129
+ Or, if you prefer, __use two underscores instead__.
130
+
131
+ Output:
132
+
133
+ &lt;p&gt;Some of these words &lt;em&gt;are emphasized&lt;/em&gt;.
134
+ Some of these words &lt;em&gt;are emphasized also&lt;/em&gt;.&lt;/p&gt;
135
+
136
+ &lt;p&gt;Use two asterisks for &lt;strong&gt;strong emphasis&lt;/strong&gt;.
137
+ Or, if you prefer, &lt;strong&gt;use two underscores instead&lt;/strong&gt;.&lt;/p&gt;
138
+
139
+
140
+
141
+ ## Lists ##
142
+
143
+ Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`,
144
+ `+`, and `-`) as list markers. These three markers are
145
+ interchangable; this:
146
+
147
+ * Candy.
148
+ * Gum.
149
+ * Booze.
150
+
151
+ this:
152
+
153
+ + Candy.
154
+ + Gum.
155
+ + Booze.
156
+
157
+ and this:
158
+
159
+ - Candy.
160
+ - Gum.
161
+ - Booze.
162
+
163
+ all produce the same output:
164
+
165
+ &lt;ul&gt;
166
+ &lt;li&gt;Candy.&lt;/li&gt;
167
+ &lt;li&gt;Gum.&lt;/li&gt;
168
+ &lt;li&gt;Booze.&lt;/li&gt;
169
+ &lt;/ul&gt;
170
+
171
+ Ordered (numbered) lists use regular numbers, followed by periods, as
172
+ list markers:
173
+
174
+ 1. Red
175
+ 2. Green
176
+ 3. Blue
177
+
178
+ Output:
179
+
180
+ &lt;ol&gt;
181
+ &lt;li&gt;Red&lt;/li&gt;
182
+ &lt;li&gt;Green&lt;/li&gt;
183
+ &lt;li&gt;Blue&lt;/li&gt;
184
+ &lt;/ol&gt;
185
+
186
+ If you put blank lines between items, you'll get `&lt;p&gt;` tags for the
187
+ list item text. You can create multi-paragraph list items by indenting
188
+ the paragraphs by 4 spaces or 1 tab:
189
+
190
+ * A list item.
191
+
192
+ With multiple paragraphs.
193
+
194
+ * Another item in the list.
195
+
196
+ Output:
197
+
198
+ &lt;ul&gt;
199
+ &lt;li&gt;&lt;p&gt;A list item.&lt;/p&gt;
200
+ &lt;p&gt;With multiple paragraphs.&lt;/p&gt;&lt;/li&gt;
201
+ &lt;li&gt;&lt;p&gt;Another item in the list.&lt;/p&gt;&lt;/li&gt;
202
+ &lt;/ul&gt;
203
+
204
+
205
+
206
+ ### Links ###
207
+
208
+ Markdown supports two styles for creating links: *inline* and
209
+ *reference*. With both styles, you use square brackets to delimit the
210
+ text you want to turn into a link.
211
+
212
+ Inline-style links use parentheses immediately after the link text.
213
+ For example:
214
+
215
+ This is an [example link](http://example.com/).
216
+
217
+ Output:
218
+
219
+ &lt;p&gt;This is an &lt;a href="http://example.com/"&gt;
220
+ example link&lt;/a&gt;.&lt;/p&gt;
221
+
222
+ Optionally, you may include a title attribute in the parentheses:
223
+
224
+ This is an [example link](http://example.com/ "With a Title").
225
+
226
+ Output:
227
+
228
+ &lt;p&gt;This is an &lt;a href="http://example.com/" title="With a Title"&gt;
229
+ example link&lt;/a&gt;.&lt;/p&gt;
230
+
231
+ Reference-style links allow you to refer to your links by names, which
232
+ you define elsewhere in your document:
233
+
234
+ I get 10 times more traffic from [Google][1] than from
235
+ [Yahoo][2] or [MSN][3].
236
+
237
+ [1]: http://google.com/ "Google"
238
+ [2]: http://search.yahoo.com/ "Yahoo Search"
239
+ [3]: http://search.msn.com/ "MSN Search"
240
+
241
+ Output:
242
+
243
+ &lt;p&gt;I get 10 times more traffic from &lt;a href="http://google.com/"
244
+ title="Google"&gt;Google&lt;/a&gt; than from &lt;a href="http://search.yahoo.com/"
245
+ title="Yahoo Search"&gt;Yahoo&lt;/a&gt; or &lt;a href="http://search.msn.com/"
246
+ title="MSN Search"&gt;MSN&lt;/a&gt;.&lt;/p&gt;
247
+
248
+ The title attribute is optional. Link names may contain letters,
249
+ numbers and spaces, but are *not* case sensitive:
250
+
251
+ I start my morning with a cup of coffee and
252
+ [The New York Times][NY Times].
253
+
254
+ [ny times]: http://www.nytimes.com/
255
+
256
+ Output:
257
+
258
+ &lt;p&gt;I start my morning with a cup of coffee and
259
+ &lt;a href="http://www.nytimes.com/"&gt;The New York Times&lt;/a&gt;.&lt;/p&gt;
260
+
261
+
262
+ ### Images ###
263
+
264
+ Image syntax is very much like link syntax.
265
+
266
+ Inline (titles are optional):
267
+
268
+ ![alt text](/path/to/img.jpg "Title")
269
+
270
+ Reference-style:
271
+
272
+ ![alt text][id]
273
+
274
+ [id]: /path/to/img.jpg "Title"
275
+
276
+ Both of the above examples produce the same output:
277
+
278
+ &lt;img src="/path/to/img.jpg" alt="alt text" title="Title" /&gt;
279
+
280
+
281
+
282
+ ### Code ###
283
+
284
+ In a regular paragraph, you can create code span by wrapping text in
285
+ backtick quotes. Any ampersands (`&amp;`) and angle brackets (`&lt;` or
286
+ `&gt;`) will automatically be translated into HTML entities. This makes
287
+ it easy to use Markdown to write about HTML example code:
288
+
289
+ I strongly recommend against using any `&lt;blink&gt;` tags.
290
+
291
+ I wish SmartyPants used named entities like `&amp;mdash;`
292
+ instead of decimal-encoded entites like `&amp;#8212;`.
293
+
294
+ Output:
295
+
296
+ &lt;p&gt;I strongly recommend against using any
297
+ &lt;code&gt;&amp;lt;blink&amp;gt;&lt;/code&gt; tags.&lt;/p&gt;
298
+
299
+ &lt;p&gt;I wish SmartyPants used named entities like
300
+ &lt;code&gt;&amp;amp;mdash;&lt;/code&gt; instead of decimal-encoded
301
+ entites like &lt;code&gt;&amp;amp;#8212;&lt;/code&gt;.&lt;/p&gt;
302
+
303
+
304
+ To specify an entire block of pre-formatted code, indent every line of
305
+ the block by 4 spaces or 1 tab. Just like with code spans, `&amp;`, `&lt;`,
306
+ and `&gt;` characters will be escaped automatically.
307
+
308
+ Markdown:
309
+
310
+ If you want your page to validate under XHTML 1.0 Strict,
311
+ you've got to put paragraph tags in your blockquotes:
312
+
313
+ &lt;blockquote&gt;
314
+ &lt;p&gt;For example.&lt;/p&gt;
315
+ &lt;/blockquote&gt;
316
+
317
+ Output:
318
+
319
+ &lt;p&gt;If you want your page to validate under XHTML 1.0 Strict,
320
+ you've got to put paragraph tags in your blockquotes:&lt;/p&gt;
321
+
322
+ &lt;pre&gt;&lt;code&gt;&amp;lt;blockquote&amp;gt;
323
+ &amp;lt;p&amp;gt;For example.&amp;lt;/p&amp;gt;
324
+ &amp;lt;/blockquote&amp;gt;
325
+ &lt;/code&gt;&lt;/pre&gt;
326
+ </textarea></form>
327
+
328
+ <script>
329
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
330
+ mode: 'markdown',
331
+ lineNumbers: true,
332
+ matchBrackets: true,
333
+ theme: "default"
334
+ });
335
+ </script>
336
+
337
+ <p><strong>MIME types defined:</strong> <code>text/x-markdown</code>.</p>
338
+
339
+ </body>
340
+ </html>
@@ -0,0 +1,10 @@
1
+ .cm-s-default span.cm-header {color: #2f2f4f; font-weight:bold;}
2
+ .cm-s-default span.cm-code {color: #666;}
3
+ .cm-s-default span.cm-quote {color: #090;}
4
+ .cm-s-default span.cm-list {color: #a50;}
5
+ .cm-s-default span.cm-hr {color: #999;}
6
+ .cm-s-default span.cm-linktext {color: #00c; text-decoration: underline;}
7
+ .cm-s-default span.cm-linkhref {color: #00c;}
8
+ .cm-s-default span.cm-em {font-style: italic;}
9
+ .cm-s-default span.cm-strong {font-weight: bold;}
10
+ .cm-s-default span.cm-emstrong {font-style: italic; font-weight: bold;}