Skip to content
Merged
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,24 @@ That's it! md2do will scan all `.md` files and extract your TODO items.
md2do recognizes standard markdown task syntax with rich metadata:

```markdown
- [ ] Implement user authentication @jane !!! #backend #auth [due: 2026-01-20]
- [x] Write documentation @nick !! #docs [completed: 2026-01-15]
- [ ] Fix bug in parser @alex ! #bug [due: 2026-01-18]
- [ ] Implement user authentication @jane !!! #backend #auth #due:2026-01-20
- [x] Write documentation @nick !! #docs {completed:2026-01-15}
- [ ] Fix bug in parser @alex ! #bug #due:2026-01-18
```

**Supported metadata:**

- `@username` - Task assignee
- `!!!` / `!!` / `!` - Priority (urgent/high/normal)
- `#tag` - Tags
- `[due: YYYY-MM-DD]` - Due date (also supports `[due: tomorrow]`, `[due: 1/25/26]`, etc.)
- `[completed: YYYY-MM-DD]` - Completion date
- `#due:YYYY-MM-DD` - Due date
- `{completed:YYYY-MM-DD}` - Completion date
- `{todoist:ID}` - Todoist sync ID
- `- [x]` - Completed task
- `- [ ]` - Incomplete task

> **Note:** Legacy bracket syntax (`[due: ...]`, `[completed: ...]`, `[todoist: ...]`) is still parsed for backward compatibility.

### List Command

Display tasks with filtering and sorting:
Expand Down Expand Up @@ -495,7 +498,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
- [ ] CLI commands (`md2do todoist sync`, `md2do todoist push`, etc.)
- [ ] Bidirectional sync logic
- [ ] Interactive token setup
- [ ] Validation warnings for `[todoist:ID]` markers
- [ ] Validation warnings for `{todoist:ID}` markers
- [ ] Detect malformed IDs
- [ ] Verify ID exists in Todoist
- [ ] Warn about orphaned/deleted tasks
Expand Down
11 changes: 6 additions & 5 deletions STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@ This document provides a quick overview of md2do's current implementation status
- [x] Status bar integration
- [x] Published to VSCode Marketplace (v0.2.2)

### Date Support
### Metadata Syntax

- [x] Absolute dates: `[due: 2026-01-25]`, `[due: 2026-01-25 14:30]`
- [x] Short formats: `[due: 1/25/26]`, `[due: 1/25]`
- [x] Relative dates: `[due: today]`, `[due: tomorrow]`, `[due: next week]`, `[due: next month]`
- [x] Completion dates: `[completed: 2026-01-25]`
- [x] Due dates: `#due:2026-01-25` (tag-style)
- [x] Completion dates: `{completed:2026-01-25}` (brace-style)
- [x] Todoist IDs: `{todoist:123456}` (brace-style)
- [x] Legacy bracket syntax still parsed for backward compatibility (`[due: ...]`, `[completed: ...]`, `[todoist: ...]`)
- [x] CLI migration command: `md2do migrate --dry-run --path <dir>`
- [x] Heading date extraction (ISO, slash, natural formats)

