Convert Telegram chat HTML exports to structured Markdown files for LLM analysis.
- Converts Telegram HTML exports to clean, structured Markdown
- Filters messages by date range
- Splits output into manageable file sizes
- Preserves message metadata and reactions
- Optimized for LLM processing
- Clone the repository:
git clone https://github.com/YOUR_USERNAME/telegram-markdown-converter.git
cd telegram-markdown-converter
- Install dependencies:
npm install
- Export your Telegram chat history as HTML
- Place the HTML files in the
messages
directory - Run the converter:
# Basic usage
npm start
# With date range
npm start -- -f 2023-01-01 -t 2023-12-31
# Specify maximum output file size (in KB)
npm start -- -s 1000
-f, --from <date>
: Start date (YYYY-MM-DD)-t, --to <date>
: End date (YYYY-MM-DD)-s, --size <size>
: Maximum output file size in KB (default: 500)
telegram-to-markdown-converter/
├── src/ # Source code
├── messages/ # Input HTML files
└── output/ # Generated Markdown files
MIT
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request