Skip to content

Commit

Permalink
change: ignore tasks inside code blocks; update badges better
Browse files Browse the repository at this point in the history
  • Loading branch information
saibotsivad committed Dec 19, 2023
1 parent e0b36d2 commit 4e70257
Show file tree
Hide file tree
Showing 23 changed files with 409 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = true

[*.{yml,yaml,toml}]
[*.{yml,yaml,toml,json}]
indent_style = space
indent_size = 2
Empty file added .gitignore
Empty file.
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/jsLibraryMappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/markdown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/obsidian-gtd-no-next-step.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ This plugin currently only has the following configurable options:

#### Projects folder

The folder where project files live. Default: `Projects/`
The folder where project files live.

Default: `Projects/`

This plugin also works for all sub-folders as well, e.g.:

Expand All @@ -37,11 +39,15 @@ Projects/

#### Next-Step tag

The tag that indicates a task has a next step. Default: `#next-step`
The tag that indicates a task has a next step.

Default: `#next-step`

#### Waiting-For tag

The tag that indicates a task is waiting for an external action. Default: `#waiting-for`
The tag that indicates a task is waiting for an external action.

Default: `#waiting-for`

## My GTD Workflow

Expand Down
1 change: 1 addition & 0 deletions example-vault/.obsidian/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions example-vault/.obsidian/appearance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"accentColor": ""
}
3 changes: 3 additions & 0 deletions example-vault/.obsidian/community-plugins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"gtd-no-next-step"
]
30 changes: 30 additions & 0 deletions example-vault/.obsidian/core-plugins-migration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"file-explorer": true,
"global-search": false,
"switcher": true,
"graph": false,
"backlink": false,
"canvas": false,
"outgoing-link": false,
"tag-pane": false,
"properties": false,
"page-preview": false,
"daily-notes": false,
"templates": true,
"note-composer": false,
"command-palette": true,
"slash-command": false,
"editor-status": true,
"bookmarks": false,
"markdown-importer": false,
"zk-prefixer": false,
"random-note": false,
"outline": false,
"word-count": false,
"slides": false,
"audio-recorder": false,
"workspaces": false,
"file-recovery": false,
"publish": false,
"sync": false
}
7 changes: 7 additions & 0 deletions example-vault/.obsidian/core-plugins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
"file-explorer",
"switcher",
"templates",
"command-palette",
"editor-status"
]
1 change: 1 addition & 0 deletions example-vault/.obsidian/hotkeys.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions example-vault/.obsidian/templates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"folder": "Templates"
}
86 changes: 86 additions & 0 deletions example-vault/.obsidian/workspace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"main": {
"id": "487bd2982b5b1dce",
"type": "split",
"children": [
{
"id": "bfa372977a8b84fb",
"type": "tabs",
"children": [
{
"id": "cfac32c7e03ebb33",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Projects/Example.md",
"mode": "source",
"backlinks": false,
"source": false
}
}
}
]
}
],
"direction": "vertical"
},
"left": {
"id": "ac6138c908bf2ef0",
"type": "split",
"children": [
{
"id": "902746e70cb575cc",
"type": "tabs",
"children": [
{
"id": "aeeedd5116b7ef5a",
"type": "leaf",
"state": {
"type": "file-explorer",
"state": {
"sortOrder": "alphabetical"
}
}
},
{
"id": "22f163d7d3e086f0",
"type": "leaf",
"state": {
"type": "search",
"state": {
"query": "tag:#waiting-for"
}
}
}
]
}
],
"direction": "horizontal",
"width": 300
},
"right": {
"id": "ab6ae738fa12851d",
"type": "split",
"children": [],
"direction": "horizontal",
"width": 300,
"collapsed": true
},
"left-ribbon": {
"hiddenItems": {
"switcher:Open quick switcher": false,
"templates:Insert template": false,
"command-palette:Open command palette": false
}
},
"active": "cfac32c7e03ebb33",
"lastOpenFiles": [
"Hello World.md",
"Templates/Plugin Test.md",
"Projects/Example.md",
"test-2023-12-16.md",
"Projects",
"Templates"
]
}
18 changes: 18 additions & 0 deletions example-vault/Hello World.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

This vault is primarily used to test this plugin.

To test it, create a new note from [[Plugin Test]], test each scenario and mark as done and add notes as needed.

To install the local version of the plugin, you'll need to copy these files:
- `main.js`
- `manifest.json`
- `styles.css`
Into the folder:
- `.obsidian/plugins/gtd-no-next-step`
Tags used: #next-step #waiting-for

Or, from the root of this repo, simply do:
```
npm run setup
```
Then from Obsidian go turn on community plugins, then "View > Force Reload", then got turn this plugin on.
1 change: 1 addition & 0 deletions example-vault/Projects/Example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [ ] this is a task
98 changes: 98 additions & 0 deletions example-vault/Templates/Plugin Test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@

In lieu of automated tests, here are the things to test when making changes.

Configuration:
- Folder: `Projects/`
- Next: `#next-step`
- Waiting: `#waiting-for`

#### 1. File with no tasks
Template:
```
file with no tasks
```
Action
- None
Expected outcome:
- [ ] The red badge "No Next" is shown

#### 2. File with tasks but no next/waiting
Template:
```
- [ ] this is a task
```
Action
- None
Expected outcome:
- [ ] The red badge "No Next" is shown

#### 3. File with only a waiting task
Template:
```
- [ ] this is a task #waiting-for
```
Action
- None
Expected outcome:
- [ ] The gray badge "Waiting" is shown

#### 4. Marking task as done, no tasks left
Template:
```
- [ ] this is a task #next-step
```
Action
- Mark the task as done by checking box
Expected outcome:
- [ ] No next step so the red "No Next" badge is shown

#### 5. No next, marking task as waiting
Template:
```
- [ ] this is a task
```
Action
- Add the tag `#waiting-for` to the task
Expected outcome:
- [ ] The gray "Waiting" badge appears

#### 6. Waiting task, marking as done
Template:
```
- [ ] this is a task #waiting-for
```
Action
- Mark the task as done by checking box
Expected outcome:
- [ ] The red "No Next" badge appears

#### 7. Waiting task, removing tag
Template:
```
- [ ] this is a task #waiting-for
```
Action
- Clear the tag from the task
Expected outcome:
- [ ] The red "No Next" badge appears

#### 8. Moving a project file out
Template:
```
- [ ] this is a task
```
Action
- Move out of the `Projects/` folder
Expected outcome:
- [ ] The red "No Next" badge is removed

#### 9. Moving a file into projects
Create a file outside the `Projects/` folder.
Template:
```
- [ ] this is a task
```
Action
- Move into the `Projects/` folder
Expected outcome:
- [ ] The red "No Next" badge is added
Loading

0 comments on commit 4e70257

Please sign in to comment.