Claw Markdown Preview for Openclaw

A local Markdown preview server enabling real-time document rendering, side-by-side editing, and rich text export to publishing platforms.

webkixi
v0.1.0
Jul 8, 2026
0
3
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install claw-markdown-preview-skill

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install claw-markdown-preview-skill using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Claw Markdown Preview?

Claw Markdown Preview is a developer-centric rendering utility designed for integration with AI coding environments. Instead of manually exporting files or toggling layout viewers, this skill enables your assistant to display formatted Markdown documents directly inside your browser.

Running as a lightweight local Python HTTP service, the interface features 22 layout themes, 9 code-highlighting schemes, and a variety of preview configurations. It provides an integrated double-pane sync editor, local clipboard image pasting, and rich-text copying for publishing workflows.

Claw Markdown Preview Use Cases

  • Immediate Layout Verification: Check rendering quality, tables, lists, and syntax highlights of AI-generated Markdown documents.
  • Direct Rich-Text Copying: Export styled content directly to your clipboard for pasting on platforms like WeChat or blog hosts, converting local images to base64 format automatically.
  • Dual-Pane Interactive Editing: Refine documents collaboratively with a side-by-side sync-scrolling editor.
  • Simplified Local Media Assets: Save clipboard images directly to your local file path and insert standard Markdown image links.

How Claw Markdown Preview Works

  1. Environment & File Validation: The system verifies the existence of the targeted .md file and tests that the local Python server script is present and executable.
  2. Clean up Pre-existing Instances: Active preview processes from previous runs are terminated to prevent network port collision.
  3. Unbuffered Server Launch: The server initiates with unbuffered standard output to capture the assigned port dynamically.
  4. PID State Recording: The active process ID (PID) is identified using a network query and saved locally for process control.
  5. Automated Client Launch: The utility issues an OS-level command to open the preview portal in the user's default browser.

Claw Markdown Preview Setup

To clean up older services and launch the local preview application, execute the following commands:

# 1. Kill prior running processes
PID_FILE="/tmp/claw-markdown-preview.pid"
if [ -f "$PID_FILE" ]; then
  OLD_PID=$(cat "$PID_FILE")
  kill "$OLD_PID" 2>/dev/null || true
  rm -f "$PID_FILE"
fi
pkill -f "preview_server.py" 2>/dev/null || true

# 2. Run preview server in the background
PYTHONUNBUFFERED=1 python3 scripts/preview_server.py --file "<MD_FILE_PATH>" --no-open --heartbeat-timeout 60

# 3. Detect port, record PID, and open browser (Example port: 8765)
PID=$(lsof -iTCP:8765 -sTCP:LISTEN -P -n -t 2>/dev/null | head -1)
echo "$PID" > /tmp/claw-markdown-preview.pid
open "http://127.0.0.1:8765"

Claw Markdown Preview Data Schema & Taxonomy

The preview script manages assets, configurations, and internal states according to the schema below:

Item Type Description
--file File Parameter Target Markdown file to poll, render, and update.
--port Network Property Local port (defaults to 8765, auto-negotiates up to 20 alternate options if occupied).
images/ Directory Storage path for clipboard-pasted files, co-located with the parent Markdown directory.
claw-markdown-preview.pid State Log Temp process file to coordinate starting, killing, and monitoring the server process.

Claw Markdown Preview Advanced Features

  • Auto-Polling Hot Reload: Monitors local files for changes every 3 seconds to keep layouts refreshed during AI-generation steps.
  • Base64 Image Inlining: Transforms local image assets into inline data strings to ensure styling is maintained during clipboard copying.
  • Smart Heartbeat Monitor: Automatically terminates background tasks if browser connections are lost, utilizing a default 60-second threshold for AI agents.
  • CodeMirror Integration: Includes developer-focused markdown text editing within the viewer itself.
  • Extensible Integration Workspace: Coordinates with multi-agent setups to show the utility of Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*