ledger_web 1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. data/.gitignore +10 -0
  2. data/LICENSE +7 -0
  3. data/README.md +140 -0
  4. data/Rakefile +11 -0
  5. data/bin/ledger_web +14 -0
  6. data/ledger_web.gemspec +26 -0
  7. data/lib/ledger_web/app.rb +69 -0
  8. data/lib/ledger_web/config.rb +87 -0
  9. data/lib/ledger_web/db/migrate/20111226180900_initial_schema.rb +38 -0
  10. data/lib/ledger_web/db/migrate/20111231132900_add_views.rb +37 -0
  11. data/lib/ledger_web/db.rb +54 -0
  12. data/lib/ledger_web/helpers.rb +62 -0
  13. data/lib/ledger_web/public/bootstrap-dropdown.js +55 -0
  14. data/lib/ledger_web/public/bootstrap.min.css +356 -0
  15. data/lib/ledger_web/public/codemirror/keymap/emacs.js +29 -0
  16. data/lib/ledger_web/public/codemirror/keymap/vim.js +76 -0
  17. data/lib/ledger_web/public/codemirror/lib/codemirror.css +104 -0
  18. data/lib/ledger_web/public/codemirror/lib/codemirror.js +2761 -0
  19. data/lib/ledger_web/public/codemirror/lib/util/dialog.css +23 -0
  20. data/lib/ledger_web/public/codemirror/lib/util/dialog.js +63 -0
  21. data/lib/ledger_web/public/codemirror/lib/util/foldcode.js +66 -0
  22. data/lib/ledger_web/public/codemirror/lib/util/formatting.js +291 -0
  23. data/lib/ledger_web/public/codemirror/lib/util/javascript-hint.js +83 -0
  24. data/lib/ledger_web/public/codemirror/lib/util/overlay.js +51 -0
  25. data/lib/ledger_web/public/codemirror/lib/util/runmode.js +27 -0
  26. data/lib/ledger_web/public/codemirror/lib/util/search.js +114 -0
  27. data/lib/ledger_web/public/codemirror/lib/util/searchcursor.js +117 -0
  28. data/lib/ledger_web/public/codemirror/lib/util/simple-hint.css +16 -0
  29. data/lib/ledger_web/public/codemirror/lib/util/simple-hint.js +66 -0
  30. data/lib/ledger_web/public/codemirror/mode/clike/clike.js +249 -0
  31. data/lib/ledger_web/public/codemirror/mode/clike/index.html +101 -0
  32. data/lib/ledger_web/public/codemirror/mode/clojure/clojure.js +207 -0
  33. data/lib/ledger_web/public/codemirror/mode/clojure/index.html +66 -0
  34. data/lib/ledger_web/public/codemirror/mode/coffeescript/LICENSE +22 -0
  35. data/lib/ledger_web/public/codemirror/mode/coffeescript/coffeescript.js +325 -0
  36. data/lib/ledger_web/public/codemirror/mode/coffeescript/index.html +721 -0
  37. data/lib/ledger_web/public/codemirror/mode/css/css.js +124 -0
  38. data/lib/ledger_web/public/codemirror/mode/css/index.html +55 -0
  39. data/lib/ledger_web/public/codemirror/mode/diff/diff.css +3 -0
  40. data/lib/ledger_web/public/codemirror/mode/diff/diff.js +13 -0
  41. data/lib/ledger_web/public/codemirror/mode/diff/index.html +99 -0
  42. data/lib/ledger_web/public/codemirror/mode/gfm/gfm.js +108 -0
  43. data/lib/ledger_web/public/codemirror/mode/gfm/index.html +47 -0
  44. data/lib/ledger_web/public/codemirror/mode/groovy/groovy.js +210 -0
  45. data/lib/ledger_web/public/codemirror/mode/groovy/index.html +71 -0
  46. data/lib/ledger_web/public/codemirror/mode/haskell/haskell.js +242 -0
  47. data/lib/ledger_web/public/codemirror/mode/haskell/index.html +60 -0
  48. data/lib/ledger_web/public/codemirror/mode/htmlembedded/htmlembedded.js +68 -0
  49. data/lib/ledger_web/public/codemirror/mode/htmlembedded/index.html +49 -0
  50. data/lib/ledger_web/public/codemirror/mode/htmlmixed/htmlmixed.js +83 -0
  51. data/lib/ledger_web/public/codemirror/mode/htmlmixed/index.html +51 -0
  52. data/lib/ledger_web/public/codemirror/mode/javascript/index.html +77 -0
  53. data/lib/ledger_web/public/codemirror/mode/javascript/javascript.js +360 -0
  54. data/lib/ledger_web/public/codemirror/mode/jinja2/index.html +37 -0
  55. data/lib/ledger_web/public/codemirror/mode/jinja2/jinja2.js +42 -0
  56. data/lib/ledger_web/public/codemirror/mode/lua/index.html +72 -0
  57. data/lib/ledger_web/public/codemirror/mode/lua/lua.js +140 -0
  58. data/lib/ledger_web/public/codemirror/mode/markdown/index.html +339 -0
  59. data/lib/ledger_web/public/codemirror/mode/markdown/markdown.js +242 -0
  60. data/lib/ledger_web/public/codemirror/mode/ntriples/index.html +32 -0
  61. data/lib/ledger_web/public/codemirror/mode/ntriples/ntriples.js +172 -0
  62. data/lib/ledger_web/public/codemirror/mode/pascal/LICENSE +7 -0
  63. data/lib/ledger_web/public/codemirror/mode/pascal/index.html +48 -0
  64. data/lib/ledger_web/public/codemirror/mode/pascal/pascal.js +138 -0
  65. data/lib/ledger_web/public/codemirror/mode/perl/LICENSE +19 -0
  66. data/lib/ledger_web/public/codemirror/mode/perl/index.html +62 -0
  67. data/lib/ledger_web/public/codemirror/mode/perl/perl.js +816 -0
  68. data/lib/ledger_web/public/codemirror/mode/php/index.html +48 -0
  69. data/lib/ledger_web/public/codemirror/mode/php/php.js +120 -0
  70. data/lib/ledger_web/public/codemirror/mode/plsql/index.html +62 -0
  71. data/lib/ledger_web/public/codemirror/mode/plsql/plsql.js +217 -0
  72. data/lib/ledger_web/public/codemirror/mode/python/LICENSE.txt +21 -0
  73. data/lib/ledger_web/public/codemirror/mode/python/index.html +122 -0
  74. data/lib/ledger_web/public/codemirror/mode/python/python.js +333 -0
  75. data/lib/ledger_web/public/codemirror/mode/r/LICENSE +24 -0
  76. data/lib/ledger_web/public/codemirror/mode/r/index.html +73 -0
  77. data/lib/ledger_web/public/codemirror/mode/r/r.js +141 -0
  78. data/lib/ledger_web/public/codemirror/mode/rpm/changes/changes.js +19 -0
  79. data/lib/ledger_web/public/codemirror/mode/rpm/changes/index.html +53 -0
  80. data/lib/ledger_web/public/codemirror/mode/rpm/spec/index.html +99 -0
  81. data/lib/ledger_web/public/codemirror/mode/rpm/spec/spec.css +5 -0
  82. data/lib/ledger_web/public/codemirror/mode/rpm/spec/spec.js +66 -0
  83. data/lib/ledger_web/public/codemirror/mode/rst/index.html +525 -0
  84. data/lib/ledger_web/public/codemirror/mode/rst/rst.js +326 -0
  85. data/lib/ledger_web/public/codemirror/mode/ruby/LICENSE +24 -0
  86. data/lib/ledger_web/public/codemirror/mode/ruby/index.html +171 -0
  87. data/lib/ledger_web/public/codemirror/mode/ruby/ruby.js +195 -0
  88. data/lib/ledger_web/public/codemirror/mode/rust/index.html +48 -0
  89. data/lib/ledger_web/public/codemirror/mode/rust/rust.js +411 -0
  90. data/lib/ledger_web/public/codemirror/mode/scheme/index.html +64 -0
  91. data/lib/ledger_web/public/codemirror/mode/scheme/scheme.js +202 -0
  92. data/lib/ledger_web/public/codemirror/mode/smalltalk/index.html +55 -0
  93. data/lib/ledger_web/public/codemirror/mode/smalltalk/smalltalk.js +139 -0
  94. data/lib/ledger_web/public/codemirror/mode/sparql/index.html +40 -0
  95. data/lib/ledger_web/public/codemirror/mode/sparql/sparql.js +143 -0
  96. data/lib/ledger_web/public/codemirror/mode/stex/index.html +95 -0
  97. data/lib/ledger_web/public/codemirror/mode/stex/stex.js +167 -0
  98. data/lib/ledger_web/public/codemirror/mode/tiddlywiki/index.html +183 -0
  99. data/lib/ledger_web/public/codemirror/mode/tiddlywiki/tiddlywiki.css +21 -0
  100. data/lib/ledger_web/public/codemirror/mode/tiddlywiki/tiddlywiki.js +374 -0
  101. data/lib/ledger_web/public/codemirror/mode/velocity/index.html +103 -0
  102. data/lib/ledger_web/public/codemirror/mode/velocity/velocity.js +146 -0
  103. data/lib/ledger_web/public/codemirror/mode/xml/index.html +44 -0
  104. data/lib/ledger_web/public/codemirror/mode/xml/xml.js +252 -0
  105. data/lib/ledger_web/public/codemirror/mode/xmlpure/index.html +59 -0
  106. data/lib/ledger_web/public/codemirror/mode/xmlpure/xmlpure.js +485 -0
  107. data/lib/ledger_web/public/codemirror/mode/yaml/index.html +67 -0
  108. data/lib/ledger_web/public/codemirror/mode/yaml/yaml.js +95 -0
  109. data/lib/ledger_web/public/codemirror/theme/cobalt.css +18 -0
  110. data/lib/ledger_web/public/codemirror/theme/eclipse.css +25 -0
  111. data/lib/ledger_web/public/codemirror/theme/elegant.css +10 -0
  112. data/lib/ledger_web/public/codemirror/theme/monokai.css +28 -0
  113. data/lib/ledger_web/public/codemirror/theme/neat.css +9 -0
  114. data/lib/ledger_web/public/codemirror/theme/night.css +21 -0
  115. data/lib/ledger_web/public/codemirror/theme/rubyblue.css +21 -0
  116. data/lib/ledger_web/public/jquery-1.7.1.min.js +4 -0
  117. data/lib/ledger_web/public/jquery.tablesorter.min.js +4 -0
  118. data/lib/ledger_web/public/ledger.css +14 -0
  119. data/lib/ledger_web/report.rb +187 -0
  120. data/lib/ledger_web/reports/savings_rate.erb +49 -0
  121. data/lib/ledger_web/version.rb +3 -0
  122. data/lib/ledger_web/views/error.erb +5 -0
  123. data/lib/ledger_web/views/help.erb +6 -0
  124. data/lib/ledger_web/views/layout.erb +44 -0
  125. data/lib/ledger_web/views/table.erb +31 -0
  126. data/lib/ledger_web/watcher.rb +37 -0
  127. data/lib/ledger_web.rb +20 -0
  128. metadata +229 -0
