added directive support and optional parsing.

Updated docs as well