8000 GitHub - tunghuynh/convert-md · GitHub
[go: up one dir, main page]

Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Universal Table Converter

A web-based tool that converts tables between multiple formats including Markdown, SQL, JSON, XML, HTML, and CSV. The application supports Excel file processing, drag-and-drop functionality, and multi-language support.

Demo Online: https://tunghuynh.net/convert-md/

🚀 Features

  • Multi-format Conversion: Convert tables to/from Markdown, SQL, JSON, XML, HTML, and CSV
  • Excel File Support: Process .xlsx and .xls files with multi-sheet support
  • Drag & Drop Interface: Simply drag Excel files into the input area
  • Copy/Paste Support: Paste table data from Excel, Google Sheets, Word, or websites
  • Multi-language Support: Available in English, Vietnamese, Chinese, and Japanese
  • Real-time Conversion: Auto-convert as you edit table data
  • Interactive Table Editor: Add rows, edit cells directly in the interface
  • Multiple Input Methods: Support for HTML tables, tab-separated, and comma-separated data
  • Statistics Display: Shows row count, column count, and current file information

🛠️ Tech Stack

  • Frontend: Vanilla JavaScript, HTML5, CSS3
  • Libraries:
  • No Build Process: Pure client-side application with CDN dependencies

📁 Project Structure

md/
├── index.html          # Main HTML file with UI structure
├── style.css          # Styling and responsive design
├── main.js            # Application initialization and event handlers
├── script.js          # Core application logic and translations
├── generators.js      # Output format generators (Markdown, SQL, JSON, etc.)
├── excel-handler.js   # Excel file processing functionality
├── table-handler.js   # Table parsing and manipulation
├── translations.js    # Translation data (incomplete file)
├── globals.js         # Global variables and constants
├── i18n.js           # Internationalization utilities
└── utils.js          # Utility functions

🎯 How It Works

Input Processing Flow

  1. File Input: Users can drag & drop Excel files or paste table data
  2. Format Detection: Automatically detects HTML tables, tab-separated, or comma-separated data
  3. Sheet Selection: For multi-sheet Excel files, users can select specific sheets
  4. Data Parsing: Converts input data into a standardized table format

Output Generation Flow

  1. Format Selection: Users choose output format via format buttons
  2. Data Conversion: Applies format-specific generators to table data
  3. Real-time Update: Output updates automatically when input changes
  4. Copy Functionality: One-click copying of generated output

Supported Formats

Format Input Output Description
Markdown ✅ ✅ GitHub-flavored markdown tables
SQL ❌ ✅ CREATE TABLE and INSERT statements
JSON ❌ ✅ Array of objects format
XML ❌ ✅ Structured XML with table elements
HTML ✅ ✅ Standard HTML table markup
CSV ✅ ✅ Comma-separated values
Excel ✅ ❌ .xlsx and .xls file support

🌐 Multi-language Support

The application supports 4 languages with complete UI translation:

  • 🇺🇸 English (en) - Default language
  • 🇻🇳 Vietnamese (vi) - Tiếng Việt
  • 🇨🇳 Chinese (zh) - 中文
  • 🇯🇵 Japanese (ja) - 日本語

Language preference is automatically saved to localStorage.

🚀 Getting Started

Prerequisites

  • Modern web browser with JavaScript enabled
  • Internet connection (for CDN dependencies)

Installation

  1. Clone or download the project files
  2. Open index.html in a web browser
  3. No build process or server setup required

Usage Examples

Converting Excel to Markdown

  1. Drag an Excel file into the input area
  2. Select desired sheet (if multiple sheets exist)
  3. Choose "Markdown" format
  4. Copy the generated output

Pasting Table Data

  1. Copy a table from Excel/Google Sheets
  2. Paste into the input area
  3. Select output format
  4. Use "Copy Output" to get converted data

🔧 Development

Code Organization

  • Modular Architecture: Functionality split across focused JavaScript files
  • Event-Driven: Uses DOM events for user interactions
  • Translation System: Centralized i18n with nested object structure
  • Error Handling: Comprehensive error messages with user feedback

Key Functions

  • processExcelFile() - Handles Excel file processing
  • generateOutput() - Main output format dispatcher
  • parseHTMLTable() - Parses HTML table data
  • autoConvert() - Triggers automatic conversion
  • updateLanguage() - Handles UI language switching

📊 Statistics & Feedback

The application tracks and displays:

  • Number of rows and columns
  • Current file name
  • Processing status
  • Success/error notifications

🎨 UI/UX Features

  • Responsive Design: Works on desktop and mobile devices
  • Drag & Drop Visual Feedback: Clear visual indicators during file operations
  • Loading States: Progress indicators for file processing
  • Toast Notifications: User feedback for all operations
  • Auto-save Language: Remembers user's language preference

📝 License

© 2025 by Tùng Huynh

☕ Support

If you find this tool helpful, consider buying the author a coffee.


This is a client-side web application that processes data locally in your browser. No data is sent to external servers.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0