diff options
Diffstat (limited to 'imports/codemirror/mode/tiddlywiki')
-rwxr-xr-x | imports/codemirror/mode/tiddlywiki/index.html | 183 | ||||
-rwxr-xr-x | imports/codemirror/mode/tiddlywiki/tiddlywiki.css | 21 | ||||
-rwxr-xr-x | imports/codemirror/mode/tiddlywiki/tiddlywiki.js | 374 |
3 files changed, 578 insertions, 0 deletions
diff --git a/imports/codemirror/mode/tiddlywiki/index.html b/imports/codemirror/mode/tiddlywiki/index.html new file mode 100755 index 00000000..36d0975c --- /dev/null +++ b/imports/codemirror/mode/tiddlywiki/index.html | |||
@@ -0,0 +1,183 @@ | |||
1 | <!doctype html> | ||
2 | <html> | ||
3 | <head> | ||
4 | <title>CodeMirror: TiddlyWiki mode</title> | ||
5 | <link rel="stylesheet" href="../../lib/codemirror.css"> | ||
6 | <script src="../../lib/codemirror.js"></script> | ||
7 | <script src="tiddlywiki.js"></script> | ||
8 | <link rel="stylesheet" href="tiddlywiki.css"> | ||
9 | <link rel="stylesheet" href="../../doc/docs.css"> | ||
10 | <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> | ||
11 | </head> | ||
12 | <body> | ||
13 | <h1>CodeMirror: TiddlyWiki mode</h1> | ||
14 | |||
15 | <div><textarea id="code" name="code"> | ||
16 | !TiddlyWiki Formatting | ||
17 | * Rendered versions can be found at: http://www.tiddlywiki.com/#Reference | ||
18 | |||
19 | |!Option|!Syntax|!Output| | ||
20 | |bold font|{{{''bold''}}}|''bold''| | ||
21 | |italic type|{{{//italic//}}}|//italic//| | ||
22 | |underlined text|{{{__underlined__}}}|__underlined__| | ||
23 | |strikethrough text|{{{--strikethrough--}}}|--strikethrough--| | ||
24 | |superscript text|{{{^^super^^script}}}|^^super^^script| | ||
25 | |subscript text|{{{~~sub~~script}}}|~~sub~~script| | ||
26 | |highlighted text|{{{@@highlighted@@}}}|@@highlighted@@| | ||
27 | |preformatted text|<html><code>{{{preformatted}}}</code></html>|{{{preformatted}}}| | ||
28 | |||
29 | !Block Elements | ||
30 | !!Headings | ||
31 | {{{ | ||
32 | !Heading 1 | ||
33 | !!Heading 2 | ||
34 | !!!Heading 3 | ||
35 | !!!!Heading 4 | ||
36 | !!!!!Heading 5 | ||
37 | }}} | ||
38 | <<< | ||
39 | |||
40 | !Heading 1 | ||
41 | |||
42 | !!Heading 2 | ||
43 | |||
44 | !!!Heading 3 | ||
45 | |||
46 | !!!!Heading 4 | ||
47 | |||
48 | !!!!!Heading 5 | ||
49 | <<< | ||
50 | |||
51 | !!Lists | ||
52 | {{{ | ||
53 | * unordered list, level 1 | ||
54 | ** unordered list, level 2 | ||
55 | *** unordered list, level 3 | ||
56 | |||
57 | # ordered list, level 1 | ||
58 | ## ordered list, level 2 | ||
59 | ### unordered list, level 3 | ||
60 | |||
61 | ; definition list, term | ||
62 | : definition list, description | ||
63 | }}} | ||
64 | <<< | ||
65 | * unordered list, level 1 | ||
66 | ** unordered list, level 2 | ||
67 | *** unordered list, level 3 | ||
68 | |||
69 | # ordered list, level 1 | ||
70 | ## ordered list, level 2 | ||
71 | ### unordered list, level 3 | ||
72 | |||
73 | ; definition list, term | ||
74 | : definition list, description | ||
75 | <<< | ||
76 | |||
77 | !!Blockquotes | ||
78 | {{{ | ||
79 | > blockquote, level 1 | ||
80 | >> blockquote, level 2 | ||
81 | >>> blockquote, level 3 | ||
82 | |||
83 | <<< | ||
84 | blockquote | ||
85 | <<< | ||
86 | }}} | ||
87 | <<< | ||
88 | > blockquote, level 1 | ||
89 | >> blockquote, level 2 | ||
90 | >>> blockquote, level 3 | ||
91 | |||
92 | > blockquote | ||
93 | <<< | ||
94 | |||
95 | !!Preformatted Text | ||
96 | <html><pre> | ||
97 | {{{ | ||
98 | preformatted (e.g. code) | ||
99 | }}} | ||
100 | </pre></html> | ||
101 | <<< | ||
102 | {{{ | ||
103 | preformatted (e.g. code) | ||
104 | }}} | ||
105 | <<< | ||
106 | |||
107 | !!Code Sections | ||
108 | {{{ | ||
109 | Text style code | ||
110 | }}} | ||
111 | |||
112 | //{{{ | ||
113 | JS styled code. TiddlyWiki mixed mode should support highlighter switching in the future. | ||
114 | //}}} | ||
115 | |||
116 | <!--{{{--> | ||
117 | XML styled code. TiddlyWiki mixed mode should support highlighter switching in the future. | ||
118 | <!--}}}--> | ||
119 | |||
120 | !!Tables | ||
121 | {{{ | ||
122 | |CssClass|k | ||
123 | |!heading column 1|!heading column 2| | ||
124 | |row 1, column 1|row 1, column 2| | ||
125 | |row 2, column 1|row 2, column 2| | ||
126 | |>|COLSPAN| | ||
127 | |ROWSPAN| ... | | ||
128 | |~| ... | | ||
129 | |CssProperty:value;...| ... | | ||
130 | |caption|c | ||
131 | }}} | ||
132 | ''Annotation:'' | ||
133 | * The {{{>}}} marker creates a "colspan", causing the current cell to merge with the one to the right. | ||
134 | * The {{{~}}} marker creates a "rowspan", causing the current cell to merge with the one above. | ||
135 | <<< | ||
136 | |CssClass|k | ||
137 | |!heading column 1|!heading column 2| | ||
138 | |row 1, column 1|row 1, column 2| | ||
139 | |row 2, column 1|row 2, column 2| | ||
140 | |>|COLSPAN| | ||
141 | |ROWSPAN| ... | | ||
142 | |~| ... | | ||
143 | |CssProperty:value;...| ... | | ||
144 | |caption|c | ||
145 | <<< | ||
146 | !!Images /% TODO %/ | ||
147 | cf. [[TiddlyWiki.com|http://www.tiddlywiki.com/#EmbeddedImages]] | ||
148 | |||
149 | !Hyperlinks | ||
150 | * [[WikiWords|WikiWord]] are automatically transformed to hyperlinks to the respective tiddler | ||
151 | ** the automatic transformation can be suppressed by preceding the respective WikiWord with a tilde ({{{~}}}): {{{~WikiWord}}} | ||
152 | * [[PrettyLinks]] are enclosed in square brackets and contain the desired tiddler name: {{{[[tiddler name]]}}} | ||
153 | ** optionally, a custom title or description can be added, separated by a pipe character ({{{|}}}): {{{[[title|target]]}}}<br>'''N.B.:''' In this case, the target can also be any website (i.e. URL). | ||
154 | |||
155 | !Custom Styling | ||
156 | * {{{@@CssProperty:value;CssProperty:value;...@@}}}<br>''N.B.:'' CSS color definitions should use lowercase letters to prevent the inadvertent creation of WikiWords. | ||
157 | * <html><code>{{customCssClass{...}}}</code></html> | ||
158 | * raw HTML can be inserted by enclosing the respective code in HTML tags: {{{<html> ... </html>}}} | ||
159 | |||
160 | !Special Markers | ||
161 | * {{{<br>}}} forces a manual line break | ||
162 | * {{{----}}} creates a horizontal ruler | ||
163 | * [[HTML entities|http://www.tiddlywiki.com/#HtmlEntities]] | ||
164 | * [[HTML entities local|HtmlEntities]] | ||
165 | * {{{<<macroName>>}}} calls the respective [[macro|Macros]] | ||
166 | * To hide text within a tiddler so that it is not displayed, it can be wrapped in {{{/%}}} and {{{%/}}}.<br/>This can be a useful trick for hiding drafts or annotating complex markup. | ||
167 | * To prevent wiki markup from taking effect for a particular section, that section can be enclosed in three double quotes: e.g. {{{"""WikiWord"""}}}. | ||
168 | </textarea></div> | ||
169 | |||
170 | <script> | ||
171 | var editor = CodeMirror.fromTextArea(document.getElementById("code"), { | ||
172 | mode: 'tiddlywiki', | ||
173 | lineNumbers: true, | ||
174 | enterMode: 'keep', | ||
175 | matchBrackets: true | ||
176 | }); | ||
177 | </script> | ||
178 | |||
179 | <p>TiddlyWiki mode supports a single configuration.</p> | ||
180 | |||
181 | <p><strong>MIME types defined:</strong> <code>text/x-tiddlywiki</code>.</p> | ||
182 | </body> | ||
183 | </html> | ||
diff --git a/imports/codemirror/mode/tiddlywiki/tiddlywiki.css b/imports/codemirror/mode/tiddlywiki/tiddlywiki.css new file mode 100755 index 00000000..767f3de2 --- /dev/null +++ b/imports/codemirror/mode/tiddlywiki/tiddlywiki.css | |||
@@ -0,0 +1,21 @@ | |||
1 | .cm-s-default span.cm-header {color: blue; font-weight:bold;} | ||
2 | .cm-s-default span.cm-code {color: #a50;} | ||
3 | .cm-s-default span.cm-code-inline {color: #660;} | ||
4 | |||
5 | .cm-s-default span.cm-quote {color: #555;} | ||
6 | .cm-s-default span.cm-list {color: #c60;} | ||
7 | .cm-s-default span.cm-hr {color: #999;} | ||
8 | .cm-s-default span.cm-em {font-style: italic;} | ||
9 | .cm-s-default span.cm-strong {font-weight: bold;} | ||
10 | |||
11 | .cm-s-default span.cm-link-external {color: blue;} | ||
12 | .cm-s-default span.cm-brace {color: #170; font-weight: bold;} | ||
13 | .cm-s-default span.cm-macro {color: #9E3825;} | ||
14 | .cm-s-default span.cm-table {color: blue;} | ||
15 | .cm-s-default span.cm-warning {color: red; font-weight: bold;} | ||
16 | |||
17 | .cm-s-default span.cm-underlined {text-decoration: underline;} | ||
18 | .cm-s-default span.cm-line-through {text-decoration: line-through;} | ||
19 | |||
20 | .cm-s-default span.cm-comment {color: #666;} | ||
21 | |||
diff --git a/imports/codemirror/mode/tiddlywiki/tiddlywiki.js b/imports/codemirror/mode/tiddlywiki/tiddlywiki.js new file mode 100755 index 00000000..e07124c2 --- /dev/null +++ b/imports/codemirror/mode/tiddlywiki/tiddlywiki.js | |||
@@ -0,0 +1,374 @@ | |||
1 | /*** | ||
2 | |''Name''|tiddlywiki.js| | ||
3 | |''Description''|Enables TiddlyWikiy syntax highlighting using CodeMirror2| | ||
4 | |''Author''|PMario| | ||
5 | |''Version''|0.1.6| | ||
6 | |''Status''|''beta''| | ||
7 | |''Source''|[[GitHub|https://github.com/pmario/CodeMirror2/blob/tw-syntax/mode/tiddlywiki]]| | ||
8 | |''Documentation''|http://codemirror.tiddlyspace.com/| | ||
9 | |''License''|[[MIT License|http://www.opensource.org/licenses/mit-license.php]]| | ||
10 | |''CoreVersion''|2.5.0| | ||
11 | |''Requires''|codemirror.js| | ||
12 | |''Keywords''|syntax highlighting color code mirror codemirror| | ||
13 | ! Info | ||
14 | CoreVersion parameter is needed for TiddlyWiki only! | ||
15 | ***/ | ||
16 | //{{{ | ||
17 | CodeMirror.defineMode("tiddlywiki", function (config, parserConfig) { | ||
18 | var indentUnit = config.indentUnit; | ||