-#!/usr/bin/env python
# Parse markdown table into tuple of lists
# Armaan Bhojwani 2021
def md2html(file):
"""Use the markdown module to convert input to HTML"""
- with open(file, "r", encoding="utf-8") as input_file:
- return markdown.markdown(input_file.read(), extensions=['tables'])
+ try:
+ with open(file, "r", encoding="utf-8") as input_file:
+ return markdown.markdown(input_file.read(), extensions=['tables'])
+ except FileNotFoundError:
+ print(f"lightcards: \"{file}\": No such file or directory")
+ exit(1)
def parse_html(html):