Skip to content
Permalink
fc3351cd7e
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
49 lines (36 sloc) 1.39 KB
"""
Python script to build a dissertaion based on Markdown / Pandoc
TODO: Options?
"""
import subprocess
# --------------- CHANGE THESE TWO LINES -------------------------
OUTPUT_FILE = "Disso.pdf"
#ENTER ALL THE SOURCE FILES THAT YOU HAVE IN THE DISSERTAION HERE.
SOURCE_FILES = ["Example/Intro.md", "Example/Use.md"]
#Are you using the Submodule Approach
SUBMODULE = True
#Is it the Default Path
SUBMODULE_PATH="markdown_dissertation"
# --------------- END OF STUFF THAT YOU NEED TO CHANGE -------------------------
def buildCommand():
"""Build the list that we send to pandoc"""
STU_HEADER_FILE = "Dissertation.md"
HEADER_FILE = "Header.md"
FOOTER_FILE = "References.md" #Needed otherwise refs come on the same page
PANDOC_OPTS = ["--filter=pandoc-citeproc",
"--template=Template/disso.latex",
"--top-level-division=chapter"]
#Actually Build the list
commandList = ["pandoc"]
commandList.extend(PANDOC_OPTS) #Add the options
commandList.append(STU_HEADER_FILE) #Students Headderfile
commandList.append(HEADER_FILE) #Header File
commandList.extend(SOURCE_FILES) #STUDENT source
commandList.append(FOOTER_FILE) #FOOTER FILE
commandList.append("-o")
commandList.append(OUTPUT_FILE)
print (commandList)
subprocess.run(commandList)
if __name__ == "__main__":
#Build the damm thing
buildCommand()