diff options
-rw-r--r-- | lib/coderay/encoders/terminal.rb | 2 | ||||
-rw-r--r-- | lib/coderay/scanners/taskpaper.rb | 18 | ||||
-rw-r--r-- | lib/coderay/styles/alpha.rb | 3 | ||||
-rwxr-xr-x | lib/coderay/token_kinds.rb | 8 |
4 files changed, 14 insertions, 17 deletions
diff --git a/lib/coderay/encoders/terminal.rb b/lib/coderay/encoders/terminal.rb index 500e5d8..9894b91 100644 --- a/lib/coderay/encoders/terminal.rb +++ b/lib/coderay/encoders/terminal.rb @@ -37,7 +37,7 @@ module CodeRay :directive => "\e[32m\e[4m", :doc => "\e[46m", :doctype => "\e[1;30m", - :doc_string => "\e[31m\e[4m", + :docstring => "\e[31m\e[4m", :entity => "\e[33m", :error => "\e[1;33m\e[41m", :exception => "\e[1;31m", diff --git a/lib/coderay/scanners/taskpaper.rb b/lib/coderay/scanners/taskpaper.rb index c6eb3b3..42670bc 100644 --- a/lib/coderay/scanners/taskpaper.rb +++ b/lib/coderay/scanners/taskpaper.rb @@ -10,17 +10,19 @@ module Scanners def scan_tokens encoder, options until eos? - if match = scan(/^\S.*:.*$/) # project - encoder.text_token(match, :project) - elsif match = scan(/^-.+@done(?:\(.*)?.*$/) # completed task - encoder.text_token(match, :complete) - elsif match = scan(/^-.+$/) # task + if match = scan(/\S.*:.*$/) # project + encoder.text_token(match, :namespace) + elsif match = scan(/-.+@done.*/) # completed task + encoder.text_token(match, :done) + elsif match = scan(/-(?:[^@\n]+|@(?!due))*/) # task encoder.text_token(match, :plain) - elsif match = scan(/^.+$/) # comment + elsif match = scan(/@due.*/) # comment + encoder.text_token(match, :important) + elsif match = scan(/.+/) # comment encoder.text_token(match, :comment) - elsif match = scan(/\s+/) # space + elsif match = scan(/\s+/) # space encoder.text_token(match, :space) - else # other + else # other encoder.text_token getch, :error end end diff --git a/lib/coderay/styles/alpha.rb b/lib/coderay/styles/alpha.rb index 6829686..f57e4a1 100644 --- a/lib/coderay/styles/alpha.rb +++ b/lib/coderay/styles/alpha.rb @@ -141,8 +141,7 @@ table.CodeRay td { padding: 2px 4px; vertical-align: top; } .change .change { color: #88f } .head .head { color: #f4f } -.project { color: #707; font-weight: bold } -.complete { text-decoration: line-through; color: gray } +.done { text-decoration: line-through; color: gray } TOKENS end diff --git a/lib/coderay/token_kinds.rb b/lib/coderay/token_kinds.rb index f7f19bb..de3a0d0 100755 --- a/lib/coderay/token_kinds.rb +++ b/lib/coderay/token_kinds.rb @@ -29,7 +29,8 @@ module CodeRay :directive => 'directive', :doc => 'doc', :doctype => 'doctype', - :doc_string => 'doc-string', + :docstring => 'doc-string', + :done => 'done', :entity => 'entity', :error => 'error', :escape => 'escape', @@ -75,9 +76,6 @@ module CodeRay :insert => 'insert', :eyecatcher => 'eyecatcher', - - :project => 'project', - :complete => 'complete', :ident => false, :operator => false, @@ -87,6 +85,4 @@ module CodeRay ) TokenKinds[:method] = TokenKinds[:function] - TokenKinds[:escape] = TokenKinds[:delimiter] - TokenKinds[:docstring] = TokenKinds[:comment] end |