#!/usr/bin/env python

import os
from abjad.tools import iotools
from abjad.cfg.cfg import ABJADPATH
from abjad.tools.documentationtools import AbjadAPIGenerator


if __name__ == '__main__':
    AbjadAPIGenerator()(verbose=True)

    # print greeting
    print 'Now building the HTML docs ...'
    print ''

    # change to docs directory because makefile lives there
    docs_directory = os.path.join(ABJADPATH, 'docs')
    os.chdir(docs_directory)

    # make html docs
    iotools.spawn_subprocess('make html')
