summaryrefslogtreecommitdiff
path: root/converters/html_to_md.py
diff options
context:
space:
mode:
Diffstat (limited to 'converters/html_to_md.py')
-rw-r--r--converters/html_to_md.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/converters/html_to_md.py b/converters/html_to_md.py
new file mode 100644
index 0000000..b6aeae0
--- /dev/null
+++ b/converters/html_to_md.py
@@ -0,0 +1,19 @@
+import os
+from os import walk
+import os.path
+from markdownify import markdownify
+
+def convert_html_to_md(HtmlList):
+ for path in HtmlList:
+
+ pathsplit = path.split("/")
+
+ file = open(str(path), "r").read()
+ html = markdownify(file, heading_style="ATX")
+ f = open("output/markdown/" + str(pathsplit[-1]).replace(".html", ".md"), "w")
+ f.write(html)
+ f.close()
+
+
+
+ return "html was converted to markdown (1/3)"