Skip to main content

Make Markdown Documents

Project description

mkmd

Make Markdown Documents in Python.

Features

  • Heading
  • Paragraph
  • Code Block
  • Horizontal Rule
  • Reference
  • Image
  • Unordered List
  • Ordered List

Installation

pip install mkmd

Basic Usage

import mkmd
from mkmd.utils import *

md = mkmd.Markdown()

(md
    .add_heading(f"Hello {bold_and_italic('MKMD')}",)
    
    .add_paragraph(f"""
        This markdown document was generated by using
        {refer('mkmd', '1')}. This is a quick example showing how to
        use it:
    """, wrapped = True)
    
    .add_codeblock("""
        import mkmd
        
        md = mkmd.Markdown()
        md.add_heading("Hello World")
        md.add_paragraph("Lorem ipsum dolor sit amet.")
    """, language = "python")
    
    .add_ordered_list(
        *"So many things are possible!".split()
    )
    
    .add_reference("1", "http://example.org", "Look at this")
    
    .add_image("Linux Mascot",
        "https://mdg.imgix.net/assets/images/tux.png?auto=format&fit=clip&q=40&w=100"
    )
)

if __name__ == "__main__":
    md.save("example_result.md")

Links

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

mkmd-0.0.1.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

mkmd-0.0.1-py3-none-any.whl (5.6 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