Important
This repository has been archived. The official MarkText website has been migrated into the main marktext/marktext repository. Please file issues and contribute there going forward. This repo is kept for historical reference only and will no longer receive updates.
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 install
Start the development server with hot-reload:
pnpm dev
The application will be available at http://localhost:5173 (or the next available port).
Build the application for production:
pnpm build
The optimized files will be generated in the build/ directory.
Preview the production build locally:
pnpm preview
Run TypeScript type checking:
pnpm type-check
Run ESLint to check code quality:
pnpm lint
This 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 preview
website/
āāā 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