Skip to main content

A fork. A command line tool for automatically generating .md files from click's CLI command.

Project description

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.

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

md_click_2-0.0.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

md_click_2-0.0.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file md_click_2-0.0.1.tar.gz.

File metadata

  • Download URL: md_click_2-0.0.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for md_click_2-0.0.1.tar.gz
Algorithm Hash digest
SHA256 86fbd426dd5d650365cd37ec427a57f52f1da2402c96fd0ada25374a7fbccbf3
MD5 a842b1ca41adf3bb84d517326c3ffe67
BLAKE2b-256 c04d1b78b8e842df825e38385d109b6e22082ae2bfe74528481f01930d481672

See more details on using hashes here.

File details

Details for the file md_click_2-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: md_click_2-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for md_click_2-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f1e34044f4953188f0a2566dcb948069c346eb331f5fd7fa4c81a051d2ef33c1
MD5 66e265c3b3514db2e7badc4fe11e3438
BLAKE2b-256 c91fb19f188261065be1c9b40877e65966f4054568d3a13abe2d4171d7e84e68

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