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

Task attributes #1

Merged
merged 11 commits into from
Mar 21, 2024
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: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
continue-on-error: true
outputs:
pytestOutput: ${{ steps.unit-tests.outputs.test }}
mypyOutput: ${{ steps.type-checks.outputs.test }}
pyrightOutput: ${{ steps.type-checks.outputs.test }}
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
Expand Down Expand Up @@ -59,4 +59,4 @@ jobs:
- name: Type checking
id: type-checks
run: |
poetry run mypy --namespace-packages -p today
poetry run pyright
42 changes: 32 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ The task files are the only source of truth!
`today` is a read-only utility to display what's planned for today.
To mark a task complete, edit `tasks.md` and tick its Markdown checkbox.

## Detailed Docs
## Docs

### Task Files

Expand All @@ -62,26 +62,48 @@ Ideally each project should be tightly scoped and not drag on forever.
- You can save Markdown files on disk in any way you want. Add nested folders to encode hierarchy.
- You can group tasks within a task file any way you want. Add nested Markdown headings to encode hierarchy.

### Task Definitions
### Defining Tasks

Tasks are defined with a list item that starts with a Markdown checkbox.
Mark a task as completed by checking its checkbox.

A task can have a created, reminder, due, and finished date by placing it in square brackets with the prefix `c:`, `r:`, `d:`, or `f:`.
```markdown
- [x] A completed task
- [ ] An example task
```

#### Task Description

You can add a description for a task underneath the task title.
It can consist of any Markdown you want (*except headings*).

- The date is in `month`/`day`/`year` format
- `t` is a shorthand date for today. For example, if a task should be due today, use: `[d:t]`
#### Task Attributes

You can add a description for a task underneath the task title. It can consist of any Markdown you want (*except headings*).
Task attributes are written in the same line as the task title.

- Date attributes
- Created date: `[c:<date>]`
- Reminder date: `[r<date>]`
- Due date: `[d:<date>]`
- Finished date: `[f:<date>]`
- Date is in `month`/`day`/`year` format
- `t` is a shorthand date for today
- For example, if a task should be due today, write `[d:t]`
- Assignment attribute
- `[@<username>]` assigns a task to the given `username`
- Priority attribute
- `[!0]` sets the priority of a task to `0`. `0` is the highest priority, followed by `1`, `2`, ...
- Tasks without a priority attribute are printed separately from tasks marked with a priority

#### Subtasks

Subtasks are specified with a nested list of checkboxes under the main task.

- Subtasks cannot have their own descriptions, but they can have their own created/reminder/due dates.
- If the main task has a created/reminder/due date, it will apply for all subtasks automatically, unless otherwise specified
- Only one level of subtasks is supported

A task can be marked complete just by checking its checkbox. You can optionally specify a completion time with a finish `f` date.

Here is a complete example:
### Example

```markdown
- [x] Pay the electricity bill [d:t] [f:2/20/2023]
Expand All @@ -90,7 +112,7 @@ Here is a complete example:
- [ ] Wipe the countertops
- [ ] Throw the trash

Any text here will be part of the main task's description.
Any text here will be part of the main task's ("Home Cleaning") description.

- Some bullets
- A nested bullet
Expand Down
2 changes: 1 addition & 1 deletion example/chores.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Cleaning *italics*

- [ ] Clean the *countertops* [d:1/11/2022]
- [ ] ***Wash my car*** [d:1/10/2022]
- [ ] ***Wash my car*** [d:1/10/2022] [!0]
- [x] Sweep the floors [d:1/5/2022] [f:1/4/2022]
- [ ] `Another task` [d:t]

Expand Down
116 changes: 57 additions & 59 deletions poetry.lock

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

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ start = "today.scripts.start:main"
python = "^3.9"
rich = "^13.7"
pydantic = "^2.6.4"
more-itertools = "^10.2"

[tool.poetry.dev-dependencies]
pytest = "^7.1"
mypy = "^0.991"
pytest = "^8.1"
pyright = "^1.1"

[[tool.poetry.source]]
name = "PyPI"
Expand Down
Loading
Loading