Skip to content

TMHSDigital/Markdown-Preview

Repository files navigation

Markdown-Preview

Go Version License Code Style Made with Go Build Size Go Report Card

Markdown-Preview Logo
A modern, feature-rich markdown editor and previewer built with Go and modern web technologies.

FeaturesQuick StartShortcutsGuideArchitecture

Overview

Markdown-Preview is a lightweight yet powerful markdown editor that combines real-time preview with modern features. Built with performance and usability in mind, it offers a seamless writing experience for developers, technical writers, and markdown enthusiasts.

Dark Theme

Dark Theme Screenshot

Light Theme

Light Theme Screenshot

Features

Category Features Description
Editor - Real-time preview
- Split view with resizable panes
- Syntax highlighting
- Auto-save functionality
Advanced editor with instant preview and modern IDE features
Appearance - Dark/Light mode
- Clean, modern UI
- Mobile responsive design
Polished interface that adapts to any device or preference
Functionality - Offline support
- Image upload & drag-n-drop
- Keyboard shortcuts
Works without internet and supports rich media content
Documentation - Comprehensive Markdown Guide:
- Interactive examples (click-to-copy)
- Live Markdown-to-HTML demo
- Common patterns/templates
- Guide search functionality
- Shortcut cheat sheet
- Fullscreen mode
- Contextual tooltips and hints
Built-in learning resources and contextual help, significantly enhanced.

Technical Details

Performance Metrics

Metric Value Description
Initial Load ~2MB Optimized bundle size
Preview Latency ~50ms Real-time markdown rendering
Memory Usage <100MB Efficient resource utilization
Browser Support Modern Browsers Chrome 80+, Firefox 75+, Safari 13+

Dependencies

require (
	github.com/gomarkdown/markdown v0.0.0-latest
	github.com/gorilla/mux v1.8.0
	github.com/tdewolff/minify/v2 v2.12.0
)

Quick Start

Prerequisites

go version >= 1.16

One-Line Installation

git clone https://github.com/TMHSDigital/Markdown-Preview.git && cd Markdown-Preview && go run main.go

Manual Installation

  1. Clone the repository:
git clone https://github.com/TMHSDigital/Markdown-Preview.git
cd Markdown-Preview
  1. Install dependencies:
go mod download
  1. Run the application:
go run main.go
  1. Open your browser:
http://localhost:8080

Keyboard Shortcuts

Category Shortcut Action Context
File Operations Ctrl+S Save Editor
Text Formatting Ctrl+B
Ctrl+I
Ctrl+K
Ctrl+``
Bold
Italic
Link
Code
Editor
List Operations Ctrl+Shift+L
Ctrl+Shift+O
Ctrl+Shift+T
Unordered List
Ordered List
Task List
Editor
Block Elements Ctrl+Shift+C
Ctrl+Shift+H
Blockquote
Horizontal Rule
Editor
UI Controls Ctrl+P
Ctrl+F
Alt+Z
Ctrl+?
Toggle Preview
Open Search
Toggle Word Wrap
Toggle Guide
Global

For a complete list of keyboard shortcuts, see the Shortcuts section in the built-in guide.

Markdown Guide

Markdown-Preview includes a comprehensive interactive guide that helps users learn and master Markdown syntax:

  • Interactive Examples: Click any code example to copy it to your clipboard.
  • Live Demo: Test Markdown syntax and see the HTML output in real-time.
  • Template Library: Ready-to-use templates for READMEs, blog posts, and meeting notes.
  • Search Functionality: Quickly find specific Markdown syntax elements.
  • Keyboard Shortcuts: Complete list of keyboard shortcuts for efficient editing.
  • Fullscreen Mode: Distraction-free learning experience.

Access the guide by clicking the ? button in the toolbar.

Markdown Guide Screenshot

Architecture

Markdown-Preview/
├── main.go           # Application entry point and server setup
├── static/          # Static assets and client-side resources
│   ├── styles.css   # CSS styling and theme definitions
│   ├── guide.html   # Interactive markdown guide with documentation
│   └── images/      # Static images and icons
├── templates/       # Go HTML templates
│   └── index.html   # Main application template
├── internal/        # Internal packages
│   ├── markdown/    # Markdown processing
│   └── server/      # HTTP server logic
└── uploads/         # User uploaded content (gitignored)

Security Features

Feature Implementation
Input Sanitization HTML sanitization and markdown safe rendering
Upload Security File type validation and size limits
XSS Protection Content Security Policy (CSP) headers
CSRF Protection Token-based request validation

License

This project is licensed under the MIT License - see the LICENSE file for details.

Tech Stack

Category Technology Usage
Backend Go 1.16+ Server runtime
Frontend Vanilla JS Client-side logic
Markdown gomarkdown Markdown processing
Syntax Highlighting Prism.js Code block highlighting
UI Components Material Icons Interface icons
Templates Go html/template HTML rendering

Powered by Go. Built by TMHSDigital.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published