Add comprehensive README with usage instructions

This commit is contained in:
Hermes Agent 2026-11-03 13:06:31 -08:00
parent f1de59394f
commit b16e82336a

View file

@ -1,77 +1,49 @@
# Logseq Task List Query Cleaner
A suite of Python scripts to clean up and normalize Logseq journal pages.
A Python script to clean up Logseq journal pages by removing the auto-generated "Task List" query blocks.
## Available Scripts
## Problem
### 1. `clean_task_lists.py` - Remove Task List Query Blocks
Removes auto-generated "Task List" query blocks that Logseq adds to journal pages.
Logseq journal pages often contain two auto-generated query blocks at the bottom:
1. **Work Task List** - Shows TODO/LATER items tagged with specific pages (e.g., `#neonai`)
2. **Personal Task List** - Shows TODO/LATER items not tagged with work pages
These query blocks add visual clutter when you want to review or archive daily notes.
## Solution
This script removes both Task List query blocks while preserving all your actual note content.
## Usage
### Basic Usage
```bash
python3 clean_task_lists.py --dry-run journals/
python3 clean_task_lists.py -r journals/
```
### 2. `clean_empty_bullets.py` - Remove Empty Bullet Lines
Removes empty bullet lines (lines with only whitespace and/or a single dash `-`).
```bash
python3 clean_empty_bullets.py --dry-run journals/
python3 clean_empty_bullets.py -r journals/
```
### 3. `ensure_newline_ending.py` - Normalize File Endings
Ensures all files end with exactly one newline character.
```bash
python3 ensure_newline_ending.py --dry-run journals/
python3 ensure_newline_ending.py -r journals/
```
### 4. `run_full_cleanup.sh` - Master Cleanup Script
Runs all cleanup scripts in the correct order:
1. Remove Task List query blocks (largest changes first)
2. Remove empty bullet lines (cleanup remnants)
3. Ensure single trailing newline (final normalization)
```bash
# Dry run
./run_full_cleanup.sh --dry-run ~/notes_test/journals/
# Process a single file
./run_full_cleanup.sh ~/notes_test/journals/JOURNAL_FILE.md
python3 clean_task_lists.py path/to/journal-page.md
# Process recursively
./run_full_cleanup.sh -r ~/notes_test/journals/
# Process all .md files in a directory
python3 clean_task_lists.py path/to/journals/
# Process recursively through subdirectories
python3 clean_task_lists.py -r path/to/journals/
```
## Usage Examples
### Quick Single File Cleanup
### Dry Run
```bash
# Use the master script for complete cleanup
./run_full_cleanup.sh path/to/journal.md
# See what would be changed without modifying files
python3 clean_task_lists.py --dry-run path/to/journals/
```
### Batch Process All Journals
### Examples
```bash
# Preview first
./run_full_cleanup.sh --dry-run -r journals/
# Check a single file first
python3 clean_task_lists.py --dry-run 2026-10-23.md
# Then execute
./run_full_cleanup.sh -r journals/
```
# Clean a whole month of journals
python3 clean_task_lists.py journals/2026/10/
### Individual Script Usage
```bash
# Just remove query blocks
python3 clean_task_lists.py -r journals/
# Just fix empty bullets
python3 clean_empty_bullets.py -r journals/
# Just normalize endings
python3 ensure_newline_ending.py -r journals/
# Clean everything recursively
python3 clean_task_lists.py -r ~/logseq/journals/
```
## What Gets Removed
@ -88,6 +60,7 @@ And also handles variants with sorting options:
- ## Daily Tasks
- DONE Zyrtec
:LOGBOOK:
CLOCK: [2026-10-23 Fri 17:22:24]--[2026-10-23 Fri 17:22:30] => 00:00:06
:END:
- query-table:: true
query-sort-by:: page