Skip to main content

MD to HTML converter

Project description

Markdown to HTML Converter

This is a converter from Markdown to HTML with advanced support for Markdown tables and GFM syntax highlighting. This package relies on markdown2 for converting basic Markdown to HTML and pygments to support code to HTML conversion for syntax highlighting. The default (and, currently, only) theme for this package is Monokai.

You can find a sample of a site generated from this package at https://mcautograder.cpyles.com.

Installation

The converter is installed using pip:

pip install md2html

Usage

This package an executable that can be run from the command line:

md2html ...

Here is the help entry for this file:

usage: md2html [-h] [-s SITE] [-n NAV] ...

convert Markdown to HTML

positional arguments:
  files                 files to be converted to HTML

optional arguments:
  -h, --help            show this help message and exit
  -s SITE, --site-info SITE
                        add metadata to the HTML files
  -n NAV, --nav NAV     add a YAML file to use for navigation menu

Running the converter will place HTML files in the same directory as your Markdown files, with the .md extension replaced with .html. The HTML files come with CSS in a style tag in the head.

Page Metadata

If you would like to add metadata to your page, including a navigation menu, do so by creating a YAML file containing this metadata and passing the file path to the -s flag, e.g.

md2html -s meta.yml ...

The structure of your YAML file should be:

title: page title
author: page author
description: page description
navigation:
  nav_title: navigation menu title
  links:
    - title: link name
      url: HTML file path
    - title: ...
      url: ...
    ...

Currently, the title must be set if you use this option. The converter does not yet support navigation submenus, so all links will be rendered as

Navigation Menu

The converter also supports adding only a navigation menu without page metadata. To do this, pass a YAML file to the -n flag. It should have the following structure:

nav_title: navigation menu title
links:
  - title: link name
    url: HTML file path
  - title: ...
    url: ...
  ...

Changelog

v1.0:

  • Changed to Boostrap CSS

v0.1:

  • Initial release

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

md2html-1.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

md2html-1.0-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file md2html-1.0.tar.gz.

File metadata

  • Download URL: md2html-1.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for md2html-1.0.tar.gz
Algorithm Hash digest
SHA256 18598fdd04ab057827b07534a29b66d158bdd76a0b1976899e22406d861c323f
MD5 da799dda6c79ea4dc1846db46884b07e
BLAKE2b-256 facc1b3d2766dfa059836a89ba9d02d20190ecb58a7fd47e821bc5e8fb4565d3

See more details on using hashes here.

File details

Details for the file md2html-1.0-py3-none-any.whl.

File metadata

  • Download URL: md2html-1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5

File hashes

Hashes for md2html-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46635fe165da45986950dd2da7bc2f49bea0120d56790e5bd9238a13c3f330c6
MD5 d78d08bea20878c95b50f6fac0db0624
BLAKE2b-256 34cf505ea03287da7446a7a9eab5c887822c007a2f0cd047ca3bafaa6786319c

See more details on using hashes here.

Supported by

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