File tree Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Expand file tree Collapse file tree 3 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ module CodeRay
2
+ module Scanners
3
+
4
+ class Taskpaper < Scanner
5
+
6
+ register_for :taskpaper
7
+ file_extension 'taskpaper'
8
+
9
+ protected
10
+
11
+ def scan_tokens encoder , options
12
+ until eos?
13
+ if match = scan ( /^\S .*:.*$/ ) # project
14
+ encoder . text_token ( match , :project )
15
+ elsif match = scan ( /^-.+@done(?:\( .*)?.*$/ ) # completed task
16
+ encoder . text_token ( match , :complete )
17
+ elsif match = scan ( /^-.+$/ ) # task
18
+ encoder . text_token ( match , :plain )
19
+ elsif match = scan ( /^.+$/ ) # comment
20
+ encoder . text_token ( match , :comment )
21
+ elsif match = scan ( /\s +/ ) # space
22
+ encoder . text_token ( match , :space )
23
+ else # other
24
+ encoder . text_token getch , :error
25
+ end
26
+ end
27
+
28
+ encoder
29
+ end
30
+
31
+ end
32
+
33
+ end
34
+ end
Original file line number Diff line number Diff line change @@ -134,6 +134,9 @@ class Alpha < Style
134
134
.delete .delete { color: #c00; background:transparent; font-weight:bold }
135
135
.change .change { color: #88f }
136
136
.head .head { color: #f4f }
137
+
138
+ .project { color: #707; font-weight: bold }
139
+ .complete { text-decoration: line-through; color: gray }
137
140
TOKENS
138
141
139
142
end
Original file line number Diff line number Diff line change @@ -74,6 +74,9 @@ module CodeRay
74
74
:insert => 'insert' ,
75
75
76
76
:eyecatcher => 'eyecatcher' ,
77
+
78
+ :project => 'project' ,
79
+ :complete => 'complete' ,
77
80
78
81
:ident => false ,
79
82
:operator => false ,
You can’t perform that action at this time.
0 commit comments