IWE Normalize

Performs comprehensive document normalization across all markdown files in your knowledge base.

Usage

iwe normalize

Operations Performed

OperationDescription
Link title syncUpdates link text to match target document headers
Header levelingAdjusts header levels for consistent hierarchy
List renumberingFixes ordered list numbering (1, 2, 3…)
Whitespace normalizationStandardizes newlines and indentation
List formattingEnsures consistent list item formatting
Structure cleanupRemoves redundant empty lines

Before/After Examples

Link Title Sync

Before:

See the [old title](project-docs) for details.

After (if project-docs.md has header # Project Documentation):

See the [Project Documentation](project-docs) for details.

List Renumbering

Before:

1. First item
1. Second item
5. Third item

After:

1. First item
2. Second item
3. Third item

Whitespace Normalization

Before:

# Title


Some paragraph.



Another paragraph.

After:

# Title

Some paragraph.

Another paragraph.

Examples

# Basic normalization
iwe normalize

# With INFO level logging
iwe -v 1 normalize

# With DEBUG level logging
iwe -v 2 normalize

Safety Warning

Important: The normalize command modifies files in place. Always ensure you have a backup or version control before running:

# Recommended: commit changes before normalizing
git add -A && git commit -m "Before normalization"

# Run normalization
iwe normalize

# Review changes
git diff

Configuration

Normalization behavior is controlled by .iwe/config.toml:

[markdown]
refs_extension = ""  # Extension for reference links

Idempotency

Running normalize multiple times produces the same result - once files are normalized, subsequent runs make no changes.