Skip to main content

Convert Markdown files to index.html

Project description

md2indexhtml

md2indexhtml is a Python package that converts Markdown files to HTML files as index.html.

Features

  • Converts Markdown to HTML
  • Supports custom templates and CSS
  • Automatically generates a sidebar from headers
  • Easy-to-use command line interface

Installation

Install the package using pip:

pip install md2indexhtml

Usage

This document provides instructions on how to use the md2indexhtml package to convert Markdown files to HTML files.

Installation

To install the package, run the following command:

pip install md2indexhtml

Basic Usage

To convert a Markdown file to an HTML file using the default settings, run the following command:

md2indexhtml path/to/yourfile.md

Advanced Usage

You can customize the conversion by providing additional options:

  • output_dir: Directory to save the output HTML file.
  • template: Path to the HTML template.
  • css: Path to a custom CSS file.
  • title: Title for the HTML document and navbar.

Example:

md2indexhtml path/to/yourfile.md path/to/output/dir --template path/to/template.html --css path/to/custom.css --title "My Documentation"

Themes

Default Theme

md2indexhtml README.md output --title "Default Theme"

Default

GoDocs Theme

md2indexhtml README.md output --title "GoDocs Theme" --template godocs.html

GoDocs

DocBox Theme

md2indexhtml README.md output --title "DocBox Theme" --template docbox.html 

GoDocs

Python API

You can also use the package programmatically in your Python code:

from md2indexhtml import convert_md_to_html

convert_md_to_html(
    md_file_path="path/to/yourfile.md",
    output_dir="path/to/output/dir",
    template_path="path/to/template.html",
    custom_css_path="path/to/custom.css",
    title="My Documentation"
)

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue on GitHub.

License

This project is licensed under the MIT License.

Feel free to adjust any of the content to better suit your needs.

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

md2indexhtml-0.1.3.tar.gz (8.5 kB view hashes)

Uploaded Source

Built Distribution

md2indexhtml-0.1.3-py3-none-any.whl (11.5 kB view hashes)

Uploaded Python 3

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