Skip to content
blasterbug edited this page Dec 19, 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

Author: Benjamin Sientzoff
Version: 0.1.2b
License: GNU GPL V2

Functions

fmt_doc(doc, indent=)

Format a doc-string.

insp_class(class_name, class_inst)

Inspect class and return doc, methods.

insp_file(file_name)

Inspect a file and return module information

insp_method(method_name, method_inst)

Inspect a method and return arguments, doc.

insp_mod(mod_name, mod_inst)

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

remove_extension(fl)

Remove extention from the program file name

to_markdown(text_block)

Markdownify an inspect file
:param text_block: inspect file to turn to Markdown
:return: Markdown doc into a string

Clone this wiki locally