File tree 3 files changed +40
-0
lines changed 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 @@ -140,6 +140,9 @@ class Alpha < Style
140
140
.delete .delete { color: #c00; background:transparent; font-weight:bold }
141
141
.change .change { color: #88f }
142
142
.head .head { color: #f4f }
143
+
144
+ .project { color: #707; font-weight: bold }
145
+ .complete { text-decoration: line-through; color: gray }
143
146
TOKENS
144
147
145
148
end
Original file line number Diff line number Diff line change @@ -75,6 +75,9 @@ module CodeRay
75
75
:insert => 'insert' ,
76
76
77
77
:eyecatcher => 'eyecatcher' ,
78
+
79
+ :project => 'project' ,
80
+ :complete => 'complete' ,
78
81
79
82
:ident => false ,
80
83
:operator => false ,
You can’t perform that action at this time.
0 commit comments