<commit_before># Module:   docs
# Date:     03rd April 2013
# Author:   <NAME>, j dot mills at griffith dot edu dot au

"""Documentation Tasks"""

from fabric.api import lcd, local, task

from .utils import pip, requires


PACKAGE = "src/ccav"


@task()
@requires("sphinx-apidoc")
def api():
    """Generate the API Documentation"""

    if PACKAGE is not None:
        local("sphinx-apidoc -f -T -o docs/source/api {0:s}".format(PACKAGE))


@task()
@requires("make")
def clean():
    """Delete Generated Documentation"""

    with lcd("docs"):
        local("make clean")


@task(default=True)
@requires("make")
def build(**options):
    """Build the Documentation"""

    pip(requirements="docs/requirements.txt")

    with lcd("docs"):
        local("make html")


@task()
@requires("open")
def view(**options):
    """View the Documentation"""

    with lcd("docs"):
        local("open build/html/index.html")<commit_msg>Use webbrowser.open_new_tab() instead of platform dependent open<commit_after># Module:   docs
# Date:     03rd April 2013
# Author:   <NAME>, j dot mills at griffith dot edu dot au

"""Documentation Tasks"""

from fabric.api import lcd, local, task

from .utils import pip, requires


PACKAGE = "src/ccav"


@task()
@requires("sphinx-apidoc")
def api():
    """Generate the API Documentation"""

    if PACKAGE is not None:
        local("sphinx-apidoc -f -T -o docs/source/api {0:s}".format(PACKAGE))


@task()
@requires("make")
def clean():
    """Delete Generated Documentation"""

    with lcd("docs"):
        local("make clean")


@task(default=True)
@requires("make")
def build(**options):
    """Build the Documentation"""

    pip(requirements="docs/requirements.txt")

    with lcd("docs"):
        local("make html")


@task()
def view(**options):
    """View the Documentation"""

    with lcd("docs"):
        import webbrowser
        webbrowser.open_new_tab("build/html/index.html")
{'fraction_non_alphanumeric': 0.1606029106029106, 'fraction_numerical': 0.007276507276507277, 'mean_word_length': 3.6610169491525424, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1149115', 'n_tokens_mistral': 668, 'n_tokens_neox': 618, 'n_words': 177}