### Publishing & CI/CD
Expand Down
2 changes: 2 additions & 0 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export default defineConfig({
{ text: 'Overview', link: '/cli/overview' },
{ text: 'list', link: '/cli/list' },
{ text: 'stats', link: '/cli/stats' },
{ text: 'migrate', link: '/cli/migrate' },
{
text: 'todoist',
collapsed: false,
Expand All @@ -91,6 +92,7 @@ export default defineConfig({
text: 'Integrations',
items: [
{ text: 'VSCode Extension', link: '/integrations/vscode' },
{ text: 'Obsidian Plugin', link: '/integrations/obsidian' },
{ text: 'Todoist Setup', link: '/integrations/todoist' },
{ text: 'MCP (AI Integration)', link: '/integrations/mcp' },
],
Expand Down
95 changes: 95 additions & 0 deletions docs/cli/migrate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# migrate

Migrate markdown files from legacy bracket syntax (`[due:...]`, `[completed:...]`, `[todoist:...]`) to the new tag/brace syntax (`#due:...`, `{completed:...}`, `{todoist:...}`).

## Usage

```bash
md2do migrate [options]
```

## Options

| Option | Description | Default |
| --------------------- | --------------------------------------- | ----------------- |
| `-p, --path <path>` | Root directory to scan | Current directory |
| `--pattern <pattern>` | Glob pattern for markdown files | `**/*.md` |
| `--dry-run` | Preview changes without modifying files | `false` |

## How It Works

The migrate command scans all matching markdown files and converts legacy bracket syntax to the new format:

| Legacy Syntax | New Syntax |
| ------------------------- | ------------------------ |
| `[due: 2026-02-01]` | `#due:2026-02-01` |
| `[completed: 2026-01-15]` | `{completed:2026-01-15}` |
| `[todoist: 123456]` | `{todoist:123456}` |

Files that already use the new syntax are left unchanged. The migrator reports warnings for any lines it cannot automatically convert.

## Examples

### Preview changes (recommended first step)

```bash
md2do migrate --dry-run
```

Output:

```
tasks/home.md:
L7:
- - [ ] Pay electricity bill !! #bills [due: 2026-01-15]
+ - [ ] Pay electricity bill !! #bills #due:2026-01-15

L12:
- - [x] Fix leaky faucet [completed: 2026-01-10]
+ - [x] Fix leaky faucet {completed:2026-01-10}

[DRY RUN] 1 file(s) would be modified, 2 change(s), 0 warning(s)
```

### Apply migration

```bash
md2do migrate
```

### Migrate a specific directory

```bash
md2do migrate --path ./work-notes
```

### Migrate only files in a subdirectory

```bash
md2do migrate --pattern "projects/**/*.md"
```

## Notes

- **Non-destructive**: Legacy syntax is still parsed by all md2do tools, so migration is optional but recommended.
- **Idempotent**: Running migrate multiple times has no effect on already-migrated files.
- **Excludes**: `node_modules` and `.git` directories are automatically excluded.
- **Backup**: Consider committing your files before running migrate without `--dry-run`.

## Programmatic Usage

The migrator is also available as a library from `@md2do/core`:

```typescript
import { migrateContent } from '@md2do/core';

const result = migrateContent(markdownString);
// result.content - migrated content
// result.changes - array of { line, original, migrated }
// result.warnings - array of { line, message }
```

## See Also

- [Task Format](/guide/task-format) - Full syntax reference including legacy format
- [CLI Overview](/cli/overview) - All CLI commands
29 changes: 29 additions & 0 deletions docs/cli/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,35 @@ md2do config edit

See [config command](/cli/config) for details.

### `migrate`

Migrate markdown files from legacy bracket syntax to the new tag/brace syntax.

```bash
md2do migrate [options]
```

**Options:**

- `--path <dir>` - Root directory to scan (default: current directory)
- `--pattern <pattern>` - Glob pattern for markdown files (default: `**/*.md`)
- `--dry-run` - Preview changes without modifying files

**Examples:**

```bash
# Preview what would change
md2do migrate --dry-run

# Apply migration
md2do migrate

# Migrate specific directory
md2do migrate --path ./work-notes
```

See [migrate command](/cli/migrate) for details.

## Todoist Commands

Sync with [Todoist](https://www.todoist.com). Requires API token configuration.
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/todoist/import.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ md2do todoist import ./work/tasks.md:8 --project Work
1. Reads the task from the specified line in your markdown file
2. Extracts metadata (priority, tags, due date)
3. Creates the task in Todoist
4. Adds `[todoist:ID]` marker to your markdown for future syncs
4. Adds `{todoist:ID}` marker to your markdown for future syncs

## Related

Expand Down
2 changes: 1 addition & 1 deletion docs/cli/todoist/sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ md2do todoist sync

## How It Works

1. Scans markdown files for tasks with `[todoist:ID]` markers
1. Scans markdown files for tasks with `{todoist:ID}` markers (legacy `[todoist:ID]` also supported)
2. Queries Todoist API for those tasks
3. Compares completion status and metadata
4. Updates markdown files with changes from Todoist
Expand Down
47 changes: 22 additions & 25 deletions docs/development/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,29 @@ See the complete roadmap at [ROADMAP.md](https://github.com/TeamNickHart/md2do/b

This page highlights the major upcoming features and their current status.

## Current Version: v0.1.0
## Current Version: v0.2.x

✅ Core task parsing and filtering
✅ CLI commands (list, stats)
✅ Todoist integration
✅ MCP server for AI
✅ Hierarchical configuration
### Completed

- Core task parsing and filtering
- CLI commands (list, stats, config, migrate)
- Todoist integration (import, sync, list, add)
- MCP server for AI
- Hierarchical configuration
- VitePress docs site at [md2do.com](https://md2do.com)
- **Syntax migration** - New `#due:YYYY-MM-DD`, `{completed:YYYY-MM-DD}`, `{todoist:NNN}` format with backward-compatible legacy parsing
- **`md2do migrate` command** - Automated migration from legacy bracket syntax
- **VS Code extension** (v0.2.1) - Task Explorer, CodeLens, diagnostics, dashboard, smart `#due:` autocomplete
- **Obsidian plugin** (beta) - Task list view, grouping, sorting, commands

## In Progress

### Obsidian Plugin Polish

- [ ] Syntax migration updates (suggest provider, task writer)
- [ ] Community plugin submission
- [ ] Auto-completion for `#due:`, `@`, `#`

### Advanced Sync Logic

- [x] Basic bidirectional sync
Expand All @@ -28,7 +41,7 @@ This page highlights the major upcoming features and their current status.
- [ ] Better error messages
- [ ] First-run experience

## Near-Term (Next 3-6 Months)
## Near-Term

### Watch Mode

Expand All @@ -38,21 +51,13 @@ Real-time monitoring and auto-sync
- Auto-sync on save
- Desktop notifications

### Website & Docs

- [ ] VitePress site at md2do.com
- [ ] Interactive examples
- [ ] Video tutorials
- [ ] Blog

### Repository Polish

- [ ] CONTRIBUTING.md
- [ ] Issue/PR templates
- [ ] GitHub Actions CI/CD
- [ ] Automated releases

## Mid-Term (6-12 Months)
## Mid-Term

### MCP + Todoist

Expand All @@ -69,15 +74,7 @@ Sync with GitHub Issues
- Bidirectional sync
- Issue linking

### VS Code Extension

Native VS Code integration

- Task tree view
- Inline decorations
- Quick actions

## Long-Term (12+ Months)
## Long-Term

### Web Dashboard

Expand Down
4 changes: 2 additions & 2 deletions docs/development/vscode-extension-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ A VS Code extension to enhance the md2do task management experience directly in
- Highlight @assignees (e.g., `@nick` in blue)
- Highlight priority markers (`!!!` in red, `!!` in orange, `!` in yellow)
- Highlight tags (`#backend` in purple)
- Highlight due dates (`[due: 2026-01-25]` in green)
- Highlight Todoist IDs (`[todoist: 123]` in gray)
- Highlight due dates (`#due:2026-01-25` in green)
- Highlight Todoist IDs (`{todoist:123}` in gray)
- Highlight completed tasks differently from incomplete

**Technical Approach:**
Expand Down
Loading
Loading