Skip to main content

MD Click

MD-Click is a command line tool for creating .md files for any python's click CLI projects.

The Problem

After creating new CLI project using click, we couldn't found out any tool that generates automatic .md files documentation per each command. This is the reason we've create this quick and easy tool.

The Solution

MD-Click creates .md files per each command exists under the click project CLI. The tool runs recursively and generates a markdown file per each command, and sub commands.

Installation

Just install it using pip:

> pip install md-click

Usage

Create md files per each command, in format of parent-command, under the --docsPath directory.

for example, we have the next click python module:

# app/cli.py
import click

@click.group('namer')
@click.option('--debug', help='Should I run on Debug?', is_flag=True)
def main(**kwargs):
  """ A namer CLI """
  debug = kwargs.get('debug')
  if debug:
    click.secho('is Debug? True', color='green')

@main.command('full')
@click.option('--name', help='The user name', required=True, type=str)
@click.option('--lastName', help='The last Name', required=False, type=str)
def full_name(**kwargs):
    """ A CLI that gets name and last name and returns the full name"""
    firstname = kwargs.get('name')
    lastname = kwargs.get('lastname')

    click.secho(f'The full name is: {firstname} {lastname}', color='yellow')

and we want to create a nice md files per each command, we'll run the next cli command:

> mdclick dumps --baseModule=app.cli --baseCommand=main --docPath=./docs/commands

The output:

./docs/commands/namer.md
./docs/commands/namer-full.md

As you can assume, all of the markdown files under docs/commands in this repository, generated automatically by mdclick command. Use them as a reference.

Metadata

Release files for md-click 1.0.1

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

Source distribution (sdist)

Source distribution for md-click 1.0.1
File Size Uploaded
md-click-1.0.1.tar.gz 4.8 kB Details

Built distribution (wheel)

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

Total release size: 11.6 kB

Release files / md-click-1.0.1.tar.gz

Download URL md-click-1.0.1.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2725103ca2bcd2e114454c3d5e561205725107702be1d8f26453705c45ebf65e
BLAKE2b-256 checksum
How to use checksums
6d895a9b36bb0bc2eee482450d373433a4f1e6fca440c73b7ecbcdc2df155d93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.2

Release files / md_click-1.0.1-py3-none-any.whl

Download URL md_click-1.0.1-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b42d4d4c7d12acf2848e27ef16df4149a57b7146550d83c4b100d309b2e86359
BLAKE2b-256 checksum
How to use checksums
510fc91e257b608628e1dbd51e62a3bae53b3daf960af5b52bc881d9c81c6179
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0

3 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