summaryrefslogtreecommitdiff
path: root/enhancers.txt
blob: 22c684b032e7ba51964075007f64b6ad98180553 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
--boundary
X-Thing: Pattern

text/markdown
--boundary
X-Thing: Head

<link rel="stylesheet" href="/static/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="/static/simplemde/dist/simplemde.min.css">
<script src="/static/simplemde/dist/simplemde.min.js"></script>
--boundary
X-Thing: Tail

<script>
(function() {
	var textarea = document.getElementsByTagName('textarea')[0];
	var form = textarea.form;
	var container = document.createElement('div');
	form.insertBefore(container, textarea);
	container.appendChild(textarea);

	var tip = document.createElement('aside');
	tip.innerHTML =
		'<p>Tip: To set the page title (what appears in the tab '+
		'name/window bar), put this at the top of the page:</p>\n'+
		'<pre>---\ntitle: "Your Title Here"\n---\n</pre>'+
		'<p>I apologize that it looks funny on this page and in the '+
		'preview.</p>';
	container.appendChild(tip);

	var simplemde = new SimpleMDE({
		autoDownloadFontAwesome: false,
		element: textarea,
		promptURLs: true,
		forceSync: true,
		showIcons: ['code', 'table'],
	});
})();
</script>
--boundary
X-Thing: Pattern

text/*; */*+xml
--boundary
X-Thing: Head

<link rel="stylesheet" href="/static/codemirror/lib/codemirror.css">
<script src="/static/codemirror/lib/codemirror.js"></script>


<script src="/static/codemirror/mode/xml/xml.js"></script>
<script src="/static/codemirror/mode/javascript/javascript.js"></script>
<script src="/static/codemirror/mode/css/css.js"></script>
<script src="/static/codemirror/mode/sass/sass.js"></script>
<script src="/static/codemirror/mode/htmlmixed/htmlmixed.js"></script>
<script src="/static/codemirror/addon/edit/matchbrackets.js"></script>
<script src="/static/codemirror/addon/edit/trailingspace.js"></script>
<script src="/static/codemirror/addon/display/rulers.js"></script>

<script src="/static/codemirror/addon/fold/foldcode.js"></script>
<script src="/static/codemirror/addon/fold/foldgutter.js"></script>
<link rel="stylesheet" href="/static/codemirror/addon/fold/foldgutter.css">
<script src="/static/codemirror/addon/fold/brace-fold.js"></script>
<script src="/static/codemirror/addon/fold/xml-fold.js"></script>
<script src="/static/codemirror/addon/fold/markdown-fold.js"></script>
<script src="/static/codemirror/addon/fold/comment-fold.js"></script>
--boundary
X-Thing: Tail

<script>
(function() {
	var textarea = document.getElementsByTagName('textarea')[0];
	var form = textarea.form;
	var container = document.createElement('div');
	form.insertBefore(container, textarea);
	container.appendChild(textarea);
	var cm = CodeMirror.fromTextArea(textarea, {
		mode: ctype,
		lineNumbers: true,
		matchBrackets: true,
		foldGutter: true,
		rulers: [{column: 80, lineStyle: "dashed"}],
		showTrailingSpace: true,
		gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
	});
	cm.on("change", function() {
		cm.save();
	});
})();
</script>
--boundary--