A professional, real-time Markdown previewer inspired by README.com with live reload, syntax highlighting, and advanced features for developers and technical writers.
- README.com-inspired design and layout
- Beautiful syntax highlighting with Highlight.js
- Responsive design for all screen sizes
- Clean, modern typography
- Frontmatter processing - YAML metadata support
- Multi-language code tabs - Organize code samples
- Info boxes with emoji indicators (π π‘
β οΈ β ) - GitHub Flavored Markdown features
- Variable substitution for API documentation
- Real-time preview with instant updates
- File watching - Auto-refresh on file changes
- Live reload via WebSockets
- Hot reloading during development
- Multiple markdown files support
- File manager with easy navigation
- Error handling and validation
- Professional code organization
- Node.js 16.0.0 or higher
- npm 8.0.0 or higher
-
Clone the repository
git clone https://github.com/yourusername/readme-previewer.git cd readme-previewer -
Install dependencies
npm install
-
Build the frontend
npm run build
-
Start the server
npm start
-
Open your browser
http://localhost:3000
- Place your Markdown files in the
docs/directory - Start the server with
npm start - Navigate to
http://localhost:3000 - Select files from the sidebar to preview them
- Edit files in your favorite editor - changes appear instantly!
---
title: Your Document Title
excerpt: A brief description that appears below the title
category: documentation
---```javascript HTTP using JavaScript (ES6)
// Your JavaScript code here
```
```python HTTP using Python
# Your Python code here
```> π **Note**
> This is an informational note box
> β οΈ **Warning**
> This is a warning box
> β
**Success**
> This indicates success
> π‘ **Tip**
> This is a helpful tipUse {{apiKey}} and {{baseUrl}} in your documentation.Variables are automatically replaced:
{{apiKey}}βdemo_api_key_12345{{baseUrl}}βhttps://api.opengateway.telefonica.com{{version}}βv1.2.0
readme-previewer/
βββ docs/ # Markdown files to preview
βββ src/
β βββ server/ # Server-side modules
β β βββ markdown-processor.js
β β βββ tabs-processor.js
β β βββ file-manager.js
β βββ App.js # React main component
β βββ App.css # Styling
β βββ index.js # React entry point
βββ public/ # Generated static files
βββ server.js # Main server file
βββ webpack.config.js # Build configuration
βββ package.json
# Start development server with auto-restart
npm run dev
# Build for production
npm run build
# Build for development (faster)
npm run build:dev
# Watch mode for continuous building
npm run watch
# Clean generated files
npm run clean| Endpoint | Method | Description |
|---|---|---|
/api/files |
GET | List all markdown files |
/api/files/:filename |
GET | Get file content and HTML |
/api/preview |
POST | Process markdown content |
| Event | Description |
|---|---|
fileAdded |
New file detected |
fileChanged |
File content updated |
fileRemoved |
File deleted |
Create a .env file in the root directory:
PORT=3000
DOCS_DIR=./docsEdit src/server/markdown-processor.js to modify variable substitutions:
const mockVariables = {
'{{apiKey}}': 'your_api_key',
'{{baseUrl}}': 'https://your-api.com',
'{{version}}': 'v2.0.0'
};# Build optimized production bundle
npm run build
# Start production server
NODE_ENV=production npm startFROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Test thoroughly
- Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by README.com design
- Built with React and Node.js
- Syntax highlighting by Highlight.js
- Markdown processing by markdown-it
Made with β€οΈ for the developer community
β Star this repo if you find it helpful!