ledger_web 1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +10 -0
- data/LICENSE +7 -0
- data/README.md +140 -0
- data/Rakefile +11 -0
- data/bin/ledger_web +14 -0
- data/ledger_web.gemspec +26 -0
- data/lib/ledger_web/app.rb +69 -0
- data/lib/ledger_web/config.rb +87 -0
- data/lib/ledger_web/db/migrate/20111226180900_initial_schema.rb +38 -0
- data/lib/ledger_web/db/migrate/20111231132900_add_views.rb +37 -0
- data/lib/ledger_web/db.rb +54 -0
- data/lib/ledger_web/helpers.rb +62 -0
- data/lib/ledger_web/public/bootstrap-dropdown.js +55 -0
- data/lib/ledger_web/public/bootstrap.min.css +356 -0
- data/lib/ledger_web/public/codemirror/keymap/emacs.js +29 -0
- data/lib/ledger_web/public/codemirror/keymap/vim.js +76 -0
- data/lib/ledger_web/public/codemirror/lib/codemirror.css +104 -0
- data/lib/ledger_web/public/codemirror/lib/codemirror.js +2761 -0
- data/lib/ledger_web/public/codemirror/lib/util/dialog.css +23 -0
- data/lib/ledger_web/public/codemirror/lib/util/dialog.js +63 -0
- data/lib/ledger_web/public/codemirror/lib/util/foldcode.js +66 -0
- data/lib/ledger_web/public/codemirror/lib/util/formatting.js +291 -0
- data/lib/ledger_web/public/codemirror/lib/util/javascript-hint.js +83 -0
- data/lib/ledger_web/public/codemirror/lib/util/overlay.js +51 -0
- data/lib/ledger_web/public/codemirror/lib/util/runmode.js +27 -0
- data/lib/ledger_web/public/codemirror/lib/util/search.js +114 -0
- data/lib/ledger_web/public/codemirror/lib/util/searchcursor.js +117 -0
- data/lib/ledger_web/public/codemirror/lib/util/simple-hint.css +16 -0
- data/lib/ledger_web/public/codemirror/lib/util/simple-hint.js +66 -0
- data/lib/ledger_web/public/codemirror/mode/clike/clike.js +249 -0
- data/lib/ledger_web/public/codemirror/mode/clike/index.html +101 -0
- data/lib/ledger_web/public/codemirror/mode/clojure/clojure.js +207 -0
- data/lib/ledger_web/public/codemirror/mode/clojure/index.html +66 -0
- data/lib/ledger_web/public/codemirror/mode/coffeescript/LICENSE +22 -0
- data/lib/ledger_web/public/codemirror/mode/coffeescript/coffeescript.js +325 -0
- data/lib/ledger_web/public/codemirror/mode/coffeescript/index.html +721 -0
- data/lib/ledger_web/public/codemirror/mode/css/css.js +124 -0
- data/lib/ledger_web/public/codemirror/mode/css/index.html +55 -0
- data/lib/ledger_web/public/codemirror/mode/diff/diff.css +3 -0
- data/lib/ledger_web/public/codemirror/mode/diff/diff.js +13 -0
- data/lib/ledger_web/public/codemirror/mode/diff/index.html +99 -0
- data/lib/ledger_web/public/codemirror/mode/gfm/gfm.js +108 -0
- data/lib/ledger_web/public/codemirror/mode/gfm/index.html +47 -0
- data/lib/ledger_web/public/codemirror/mode/groovy/groovy.js +210 -0
- data/lib/ledger_web/public/codemirror/mode/groovy/index.html +71 -0
- data/lib/ledger_web/public/codemirror/mode/haskell/haskell.js +242 -0
- data/lib/ledger_web/public/codemirror/mode/haskell/index.html +60 -0
- data/lib/ledger_web/public/codemirror/mode/htmlembedded/htmlembedded.js +68 -0
- data/lib/ledger_web/public/codemirror/mode/htmlembedded/index.html +49 -0
- data/lib/ledger_web/public/codemirror/mode/htmlmixed/htmlmixed.js +83 -0
- data/lib/ledger_web/public/codemirror/mode/htmlmixed/index.html +51 -0
- data/lib/ledger_web/public/codemirror/mode/javascript/index.html +77 -0
- data/lib/ledger_web/public/codemirror/mode/javascript/javascript.js +360 -0
- data/lib/ledger_web/public/codemirror/mode/jinja2/index.html +37 -0
- data/lib/ledger_web/public/codemirror/mode/jinja2/jinja2.js +42 -0
- data/lib/ledger_web/public/codemirror/mode/lua/index.html +72 -0
- data/lib/ledger_web/public/codemirror/mode/lua/lua.js +140 -0
- data/lib/ledger_web/public/codemirror/mode/markdown/index.html +339 -0
- data/lib/ledger_web/public/codemirror/mode/markdown/markdown.js +242 -0
- data/lib/ledger_web/public/codemirror/mode/ntriples/index.html +32 -0
- data/lib/ledger_web/public/codemirror/mode/ntriples/ntriples.js +172 -0
- data/lib/ledger_web/public/codemirror/mode/pascal/LICENSE +7 -0
- data/lib/ledger_web/public/codemirror/mode/pascal/index.html +48 -0
- data/lib/ledger_web/public/codemirror/mode/pascal/pascal.js +138 -0
- data/lib/ledger_web/public/codemirror/mode/perl/LICENSE +19 -0
- data/lib/ledger_web/public/codemirror/mode/perl/index.html +62 -0
- data/lib/ledger_web/public/codemirror/mode/perl/perl.js +816 -0
- data/lib/ledger_web/public/codemirror/mode/php/index.html +48 -0
- data/lib/ledger_web/public/codemirror/mode/php/php.js +120 -0
- data/lib/ledger_web/public/codemirror/mode/plsql/index.html +62 -0
- data/lib/ledger_web/public/codemirror/mode/plsql/plsql.js +217 -0
- data/lib/ledger_web/public/codemirror/mode/python/LICENSE.txt +21 -0
- data/lib/ledger_web/public/codemirror/mode/python/index.html +122 -0
- data/lib/ledger_web/public/codemirror/mode/python/python.js +333 -0
- data/lib/ledger_web/public/codemirror/mode/r/LICENSE +24 -0
- data/lib/ledger_web/public/codemirror/mode/r/index.html +73 -0
- data/lib/ledger_web/public/codemirror/mode/r/r.js +141 -0
- data/lib/ledger_web/public/codemirror/mode/rpm/changes/changes.js +19 -0
- data/lib/ledger_web/public/codemirror/mode/rpm/changes/index.html +53 -0
- data/lib/ledger_web/public/codemirror/mode/rpm/spec/index.html +99 -0
- data/lib/ledger_web/public/codemirror/mode/rpm/spec/spec.css +5 -0
- data/lib/ledger_web/public/codemirror/mode/rpm/spec/spec.js +66 -0
- data/lib/ledger_web/public/codemirror/mode/rst/index.html +525 -0
- data/lib/ledger_web/public/codemirror/mode/rst/rst.js +326 -0
- data/lib/ledger_web/public/codemirror/mode/ruby/LICENSE +24 -0
- data/lib/ledger_web/public/codemirror/mode/ruby/index.html +171 -0
- data/lib/ledger_web/public/codemirror/mode/ruby/ruby.js +195 -0
- data/lib/ledger_web/public/codemirror/mode/rust/index.html +48 -0
- data/lib/ledger_web/public/codemirror/mode/rust/rust.js +411 -0
- data/lib/ledger_web/public/codemirror/mode/scheme/index.html +64 -0
- data/lib/ledger_web/public/codemirror/mode/scheme/scheme.js +202 -0
- data/lib/ledger_web/public/codemirror/mode/smalltalk/index.html +55 -0
- data/lib/ledger_web/public/codemirror/mode/smalltalk/smalltalk.js +139 -0
- data/lib/ledger_web/public/codemirror/mode/sparql/index.html +40 -0
- data/lib/ledger_web/public/codemirror/mode/sparql/sparql.js +143 -0
- data/lib/ledger_web/public/codemirror/mode/stex/index.html +95 -0
- data/lib/ledger_web/public/codemirror/mode/stex/stex.js +167 -0
- data/lib/ledger_web/public/codemirror/mode/tiddlywiki/index.html +183 -0
- data/lib/ledger_web/public/codemirror/mode/tiddlywiki/tiddlywiki.css +21 -0
- data/lib/ledger_web/public/codemirror/mode/tiddlywiki/tiddlywiki.js +374 -0
- data/lib/ledger_web/public/codemirror/mode/velocity/index.html +103 -0
- data/lib/ledger_web/public/codemirror/mode/velocity/velocity.js +146 -0
- data/lib/ledger_web/public/codemirror/mode/xml/index.html +44 -0
- data/lib/ledger_web/public/codemirror/mode/xml/xml.js +252 -0
- data/lib/ledger_web/public/codemirror/mode/xmlpure/index.html +59 -0
- data/lib/ledger_web/public/codemirror/mode/xmlpure/xmlpure.js +485 -0
- data/lib/ledger_web/public/codemirror/mode/yaml/index.html +67 -0
- data/lib/ledger_web/public/codemirror/mode/yaml/yaml.js +95 -0
- data/lib/ledger_web/public/codemirror/theme/cobalt.css +18 -0
- data/lib/ledger_web/public/codemirror/theme/eclipse.css +25 -0
- data/lib/ledger_web/public/codemirror/theme/elegant.css +10 -0
- data/lib/ledger_web/public/codemirror/theme/monokai.css +28 -0
- data/lib/ledger_web/public/codemirror/theme/neat.css +9 -0
- data/lib/ledger_web/public/codemirror/theme/night.css +21 -0
- data/lib/ledger_web/public/codemirror/theme/rubyblue.css +21 -0
- data/lib/ledger_web/public/jquery-1.7.1.min.js +4 -0
- data/lib/ledger_web/public/jquery.tablesorter.min.js +4 -0
- data/lib/ledger_web/public/ledger.css +14 -0
- data/lib/ledger_web/report.rb +187 -0
- data/lib/ledger_web/reports/savings_rate.erb +49 -0
- data/lib/ledger_web/version.rb +3 -0
- data/lib/ledger_web/views/error.erb +5 -0
- data/lib/ledger_web/views/help.erb +6 -0
- data/lib/ledger_web/views/layout.erb +44 -0
- data/lib/ledger_web/views/table.erb +31 -0
- data/lib/ledger_web/watcher.rb +37 -0
- data/lib/ledger_web.rb +20 -0
- 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
|
+
<ul id="ProjectSubmenu">
|
22
|
+
<li><a href="/projects/markdown/" title="Markdown Project Page">Main</a></li>
|
23
|
+
<li><a class="selected" title="Markdown Basics">Basics</a></li>
|
24
|
+
<li><a href="/projects/markdown/syntax" title="Markdown Syntax Documentation">Syntax</a></li>
|
25
|
+
<li><a href="/projects/markdown/license" title="Pricing and License Information">License</a></li>
|
26
|
+
<li><a href="/projects/markdown/dingus" title="Online Markdown Web Form">Dingus</a></li>
|
27
|
+
</ul>
|
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 `<h1>` and `<h2>` 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 '`>`' 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
|
+
> This is a blockquote.
|
87
|
+
>
|
88
|
+
> This is the second paragraph in the blockquote.
|
89
|
+
>
|
90
|
+
> ## This is an H2 in a blockquote
|
91
|
+
|
92
|
+
|
93
|
+
Output:
|
94
|
+
|
95
|
+
<h1>A First Level Header</h1>
|
96
|
+
|
97
|
+
<h2>A Second Level Header</h2>
|
98
|
+
|
99
|
+
<p>Now is the time for all good men to come to
|
100
|
+
the aid of their country. This is just a
|
101
|
+
regular paragraph.</p>
|
102
|
+
|
103
|
+
<p>The quick brown fox jumped over the lazy
|
104
|
+
dog's back.</p>
|
105
|
+
|
106
|
+
<h3>Header 3</h3>
|
107
|
+
|
108
|
+
<blockquote>
|
109
|
+
<p>This is a blockquote.</p>
|
110
|
+
|
111
|
+
<p>This is the second paragraph in the blockquote.</p>
|
112
|
+
|
113
|
+
<h2>This is an H2 in a blockquote</h2>
|
114
|
+
</blockquote>
|
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
|
+
<p>Some of these words <em>are emphasized</em>.
|
133
|
+
Some of these words <em>are emphasized also</em>.</p>
|
134
|
+
|
135
|
+
<p>Use two asterisks for <strong>strong emphasis</strong>.
|
136
|
+
Or, if you prefer, <strong>use two underscores instead</strong>.</p>
|
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
|
+
<ul>
|
165
|
+
<li>Candy.</li>
|
166
|
+
<li>Gum.</li>
|
167
|
+
<li>Booze.</li>
|
168
|
+
</ul>
|
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
|
+
<ol>
|
180
|
+
<li>Red</li>
|
181
|
+
<li>Green</li>
|
182
|
+
<li>Blue</li>
|
183
|
+
</ol>
|
184
|
+
|
185
|
+
If you put blank lines between items, you'll get `<p>` 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
|
+
<ul>
|
198
|
+
<li><p>A list item.</p>
|
199
|
+
<p>With multiple paragraphs.</p></li>
|
200
|
+
<li><p>Another item in the list.</p></li>
|
201
|
+
</ul>
|
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
|
+
<p>This is an <a href="http://example.com/">
|
219
|
+
example link</a>.</p>
|
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
|
+
<p>This is an <a href="http://example.com/" title="With a Title">
|
228
|
+
example link</a>.</p>
|
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
|
+
<p>I get 10 times more traffic from <a href="http://google.com/"
|
243
|
+
title="Google">Google</a> than from <a href="http://search.yahoo.com/"
|
244
|
+
title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/"
|
245
|
+
title="MSN Search">MSN</a>.</p>
|
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
|
+
<p>I start my morning with a cup of coffee and
|
258
|
+
<a href="http://www.nytimes.com/">The New York Times</a>.</p>
|
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
|
+
<img src="/path/to/img.jpg" alt="alt text" title="Title" />
|
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 (`&`) and angle brackets (`<` or
|
285
|
+
`>`) 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 `<blink>` tags.
|
289
|
+
|
290
|
+
I wish SmartyPants used named entities like `&mdash;`
|
291
|
+
instead of decimal-encoded entites like `&#8212;`.
|
292
|
+
|
293
|
+
Output:
|
294
|
+
|
295
|
+
<p>I strongly recommend against using any
|
296
|
+
<code>&lt;blink&gt;</code> tags.</p>
|
297
|
+
|
298
|
+
<p>I wish SmartyPants used named entities like
|
299
|
+
<code>&amp;mdash;</code> instead of decimal-encoded
|
300
|
+
entites like <code>&amp;#8212;</code>.</p>
|
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, `&`, `<`,
|
305
|
+
and `>` 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
|
+
<blockquote>
|
313
|
+
<p>For example.</p>
|
314
|
+
</blockquote>
|
315
|
+
|
316
|
+
Output:
|
317
|
+
|
318
|
+
<p>If you want your page to validate under XHTML 1.0 Strict,
|
319
|
+
you've got to put paragraph tags in your blockquotes:</p>
|
320
|
+
|
321
|
+
<pre><code>&lt;blockquote&gt;
|
322
|
+
&lt;p&gt;For example.&lt;/p&gt;
|
323
|
+
&lt;/blockquote&gt;
|
324
|
+
</code></pre>
|
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>
|