pymdgen

Functions


adjust_header_indent

def adjust_header_indent(line, section_level)

Parses a line for a markdown header and fixes the indent for the specified section level

eg. '## Header' with section_level=1 will become '# Header"

Arguments:

  • line(str)
  • section_level(int)

Returns:

  • str

doc_attribute

def doc_attribute(name, attribute)

return markdown formatted documentation for a class attribute

This is an experimental feature that will document any attribute set on class as long as the attribute it self has help property

Argument(s):

  • name(str)
  • attribute(function|class|instance)

Returns:

  • list

doc_class

def doc_class(name, cls, section_level=3)

return markdown formatted documentation for a class

Arguments

  • name(str): function name #FIXME: why is this manual?
  • cls(class)
  • section_level(int): markdown section level

doc_func

def doc_func(name, func, section_level=4)

return markdown formatted documentation for a function

Arguments:

  • name(str): function name #FIXME: why is this manual?
  • func(function)
  • section_level(int): markdown section level

doc_module

def doc_module(name, debug=False, section_level=3)

return markdown formatted documentation for a module

Arguments:

  • name(str): module name
  • debug(bool): log debug messages
  • section_level(int): markdown section level

doc_property

def doc_property(name, prop)

return markdown formatted documentation for a class property

Argument(s):

  • name(str)
  • prop(property)

Returns:

  • list

getargspec

def getargspec(func)

Wrapper for inspect.getargspec that supports decorated functions


parse_class_docstr

def parse_class_docstr(docstr, list_class_attributes, section_level)

Takes a class doc string markdown and parses it line for line to fix and header indent issues as well as collect instanced attribute docs

Arguments

  • docstr(str): markdown formatted class docstr
  • list_class_attributes(list): collect instance attribute docs into this list
  • section_level(int): header indent level

Returns:

  • list: parsed/fixed output split into lines