Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Todo.txt syntax #2375

Merged
merged 5 commits into from
Oct 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@
url = https://github.com/victor-gp/cmd-help-sublime-syntax.git
branch = main
shallow = true
[submodule "assets/syntaxes/02_Extra/TodoTxt"]
path = assets/syntaxes/02_Extra/TodoTxt
url = https://github.com/dertuxmalwieder/SublimeTodoTxt
[submodule "assets/syntaxes/02_Extra/Ada"]
path = assets/syntaxes/02_Extra/Ada
url = https://github.com/wiremoons/ada-sublime-syntax

13 changes: 13 additions & 0 deletions assets/patches/TodoTxt.sublime-syntax.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git syntaxes/02_Extra/TodoTxt/TodoTxt.sublime-syntax syntaxes/02_Extra/TodoTxt/TodoTxt.sublime-syntax
index 6c75dbb..0115978 100644
--- syntaxes/02_Extra/TodoTxt/TodoTxt.sublime-syntax
+++ syntaxes/02_Extra/TodoTxt/TodoTxt.sublime-syntax
@@ -68,7 +68,7 @@ contexts:

- match: (\s+[^\s:]+:[^\s:]+)+\s*$
comment: Custom attributes
- scope: variable.annotation.todotxt.attribute
+ scope: variable.other.todotxt.attribute

comments:
# Comments begin with a '//' and finish at the end of the line.
1 change: 1 addition & 0 deletions assets/syntaxes/02_Extra/TodoTxt
Submodule TodoTxt added at f5f0a6
65 changes: 65 additions & 0 deletions tests/syntax-tests/highlighted/Todo.txt/todo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
Rule 1.1: Priority

/// Should have priority ///
(A) Thank Mom for the meatballs @phone
(B) Schedule Goodwill pickup +GarageSale @phone

/// Should not have priority ///
Really gotta call Mom (A) @phone @someday
(b) Get back to the boss
(B)->Submit TPS report


Rule 1.2: Creation date

/// Date should be after priority ///
2011-03-02 Document +TodoTxt task format
(A) 2011-03-02 Call Mom

/// Should not have creation date ///
(A) Call Mom 2011-03-02


Rule 1.3: Context and Projects 

/// Contexts and projects can appear anywhere ///
(A) Call Mom +Family +PeaceLoveAndHappiness @iphone @phone to celebrate!

/// No context ///
Email SoAndSo at soandso@example.com

/// No project ///
Learn how to add 2+2


Rule 2.1: Completed task

/// Complete task ///
x 2011-03-03 Call Mom
x With @contexts +projects and key:value

/// Not completed tasks ///
xylophone lesson
X 2012-01-01 Make resolutions
(A) x Find ticket prices


Rule 2.2: Completion date

/// Only completion date is valuable ///
x Completion date is optional
x 2022-10-21 But you can specify it
x 2011-03-02 2011-03-01 


Additional definition

/// Properties ///
Decide on present for Mom due:2022-01-01 pri:1



Unspecified

/// Delayed tasks with WAIT keyword ///
WAIT for @Patric to finish his task with +program
65 changes: 65 additions & 0 deletions tests/syntax-tests/source/Todo.txt/todo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
Rule 1.1: Priority

/// Should have priority ///
(A) Thank Mom for the meatballs @phone
(B) Schedule Goodwill pickup +GarageSale @phone

/// Should not have priority ///
Really gotta call Mom (A) @phone @someday
(b) Get back to the boss
(B)->Submit TPS report


Rule 1.2: Creation date

/// Date should be after priority ///
2011-03-02 Document +TodoTxt task format
(A) 2011-03-02 Call Mom

/// Should not have creation date ///
(A) Call Mom 2011-03-02


Rule 1.3: Context and Projects

/// Contexts and projects can appear anywhere ///
(A) Call Mom +Family +PeaceLoveAndHappiness @iphone @phone to celebrate!

/// No context ///
Email SoAndSo at soandso@example.com

/// No project ///
Learn how to add 2+2


Rule 2.1: Completed task

/// Complete task ///
x 2011-03-03 Call Mom
x With @contexts +projects and key:value

/// Not completed tasks ///
xylophone lesson
X 2012-01-01 Make resolutions
(A) x Find ticket prices


Rule 2.2: Completion date

/// Only completion date is valuable ///
x Completion date is optional
x 2022-10-21 But you can specify it
x 2011-03-02 2011-03-01


Additional definition

/// Properties ///
Decide on present for Mom due:2022-01-01 pri:1



Unspecified

/// Delayed tasks with WAIT keyword ///
WAIT for @Patric to finish his task with +program