diff options
| author | Aarontheissueguy | 2021-02-20 20:03:09 +0100 |
|---|---|---|
| committer | GitHub | 2021-02-20 20:03:09 +0100 |
| commit | ebfeb5d51e5e31195053b8ed714762ae6b0d2060 (patch) | |
| tree | e4bf1a7a59b5e2d7ca5d65abbcd0683d3e0b608a /converters/html_to_md.py | |
Initial commit
Diffstat (limited to 'converters/html_to_md.py')
| -rw-r--r-- | converters/html_to_md.py | 19 |
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)" |
