dimanche 16 mai 2021

Convert web page to markdown

Just wanted to share this.

I used to have a lot of notes on the classic Google site. Whenever something interesting pops up, I will just copy and paste it into the Google site. It worked quite well until recently Google decided to shut down this service and replace it with their new site template, which misses many handy features such as sub-page listing, attachments, etc. So I decided to migrate all the notes into the markdown format and serve it on my own server.

After some study I found a few nice libraries that can help with the conversion. One is a nodejs library called mercury-parser, the other is a python CLI called reader.

After a bit of tweaking, I ended up creating a small web site: Web2Markdown converter. With this site you just need to copy and past the URL. It will give you nice markdown and you can continue to tweak it until it looks perfect.

Hope this helps. 🎉




Aucun commentaire:

Enregistrer un commentaire