@@ -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","do", "\\(", "{"]);
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 != "comment") && (style != "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,339 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <title>CodeMirror: 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="markdown.css">
10
+ <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
11
+ <link rel="stylesheet" href="../../doc/docs.css">
12
+ </head>
13
+ <body>
14
+ <h1>CodeMirror: Markdown mode</h1>
15
+
16
+ <!-- source: http://daringfireball.net/projects/markdown/basics.text -->
17
+ <form><textarea id="code" name="code">
18
+ Markdown: Basics
19
+ ================
20
+
21
+ &lt;ul id="ProjectSubmenu"&gt;
22
+ &lt;li&gt;&lt;a href="/projects/markdown/" title="Markdown Project Page"&gt;Main&lt;/a&gt;&lt;/li&gt;
23
+ &lt;li&gt;&lt;a class="selected" title="Markdown Basics"&gt;Basics&lt;/a&gt;&lt;/li&gt;
24
+ &lt;li&gt;&lt;a href="/projects/markdown/syntax" title="Markdown Syntax Documentation"&gt;Syntax&lt;/a&gt;&lt;/li&gt;
25
+ &lt;li&gt;&lt;a href="/projects/markdown/license" title="Pricing and License Information"&gt;License&lt;/a&gt;&lt;/li&gt;
26
+ &lt;li&gt;&lt;a href="/projects/markdown/dingus" title="Online Markdown Web Form"&gt;Dingus&lt;/a&gt;&lt;/li&gt;
27
+ &lt;/ul&gt;
28
+
29
+
30
+ Getting the Gist of Markdown's Formatting Syntax
31
+ ------------------------------------------------
32
+
33
+ This page offers a brief overview of what it's like to use Markdown.
34
+ The [syntax page] [s] provides complete, detailed documentation for
35
+ every feature, but Markdown should be very easy to pick up simply by
36
+ looking at a few examples of it in action. The examples on this page
37
+ are written in a before/after style, showing example syntax and the
38
+ HTML output produced by Markdown.
39
+
40
+ It's also helpful to simply try Markdown out; the [Dingus] [d] is a
41
+ web application that allows you type your own Markdown-formatted text
42
+ and translate it to XHTML.
43
+
44
+ **Note:** This document is itself written using Markdown; you
45
+ can [see the source for it by adding '.text' to the URL] [src].
46
+
47
+ [s]: /projects/markdown/syntax "Markdown Syntax"
48
+ [d]: /projects/markdown/dingus "Markdown Dingus"
49
+ [src]: /projects/markdown/basics.text
50
+
51
+
52
+ ## Paragraphs, Headers, Blockquotes ##
53
+
54
+ A paragraph is simply one or more consecutive lines of text, separated
55
+ by one or more blank lines. (A blank line is any line that looks like
56
+ a blank line -- a line containing nothing but spaces or tabs is
57
+ considered blank.) Normal paragraphs should not be indented with
58
+ spaces or tabs.
59
+
60
+ Markdown offers two styles of headers: *Setext* and *atx*.
61
+ Setext-style headers for `&lt;h1&gt;` and `&lt;h2&gt;` are created by
62
+ "underlining" with equal signs (`=`) and hyphens (`-`), respectively.
63
+ To create an atx-style header, you put 1-6 hash marks (`#`) at the
64
+ beginning of the line -- the number of hashes equals the resulting
65
+ HTML header level.
66
+
67
+ Blockquotes are indicated using email-style '`&gt;`' angle brackets.
68
+
69
+ Markdown:
70
+
71
+ A First Level Header
72
+ ====================
73
+
74
+ A Second Level Header
75
+ ---------------------
76
+
77
+ Now is the time for all good men to come to
78
+ the aid of their country. This is just a
79
+ regular paragraph.
80
+
81
+ The quick brown fox jumped over the lazy
82
+ dog's back.
83
+
84
+ ### Header 3
85
+
86
+ &gt; This is a blockquote.
87
+ &gt;
88
+ &gt; This is the second paragraph in the blockquote.
89
+ &gt;
90
+ &gt; ## This is an H2 in a blockquote
91
+
92
+
93
+ Output:
94
+
95
+ &lt;h1&gt;A First Level Header&lt;/h1&gt;
96
+
97
+ &lt;h2&gt;A Second Level Header&lt;/h2&gt;
98
+
99
+ &lt;p&gt;Now is the time for all good men to come to
100
+ the aid of their country. This is just a
101
+ regular paragraph.&lt;/p&gt;
102
+
103
+ &lt;p&gt;The quick brown fox jumped over the lazy
104
+ dog's back.&lt;/p&gt;
105
+
106
+ &lt;h3&gt;Header 3&lt;/h3&gt;
107
+
108
+ &lt;blockquote&gt;
109
+ &lt;p&gt;This is a blockquote.&lt;/p&gt;
110
+
111
+ &lt;p&gt;This is the second paragraph in the blockquote.&lt;/p&gt;
112
+
113
+ &lt;h2&gt;This is an H2 in a blockquote&lt;/h2&gt;
114
+ &lt;/blockquote&gt;
115
+
116
+
117
+
118
+ ### Phrase Emphasis ###
119
+
120
+ Markdown uses asterisks and underscores to indicate spans of emphasis.
121
+
122
+ Markdown:
123
+
124
+ Some of these words *are emphasized*.
125
+ Some of these words _are emphasized also_.
126
+
127
+ Use two asterisks for **strong emphasis**.
128
+ Or, if you prefer, __use two underscores instead__.
129
+
130
+ Output:
131
+
132
+ &lt;p&gt;Some of these words &lt;em&gt;are emphasized&lt;/em&gt;.
133
+ Some of these words &lt;em&gt;are emphasized also&lt;/em&gt;.&lt;/p&gt;
134
+
135
+ &lt;p&gt;Use two asterisks for &lt;strong&gt;strong emphasis&lt;/strong&gt;.
136
+ Or, if you prefer, &lt;strong&gt;use two underscores instead&lt;/strong&gt;.&lt;/p&gt;
137
+
138
+
139
+
140
+ ## Lists ##
141
+
142
+ Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`,
143
+ `+`, and `-`) as list markers. These three markers are
144
+ interchangable; this:
145
+
146
+ * Candy.
147
+ * Gum.
148
+ * Booze.
149
+
150
+ this:
151
+
152
+ + Candy.
153
+ + Gum.
154
+ + Booze.
155
+
156
+ and this:
157
+
158
+ - Candy.
159
+ - Gum.
160
+ - Booze.
161
+
162
+ all produce the same output:
163
+
164
+ &lt;ul&gt;
165
+ &lt;li&gt;Candy.&lt;/li&gt;
166
+ &lt;li&gt;Gum.&lt;/li&gt;
167
+ &lt;li&gt;Booze.&lt;/li&gt;
168
+ &lt;/ul&gt;
169
+
170
+ Ordered (numbered) lists use regular numbers, followed by periods, as
171
+ list markers:
172
+
173
+ 1. Red
174
+ 2. Green
175
+ 3. Blue
176
+
177
+ Output:
178
+
179
+ &lt;ol&gt;
180
+ &lt;li&gt;Red&lt;/li&gt;
181
+ &lt;li&gt;Green&lt;/li&gt;
182
+ &lt;li&gt;Blue&lt;/li&gt;
183
+ &lt;/ol&gt;
184
+
185
+ If you put blank lines between items, you'll get `&lt;p&gt;` tags for the
186
+ list item text. You can create multi-paragraph list items by indenting
187
+ the paragraphs by 4 spaces or 1 tab:
188
+
189
+ * A list item.
190
+
191
+ With multiple paragraphs.
192
+
193
+ * Another item in the list.
194
+
195
+ Output:
196
+
197
+ &lt;ul&gt;
198
+ &lt;li&gt;&lt;p&gt;A list item.&lt;/p&gt;
199
+ &lt;p&gt;With multiple paragraphs.&lt;/p&gt;&lt;/li&gt;
200
+ &lt;li&gt;&lt;p&gt;Another item in the list.&lt;/p&gt;&lt;/li&gt;
201
+ &lt;/ul&gt;
202
+
203
+
204
+
205
+ ### Links ###
206
+
207
+ Markdown supports two styles for creating links: *inline* and
208
+ *reference*. With both styles, you use square brackets to delimit the
209
+ text you want to turn into a link.
210
+
211
+ Inline-style links use parentheses immediately after the link text.
212
+ For example:
213
+
214
+ This is an [example link](http://example.com/).
215
+
216
+ Output:
217
+
218
+ &lt;p&gt;This is an &lt;a href="http://example.com/"&gt;
219
+ example link&lt;/a&gt;.&lt;/p&gt;
220
+
221
+ Optionally, you may include a title attribute in the parentheses:
222
+
223
+ This is an [example link](http://example.com/ "With a Title").
224
+
225
+ Output:
226
+
227
+ &lt;p&gt;This is an &lt;a href="http://example.com/" title="With a Title"&gt;
228
+ example link&lt;/a&gt;.&lt;/p&gt;
229
+
230
+ Reference-style links allow you to refer to your links by names, which
231
+ you define elsewhere in your document:
232
+
233
+ I get 10 times more traffic from [Google][1] than from
234
+ [Yahoo][2] or [MSN][3].
235
+
236
+ [1]: http://google.com/ "Google"
237
+ [2]: http://search.yahoo.com/ "Yahoo Search"
238
+ [3]: http://search.msn.com/ "MSN Search"
239
+
240
+ Output:
241
+
242
+ &lt;p&gt;I get 10 times more traffic from &lt;a href="http://google.com/"
243
+ title="Google"&gt;Google&lt;/a&gt; than from &lt;a href="http://search.yahoo.com/"
244
+ title="Yahoo Search"&gt;Yahoo&lt;/a&gt; or &lt;a href="http://search.msn.com/"
245
+ title="MSN Search"&gt;MSN&lt;/a&gt;.&lt;/p&gt;
246
+
247
+ The title attribute is optional. Link names may contain letters,
248
+ numbers and spaces, but are *not* case sensitive:
249
+
250
+ I start my morning with a cup of coffee and
251
+ [The New York Times][NY Times].
252
+
253
+ [ny times]: http://www.nytimes.com/
254
+
255
+ Output:
256
+
257
+ &lt;p&gt;I start my morning with a cup of coffee and
258
+ &lt;a href="http://www.nytimes.com/"&gt;The New York Times&lt;/a&gt;.&lt;/p&gt;
259
+
260
+
261
+ ### Images ###
262
+
263
+ Image syntax is very much like link syntax.
264
+
265
+ Inline (titles are optional):
266
+
267
+ ![alt text](/path/to/img.jpg "Title")
268
+
269
+ Reference-style:
270
+
271
+ ![alt text][id]
272
+
273
+ [id]: /path/to/img.jpg "Title"
274
+
275
+ Both of the above examples produce the same output:
276
+
277
+ &lt;img src="/path/to/img.jpg" alt="alt text" title="Title" /&gt;
278
+
279
+
280
+
281
+ ### Code ###
282
+
283
+ In a regular paragraph, you can create code span by wrapping text in
284
+ backtick quotes. Any ampersands (`&amp;`) and angle brackets (`&lt;` or
285
+ `&gt;`) will automatically be translated into HTML entities. This makes
286
+ it easy to use Markdown to write about HTML example code:
287
+
288
+ I strongly recommend against using any `&lt;blink&gt;` tags.
289
+
290
+ I wish SmartyPants used named entities like `&amp;mdash;`
291
+ instead of decimal-encoded entites like `&amp;#8212;`.
292
+
293
+ Output:
294
+
295
+ &lt;p&gt;I strongly recommend against using any
296
+ &lt;code&gt;&amp;lt;blink&amp;gt;&lt;/code&gt; tags.&lt;/p&gt;
297
+
298
+ &lt;p&gt;I wish SmartyPants used named entities like
299
+ &lt;code&gt;&amp;amp;mdash;&lt;/code&gt; instead of decimal-encoded
300
+ entites like &lt;code&gt;&amp;amp;#8212;&lt;/code&gt;.&lt;/p&gt;
301
+
302
+
303
+ To specify an entire block of pre-formatted code, indent every line of
304
+ the block by 4 spaces or 1 tab. Just like with code spans, `&amp;`, `&lt;`,
305
+ and `&gt;` characters will be escaped automatically.
306
+
307
+ Markdown:
308
+
309
+ If you want your page to validate under XHTML 1.0 Strict,
310
+ you've got to put paragraph tags in your blockquotes:
311
+
312
+ &lt;blockquote&gt;
313
+ &lt;p&gt;For example.&lt;/p&gt;
314
+ &lt;/blockquote&gt;
315
+
316
+ Output:
317
+
318
+ &lt;p&gt;If you want your page to validate under XHTML 1.0 Strict,
319
+ you've got to put paragraph tags in your blockquotes:&lt;/p&gt;
320
+
321
+ &lt;pre&gt;&lt;code&gt;&amp;lt;blockquote&amp;gt;
322
+ &amp;lt;p&amp;gt;For example.&amp;lt;/p&amp;gt;
323
+ &amp;lt;/blockquote&amp;gt;
324
+ &lt;/code&gt;&lt;/pre&gt;
325
+ </textarea></form>
326
+
327
+ <script>
328
+ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
329
+ mode: 'markdown',
330
+ lineNumbers: true,
331
+ matchBrackets: true,
332
+ theme: "default"
333
+ });
334
+ </script>
335
+
336
+ <p><strong>MIME types defined:</strong> <code>text/x-markdown</code>.</p>
337
+
338
+ </body>
339
+ </html>