Compiles a theme.

def compile_theme(theme_id=None):
    """Compiles a theme."""
    from engineer.processors import convert_less
    from engineer.themes import ThemeManager

    if theme_id is None:
        themes = ThemeManager.themes().values()
    else:
        themes = [ThemeManager.theme(theme_id)]

    with(indent(2)):
        puts(colored.yellow("Compiling %s themes." % len(themes)))

        for theme in themes:
            theme_output_path = (theme.static_root / ('stylesheets/%s_precompiled.css' % theme.id)).normpath()

            puts(colored.cyan("Compiling theme %s to %s" % (theme.id, theme_output_path)))
            with indent(4):
                puts("Compiling...")
                convert_less(theme.static_root / ('stylesheets/%s.less' % theme.id),
                             theme_output_path,
                             minify=True)
                puts(colored.green("Done.", bold=True))