import os.path, gitpath #pip install git+'https://github.com/ruxi/python-gitpath.git'
os.chdir(gitpath.root()) # changes path to .git root
#os.getcwd() #check current work directory

"""
Explanation: Required:
End of explanation
"""


from IPython.display import IFrame
url = 'http://jekyllrb.com/docs/structure/'
IFrame(url, width=300, height=400)


"""
Explanation: Install Jekyll
by Ruxi
Feb 8, 2016
What is Jekyll? Its a static templating library enables blogging on github pages
It follows this directory structure
End of explanation
"""


# write files to .gitignore if not exist
with open('.gitignore', 'r+') as f:
    ignorelist = ['_sites']
    for path in ignorelist:
        if path in f.read():
            print('Found:\t"{}"\tmoving to next'.format(path))
        else:
            print('Not found:\t"{}"\twriting to file'.format(path))
            f.writelines("{}\n".format(path))

!cat .gitignore

"""
Explanation: Instructions
http://michaelchelen.net/81fa/install-jekyll-2-ubuntu-14-04/

sudo apt-get install ruby ruby-dev make gcc nodejs

(1) .gitignore __sites
End of explanation
"""


%%writefile _config.yml
name: Ruxi
markdown:

Apprently karmdown is the only flavor of 

"""
Explanation: (2) _config.yml
End of explanation
"""


py_commit_msg = """
write code cell to add file to .gitignore if not found
"""

%%bash -s "$py_commit_msg"
echo $1
git add --all :/
git commit -a -m "$1" #message from py_commit_msg
git push origin master

"""
Explanation: Version control
Saving
End of explanation
"""


