New refreshed blog for 2024 using Zola

This commit is contained in:
Salar Rahmanian 2024-02-10 18:04:44 -08:00
parent a23dd16b89
commit 46c2405d9e
125 changed files with 1356 additions and 1337 deletions

View file

@ -0,0 +1,31 @@
+++
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](https://pypi.org/project/markdownify/).
I used Nix Shell to install it:
```bash
nix-shell -p python311Packages.markdownify
```
And to do the conversion I just did:
```bash
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.