From 75bc5543c8c8e04d87d1af816a60b87c0cb1679a Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Tue, 3 Nov 2026 14:01:04 -0800 Subject: [PATCH] Update README with all scripts and run_full_cleanup.sh documentation --- README.md | 88 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 58 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index cf2b964..c343b0b 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,77 @@ # Logseq Task List Query Cleaner -A Python script to clean up Logseq journal pages by removing the auto-generated "Task List" query blocks. +A suite of Python scripts to clean up and normalize Logseq journal pages. -## Problem +## Available Scripts -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 +### 1. `clean_task_lists.py` - Remove Task List Query Blocks +Removes auto-generated "Task List" query blocks that Logseq adds to journal 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 -python3 clean_task_lists.py path/to/journal-page.md +./run_full_cleanup.sh ~/notes_test/journals/2026_10_23.md -# 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/ +# Process recursively +./run_full_cleanup.sh -r ~/notes_test/journals/ ``` -### Dry Run +## Usage Examples + +### Quick Single File Cleanup ```bash -# See what would be changed without modifying files -python3 clean_task_lists.py --dry-run path/to/journals/ +# Use the master script for complete cleanup +./run_full_cleanup.sh path/to/journal.md ``` -### Examples +### Batch Process All Journals ```bash -# Check a single file first -python3 clean_task_lists.py --dry-run 2026-10-23.md +# Preview first +./run_full_cleanup.sh --dry-run -r journals/ -# Clean a whole month of journals -python3 clean_task_lists.py journals/2026/10/ +# Then execute +./run_full_cleanup.sh -r journals/ +``` -# Clean everything recursively -python3 clean_task_lists.py -r ~/logseq/journals/ +### 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/ ``` ## What Gets Removed