Skip to main content

A simple CLI to convert markdown files to HTML using GitHub API using the GitHub Markdown style.

Project description

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.

Installation

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

--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 later, the --no-gfm option can be used:

ghmd README.md --no-gfm

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ghmd-0.2.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

ghmd-0.2.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file ghmd-0.2.0.tar.gz.

File metadata

  • Download URL: ghmd-0.2.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.0

File hashes

Hashes for ghmd-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4c5b179036c17c466f14b5772b1d7ab037d41f462a2615d018b728d2cf71ffbb
MD5 89ccce30bdcb64cdb24d7f9141177b8d
BLAKE2b-256 cadeb2a396f9618c8636ae7e7682acea3737fc4a264cc69e65503157adb9aa3a

See more details on using hashes here.

File details

Details for the file ghmd-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ghmd-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.0

File hashes

Hashes for ghmd-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7e9aa9b3a0f3b1bc7d51516b7bf65c5dd4f9025cc1e4956665079c729f8a530
MD5 03bcd18e7fb8c1b6931a4a9619707043
BLAKE2b-256 09b63d2b5d9c7088ea4150abb8786ccee358d5eeb8fcf1549b4fcbbc2d9a385b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page