]> git.armaanb.net Git - lightcards.git/blobdiff - lightcards/parse.py
Add ability to star cards
[lightcards.git] / lightcards / parse.py
index 457da136f4b30b503f3350dfdcf3f9dd7d58150c..6f3c25f6baf0d40b75fbdcfcf6ecbe4e850fae98 100755 (executable)
@@ -6,6 +6,8 @@ import sys
 from bs4 import BeautifulSoup
 import markdown
 
+from .deck import Card
+
 
 def md2html(file):
     with open(file, "r", encoding="utf-8") as input_file:
@@ -26,7 +28,7 @@ def parse_html(html):
     outp = []
 
     for x in soup.find_all("tr"):
-        outp.append([clean_text(y) for y in x.find_all("td")])
+        outp.append(Card([clean_text(y) for y in x.find_all("td")]))
 
     return ([clean_text(x) for x in soup.find_all("th")],
             clean_list(outp))