# Path: academicmarkdown/build.py
# def HTML(src, target=None, standalone=True):
# def MD(src, target=None):
# def PDF(src, target, lineNumbers=False, args=''):
# def ODT(src, target):
# def DOC(src, target):
# def DOCX(src, target):
# def setStyle(style):


from academicmarkdown import build
from subprocess import check_output, call
import os
import shlex

	Arguments:
	src		--	The source Markdown document.

	Keyword arguments:
	msg		--	A commit message. (default=u'snapshot')
	"""

	cmd = [u'git', u'commit', u'-am', msg]
	print(u'Committing (msg: %s)' % msg)
	call(cmd)
	cmd = [u'git', u'log', u'--pretty=format:[%cd #%h] %s', u'--date=iso', \
		u'-1']
	tag = check_output(cmd).decode()
	folder = os.path.join(exportFolder, tag)
	print(u'Exporting to %s' % folder)
	if os.path.exists(folder):
		raise Exception( \
			u'Folder %s already exists! There is probably nothing new to export.' \
			% folder)
	os.mkdir(folder)
	if u'pdf' in exportFormats:
		build.PDF(src, os.path.join(folder, u'export.pdf'), **pdfArgs)
	if u'doc' in exportFormats:
		build.DOC(src, os.path.join(folder, u'export.doc'))
	if u'docx' in exportFormats:
		build.DOCX(src, os.path.join(folder, u'export.docx'))
	if u'odt' in exportFormats:
		build.ODT(src, os.path.join(folder, u'export.odt'))
	if u'html' in exportFormats:

# Path: academicmarkdown/build.py
# def HTML(src, target=None, standalone=True):
# def MD(src, target=None):
# def PDF(src, target, lineNumbers=False, args=''):
# def ODT(src, target):
# def DOC(src, target):
# def DOCX(src, target):
# def setStyle(style):


# Path: academicmarkdown/git.py
from academicmarkdown import build
from subprocess import check_output, call
import os
import shlex


	Arguments:
	src		--	The source Markdown document.

	Keyword arguments:
	msg		--	A commit message. (default=u'snapshot')
	"""

	cmd = [u'git', u'commit', u'-am', msg]
	print(u'Committing (msg: %s)' % msg)
	call(cmd)
	cmd = [u'git', u'log', u'--pretty=format:[%cd #%h] %s', u'--date=iso', \
		u'-1']
	tag = check_output(cmd).decode()
	folder = os.path.join(exportFolder, tag)
	print(u'Exporting to %s' % folder)
	if os.path.exists(folder):
		raise Exception( \
			u'Folder %s already exists! There is probably nothing new to export.' \
			% folder)
	os.mkdir(folder)
	if u'pdf' in exportFormats:
		build.PDF(src, os.path.join(folder, u'export.pdf'), **pdfArgs)
	if u'doc' in exportFormats:
		build.DOC(src, os.path.join(folder, u'export.doc'))
	if u'docx' in exportFormats:
		build.DOCX(src, os.path.join(folder, u'export.docx'))
	if u'odt' in exportFormats:
		build.ODT(src, os.path.join(folder, u'export.odt'))
	if u'html' in exportFormats:

		build.HTML(src, os.path.join(folder, u'export.html'))