Skip to content

silijon/markflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Markflow

A lightweight, real-time Markdown preview tool that watches your Markdown files and automatically updates the rendered HTML in your browser as you edit.

Features

  • Live Preview: Automatically refreshes browser view when you save changes to your Markdown file
  • GitHub Flavored Markdown: Supports tables, strikethrough text, and other GFM features
  • Dark Theme: Uses GitHub's dark markdown CSS for comfortable viewing
  • Zero Configuration: Works out of the box with sensible defaults
  • Lightweight: Minimal dependencies, fast startup
  • Cross-Platform: Works on Windows, macOS, and Linux

Installation

Global Installation (Recommended)

npm install -g markflow

Local Installation

npm install markflow

Usage

Basic Usage

Simply point markflow to any Markdown file:

markflow README.md

This will:

  1. Start a local server (default port 3000)
  2. Open your browser with the rendered Markdown
  3. Watch for changes and auto-refresh the browser

Custom Port

You can specify a custom port using the --port or -p flag:

markflow README.md --port 8080
# or
markflow README.md -p 8080

Help

Display help information:

markflow --help
# or
markflow -h

How It Works

Markflow uses BrowserSync to create a local development server that:

  1. Serves a single HTML page with your rendered Markdown content
  2. Watches the specified Markdown file for changes
  3. Automatically refreshes the browser when changes are detected
  4. Uses Showdown.js to convert Markdown to HTML
  5. Applies GitHub's markdown CSS for professional styling

Supported Markdown Features

Markflow supports standard Markdown plus these enhanced features:

  • Tables: Create tables using pipes and hyphens
  • Strikethrough: Use ~~text~~ for strikethrough
  • Task Lists: Create checkboxes with - [ ] and - [x]
  • Code Highlighting: Fenced code blocks with language specification
  • Proper List Indentation: Supports 2-space indented sublists

Development

Prerequisites

  • Node.js 14.0 or higher
  • npm or yarn

Setup

  1. Clone the repository:
git clone https://github.com/silijon/markflow.git
cd markflow
  1. Install dependencies:
npm install
  1. Link for local development:
npm link

Project Structure

markflow/
├── app.js           # Main application entry point
├── markflow/        # Static assets directory
│   └── index.html   # HTML template for rendering
├── package.json     # Project configuration
└── README.md        # This file

API

Markflow exposes a simple HTTP endpoint when running:

  • GET /markdown - Returns JSON with the current markdown file content:
    {
      "location": "/absolute/path/to/file.md",
      "text": "# Markdown content..."
    }

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Bug Reports

If you find a bug, please report it at GitHub Issues.

License

ISC License - see the LICENSE file for details.

Author

John Dennis

Links

Changelog

Version 0.0.3

  • Latest stable release

Version 0.0.2

  • Added support for strikethrough and tables
  • Fixed 2-space sublist indentation issue

Version 0.0.1

  • Initial release
  • Basic markdown preview functionality

About

Watches a markdown file for changes and updates those changes to hosted HTML.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published