Files
news.gitea.happylizard.me/bin/gems/coderay-1.1.3/lib/coderay/scanners/taskpaper.rb
T
pizza2d1 4cee170d66
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 9s
Add bin and edit workflow
2026-09-16 13:11:16 -06:00

37 lines
1.0 KiB
Ruby

module CodeRay
module Scanners
class Taskpaper < Scanner
register_for :taskpaper
file_extension 'taskpaper'
protected
def scan_tokens encoder, options
until eos?
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(/@due.*/) # comment
encoder.text_token(match, :important)
elsif match = scan(/.+/) # comment
encoder.text_token(match, :comment)
elsif match = scan(/\s+/) # space
encoder.text_token(match, :space)
else # other
encoder.text_token getch, :error
end
end
encoder
end
end
end
end