Fourth Year Project
Title : KeyWriter
Student number : C15355361
Student name : Ciara Sastre
Supervisor : Paul Doyle
How To Run:
To run this application, Click the start.bat file to get the server running locally
Then go onto http://127.0.0.1:5000/ to see the application.
Files:
There are Four Folders:
-> JSON = Contains all JSON files created by my program
-> Static/Styles = Contains all CSS and JS files I created
-> Static/Styles/latex = Contains all LaTeX and PDF generated files
-> Templates = Contains all HTML files I created
-> LaTeXFiles = Contains all LaTeX and Tex Files generated from program. WARNING THESE ARE OLD AND UNUSED NOW
The proto1.py is the main python file I developed that runs this program.
Classes:
Proto1.py
def done(): This class is run by the proto1.py python file. It manages book editing by opening a JSON file
Re-writing in it, and closing it. This saves the new JSON file and the users book is updated.
def book(): This class is run by the proto1.py python file. It manages the create a book section of the program.
It will create a JSON file and store the users input in it.
def latex(): This class is run by the proto1.py python file. It manages converting the JSON to LaTeX. It opens the JSON file
stores the information into variables. These variables are put through a series of LaTeX rules for example :
book.preamble.append(Command('title', title_name))
This takes the title name the user input, into the title of the LaTeX PDF book. As well as the images.
This code also generates a PDf and Tex file.
@app.route("/")
def hello(): This along with the other classes are just rendering the HTML templates. Using return render_template("webpageproto1.html")
def test(): This is a test to open the JSON file and render it on a server so the front end can access it using XMLHTTP Requests.
KWProfile.js
function apply(): This calls a XMLHTTP request to the JSON file that is run on def test() above. It parses this data and stores
it in variables.
function fillData(): This uses those variables to fill the HTML page with the data.
function save(): This is activated when the user pushes th Save button. Any text that was modified in the text editor is now
modified in the JSON file.
Scripts:
The Start Bat file is a batch file that quickly runs Flask. I also wrote this, it writes a series of commands in the commandline
such as setting the environment and debug mode.