# Path: twip/constant.py
# DOCS_PATH = os.path.abspath(os.path.join(BASE_PATH, '..', 'docs'))


import os
import subprocess
from traceback import print_exc
from pug.nlp.util import mkdir_p
from twip.constant import DOCS_PATH
    output = subprocess.check_output(cmd.split())

    markdown_file = "{}/{}.md".format(POSTS_PATH, args.presentation)
    html_file = "{}/{}.html".format(DOCS_PATH, args.presentation)

    cmd = """pandoc -t revealjs --mathjax --template={}/pandoc-template-for-revealjs.html -V theme=moon -s "$MARKDOWN" -o "$HTML" """.format(
        SLIDES_PATH, markdown_file, html_file)
    output = subprocess.check_output(cmd.split())
    cmd = r'''sed -i -e 's/src\=\"\/images/src="\/talks\/images/g' ''' + '"{}"'.format(html_file)


def update_git_repo():
    """Because GitPython sucks (cmd.commit() hangs)

    # pip install GitPython
    # import git
    # repo = git.Repo('.')
    # g = git.cmd.Git('.')
    # g.pull()
    # g.push()
    # g.commit()

    """
    today
    commands = """
        git add docs/*.html
        git add docs/images/
        git add docs*.ipynb
        git commit -am "autocommit new docs build {}"
        git push hobson

# Path: twip/constant.py
# DOCS_PATH = os.path.abspath(os.path.join(BASE_PATH, '..', 'docs'))


# Path: twip/wip/build_pycon_slides.py
import os
import subprocess
from traceback import print_exc
from pug.nlp.util import mkdir_p
from twip.constant import DOCS_PATH

    output = subprocess.check_output(cmd.split())

    markdown_file = "{}/{}.md".format(POSTS_PATH, args.presentation)
    html_file = "{}/{}.html".format(DOCS_PATH, args.presentation)

    cmd = """pandoc -t revealjs --mathjax --template={}/pandoc-template-for-revealjs.html -V theme=moon -s "$MARKDOWN" -o "$HTML" """.format(
        SLIDES_PATH, markdown_file, html_file)
    output = subprocess.check_output(cmd.split())
    cmd = r'''sed -i -e 's/src\=\"\/images/src="\/talks\/images/g' ''' + '"{}"'.format(html_file)


def update_git_repo():
    """Because GitPython sucks (cmd.commit() hangs)

    # pip install GitPython
    # import git
    # repo = git.Repo('.')
    # g = git.cmd.Git('.')
    # g.pull()
    # g.push()
    # g.commit()

    """
    today
    commands = """
        git add docs/*.html
        git add docs/images/
        git add docs*.ipynb
        git commit -am "autocommit new docs build {}"
        git push hobson

        git push origin