Skip to content
blasterbug edited this page Nov 22, 2015 · 3 revisions

doc2md

doc2md.py generates Python documentation in the Markdown (md) format. It was written to automatically generate documentation that can be put on Github or Bitbucket wiki pages. It is initially based on Ferry Boender's pydocmd.

It is as of yet not very complete and is more of a Proof-of-concept than a fully-fledged tool. Markdown is also a very restricted format and every implementation works subtly, or completely, different. This means output may be different on different converters.

Usage

$ python doc2md.py module [...]

doc2md.py scans every python file (.py) given and generates the documentation in a subfolder doc.

Example output

Functions

def fmt_doc(doc, indent=)

Format a doc-string.

def insp_class(class_name, class_inst)

Inspect class and return doc, methods.

def insp_file(file_name)

Inspect a file and return module information

def insp_method(method_name, method_inst)

Inspect a method and return arguments, doc.

def insp_mod(mod_name, mod_inst)

Inspect a module return doc, vars, functions and classes.

def remove_extension(fl)

No documentation for this function

def to_markdown(text_block)

Markdownify an inspect file

Clone this wiki locally