dimanche 29 mars 2015

How to get the rendered HTML from a Rails backed blog when db store column as text, but renders with effects

Preface: I am writing a gem that is designed to take a database-backed blog, such as one ran on Rails, and then proceeds to intake all the given records from the Post model's titles and body text. It then takes this, converts it to markdown, and creates a jekyll project in the current dir for each post and saves them in the appropriate place.


Currently when I get the text it is the raw text put into a DB column. But with effects such as 's, images, etc, what would be the best way to get the html that is actually being rendered, and then convert it to markdown instead of using the db?


I had thought about scraping after being given a route schema but I feel this is suboptimal.


This is a very open ended problem, and I'm open to a myriad of solutions. I just want to cover a few cases first and go in depth after.


Aucun commentaire:

Enregistrer un commentaire