#!/usr/bin/env python

import os
from abjad.tools import systemtools
from abjad.tools.documentationtools import AbjadAPIGenerator


if __name__ == '__main__':
    from abjad import abjad_configuration

    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(abjad_configuration.abjad_directory_path, 'docs')
    os.chdir(docs_directory)

    # make html docs
    systemtools.IOManager.spawn_subprocess('make html')
