-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathtodo.html
43 lines (37 loc) · 1.19 KB
/
todo.html
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
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>TODO List</title>
<script src="js/plugin.js"></script>
<script>
var headers = {
name: "BeautifyPlugin", version: "1.0", description: "Beautify editor code."
};
var provider = new orion.PluginProvider(headers);
provider.registerServiceProvider("orion.edit.outliner", {
getOutline: function(contents, title) {
var outline = [];
var lines = contents.split(/\r?\n/);
for (var i=0; i < lines.length; i++) {
var line = lines[i];
var match = /^=\s*(.+?)\s*=$/.exec(line);
if (match) {
outline.push({
label: match[1],
line: i+1 // lines are numbered from 1
});
}
}
return outline;
}
}, {
name: "Headings",
id: "orion.outliner.example.headings"
});
provider.connect();
</script>
</head>
<body>
<h1>TODO List</h1>
</body>
</html>