Added novelWriter flavour markdown as an export format, and cleaned up windows/unix line endings code

This commit is contained in:
Veronica K. B. Olsen
2019-10-26 22:58:16 +02:00
parent 753b248b9f
commit f38e770402
5 changed files with 126 additions and 41 deletions
+4 -14
View File
@@ -34,16 +34,11 @@ class LaTeXFile(TextFile):
def _doOpenFile(self, filePath):
if self.winEnding:
tN = "\r\n"
else:
tN = "\n"
try:
self.outFile = open(filePath,mode="w+")
self.outFile.write(r"\documentclass[12pt]{report}"+tN+tN)
self.outFile.write(r"\usepackage[utf8]{inputenc}"+tN+tN)
self.outFile.write(r"\begin{document}"+tN+tN)
self.outFile.write(r"\documentclass[12pt]{report}"+self.endLine)
self.outFile.write(r"\usepackage[utf8]{inputenc}"+self.endLine)
self.outFile.write(r"\begin{document}"+self.endLine)
except Exception as e:
self.makeAlert(["Failed to open file.",str(e)], nwAlert.ERROR)
return False
@@ -52,13 +47,8 @@ class LaTeXFile(TextFile):
def _doCloseFile(self):
if self.winEnding:
tN = "\r\n"
else:
tN = "\n"
if self.outFile is not None:
self.outFile.write(r"\end{document}"+tN)
self.outFile.write(r"\end{document}"+self.endLine)
self.outFile.close()
return True