softinio.com/content/til/converting-html-to-markdown-using-markdownify.md
Salar Rahmanian b10e834407
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/pr/woodpecker Pipeline was successful
New refreshed blog for 2024 using Zola
2024-02-16 22:46:42 -08:00

728 B

+++ title = "Converting HTML to Markdown using Markdownify" date = 2023-12-26

[taxonomies] tags = ["markdown"] categories = [ "TIL" ]

[extra] toc = true keywords = ["markdown", "html", "convert", "python", "nix"] +++

I had some HTML content that I wanted to convert to markdown.

The simplest tool I found to do this effectively was a python utility called Markdownify.

I used Nix Shell to install it:

nix-shell -p python311Packages.markdownify

And to do the conversion I just did:

markdownify myfile.html > myfile.md

where myfile.html is the name of the file I wanted to convert and myfile.md in the name of the markdown file it got converted to.