A professional web application that converts Markdown content into styled HTML articles optimized for WeChat's rich text editor. Create beautiful, formatted articles with multiple style templates and seamless copy-paste functionality.
- Classic: Professional and formal style with elegant typography
- Medium: Clean, modern style inspired by Medium publications
- Wikipedia: Encyclopedia-style formatting for maximum readability
- Real-time preview in mobile format
- Font sizes optimized for mobile viewing
- Perfect rendering on WeChat mobile app
- Live Preview: See changes instantly as you type
- Rich Text Copy: One-click copy with proper formatting
- File Upload: Import existing Markdown files
- Template Switching: Change styles with a dropdown
- CSS Inlining: Automatic style inlining for WeChat compatibility
- List Fix: Proper list formatting that works in WeChat
- Cross-browser: Works on all modern browsers
- TypeScript: Full type safety and better development experience
- Node.js 16+
- npm or yarn
# Clone the repository
git clone <repository-url>
cd wechat-article
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint (if configured)
- Type or paste your Markdown content in the left editor
- Use the "π Open File" button to import existing
.md
files - Supports all standard Markdown syntax
- Select from Classic, Medium, or Wikipedia templates
- Preview updates instantly with your selected style
- Each template is optimized for different content types
- Click "Copy for WeChat" button
- Paste directly into WeChat's rich text editor
- All formatting is preserved automatically
- Headers: H1-H6 with proper hierarchy
- Text Formatting: Bold, italic, inline code
- Lists: Bullet points and numbered lists (WeChat compatible)
- Blockquotes: Professional quote styling
- Code Blocks: Syntax highlighted code
- Links: Clickable links with hover effects
- Tables: Clean, structured data presentation
- Images: Responsive image handling
Template | Best For | Font Style | Visual Style |
---|---|---|---|
Classic | Business articles, formal documents | Modern sans-serif (Poppins) | Professional, elegant |
Medium | Blog posts, stories, personal articles | Serif body text (Georgia) | Clean, readable |
Wikipedia | Reference content, factual articles | System fonts (Arial) | Academic, functional |
- React 18+ with TypeScript
- Vite for fast development and building
- Styled Components for component styling
- Markdown-it for robust Markdown parsing
src/
βββ components/
β βββ Editor/ # Markdown editor components
β βββ Preview/ # Article preview and copy functionality
β βββ Layout/ # App layout components
βββ templates/ # Style template definitions
βββ types/ # TypeScript type definitions
βββ utils/ # Utility functions
βββ contexts/ # React context for state management
- Extensible Architecture: Easy to add new templates
- Type-Safe: Full TypeScript support
- Dynamic CSS: Runtime style generation
- Context-Based: React context for global template state
- Create a new template file in
src/templates/
:
import type { StyleTemplate } from '../types/template';
export const myTemplate: StyleTemplate = {
id: 'my-template',
name: 'My Template',
description: 'My custom template description',
typography: { /* typography config */ },
colors: { /* color palette */ },
spacing: { /* spacing config */ },
generateCSS: function() {
return `/* your CSS here */`;
},
};
- Register in
src/templates/templateRegistry.ts
:
import { myTemplate } from './myTemplate';
export const templateRegistry = {
// ... existing templates
'my-template': myTemplate,
};
- Update the
TemplateId
type insrc/types/template.ts
- CSS Inlining: All styles are inlined for maximum compatibility
- List Formatting: Special handling for bullet points and numbering
- Rich Text Copy: Uses modern clipboard API with fallbacks
- Mobile-First: Designed for mobile WeChat viewing
- Uses
navigator.clipboard.write()
for rich text copying - Falls back to
document.execCommand()
for older browsers - Custom markdown-it renderer for WeChat-compatible lists
- Juice library for CSS inlining
- Fork the repository
- Create a 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
This project is licensed under the MIT License - see the LICENSE file for details.
- markdown-it for excellent Markdown parsing
- Juice for reliable CSS inlining
- React ecosystem for robust development tools
- WeChat for inspiring this tool's creation
If you encounter any issues or have questions:
- Open an issue on GitHub
- Check the existing documentation
- Review the CLAUDE.md file for development guidance
If you like this project, please consider buying me a coffee.
Made with β€οΈ for WeChat content creators
Transform your Markdown into beautiful WeChat articles effortlessly!