Skip to content
silijonPublic

About

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

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

19 Commits

Folders and files

Repository files navigation

Markflow

A lightweight Markdown preview tool that opens a rendered view of your Markdown file in the browser, with an optional live-updating mode that watches the file and automatically refreshes as you edit.

Features

  • Live Preview: Optionally refreshes browser view when you save changes to your Markdown file (with --watch)
  • 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. Shut down the server and exit once the page has loaded

By default, markflow gives you a one-time snapshot: the browser tab keeps showing what was rendered, but it is no longer connected to the file or the server.

Watch Mode

To keep the browser in sync with the file as you edit it, pass the --watch or -w flag:

markflow README.md --watch
# or
markflow README.md -w

This will:

  1. Start a local server (default port 3000)
  2. Open your browser with the rendered Markdown
  3. Watch the file for changes and auto-refresh the browser
  4. Keep running until you stop it (e.g. with Ctrl+C)

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

This can be combined with --watch:

markflow README.md --watch --port 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. Uses Showdown.js to convert Markdown to HTML
  3. Applies GitHub's markdown CSS for professional styling

By default, the server shuts down shortly after the browser loads the page, so the tab is a static snapshot. When --watch is passed, the server instead stays running, watches the Markdown file for changes, and automatically refreshes the browser when changes are detected.

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

Running Without Installing

You can also run markflow directly from the repo root, without linking or installing it globally:

node app.js README.md

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

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages