The official website for MarkText - A simple and elegant markdown editor.
- ๐ Modern Stack: Built with React 18 + TypeScript + Vite
- ๐ Live Preview: Interactive markdown editor with real-time rendering
- ๐จ Multiple Themes: Support for Dark, Graphite, Material Dark, One Dark, and Ulysses themes
- ๐ Diagram Support: Mermaid diagrams integration for flowcharts, sequence diagrams, and more
- ๐งฎ Math Rendering: KaTeX support for mathematical formulas
- ๐ Syntax Highlighting: Prism.js integration for code blocks
- ๐ฑ Responsive Design: Works seamlessly on desktop and mobile devices
Before you begin, ensure you have the following installed:
- Node.js: >= 16.0.0 (recommended: LTS version)
- pnpm: >= 8.0.0 (recommended package manager)
To install pnpm globally:
npm install -g pnpm- Clone the repository:
git clone https://github.com/marktext/website.git
cd website- Install dependencies:
pnpm installStart the development server with hot-reload:
pnpm devThe application will be available at http://localhost:5173 (or the next available port).
Build the application for production:
pnpm buildThe optimized files will be generated in the build/ directory.
Preview the production build locally:
pnpm previewRun TypeScript type checking:
pnpm type-checkRun ESLint to check code quality:
pnpm lintThis project is configured to automatically deploy to GitHub Pages using GitHub Actions.
- Go to your repository Settings โ Pages
- Under Source, select GitHub Actions
- Push to the
masterbranch or manually trigger the workflow
The site will be available at: https://marktext.github.io/website/
You can also trigger the deployment manually:
- Go to Actions tab in your GitHub repository
- Select Deploy to GitHub Pages workflow
- Click Run workflow
To preview the production build locally before deploying:
pnpm build
pnpm previewwebsite/
โโโ src/
โ โโโ assets/ # Static assets (images, SVGs)
โ โ โโโ sponsor/ # Sponsor logos
โ โโโ components/ # React components
โ โ โโโ Feature.tsx # Main feature showcase with markdown preview
โ โ โโโ Footer.tsx # Website footer
โ โ โโโ Sponsor.tsx # Sponsors section
โ โ โโโ Theme.tsx # Theme switcher
โ โ โโโ TitleBar.tsx # Navigation bar
โ โโโ markdowns/ # Markdown demo files
โ โโโ muya/ # Muya editor library
โ โโโ themes/ # Theme CSS files
โ โโโ types/ # TypeScript type definitions
โ โโโ utils/ # Utility functions
โ โ โโโ markdownToHtml.ts # Markdown to HTML converter
โ โ โโโ scrollTo.ts # Smooth scrolling utilities
โ โ โโโ theme.ts # Theme management
โ โ โโโ themeColor.ts # Theme color definitions
โ โโโ App.tsx # Root component
โ โโโ main.tsx # Application entry point
โ โโโ app.global.css # Global styles
โโโ public/ # Public static files
โโโ build/ # Production build output (generated)
โโโ index.html # HTML template
โโโ package.json # Project dependencies and scripts
โโโ tsconfig.json # TypeScript configuration
โโโ vite.config.js # Vite configuration
โโโ README.md # This file
- React - UI library
- TypeScript - Type-safe JavaScript
- Vite - Build tool and dev server
- Mermaid - Diagram and flowchart rendering
- KaTeX - Math typesetting
- Prism.js - Syntax highlighting
- DOMPurify - HTML sanitization
- Axios - HTTP client
- GitHub Markdown CSS - Markdown styling
- ESLint - Code linting
- TypeScript ESLint - TypeScript-specific linting rules
- Vite Plugin SVGR - SVG to React component conversion
The website supports multiple editor themes:
- Cadmium Light (Default)
- Dark - Dark theme with high contrast
- Graphite - Elegant dark gray theme
- Material Dark - Material Design inspired dark theme
- One Dark - Atom One Dark theme
- Ulysses - Minimalist theme inspired by Ulysses app
The editor preview supports:
- โ CommonMark and GitHub Flavored Markdown
- โ Task lists with checkboxes
- โ Tables with alignment
- โ Code blocks with syntax highlighting
- โ Math equations (inline and block)
- โ Mermaid diagrams
- โ HTML sanitization for security
- โ Auto-linking URLs
- โ Emoji support
The vite.config.js includes:
- Custom markdown plugin for
.mdfile imports - SVGR plugin for SVG component generation
- Optimized build settings
Two TypeScript configs are used:
tsconfig.json- App source code configurationtsconfig.node.json- Build tools configuration
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Main Project: MarkText Editor
- Website: https://marktext.me
- Documentation: MarkText Docs
Special thanks to all our sponsors for supporting the MarkText project!
Made with โค๏ธ by the MarkText Team