Skip to content

A Node.js tool that converts Telegram chat HTML exports to clean, structured Markdown for LLM analysis. Features include date filtering, message metadata preservation, and configurable output file sizes. Perfect for data analysis, training language models, and chat content archiving.

License

Notifications You must be signed in to change notification settings

caelum29/telegram-markdown-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram to Markdown Converter

Convert Telegram chat HTML exports to structured Markdown files for LLM analysis.

Features

  • 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

Installation

  1. Clone the repository:
git clone https://github.com/YOUR_USERNAME/telegram-markdown-converter.git
cd telegram-markdown-converter
  1. Install dependencies:
npm install

Usage

  1. Export your Telegram chat history as HTML
  2. Place the HTML files in the messages directory
  3. 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

Options

  • -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)

Directory Structure

telegram-to-markdown-converter/
├── src/                  # Source code
├── messages/             # Input HTML files
└── output/              # Generated Markdown files

License

MIT

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License: MIT

About

A Node.js tool that converts Telegram chat HTML exports to clean, structured Markdown for LLM analysis. Features include date filtering, message metadata preservation, and configurable output file sizes. Perfect for data analysis, training language models, and chat content archiving.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published