Creates consolidated documents by combining linked content into a single markdown file.
iwe squash <KEY> [OPTIONS]| Argument | Description |
|---|---|
<KEY> |
Document key to squash |
| Option | Default | Description |
|---|---|---|
-d, --depth <DEPTH> |
2 |
How deep to traverse links |
-v, --verbose <LEVEL> |
0 |
Verbosity level |
- Starts from the specified document
- Traverses Inclusion Links up to specified depth
- Combines content into a single markdown document
- Converts linked sections to inline sections
- Adjusts header levels to maintain hierarchy
Given this document structure:
project-overview.md:
# Project Overview
Introduction to the project.
- [Goals](goals)
- [Architecture](architecture)goals.md:
# Goals
Our main objectives are:
- Improve performance
- Add new featuresRunning iwe squash project-overview outputs:
# Project Overview
Introduction to the project.
## Goals
Our main objectives are:
- Improve performance
- Add new features
## Architecture
...Note that linked document headers become sub-headers (# → ##) to preserve hierarchy.
# Squash starting from document "project-overview"
iwe squash project-overview
# Squash with greater depth
iwe squash main-topic --depth 4
# Save output to file
iwe squash research-notes --depth 3 > output.md
# With debug output
iwe squash research-notes --depth 3 -v 2When documents are inlined, their header levels are adjusted:
| Original Level | Becomes | Reason |
|---|---|---|
# (h1) |
## (h2) |
Linked document becomes section |
## (h2) |
### (h3) |
Preserves relative hierarchy |
### (h3) |
#### (h4) |
And so on... |
This ensures the squashed document maintains a logical structure with the root document as the top-level heading.
- Export to PDF: Create a single document for typesetting with tools like Typst
- Sharing: Generate a standalone file from interconnected notes
- Backup: Consolidate project knowledge into a portable format
- Context building: Create comprehensive documents for review
- Use
squashto build comprehensive context from related documents - Combine with
retrievefor maximum context: squash provides structure, retrieve provides backlinks - Adjust depth based on scope: shallow (2) for focused topics, deep (4+) for comprehensive overviews
- Squashed output is ideal for sending to language models as context
Example PDF generated using squash command and Typst.