Skip to main content

ghmd

ghmd (GitHub Markdown) is an extremely light-weight and simple command line tool to convert GitHub Flavored Markdown (or plain Markdown) to HTML.

It does so by using the GitHub Markdown API in combination with GitHub Markdown CSS.

It has two available implementations:

Installation

# Node.js
npm install -g ghmd-js

or

# Python
pip install ghmd

Usage

Simply run ghmd with the path to the markdown file(s) you want to convert. An HTML file will be created in the same directory as the markdown file with the same filename.

ghmd README.md
# or
ghmd README.md CONTRIBUTING.md

[!NOTE] If you don't have the ghmd command available after installing, you may need to add the Python scripts directory to your PATH environment variable.

Otherwise you, can use python -m ghmd instead of ghmd.

Options

GitHub API Token

By default, ghmd uses unauthenticated requests to the GitHub API, which has a rate limit of 60 requests per hour. To increase this limit to 5000 requests per hour, you can set the GITHUB_TOKEN environment variable with a GitHub personal access token:

export GITHUB_TOKEN=your_github_token_here
ghmd README.md

To create a personal access token, visit your GitHub Settings > Developer Settings > Personal access tokens and create a new token (no specific scopes are required).

--embed-css

By default, ghmd will add the remote CSS as a <link> tag in the HTML file. If you want to embed the CSS directly into the HTML file so that, for example, you can send the HTML file to someone else and they can view it without an internet connection, you can use the --embed-css option.

ghmd README.md --embed-css

--light and --dark

The default CSS styles adapt to the system's dark mode setting of the reader. If you want to force the CSS to be light or dark, you can use the --light or --dark options.

ghmd README.md --light
# or
ghmd README.md --dark

Both --light and --dark can be used in combination with --embed-css.

[!NOTE] Using the --embed-css option will result in a ~25 KB larger HTML file size (~18 KB when using --light or --dark).

--no-gfm

The tool offers two modes: GitHub Flavored Markdown (gfm, default) and plain Markdown. To use the latter, the --no-gfm option can be used:

ghmd README.md --no-gfm

Metadata

Release files for ghmd 1.0.1.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ghmd 1.0.1.post1
File Size Uploaded
ghmd-1.0.1.post1.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ghmd 1.0.1.post1
File Interpreter ABI Platform
ghmd-1.0.1.post1-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / ghmd-1.0.1.post1.tar.gz

Download URL ghmd-1.0.1.post1.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5cb04c94d1f1a09c04c0a5de4d54f33b235ca5b380d74001e0009650f3d6d8be
BLAKE2b-256 checksum
How to use checksums
f00e0e067988d2564a37d24f5f84765539283b904aa1c3285f5aac18cbe57146
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ghmd-1.0.1.post1-py3-none-any.whl

Download URL ghmd-1.0.1.post1-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2643563981d5b6fe0055745dc6cdda9b69a391245ed001f0dfaabb0840b6eeac
BLAKE2b-256 checksum
How to use checksums
59d453c8ce4d80dd2279d23e6a7eb4a3b3aa1a8ec45a27173cfb6232827126f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

1.0.1.post1 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page