X-Git-Url: https://git.armaanb.net/?a=blobdiff_plain;f=lightcards%2Fparse.py;h=d70c4e977935752853167a775dcc7f8aacb96dc6;hb=23bedf0b57ac06fbee12af000f42c992d3227dd1;hp=d0b0eb5c001e19cf98f64c7aa1c5d8675f7bdeda;hpb=fdb8037c1207d21fd5c233cc771237e20f494ec7;p=lightcards.git diff --git a/lightcards/parse.py b/lightcards/parse.py old mode 100755 new mode 100644 index d0b0eb5..d70c4e9 --- a/lightcards/parse.py +++ b/lightcards/parse.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # Parse markdown table into tuple of lists # Armaan Bhojwani 2021 @@ -12,10 +11,9 @@ from .deck import Card def md2html(file): """Use the markdown module to convert input to HTML""" try: - with open(file, "r", encoding="utf-8") as input_file: - return markdown.markdown(input_file.read(), extensions=['tables']) + return markdown.markdown(open(file, "r").read(), extensions=['tables']) except FileNotFoundError: - print(f"File \"{file}\" not found!") + print(f"lightcards: \"{file}\": No such file or directory") exit(1)