Add comprehensive README with usage instructions
This commit is contained in:
parent
f1de59394f
commit
b16e82336a
1 changed files with 31 additions and 58 deletions
89
README.md
89
README.md
|
|
@ -1,77 +1,49 @@
|
||||||
# Logseq Task List Query Cleaner
|
# 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
|
Logseq journal pages often contain two auto-generated query blocks at the bottom:
|
||||||
Removes auto-generated "Task List" query blocks that Logseq adds to journal pages.
|
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
|
```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
|
# 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
|
# Process all .md files in a directory
|
||||||
./run_full_cleanup.sh -r ~/notes_test/journals/
|
python3 clean_task_lists.py path/to/journals/
|
||||||
|
|
||||||
|
# Process recursively through subdirectories
|
||||||
|
python3 clean_task_lists.py -r path/to/journals/
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage Examples
|
### Dry Run
|
||||||
|
|
||||||
### Quick Single File Cleanup
|
|
||||||
```bash
|
```bash
|
||||||
# Use the master script for complete cleanup
|
# See what would be changed without modifying files
|
||||||
./run_full_cleanup.sh path/to/journal.md
|
python3 clean_task_lists.py --dry-run path/to/journals/
|
||||||
```
|
```
|
||||||
|
|
||||||
### Batch Process All Journals
|
### Examples
|
||||||
```bash
|
```bash
|
||||||
# Preview first
|
# Check a single file first
|
||||||
./run_full_cleanup.sh --dry-run -r journals/
|
python3 clean_task_lists.py --dry-run 2026-10-23.md
|
||||||
|
|
||||||
# Then execute
|
# Clean a whole month of journals
|
||||||
./run_full_cleanup.sh -r journals/
|
python3 clean_task_lists.py journals/2026/10/
|
||||||
```
|
|
||||||
|
|
||||||
### Individual Script Usage
|
# Clean everything recursively
|
||||||
```bash
|
python3 clean_task_lists.py -r ~/logseq/journals/
|
||||||
# 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
|
## What Gets Removed
|
||||||
|
|
@ -88,6 +60,7 @@ And also handles variants with sorting options:
|
||||||
- ## Daily Tasks
|
- ## Daily Tasks
|
||||||
- DONE Zyrtec
|
- DONE Zyrtec
|
||||||
:LOGBOOK:
|
:LOGBOOK:
|
||||||
|
CLOCK: [2026-10-23 Fri 17:22:24]--[2026-10-23 Fri 17:22:30] => 00:00:06
|
||||||
:END:
|
:END:
|
||||||
- query-table:: true
|
- query-table:: true
|
||||||
query-sort-by:: page
|
query-sort-by:: page
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue