Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
""" | ||
Python script to build a dissertaion based on Markdown / Pandoc | ||
TODO: Options? | ||
""" | ||
|
||
import subprocess | ||
|
||
|
||
# --------------- CHANGE THESE TWO LINES ------------------------- | ||
OUTPUT_FILE = "testing.pdf" | ||
|
||
#ENTER ALL THE SOURCE FILES THAT YOU HAVE IN THE DISSERTAION HERE. | ||
SOURCE_FILES = ["EG-Intro.md"] | ||
# --------------- END OF STUFF THAT YOU NEED TO CHANGE ------------------------- | ||
|
||
|
||
|
||
|
||
|
||
def buildCommand(): | ||
"""Build the list that we send to pandoc""" | ||
HEADER_FILE = "Dissertation.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(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() | ||
# subprocess.run(["pandoc", HEADER_FILE, "EG-Intro.md", FOOTER_FILE, "-o", OUTPUT_FILE]) |