An extensible and beautifully designed web-based text processing toolbox with multiple text processing capabilities.
- π¨ Beautiful Web Interface - Modern gradient design with drag-and-drop file upload
- π§ Easy to Extend - Plugin architecture for easy addition of new features
- π High Performance - Asynchronous backend based on FastAPI
- π¦ Flexible Input - Supports multiple file selection and ZIP archives
- π Cross-Platform - Web-based, works in any browser
Merges multiple date-named Markdown files in chronological order into a single file.
Supported filename formats:
20250410.md2025-04-10.md20250410_notes.md
Merge rules:
- Output filename is the year (e.g.,
2025.md) - H1 heading is the year (e.g.,
# 2025) - H2 headings are formatted dates (e.g.,
## 2025-03-09) - Each file's content follows its corresponding date heading
- Files are separated by horizontal rules
--- - Sorted in ascending date order
Usage:
- Upload multiple .md files, or
- Upload a .zip archive containing .md files
text-toolbox/
βββ backend/ # Backend code
β βββ main.py # FastAPI application entry point
β βββ requirements.txt # Python dependencies
β βββ tools/ # Tool modules directory
β β βββ __init__.py
β β βββ base.py # Base tool class
β β βββ md_merger.py # Markdown merger tool
β βββ temp/ # Temporary files directory
βββ frontend/ # Frontend code
β βββ index.html # Single page application
βββ docker-compose.yml # Docker Compose file
βββ Dockerfile # Docker image
βββ README.md # Project documentation
# Start all services
./start.sh # Linux/Mac
start.bat # Windows
# Or manually:
docker-compose up -dAccess: http://localhost:8080
# Install dependencies
cd backend
pip install -r requirements.txt
# Start backend
python main.pyBackend API: http://localhost:8000
In another terminal:
# Start frontend
cd frontend
python -m http.server 8080Frontend: http://localhost:8080
After starting the backend, visit http://localhost:8000/docs to view the auto-generated API documentation.
GET /- Get API information and tool listGET /api/tools- Get all available toolsPOST /api/tools/md-merger- Merge multiple MD filesPOST /api/tools/md-merger/zip- Extract and merge MD files from ZIP
This project uses a plugin architecture, making it very simple to add new features:
Create a new tool file in backend/tools/ directory, inheriting from BaseTool:
# backend/tools/your_tool.py
from .base import BaseTool
class YourTool(BaseTool):
@property
def name(self) -> str:
return "Your Tool Name"
@property
def description(self) -> str:
return "Tool description"
async def process(self, *args, **kwargs):
# Implement your processing logic
passRegister your tool in backend/main.py:
from tools.your_tool import YourTool
TOOLS_REGISTRY = {
"md_merger": {...},
"your_tool": {
"name": "Your Tool Name",
"description": "Tool description",
"endpoint": "/tools/your-tool",
"handler": YourTool()
}
}Add the corresponding API endpoint in backend/main.py:
@app.post("/api/tools/your-tool")
async def your_tool_endpoint(file: UploadFile = File(...)):
# Processing logic
passAdd a new tool card and interaction logic in frontend/index.html.
The project includes complete Docker configuration for one-click deployment:
# Build and start
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose downfolder/
βββ 20250101.md
βββ 20250102.md
βββ 20250103.md
20250101.md:
First day of 2025, Happy New Year!20250102.md:
Starting to plan for the new year.# 2025
## 2025-01-01
First day of 2025, Happy New Year!
---
## 2025-01-02
Starting to plan for the new year.
---- Markdown file merger feature
- Text format conversion (MD/TXT/PDF, etc.)
- Batch file renaming
- Text statistics and analysis
- Regex batch replacement
- CSV/Excel data processing
- Text deduplication tool
Issues and Pull Requests are welcome!
MIT License
- Backend: FastAPI (Python 3.8+)
- Frontend: Native HTML/CSS/JavaScript
- Deployment: Docker + Docker Compose